@goondocks/myco 0.20.2 → 0.21.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.
Files changed (196) hide show
  1. package/dist/agent-eval-RJSQI5S2.js +355 -0
  2. package/dist/agent-eval-RJSQI5S2.js.map +1 -0
  3. package/dist/{agent-run-X25Q2A6T.js → agent-run-2JSYFOKU.js} +10 -8
  4. package/dist/{agent-run-X25Q2A6T.js.map → agent-run-2JSYFOKU.js.map} +1 -1
  5. package/dist/{agent-tasks-7B6OFERB.js → agent-tasks-APFJIM2T.js} +10 -8
  6. package/dist/{agent-tasks-7B6OFERB.js.map → agent-tasks-APFJIM2T.js.map} +1 -1
  7. package/dist/{chunk-OD4AA7PV.js → chunk-53RPGOEN.js} +56 -8
  8. package/dist/chunk-53RPGOEN.js.map +1 -0
  9. package/dist/chunk-54SXG5HF.js +26 -0
  10. package/dist/chunk-54SXG5HF.js.map +1 -0
  11. package/dist/{chunk-DCSGJ7W4.js → chunk-5ZG4RMUH.js} +2 -2
  12. package/dist/{chunk-FLLBJLHM.js → chunk-6C6QZ4PM.js} +9 -5
  13. package/dist/chunk-6C6QZ4PM.js.map +1 -0
  14. package/dist/chunk-6LB7XELY.js +406 -0
  15. package/dist/chunk-6LB7XELY.js.map +1 -0
  16. package/dist/{chunk-JZGN33AY.js → chunk-75Z7UKDY.js} +4 -4
  17. package/dist/{chunk-XG5RRUYF.js → chunk-BUTL6IFS.js} +2 -2
  18. package/dist/chunk-CESKJD44.js +586 -0
  19. package/dist/chunk-CESKJD44.js.map +1 -0
  20. package/dist/chunk-CISWUP5W.js +101 -0
  21. package/dist/chunk-CISWUP5W.js.map +1 -0
  22. package/dist/chunk-DJ3IHNYO.js +50 -0
  23. package/dist/chunk-DJ3IHNYO.js.map +1 -0
  24. package/dist/chunk-F3OEQYLS.js +847 -0
  25. package/dist/chunk-F3OEQYLS.js.map +1 -0
  26. package/dist/{chunk-6RFZWV4R.js → chunk-FCJ5JV54.js} +1 -1
  27. package/dist/{chunk-6RFZWV4R.js.map → chunk-FCJ5JV54.js.map} +1 -1
  28. package/dist/{chunk-2PDWCDKY.js → chunk-G6QIBNZM.js} +9 -6
  29. package/dist/{chunk-2PDWCDKY.js.map → chunk-G6QIBNZM.js.map} +1 -1
  30. package/dist/{chunk-6X2ERTQV.js → chunk-ILJPRYES.js} +6 -4
  31. package/dist/{chunk-6X2ERTQV.js.map → chunk-ILJPRYES.js.map} +1 -1
  32. package/dist/{chunk-US4LNCAT.js → chunk-IPPMYQ2Y.js} +5 -1
  33. package/dist/chunk-IPPMYQ2Y.js.map +1 -0
  34. package/dist/{chunk-KESLPBKV.js → chunk-JR54LTPP.js} +4 -4
  35. package/dist/{chunk-CCRGY3QW.js → chunk-JZS6GZ6T.js} +16 -94
  36. package/dist/chunk-JZS6GZ6T.js.map +1 -0
  37. package/dist/{chunk-5XIVBO25.js → chunk-LVIY7P35.js} +2 -2
  38. package/dist/chunk-NGH7U6A3.js +13844 -0
  39. package/dist/chunk-NGH7U6A3.js.map +1 -0
  40. package/dist/chunk-OUJSQSKE.js +113 -0
  41. package/dist/chunk-OUJSQSKE.js.map +1 -0
  42. package/dist/{chunk-VVNL26WX.js → chunk-P66DLD6G.js} +22 -10
  43. package/dist/chunk-P66DLD6G.js.map +1 -0
  44. package/dist/{chunk-XATDZX7U.js → chunk-R2JIJBCL.js} +18 -4
  45. package/dist/{chunk-XATDZX7U.js.map → chunk-R2JIJBCL.js.map} +1 -1
  46. package/dist/{chunk-MYOZLMB2.js → chunk-RL5R4CQU.js} +538 -19
  47. package/dist/chunk-RL5R4CQU.js.map +1 -0
  48. package/dist/{chunk-EVDQKYCG.js → chunk-RQSJLWP4.js} +13 -2
  49. package/dist/chunk-RQSJLWP4.js.map +1 -0
  50. package/dist/{chunk-BPRIYNLE.js → chunk-TKAJ3JVF.js} +3 -3
  51. package/dist/{chunk-Q36VMZST.js → chunk-VHNRMM4O.js} +3 -2
  52. package/dist/{chunk-FMRZ26U5.js → chunk-X3IGT5RV.js} +5 -2
  53. package/dist/{chunk-FMRZ26U5.js.map → chunk-X3IGT5RV.js.map} +1 -1
  54. package/dist/{chunk-KHT24OWC.js → chunk-YDUOSRGD.js} +8 -94
  55. package/dist/{chunk-KHT24OWC.js.map → chunk-YDUOSRGD.js.map} +1 -1
  56. package/dist/{cli-GGPWH4UO.js → cli-LNYSTDQM.js} +49 -42
  57. package/dist/cli-LNYSTDQM.js.map +1 -0
  58. package/dist/{client-YXQUTXVZ.js → client-NWE4TCNO.js} +4 -4
  59. package/dist/{config-OMCYHG2S.js → config-VC4ACP42.js} +6 -4
  60. package/dist/{config-OMCYHG2S.js.map → config-VC4ACP42.js.map} +1 -1
  61. package/dist/{detect-providers-5KOPZ7J2.js → detect-providers-ILLQZROY.js} +4 -4
  62. package/dist/{doctor-5JXJ36KA.js → doctor-TI7EZ3RW.js} +48 -15
  63. package/dist/doctor-TI7EZ3RW.js.map +1 -0
  64. package/dist/executor-F2YU7HXJ.js +44 -0
  65. package/dist/{init-LMYOVZAV.js → init-KG3TYVGE.js} +14 -12
  66. package/dist/{init-LMYOVZAV.js.map → init-KG3TYVGE.js.map} +1 -1
  67. package/dist/{installer-FS257JRZ.js → installer-UMH7OJ5A.js} +6 -4
  68. package/dist/{llm-TH4NLIRM.js → llm-AGVEF5XD.js} +5 -4
  69. package/dist/{loader-CQYTFHEW.js → loader-LX7TFRM6.js} +5 -3
  70. package/dist/{loader-NOMBJUPW.js → loader-NAVVZK63.js} +4 -3
  71. package/dist/{main-YTBVRTBI.js → main-5PRQNEEE.js} +2453 -650
  72. package/dist/main-5PRQNEEE.js.map +1 -0
  73. package/dist/{open-HG2DX6RN.js → open-5A27BCSB.js} +10 -8
  74. package/dist/{open-HG2DX6RN.js.map → open-5A27BCSB.js.map} +1 -1
  75. package/dist/{post-compact-JSECI44W.js → post-compact-USAODKPQ.js} +6 -6
  76. package/dist/{post-tool-use-POGPTJBA.js → post-tool-use-GMMSYBII.js} +9 -7
  77. package/dist/post-tool-use-GMMSYBII.js.map +1 -0
  78. package/dist/{post-tool-use-failure-OT7BFWQW.js → post-tool-use-failure-NZVSL2PO.js} +6 -6
  79. package/dist/{pre-compact-OXVODKH4.js → pre-compact-LZ57DLUS.js} +6 -6
  80. package/dist/{provider-check-43LAMSMH.js → provider-check-ZEV5P4KM.js} +4 -4
  81. package/dist/{registry-U4CHXK6R.js → registry-M2Z5QBWH.js} +5 -4
  82. package/dist/{remove-N7ZPELFU.js → remove-T3KE6C5N.js} +10 -8
  83. package/dist/{remove-N7ZPELFU.js.map → remove-T3KE6C5N.js.map} +1 -1
  84. package/dist/{restart-ADG5GBTB.js → restart-YWDEVZUJ.js} +11 -9
  85. package/dist/{restart-ADG5GBTB.js.map → restart-YWDEVZUJ.js.map} +1 -1
  86. package/dist/{search-AHZEUNRR.js → search-GKFDGELR.js} +11 -9
  87. package/dist/{search-AHZEUNRR.js.map → search-GKFDGELR.js.map} +1 -1
  88. package/dist/{server-AGVYZVP5.js → server-AHUR6CWF.js} +368 -269
  89. package/dist/server-AHUR6CWF.js.map +1 -0
  90. package/dist/{session-6IU4AXYP.js → session-2ZEPLWW6.js} +11 -9
  91. package/dist/{session-6IU4AXYP.js.map → session-2ZEPLWW6.js.map} +1 -1
  92. package/dist/{session-end-FT27DWYZ.js → session-end-LWJYQAXX.js} +5 -5
  93. package/dist/session-start-WTA6GCOQ.js +134 -0
  94. package/dist/session-start-WTA6GCOQ.js.map +1 -0
  95. package/dist/{setup-llm-77MP4I2G.js → setup-llm-E7UU5IO7.js} +11 -9
  96. package/dist/{setup-llm-77MP4I2G.js.map → setup-llm-E7UU5IO7.js.map} +1 -1
  97. package/dist/src/agent/definitions/agent.yaml +9 -5
  98. package/dist/src/agent/definitions/tasks/cortex-instructions.yaml +93 -0
  99. package/dist/src/agent/definitions/tasks/cortex-prompt-builder.yaml +67 -0
  100. package/dist/src/agent/definitions/tasks/digest-only.yaml +1 -1
  101. package/dist/src/agent/definitions/tasks/extract-only.yaml +1 -1
  102. package/dist/src/agent/definitions/tasks/review-session.yaml +10 -39
  103. package/dist/src/agent/definitions/tasks/skill-evolve.yaml +4 -4
  104. package/dist/src/agent/definitions/tasks/skill-generate.yaml +1 -1
  105. package/dist/src/agent/definitions/tasks/skill-survey.yaml +2 -6
  106. package/dist/src/agent/definitions/tasks/supersession-sweep.yaml +1 -1
  107. package/dist/src/agent/definitions/tasks/title-summary.yaml +12 -19
  108. package/dist/src/agent/definitions/tasks/{full-intelligence.yaml → vault-evolve.yaml} +17 -82
  109. package/dist/src/agent/definitions/tasks/vault-seed.yaml +370 -0
  110. package/dist/src/agent/prompts/agent.md +12 -38
  111. package/dist/src/cli.js +1 -1
  112. package/dist/src/daemon/main.js +1 -1
  113. package/dist/src/hooks/post-tool-use.js +1 -1
  114. package/dist/src/hooks/session-end.js +1 -1
  115. package/dist/src/hooks/session-start.js +1 -1
  116. package/dist/src/hooks/stop.js +1 -1
  117. package/dist/src/hooks/user-prompt-submit.js +1 -1
  118. package/dist/src/mcp/server.js +1 -1
  119. package/dist/src/symbionts/manifests/claude-code.yaml +4 -0
  120. package/dist/src/symbionts/manifests/pi.yaml +22 -0
  121. package/dist/src/symbionts/templates/pi/package.json +6 -0
  122. package/dist/src/symbionts/templates/pi/plugin.ts +559 -0
  123. package/dist/{stats-NVPWOYTE.js → stats-DFG6S23S.js} +11 -9
  124. package/dist/{stats-NVPWOYTE.js.map → stats-DFG6S23S.js.map} +1 -1
  125. package/dist/{stop-ZPIKVLH4.js → stop-WRBTXEVT.js} +5 -5
  126. package/dist/{stop-failure-2PX67YJC.js → stop-failure-32MGIG2Q.js} +6 -6
  127. package/dist/{subagent-start-UUE6EHQD.js → subagent-start-VFGHQFVL.js} +6 -6
  128. package/dist/{subagent-stop-KQWWWPE6.js → subagent-stop-663FXG3P.js} +6 -6
  129. package/dist/{task-completed-WMHOFQ7B.js → task-completed-ZCQYEFMZ.js} +6 -6
  130. package/dist/{team-LRZ6GTQK.js → team-JTI5CDUO.js} +7 -5
  131. package/dist/{turns-YFNI5CQC.js → turns-HU2CTZAP.js} +2 -2
  132. package/dist/ui/assets/index-DGf1h-Ha.js +842 -0
  133. package/dist/ui/assets/index-_OP4ifzH.css +1 -0
  134. package/dist/ui/index.html +2 -2
  135. package/dist/{update-O6V4RC4W.js → update-3NBQTG32.js} +10 -8
  136. package/dist/{update-O6V4RC4W.js.map → update-3NBQTG32.js.map} +1 -1
  137. package/dist/{user-prompt-submit-N36KUPHI.js → user-prompt-submit-ME2TBKOS.js} +8 -7
  138. package/dist/{user-prompt-submit-N36KUPHI.js.map → user-prompt-submit-ME2TBKOS.js.map} +1 -1
  139. package/dist/{verify-LXPV7NYG.js → verify-R76ZFJSZ.js} +8 -5
  140. package/dist/{verify-LXPV7NYG.js.map → verify-R76ZFJSZ.js.map} +1 -1
  141. package/dist/{version-XMPPJQHR.js → version-GQAFBBPX.js} +2 -2
  142. package/dist/version-GQAFBBPX.js.map +1 -0
  143. package/package.json +3 -1
  144. package/skills/myco/SKILL.md +16 -1
  145. package/skills/myco/references/cli-usage.md +1 -1
  146. package/skills/myco-curate/SKILL.md +1 -1
  147. package/dist/chunk-4YFKBL3F.js +0 -195
  148. package/dist/chunk-4YFKBL3F.js.map +0 -1
  149. package/dist/chunk-CCRGY3QW.js.map +0 -1
  150. package/dist/chunk-EVDQKYCG.js.map +0 -1
  151. package/dist/chunk-FLLBJLHM.js.map +0 -1
  152. package/dist/chunk-MYOZLMB2.js.map +0 -1
  153. package/dist/chunk-OD4AA7PV.js.map +0 -1
  154. package/dist/chunk-US4LNCAT.js.map +0 -1
  155. package/dist/chunk-UYMFCYBF.js +0 -2326
  156. package/dist/chunk-UYMFCYBF.js.map +0 -1
  157. package/dist/chunk-VVNL26WX.js.map +0 -1
  158. package/dist/cli-GGPWH4UO.js.map +0 -1
  159. package/dist/doctor-5JXJ36KA.js.map +0 -1
  160. package/dist/executor-HWW2QNZQ.js +0 -2472
  161. package/dist/executor-HWW2QNZQ.js.map +0 -1
  162. package/dist/main-YTBVRTBI.js.map +0 -1
  163. package/dist/post-tool-use-POGPTJBA.js.map +0 -1
  164. package/dist/server-AGVYZVP5.js.map +0 -1
  165. package/dist/session-start-LAFICHII.js +0 -189
  166. package/dist/session-start-LAFICHII.js.map +0 -1
  167. package/dist/src/agent/definitions/tasks/graph-maintenance.yaml +0 -93
  168. package/dist/ui/assets/index-C2JuNtRB.css +0 -1
  169. package/dist/ui/assets/index-JLVaQKV2.js +0 -832
  170. /package/dist/{chunk-DCSGJ7W4.js.map → chunk-5ZG4RMUH.js.map} +0 -0
  171. /package/dist/{chunk-JZGN33AY.js.map → chunk-75Z7UKDY.js.map} +0 -0
  172. /package/dist/{chunk-XG5RRUYF.js.map → chunk-BUTL6IFS.js.map} +0 -0
  173. /package/dist/{chunk-KESLPBKV.js.map → chunk-JR54LTPP.js.map} +0 -0
  174. /package/dist/{chunk-5XIVBO25.js.map → chunk-LVIY7P35.js.map} +0 -0
  175. /package/dist/{chunk-BPRIYNLE.js.map → chunk-TKAJ3JVF.js.map} +0 -0
  176. /package/dist/{chunk-Q36VMZST.js.map → chunk-VHNRMM4O.js.map} +0 -0
  177. /package/dist/{client-YXQUTXVZ.js.map → client-NWE4TCNO.js.map} +0 -0
  178. /package/dist/{detect-providers-5KOPZ7J2.js.map → detect-providers-ILLQZROY.js.map} +0 -0
  179. /package/dist/{installer-FS257JRZ.js.map → executor-F2YU7HXJ.js.map} +0 -0
  180. /package/dist/{llm-TH4NLIRM.js.map → installer-UMH7OJ5A.js.map} +0 -0
  181. /package/dist/{loader-CQYTFHEW.js.map → llm-AGVEF5XD.js.map} +0 -0
  182. /package/dist/{loader-NOMBJUPW.js.map → loader-LX7TFRM6.js.map} +0 -0
  183. /package/dist/{provider-check-43LAMSMH.js.map → loader-NAVVZK63.js.map} +0 -0
  184. /package/dist/{post-compact-JSECI44W.js.map → post-compact-USAODKPQ.js.map} +0 -0
  185. /package/dist/{post-tool-use-failure-OT7BFWQW.js.map → post-tool-use-failure-NZVSL2PO.js.map} +0 -0
  186. /package/dist/{pre-compact-OXVODKH4.js.map → pre-compact-LZ57DLUS.js.map} +0 -0
  187. /package/dist/{registry-U4CHXK6R.js.map → provider-check-ZEV5P4KM.js.map} +0 -0
  188. /package/dist/{team-LRZ6GTQK.js.map → registry-M2Z5QBWH.js.map} +0 -0
  189. /package/dist/{session-end-FT27DWYZ.js.map → session-end-LWJYQAXX.js.map} +0 -0
  190. /package/dist/{stop-ZPIKVLH4.js.map → stop-WRBTXEVT.js.map} +0 -0
  191. /package/dist/{stop-failure-2PX67YJC.js.map → stop-failure-32MGIG2Q.js.map} +0 -0
  192. /package/dist/{subagent-start-UUE6EHQD.js.map → subagent-start-VFGHQFVL.js.map} +0 -0
  193. /package/dist/{subagent-stop-KQWWWPE6.js.map → subagent-stop-663FXG3P.js.map} +0 -0
  194. /package/dist/{task-completed-WMHOFQ7B.js.map → task-completed-ZCQYEFMZ.js.map} +0 -0
  195. /package/dist/{turns-YFNI5CQC.js.map → team-JTI5CDUO.js.map} +0 -0
  196. /package/dist/{version-XMPPJQHR.js.map → turns-HU2CTZAP.js.map} +0 -0
@@ -1,21 +1,46 @@
1
1
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
2
+ import {
3
+ COLLECTIVE_TOOL_DEFINITIONS,
4
+ TOOL_COLLECTIVE_PROJECT,
5
+ TOOL_COLLECTIVE_PROJECTS,
6
+ TOOL_COLLECTIVE_SEARCH,
7
+ TOOL_CONSOLIDATE,
8
+ TOOL_CONTEXT,
9
+ TOOL_CORTEX,
10
+ TOOL_DEFINITIONS,
11
+ TOOL_DIGEST_REVISIONS,
12
+ TOOL_EVALUATIONS,
13
+ TOOL_GRAPH,
14
+ TOOL_PHASE_AUDIT,
15
+ TOOL_PLANS,
16
+ TOOL_RECALL,
17
+ TOOL_REMEMBER,
18
+ TOOL_RESUME_RUN,
19
+ TOOL_RUNS,
20
+ TOOL_SAVE_PLAN,
21
+ TOOL_SEARCH,
22
+ TOOL_SESSIONS,
23
+ TOOL_SKILLS,
24
+ TOOL_SKILL_CANDIDATES,
25
+ TOOL_SUPERSEDE,
26
+ TOOL_TEAM,
27
+ TOOL_WRITE_INTENTS
28
+ } from "./chunk-CESKJD44.js";
2
29
  import "./chunk-POEPHBQK.js";
3
30
  import {
4
31
  resolveVaultDir
5
32
  } from "./chunk-CUDIZJY7.js";
6
33
  import {
7
34
  DaemonClient
8
- } from "./chunk-VVNL26WX.js";
35
+ } from "./chunk-P66DLD6G.js";
9
36
  import {
10
37
  getPluginVersion
11
- } from "./chunk-XG5RRUYF.js";
38
+ } from "./chunk-BUTL6IFS.js";
12
39
  import "./chunk-LPUQPDC2.js";
13
40
  import {
14
41
  DAEMON_CLIENT_TIMEOUT_MS,
15
- MCP_SEARCH_DEFAULT_LIMIT,
16
- MCP_SESSIONS_DEFAULT_LIMIT,
17
- MCP_SKILLS_DEFAULT_LIMIT
18
- } from "./chunk-FLLBJLHM.js";
42
+ MCP_SEARCH_DEFAULT_LIMIT
43
+ } from "./chunk-6C6QZ4PM.js";
19
44
  import "./chunk-UUHLLQXO.js";
20
45
  import "./chunk-ODXLRR4U.js";
21
46
  import {
@@ -25,7 +50,6 @@ import {
25
50
  boolean,
26
51
  custom,
27
52
  discriminatedUnion,
28
- external_exports,
29
53
  intersection,
30
54
  iso_exports,
31
55
  literal,
@@ -14104,10 +14128,42 @@ async function handleMycoRemember(input, client) {
14104
14128
  return result.data;
14105
14129
  }
14106
14130
 
14131
+ // src/mcp/tools/error.ts
14132
+ function extractErrorMessage(data, fallback) {
14133
+ if (typeof data === "string") return data;
14134
+ if (typeof data !== "object" || data === null) return fallback;
14135
+ const rawError = data.error;
14136
+ if (typeof rawError === "string") return rawError;
14137
+ if (typeof rawError === "object" && rawError !== null && "message" in rawError && typeof rawError.message === "string") {
14138
+ return rawError.message;
14139
+ }
14140
+ return fallback;
14141
+ }
14142
+
14107
14143
  // src/mcp/tools/plans.ts
14108
14144
  async function handleMycoPlans(input, client) {
14145
+ const op = input.op ?? "list";
14146
+ if (op === "delete") {
14147
+ if (!input.id) {
14148
+ return { ok: false, error: "id is required for op: delete" };
14149
+ }
14150
+ const body = input.force_remote ? { force_remote: true } : void 0;
14151
+ const result2 = await client.delete(`/api/plans/${encodeURIComponent(input.id)}`, body);
14152
+ if (!result2.ok) {
14153
+ return { ok: false, error: extractErrorMessage(result2.data, "delete_failed") };
14154
+ }
14155
+ return {
14156
+ ok: Boolean(result2.data?.ok),
14157
+ id: result2.data?.id,
14158
+ session_id: result2.data?.session_id ?? null
14159
+ };
14160
+ }
14161
+ if (input.id && input.session) {
14162
+ return { ok: false, error: "Pass either id or session, not both" };
14163
+ }
14109
14164
  const endpoint = buildEndpoint("/api/mcp/plans", {
14110
14165
  id: input.id,
14166
+ session: input.session,
14111
14167
  status: input.status,
14112
14168
  limit: input.limit
14113
14169
  });
@@ -14116,6 +14172,25 @@ async function handleMycoPlans(input, client) {
14116
14172
  return result.data.plans;
14117
14173
  }
14118
14174
 
14175
+ // src/mcp/tools/save-plan.ts
14176
+ async function handleMycoSavePlan(input, client) {
14177
+ const result = await client.post("/api/mcp/plans", {
14178
+ session_id: input.session_id,
14179
+ content: input.content,
14180
+ source_path: input.source_path,
14181
+ plan_key: input.plan_key,
14182
+ title: input.title,
14183
+ status: input.status,
14184
+ tags: input.tags
14185
+ });
14186
+ if (!result.ok || !result.data) {
14187
+ const rawError = result.data?.error;
14188
+ const message = typeof rawError === "string" ? rawError : typeof rawError === "object" && rawError !== null && "message" in rawError ? String(rawError.message) : "unknown";
14189
+ return { ok: false, error: message };
14190
+ }
14191
+ return { ok: true, ...result.data };
14192
+ }
14193
+
14119
14194
  // src/mcp/tools/sessions.ts
14120
14195
  async function handleMycoSessions(input, client) {
14121
14196
  const endpoint = buildEndpoint("/api/mcp/sessions", {
@@ -14294,276 +14369,206 @@ async function handleCollectiveProject(input, client) {
14294
14369
  return result.data?.project ?? null;
14295
14370
  }
14296
14371
 
14297
- // src/vault/types.ts
14298
- var SessionFrontmatterSchema = external_exports.object({
14299
- type: external_exports.literal("session"),
14300
- id: external_exports.string(),
14301
- agent: external_exports.string(),
14302
- user: external_exports.string(),
14303
- started: external_exports.string(),
14304
- ended: external_exports.string().optional(),
14305
- parent: external_exports.string().optional(),
14306
- parent_reason: external_exports.string().optional(),
14307
- plan: external_exports.string().optional(),
14308
- // backward compat read path
14309
- plans: external_exports.array(external_exports.string()).optional(),
14310
- // new: multiple plans
14311
- branch: external_exports.string().optional(),
14312
- tags: external_exports.array(external_exports.string()).default([]),
14313
- tools_used: external_exports.number().int().optional(),
14314
- files_changed: external_exports.number().int().optional()
14315
- });
14316
- var PLAN_STATUSES = ["active", "in_progress", "completed", "abandoned"];
14317
- var PlanFrontmatterSchema = external_exports.object({
14318
- type: external_exports.literal("plan"),
14319
- id: external_exports.string(),
14320
- status: external_exports.enum(PLAN_STATUSES).default("active"),
14321
- created: external_exports.string(),
14322
- author: external_exports.string().optional(),
14323
- tags: external_exports.array(external_exports.string()).default([])
14324
- });
14325
- var OBSERVATION_TYPES = ["gotcha", "bug_fix", "decision", "discovery", "trade_off", "cross-cutting"];
14326
- var SPORE_STATUSES = ["active", "superseded", "archived"];
14327
- var SporeFrontmatterSchema = external_exports.object({
14328
- type: external_exports.literal("spore"),
14329
- id: external_exports.string(),
14330
- observation_type: external_exports.string(),
14331
- status: external_exports.enum(SPORE_STATUSES).default("active"),
14332
- session: external_exports.string().optional(),
14333
- plan: external_exports.string().optional(),
14334
- superseded_by: external_exports.string().optional(),
14335
- consolidated_from: external_exports.array(external_exports.string()).optional(),
14336
- created: external_exports.string(),
14337
- tags: external_exports.array(external_exports.string()).default([])
14338
- });
14339
- var ARTIFACT_TYPES = ["spec", "plan", "rfc", "doc", "other"];
14340
- var ArtifactFrontmatterSchema = external_exports.object({
14341
- type: external_exports.literal("artifact"),
14342
- id: external_exports.string(),
14343
- artifact_type: external_exports.enum(ARTIFACT_TYPES).default("other"),
14344
- source_path: external_exports.string(),
14345
- title: external_exports.string(),
14346
- last_captured_by: external_exports.string(),
14347
- created: external_exports.string(),
14348
- updated: external_exports.string(),
14349
- tags: external_exports.array(external_exports.string()).default([])
14350
- });
14351
- var TeamMemberFrontmatterSchema = external_exports.object({
14352
- type: external_exports.literal("team-member"),
14353
- user: external_exports.string(),
14354
- joined: external_exports.string(),
14355
- role: external_exports.string().optional(),
14356
- tags: external_exports.array(external_exports.string()).default([])
14357
- });
14358
-
14359
- // src/mcp/tool-definitions.ts
14360
- var PLAN_STATUS_FILTER = [...PLAN_STATUSES, "all"];
14361
- var TOOL_SEARCH = "myco_search";
14362
- var TOOL_RECALL = "myco_recall";
14363
- var TOOL_REMEMBER = "myco_remember";
14364
- var TOOL_PLANS = "myco_plans";
14365
- var TOOL_SESSIONS = "myco_sessions";
14366
- var TOOL_TEAM = "myco_team";
14367
- var TOOL_GRAPH = "myco_graph";
14368
- var TOOL_SUPERSEDE = "myco_supersede";
14369
- var TOOL_CONSOLIDATE = "myco_consolidate";
14370
- var TOOL_CONTEXT = "myco_context";
14371
- var TOOL_SKILLS = "myco_skills";
14372
- var TOOL_SKILL_CANDIDATES = "myco_skill_candidates";
14373
- var TOOL_COLLECTIVE_SEARCH = "collective_search";
14374
- var TOOL_COLLECTIVE_PROJECTS = "collective_projects";
14375
- var TOOL_COLLECTIVE_PROJECT = "collective_project";
14376
- var PROP_BRANCH = "Git branch name to find related sessions and plans";
14377
- var PROP_SINCE = "ISO timestamp \u2014 entries after this date";
14378
- var PROP_TAGS = "Tags for discoverability \u2014 component names, technologies, concepts";
14379
- var TOOL_DEFINITIONS = [
14380
- {
14381
- name: TOOL_SEARCH,
14382
- description: "Search the vault for prior sessions, spores, plans, and artifacts. Use before making design decisions, when debugging non-obvious issues, or when wondering why code is structured a certain way.",
14383
- inputSchema: {
14384
- type: "object",
14385
- properties: {
14386
- query: { type: "string", description: "Natural language search query \u2014 describe what you are looking for" },
14387
- type: { type: "string", enum: ["session", "plan", "spore", "all"], description: "Filter by note type (default: all)" },
14388
- limit: { type: "number", description: `Max results (default: ${MCP_SEARCH_DEFAULT_LIMIT})` }
14389
- },
14390
- required: ["query"]
14391
- }
14392
- },
14393
- {
14394
- name: TOOL_RECALL,
14395
- description: "Look up a specific vault note by ID \u2014 returns the full content of a session, spore, or plan. Use when you have a note ID from search results or graph traversal and need the complete details.",
14396
- inputSchema: {
14397
- type: "object",
14398
- properties: {
14399
- note_id: { type: "string", description: 'Note ID to look up (e.g., "session-abc123", "decision-xyz789", "plan-feature-x")' }
14400
- },
14401
- required: ["note_id"]
14402
- }
14403
- },
14404
- {
14405
- name: TOOL_REMEMBER,
14406
- description: "Save a decision, gotcha, bug fix, discovery, or trade-off as a permanent spore. Use after making a key decision, fixing a tricky bug, discovering something non-obvious, or encountering a gotcha. Session association is derived by the daemon \u2014 the MCP client does not pass it.",
14407
- inputSchema: {
14408
- type: "object",
14409
- properties: {
14410
- content: { type: "string", description: "The observation \u2014 include context, reasoning, and what someone encountering this in the future needs to know" },
14411
- type: { type: "string", enum: OBSERVATION_TYPES, description: `Observation type: ${OBSERVATION_TYPES.join(", ")}` },
14412
- tags: { type: "array", items: { type: "string" }, description: PROP_TAGS }
14413
- },
14414
- required: ["content", "type"]
14415
- }
14416
- },
14417
- {
14418
- name: TOOL_PLANS,
14419
- description: "List active implementation plans and their status. Use to check what work is in flight before starting new tasks.",
14420
- inputSchema: {
14421
- type: "object",
14422
- properties: {
14423
- status: { type: "string", enum: PLAN_STATUS_FILTER, description: "Filter by status (default: all statuses)" },
14424
- id: { type: "string", description: "Get a specific plan by ID" }
14425
- }
14372
+ // src/mcp/tools/cortex.ts
14373
+ async function handleMycoCortex(input, client) {
14374
+ switch (input.op) {
14375
+ case "get": {
14376
+ const result = await client.get("/api/cortex/instructions");
14377
+ if (!result.ok) return { ok: false, op: input.op, error: "fetch_failed" };
14378
+ return { ok: true, op: input.op, data: result.data };
14379
+ }
14380
+ case "refresh": {
14381
+ const result = await client.post("/api/cortex/instructions/refresh", {});
14382
+ if (!result.ok) return { ok: false, op: input.op, error: "refresh_failed" };
14383
+ return { ok: true, op: input.op, data: result.data };
14384
+ }
14385
+ case "build_prompt": {
14386
+ if (!input.goal || input.goal.trim().length === 0) {
14387
+ return { ok: false, op: input.op, error: "goal is required" };
14388
+ }
14389
+ const body = { goal: input.goal };
14390
+ if (input.symbiont) body.symbiont = input.symbiont;
14391
+ const result = await client.post("/api/cortex/prompt-builder", body);
14392
+ if (!result.ok) return { ok: false, op: input.op, error: "build_prompt_failed" };
14393
+ return { ok: true, op: input.op, data: result.data };
14394
+ }
14395
+ case "get_prompt_result": {
14396
+ if (!input.run_id) {
14397
+ return { ok: false, op: input.op, error: "run_id is required" };
14398
+ }
14399
+ const result = await client.get(
14400
+ `/api/cortex/prompt-builder/${encodeURIComponent(input.run_id)}`
14401
+ );
14402
+ if (!result.ok) {
14403
+ return { ok: false, op: input.op, error: "not_ready_or_not_found" };
14404
+ }
14405
+ return { ok: true, op: input.op, data: result.data };
14406
+ }
14407
+ default: {
14408
+ const _exhaustive = input.op;
14409
+ return { ok: false, op: _exhaustive, error: "unknown_op" };
14426
14410
  }
14427
- },
14428
- {
14429
- name: TOOL_SESSIONS,
14430
- description: "Browse past coding sessions with summaries, tools used, and linked spores. Use to understand what work has been done on a feature or branch.",
14431
- inputSchema: {
14432
- type: "object",
14433
- properties: {
14434
- plan: { type: "string", description: "Filter to the session linked to this plan id" },
14435
- branch: { type: "string", description: PROP_BRANCH },
14436
- user: { type: "string", description: "Filter sessions by user" },
14437
- since: { type: "string", description: PROP_SINCE },
14438
- status: { type: "string", description: "Filter by session status (e.g., active, completed)" },
14439
- limit: { type: "number", description: `Max results (default: ${MCP_SESSIONS_DEFAULT_LIMIT})` }
14440
- }
14441
- }
14442
- },
14443
- {
14444
- name: TOOL_TEAM,
14445
- description: "List team members registered in the vault. Returns id, user, role, joined, and tags per member. Phase-1 scope: no filters.",
14446
- inputSchema: {
14447
- type: "object",
14448
- properties: {}
14449
- }
14450
- },
14451
- {
14452
- name: TOOL_GRAPH,
14453
- description: "Traverse connections between records via graph edges \u2014 explore how sessions, spores, and plans relate to each other.",
14454
- inputSchema: {
14455
- type: "object",
14456
- properties: {
14457
- note_id: { type: "string", description: 'Note ID to start from (e.g., "session-abc123" or "decision-xyz789")' },
14458
- direction: { type: "string", enum: ["incoming", "outgoing", "both"], description: "Link direction to follow (default: both)" },
14459
- depth: { type: "number", description: "How many hops to traverse, 1-3 (default: 1)" }
14460
- },
14461
- required: ["note_id"]
14462
- }
14463
- },
14464
- {
14465
- name: TOOL_SUPERSEDE,
14466
- description: "Mark a spore as outdated and replaced by a newer one. Use when a decision was reversed, a gotcha was fixed, a discovery was wrong, or the codebase changed and an observation no longer applies. The old spore is preserved but marked superseded.",
14467
- inputSchema: {
14468
- type: "object",
14469
- properties: {
14470
- old_spore_id: { type: "string", description: 'ID of the outdated spore (e.g., "decision-abc123")' },
14471
- new_spore_id: { type: "string", description: "ID of the replacement spore" },
14472
- reason: { type: "string", description: "Why the old spore is being superseded" }
14473
- },
14474
- required: ["old_spore_id", "new_spore_id"]
14475
- }
14476
- },
14477
- {
14478
- name: TOOL_CONSOLIDATE,
14479
- description: "Merge 2+ related spores into a single comprehensive wisdom note. Inserts a new spore with the consolidated content; each source spore is marked superseded with a resolution_events row linking it to the new wisdom spore. Use when multiple observations describe aspects of the same insight, share a root cause, or would be more useful as one reference.",
14480
- inputSchema: {
14481
- type: "object",
14482
- properties: {
14483
- source_spore_ids: { type: "array", items: { type: "string" }, description: "IDs of the spores to merge (minimum 2)" },
14484
- consolidated_content: { type: "string", description: "The merged, comprehensive content \u2014 synthesize, do not just concatenate" },
14485
- observation_type: { type: "string", enum: OBSERVATION_TYPES, description: `Type for the consolidated wisdom note: ${OBSERVATION_TYPES.join(", ")}` },
14486
- tags: { type: "array", items: { type: "string" }, description: PROP_TAGS },
14487
- reason: { type: "string", description: "Optional reason recorded on each resolution event" }
14488
- },
14489
- required: ["source_spore_ids", "consolidated_content", "observation_type"]
14411
+ }
14412
+ }
14413
+
14414
+ // src/mcp/tools/runs.ts
14415
+ async function handleMycoRuns(input, client) {
14416
+ const op = input.op ?? "list";
14417
+ if (op === "get") {
14418
+ if (!input.id) {
14419
+ return { ok: false, op, error: "id is required for op: get" };
14490
14420
  }
14491
- },
14492
- {
14493
- name: TOOL_CONTEXT,
14494
- description: "Retrieve Myco's pre-computed project digest \u2014 a rich, always-current synthesis of project history, decisions, patterns, active work, and institutional knowledge. Call this at the start of a new task or session to orient yourself on the project before taking action; call it again after long interruptions or when switching contexts. This is NOT a search \u2014 it's the project's accumulated understanding, served instantly. Available tiers: 1500 (executive briefing, one-screen overview), 5000 (deep onboarding, default), 10000 (comprehensive institutional knowledge). Prefer this over myco_search when you need broad project orientation; use myco_search when you need to find specific prior decisions or bug fixes.",
14495
- inputSchema: {
14496
- type: "object",
14497
- properties: {
14498
- tier: {
14499
- type: "number",
14500
- enum: [1500, 5e3, 1e4],
14501
- description: "Token budget tier. Larger tiers include more detail. Default: 5000."
14502
- }
14503
- }
14421
+ const result2 = await client.get(
14422
+ `/api/agent/runs/${encodeURIComponent(input.id)}`
14423
+ );
14424
+ if (!result2.ok) {
14425
+ return { ok: false, op, error: "not_found" };
14504
14426
  }
14505
- },
14506
- {
14507
- name: TOOL_SKILLS,
14508
- description: "List and inspect skills generated by Myco. Use to see what skills are active, check skill details, or find skills by status.",
14509
- inputSchema: {
14510
- type: "object",
14511
- properties: {
14512
- id: { type: "string", description: "Get a specific skill by ID or name" },
14513
- status: { type: "string", description: "Filter by status: active, stale, retired" },
14514
- limit: { type: "number", description: `Max results (default: ${MCP_SKILLS_DEFAULT_LIMIT})` }
14515
- }
14427
+ return { ok: true, op, data: result2.data };
14428
+ }
14429
+ const endpoint = buildEndpoint("/api/agent/runs", {
14430
+ task: input.task,
14431
+ agentId: input.agent_id,
14432
+ limit: input.limit
14433
+ });
14434
+ const result = await client.get(endpoint);
14435
+ if (!result.ok) {
14436
+ return { ok: false, op, error: "fetch_failed" };
14437
+ }
14438
+ return { ok: true, op, data: result.data };
14439
+ }
14440
+
14441
+ // src/mcp/tools/evaluations.ts
14442
+ async function handleMycoEvaluations(input, client) {
14443
+ const op = input.op ?? "list";
14444
+ if (op === "get") {
14445
+ if (!input.id) {
14446
+ return { ok: false, op, error: "id is required for op: get" };
14516
14447
  }
14517
- },
14518
- {
14519
- name: TOOL_SKILL_CANDIDATES,
14520
- description: "List and manage skill candidates \u2014 observations identified as potential skills. Use to see pending candidates, approve, or dismiss them.",
14521
- inputSchema: {
14522
- type: "object",
14523
- properties: {
14524
- id: { type: "string", description: "Get a specific candidate by ID" },
14525
- action: { type: "string", enum: ["list", "approve", "dismiss"], description: "Action to perform (default: 'list')" },
14526
- status: { type: "string", description: "Filter by status: identified, approved, generated, dismissed" },
14527
- limit: { type: "number", description: `Max results (default: ${MCP_SKILLS_DEFAULT_LIMIT})` }
14528
- }
14448
+ const result2 = await client.get(
14449
+ `/api/agent/evaluations/${encodeURIComponent(input.id)}`
14450
+ );
14451
+ if (!result2.ok) {
14452
+ return {
14453
+ ok: false,
14454
+ op,
14455
+ error: extractErrorMessage(result2.data, "not_found")
14456
+ };
14529
14457
  }
14458
+ return { ok: true, op, data: result2.data };
14530
14459
  }
14531
- ];
14532
- var COLLECTIVE_TOOL_DEFINITIONS = [
14533
- {
14534
- name: TOOL_COLLECTIVE_SEARCH,
14535
- description: "Search across connected projects in the active Myco Collective. Results include project attribution.",
14536
- inputSchema: {
14537
- type: "object",
14538
- properties: {
14539
- query: { type: "string", description: "Natural language search query across the connected Collective projects" },
14540
- project: { type: "string", description: "Optional project id or project name filter" },
14541
- limit: { type: "number", description: `Max results (default: ${MCP_SEARCH_DEFAULT_LIMIT})` }
14542
- },
14543
- required: ["query"]
14460
+ if (op === "create") {
14461
+ if (!input.task_id) {
14462
+ return { ok: false, op, error: "task_id is required for op: create" };
14544
14463
  }
14545
- },
14546
- {
14547
- name: TOOL_COLLECTIVE_PROJECTS,
14548
- description: "List the projects connected to the active Myco Collective.",
14549
- inputSchema: {
14550
- type: "object",
14551
- properties: {}
14464
+ if (input.matrix === void 0 || input.matrix === null) {
14465
+ return { ok: false, op, error: "matrix is required for op: create" };
14552
14466
  }
14553
- },
14554
- {
14555
- name: TOOL_COLLECTIVE_PROJECT,
14556
- description: "Get metadata for a single project connected to the active Myco Collective.",
14557
- inputSchema: {
14558
- type: "object",
14559
- properties: {
14560
- project: { type: "string", description: "Project id or project name" },
14561
- include_digest: { type: "boolean", description: "Request digest information when available" }
14562
- },
14563
- required: ["project"]
14467
+ const body = {
14468
+ taskId: input.task_id,
14469
+ matrix: input.matrix
14470
+ };
14471
+ if (input.notes !== void 0) body.notes = input.notes;
14472
+ const result2 = await client.post("/api/agent/evaluations", body);
14473
+ if (!result2.ok) {
14474
+ return {
14475
+ ok: false,
14476
+ op,
14477
+ error: extractErrorMessage(result2.data, "create_failed")
14478
+ };
14564
14479
  }
14480
+ return { ok: true, op, data: result2.data };
14481
+ }
14482
+ const endpoint = buildEndpoint("/api/agent/evaluations", {
14483
+ status: input.status,
14484
+ limit: input.limit
14485
+ });
14486
+ const result = await client.get(endpoint);
14487
+ if (!result.ok) {
14488
+ return {
14489
+ ok: false,
14490
+ op,
14491
+ error: extractErrorMessage(result.data, "fetch_failed")
14492
+ };
14493
+ }
14494
+ return { ok: true, op, data: result.data };
14495
+ }
14496
+
14497
+ // src/mcp/tools/write-intents.ts
14498
+ async function handleMycoWriteIntents(input, client) {
14499
+ if (!input.run_id) {
14500
+ return { ok: false, error: "run_id is required" };
14501
+ }
14502
+ const endpoint = buildEndpoint(
14503
+ `/api/agent/runs/${encodeURIComponent(input.run_id)}/write-intents`,
14504
+ { limit: input.limit, offset: input.offset }
14505
+ );
14506
+ const result = await client.get(endpoint);
14507
+ if (!result.ok) {
14508
+ return {
14509
+ ok: false,
14510
+ error: extractErrorMessage(result.data, "fetch_failed")
14511
+ };
14512
+ }
14513
+ return { ok: true, data: result.data };
14514
+ }
14515
+
14516
+ // src/mcp/tools/phase-audit.ts
14517
+ async function handleMycoPhaseAudit(input, client) {
14518
+ if (!input.run_id) {
14519
+ return { ok: false, error: "run_id is required" };
14520
+ }
14521
+ const result = await client.get(
14522
+ `/api/agent/runs/${encodeURIComponent(input.run_id)}/audit`
14523
+ );
14524
+ if (!result.ok) {
14525
+ return {
14526
+ ok: false,
14527
+ error: extractErrorMessage(result.data, "not_found")
14528
+ };
14529
+ }
14530
+ return { ok: true, data: result.data };
14531
+ }
14532
+
14533
+ // src/mcp/tools/resume-run.ts
14534
+ async function handleMycoResumeRun(input, client) {
14535
+ if (!input.id) {
14536
+ return { ok: false, error: "id is required" };
14537
+ }
14538
+ const body = {};
14539
+ if (input.mode) body.mode = input.mode;
14540
+ const result = await client.post(
14541
+ `/api/agent/runs/${encodeURIComponent(input.id)}/resume`,
14542
+ body
14543
+ );
14544
+ if (!result.ok) {
14545
+ return {
14546
+ ok: false,
14547
+ error: extractErrorMessage(result.data, "resume_failed")
14548
+ };
14549
+ }
14550
+ return { ok: true, data: result.data };
14551
+ }
14552
+
14553
+ // src/mcp/tools/digest-revisions.ts
14554
+ async function handleMycoDigestRevisions(input, client) {
14555
+ if (input.tier === void 0 || input.tier === null) {
14556
+ return { ok: false, error: "tier is required" };
14557
+ }
14558
+ const endpoint = buildEndpoint("/api/digest/revisions", {
14559
+ agentId: input.agent_id,
14560
+ tier: input.tier,
14561
+ limit: input.limit
14562
+ });
14563
+ const result = await client.get(endpoint);
14564
+ if (!result.ok) {
14565
+ return {
14566
+ ok: false,
14567
+ error: extractErrorMessage(result.data, "fetch_failed")
14568
+ };
14565
14569
  }
14566
- ];
14570
+ return { ok: true, data: result.data };
14571
+ }
14567
14572
 
14568
14573
  // src/mcp/server.ts
14569
14574
  function createMycoServer(vaultDir, client) {
@@ -14634,7 +14639,25 @@ function createMycoServer(vaultDir, client) {
14634
14639
  case TOOL_PLANS: {
14635
14640
  const plansInput = input;
14636
14641
  const result = await handleMycoPlans(plansInput, client);
14637
- logActivity(TOOL_PLANS, { count: result.length, duration_ms: Date.now() - start });
14642
+ const count = Array.isArray(result) ? result.length : void 0;
14643
+ logActivity(TOOL_PLANS, {
14644
+ op: plansInput.op ?? "list",
14645
+ id: plansInput.id,
14646
+ session: plansInput.session,
14647
+ count,
14648
+ duration_ms: Date.now() - start
14649
+ });
14650
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14651
+ }
14652
+ case TOOL_SAVE_PLAN: {
14653
+ const savePlanInput = input;
14654
+ const result = await handleMycoSavePlan(savePlanInput, client);
14655
+ logActivity(TOOL_SAVE_PLAN, {
14656
+ session_id: savePlanInput.session_id,
14657
+ source_path: savePlanInput.source_path,
14658
+ plan_key: savePlanInput.plan_key,
14659
+ duration_ms: Date.now() - start
14660
+ });
14638
14661
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
14639
14662
  }
14640
14663
  case TOOL_SESSIONS: {
@@ -14707,6 +14730,82 @@ function createMycoServer(vaultDir, client) {
14707
14730
  logActivity(TOOL_COLLECTIVE_PROJECT, { project: collectiveInput.project, duration_ms: Date.now() - start });
14708
14731
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
14709
14732
  }
14733
+ case TOOL_CORTEX: {
14734
+ const cortexInput = input;
14735
+ const result = await handleMycoCortex(cortexInput, client);
14736
+ logActivity(TOOL_CORTEX, {
14737
+ op: cortexInput.op,
14738
+ run_id: cortexInput.run_id,
14739
+ ok: result.ok,
14740
+ duration_ms: Date.now() - start
14741
+ });
14742
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14743
+ }
14744
+ case TOOL_RUNS: {
14745
+ const runsInput = input;
14746
+ const result = await handleMycoRuns(runsInput, client);
14747
+ logActivity(TOOL_RUNS, {
14748
+ op: runsInput.op ?? "list",
14749
+ id: runsInput.id,
14750
+ ok: result.ok,
14751
+ duration_ms: Date.now() - start
14752
+ });
14753
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14754
+ }
14755
+ case TOOL_EVALUATIONS: {
14756
+ const evalInput = input;
14757
+ const result = await handleMycoEvaluations(evalInput, client);
14758
+ logActivity(TOOL_EVALUATIONS, {
14759
+ op: evalInput.op ?? "list",
14760
+ id: evalInput.id,
14761
+ task_id: evalInput.task_id,
14762
+ ok: result.ok,
14763
+ duration_ms: Date.now() - start
14764
+ });
14765
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14766
+ }
14767
+ case TOOL_WRITE_INTENTS: {
14768
+ const wiInput = input;
14769
+ const result = await handleMycoWriteIntents(wiInput, client);
14770
+ logActivity(TOOL_WRITE_INTENTS, {
14771
+ run_id: wiInput.run_id,
14772
+ ok: result.ok,
14773
+ duration_ms: Date.now() - start
14774
+ });
14775
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14776
+ }
14777
+ case TOOL_PHASE_AUDIT: {
14778
+ const auditInput = input;
14779
+ const result = await handleMycoPhaseAudit(auditInput, client);
14780
+ logActivity(TOOL_PHASE_AUDIT, {
14781
+ run_id: auditInput.run_id,
14782
+ ok: result.ok,
14783
+ duration_ms: Date.now() - start
14784
+ });
14785
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14786
+ }
14787
+ case TOOL_RESUME_RUN: {
14788
+ const resumeInput = input;
14789
+ const result = await handleMycoResumeRun(resumeInput, client);
14790
+ logActivity(TOOL_RESUME_RUN, {
14791
+ id: resumeInput.id,
14792
+ mode: resumeInput.mode,
14793
+ ok: result.ok,
14794
+ duration_ms: Date.now() - start
14795
+ });
14796
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14797
+ }
14798
+ case TOOL_DIGEST_REVISIONS: {
14799
+ const drInput = input;
14800
+ const result = await handleMycoDigestRevisions(drInput, client);
14801
+ logActivity(TOOL_DIGEST_REVISIONS, {
14802
+ agent_id: drInput.agent_id,
14803
+ tier: drInput.tier,
14804
+ ok: result.ok,
14805
+ duration_ms: Date.now() - start
14806
+ });
14807
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
14808
+ }
14710
14809
  default:
14711
14810
  throw new Error(`Unknown tool: ${name}`);
14712
14811
  }
@@ -14732,4 +14831,4 @@ export {
14732
14831
  createMycoServer,
14733
14832
  main
14734
14833
  };
14735
- //# sourceMappingURL=server-AGVYZVP5.js.map
14834
+ //# sourceMappingURL=server-AHUR6CWF.js.map