feat(cli): 1.27.0 — state/memory through daemon + workspace alias

extend the daemon thin-client surface to two more verb families: state
get/set/list now routes through `/v1/state`, and remember/recall/forget
through `/v1/memory`. same warm-path pattern as 1.25.0 — try the unix
socket first, fall back to the cold ws path when the daemon is absent.
multi-mesh aware (aggregates on read, requires `--mesh` for writes
when ambiguous).

also ships an early `claudemesh workspace <verb>` alias surface — bare
teaser for the 1.28.0 mesh→workspace public rename. no-arg falls
through to launch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-05-04 09:41:18 +01:00
parent cb90f1ca60
commit 3753a6e137
10 changed files with 523 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
import { withMesh } from "./connect.js";
import { tryRememberViaDaemon } from "~/services/bridge/daemon-route.js";
import { render } from "~/ui/render.js";
import { dim } from "~/ui/styles.js";
import { EXIT } from "~/constants/exit-codes.js";
@@ -12,6 +13,18 @@ export async function remember(
return EXIT.INVALID_ARGS;
}
const tags = opts.tags?.split(",").map((t) => t.trim()).filter(Boolean);
// Daemon path first.
const daemonRes = await tryRememberViaDaemon(content, tags, opts.mesh);
if (daemonRes) {
if (opts.json) {
console.log(JSON.stringify({ id: daemonRes.id, content, tags, mesh: daemonRes.mesh }));
return EXIT.SUCCESS;
}
render.ok("remembered", dim(daemonRes.id.slice(0, 8)));
return EXIT.SUCCESS;
}
return await withMesh({ meshSlug: opts.mesh ?? null }, async (client) => {
const id = await client.remember(content, tags);