@goondocks/myco 0.20.2 → 0.21.1
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/bin/myco-run +68 -7
- package/dist/agent-eval-YK2VP2S4.js +356 -0
- package/dist/agent-eval-YK2VP2S4.js.map +1 -0
- package/dist/{agent-run-X25Q2A6T.js → agent-run-GEJBD2YD.js} +10 -8
- package/dist/{agent-run-X25Q2A6T.js.map → agent-run-GEJBD2YD.js.map} +1 -1
- package/dist/{agent-tasks-7B6OFERB.js → agent-tasks-5XSRGTRX.js} +10 -8
- package/dist/{agent-tasks-7B6OFERB.js.map → agent-tasks-5XSRGTRX.js.map} +1 -1
- package/dist/{chunk-OD4AA7PV.js → chunk-53RPGOEN.js} +56 -8
- package/dist/chunk-53RPGOEN.js.map +1 -0
- package/dist/chunk-54SXG5HF.js +26 -0
- package/dist/chunk-54SXG5HF.js.map +1 -0
- package/dist/{chunk-XATDZX7U.js → chunk-6ALVMIB4.js} +19 -5
- package/dist/{chunk-XATDZX7U.js.map → chunk-6ALVMIB4.js.map} +1 -1
- package/dist/{chunk-FLLBJLHM.js → chunk-6C6QZ4PM.js} +9 -5
- package/dist/chunk-6C6QZ4PM.js.map +1 -0
- package/dist/{chunk-CCRGY3QW.js → chunk-AUIXX33A.js} +24 -95
- package/dist/chunk-AUIXX33A.js.map +1 -0
- package/dist/chunk-CISWUP5W.js +101 -0
- package/dist/chunk-CISWUP5W.js.map +1 -0
- package/dist/{chunk-MYOZLMB2.js → chunk-DTWUHHFI.js} +576 -20
- package/dist/chunk-DTWUHHFI.js.map +1 -0
- package/dist/chunk-EEOJWLMP.js +582 -0
- package/dist/chunk-EEOJWLMP.js.map +1 -0
- package/dist/{chunk-XG5RRUYF.js → chunk-ENZR5NG7.js} +2 -2
- package/dist/{chunk-6RFZWV4R.js → chunk-FCJ5JV54.js} +1 -1
- package/dist/{chunk-6RFZWV4R.js.map → chunk-FCJ5JV54.js.map} +1 -1
- package/dist/{chunk-US4LNCAT.js → chunk-IPPMYQ2Y.js} +5 -1
- package/dist/chunk-IPPMYQ2Y.js.map +1 -0
- package/dist/{chunk-VVNL26WX.js → chunk-KTTSXYEK.js} +22 -10
- package/dist/chunk-KTTSXYEK.js.map +1 -0
- package/dist/chunk-LQIPXVDH.js +17 -0
- package/dist/chunk-LQIPXVDH.js.map +1 -0
- package/dist/{chunk-DCSGJ7W4.js → chunk-N2DGFACQ.js} +3 -3
- package/dist/chunk-N7Z3LUEZ.js +858 -0
- package/dist/chunk-N7Z3LUEZ.js.map +1 -0
- package/dist/{chunk-2PDWCDKY.js → chunk-NFO7BRCO.js} +10 -7
- package/dist/{chunk-2PDWCDKY.js.map → chunk-NFO7BRCO.js.map} +1 -1
- package/dist/{chunk-Q36VMZST.js → chunk-OTQH5KZW.js} +89 -38
- package/dist/chunk-OTQH5KZW.js.map +1 -0
- package/dist/chunk-OUJSQSKE.js +113 -0
- package/dist/chunk-OUJSQSKE.js.map +1 -0
- package/dist/chunk-OZ3FBAK5.js +50 -0
- package/dist/chunk-OZ3FBAK5.js.map +1 -0
- package/dist/chunk-QATYARI5.js +408 -0
- package/dist/chunk-QATYARI5.js.map +1 -0
- package/dist/{chunk-KESLPBKV.js → chunk-QDLVIW2O.js} +4 -4
- package/dist/{chunk-5XIVBO25.js → chunk-QLLBJEM7.js} +6 -2
- package/dist/chunk-QLLBJEM7.js.map +1 -0
- package/dist/{chunk-EVDQKYCG.js → chunk-RQSJLWP4.js} +13 -2
- package/dist/chunk-RQSJLWP4.js.map +1 -0
- package/dist/{chunk-BPRIYNLE.js → chunk-TKAJ3JVF.js} +3 -3
- package/dist/chunk-TSM6VESW.js +25 -0
- package/dist/chunk-TSM6VESW.js.map +1 -0
- package/dist/{chunk-6X2ERTQV.js → chunk-USVFEWYL.js} +6 -4
- package/dist/{chunk-6X2ERTQV.js.map → chunk-USVFEWYL.js.map} +1 -1
- package/dist/{chunk-JZGN33AY.js → chunk-VRI56337.js} +4 -4
- package/dist/chunk-X2IRGXGF.js +14103 -0
- package/dist/chunk-X2IRGXGF.js.map +1 -0
- package/dist/{chunk-FMRZ26U5.js → chunk-X3IGT5RV.js} +5 -2
- package/dist/{chunk-FMRZ26U5.js.map → chunk-X3IGT5RV.js.map} +1 -1
- package/dist/{chunk-KHT24OWC.js → chunk-YDUOSRGD.js} +8 -94
- package/dist/{chunk-KHT24OWC.js.map → chunk-YDUOSRGD.js.map} +1 -1
- package/dist/{chunk-NGROSFOH.js → chunk-Z66IT5KL.js} +14 -9
- package/dist/chunk-Z66IT5KL.js.map +1 -0
- package/dist/{cli-GGPWH4UO.js → cli-HSLIG7EX.js} +50 -43
- package/dist/cli-HSLIG7EX.js.map +1 -0
- package/dist/{client-YXQUTXVZ.js → client-Z43DNLJH.js} +4 -4
- package/dist/{config-OMCYHG2S.js → config-VC4ACP42.js} +6 -4
- package/dist/{config-OMCYHG2S.js.map → config-VC4ACP42.js.map} +1 -1
- package/dist/{detect-PXNM6TA7.js → detect-7NUD5B5R.js} +2 -2
- package/dist/{detect-providers-5KOPZ7J2.js → detect-providers-ILLQZROY.js} +4 -4
- package/dist/{doctor-5JXJ36KA.js → doctor-HJCWHAU4.js} +49 -16
- package/dist/doctor-HJCWHAU4.js.map +1 -0
- package/dist/executor-DO6QFC6G.js +45 -0
- package/dist/{init-LMYOVZAV.js → init-4KVK7W2E.js} +16 -14
- package/dist/{init-LMYOVZAV.js.map → init-4KVK7W2E.js.map} +1 -1
- package/dist/{installer-FS257JRZ.js → installer-N4UTEACX.js} +6 -4
- package/dist/{llm-TH4NLIRM.js → llm-AGVEF5XD.js} +5 -4
- package/dist/{loader-CQYTFHEW.js → loader-LX7TFRM6.js} +5 -3
- package/dist/{loader-NOMBJUPW.js → loader-UDNUMEDA.js} +5 -3
- package/dist/{main-YTBVRTBI.js → main-4J4QZZTZ.js} +2518 -656
- package/dist/main-4J4QZZTZ.js.map +1 -0
- package/dist/{open-HG2DX6RN.js → open-7TXJQM3H.js} +10 -8
- package/dist/{open-HG2DX6RN.js.map → open-7TXJQM3H.js.map} +1 -1
- package/dist/{post-compact-JSECI44W.js → post-compact-7AEFVCZS.js} +8 -8
- package/dist/{post-tool-use-POGPTJBA.js → post-tool-use-TZINWWDH.js} +11 -9
- package/dist/post-tool-use-TZINWWDH.js.map +1 -0
- package/dist/{post-tool-use-failure-OT7BFWQW.js → post-tool-use-failure-TCFEU2GI.js} +8 -8
- package/dist/{pre-compact-OXVODKH4.js → pre-compact-LO2VZCGR.js} +8 -8
- package/dist/{provider-check-43LAMSMH.js → provider-check-ZEV5P4KM.js} +4 -4
- package/dist/{registry-U4CHXK6R.js → registry-F3THYC5M.js} +6 -4
- package/dist/{remove-N7ZPELFU.js → remove-F77AAALE.js} +12 -10
- package/dist/{remove-N7ZPELFU.js.map → remove-F77AAALE.js.map} +1 -1
- package/dist/{restart-ADG5GBTB.js → restart-UEFDPMLT.js} +11 -9
- package/dist/{restart-ADG5GBTB.js.map → restart-UEFDPMLT.js.map} +1 -1
- package/dist/{search-AHZEUNRR.js → search-NHNVUAQQ.js} +11 -9
- package/dist/{search-AHZEUNRR.js.map → search-NHNVUAQQ.js.map} +1 -1
- package/dist/{server-AGVYZVP5.js → server-AZJSTQEK.js} +369 -270
- package/dist/server-AZJSTQEK.js.map +1 -0
- package/dist/{session-6IU4AXYP.js → session-3HLC5KOD.js} +11 -9
- package/dist/{session-6IU4AXYP.js.map → session-3HLC5KOD.js.map} +1 -1
- package/dist/{session-end-FT27DWYZ.js → session-end-FS46UARX.js} +7 -7
- package/dist/session-start-46KPFV2H.js +134 -0
- package/dist/session-start-46KPFV2H.js.map +1 -0
- package/dist/{setup-llm-77MP4I2G.js → setup-llm-JMWSNQ2C.js} +11 -9
- package/dist/{setup-llm-77MP4I2G.js.map → setup-llm-JMWSNQ2C.js.map} +1 -1
- package/dist/src/agent/definitions/agent.yaml +9 -5
- package/dist/src/agent/definitions/tasks/cortex-instructions.yaml +115 -0
- package/dist/src/agent/definitions/tasks/cortex-prompt-builder.yaml +67 -0
- package/dist/src/agent/definitions/tasks/digest-only.yaml +1 -1
- package/dist/src/agent/definitions/tasks/extract-only.yaml +1 -1
- package/dist/src/agent/definitions/tasks/review-session.yaml +10 -39
- package/dist/src/agent/definitions/tasks/skill-evolve.yaml +181 -25
- package/dist/src/agent/definitions/tasks/skill-generate.yaml +21 -7
- package/dist/src/agent/definitions/tasks/skill-survey.yaml +2 -6
- package/dist/src/agent/definitions/tasks/supersession-sweep.yaml +1 -1
- package/dist/src/agent/definitions/tasks/title-summary.yaml +12 -19
- package/dist/src/agent/definitions/tasks/{full-intelligence.yaml → vault-evolve.yaml} +74 -129
- package/dist/src/agent/definitions/tasks/vault-seed.yaml +370 -0
- package/dist/src/agent/prompts/agent.md +12 -38
- package/dist/src/cli.js +1 -1
- package/dist/src/daemon/main.js +1 -1
- package/dist/src/hooks/post-tool-use.js +1 -1
- package/dist/src/hooks/session-end.js +1 -1
- package/dist/src/hooks/session-start.js +1 -1
- package/dist/src/hooks/stop.js +1 -1
- package/dist/src/hooks/user-prompt-submit.js +1 -1
- package/dist/src/mcp/server.js +1 -1
- package/dist/src/symbionts/manifests/claude-code.yaml +4 -0
- package/dist/src/symbionts/manifests/opencode.yaml +7 -0
- package/dist/src/symbionts/manifests/pi.yaml +22 -0
- package/dist/src/symbionts/templates/agents-starter.md +1 -1
- package/dist/src/symbionts/templates/pi/package.json +6 -0
- package/dist/src/symbionts/templates/pi/plugin.ts +559 -0
- package/dist/{stats-NVPWOYTE.js → stats-MKMETHMA.js} +11 -9
- package/dist/{stats-NVPWOYTE.js.map → stats-MKMETHMA.js.map} +1 -1
- package/dist/{stop-ZPIKVLH4.js → stop-OUEX6KA4.js} +7 -7
- package/dist/{stop-failure-2PX67YJC.js → stop-failure-2BWVNZEG.js} +8 -8
- package/dist/{subagent-start-UUE6EHQD.js → subagent-start-J4VV6DEE.js} +8 -8
- package/dist/{subagent-stop-KQWWWPE6.js → subagent-stop-JMLVEPIA.js} +8 -8
- package/dist/{task-completed-WMHOFQ7B.js → task-completed-65CHMMKA.js} +8 -8
- package/dist/{team-LRZ6GTQK.js → team-U2LDKIS4.js} +7 -5
- package/dist/{turns-YFNI5CQC.js → turns-HU2CTZAP.js} +2 -2
- package/dist/ui/assets/index-BUGor9dk.js +842 -0
- package/dist/ui/assets/index-_OP4ifzH.css +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/{update-O6V4RC4W.js → update-ZSHVXWSQ.js} +12 -10
- package/dist/{update-O6V4RC4W.js.map → update-ZSHVXWSQ.js.map} +1 -1
- package/dist/{user-prompt-submit-N36KUPHI.js → user-prompt-submit-APMO6FVU.js} +10 -9
- package/dist/{user-prompt-submit-N36KUPHI.js.map → user-prompt-submit-APMO6FVU.js.map} +1 -1
- package/dist/{verify-LXPV7NYG.js → verify-R76ZFJSZ.js} +8 -5
- package/dist/{verify-LXPV7NYG.js.map → verify-R76ZFJSZ.js.map} +1 -1
- package/dist/{version-XMPPJQHR.js → version-TXPPS3L5.js} +2 -2
- package/dist/version-TXPPS3L5.js.map +1 -0
- package/package.json +3 -1
- package/skills/myco/SKILL.md +16 -1
- package/skills/myco/references/cli-usage.md +1 -1
- package/skills/myco-rules/SKILL.md +94 -0
- package/skills/{rules → myco-rules}/references/rules-bad-example.md +1 -1
- package/skills/{rules → myco-rules}/references/rules-good-example.md +1 -1
- package/dist/chunk-4YFKBL3F.js +0 -195
- package/dist/chunk-4YFKBL3F.js.map +0 -1
- package/dist/chunk-5XIVBO25.js.map +0 -1
- package/dist/chunk-CCRGY3QW.js.map +0 -1
- package/dist/chunk-CUDIZJY7.js +0 -36
- package/dist/chunk-CUDIZJY7.js.map +0 -1
- package/dist/chunk-EVDQKYCG.js.map +0 -1
- package/dist/chunk-FLLBJLHM.js.map +0 -1
- package/dist/chunk-MYOZLMB2.js.map +0 -1
- package/dist/chunk-NGROSFOH.js.map +0 -1
- package/dist/chunk-OD4AA7PV.js.map +0 -1
- package/dist/chunk-Q36VMZST.js.map +0 -1
- package/dist/chunk-US4LNCAT.js.map +0 -1
- package/dist/chunk-UYMFCYBF.js +0 -2326
- package/dist/chunk-UYMFCYBF.js.map +0 -1
- package/dist/chunk-VVNL26WX.js.map +0 -1
- package/dist/cli-GGPWH4UO.js.map +0 -1
- package/dist/doctor-5JXJ36KA.js.map +0 -1
- package/dist/executor-HWW2QNZQ.js +0 -2472
- package/dist/executor-HWW2QNZQ.js.map +0 -1
- package/dist/main-YTBVRTBI.js.map +0 -1
- package/dist/post-tool-use-POGPTJBA.js.map +0 -1
- package/dist/server-AGVYZVP5.js.map +0 -1
- package/dist/session-start-LAFICHII.js +0 -189
- package/dist/session-start-LAFICHII.js.map +0 -1
- package/dist/src/agent/definitions/tasks/graph-maintenance.yaml +0 -93
- package/dist/ui/assets/index-C2JuNtRB.css +0 -1
- package/dist/ui/assets/index-JLVaQKV2.js +0 -832
- package/skills/myco-curate/SKILL.md +0 -86
- package/skills/rules/SKILL.md +0 -214
- /package/dist/{chunk-XG5RRUYF.js.map → chunk-ENZR5NG7.js.map} +0 -0
- /package/dist/{chunk-DCSGJ7W4.js.map → chunk-N2DGFACQ.js.map} +0 -0
- /package/dist/{chunk-KESLPBKV.js.map → chunk-QDLVIW2O.js.map} +0 -0
- /package/dist/{chunk-BPRIYNLE.js.map → chunk-TKAJ3JVF.js.map} +0 -0
- /package/dist/{chunk-JZGN33AY.js.map → chunk-VRI56337.js.map} +0 -0
- /package/dist/{client-YXQUTXVZ.js.map → client-Z43DNLJH.js.map} +0 -0
- /package/dist/{detect-PXNM6TA7.js.map → detect-7NUD5B5R.js.map} +0 -0
- /package/dist/{detect-providers-5KOPZ7J2.js.map → detect-providers-ILLQZROY.js.map} +0 -0
- /package/dist/{installer-FS257JRZ.js.map → executor-DO6QFC6G.js.map} +0 -0
- /package/dist/{llm-TH4NLIRM.js.map → installer-N4UTEACX.js.map} +0 -0
- /package/dist/{loader-CQYTFHEW.js.map → llm-AGVEF5XD.js.map} +0 -0
- /package/dist/{loader-NOMBJUPW.js.map → loader-LX7TFRM6.js.map} +0 -0
- /package/dist/{provider-check-43LAMSMH.js.map → loader-UDNUMEDA.js.map} +0 -0
- /package/dist/{post-compact-JSECI44W.js.map → post-compact-7AEFVCZS.js.map} +0 -0
- /package/dist/{post-tool-use-failure-OT7BFWQW.js.map → post-tool-use-failure-TCFEU2GI.js.map} +0 -0
- /package/dist/{pre-compact-OXVODKH4.js.map → pre-compact-LO2VZCGR.js.map} +0 -0
- /package/dist/{registry-U4CHXK6R.js.map → provider-check-ZEV5P4KM.js.map} +0 -0
- /package/dist/{team-LRZ6GTQK.js.map → registry-F3THYC5M.js.map} +0 -0
- /package/dist/{session-end-FT27DWYZ.js.map → session-end-FS46UARX.js.map} +0 -0
- /package/dist/{stop-ZPIKVLH4.js.map → stop-OUEX6KA4.js.map} +0 -0
- /package/dist/{stop-failure-2PX67YJC.js.map → stop-failure-2BWVNZEG.js.map} +0 -0
- /package/dist/{subagent-start-UUE6EHQD.js.map → subagent-start-J4VV6DEE.js.map} +0 -0
- /package/dist/{subagent-stop-KQWWWPE6.js.map → subagent-stop-JMLVEPIA.js.map} +0 -0
- /package/dist/{task-completed-WMHOFQ7B.js.map → task-completed-65CHMMKA.js.map} +0 -0
- /package/dist/{turns-YFNI5CQC.js.map → team-U2LDKIS4.js.map} +0 -0
- /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-EEOJWLMP.js";
|
|
2
29
|
import "./chunk-POEPHBQK.js";
|
|
3
30
|
import {
|
|
4
31
|
resolveVaultDir
|
|
5
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-TSM6VESW.js";
|
|
6
33
|
import {
|
|
7
34
|
DaemonClient
|
|
8
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-KTTSXYEK.js";
|
|
9
36
|
import {
|
|
10
37
|
getPluginVersion
|
|
11
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ENZR5NG7.js";
|
|
12
39
|
import "./chunk-LPUQPDC2.js";
|
|
13
40
|
import {
|
|
14
41
|
DAEMON_CLIENT_TIMEOUT_MS,
|
|
15
|
-
MCP_SEARCH_DEFAULT_LIMIT
|
|
16
|
-
|
|
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/
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
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
|
-
|
|
14430
|
-
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
|
|
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
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
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
|
-
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
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
|
-
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14556
|
-
|
|
14557
|
-
|
|
14558
|
-
|
|
14559
|
-
|
|
14560
|
-
|
|
14561
|
-
|
|
14562
|
-
|
|
14563
|
-
|
|
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
|
-
|
|
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-
|
|
14834
|
+
//# sourceMappingURL=server-AZJSTQEK.js.map
|