@meshpoint/cli 1.7.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agents-md.js CHANGED
@@ -8,6 +8,9 @@ import { isExpired } from "@meshpoint/sdk";
8
8
  export const AGENTS_FILE = "AGENTS.md";
9
9
  export const BLOCK_START = "<!-- meshpoint:conventions start -->";
10
10
  export const BLOCK_END = "<!-- meshpoint:conventions end -->";
11
+ // The session-start context for a job that has no hook (CI, cloud agents): written per checkout, not committed.
12
+ export const CONTEXT_START = "<!-- meshpoint:context start -->";
13
+ export const CONTEXT_END = "<!-- meshpoint:context end -->";
11
14
  const ID_TAG = /<!--\s*mp:([A-Za-z0-9_-]{8,})\s*-->/g;
12
15
  const CLAUDE_IMPORT = /^@(?:\.\/)?AGENTS\.md\s*$/m;
13
16
  // Harnesses that read AGENTS.md at the repository root on their own. Claude Code reads CLAUDE.md
@@ -35,13 +38,13 @@ export function renderBlock(items) {
35
38
  return lines.join("\n");
36
39
  }
37
40
  // Replaces the block in place, appends it to a file without one, or starts a new file.
38
- export function applyBlock(existing, block) {
41
+ export function applyBlock(existing, block, markers = [BLOCK_START, BLOCK_END]) {
39
42
  if (existing === null)
40
43
  return `# Agent instructions\n\n${block}\n`;
41
- const start = existing.indexOf(BLOCK_START);
42
- const end = existing.indexOf(BLOCK_END, start);
44
+ const start = existing.indexOf(markers[0]);
45
+ const end = existing.indexOf(markers[1], start);
43
46
  if (start >= 0 && end > start)
44
- return `${existing.slice(0, start)}${block}${existing.slice(end + BLOCK_END.length)}`;
47
+ return `${existing.slice(0, start)}${block}${existing.slice(end + markers[1].length)}`;
45
48
  const head = existing.replace(/\s+$/, "");
46
49
  return `${head ? `${head}\n\n` : ""}${block}\n`;
47
50
  }
@@ -59,6 +62,18 @@ export function exportConventions(items, root, opts = {}) {
59
62
  writeFileSync(abs, next);
60
63
  return { file: rel, created: existing === null, changed, count: conventions.length };
61
64
  }
65
+ // The inject text as a block for a checkout without hooks. Replaces an earlier block, leaves the
66
+ // conventions block alone, and answers whether the file changed.
67
+ export function writeContext(text, root, file = AGENTS_FILE) {
68
+ const abs = path.join(root, file);
69
+ const existing = read(abs);
70
+ const body = text.trim() || "No team knowledge for this branch yet.";
71
+ const next = applyBlock(existing, `${CONTEXT_START}\n${body}\n${CONTEXT_END}`, [CONTEXT_START, CONTEXT_END]);
72
+ const changed = next !== existing;
73
+ if (changed)
74
+ writeFileSync(abs, next);
75
+ return { file, created: existing === null, changed };
76
+ }
62
77
  export function hasBlock(root, file = AGENTS_FILE) {
63
78
  const text = read(path.join(root, file));
64
79
  return text !== null && text.includes(BLOCK_START) && text.includes(BLOCK_END);
package/dist/bin.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { randomUUID } from "node:crypto";
2
3
  import { readFileSync } from "node:fs";
3
4
  import path from "node:path";
4
5
  import { fileURLToPath } from "node:url";
@@ -17,7 +18,7 @@ import { connectPi } from "./pi/connect.js";
17
18
  import { Checkpoints } from "./checkpoints.js";
18
19
  import { configPath, deleteConfig, loadConfig, repoContext, saveConfig, spoolDir, stateDir } from "./config.js";
19
20
  import { SessionCache } from "./context.js";
20
- import { localChecks } from "./tap.js";
21
+ import { localChecks, Tap } from "./tap.js";
21
22
  import { Touched } from "./touched.js";
22
23
  import { MeshpointError } from "@meshpoint/sdk";
23
24
  import { api, ApiError, canOpenBrowser, deviceLogin, freshConfig, login } from "./control.js";
@@ -26,7 +27,10 @@ import { renderDoctor, runDoctor } from "./doctor.js";
26
27
  import { branchItems, confirmItems, parseItemArgs, parseItems, putItems, retractItems } from "./items.js";
27
28
  import { importOffer } from "./import/offer.js";
28
29
  import { applyProposalFile, DEFAULT_SINCE_DAYS, importSessions } from "./import/run.js";
29
- import { AGENTS_FILE, exportConventions, hasBlock } from "./agents-md.js";
30
+ import { AGENTS_FILE, exportConventions, hasBlock, writeContext } from "./agents-md.js";
31
+ import { connectMcp } from "./mcp/connect.js";
32
+ import { McpServer } from "./mcp/server.js";
33
+ import { MCP_INSTRUCTIONS, MCP_SERVER_NAME, meshpointTools } from "./mcp/tools.js";
30
34
  import { detectRunner } from "./import/runner.js";
31
35
  import { Spool } from "./spool.js";
32
36
  const IMPORT_USAGE = ` import sessions [--since <days>] [--all-repos] [--with-turns] [--apply | --propose] [--yes] [--fresh]
@@ -88,12 +92,21 @@ const USAGE = `meshpoint <command>
88
92
  opencode [--config-dir <dir>] <dir>/plugins/meshpoint.js + <dir>/skills/meshpoint
89
93
  (default dir: ~/.config/opencode)
90
94
  openclaw hook pack installed through 'openclaw plugins install'
95
+ mcp prints where MCP clients take the server; --project <dir>
96
+ writes <dir>/.mcp.json (Claude Code project scope, VS Code
97
+ with Copilot)
98
+ mcp [--cwd <dir>] stdio MCP server for clients without a hook: tools for recall,
99
+ file context and item writes; the repository is the working
100
+ directory
91
101
  items put --item <kind> <title> <body> [--item ...]
92
102
  items put --file <path> | items put < items.json
93
103
  write items for the current repo and branch; the file or
94
104
  stdin form takes a JSON array of {kind, title, body}
95
105
  items retract <id>... retract items on the current branch; an id may be a prefix
96
106
  items confirm <id>... confirm items on the current branch (counts toward their rank)
107
+ context write [--file <path>] write the session-start context (team knowledge, verification
108
+ marks, teammates) as a marked block in AGENTS.md for a checkout
109
+ without hooks: CI jobs and cloud agents. Not for committing
97
110
  export agents [--file <path>] [--check] write the branch's conventions as a marked block in AGENTS.md
98
111
  (or --file, repo-relative) for agents that read that file
99
112
  without a hook; the block is the only part touched, rerun to
@@ -106,6 +119,9 @@ function flag(args, name) {
106
119
  const i = args.indexOf(name);
107
120
  return i >= 0 ? args[i + 1] : undefined;
108
121
  }
122
+ function installedVersion() {
123
+ return JSON.parse(readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf8")).version;
124
+ }
109
125
  const DEFAULT_BASE_URL = "https://api.meshpoint.dev";
110
126
  async function requireConfig() {
111
127
  const config = loadConfig();
@@ -176,8 +192,7 @@ async function main(argv) {
176
192
  case "--version":
177
193
  case "-v":
178
194
  case "version": {
179
- const pkg = JSON.parse(readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf8"));
180
- process.stdout.write(`${pkg.version}\n`);
195
+ process.stdout.write(`${installedVersion()}\n`);
181
196
  return 0;
182
197
  }
183
198
  case "login": {
@@ -256,9 +271,11 @@ async function main(argv) {
256
271
  console.log(connectOpenclaw({ remove }));
257
272
  else if (rest[0] === "opencode")
258
273
  console.log(connectOpencode({ remove, ...(configDir ? { configDir } : {}) }));
274
+ else if (rest[0] === "mcp")
275
+ console.log(connectMcp({ remove, ...inProject }));
259
276
  else
260
- throw new Error("connect supports: claude-code, codex, cursor, antigravity, pi, opencode, openclaw");
261
- if (!remove) {
277
+ throw new Error("connect supports: claude-code, codex, cursor, antigravity, pi, opencode, openclaw, mcp");
278
+ if (!remove && rest[0] !== "mcp") {
262
279
  // Past sessions for this repository are worth a line; the offer never fails the connect.
263
280
  try {
264
281
  const repo = repoContext(process.cwd());
@@ -297,6 +314,52 @@ async function main(argv) {
297
314
  console.log(JSON.stringify({ ...out, project: repo.project, branch: repo.branch }));
298
315
  return 0;
299
316
  }
317
+ case "mcp": {
318
+ const cwd = flag(rest, "--cwd") ?? process.cwd();
319
+ if (!path.isAbsolute(cwd))
320
+ throw new Error("--cwd must be an absolute path");
321
+ const stored = loadConfig();
322
+ const config = stored ? await freshConfig(stored).catch(() => stored) : null;
323
+ const repo = repoContext(cwd);
324
+ const tap = config && repo
325
+ ? new Tap({
326
+ config,
327
+ repo,
328
+ session: `mcp-${randomUUID()}`,
329
+ spool: new Spool(spoolDir()),
330
+ checkpoints: new Checkpoints(stateDir()),
331
+ touched: new Touched(stateDir()),
332
+ cache: new SessionCache(stateDir()),
333
+ local: localChecks(repo.root),
334
+ refresh: () => freshConfig(config, { force: true }).catch(() => null),
335
+ })
336
+ : null;
337
+ const server = new McpServer({
338
+ name: MCP_SERVER_NAME,
339
+ version: installedVersion(),
340
+ instructions: MCP_INSTRUCTIONS,
341
+ tools: meshpointTools({ tap, cwd, config: requireConfig, checkpoints: new Checkpoints(stateDir()), touched: new Touched(stateDir()) }),
342
+ });
343
+ await server.serve(process.stdin, process.stdout);
344
+ return 0;
345
+ }
346
+ case "context": {
347
+ if (rest[0] !== "write")
348
+ throw new Error("context supports: write");
349
+ const config = await requireConfig();
350
+ const repo = repoContext(process.cwd());
351
+ if (!repo)
352
+ throw new Error("not inside a git repo with an origin remote");
353
+ const file = flag(rest, "--file");
354
+ if (file !== undefined && (path.isAbsolute(file) || file.split(/[\\/]/).includes("..")))
355
+ throw new Error("--file is a path inside the repository");
356
+ const tap = new Tap({ config, repo, session: `context-${randomUUID()}`, spool: new Spool(spoolDir()), checkpoints: new Checkpoints(stateDir()), local: localChecks(repo.root), refresh: () => freshConfig(config, { force: true }).catch(() => null) });
357
+ const text = await tap.start();
358
+ const out = writeContext(text, repo.root, file);
359
+ const items = (text.match(/^- /gm) ?? []).length;
360
+ console.log(`${out.created ? "created" : out.changed ? "updated" : "unchanged"} ${out.file}: context for ${repo.project} @ ${repo.branch}, ${items} line${items === 1 ? "" : "s"}. Not for committing.`);
361
+ return 0;
362
+ }
300
363
  case "export": {
301
364
  if (rest[0] !== "agents")
302
365
  throw new Error("export supports: agents");
@@ -0,0 +1,61 @@
1
+ import { readFileSync, rmSync, writeFileSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import path from "node:path";
4
+ // Registers the stdio server where MCP clients look. One file is written: <repo>/.mcp.json, which
5
+ // Claude Code (project scope) and VS Code with Copilot both read. Other clients keep their own
6
+ // user-level files; connect prints the entry for them instead of guessing at those files.
7
+ export const MCP_FILE = ".mcp.json";
8
+ export const MCP_ENTRY = { type: "stdio", command: "meshpoint", args: ["mcp"] };
9
+ export function installMcpEntry(file) {
10
+ return { ...file, mcpServers: { ...file.mcpServers, meshpoint: MCP_ENTRY } };
11
+ }
12
+ export function removeMcpEntry(file) {
13
+ const { meshpoint: _dropped, ...servers } = file.mcpServers ?? {};
14
+ const { mcpServers: _old, ...rest } = file;
15
+ return Object.keys(servers).length > 0 ? { ...rest, mcpServers: servers } : rest;
16
+ }
17
+ export function mcpSnippets(home = homedir(), platform = process.platform) {
18
+ const entry = JSON.stringify({ mcpServers: { meshpoint: MCP_ENTRY } }, null, 2);
19
+ const desktop = platform === "darwin" ? path.join(home, "Library", "Application Support", "Claude", "claude_desktop_config.json") : platform === "win32" ? "%APPDATA%\\Claude\\claude_desktop_config.json" : path.join(home, ".config", "Claude", "claude_desktop_config.json");
20
+ return [
21
+ "Add the Meshpoint MCP server to a client by hand:",
22
+ "",
23
+ ` Claude Code, VS Code with Copilot (one repository): meshpoint connect mcp --project <repo> writes <repo>/${MCP_FILE}`,
24
+ ` Claude Code (every repository): claude mcp add --scope user meshpoint -- meshpoint mcp`,
25
+ ` VS Code with Copilot (every repository): ${path.join(home, ".copilot", "mcp-config.json")}`,
26
+ ` Claude Desktop: ${desktop}`,
27
+ ` Zed: settings.json, key "context_servers": {"meshpoint": {"command": "meshpoint", "args": ["mcp"]}}`,
28
+ "",
29
+ "The entry for the mcpServers files:",
30
+ "",
31
+ entry.replace(/^/gm, " "),
32
+ "",
33
+ "The server finds the repository from its working directory; clients that start it elsewhere pass --cwd <repo> in args.",
34
+ ].join("\n");
35
+ }
36
+ export function connectMcp(opts) {
37
+ if (!opts.projectDir) {
38
+ if (opts.remove)
39
+ return "connect mcp --remove needs --project <repo>; user-level entries were added by hand and are removed the same way";
40
+ return mcpSnippets();
41
+ }
42
+ const file = path.join(opts.projectDir, MCP_FILE);
43
+ let current = {};
44
+ try {
45
+ current = JSON.parse(readFileSync(file, "utf8"));
46
+ }
47
+ catch (err) {
48
+ if (err.code !== "ENOENT")
49
+ throw new Error(`could not read ${file}: ${err.message}`);
50
+ }
51
+ if (opts.remove) {
52
+ const next = removeMcpEntry(current);
53
+ if (Object.keys(next).length > 0)
54
+ writeFileSync(file, `${JSON.stringify(next, null, 2)}\n`);
55
+ else
56
+ rmSync(file, { force: true });
57
+ return `removed the meshpoint server from ${file}`;
58
+ }
59
+ writeFileSync(file, `${JSON.stringify(installMcpEntry(current), null, 2)}\n`);
60
+ return `registered the meshpoint MCP server in ${file} (Claude Code project scope, VS Code with Copilot). Commit it so the team gets it; Claude Code asks once to approve a project server.`;
61
+ }
@@ -0,0 +1,111 @@
1
+ // A stdio MCP server: JSON-RPC 2.0, one message per line. Only the lifecycle and the tools
2
+ // methods are implemented; everything else answers "method not found". No SDK: the protocol
3
+ // surface used here is five methods and fits in a file.
4
+ export const PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"];
5
+ const DEFAULT_PROTOCOL = PROTOCOL_VERSIONS[0];
6
+ const PARSE_ERROR = -32700;
7
+ const INVALID_REQUEST = -32600;
8
+ const METHOD_NOT_FOUND = -32601;
9
+ const INVALID_PARAMS = -32602;
10
+ const INTERNAL = -32603;
11
+ class RpcError extends Error {
12
+ code;
13
+ constructor(code, message) {
14
+ super(message);
15
+ this.code = code;
16
+ }
17
+ }
18
+ export class McpServer {
19
+ opts;
20
+ constructor(opts) {
21
+ this.opts = opts;
22
+ }
23
+ // One request in, one result or error out; null for notifications.
24
+ async handle(req) {
25
+ const id = req.id ?? null;
26
+ if (req.jsonrpc !== "2.0" || typeof req.method !== "string")
27
+ return id === null ? null : error(id, INVALID_REQUEST, "invalid request");
28
+ if (req.method.startsWith("notifications/"))
29
+ return null;
30
+ try {
31
+ return { jsonrpc: "2.0", id, result: await this.dispatch(req.method, req.params ?? {}) };
32
+ }
33
+ catch (err) {
34
+ if (err instanceof RpcError)
35
+ return error(id, err.code, err.message);
36
+ return error(id, INTERNAL, err instanceof Error ? err.message : String(err));
37
+ }
38
+ }
39
+ async dispatch(method, params) {
40
+ switch (method) {
41
+ case "initialize": {
42
+ const asked = typeof params.protocolVersion === "string" ? params.protocolVersion : "";
43
+ return {
44
+ protocolVersion: PROTOCOL_VERSIONS.includes(asked) ? asked : DEFAULT_PROTOCOL,
45
+ capabilities: { tools: {} },
46
+ serverInfo: { name: this.opts.name, version: this.opts.version },
47
+ instructions: this.opts.instructions,
48
+ };
49
+ }
50
+ case "ping":
51
+ return {};
52
+ case "tools/list":
53
+ return { tools: this.opts.tools.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })) };
54
+ case "tools/call": {
55
+ const tool = this.opts.tools.find((t) => t.name === params.name);
56
+ if (!tool)
57
+ throw new RpcError(INVALID_PARAMS, `unknown tool: ${String(params.name)}`);
58
+ const args = params.arguments;
59
+ if (args !== undefined && (typeof args !== "object" || args === null || Array.isArray(args)))
60
+ throw new RpcError(INVALID_PARAMS, "arguments must be an object");
61
+ try {
62
+ return { content: [{ type: "text", text: await tool.run(args ?? {}) }], isError: false };
63
+ }
64
+ catch (err) {
65
+ return { content: [{ type: "text", text: err instanceof Error ? err.message : String(err) }], isError: true };
66
+ }
67
+ }
68
+ default:
69
+ throw new RpcError(METHOD_NOT_FOUND, `method not found: ${method}`);
70
+ }
71
+ }
72
+ // Reads lines until the input ends; answers are written as they are ready.
73
+ async serve(input, output) {
74
+ let buffer = "";
75
+ const pending = [];
76
+ const write = (msg) => {
77
+ output.write(`${JSON.stringify(msg)}\n`);
78
+ };
79
+ const take = (line) => {
80
+ const text = line.trim();
81
+ if (!text)
82
+ return;
83
+ let req;
84
+ try {
85
+ req = JSON.parse(text);
86
+ }
87
+ catch {
88
+ write(error(null, PARSE_ERROR, "parse error"));
89
+ return;
90
+ }
91
+ pending.push(this.handle(req).then((res) => {
92
+ if (res)
93
+ write(res);
94
+ }));
95
+ };
96
+ for await (const chunk of input) {
97
+ buffer += typeof chunk === "string" ? chunk : chunk.toString("utf8");
98
+ let nl = buffer.indexOf("\n");
99
+ while (nl >= 0) {
100
+ take(buffer.slice(0, nl));
101
+ buffer = buffer.slice(nl + 1);
102
+ nl = buffer.indexOf("\n");
103
+ }
104
+ }
105
+ take(buffer);
106
+ await Promise.all(pending);
107
+ }
108
+ }
109
+ function error(id, code, message) {
110
+ return { jsonrpc: "2.0", id, error: { code, message } };
111
+ }
@@ -0,0 +1,90 @@
1
+ import { KINDS } from "@meshpoint/sdk";
2
+ import { confirmItems, ITEMS_MAX, parseItems, putItems, retractItems } from "../items.js";
3
+ // The Meshpoint tools an MCP client gets: the session-start context, the notice for one file,
4
+ // and the three item writes. Capture and presence need a hook or plugin and are not here.
5
+ export const MCP_SERVER_NAME = "meshpoint";
6
+ export const MCP_INSTRUCTIONS = `Meshpoint is the team's shared memory for this repository, per branch.
7
+ Call meshpoint_recall once at the start of a task: it lists what teammates' agents learned (decisions, gotchas, conventions, facts, status, todos) and who is active now. Before editing a file, meshpoint_file_context tells you what is known about that file and whether a teammate is on it.
8
+ Record what you establish with meshpoint_items_put: one item per decision, gotcha, convention, fact, status or todo, bodies concrete (repo-relative file names, commands, values, reasons), nothing already listed by recall unless it changed, no secrets. Retract items you proved wrong with meshpoint_items_retract.`;
9
+ const IDS_SCHEMA = { type: "array", items: { type: "string" }, minItems: 1, description: "Item ids or unique id prefixes, as recall lists them." };
10
+ function strings(v, what) {
11
+ if (!Array.isArray(v) || v.length === 0 || !v.every((s) => typeof s === "string" && s.trim()))
12
+ throw new Error(`${what} must be a non-empty list of strings`);
13
+ return v.map((s) => s.trim());
14
+ }
15
+ export function meshpointTools(deps) {
16
+ const tap = () => {
17
+ if (!deps.tap)
18
+ throw new Error(`${deps.cwd} is not inside a git repository with an origin remote; start the server in one or pass --cwd`);
19
+ return deps.tap;
20
+ };
21
+ const repo = () => tap().repo;
22
+ const itemDeps = async () => ({ config: await deps.config(), repo: repo(), ...(deps.fetch ? { fetch: deps.fetch } : {}) });
23
+ return [
24
+ {
25
+ name: "meshpoint_recall",
26
+ description: "Team knowledge for this repository and branch: items from teammates' agents (first column is the item id, ? marks an item whose referenced file changed since) and who is active now. Call once at the start of a task.",
27
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
28
+ run: async () => {
29
+ const text = await tap().start();
30
+ return text || `No team knowledge for ${repo().project} @ ${repo().branch} yet.`;
31
+ },
32
+ },
33
+ {
34
+ name: "meshpoint_file_context",
35
+ description: "What is known about one file before you edit it: items naming it and teammates editing it now. Path is repo-relative or absolute.",
36
+ inputSchema: { type: "object", properties: { path: { type: "string", description: "File path, repo-relative or absolute." } }, required: ["path"], additionalProperties: false },
37
+ run: async (args) => {
38
+ if (typeof args.path !== "string" || !args.path.trim())
39
+ throw new Error("path is required");
40
+ const text = await tap().fileContext(args.path.trim());
41
+ return text || `Nothing recorded about ${args.path.trim()}; nobody else is on it.`;
42
+ },
43
+ },
44
+ {
45
+ name: "meshpoint_items_put",
46
+ description: `Write knowledge items for this repository and branch. Each item: kind (${KINDS.join(", ")}), one-line title, one to three concrete sentences as body; optional key (a stable slot such as test-runner; a later item with the same key replaces this one) and supersedes (ids this item replaces). At most ${ITEMS_MAX} per call. Name files by repo-relative path; the result lists paths that do not exist in the checkout.`,
47
+ inputSchema: {
48
+ type: "object",
49
+ properties: {
50
+ items: {
51
+ type: "array",
52
+ minItems: 1,
53
+ maxItems: ITEMS_MAX,
54
+ items: {
55
+ type: "object",
56
+ properties: {
57
+ kind: { type: "string", enum: [...KINDS] },
58
+ title: { type: "string" },
59
+ body: { type: "string" },
60
+ key: { type: "string" },
61
+ supersedes: { type: "array", items: { type: "string" } },
62
+ },
63
+ required: ["kind", "title", "body"],
64
+ additionalProperties: false,
65
+ },
66
+ },
67
+ },
68
+ required: ["items"],
69
+ additionalProperties: false,
70
+ },
71
+ run: async (args) => {
72
+ const drafts = parseItems(JSON.stringify(args.items ?? null));
73
+ const { missing, ...out } = await putItems(drafts, { ...(await itemDeps()), checkpoints: deps.checkpoints, touched: deps.touched });
74
+ return JSON.stringify({ ...out, project: repo().project, branch: repo().branch, ...(missing.length ? { ref_not_found: missing } : {}) });
75
+ },
76
+ },
77
+ {
78
+ name: "meshpoint_items_retract",
79
+ description: "Retract items on this branch that this session proved wrong: a finished todo, a reversed decision with nothing in its place.",
80
+ inputSchema: { type: "object", properties: { ids: IDS_SCHEMA }, required: ["ids"], additionalProperties: false },
81
+ run: async (args) => JSON.stringify(await retractItems(strings(args.ids, "ids"), await itemDeps())),
82
+ },
83
+ {
84
+ name: "meshpoint_items_confirm",
85
+ description: "Confirm items that held true in this session; confirmations raise an item in recall and keep status and todo items from expiring.",
86
+ inputSchema: { type: "object", properties: { ids: IDS_SCHEMA }, required: ["ids"], additionalProperties: false },
87
+ run: async (args) => JSON.stringify(await confirmItems(strings(args.ids, "ids"), await itemDeps())),
88
+ },
89
+ ];
90
+ }
package/dist/tap.js CHANGED
@@ -93,18 +93,25 @@ export class Tap {
93
93
  return "";
94
94
  if (this.deps.cache && !this.deps.cache.firstEdit(this.deps.session, rel))
95
95
  return "";
96
- const cached = this.deps.cache?.loadRecall(this.deps.session);
97
- const ctx = await Promise.race([
98
- this.client(this.repo.branch).context(rel).catch(() => null),
99
- new Promise((r) => setTimeout(() => r(null), EDIT_WAIT_MS)),
100
- ]);
101
- const items = cached ? itemsForFile(cached.items, cached.verdicts, rel) : (ctx?.items ?? []);
102
- return renderEditNotice(rel, items, ctx?.presence ?? [], this.now());
96
+ return await this.fileContext(rel);
103
97
  }
104
98
  catch {
105
99
  return "";
106
100
  }
107
101
  }
102
+ // The same notice on demand, every time it is asked for (the MCP tool).
103
+ async fileContext(filePath) {
104
+ const rel = this.relative(filePath);
105
+ if (!rel)
106
+ return "";
107
+ const cached = this.deps.cache?.loadRecall(this.deps.session);
108
+ const ctx = await Promise.race([
109
+ this.client(this.repo.branch).context(rel).catch(() => null),
110
+ new Promise((r) => setTimeout(() => r(null), EDIT_WAIT_MS)),
111
+ ]);
112
+ const items = cached ? itemsForFile(cached.items, cached.verdicts, rel) : (ctx?.items ?? []);
113
+ return renderEditNotice(rel, items, ctx?.presence ?? [], this.now());
114
+ }
108
115
  async user(prompt) {
109
116
  if (prompt)
110
117
  this.spoolTurn(`[user] ${prompt}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshpoint/cli",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Meshpoint CLI and harness adapters: shared agent memory for developer teams",
5
5
  "keywords": [
6
6
  "meshpoint",