CLI becomes the API; MCP becomes a tool-less push-pipe. Bundle -42% (250 KB → 146 KB) after stripping ~1700 lines of dead tool handlers. - Tool-less MCP: tools/list returns []. Inbound peer messages still arrive as experimental.claude/channel notifications mid-turn. - Resource-noun-verb CLI: peer list, message send, memory recall, etc. Legacy flat verbs (peers, send, remember) remain as aliases. - Bundled claudemesh skill auto-installed by `claudemesh install` — sole CLI-discoverability surface for Claude. - Unix-socket bridge: CLI invocations dial the push-pipe's warm WS (~220 ms warm vs ~600 ms cold). - --mesh <slug> flag: connect a session to multiple meshes. - Policy engine: every broker-touching verb runs through a YAML gate at ~/.claudemesh/policy.yaml (auto-created). Destructive verbs prompt; non-TTY auto-denies. Audit log at ~/.claudemesh/audit.log. - --approval-mode plan|read-only|write|yolo + --policy <path>. Spec: .artifacts/specs/2026-05-02-architecture-north-star.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { withMesh } from "./connect.js";
|
|
import { render } from "~/ui/render.js";
|
|
import { bold, clay, dim } from "~/ui/styles.js";
|
|
import { EXIT } from "~/constants/exit-codes.js";
|
|
|
|
export async function recall(
|
|
query: string,
|
|
opts: { mesh?: string; json?: boolean } = {},
|
|
): Promise<number> {
|
|
if (!query) {
|
|
render.err("Usage: claudemesh recall <query>");
|
|
return EXIT.INVALID_ARGS;
|
|
}
|
|
return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
|
|
const memories = await client.recall(query);
|
|
|
|
if (opts.json) {
|
|
console.log(JSON.stringify(memories, null, 2));
|
|
return EXIT.SUCCESS;
|
|
}
|
|
|
|
if (memories.length === 0) {
|
|
render.info(dim("no memories found."));
|
|
return EXIT.SUCCESS;
|
|
}
|
|
|
|
render.section(`memories (${memories.length})`);
|
|
for (const m of memories) {
|
|
const tags = m.tags.length ? dim(` [${m.tags.map((t) => clay(t)).join(dim(", "))}]`) : "";
|
|
process.stdout.write(` ${bold(m.id.slice(0, 8))}${tags}\n`);
|
|
process.stdout.write(` ${m.content}\n`);
|
|
process.stdout.write(` ${dim(m.rememberedBy + " · " + new Date(m.rememberedAt).toLocaleString())}\n\n`);
|
|
}
|
|
return EXIT.SUCCESS;
|
|
});
|
|
}
|