@adhdev/mesh-shared 1.0.75 → 1.0.76-rc.2

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.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * assistant-protocol — the assistant layer's tool and daemon-verb names
3
+ * (docs/design/2026-10-07-assistant-layer.md §4.4).
4
+ *
5
+ * The single source for both halves of the assistant contract, like
6
+ * `WORKER_TOOLS` is for workers:
7
+ * - `ASSISTANT_TOOLS` — exactly what `adhdev mcp --assistant` will advertise
8
+ * (an mcp-server parity test pins ListTools to this tuple once that mode
9
+ * lands);
10
+ * - `ASSISTANT_TOOL_VERBS` — the daemon command each tool calls;
11
+ * - the daemon-only verbs (launch / MCP-only pull / owner actions) that have
12
+ * no tool.
13
+ *
14
+ * Assistant tools are a separate set from the mesh tools: none of these names
15
+ * belongs in `CANONICAL_MESH_TOOL_NAMES`, and the coordinator/worker MCP modes
16
+ * never publish them.
17
+ */
18
+ export declare const ASSISTANT_TOOLS: readonly ["projects", "project_status", "project_send", "project_read", "project_add", "discover_repos", "memory", "skill_view", "skill_manage", "project_note"];
19
+ export type AssistantTool = typeof ASSISTANT_TOOLS[number];
20
+ export declare function isAssistantTool(value: unknown): value is AssistantTool;
21
+ /** Daemon verb names (§4.4 table + the five verbs below it). */
22
+ export declare const ASSISTANT_VERB: {
23
+ readonly projects: "assistant_projects";
24
+ readonly projectStatus: "assistant_project_status";
25
+ readonly projectSend: "assistant_project_send";
26
+ readonly projectRead: "assistant_project_read";
27
+ readonly projectAdd: "assistant_project_add";
28
+ readonly discoverRepos: "assistant_discover_repos";
29
+ readonly memory: "assistant_memory";
30
+ readonly skillView: "assistant_skill_view";
31
+ readonly skillManage: "assistant_skill_manage";
32
+ readonly projectNote: "assistant_project_note";
33
+ readonly launch: "launch_assistant";
34
+ readonly pendingRelays: "assistant_pending_relays";
35
+ readonly stagedResolve: "assistant_staged_resolve";
36
+ readonly storeAdmin: "assistant_store_admin";
37
+ readonly importSkills: "assistant_import_skills";
38
+ };
39
+ export type AssistantVerb = typeof ASSISTANT_VERB[keyof typeof ASSISTANT_VERB];
40
+ /** The daemon verb each assistant tool calls. */
41
+ export declare const ASSISTANT_TOOL_VERBS: Readonly<Record<AssistantTool, AssistantVerb>>;
42
+ /**
43
+ * Tools annotated as writes; every other assistant tool is read-only. §4.4
44
+ * lists the three store writes; project_send and project_add are here too
45
+ * because they cause effects (a coordinator message or launch, a new
46
+ * project), and MCP clients use readOnlyHint to skip confirmation.
47
+ */
48
+ export declare const ASSISTANT_WRITE_TOOLS: readonly AssistantTool[];
49
+ /** Owner-only verbs: never reachable from the assistant's MCP server (no `ipc`). */
50
+ export declare const ASSISTANT_OWNER_VERBS: readonly AssistantVerb[];
51
+ /** The only assistant verbs accepted while an idle review turn is open (§4.10.7). */
52
+ export declare const ASSISTANT_REVIEW_TURN_VERBS: readonly AssistantVerb[];
53
+ /**
54
+ * Env var the daemon sets on the assistant CLI's process (§4.5), read by the
55
+ * assistant MCP server and forwarded on every verb as
56
+ * `ASSISTANT_SESSION_ID_ARG`. Routing / ownership only — never an auth gate.
57
+ */
58
+ export declare const ASSISTANT_SESSION_ID_ENV = "ADHDEV_ASSISTANT_SESSION_ID";
59
+ /** Request arg carrying the calling assistant session id. */
60
+ export declare const ASSISTANT_SESSION_ID_ARG = "assistantSessionId";
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export * from './session-status';
32
32
  export * from './mesh-vocabulary';
33
33
  export * from './outbound-message';
34
34
  export * from './worker-protocol';
35
+ export * from './assistant-protocol';
35
36
  export * from './protocol';
36
37
  export * from './turn-evidence';
37
38
  export * from './session-launch';
package/dist/index.js CHANGED
@@ -20,6 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ASSISTANT_OWNER_VERBS: () => ASSISTANT_OWNER_VERBS,
24
+ ASSISTANT_REVIEW_TURN_VERBS: () => ASSISTANT_REVIEW_TURN_VERBS,
25
+ ASSISTANT_SESSION_ID_ARG: () => ASSISTANT_SESSION_ID_ARG,
26
+ ASSISTANT_SESSION_ID_ENV: () => ASSISTANT_SESSION_ID_ENV,
27
+ ASSISTANT_TOOLS: () => ASSISTANT_TOOLS,
28
+ ASSISTANT_TOOL_VERBS: () => ASSISTANT_TOOL_VERBS,
29
+ ASSISTANT_VERB: () => ASSISTANT_VERB,
30
+ ASSISTANT_WRITE_TOOLS: () => ASSISTANT_WRITE_TOOLS,
23
31
  CANCEL_REASONS: () => CANCEL_REASONS,
24
32
  CANONICAL_MESH_TOOL_COUNT: () => CANONICAL_MESH_TOOL_COUNT,
25
33
  CANONICAL_MESH_TOOL_NAMES: () => CANONICAL_MESH_TOOL_NAMES,
@@ -215,6 +223,7 @@ __export(index_exports, {
215
223
  hasGitStatusEvidence: () => hasGitStatusEvidence,
216
224
  hasWorkerProtocolFooter: () => hasWorkerProtocolFooter,
217
225
  interpolateString: () => interpolateString,
226
+ isAssistantTool: () => isAssistantTool,
218
227
  isBlockedStatus: () => isBlockedStatus,
219
228
  isBusyStatus: () => isBusyStatus,
220
229
  isChunkType: () => isChunkType,
@@ -900,18 +909,6 @@ var CLI_SLOT_RECIPES = Object.freeze({
900
909
  maxParallel: 1,
901
910
  rationale: "Easy tasks only; auto model selection."
902
911
  }
903
- ],
904
- "hermes-cli": [
905
- {
906
- difficulty: ["medium"],
907
- maxParallel: 2,
908
- provisional: true,
909
- // NOTE: ESTIMATE, NOT OBSERVED. hermes-cli is absent from the live
910
- // slot configuration this table was seeded from, so `medium` is a
911
- // conservative placement rather than a transcription. Revisit once
912
- // it has real usage data.
913
- rationale: "ESTIMATE \u2014 no live slot to transcribe; conservative mid placement. Adjust after real use."
914
- }
915
912
  ]
916
913
  });
917
914
  var UNKNOWN_CLI_SLOT_RECIPE = Object.freeze({
@@ -1768,7 +1765,7 @@ var MESSAGE_ID_PREFIX = "msg_";
1768
1765
  function isMessageId(value) {
1769
1766
  return typeof value === "string" && value.length > MESSAGE_ID_PREFIX.length && value.startsWith(MESSAGE_ID_PREFIX);
1770
1767
  }
1771
- var OUTBOUND_MESSAGE_ORIGINS = ["dashboard", "mcp", "mesh", "api", "cli"];
1768
+ var OUTBOUND_MESSAGE_ORIGINS = ["dashboard", "mcp", "mesh", "api", "cli", "assistant"];
1772
1769
  function isOutboundMessageOrigin(value) {
1773
1770
  return typeof value === "string" && OUTBOUND_MESSAGE_ORIGINS.includes(value);
1774
1771
  }
@@ -1979,6 +1976,70 @@ function renderCoordinatorWorkerSection() {
1979
1976
  ].join("\n");
1980
1977
  }
1981
1978
 
1979
+ // src/assistant-protocol.ts
1980
+ var ASSISTANT_TOOLS = [
1981
+ "projects",
1982
+ "project_status",
1983
+ "project_send",
1984
+ "project_read",
1985
+ "project_add",
1986
+ "discover_repos",
1987
+ "memory",
1988
+ "skill_view",
1989
+ "skill_manage",
1990
+ "project_note"
1991
+ ];
1992
+ var ASSISTANT_TOOL_SET = new Set(ASSISTANT_TOOLS);
1993
+ function isAssistantTool(value) {
1994
+ return typeof value === "string" && ASSISTANT_TOOL_SET.has(value);
1995
+ }
1996
+ var ASSISTANT_VERB = {
1997
+ // tool verbs
1998
+ projects: "assistant_projects",
1999
+ projectStatus: "assistant_project_status",
2000
+ projectSend: "assistant_project_send",
2001
+ projectRead: "assistant_project_read",
2002
+ projectAdd: "assistant_project_add",
2003
+ discoverRepos: "assistant_discover_repos",
2004
+ memory: "assistant_memory",
2005
+ skillView: "assistant_skill_view",
2006
+ skillManage: "assistant_skill_manage",
2007
+ projectNote: "assistant_project_note",
2008
+ // assistant-side daemon verbs without a tool of the same name
2009
+ launch: "launch_assistant",
2010
+ pendingRelays: "assistant_pending_relays",
2011
+ // owner verbs (dashboard only)
2012
+ stagedResolve: "assistant_staged_resolve",
2013
+ storeAdmin: "assistant_store_admin",
2014
+ importSkills: "assistant_import_skills"
2015
+ };
2016
+ var ASSISTANT_TOOL_VERBS = {
2017
+ projects: ASSISTANT_VERB.projects,
2018
+ project_status: ASSISTANT_VERB.projectStatus,
2019
+ project_send: ASSISTANT_VERB.projectSend,
2020
+ project_read: ASSISTANT_VERB.projectRead,
2021
+ project_add: ASSISTANT_VERB.projectAdd,
2022
+ discover_repos: ASSISTANT_VERB.discoverRepos,
2023
+ memory: ASSISTANT_VERB.memory,
2024
+ skill_view: ASSISTANT_VERB.skillView,
2025
+ skill_manage: ASSISTANT_VERB.skillManage,
2026
+ project_note: ASSISTANT_VERB.projectNote
2027
+ };
2028
+ var ASSISTANT_WRITE_TOOLS = ["memory", "skill_manage", "project_note", "project_send", "project_add"];
2029
+ var ASSISTANT_OWNER_VERBS = [
2030
+ ASSISTANT_VERB.stagedResolve,
2031
+ ASSISTANT_VERB.storeAdmin,
2032
+ ASSISTANT_VERB.importSkills
2033
+ ];
2034
+ var ASSISTANT_REVIEW_TURN_VERBS = [
2035
+ ASSISTANT_VERB.memory,
2036
+ ASSISTANT_VERB.skillView,
2037
+ ASSISTANT_VERB.skillManage,
2038
+ ASSISTANT_VERB.projectNote
2039
+ ];
2040
+ var ASSISTANT_SESSION_ID_ENV = "ADHDEV_ASSISTANT_SESSION_ID";
2041
+ var ASSISTANT_SESSION_ID_ARG = "assistantSessionId";
2042
+
1982
2043
  // src/turn-evidence.ts
1983
2044
  var MESH_TOPIC_PROTOCOL_VERSION = 2;
1984
2045
  var EVIDENCE_SOURCE_IDS = [
@@ -2373,7 +2434,7 @@ var MODEL_AXIS_SOURCES = [
2373
2434
  function isModelAxisSource(value) {
2374
2435
  return typeof value === "string" && MODEL_AXIS_SOURCES.includes(value);
2375
2436
  }
2376
- var SESSION_LAUNCHED_BY = ["dashboard", "mesh", "cli", "api", "restore"];
2437
+ var SESSION_LAUNCHED_BY = ["dashboard", "mesh", "cli", "api", "restore", "assistant"];
2377
2438
  function isSessionLaunchedBy(value) {
2378
2439
  return typeof value === "string" && SESSION_LAUNCHED_BY.includes(value);
2379
2440
  }
@@ -3646,6 +3707,14 @@ function stableMeshNodeRow(row) {
3646
3707
  }
3647
3708
  // Annotate the CommonJS export names for ESM import in node:
3648
3709
  0 && (module.exports = {
3710
+ ASSISTANT_OWNER_VERBS,
3711
+ ASSISTANT_REVIEW_TURN_VERBS,
3712
+ ASSISTANT_SESSION_ID_ARG,
3713
+ ASSISTANT_SESSION_ID_ENV,
3714
+ ASSISTANT_TOOLS,
3715
+ ASSISTANT_TOOL_VERBS,
3716
+ ASSISTANT_VERB,
3717
+ ASSISTANT_WRITE_TOOLS,
3649
3718
  CANCEL_REASONS,
3650
3719
  CANONICAL_MESH_TOOL_COUNT,
3651
3720
  CANONICAL_MESH_TOOL_NAMES,
@@ -3841,6 +3910,7 @@ function stableMeshNodeRow(row) {
3841
3910
  hasGitStatusEvidence,
3842
3911
  hasWorkerProtocolFooter,
3843
3912
  interpolateString,
3913
+ isAssistantTool,
3844
3914
  isBlockedStatus,
3845
3915
  isBusyStatus,
3846
3916
  isChunkType,