Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c6b0c0e07 | ||
|
|
ec9626503c |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "claudemesh-cli",
|
"name": "claudemesh-cli",
|
||||||
"version": "0.5.1",
|
"version": "0.5.2",
|
||||||
"description": "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
"description": "Claude Code MCP client for claudemesh — peer mesh messaging between Claude sessions.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"claude-code",
|
"claude-code",
|
||||||
|
|||||||
@@ -722,19 +722,20 @@ Your message mode is "${messageMode}".
|
|||||||
// any mesh's broker connection becomes a <channel source="claudemesh">
|
// any mesh's broker connection becomes a <channel source="claudemesh">
|
||||||
// system reminder injected into Claude Code's context.
|
// system reminder injected into Claude Code's context.
|
||||||
for (const client of allClients()) {
|
for (const client of allClients()) {
|
||||||
client.onPush(async (msg) => {
|
// Poll-based push: drain pushBuffer every 1s and emit channel notifications.
|
||||||
// In "off" mode, silently skip notification — messages are still
|
// This is the proven approach from claude-intercom. The WS onPush handler
|
||||||
// buffered in pushBuffer and accessible via check_messages.
|
// fires instantly but server.notification() may not flush stdio reliably
|
||||||
if (messageMode === "off") return;
|
// from an async WS callback. Polling on a timer ensures consistent delivery.
|
||||||
|
if (messageMode !== "off") {
|
||||||
|
const pushPollTimer = setInterval(async () => {
|
||||||
|
const buffered = client.drainPushBuffer();
|
||||||
|
for (const msg of buffered) {
|
||||||
const fromPubkey = msg.senderPubkey || "";
|
const fromPubkey = msg.senderPubkey || "";
|
||||||
// Resolve sender's display name from the cached peer list.
|
|
||||||
const fromName = fromPubkey
|
const fromName = fromPubkey
|
||||||
? await resolvePeerName(client, fromPubkey)
|
? await resolvePeerName(client, fromPubkey)
|
||||||
: "unknown";
|
: "unknown";
|
||||||
|
|
||||||
if (messageMode === "inbox") {
|
if (messageMode === "inbox") {
|
||||||
// Count-only notification, no content
|
|
||||||
try {
|
try {
|
||||||
await server.notification({
|
await server.notification({
|
||||||
method: "notifications/claude/channel",
|
method: "notifications/claude/channel",
|
||||||
@@ -744,10 +745,10 @@ Your message mode is "${messageMode}".
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch { /* best effort */ }
|
} catch { /* best effort */ }
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// push mode — full content notification
|
// push mode — full content
|
||||||
const content = msg.plaintext ?? decryptFailedWarning(fromPubkey);
|
const content = msg.plaintext ?? decryptFailedWarning(fromPubkey);
|
||||||
try {
|
try {
|
||||||
await server.notification({
|
await server.notification({
|
||||||
@@ -766,10 +767,11 @@ Your message mode is "${messageMode}".
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch {
|
} catch { /* best effort */ }
|
||||||
/* channel push is best-effort; check_messages is the fallback */
|
}
|
||||||
|
}, 1_000);
|
||||||
|
pushPollTimer.unref();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
client.onStreamData(async (evt) => {
|
client.onStreamData(async (evt) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import { RootPage, generatePageMetadata } from "@payloadcms/next/views";
|
|||||||
import { importMap } from "../importMap";
|
import { importMap } from "../importMap";
|
||||||
import config from "@payload-config";
|
import config from "@payload-config";
|
||||||
|
|
||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
type Args = { params: Promise<{ segments: string[] }> };
|
type Args = { params: Promise<{ segments: string[] }> };
|
||||||
|
|
||||||
export const generateMetadata = ({ params }: Args) =>
|
export const generateMetadata = ({ params }: Args) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user