@goondocks/myco 0.19.5 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-run-3IQXE5PI.js → agent-run-4HUXVRHW.js} +8 -8
- package/dist/{agent-tasks-5DIA3CE5.js → agent-tasks-JF45ELB6.js} +8 -8
- package/dist/{chunk-DURKJTVO.js → chunk-3WOS4TAR.js} +9 -1
- package/dist/chunk-3WOS4TAR.js.map +1 -0
- package/dist/{chunk-27ZDDWIA.js → chunk-4LCIKVDM.js} +49 -21
- package/dist/chunk-4LCIKVDM.js.map +1 -0
- package/dist/{chunk-Q4QD6LJT.js → chunk-4M7EWPIA.js} +3 -3
- package/dist/{chunk-FGKCE5AE.js → chunk-4YFKBL3F.js} +2 -2
- package/dist/{chunk-KYH4V4ML.js → chunk-57O67XVF.js} +3 -3
- package/dist/{chunk-7ONVLO43.js → chunk-5XIVBO25.js} +2 -2
- package/dist/{chunk-QLCD77AN.js → chunk-6RFZWV4R.js} +18 -1
- package/dist/chunk-6RFZWV4R.js.map +1 -0
- package/dist/{chunk-VH7XYQFL.js → chunk-ACQ2AIEM.js} +2 -2
- package/dist/{chunk-6ZDJXSEO.js → chunk-BPRIYNLE.js} +3 -3
- package/dist/chunk-CUDIZJY7.js +36 -0
- package/dist/chunk-CUDIZJY7.js.map +1 -0
- package/dist/{chunk-WKNAKQKA.js → chunk-DCSGJ7W4.js} +13 -19
- package/dist/chunk-DCSGJ7W4.js.map +1 -0
- package/dist/{chunk-Q6OEZM3S.js → chunk-EVDQKYCG.js} +237 -10
- package/dist/chunk-EVDQKYCG.js.map +1 -0
- package/dist/{chunk-I54KLC6H.js → chunk-FLLBJLHM.js} +3 -1
- package/dist/{chunk-I54KLC6H.js.map → chunk-FLLBJLHM.js.map} +1 -1
- package/dist/{chunk-PMT2LSTQ.js → chunk-FMRZ26U5.js} +2 -2
- package/dist/{chunk-3J6TUJSV.js → chunk-KHT24OWC.js} +3 -3
- package/dist/{chunk-5OXBT5MD.js → chunk-L6XFAJIF.js} +65 -14
- package/dist/chunk-L6XFAJIF.js.map +1 -0
- package/dist/{chunk-6DDRJQ4X.js → chunk-MYOZLMB2.js} +2 -2
- package/dist/{chunk-UVKQ62II.js → chunk-NGROSFOH.js} +24 -2
- package/dist/chunk-NGROSFOH.js.map +1 -0
- package/dist/{chunk-K2QX43GC.js → chunk-P3DN5EWW.js} +4 -4
- package/dist/{chunk-IQ5LQTV7.js → chunk-POR75WM6.js} +4 -4
- package/dist/{chunk-KABTXALI.js → chunk-QS5TWZBL.js} +4 -4
- package/dist/{chunk-UTSCRMJE.js → chunk-SRXTSI25.js} +110 -4
- package/dist/chunk-SRXTSI25.js.map +1 -0
- package/dist/{chunk-2QJCV3UL.js → chunk-UOQQENDW.js} +3 -3
- package/dist/{chunk-GFR542SM.js → chunk-US4LNCAT.js} +5 -11
- package/dist/chunk-US4LNCAT.js.map +1 -0
- package/dist/{chunk-44PZCAYS.js → chunk-XL75KZGI.js} +23 -13
- package/dist/chunk-XL75KZGI.js.map +1 -0
- package/dist/{chunk-5WPTS6A4.js → chunk-YSNIAJ5D.js} +7 -4
- package/dist/chunk-YSNIAJ5D.js.map +1 -0
- package/dist/chunk-ZXZPJJN3.js +54 -0
- package/dist/chunk-ZXZPJJN3.js.map +1 -0
- package/dist/{cli-RTUSGLTM.js → cli-AHTINAHY.js} +43 -43
- package/dist/{client-YWE5YJB7.js → client-LHENCAV3.js} +4 -4
- package/dist/{config-I5MJ6RXI.js → config-XPV5GDE4.js} +8 -16
- package/dist/config-XPV5GDE4.js.map +1 -0
- package/dist/{detect-BEOIHGBC.js → detect-PXNM6TA7.js} +2 -2
- package/dist/{detect-providers-2EY55EHK.js → detect-providers-5KOPZ7J2.js} +4 -4
- package/dist/{doctor-FIG7VEYV.js → doctor-XPCF5HV5.js} +13 -13
- package/dist/{executor-2TMGOVEA.js → executor-ACDHGTRH.js} +115 -77
- package/dist/executor-ACDHGTRH.js.map +1 -0
- package/dist/{init-3536BYDC.js → init-V3KCC36O.js} +14 -14
- package/dist/{installer-YH3WQISI.js → installer-ZNK4JSQA.js} +4 -4
- package/dist/{llm-SWDDQQWY.js → llm-TH4NLIRM.js} +4 -4
- package/dist/{loader-K4WF4EEJ.js → loader-H7OFASVC.js} +15 -3
- package/dist/{loader-AAZ6VUIA.js → loader-TSB5M7FD.js} +3 -3
- package/dist/{logs-KNKPQE5A.js → logs-7YVGGBIS.js} +2 -2
- package/dist/{main-R5ZD5OIZ.js → main-5S4MDCIO.js} +770 -176
- package/dist/main-5S4MDCIO.js.map +1 -0
- package/dist/{open-5UD5JQIM.js → open-AB5ULZIB.js} +8 -8
- package/dist/{post-compact-ZJFE66O3.js → post-compact-P2B7C7FE.js} +9 -8
- package/dist/{post-compact-ZJFE66O3.js.map → post-compact-P2B7C7FE.js.map} +1 -1
- package/dist/{post-tool-use-CAR2USJP.js → post-tool-use-LXL6NXDS.js} +8 -7
- package/dist/{post-tool-use-CAR2USJP.js.map → post-tool-use-LXL6NXDS.js.map} +1 -1
- package/dist/{post-tool-use-failure-OMIKVEVR.js → post-tool-use-failure-WAYVVKGR.js} +9 -8
- package/dist/{post-tool-use-failure-OMIKVEVR.js.map → post-tool-use-failure-WAYVVKGR.js.map} +1 -1
- package/dist/{pre-compact-6SXYI5CD.js → pre-compact-BCXUCF4V.js} +9 -8
- package/dist/{pre-compact-6SXYI5CD.js.map → pre-compact-BCXUCF4V.js.map} +1 -1
- package/dist/{provider-check-WCM3SDTM.js → provider-check-43LAMSMH.js} +4 -4
- package/dist/{registry-OCM4WAPJ.js → registry-MGJSJBAS.js} +4 -4
- package/dist/{remove-NJSFVZXW.js → remove-KAPX5NT2.js} +10 -10
- package/dist/{restart-U5ZGJON7.js → restart-HQO36FTG.js} +9 -9
- package/dist/{search-HO7CXV6H.js → search-YOMOKAAI.js} +9 -9
- package/dist/{server-BUSZIUZV.js → server-2N23P6F2.js} +40 -27
- package/dist/{server-BUSZIUZV.js.map → server-2N23P6F2.js.map} +1 -1
- package/dist/{session-RVT2QELH.js → session-WW2JLHPX.js} +9 -10
- package/dist/{session-RVT2QELH.js.map → session-WW2JLHPX.js.map} +1 -1
- package/dist/{session-end-4W6SZVGH.js → session-end-4WRTIBVQ.js} +8 -7
- package/dist/{session-end-4W6SZVGH.js.map → session-end-4WRTIBVQ.js.map} +1 -1
- package/dist/{session-start-PMPKAST4.js → session-start-HRWTZXQR.js} +15 -15
- package/dist/session-start-HRWTZXQR.js.map +1 -0
- package/dist/{setup-llm-6UAJUHQE.js → setup-llm-HFWSBUAF.js} +10 -9
- package/dist/{setup-llm-6UAJUHQE.js.map → setup-llm-HFWSBUAF.js.map} +1 -1
- package/dist/src/agent/definitions/tasks/full-intelligence.yaml +37 -8
- package/dist/src/agent/prompts/agent.md +2 -2
- 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/codex.yaml +28 -0
- package/dist/{stats-W47FF6RD.js → stats-7A4CJ4MS.js} +9 -9
- package/dist/{stop-6TAO2UU2.js → stop-R2GDHMRA.js} +8 -7
- package/dist/{stop-6TAO2UU2.js.map → stop-R2GDHMRA.js.map} +1 -1
- package/dist/{stop-failure-R76SULCV.js → stop-failure-773KR4VZ.js} +9 -8
- package/dist/{stop-failure-R76SULCV.js.map → stop-failure-773KR4VZ.js.map} +1 -1
- package/dist/{subagent-start-TJMUZLP2.js → subagent-start-IDECNBHW.js} +9 -8
- package/dist/{subagent-start-TJMUZLP2.js.map → subagent-start-IDECNBHW.js.map} +1 -1
- package/dist/{subagent-stop-M3DAFJWQ.js → subagent-stop-3JH7DR2S.js} +9 -8
- package/dist/{subagent-stop-M3DAFJWQ.js.map → subagent-stop-3JH7DR2S.js.map} +1 -1
- package/dist/{task-completed-2KVR5JV6.js → task-completed-AYVHPHDR.js} +9 -8
- package/dist/{task-completed-2KVR5JV6.js.map → task-completed-AYVHPHDR.js.map} +1 -1
- package/dist/{team-2IAT6MKD.js → team-3JKF7VAD.js} +5 -5
- package/dist/{turns-3ZQAF6HF.js → turns-YFNI5CQC.js} +6 -4
- package/dist/ui/assets/index-C2JuNtRB.css +1 -0
- package/dist/ui/assets/index-JLVaQKV2.js +832 -0
- package/dist/ui/favicon-dusk.svg +11 -0
- package/dist/ui/favicon-moss.svg +11 -0
- package/dist/ui/favicon-plum.svg +11 -0
- package/dist/ui/favicon-sage.svg +11 -0
- package/dist/ui/favicon-slate.svg +11 -0
- package/dist/ui/favicon-terracotta.svg +11 -0
- package/dist/ui/index.html +3 -3
- package/dist/{update-TB34JEB7.js → update-YWYW55JM.js} +10 -10
- package/dist/{user-prompt-submit-O4TP7NJ6.js → user-prompt-submit-YELSR6XI.js} +9 -8
- package/dist/{user-prompt-submit-O4TP7NJ6.js.map → user-prompt-submit-YELSR6XI.js.map} +1 -1
- package/dist/{verify-SESZXGVY.js → verify-JS44DVKJ.js} +5 -5
- package/dist/{version-QBORV23E.js → version-K5NETYIL.js} +2 -2
- package/package.json +1 -1
- package/skills/myco/SKILL.md +78 -43
- package/skills/myco/references/vault-status.md +1 -1
- package/dist/chunk-27ZDDWIA.js.map +0 -1
- package/dist/chunk-44PZCAYS.js.map +0 -1
- package/dist/chunk-5OXBT5MD.js.map +0 -1
- package/dist/chunk-5WPTS6A4.js.map +0 -1
- package/dist/chunk-5ZT2Q6P5.js +0 -25
- package/dist/chunk-5ZT2Q6P5.js.map +0 -1
- package/dist/chunk-AULBWINA.js +0 -227
- package/dist/chunk-AULBWINA.js.map +0 -1
- package/dist/chunk-DURKJTVO.js.map +0 -1
- package/dist/chunk-GFR542SM.js.map +0 -1
- package/dist/chunk-Q6OEZM3S.js.map +0 -1
- package/dist/chunk-QLCD77AN.js.map +0 -1
- package/dist/chunk-UTSCRMJE.js.map +0 -1
- package/dist/chunk-UVKQ62II.js.map +0 -1
- package/dist/chunk-VQF5E4ZX.js +0 -91
- package/dist/chunk-VQF5E4ZX.js.map +0 -1
- package/dist/chunk-WKNAKQKA.js.map +0 -1
- package/dist/config-I5MJ6RXI.js.map +0 -1
- package/dist/executor-2TMGOVEA.js.map +0 -1
- package/dist/main-R5ZD5OIZ.js.map +0 -1
- package/dist/resolution-events-PYLSI6QT.js +0 -15
- package/dist/session-start-PMPKAST4.js.map +0 -1
- package/dist/ui/assets/index-C-6W8e3m.js +0 -842
- package/dist/ui/assets/index-CRmkSi63.css +0 -1
- package/dist/version-QBORV23E.js.map +0 -1
- /package/dist/{agent-run-3IQXE5PI.js.map → agent-run-4HUXVRHW.js.map} +0 -0
- /package/dist/{agent-tasks-5DIA3CE5.js.map → agent-tasks-JF45ELB6.js.map} +0 -0
- /package/dist/{chunk-Q4QD6LJT.js.map → chunk-4M7EWPIA.js.map} +0 -0
- /package/dist/{chunk-FGKCE5AE.js.map → chunk-4YFKBL3F.js.map} +0 -0
- /package/dist/{chunk-KYH4V4ML.js.map → chunk-57O67XVF.js.map} +0 -0
- /package/dist/{chunk-7ONVLO43.js.map → chunk-5XIVBO25.js.map} +0 -0
- /package/dist/{chunk-VH7XYQFL.js.map → chunk-ACQ2AIEM.js.map} +0 -0
- /package/dist/{chunk-6ZDJXSEO.js.map → chunk-BPRIYNLE.js.map} +0 -0
- /package/dist/{chunk-PMT2LSTQ.js.map → chunk-FMRZ26U5.js.map} +0 -0
- /package/dist/{chunk-3J6TUJSV.js.map → chunk-KHT24OWC.js.map} +0 -0
- /package/dist/{chunk-6DDRJQ4X.js.map → chunk-MYOZLMB2.js.map} +0 -0
- /package/dist/{chunk-K2QX43GC.js.map → chunk-P3DN5EWW.js.map} +0 -0
- /package/dist/{chunk-IQ5LQTV7.js.map → chunk-POR75WM6.js.map} +0 -0
- /package/dist/{chunk-KABTXALI.js.map → chunk-QS5TWZBL.js.map} +0 -0
- /package/dist/{chunk-2QJCV3UL.js.map → chunk-UOQQENDW.js.map} +0 -0
- /package/dist/{cli-RTUSGLTM.js.map → cli-AHTINAHY.js.map} +0 -0
- /package/dist/{client-YWE5YJB7.js.map → client-LHENCAV3.js.map} +0 -0
- /package/dist/{detect-BEOIHGBC.js.map → detect-PXNM6TA7.js.map} +0 -0
- /package/dist/{detect-providers-2EY55EHK.js.map → detect-providers-5KOPZ7J2.js.map} +0 -0
- /package/dist/{doctor-FIG7VEYV.js.map → doctor-XPCF5HV5.js.map} +0 -0
- /package/dist/{init-3536BYDC.js.map → init-V3KCC36O.js.map} +0 -0
- /package/dist/{installer-YH3WQISI.js.map → installer-ZNK4JSQA.js.map} +0 -0
- /package/dist/{llm-SWDDQQWY.js.map → llm-TH4NLIRM.js.map} +0 -0
- /package/dist/{loader-AAZ6VUIA.js.map → loader-H7OFASVC.js.map} +0 -0
- /package/dist/{loader-K4WF4EEJ.js.map → loader-TSB5M7FD.js.map} +0 -0
- /package/dist/{logs-KNKPQE5A.js.map → logs-7YVGGBIS.js.map} +0 -0
- /package/dist/{open-5UD5JQIM.js.map → open-AB5ULZIB.js.map} +0 -0
- /package/dist/{provider-check-WCM3SDTM.js.map → provider-check-43LAMSMH.js.map} +0 -0
- /package/dist/{registry-OCM4WAPJ.js.map → registry-MGJSJBAS.js.map} +0 -0
- /package/dist/{remove-NJSFVZXW.js.map → remove-KAPX5NT2.js.map} +0 -0
- /package/dist/{restart-U5ZGJON7.js.map → restart-HQO36FTG.js.map} +0 -0
- /package/dist/{search-HO7CXV6H.js.map → search-YOMOKAAI.js.map} +0 -0
- /package/dist/{stats-W47FF6RD.js.map → stats-7A4CJ4MS.js.map} +0 -0
- /package/dist/{resolution-events-PYLSI6QT.js.map → team-3JKF7VAD.js.map} +0 -0
- /package/dist/{team-2IAT6MKD.js.map → turns-YFNI5CQC.js.map} +0 -0
- /package/dist/{update-TB34JEB7.js.map → update-YWYW55JM.js.map} +0 -0
- /package/dist/{verify-SESZXGVY.js.map → verify-JS44DVKJ.js.map} +0 -0
- /package/dist/{turns-3ZQAF6HF.js.map → version-K5NETYIL.js.map} +0 -0
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
insertGraphEdge,
|
|
24
24
|
insertLineage,
|
|
25
25
|
insertReport,
|
|
26
|
+
insertResolutionEvent,
|
|
26
27
|
insertRun,
|
|
27
28
|
insertSkillRecord,
|
|
28
29
|
listCandidates,
|
|
@@ -40,21 +41,20 @@ import {
|
|
|
40
41
|
updateSkillRecord,
|
|
41
42
|
upsertDigestExtract,
|
|
42
43
|
validateSkillContent
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-L6XFAJIF.js";
|
|
44
45
|
import {
|
|
45
|
-
fullTextSearch
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
fullTextSearch,
|
|
47
|
+
hydrateSearchResults
|
|
48
|
+
} from "./chunk-5XIVBO25.js";
|
|
49
|
+
import "./chunk-57O67XVF.js";
|
|
48
50
|
import {
|
|
49
51
|
getDefaultTask,
|
|
50
52
|
loadSystemPrompt
|
|
51
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-4M7EWPIA.js";
|
|
52
54
|
import {
|
|
53
|
-
insertTurn
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
insertResolutionEvent
|
|
57
|
-
} from "./chunk-VQF5E4ZX.js";
|
|
55
|
+
insertTurn,
|
|
56
|
+
updateTurn
|
|
57
|
+
} from "./chunk-6RFZWV4R.js";
|
|
58
58
|
import {
|
|
59
59
|
cleanupStagedSkill,
|
|
60
60
|
readStagedManifest,
|
|
@@ -65,22 +65,22 @@ import {
|
|
|
65
65
|
import "./chunk-POEPHBQK.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_IMPORTANCE,
|
|
68
|
+
getSpore,
|
|
68
69
|
insertSpore,
|
|
69
70
|
listSpores,
|
|
70
71
|
updateSporeStatus
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-4YFKBL3F.js";
|
|
72
73
|
import {
|
|
73
74
|
getActiveSessionIds,
|
|
74
75
|
listSessions,
|
|
75
76
|
updateSession
|
|
76
|
-
} from "./chunk-
|
|
77
|
-
import "./chunk-AULBWINA.js";
|
|
77
|
+
} from "./chunk-EVDQKYCG.js";
|
|
78
78
|
import {
|
|
79
79
|
AGENT_SETTABLE_STATUSES,
|
|
80
80
|
CANDIDATE_STATUS,
|
|
81
81
|
createSchema
|
|
82
|
-
} from "./chunk-
|
|
83
|
-
import "./chunk-
|
|
82
|
+
} from "./chunk-MYOZLMB2.js";
|
|
83
|
+
import "./chunk-SRXTSI25.js";
|
|
84
84
|
import {
|
|
85
85
|
getDatabase,
|
|
86
86
|
initDatabase,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
} from "./chunk-MYX5NCRH.js";
|
|
89
89
|
import {
|
|
90
90
|
getPluginVersion
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-ACQ2AIEM.js";
|
|
92
92
|
import {
|
|
93
93
|
findPackageRoot
|
|
94
94
|
} from "./chunk-LPUQPDC2.js";
|
|
@@ -100,7 +100,7 @@ import {
|
|
|
100
100
|
SEARCH_SIMILARITY_THRESHOLD,
|
|
101
101
|
TEAM_SOURCE_PREFIX,
|
|
102
102
|
epochSeconds
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-FLLBJLHM.js";
|
|
104
104
|
import "./chunk-UUHLLQXO.js";
|
|
105
105
|
import "./chunk-6LQIMRTC.js";
|
|
106
106
|
import "./chunk-ODXLRR4U.js";
|
|
@@ -132,7 +132,7 @@ var DEFAULT_SEARCH_LIMIT = 10;
|
|
|
132
132
|
var DEFAULT_ENTITIES_LIMIT = 50;
|
|
133
133
|
var DEFAULT_EDGES_LIMIT = 50;
|
|
134
134
|
function createReadTools(deps) {
|
|
135
|
-
const { agentId, embeddingManager, teamClient, machineId
|
|
135
|
+
const { agentId, embeddingManager, teamClient, machineId } = deps;
|
|
136
136
|
const vaultUnprocessed = tool(
|
|
137
137
|
"vault_unprocessed",
|
|
138
138
|
"Get unprocessed prompt batches, ordered by id ASC. Supports cursor-based pagination. Batches from in-flight sessions are excluded by default so intelligence tasks only process settled work; pass include_active=true only if you specifically need live data (e.g., title-summary).",
|
|
@@ -142,7 +142,6 @@ function createReadTools(deps) {
|
|
|
142
142
|
include_active: external_exports.boolean().optional().describe("Include batches from sessions still in active status (default: false)")
|
|
143
143
|
},
|
|
144
144
|
async (args) => {
|
|
145
|
-
recordTurn("vault_unprocessed", args);
|
|
146
145
|
const batches = getUnprocessedBatches({
|
|
147
146
|
after_id: args.after_id,
|
|
148
147
|
limit: args.limit ?? DEFAULT_UNPROCESSED_LIMIT,
|
|
@@ -154,8 +153,9 @@ function createReadTools(deps) {
|
|
|
154
153
|
);
|
|
155
154
|
const vaultSpores = tool(
|
|
156
155
|
"vault_spores",
|
|
157
|
-
"List spores with optional filters (agent, observation type, status, session). Spores from in-flight sessions are excluded by default; passing a specific session_id bypasses this filter. Pass include_active=true to bulk-read live work.",
|
|
156
|
+
"List spores with optional filters (agent, observation type, status, session), or fetch exact spores by id for full-content inspection after a semantic shortlist. Spores from in-flight sessions are excluded by default; passing a specific session_id or ids bypasses this filter. Pass include_active=true to bulk-read live work.",
|
|
158
157
|
{
|
|
158
|
+
ids: external_exports.array(external_exports.string()).optional().describe("Fetch exact spores by id in the given order; bypasses active-session gating"),
|
|
159
159
|
agent_id: external_exports.string().optional().describe("Filter by agent ID"),
|
|
160
160
|
observation_type: external_exports.string().optional().describe("Filter by observation type (e.g., gotcha, decision)"),
|
|
161
161
|
status: external_exports.enum(["active", "superseded", "archived"]).optional().describe("Filter by status"),
|
|
@@ -164,7 +164,10 @@ function createReadTools(deps) {
|
|
|
164
164
|
include_active: external_exports.boolean().optional().describe("Include spores from sessions still in active status (default: false)")
|
|
165
165
|
},
|
|
166
166
|
async (args) => {
|
|
167
|
-
|
|
167
|
+
if (args.ids && args.ids.length > 0) {
|
|
168
|
+
const spores2 = args.ids.map((id) => getSpore(id)).filter((spore) => spore !== null);
|
|
169
|
+
return textResult(spores2);
|
|
170
|
+
}
|
|
168
171
|
const spores = listSpores({
|
|
169
172
|
agent_id: args.agent_id,
|
|
170
173
|
observation_type: args.observation_type,
|
|
@@ -186,7 +189,6 @@ function createReadTools(deps) {
|
|
|
186
189
|
include_active: external_exports.boolean().optional().describe("Include sessions still in active status (default: false)")
|
|
187
190
|
},
|
|
188
191
|
async (args) => {
|
|
189
|
-
recordTurn("vault_sessions", args);
|
|
190
192
|
const sessions = listSessions({
|
|
191
193
|
limit: args.limit ?? DEFAULT_SESSIONS_LIMIT,
|
|
192
194
|
status: args.status,
|
|
@@ -206,7 +208,6 @@ function createReadTools(deps) {
|
|
|
206
208
|
include_active: external_exports.boolean().optional().describe("Include results from sessions still in active status (default: false)")
|
|
207
209
|
},
|
|
208
210
|
async (args) => {
|
|
209
|
-
recordTurn("vault_search_fts", args);
|
|
210
211
|
try {
|
|
211
212
|
const results = fullTextSearch(args.query, {
|
|
212
213
|
type: args.type,
|
|
@@ -230,7 +231,6 @@ function createReadTools(deps) {
|
|
|
230
231
|
include_active: external_exports.boolean().optional().describe("Include results from sessions still in active status (default: false)")
|
|
231
232
|
},
|
|
232
233
|
async (args) => {
|
|
233
|
-
recordTurn("vault_search_semantic", args);
|
|
234
234
|
if (!embeddingManager) {
|
|
235
235
|
return textResult({ results: [], message: "Embedding provider unavailable" });
|
|
236
236
|
}
|
|
@@ -241,7 +241,8 @@ function createReadTools(deps) {
|
|
|
241
241
|
}
|
|
242
242
|
const searchLimit = args.limit ?? DEFAULT_SEARCH_LIMIT;
|
|
243
243
|
const excludeActive = args.include_active !== true;
|
|
244
|
-
const
|
|
244
|
+
const activeIds = excludeActive ? getActiveSessionIds() : /* @__PURE__ */ new Set();
|
|
245
|
+
const [rawLocalResults, teamResults] = await Promise.all([
|
|
245
246
|
Promise.resolve(
|
|
246
247
|
embeddingManager.searchVectors(queryVector, {
|
|
247
248
|
namespace: args.namespace,
|
|
@@ -251,21 +252,26 @@ function createReadTools(deps) {
|
|
|
251
252
|
),
|
|
252
253
|
teamClient ? teamClient.search(args.query, { limit: searchLimit }).then((res) => res.results.map((r) => ({ ...r, source: `${TEAM_SOURCE_PREFIX}${r.machine_id}` }))).catch(() => []) : Promise.resolve([])
|
|
253
254
|
]);
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
255
|
+
const localResults = activeIds.size > 0 ? rawLocalResults.filter((r) => {
|
|
256
|
+
const sid = r.metadata?.session_id;
|
|
257
|
+
return typeof sid !== "string" || !activeIds.has(sid);
|
|
258
|
+
}) : rawLocalResults;
|
|
259
|
+
const hydratedLocalResults = hydrateSearchResults(localResults).map((r) => ({
|
|
260
|
+
...r,
|
|
261
|
+
source: "local"
|
|
262
|
+
}));
|
|
263
|
+
let dedupedTeam = machineId ? teamResults.filter((r) => r.machine_id !== machineId) : teamResults;
|
|
264
|
+
if (activeIds.size > 0) {
|
|
265
|
+
dedupedTeam = dedupedTeam.filter((r) => {
|
|
266
|
+
const sid = r.metadata?.session_id;
|
|
267
|
+
return typeof sid !== "string" || !activeIds.has(sid);
|
|
268
|
+
});
|
|
267
269
|
}
|
|
268
|
-
|
|
270
|
+
const merged = [
|
|
271
|
+
...hydratedLocalResults,
|
|
272
|
+
...dedupedTeam
|
|
273
|
+
].sort((a, b) => (b.score ?? 0) - (a.score ?? 0)).slice(0, searchLimit);
|
|
274
|
+
return textResult({ results: merged });
|
|
269
275
|
} catch {
|
|
270
276
|
return textResult({ results: [], message: "Semantic search unavailable" });
|
|
271
277
|
}
|
|
@@ -277,7 +283,6 @@ function createReadTools(deps) {
|
|
|
277
283
|
"Get all state key-value pairs for the current agent.",
|
|
278
284
|
{},
|
|
279
285
|
async () => {
|
|
280
|
-
recordTurn("vault_state", {});
|
|
281
286
|
const states = getStatesForAgent(agentId);
|
|
282
287
|
return textResult(states);
|
|
283
288
|
},
|
|
@@ -292,7 +297,6 @@ function createReadTools(deps) {
|
|
|
292
297
|
limit: external_exports.number().optional().describe("Maximum entities to return")
|
|
293
298
|
},
|
|
294
299
|
async (args) => {
|
|
295
|
-
recordTurn("vault_entities", args);
|
|
296
300
|
const entities = listEntities({
|
|
297
301
|
agent_id: agentId,
|
|
298
302
|
type: args.type,
|
|
@@ -313,7 +317,6 @@ function createReadTools(deps) {
|
|
|
313
317
|
limit: external_exports.number().optional().describe("Maximum edges to return")
|
|
314
318
|
},
|
|
315
319
|
async (args) => {
|
|
316
|
-
recordTurn("vault_edges", args);
|
|
317
320
|
const edges = listGraphEdges({
|
|
318
321
|
sourceId: args.source_id,
|
|
319
322
|
targetId: args.target_id,
|
|
@@ -341,7 +344,7 @@ function createReadTools(deps) {
|
|
|
341
344
|
import crypto from "crypto";
|
|
342
345
|
import { tool as tool2 } from "@anthropic-ai/claude-agent-sdk";
|
|
343
346
|
function createWriteTools(deps) {
|
|
344
|
-
const { agentId, embeddingManager, machineId
|
|
347
|
+
const { agentId, embeddingManager, machineId } = deps;
|
|
345
348
|
const vaultCreateSpore = tool2(
|
|
346
349
|
"vault_create_spore",
|
|
347
350
|
"Create a new spore (observation) in the vault. The agent_id is set automatically.",
|
|
@@ -384,7 +387,6 @@ function createWriteTools(deps) {
|
|
|
384
387
|
session_id: args.session_id
|
|
385
388
|
}).catch(() => {
|
|
386
389
|
});
|
|
387
|
-
recordTurn("vault_create_spore", args);
|
|
388
390
|
return textResult(spore);
|
|
389
391
|
},
|
|
390
392
|
{ annotations: { openWorldHint: true } }
|
|
@@ -411,7 +413,6 @@ function createWriteTools(deps) {
|
|
|
411
413
|
first_seen: now,
|
|
412
414
|
last_seen: now
|
|
413
415
|
});
|
|
414
|
-
recordTurn("vault_create_entity", args);
|
|
415
416
|
return textResult(entity);
|
|
416
417
|
},
|
|
417
418
|
{ annotations: { idempotentHint: true } }
|
|
@@ -445,7 +446,6 @@ function createWriteTools(deps) {
|
|
|
445
446
|
properties: props,
|
|
446
447
|
created_at: now
|
|
447
448
|
});
|
|
448
|
-
recordTurn("vault_create_edge", args);
|
|
449
449
|
return textResult(edge);
|
|
450
450
|
},
|
|
451
451
|
{ annotations: { idempotentHint: true } }
|
|
@@ -489,7 +489,6 @@ function createWriteTools(deps) {
|
|
|
489
489
|
} catch {
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
recordTurn("vault_resolve_spore", args);
|
|
493
492
|
return textResult({ spore: updatedSpore, resolution_event_id: eventId });
|
|
494
493
|
},
|
|
495
494
|
{ annotations: { destructiveHint: true } }
|
|
@@ -511,7 +510,6 @@ function createWriteTools(deps) {
|
|
|
511
510
|
embeddingManager?.onContentWritten("sessions", args.session_id, args.summary, {}).catch(() => {
|
|
512
511
|
});
|
|
513
512
|
}
|
|
514
|
-
recordTurn("vault_update_session", args);
|
|
515
513
|
return textResult(session);
|
|
516
514
|
},
|
|
517
515
|
{ annotations: { idempotentHint: true } }
|
|
@@ -526,7 +524,6 @@ function createWriteTools(deps) {
|
|
|
526
524
|
async (args) => {
|
|
527
525
|
const now = epochSeconds();
|
|
528
526
|
const state = setState(agentId, args.key, args.value, now);
|
|
529
|
-
recordTurn("vault_set_state", args);
|
|
530
527
|
return textResult(state);
|
|
531
528
|
},
|
|
532
529
|
{ annotations: { idempotentHint: true } }
|
|
@@ -538,7 +535,6 @@ function createWriteTools(deps) {
|
|
|
538
535
|
tier: external_exports.number().optional().describe("Specific tier to read in full (e.g., 1500, 5000, 10000). Omit to get summary of all tiers.")
|
|
539
536
|
},
|
|
540
537
|
async (args) => {
|
|
541
|
-
recordTurn("vault_read_digest", args);
|
|
542
538
|
const extracts = listDigestExtracts(agentId);
|
|
543
539
|
if (args.tier !== void 0) {
|
|
544
540
|
const extract = extracts.find((e) => e.tier === args.tier);
|
|
@@ -568,7 +564,6 @@ function createWriteTools(deps) {
|
|
|
568
564
|
content: args.content,
|
|
569
565
|
generated_at: now
|
|
570
566
|
});
|
|
571
|
-
recordTurn("vault_write_digest", args);
|
|
572
567
|
return textResult(extract);
|
|
573
568
|
},
|
|
574
569
|
{ annotations: { idempotentHint: true } }
|
|
@@ -581,7 +576,6 @@ function createWriteTools(deps) {
|
|
|
581
576
|
},
|
|
582
577
|
async (args) => {
|
|
583
578
|
const batch = markBatchProcessed(args.batch_id);
|
|
584
|
-
recordTurn("vault_mark_processed", args);
|
|
585
579
|
return textResult(batch);
|
|
586
580
|
},
|
|
587
581
|
{ annotations: { destructiveHint: true } }
|
|
@@ -602,7 +596,7 @@ function createWriteTools(deps) {
|
|
|
602
596
|
// src/agent/tools/observability-tools.ts
|
|
603
597
|
import { tool as tool3 } from "@anthropic-ai/claude-agent-sdk";
|
|
604
598
|
function createObservabilityTools(deps) {
|
|
605
|
-
const { runId, agentId
|
|
599
|
+
const { runId, agentId } = deps;
|
|
606
600
|
const vaultReport = tool3(
|
|
607
601
|
"vault_report",
|
|
608
602
|
'Record an observability report for the current run. Use action "skip" when skipping expected operations (e.g., not updating a session summary) with reasoning in the summary field.',
|
|
@@ -612,7 +606,6 @@ function createObservabilityTools(deps) {
|
|
|
612
606
|
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe("Structured details as key-value pairs")
|
|
613
607
|
},
|
|
614
608
|
async (args) => {
|
|
615
|
-
recordTurn("vault_report", args);
|
|
616
609
|
const now = epochSeconds();
|
|
617
610
|
const report = insertReport({
|
|
618
611
|
run_id: runId,
|
|
@@ -635,7 +628,7 @@ import { readFileSync, writeFileSync, mkdirSync, rmSync, existsSync } from "fs";
|
|
|
635
628
|
import { resolve } from "path";
|
|
636
629
|
import { tool as tool4 } from "@anthropic-ai/claude-agent-sdk";
|
|
637
630
|
function createSkillTools(deps) {
|
|
638
|
-
const { agentId, machineId, projectRoot, vaultDir,
|
|
631
|
+
const { agentId, machineId, projectRoot, vaultDir, embeddingManager } = deps;
|
|
639
632
|
function findOverlappingCandidate(newTopic, existing) {
|
|
640
633
|
let best = null;
|
|
641
634
|
for (const candidate of existing) {
|
|
@@ -754,7 +747,7 @@ function createSkillTools(deps) {
|
|
|
754
747
|
);
|
|
755
748
|
}
|
|
756
749
|
try {
|
|
757
|
-
const { syncSkillSymlinks } = await import("./installer-
|
|
750
|
+
const { syncSkillSymlinks } = await import("./installer-ZNK4JSQA.js");
|
|
758
751
|
syncSkillSymlinks(root, params.name, { remove: true });
|
|
759
752
|
} catch (rollbackErr) {
|
|
760
753
|
console.warn(
|
|
@@ -772,7 +765,7 @@ function createSkillTools(deps) {
|
|
|
772
765
|
};
|
|
773
766
|
}
|
|
774
767
|
try {
|
|
775
|
-
const { syncSkillSymlinks } = await import("./installer-
|
|
768
|
+
const { syncSkillSymlinks } = await import("./installer-ZNK4JSQA.js");
|
|
776
769
|
syncSkillSymlinks(root, params.name);
|
|
777
770
|
} catch (err) {
|
|
778
771
|
console.warn(
|
|
@@ -853,7 +846,6 @@ function createSkillTools(deps) {
|
|
|
853
846
|
limit: external_exports.number().optional().describe("Maximum candidates to return (for list)")
|
|
854
847
|
},
|
|
855
848
|
async (args) => {
|
|
856
|
-
recordTurn("vault_skill_candidates", args);
|
|
857
849
|
switch (args.action) {
|
|
858
850
|
case "list": {
|
|
859
851
|
const candidates = listCandidates({
|
|
@@ -986,7 +978,6 @@ function createSkillTools(deps) {
|
|
|
986
978
|
limit: external_exports.number().optional().describe("Maximum records to return (for list)")
|
|
987
979
|
},
|
|
988
980
|
async (args) => {
|
|
989
|
-
recordTurn("vault_skill_records", args);
|
|
990
981
|
switch (args.action) {
|
|
991
982
|
case "list": {
|
|
992
983
|
const records = listSkillRecords({
|
|
@@ -1041,7 +1032,7 @@ function createSkillTools(deps) {
|
|
|
1041
1032
|
console.warn("[vault_skill_records] Failed to remove skill directory:", err instanceof Error ? err.message : err);
|
|
1042
1033
|
}
|
|
1043
1034
|
try {
|
|
1044
|
-
const { syncSkillSymlinks } = await import("./installer-
|
|
1035
|
+
const { syncSkillSymlinks } = await import("./installer-ZNK4JSQA.js");
|
|
1045
1036
|
syncSkillSymlinks(root, result.name, { remove: true });
|
|
1046
1037
|
} catch (err) {
|
|
1047
1038
|
console.warn("[vault_skill_records] Failed to remove symlinks:", err instanceof Error ? err.message : err);
|
|
@@ -1070,14 +1061,12 @@ function createSkillTools(deps) {
|
|
|
1070
1061
|
async (args) => {
|
|
1071
1062
|
const validationErrors = validateSkillContent(args.content, args.name);
|
|
1072
1063
|
if (validationErrors.length > 0) {
|
|
1073
|
-
recordTurn("vault_write_skill", args);
|
|
1074
1064
|
return textResult({
|
|
1075
1065
|
error: "Skill validation failed. Fix these issues and try again.",
|
|
1076
1066
|
issues: validationErrors
|
|
1077
1067
|
});
|
|
1078
1068
|
}
|
|
1079
1069
|
if (!args.name || /[/\\]|\.\./.test(args.name)) {
|
|
1080
|
-
recordTurn("vault_write_skill", args);
|
|
1081
1070
|
return textResult({
|
|
1082
1071
|
error: 'Invalid skill name: must be a simple directory name without path separators or ".."'
|
|
1083
1072
|
});
|
|
@@ -1088,7 +1077,6 @@ function createSkillTools(deps) {
|
|
|
1088
1077
|
description: args.description
|
|
1089
1078
|
});
|
|
1090
1079
|
if (dedupError) {
|
|
1091
|
-
recordTurn("vault_write_skill", args);
|
|
1092
1080
|
return textResult(dedupError);
|
|
1093
1081
|
}
|
|
1094
1082
|
const existing = getSkillRecordByName(args.name);
|
|
@@ -1098,7 +1086,6 @@ function createSkillTools(deps) {
|
|
|
1098
1086
|
const existingContent = readFileSync(skillPath, "utf-8");
|
|
1099
1087
|
const violations = checkFrontmatterPreservation(existingContent, args.content);
|
|
1100
1088
|
if (violations.length > 0) {
|
|
1101
|
-
recordTurn("vault_write_skill", args);
|
|
1102
1089
|
return textResult({
|
|
1103
1090
|
error: "Skill update rejected: protected frontmatter fields were changed. Read the existing skill and preserve these values exactly.",
|
|
1104
1091
|
violations
|
|
@@ -1109,7 +1096,6 @@ function createSkillTools(deps) {
|
|
|
1109
1096
|
if (args.candidate_id) {
|
|
1110
1097
|
const candidateError = requireApprovedCandidate(args.candidate_id);
|
|
1111
1098
|
if (candidateError) {
|
|
1112
|
-
recordTurn("vault_write_skill", args);
|
|
1113
1099
|
return textResult(candidateError);
|
|
1114
1100
|
}
|
|
1115
1101
|
}
|
|
@@ -1142,7 +1128,6 @@ function createSkillTools(deps) {
|
|
|
1142
1128
|
linkCandidate,
|
|
1143
1129
|
label: "vault_write_skill"
|
|
1144
1130
|
});
|
|
1145
|
-
recordTurn("vault_write_skill", args);
|
|
1146
1131
|
if ("error" in result) return textResult(result);
|
|
1147
1132
|
emitSkillNotification("created", {
|
|
1148
1133
|
name: result.name,
|
|
@@ -1165,7 +1150,7 @@ function createSkillTools(deps) {
|
|
|
1165
1150
|
return textResult({ error: `Failed to write skill file: ${err instanceof Error ? err.message : String(err)}` });
|
|
1166
1151
|
}
|
|
1167
1152
|
try {
|
|
1168
|
-
const { syncSkillSymlinks } = await import("./installer-
|
|
1153
|
+
const { syncSkillSymlinks } = await import("./installer-ZNK4JSQA.js");
|
|
1169
1154
|
syncSkillSymlinks(root, args.name);
|
|
1170
1155
|
} catch (err) {
|
|
1171
1156
|
console.warn("[vault_write_skill] syncSkillSymlinks failed:", err instanceof Error ? err.message : err);
|
|
@@ -1205,7 +1190,6 @@ function createSkillTools(deps) {
|
|
|
1205
1190
|
rollbackErr instanceof Error ? rollbackErr.message : rollbackErr
|
|
1206
1191
|
);
|
|
1207
1192
|
}
|
|
1208
|
-
recordTurn("vault_write_skill", args);
|
|
1209
1193
|
return textResult({
|
|
1210
1194
|
error: `Skill write aborted: database transaction failed and on-disk state was rolled back. ${err instanceof Error ? err.message : String(err)}`
|
|
1211
1195
|
});
|
|
@@ -1222,7 +1206,6 @@ function createSkillTools(deps) {
|
|
|
1222
1206
|
name: args.name
|
|
1223
1207
|
}).catch(() => {
|
|
1224
1208
|
});
|
|
1225
|
-
recordTurn("vault_write_skill", args);
|
|
1226
1209
|
return textResult({
|
|
1227
1210
|
id: recordId,
|
|
1228
1211
|
name: args.name,
|
|
@@ -1247,7 +1230,6 @@ function createSkillTools(deps) {
|
|
|
1247
1230
|
rationale: external_exports.string().optional().describe("Why this skill is being created \u2014 stored in lineage after finalize")
|
|
1248
1231
|
},
|
|
1249
1232
|
async (args) => {
|
|
1250
|
-
recordTurn("vault_stage_skill", args);
|
|
1251
1233
|
if (!vaultDir) {
|
|
1252
1234
|
return textResult({
|
|
1253
1235
|
error: "vault_stage_skill requires vaultDir on the tool deps \u2014 staging has no location otherwise"
|
|
@@ -1306,7 +1288,6 @@ function createSkillTools(deps) {
|
|
|
1306
1288
|
candidate_id: external_exports.string().describe("Candidate ID whose staged skill should be promoted. Must match a previous vault_stage_skill call.")
|
|
1307
1289
|
},
|
|
1308
1290
|
async (args) => {
|
|
1309
|
-
recordTurn("vault_finalize_skill", args);
|
|
1310
1291
|
if (!vaultDir) {
|
|
1311
1292
|
return textResult({
|
|
1312
1293
|
error: "vault_finalize_skill requires vaultDir on the tool deps"
|
|
@@ -1409,6 +1390,7 @@ var SKILL_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
|
1409
1390
|
"vault_stage_skill",
|
|
1410
1391
|
"vault_finalize_skill"
|
|
1411
1392
|
]);
|
|
1393
|
+
var TOOL_OUTPUT_SUMMARY_LIMIT = 240;
|
|
1412
1394
|
var VAULT_TOOL_COUNT = READ_TOOL_NAMES.size + WRITE_TOOL_NAMES.size + OBSERVABILITY_TOOL_NAMES.size + SKILL_TOOL_NAMES.size;
|
|
1413
1395
|
function setsOverlap(a, b) {
|
|
1414
1396
|
for (const item of a) {
|
|
@@ -1416,13 +1398,31 @@ function setsOverlap(a, b) {
|
|
|
1416
1398
|
}
|
|
1417
1399
|
return false;
|
|
1418
1400
|
}
|
|
1401
|
+
function truncateSummary(text) {
|
|
1402
|
+
if (!text) return null;
|
|
1403
|
+
return text.length > TOOL_OUTPUT_SUMMARY_LIMIT ? `${text.slice(0, TOOL_OUTPUT_SUMMARY_LIMIT - 1)}\u2026` : text;
|
|
1404
|
+
}
|
|
1405
|
+
function summarizeToolResult(result) {
|
|
1406
|
+
if (!result || typeof result !== "object") return null;
|
|
1407
|
+
const content = result.content;
|
|
1408
|
+
if (!Array.isArray(content) || content.length === 0) return null;
|
|
1409
|
+
const first = content[0];
|
|
1410
|
+
if (!first || first.type !== "text" || typeof first.text !== "string") return null;
|
|
1411
|
+
return truncateSummary(first.text.replace(/\s+/g, " ").trim());
|
|
1412
|
+
}
|
|
1413
|
+
function summarizeToolError(error) {
|
|
1414
|
+
if (error instanceof Error && error.message) {
|
|
1415
|
+
return truncateSummary(error.message) ?? "Tool failed";
|
|
1416
|
+
}
|
|
1417
|
+
return truncateSummary(String(error)) ?? "Tool failed";
|
|
1418
|
+
}
|
|
1419
1419
|
function createVaultTools(agentId, runId, options) {
|
|
1420
1420
|
const { turnOffset = 0, embeddingManager, teamClient, machineId, projectRoot, vaultDir, onlyNames } = options ?? {};
|
|
1421
1421
|
let turnCounter = turnOffset;
|
|
1422
1422
|
function recordTurn(toolName, toolInput) {
|
|
1423
1423
|
turnCounter++;
|
|
1424
1424
|
try {
|
|
1425
|
-
insertTurn({
|
|
1425
|
+
const turn = insertTurn({
|
|
1426
1426
|
run_id: runId,
|
|
1427
1427
|
agent_id: agentId,
|
|
1428
1428
|
turn_number: turnCounter,
|
|
@@ -1430,7 +1430,9 @@ function createVaultTools(agentId, runId, options) {
|
|
|
1430
1430
|
tool_input: JSON.stringify(toolInput),
|
|
1431
1431
|
started_at: epochSeconds()
|
|
1432
1432
|
});
|
|
1433
|
+
return turn.id;
|
|
1433
1434
|
} catch {
|
|
1435
|
+
return null;
|
|
1434
1436
|
}
|
|
1435
1437
|
}
|
|
1436
1438
|
const deps = {
|
|
@@ -1444,12 +1446,46 @@ function createVaultTools(agentId, runId, options) {
|
|
|
1444
1446
|
recordTurn
|
|
1445
1447
|
};
|
|
1446
1448
|
const needsAll = !onlyNames;
|
|
1447
|
-
|
|
1449
|
+
const tools = [
|
|
1448
1450
|
...needsAll || setsOverlap(onlyNames, READ_TOOL_NAMES) ? createReadTools(deps) : [],
|
|
1449
1451
|
...needsAll || setsOverlap(onlyNames, WRITE_TOOL_NAMES) ? createWriteTools(deps) : [],
|
|
1450
1452
|
...needsAll || setsOverlap(onlyNames, OBSERVABILITY_TOOL_NAMES) ? createObservabilityTools(deps) : [],
|
|
1451
1453
|
...needsAll || setsOverlap(onlyNames, SKILL_TOOL_NAMES) ? createSkillTools(deps) : []
|
|
1452
1454
|
];
|
|
1455
|
+
return tools.map((toolDef) => wrapToolWithAudit(toolDef));
|
|
1456
|
+
function wrapToolWithAudit(toolDef) {
|
|
1457
|
+
const originalHandler = toolDef.handler;
|
|
1458
|
+
return {
|
|
1459
|
+
...toolDef,
|
|
1460
|
+
handler: async (args, extra) => {
|
|
1461
|
+
const turnId = recordTurn(toolDef.name, args);
|
|
1462
|
+
try {
|
|
1463
|
+
const result = await originalHandler(args, extra);
|
|
1464
|
+
if (turnId !== null) {
|
|
1465
|
+
try {
|
|
1466
|
+
updateTurn(turnId, {
|
|
1467
|
+
tool_output_summary: summarizeToolResult(result),
|
|
1468
|
+
completed_at: epochSeconds()
|
|
1469
|
+
});
|
|
1470
|
+
} catch {
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
return result;
|
|
1474
|
+
} catch (error) {
|
|
1475
|
+
if (turnId !== null) {
|
|
1476
|
+
try {
|
|
1477
|
+
updateTurn(turnId, {
|
|
1478
|
+
tool_output_summary: summarizeToolError(error),
|
|
1479
|
+
completed_at: epochSeconds()
|
|
1480
|
+
});
|
|
1481
|
+
} catch {
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
throw error;
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
};
|
|
1488
|
+
}
|
|
1453
1489
|
}
|
|
1454
1490
|
function createVaultToolServer(agentId, runId, options) {
|
|
1455
1491
|
const tools = createVaultTools(agentId, runId, options);
|
|
@@ -1944,15 +1980,17 @@ var MCP_SERVER_NAME = "myco-vault";
|
|
|
1944
1980
|
var PERSIST_SESSION = true;
|
|
1945
1981
|
var PROMPT_SECTION_PRIOR_PHASES = "## Prior Phase Results";
|
|
1946
1982
|
var PROMPT_SECTION_CURRENT_PHASE = "## Current Phase: ";
|
|
1947
|
-
var DEBUG_TOOL_CALLS = process.env.MYCO_AGENT_DEBUG === "1";
|
|
1948
1983
|
var TOOL_DEBUG_PREVIEW_CHARS = 240;
|
|
1984
|
+
function debugToolCallsEnabled() {
|
|
1985
|
+
return process.env.MYCO_AGENT_DEBUG === "1";
|
|
1986
|
+
}
|
|
1949
1987
|
function previewPayload(value) {
|
|
1950
1988
|
const str = typeof value === "string" ? value : JSON.stringify(value);
|
|
1951
1989
|
if (str === void 0) return "";
|
|
1952
1990
|
return str.length > TOOL_DEBUG_PREVIEW_CHARS ? `${str.slice(0, TOOL_DEBUG_PREVIEW_CHARS)}\u2026(${str.length - TOOL_DEBUG_PREVIEW_CHARS} more chars)` : str;
|
|
1953
1991
|
}
|
|
1954
1992
|
function logToolUseBlocks(phaseName, message) {
|
|
1955
|
-
if (!
|
|
1993
|
+
if (!debugToolCallsEnabled()) return;
|
|
1956
1994
|
const blocks = message.message?.content;
|
|
1957
1995
|
if (!Array.isArray(blocks)) return;
|
|
1958
1996
|
for (const block of blocks) {
|
|
@@ -1964,7 +2002,7 @@ function logToolUseBlocks(phaseName, message) {
|
|
|
1964
2002
|
}
|
|
1965
2003
|
}
|
|
1966
2004
|
function logToolResultBlocks(phaseName, message) {
|
|
1967
|
-
if (!
|
|
2005
|
+
if (!debugToolCallsEnabled()) return;
|
|
1968
2006
|
const blocks = message.message?.content;
|
|
1969
2007
|
if (!Array.isArray(blocks)) return;
|
|
1970
2008
|
for (const block of blocks) {
|
|
@@ -2431,4 +2469,4 @@ export {
|
|
|
2431
2469
|
computeWaves,
|
|
2432
2470
|
runAgent
|
|
2433
2471
|
};
|
|
2434
|
-
//# sourceMappingURL=executor-
|
|
2472
|
+
//# sourceMappingURL=executor-ACDHGTRH.js.map
|