@adhdev/mesh-shared 1.0.60-rc.52 → 1.0.60-rc.54

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/magi.d.ts CHANGED
@@ -50,7 +50,7 @@
50
50
  * already pinned the (node, provider) target, so any difficulty would be inert at best
51
51
  * and would fight the panel's own slot selection at worst. To change how hard a
52
52
  * replica thinks or how much parallelism a node grants, edit that NODE's capability
53
- * slots (`mesh_node_slots_set`); it is a different axis, on purpose.
53
+ * slots (`mesh_node_slots` action "set"); it is a different axis, on purpose.
54
54
  *
55
55
  * Unknown keys are dropped rather than rejected, so slots written by another version
56
56
  * stay readable. Write paths pair the normalizer with
@@ -18,7 +18,32 @@
18
18
  * Order mirrors mcp-server `ALL_MESH_TOOLS` for easy visual diffing, but the consistency
19
19
  * checks are set-based (order-insensitive).
20
20
  */
21
- export declare const CANONICAL_MESH_TOOL_NAMES: readonly ["mesh_status", "mesh_route_preview", "mesh_list_nodes", "mesh_enqueue_batch", "mesh_enqueue_task", "mesh_view_queue", "mesh_graph_view", "mesh_graph_gate_claim", "mesh_graph_gate_release", "mesh_graph_gate_abandon", "mesh_graph_node_patch", "mesh_queue_cancel", "mesh_queue_requeue", "mesh_send_task", "mesh_read_chat", "mesh_read_debug", "mesh_read_terminal", "mesh_send_keys", "mesh_launch_session", "mesh_git_status", "mesh_read_node_logs", "mesh_fast_forward_node", "mesh_restart_daemon", "mesh_checkpoint", "mesh_approve", "mesh_answer_question", "mesh_list_pending_approvals", "mesh_plan_onboarding", "mesh_create", "mesh_add_node", "mesh_clone_node", "mesh_remove_node", "mesh_cleanup_worktree_nodes", "mesh_refine_node", "mesh_refine_batch", "mesh_refine_config", "mesh_change_impact_config", "mesh_init", "mesh_reinit", "mesh_write_mesh_json_config", "mesh_refine_plan", "mesh_cleanup_sessions", "mesh_prune_stale_direct", "mesh_task_history", "mesh_ledger_query", "mesh_record_note", "mesh_forget_note", "mesh_reconcile_ledger", "mesh_mission_upsert", "mesh_mission_list", "mesh_review_inbox", "mesh_magi_review", "mesh_magi_collect", "mesh_magi_kind_panel_set", "mesh_magi_kind_panel_list", "mesh_node_slots_set", "mesh_node_slots_list", "mesh_node_slots_propose", "mesh_coordinator_prompt_append_get", "mesh_coordinator_prompt_append_set"];
21
+ export declare const CANONICAL_MESH_TOOL_NAMES: readonly ["mesh_status", "mesh_route_preview", "mesh_list_nodes", "mesh_enqueue_batch", "mesh_enqueue_task", "mesh_view_queue", "mesh_graph_view", "mesh_graph_gate", "mesh_graph_node_patch", "mesh_queue_cancel", "mesh_queue_requeue", "mesh_send_task", "mesh_read_chat", "mesh_read_debug", "mesh_read_terminal", "mesh_send_keys", "mesh_launch_session", "mesh_git_status", "mesh_read_node_logs", "mesh_fast_forward_node", "mesh_restart_daemon", "mesh_checkpoint", "mesh_approve", "mesh_answer_question", "mesh_list_pending_approvals", "mesh_create", "mesh_add_node", "mesh_clone_node", "mesh_remove_node", "mesh_cleanup_worktree_nodes", "mesh_refine_node", "mesh_refine_batch", "mesh_config", "mesh_init", "mesh_refine_plan", "mesh_cleanup_sessions", "mesh_task_history", "mesh_ledger_query", "mesh_note", "mesh_reconcile_ledger", "mesh_mission_upsert", "mesh_mission_list", "mesh_review_inbox", "mesh_magi_review", "mesh_magi_collect", "mesh_magi_kind_panel", "mesh_node_slots", "mesh_coordinator_prompt_append"];
22
22
  export type CanonicalMeshToolName = typeof CANONICAL_MESH_TOOL_NAMES[number];
23
23
  /** The count the `NN tools` barrel doc comments and consistency test assert against. */
24
- export declare const CANONICAL_MESH_TOOL_COUNT: 60;
24
+ export declare const CANONICAL_MESH_TOOL_COUNT: 48;
25
+ /**
26
+ * Tool names retired by the 2026-09-26 tool-surface consolidation (60 → 48).
27
+ * Every capability behind them is still reachable: each retired name maps to the
28
+ * merged tool plus the discriminator argument that selects the same behaviour.
29
+ *
30
+ * mcp-server answers a call to a retired name with an error naming the
31
+ * replacement (it does NOT forward silently — a coordinator running an old
32
+ * prompt must learn the new spelling), and the daemon-core coordinator prompt
33
+ * test asserts none of these names is advertised anywhere in the prompt.
34
+ *
35
+ * `args` is the discriminator to add; every other argument keeps its name.
36
+ * `note` covers the one rename where an argument moved (the old
37
+ * `mesh_graph_gate_claim({ extend_seconds })` extend-only mode).
38
+ */
39
+ export declare const RETIRED_MESH_TOOLS: Readonly<Record<string, {
40
+ readonly tool: CanonicalMeshToolName;
41
+ readonly args: Readonly<Record<string, string>>;
42
+ readonly note?: string;
43
+ }>>;
44
+ /**
45
+ * The error text for a call to a retired tool name, or null when `name` is not
46
+ * retired. One wording shared by every MCP mode so the redirect reads the same
47
+ * wherever an old prompt calls it.
48
+ */
49
+ export declare function retiredMeshToolError(name: string): string | null;
@@ -35,7 +35,7 @@ export type ChunkFrame<T extends string> = {
35
35
  export declare function isChunkType(value: unknown): value is `${string}_chunk`;
36
36
  export declare const DASHBOARD_TO_DAEMON_P2P_TYPES: readonly ["ping", "pong", "command", "input", "pty_input", "pty_resize", "screenshot_start", "screenshot_stop", "subscribe", "unsubscribe", "seqscribe_session_interest", "read", "write", "list"];
37
37
  export type DashboardToDaemonP2PType = typeof DASHBOARD_TO_DAEMON_P2P_TYPES[number];
38
- export declare const isDashboardToDaemonP2PType: (value: unknown) => value is "command" | "ping" | "pong" | "input" | "pty_input" | "pty_resize" | "screenshot_start" | "screenshot_stop" | "subscribe" | "unsubscribe" | "seqscribe_session_interest" | "read" | "write" | "list";
38
+ export declare const isDashboardToDaemonP2PType: (value: unknown) => value is "list" | "command" | "ping" | "pong" | "input" | "pty_input" | "pty_resize" | "screenshot_start" | "screenshot_stop" | "subscribe" | "unsubscribe" | "seqscribe_session_interest" | "read" | "write";
39
39
  export type DashboardToDaemonChunkType = `${DashboardToDaemonP2PType}_chunk`;
40
40
  export declare function isDashboardToDaemonChunkType(value: unknown): value is DashboardToDaemonChunkType;
41
41
  export type P2PPingMsg = {
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Detection of installed CLI providers already exists per node (the status
5
5
  * snapshot's `availableProviders`), and applying a slot profile already exists
6
- * (`mesh_node_slots_set`, dry-run by default). What was missing is the bit in
6
+ * (`mesh_node_slots` action "set", dry-run by default). What was missing is the bit in
7
7
  * between: turning "these CLIs are installed on this node" into a concrete
8
8
  * `NodeCapabilitySlot[]` draft the operator can review. This module is that
9
9
  * bridge, and nothing more — it is a PURE proposal generator. It never writes;
@@ -712,7 +712,7 @@ export interface GraphGateClaimRequest {
712
712
  coordinatorSessionId: string;
713
713
  leaseSeconds?: number;
714
714
  extendDeadlineSeconds?: number;
715
- /** Also collect `collectGateConvergenceEvidence` on a successful claim (mesh_graph_gate_claim's own behavior). */
715
+ /** Also collect `collectGateConvergenceEvidence` on a successful claim (mesh_graph_gate action=claim's own behavior). */
716
716
  probeConvergenceEvidence?: boolean;
717
717
  }
718
718
  export interface GraphGateClaimResponse {
@@ -903,7 +903,7 @@ export declare function decodeOrphanedPinNotifyResponse(value: unknown): Orphane
903
903
  /** The complete, closed set of IPC command names this contract defines. */
904
904
  export declare const TURN_IPC_COMMANDS: readonly ["turn_observe", "mesh_record", "turn_cancel", "operator_status", "turn_query", "mesh_index_query", "mission_upsert", "mission_query", "note_upsert", "note_forget", "tool_call_record", "ledger_query", "mission_list_query", "record_local", "queue_query", "queue_enqueue", "queue_enqueue_graph", "queue_cancel", "queue_requeue", "direct_dispatch_record", "graph_audit_record", "active_work_query", "recovery_context_query", "graph_gate_claim", "graph_gate_release", "graph_gate_abandon", "graph_node_patch", "graph_view_query", "task_stats_query", "prune_stale_direct", "orphaned_pin_notify"];
905
905
  export type TurnIpcCommand = typeof TURN_IPC_COMMANDS[number];
906
- export declare const isTurnIpcCommand: (value: unknown) => value is "operator_status" | "turn_observe" | "mesh_record" | "turn_cancel" | "turn_query" | "mesh_index_query" | "mission_upsert" | "mission_query" | "note_upsert" | "note_forget" | "tool_call_record" | "ledger_query" | "mission_list_query" | "record_local" | "queue_query" | "queue_enqueue" | "queue_enqueue_graph" | "queue_cancel" | "queue_requeue" | "direct_dispatch_record" | "graph_audit_record" | "active_work_query" | "recovery_context_query" | "graph_gate_claim" | "graph_gate_release" | "graph_gate_abandon" | "graph_node_patch" | "graph_view_query" | "task_stats_query" | "prune_stale_direct" | "orphaned_pin_notify";
906
+ export declare const isTurnIpcCommand: (value: unknown) => value is "prune_stale_direct" | "operator_status" | "turn_observe" | "mesh_record" | "turn_cancel" | "turn_query" | "mesh_index_query" | "mission_upsert" | "mission_query" | "note_upsert" | "note_forget" | "tool_call_record" | "ledger_query" | "mission_list_query" | "record_local" | "queue_query" | "queue_enqueue" | "queue_enqueue_graph" | "queue_cancel" | "queue_requeue" | "direct_dispatch_record" | "graph_audit_record" | "active_work_query" | "recovery_context_query" | "graph_gate_claim" | "graph_gate_release" | "graph_gate_abandon" | "graph_node_patch" | "graph_view_query" | "task_stats_query" | "orphaned_pin_notify";
907
907
  /** Request type keyed by command name — for a generically-typed dispatcher on either end. */
908
908
  export interface TurnIpcRequestByCommand {
909
909
  turn_observe: TurnObserveRequest;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/mesh-shared",
3
- "version": "1.0.60-rc.52",
3
+ "version": "1.0.60-rc.54",
4
4
  "description": "ADHDev mesh-shared — pure mesh/git status normalizers shared by daemon-core and web-core",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -66,7 +66,7 @@ export function isMeshTaskDifficulty(value: unknown): value is MeshTaskDifficult
66
66
  * a value that should never have been stamped provider-blind.
67
67
  *
68
68
  * 2. IT FOUGHT THE SLOTS. Operators express model choice per node via
69
- * capability slots (`mesh_node_slots_set`), which know the provider. A
69
+ * capability slots (`mesh_node_slots` action "set"), which know the provider. A
70
70
  * mesh-wide preset that also picks a model duplicated that decision from a
71
71
  * position with strictly less information, and needed the modelSource
72
72
  * ('explicit' vs 'preset') precedence machinery plus a fail-closed
package/src/magi.ts CHANGED
@@ -59,7 +59,7 @@
59
59
  * already pinned the (node, provider) target, so any difficulty would be inert at best
60
60
  * and would fight the panel's own slot selection at worst. To change how hard a
61
61
  * replica thinks or how much parallelism a node grants, edit that NODE's capability
62
- * slots (`mesh_node_slots_set`); it is a different axis, on purpose.
62
+ * slots (`mesh_node_slots` action "set"); it is a different axis, on purpose.
63
63
  *
64
64
  * Unknown keys are dropped rather than rejected, so slots written by another version
65
65
  * stay readable. Write paths pair the normalizer with
@@ -28,9 +28,7 @@ export const CANONICAL_MESH_TOOL_NAMES = [
28
28
  'mesh_view_queue',
29
29
  // GRAPH-ORCHESTRATION Phase E — the coordinator gate + graph view surface.
30
30
  'mesh_graph_view',
31
- 'mesh_graph_gate_claim',
32
- 'mesh_graph_gate_release',
33
- 'mesh_graph_gate_abandon',
31
+ 'mesh_graph_gate',
34
32
  'mesh_graph_node_patch',
35
33
  'mesh_queue_cancel',
36
34
  'mesh_queue_requeue',
@@ -48,7 +46,6 @@ export const CANONICAL_MESH_TOOL_NAMES = [
48
46
  'mesh_approve',
49
47
  'mesh_answer_question',
50
48
  'mesh_list_pending_approvals',
51
- 'mesh_plan_onboarding',
52
49
  'mesh_create',
53
50
  'mesh_add_node',
54
51
  'mesh_clone_node',
@@ -56,34 +53,84 @@ export const CANONICAL_MESH_TOOL_NAMES = [
56
53
  'mesh_cleanup_worktree_nodes',
57
54
  'mesh_refine_node',
58
55
  'mesh_refine_batch',
59
- 'mesh_refine_config',
60
- 'mesh_change_impact_config',
56
+ 'mesh_config',
61
57
  'mesh_init',
62
- 'mesh_reinit',
63
- 'mesh_write_mesh_json_config',
64
58
  'mesh_refine_plan',
65
59
  'mesh_cleanup_sessions',
66
- 'mesh_prune_stale_direct',
67
60
  'mesh_task_history',
68
61
  'mesh_ledger_query',
69
- 'mesh_record_note',
70
- 'mesh_forget_note',
62
+ 'mesh_note',
71
63
  'mesh_reconcile_ledger',
72
64
  'mesh_mission_upsert',
73
65
  'mesh_mission_list',
74
66
  'mesh_review_inbox',
75
67
  'mesh_magi_review',
76
68
  'mesh_magi_collect',
77
- 'mesh_magi_kind_panel_set',
78
- 'mesh_magi_kind_panel_list',
79
- 'mesh_node_slots_set',
80
- 'mesh_node_slots_list',
81
- 'mesh_node_slots_propose',
82
- 'mesh_coordinator_prompt_append_get',
83
- 'mesh_coordinator_prompt_append_set',
69
+ 'mesh_magi_kind_panel',
70
+ 'mesh_node_slots',
71
+ 'mesh_coordinator_prompt_append',
84
72
  ] as const;
85
73
 
86
74
  export type CanonicalMeshToolName = typeof CANONICAL_MESH_TOOL_NAMES[number];
87
75
 
88
76
  /** The count the `NN tools` barrel doc comments and consistency test assert against. */
89
77
  export const CANONICAL_MESH_TOOL_COUNT = CANONICAL_MESH_TOOL_NAMES.length;
78
+
79
+ /**
80
+ * Tool names retired by the 2026-09-26 tool-surface consolidation (60 → 48).
81
+ * Every capability behind them is still reachable: each retired name maps to the
82
+ * merged tool plus the discriminator argument that selects the same behaviour.
83
+ *
84
+ * mcp-server answers a call to a retired name with an error naming the
85
+ * replacement (it does NOT forward silently — a coordinator running an old
86
+ * prompt must learn the new spelling), and the daemon-core coordinator prompt
87
+ * test asserts none of these names is advertised anywhere in the prompt.
88
+ *
89
+ * `args` is the discriminator to add; every other argument keeps its name.
90
+ * `note` covers the one rename where an argument moved (the old
91
+ * `mesh_graph_gate_claim({ extend_seconds })` extend-only mode).
92
+ */
93
+ export const RETIRED_MESH_TOOLS: Readonly<Record<string, {
94
+ readonly tool: CanonicalMeshToolName;
95
+ readonly args: Readonly<Record<string, string>>;
96
+ readonly note?: string;
97
+ }>> = {
98
+ mesh_graph_gate_claim: {
99
+ tool: 'mesh_graph_gate',
100
+ args: { action: 'claim' },
101
+ note: 'The extend-only form (claim with extend_seconds) is now action: "extend" with the same extend_seconds.',
102
+ },
103
+ mesh_graph_gate_release: { tool: 'mesh_graph_gate', args: { action: 'release' } },
104
+ mesh_graph_gate_abandon: { tool: 'mesh_graph_gate', args: { action: 'abandon' } },
105
+ // Never a published tool (it is the daemon command behind the extend verb),
106
+ // but an older gate-expiry notice told coordinators to call it by this name.
107
+ mesh_graph_gate_extend: { tool: 'mesh_graph_gate', args: { action: 'extend' } },
108
+ mesh_node_slots_set: { tool: 'mesh_node_slots', args: { action: 'set' } },
109
+ mesh_node_slots_list: { tool: 'mesh_node_slots', args: { action: 'list' } },
110
+ mesh_node_slots_propose: { tool: 'mesh_node_slots', args: { action: 'propose' } },
111
+ mesh_magi_kind_panel_set: { tool: 'mesh_magi_kind_panel', args: { action: 'set' } },
112
+ mesh_magi_kind_panel_list: { tool: 'mesh_magi_kind_panel', args: { action: 'list' } },
113
+ mesh_coordinator_prompt_append_get: { tool: 'mesh_coordinator_prompt_append', args: { action: 'get' } },
114
+ mesh_coordinator_prompt_append_set: { tool: 'mesh_coordinator_prompt_append', args: { action: 'set' } },
115
+ mesh_record_note: { tool: 'mesh_note', args: { action: 'record' } },
116
+ mesh_forget_note: { tool: 'mesh_note', args: { action: 'forget' } },
117
+ mesh_reinit: { tool: 'mesh_init', args: { mode: 'reinit' } },
118
+ mesh_refine_config: { tool: 'mesh_config', args: { kind: 'refine' } },
119
+ mesh_change_impact_config: { tool: 'mesh_config', args: { kind: 'change_impact' } },
120
+ mesh_write_mesh_json_config: { tool: 'mesh_config', args: { kind: 'mesh_json' } },
121
+ mesh_plan_onboarding: { tool: 'mesh_create', args: { mode: 'plan' } },
122
+ mesh_prune_stale_direct: { tool: 'mesh_cleanup_sessions', args: { mode: 'prune_stale_direct' } },
123
+ };
124
+
125
+ /**
126
+ * The error text for a call to a retired tool name, or null when `name` is not
127
+ * retired. One wording shared by every MCP mode so the redirect reads the same
128
+ * wherever an old prompt calls it.
129
+ */
130
+ export function retiredMeshToolError(name: string): string | null {
131
+ const entry = Object.prototype.hasOwnProperty.call(RETIRED_MESH_TOOLS, name) ? RETIRED_MESH_TOOLS[name] : undefined;
132
+ if (!entry) return null;
133
+ const discriminator = Object.entries(entry.args).map(([k, v]) => `${k}: "${v}"`).join(', ');
134
+ return `Tool "${name}" was retired (merged into ${entry.tool}). Call ${entry.tool} with ${discriminator} and the same other arguments.`
135
+ + (entry.note ? ` ${entry.note}` : '');
136
+ }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Detection of installed CLI providers already exists per node (the status
5
5
  * snapshot's `availableProviders`), and applying a slot profile already exists
6
- * (`mesh_node_slots_set`, dry-run by default). What was missing is the bit in
6
+ * (`mesh_node_slots` action "set", dry-run by default). What was missing is the bit in
7
7
  * between: turning "these CLIs are installed on this node" into a concrete
8
8
  * `NodeCapabilitySlot[]` draft the operator can review. This module is that
9
9
  * bridge, and nothing more — it is a PURE proposal generator. It never writes;
package/src/turn-ipc.ts CHANGED
@@ -1675,8 +1675,8 @@ export function decodeRecoveryContextQueryResponse(value: unknown): RecoveryCont
1675
1675
  // Wiring-unification Phase C, workstream C-W9c (2026-09-24 19:00 stamp
1676
1676
  // "mcp-server graph gates/plan/patch ... still call daemon-core in-process").
1677
1677
  //
1678
- // `mesh-tools-graph.ts`'s five graph-orchestration tools (`mesh_graph_gate_claim`
1679
- // / `_release` / `_abandon`, `mesh_graph_node_patch`, `mesh_graph_view`) called
1678
+ // `mesh-tools-graph.ts`'s five graph-orchestration tools (the gate claim
1679
+ // / release / abandon verbs, now `mesh_graph_gate`, `mesh_graph_node_patch`, `mesh_graph_view`) called
1680
1680
  // daemon-core's MeshRuntimeStore-backed graph module in-process
1681
1681
  // (`claimMeshGraphGate` / `releaseMeshGraphGate` / `abandonMeshGraphGate` /
1682
1682
  // `patchGraphNodeAndRetry` / `buildMeshGraphViews`, all in `mesh-graph-gates.ts` /
@@ -1700,7 +1700,7 @@ export interface GraphGateClaimRequest {
1700
1700
  coordinatorSessionId: string
1701
1701
  leaseSeconds?: number
1702
1702
  extendDeadlineSeconds?: number
1703
- /** Also collect `collectGateConvergenceEvidence` on a successful claim (mesh_graph_gate_claim's own behavior). */
1703
+ /** Also collect `collectGateConvergenceEvidence` on a successful claim (mesh_graph_gate action=claim's own behavior). */
1704
1704
  probeConvergenceEvidence?: boolean
1705
1705
  }
1706
1706
 
@@ -1760,7 +1760,7 @@ export interface GraphGateReleaseRequest {
1760
1760
  // roll back — mesh-graph-gates.ts file header). The daemon handler catches
1761
1761
  // that and reports it as a RESULT, not an IPC-level failure (the same
1762
1762
  // success:true-carries-a-refusal shape `queue_enqueue_graph` already uses) —
1763
- // `mesh_graph_gate_release`'s tool layer classifies `refusalCode` by prefix
1763
+ // `mesh_graph_gate` action=release's tool layer classifies `refusalCode` by prefix
1764
1764
  // exactly as it did the in-process thrown message.
1765
1765
  export type GraphGateReleaseResponse =
1766
1766
  | {
@@ -2003,7 +2003,7 @@ export function decodeTaskStatsQueryResponse(value: unknown): TaskStatsQueryResp
2003
2003
  // ─── prune_stale_direct ─────────────────────────────────────────────────────
2004
2004
  //
2005
2005
  // C-W9c: replaces the in-process `pruneStaleDirectDispatches` call
2006
- // (`mesh_prune_stale_direct` tool, `mesh-tools-session.ts`). Unlike the other
2006
+ // (`mesh_cleanup_sessions` mode=prune_stale_direct, `mesh-tools-session.ts`). Unlike the other
2007
2007
  // C-W9 commands this one does NOT take its inputs (queue/records/direct
2008
2008
  // dispatches) on the wire — the daemon already reads them itself
2009
2009
  // (`getQueue`/`readLocalRecords`/`getActiveDirectDispatches`), so the request