@tekmidian/pai 0.42.5 → 0.42.6
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/ARCHITECTURE.md +9 -9
- package/README.md +26 -8
- package/dist/{aibroker-client-BP74gGwD.mjs → aibroker-client-Bn9SnGMa.mjs} +3 -3
- package/dist/{aibroker-client-BP74gGwD.mjs.map → aibroker-client-Bn9SnGMa.mjs.map} +1 -1
- package/dist/{aibroker-client-C6m71p6O.mjs → aibroker-client-D5NT0S1N.mjs} +1 -1
- package/dist/{auto-route-_5zzJz5q.mjs → auto-route-CcD0OWWB.mjs} +4 -4
- package/dist/{auto-route-_5zzJz5q.mjs.map → auto-route-CcD0OWWB.mjs.map} +1 -1
- package/dist/{chain-DTII7xeL.mjs → chain-BbcfP77K.mjs} +5 -4
- package/dist/{chain-DTII7xeL.mjs.map → chain-BbcfP77K.mjs.map} +1 -1
- package/dist/cli/index.mjs +23 -21
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/program.d.mts.map +1 -1
- package/dist/cli/program.mjs +23 -21
- package/dist/{clusters-j0ZuNYp9.mjs → clusters-Cw_P6lO-.mjs} +2 -2
- package/dist/{clusters-j0ZuNYp9.mjs.map → clusters-Cw_P6lO-.mjs.map} +1 -1
- package/dist/{config-B64vFg14.mjs → config-DCu8THKi.mjs} +41 -9
- package/dist/{config-B64vFg14.mjs.map → config-DCu8THKi.mjs.map} +1 -1
- package/dist/config-DeqFqa1N.mjs +3 -0
- package/dist/config-DxMZjpvY.mjs +1289 -0
- package/dist/config-DxMZjpvY.mjs.map +1 -0
- package/dist/context-handover-cache-B9NKSjwR.mjs +3242 -0
- package/dist/context-handover-cache-B9NKSjwR.mjs.map +1 -0
- package/dist/daemon/index.mjs +23 -22
- package/dist/daemon/index.mjs.map +1 -1
- package/dist/daemon-BNjbVsQU.mjs +24 -0
- package/dist/{daemon-B8N1egl0.mjs → daemon-BppziPi6.mjs} +52 -38
- package/dist/daemon-BppziPi6.mjs.map +1 -0
- package/dist/daemon-mcp/index.mjs +144 -117
- package/dist/daemon-mcp/index.mjs.map +1 -1
- package/dist/db-BOBfewFH.mjs +3 -0
- package/dist/{db-a1ixZQjr.mjs → db-DJ8rk0VM.mjs} +15 -6
- package/dist/{db-a1ixZQjr.mjs.map → db-DJ8rk0VM.mjs.map} +1 -1
- package/dist/db-DbY2O8QO.mjs +3 -0
- package/dist/{db-Ca5qfsMC.mjs → db-Ddns80yf.mjs} +15 -6
- package/dist/{db-Ca5qfsMC.mjs.map → db-Ddns80yf.mjs.map} +1 -1
- package/dist/{detect-CdaA48EI.mjs → detect-Bf2z-oKB.mjs} +1 -1
- package/dist/{detect-CdaA48EI.mjs.map → detect-Bf2z-oKB.mjs.map} +1 -1
- package/dist/detector-CkwkXuGh.mjs +5 -0
- package/dist/{detector-C73Nxm94.mjs → detector-DWXkeTlk.mjs} +2 -2
- package/dist/{detector-C73Nxm94.mjs.map → detector-DWXkeTlk.mjs.map} +1 -1
- package/dist/{embeddings-CEBGrzwu.mjs → embeddings-ClqKtLZ8.mjs} +1 -1
- package/dist/{embeddings-DOLZnT1X.mjs → embeddings-DvRKcQyt.mjs} +1 -1
- package/dist/{embeddings-DOLZnT1X.mjs.map → embeddings-DvRKcQyt.mjs.map} +1 -1
- package/dist/factory-47Qf_df7.mjs +3 -0
- package/dist/{factory-DEb9NmHJ.mjs → factory-DNYAqjH0.mjs} +8 -8
- package/dist/{factory-DEb9NmHJ.mjs.map → factory-DNYAqjH0.mjs.map} +1 -1
- package/dist/{fallback-oJl3BaIN.mjs → fallback-Cwt4hmh5.mjs} +182 -122
- package/dist/fallback-Cwt4hmh5.mjs.map +1 -0
- package/dist/{helpers-IjZkXBhj.mjs → helpers-crDEr6S2.mjs} +1 -1
- package/dist/{helpers-IjZkXBhj.mjs.map → helpers-crDEr6S2.mjs.map} +1 -1
- package/dist/hooks/capture-all-events.mjs +117 -34
- package/dist/hooks/capture-all-events.mjs.map +4 -4
- package/dist/hooks/capture-session-summary.mjs +110 -33
- package/dist/hooks/capture-session-summary.mjs.map +4 -4
- package/dist/hooks/capture-tool-output.mjs +105 -28
- package/dist/hooks/capture-tool-output.mjs.map +4 -4
- package/dist/hooks/cleanup-session-files.mjs +54 -13
- package/dist/hooks/cleanup-session-files.mjs.map +2 -2
- package/dist/hooks/context-compression-hook.mjs +7565 -122
- package/dist/hooks/context-compression-hook.mjs.map +4 -4
- package/dist/hooks/initialize-session.mjs +55 -14
- package/dist/hooks/initialize-session.mjs.map +2 -2
- package/dist/hooks/inject-observations.mjs +79 -18
- package/dist/hooks/inject-observations.mjs.map +3 -3
- package/dist/hooks/load-core-context.mjs +55 -14
- package/dist/hooks/load-core-context.mjs.map +2 -2
- package/dist/hooks/load-project-context.mjs +185 -103
- package/dist/hooks/load-project-context.mjs.map +4 -4
- package/dist/hooks/mcp-deferred-gate.mjs +54 -13
- package/dist/hooks/mcp-deferred-gate.mjs.map +2 -2
- package/dist/hooks/mcp-deferred-reminder.mjs +9 -0
- package/dist/hooks/mcp-deferred-reminder.mjs.map +3 -3
- package/dist/hooks/observe.mjs +54 -13
- package/dist/hooks/observe.mjs.map +2 -2
- package/dist/hooks/post-compact-inject.mjs +7419 -16
- package/dist/hooks/post-compact-inject.mjs.map +4 -4
- package/dist/hooks/route-agents-to-worker.mjs +7778 -171
- package/dist/hooks/route-agents-to-worker.mjs.map +4 -4
- package/dist/hooks/route-edits-to-worker.mjs +90 -0
- package/dist/hooks/route-edits-to-worker.mjs.map +7 -0
- package/dist/hooks/security-validator.mjs +147 -6
- package/dist/hooks/security-validator.mjs.map +4 -4
- package/dist/hooks/session-commands.mjs +9 -0
- package/dist/hooks/session-commands.mjs.map +3 -3
- package/dist/hooks/stop-hook.mjs +182 -105
- package/dist/hooks/stop-hook.mjs.map +4 -4
- package/dist/hooks/subagent-stop-hook.mjs +3 -0
- package/dist/hooks/subagent-stop-hook.mjs.map +1 -1
- package/dist/hooks/sync-todo-to-md.mjs +54 -13
- package/dist/hooks/sync-todo-to-md.mjs.map +2 -2
- package/dist/hooks/update-tab-on-action.mjs +3 -0
- package/dist/hooks/update-tab-on-action.mjs.map +1 -1
- package/dist/hooks/update-tab-titles.mjs +3 -0
- package/dist/hooks/update-tab-titles.mjs.map +1 -1
- package/dist/hooks/whisper-reinject.mjs +3 -0
- package/dist/hooks/whisper-reinject.mjs.map +1 -1
- package/dist/hooks/whisper-rules.mjs +134 -29
- package/dist/hooks/whisper-rules.mjs.map +4 -4
- package/dist/hooks/worker-proxy.mjs +7737 -117
- package/dist/hooks/worker-proxy.mjs.map +4 -4
- package/dist/hooks/worker-status-line.mjs +7791 -144
- package/dist/hooks/worker-status-line.mjs.map +4 -4
- package/dist/hooks/worker-supervision.mjs +7721 -115
- package/dist/hooks/worker-supervision.mjs.map +4 -4
- package/dist/index.d.mts +4 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/{indexer-backend-BPTzKFZU.mjs → indexer-backend-CdvCJCkD.mjs} +3 -3
- package/dist/{indexer-backend-BPTzKFZU.mjs.map → indexer-backend-CdvCJCkD.mjs.map} +1 -1
- package/dist/{ipc-client-BmypMNYk.mjs → ipc-client-C6NryMMb.mjs} +2 -2
- package/dist/{ipc-client-BmypMNYk.mjs.map → ipc-client-C6NryMMb.mjs.map} +1 -1
- package/dist/{kg-entity-r8duqhi9.mjs → kg-entity-BSjM5xZh.mjs} +1 -1
- package/dist/{kg-entity-r8duqhi9.mjs.map → kg-entity-BSjM5xZh.mjs.map} +1 -1
- package/dist/{latent-ideas-CtSca4qG.mjs → latent-ideas-BfL4nCQ3.mjs} +4 -4
- package/dist/{latent-ideas-CtSca4qG.mjs.map → latent-ideas-BfL4nCQ3.mjs.map} +1 -1
- package/dist/{link-boost-Bucnz3n8.mjs → link-boost-C5PaNdzm.mjs} +1 -1
- package/dist/{link-boost-Bucnz3n8.mjs.map → link-boost-C5PaNdzm.mjs.map} +1 -1
- package/dist/main-resolver-CnfnWa8C.mjs +7 -0
- package/dist/{main-resolver-DnkxPYkr.mjs → main-resolver-DvYu9jbl.mjs} +21 -11
- package/dist/main-resolver-DvYu9jbl.mjs.map +1 -0
- package/dist/{migrate-Cjzeefn9.mjs → migrate-CfERwXhY.mjs} +2 -2
- package/dist/{migrate-Cjzeefn9.mjs.map → migrate-CfERwXhY.mjs.map} +1 -1
- package/dist/{neighborhood-CM7Jgb51.mjs → neighborhood-CETR_P4y.mjs} +2 -2
- package/dist/{neighborhood-CM7Jgb51.mjs.map → neighborhood-CETR_P4y.mjs.map} +1 -1
- package/dist/{note-context-DCwE2A-M.mjs → note-context-DCcRWBoN.mjs} +1 -1
- package/dist/{note-context-DCwE2A-M.mjs.map → note-context-DCcRWBoN.mjs.map} +1 -1
- package/dist/pai-home-ChAOupZc.mjs +164 -0
- package/dist/pai-home-ChAOupZc.mjs.map +1 -0
- package/dist/{pai-marker-CHtbJMwJ.mjs → pai-marker-B20KqhA8.mjs} +1 -1
- package/dist/{pai-marker-CHtbJMwJ.mjs.map → pai-marker-B20KqhA8.mjs.map} +1 -1
- package/dist/{planner-D5Ui7DAm.mjs → planner-pXRc-8yt.mjs} +7 -6
- package/dist/{planner-D5Ui7DAm.mjs.map → planner-pXRc-8yt.mjs.map} +1 -1
- package/dist/{postgres-CtOzfoQU.mjs → postgres-CUSXWgTG.mjs} +2 -2
- package/dist/{postgres-CtOzfoQU.mjs.map → postgres-CUSXWgTG.mjs.map} +1 -1
- package/dist/{program-zpoYnJGz.mjs → program-LLNPpxlj.mjs} +8308 -6065
- package/dist/program-LLNPpxlj.mjs.map +1 -0
- package/dist/query-feedback-C7rSfiXU.mjs +3 -0
- package/dist/{query-feedback-Dqz-HC__.mjs → query-feedback-CYyOGi3y.mjs} +20 -6
- package/dist/query-feedback-CYyOGi3y.mjs.map +1 -0
- package/dist/{reranker-CwTCNsgA.mjs → reranker-B5qUTamW.mjs} +1 -1
- package/dist/{reranker-xPm04PXx.mjs → reranker-HHmhZk6v.mjs} +1 -1
- package/dist/{reranker-xPm04PXx.mjs.map → reranker-HHmhZk6v.mjs.map} +1 -1
- package/dist/router-CremHKTI.mjs +3 -0
- package/dist/{router-DD6D4j31.mjs → router-DBAZfE7X.mjs} +2 -2
- package/dist/{router-DD6D4j31.mjs.map → router-DBAZfE7X.mjs.map} +1 -1
- package/dist/{run-D7K5UALn.mjs → run-DDdT9teG.mjs} +530 -210
- package/dist/run-DDdT9teG.mjs.map +1 -0
- package/dist/{runtime-paths-rni52zHX.mjs → runtime-paths-B0P1TvUr.mjs} +1 -1
- package/dist/{runtime-paths-rni52zHX.mjs.map → runtime-paths-B0P1TvUr.mjs.map} +1 -1
- package/dist/{search-Rpk1cSBC.mjs → search-B69cQwDB.mjs} +3 -3
- package/dist/{search-Rpk1cSBC.mjs.map → search-B69cQwDB.mjs.map} +1 -1
- package/dist/{search-CfPpJAWQ.mjs → search-fb-5ovj4.mjs} +2 -2
- package/dist/{server-D4vAieF4.mjs → server-Ch99xt5K.mjs} +15 -14
- package/dist/server-Ch99xt5K.mjs.map +1 -0
- package/dist/skills/Advisor/SKILL.md +3 -3
- package/dist/skills/Providers/SKILL.md +30 -0
- package/dist/skills/Reconstruct/SKILL.md +1 -1
- package/dist/skills/VaultContext/SKILL.md +1 -1
- package/dist/skills/Whisper/SKILL.md +3 -3
- package/dist/skills/Worker/SKILL.md +1 -1
- package/dist/{sources-CS43CpuS.mjs → sources-KBGEA_E6.mjs} +2 -2
- package/dist/{sources-CS43CpuS.mjs.map → sources-KBGEA_E6.mjs.map} +1 -1
- package/dist/{sqlite-Cq3gJcq9.mjs → sqlite-By6r2YhZ.mjs} +3 -3
- package/dist/{sqlite-Cq3gJcq9.mjs.map → sqlite-By6r2YhZ.mjs.map} +1 -1
- package/dist/{state-CY6I-Hnc.mjs → state-DnYGRmS7.mjs} +1 -1
- package/dist/{state-BRdB-Bf1.mjs → state-PJrgfDLW.mjs} +1 -1
- package/dist/{state-BRdB-Bf1.mjs.map → state-PJrgfDLW.mjs.map} +1 -1
- package/dist/{stop-words-Hfu8u22w.mjs → stop-words-BaMEGVeY.mjs} +1 -1
- package/dist/{stop-words-Hfu8u22w.mjs.map → stop-words-BaMEGVeY.mjs.map} +1 -1
- package/dist/{sync-BWbe8JTg.mjs → sync-Btcb6xA4.mjs} +3 -3
- package/dist/{sync-BWbe8JTg.mjs.map → sync-Btcb6xA4.mjs.map} +1 -1
- package/dist/{themes-B7h9YDiy.mjs → themes-BVoAnLZj.mjs} +3 -3
- package/dist/{themes-B7h9YDiy.mjs.map → themes-BVoAnLZj.mjs.map} +1 -1
- package/dist/{tools-BW3NLMPk.mjs → tools-BradfQk7.mjs} +4 -3
- package/dist/{tools-LlzcV_eK.mjs → tools-UrSHIe29.mjs} +30 -233
- package/dist/tools-UrSHIe29.mjs.map +1 -0
- package/dist/{trace-u4hT-pLD.mjs → trace-Cy8quQTm.mjs} +1 -1
- package/dist/{trace-u4hT-pLD.mjs.map → trace-Cy8quQTm.mjs.map} +1 -1
- package/dist/{utils-DhMex3Ox.mjs → utils-BD8g8oSf.mjs} +1 -1
- package/dist/{utils-9Err2RBW.mjs → utils-CJymHkYm.mjs} +1 -1
- package/dist/{utils-9Err2RBW.mjs.map → utils-CJymHkYm.mjs.map} +1 -1
- package/dist/{vault-indexer-mata9S7b.mjs → vault-indexer-C5i-OAyr.mjs} +2 -2
- package/dist/{vault-indexer-mata9S7b.mjs.map → vault-indexer-C5i-OAyr.mjs.map} +1 -1
- package/dist/wakeup-TnGjJY3I.mjs +218 -0
- package/dist/wakeup-TnGjJY3I.mjs.map +1 -0
- package/dist/work-queue-worker-BA5IDBwQ.mjs +567 -0
- package/dist/work-queue-worker-BA5IDBwQ.mjs.map +1 -0
- package/dist/work-queue-worker-DLM2wlqM.mjs +14 -0
- package/dist/{zettelkasten-F0D_XfQ4.mjs → zettelkasten-BBjA7GcP.mjs} +4 -4
- package/dist/{zettelkasten-F0D_XfQ4.mjs.map → zettelkasten-BBjA7GcP.mjs.map} +1 -1
- package/docs/commands/README.md +30 -3
- package/docs/commands/audit.md +88 -0
- package/docs/commands/backup.md +2 -2
- package/docs/commands/clear-names.md +1 -1
- package/docs/commands/config.md +59 -0
- package/docs/commands/daemon.md +1 -1
- package/docs/commands/db.md +1 -1
- package/docs/commands/end.md +1 -1
- package/docs/commands/help.md +1 -1
- package/docs/commands/identity.md +1 -1
- package/docs/commands/kg.md +1 -1
- package/docs/commands/launch.md +45 -0
- package/docs/commands/mcp.md +1 -1
- package/docs/commands/memory.md +3 -3
- package/docs/commands/notify.md +1 -1
- package/docs/commands/observation.md +1 -1
- package/docs/commands/obsidian.md +1 -1
- package/docs/commands/pause.md +1 -1
- package/docs/commands/project.md +46 -1
- package/docs/commands/projects.md +46 -1
- package/docs/commands/registry.md +1 -1
- package/docs/commands/restore.md +1 -1
- package/docs/commands/session.md +1 -1
- package/docs/commands/sessions.md +1 -1
- package/docs/commands/setup.md +1 -1
- package/docs/commands/shell-init.md +1 -1
- package/docs/commands/skill.md +1 -1
- package/docs/commands/task.md +1 -1
- package/docs/commands/topic.md +1 -1
- package/docs/commands/update.md +1 -1
- package/docs/commands/worker.md +95 -6
- package/docs/commands/zettel.md +1 -1
- package/docs/provider-abstraction.md +1 -1
- package/docs/provider-independence-details.md +8 -5
- package/docs/task-bus.md +1 -1
- package/docs/worker.md +136 -83
- package/docs/workers-config.md +446 -0
- package/package.json +4 -2
- package/scripts/build-hooks.mjs +56 -3
- package/src/hooks/pre-compact.sh +5 -2
- package/src/hooks/session-stop.sh +29 -4
- package/src/hooks/ts/capture-all-events.ts +3 -3
- package/src/hooks/ts/lib/advisor-budget.test.ts +98 -0
- package/src/hooks/ts/lib/advisor-budget.ts +90 -0
- package/src/hooks/ts/lib/agent-gate.test.ts +101 -0
- package/src/hooks/ts/lib/agent-gate.ts +112 -0
- package/src/hooks/ts/lib/context-fill.ts +2 -2
- package/src/hooks/ts/lib/edit-gate.test.ts +52 -0
- package/src/hooks/ts/lib/edit-gate.ts +51 -0
- package/src/hooks/ts/lib/mcp-deferred-reminder.test.ts +8 -0
- package/src/hooks/ts/lib/pai-paths.test.ts +93 -0
- package/src/hooks/ts/lib/pai-paths.ts +168 -24
- package/src/hooks/ts/lib/project-utils/index.ts +1 -0
- package/src/hooks/ts/lib/project-utils/paths.ts +5 -4
- package/src/hooks/ts/lib/project-utils.ts +1 -0
- package/src/hooks/ts/post-tool-use/capture-tool-output.ts +2 -2
- package/src/hooks/ts/pre-compact/context-compression-hook.ts +1 -1
- package/src/hooks/ts/pre-tool-use/route-agents-to-worker.ts +46 -99
- package/src/hooks/ts/pre-tool-use/route-edits-to-worker.test.ts +47 -0
- package/src/hooks/ts/pre-tool-use/route-edits-to-worker.ts +96 -0
- package/src/hooks/ts/pre-tool-use/security-validator.ts +2 -1
- package/src/hooks/ts/session-end/capture-session-summary.ts +4 -4
- package/src/hooks/ts/session-start/initialize-session.ts +3 -3
- package/src/hooks/ts/session-start/inject-observations.test.ts +56 -0
- package/src/hooks/ts/session-start/inject-observations.ts +28 -8
- package/src/hooks/ts/session-start/load-core-context.ts +4 -4
- package/src/hooks/ts/session-start/load-project-context.ts +2 -2
- package/src/hooks/ts/session-start/mcp-deferred-reminder.ts +2 -0
- package/src/hooks/ts/session-start/session-commands.ts +4 -0
- package/src/hooks/ts/session-start/session-start-worker-guard.test.ts +36 -0
- package/src/hooks/ts/stop/stop-hook.ts +6 -11
- package/src/hooks/ts/user-prompt/whisper-rules.test.ts +49 -0
- package/src/hooks/ts/user-prompt/whisper-rules.ts +88 -47
- package/statusline-command.sh +277 -116
- package/templates/agent-prefs.example.md +8 -8
- package/templates/claude-md.template.md +1 -1
- package/templates/voices.example.json +3 -3
- package/dist/config-C_ErGddD.mjs +0 -3
- package/dist/config-_lQI_W08.mjs +0 -640
- package/dist/config-_lQI_W08.mjs.map +0 -1
- package/dist/context-handover-cache-pNFdBNrU.mjs +0 -1548
- package/dist/context-handover-cache-pNFdBNrU.mjs.map +0 -1
- package/dist/daemon-B8N1egl0.mjs.map +0 -1
- package/dist/daemon-DHfyoTlk.mjs +0 -23
- package/dist/db-O-cyAPfS.mjs +0 -3
- package/dist/db-XEwJbuGO.mjs +0 -3
- package/dist/detector-C-7KRi42.mjs +0 -5
- package/dist/factory-Dbo8yNPi.mjs +0 -3
- package/dist/fallback-oJl3BaIN.mjs.map +0 -1
- package/dist/main-resolver-BAfOMppW.mjs +0 -7
- package/dist/main-resolver-DnkxPYkr.mjs.map +0 -1
- package/dist/program-zpoYnJGz.mjs.map +0 -1
- package/dist/query-feedback-DGoVRaWD.mjs +0 -3
- package/dist/query-feedback-Dqz-HC__.mjs.map +0 -1
- package/dist/router-BTIGZR2_.mjs +0 -3
- package/dist/run-D7K5UALn.mjs.map +0 -1
- package/dist/server-D4vAieF4.mjs.map +0 -1
- package/dist/tools-LlzcV_eK.mjs.map +0 -1
- package/dist/work-queue-worker-AEmfVE0F.mjs +0 -14
- package/dist/work-queue-worker-DIT-VLSh.mjs +0 -2136
- package/dist/work-queue-worker-DIT-VLSh.mjs.map +0 -1
- /package/dist/{indexer-D7MvSQPY.mjs → indexer-C5Le7XE7.mjs} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { n as cosineSimilarity } from "./embeddings-
|
|
2
|
-
import { t as STOP_WORDS } from "./stop-words-
|
|
3
|
-
import { c as touchChunksLastAccessed, i as populateSlugs, o as searchMemoryHybrid } from "./search-
|
|
4
|
-
import { r as formatDetectionJson, t as detectProject } from "./detect-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { n as cosineSimilarity } from "./embeddings-DvRKcQyt.mjs";
|
|
2
|
+
import { t as STOP_WORDS } from "./stop-words-BaMEGVeY.mjs";
|
|
3
|
+
import { c as touchChunksLastAccessed, i as populateSlugs, o as searchMemoryHybrid } from "./search-B69cQwDB.mjs";
|
|
4
|
+
import { r as formatDetectionJson, t as detectProject } from "./detect-Bf2z-oKB.mjs";
|
|
5
|
+
import { t as buildWakeupContext } from "./wakeup-TnGjJY3I.mjs";
|
|
6
|
+
import { a as kgContradictions, i as kgAdd, n as updateEntityFeedbackWeight, o as kgInvalidate, s as kgQuery, t as listKgEntities } from "./kg-entity-BSjM5xZh.mjs";
|
|
7
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
8
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
9
9
|
|
|
10
10
|
//#region src/mcp/tools/types.ts
|
|
11
11
|
/**
|
|
@@ -79,7 +79,7 @@ async function toolMemorySearch(registryDb, federation, params, searchDefaults)
|
|
|
79
79
|
const isBackend = (x) => "backendType" in x;
|
|
80
80
|
if (isBackend(federation)) if (mode === "keyword") results = await federation.searchKeyword(params.query, searchOpts);
|
|
81
81
|
else if (mode === "semantic" || mode === "hybrid") {
|
|
82
|
-
const { generateEmbedding } = await import("./embeddings-
|
|
82
|
+
const { generateEmbedding } = await import("./embeddings-ClqKtLZ8.mjs");
|
|
83
83
|
const queryEmbedding = await generateEmbedding(params.query, true);
|
|
84
84
|
if (mode === "semantic") results = await federation.searchSemantic(queryEmbedding, searchOpts);
|
|
85
85
|
else {
|
|
@@ -94,17 +94,17 @@ async function toolMemorySearch(registryDb, federation, params, searchDefaults)
|
|
|
94
94
|
}
|
|
95
95
|
} else results = await federation.searchKeyword(params.query, searchOpts);
|
|
96
96
|
else {
|
|
97
|
-
const { searchMemory, searchMemorySemantic } = await import("./search-
|
|
97
|
+
const { searchMemory, searchMemorySemantic } = await import("./search-fb-5ovj4.mjs");
|
|
98
98
|
if (mode === "keyword") results = searchMemory(federation, params.query, searchOpts);
|
|
99
99
|
else if (mode === "semantic" || mode === "hybrid") {
|
|
100
|
-
const { generateEmbedding } = await import("./embeddings-
|
|
100
|
+
const { generateEmbedding } = await import("./embeddings-ClqKtLZ8.mjs");
|
|
101
101
|
const queryEmbedding = await generateEmbedding(params.query, true);
|
|
102
102
|
if (mode === "semantic") results = searchMemorySemantic(federation, queryEmbedding, searchOpts);
|
|
103
103
|
else results = searchMemoryHybrid(federation, params.query, queryEmbedding, searchOpts);
|
|
104
104
|
} else results = searchMemory(federation, params.query, searchOpts);
|
|
105
105
|
}
|
|
106
106
|
try {
|
|
107
|
-
const { applyLinkBoost } = await import("./link-boost-
|
|
107
|
+
const { applyLinkBoost } = await import("./link-boost-C5PaNdzm.mjs");
|
|
108
108
|
const paths = [...new Set(results.map((r) => r.path))];
|
|
109
109
|
if (isBackend(federation) && paths.length > 1) {
|
|
110
110
|
const edges = [];
|
|
@@ -127,12 +127,12 @@ async function toolMemorySearch(registryDb, federation, params, searchDefaults)
|
|
|
127
127
|
} catch {}
|
|
128
128
|
const shouldRerank = params.rerank ?? searchDefaults?.rerank ?? true;
|
|
129
129
|
if (shouldRerank && results.length > 0) {
|
|
130
|
-
const { rerankResults } = await import("./reranker-
|
|
130
|
+
const { rerankResults } = await import("./reranker-B5qUTamW.mjs");
|
|
131
131
|
results = await rerankResults(params.query, results, { topK: searchOpts.maxResults ?? 5 });
|
|
132
132
|
}
|
|
133
133
|
const recencyDays = params.recencyBoost ?? searchDefaults?.recencyBoostDays ?? 0;
|
|
134
134
|
if (recencyDays > 0 && results.length > 0) {
|
|
135
|
-
const { applyRecencyBoost } = await import("./search-
|
|
135
|
+
const { applyRecencyBoost } = await import("./search-fb-5ovj4.mjs");
|
|
136
136
|
results = applyRecencyBoost(results, recencyDays);
|
|
137
137
|
}
|
|
138
138
|
const withSlugs = populateSlugs(results, registryDb);
|
|
@@ -151,7 +151,7 @@ async function toolMemorySearch(registryDb, federation, params, searchDefaults)
|
|
|
151
151
|
return `${header}\n${raw.length > snippetLength ? raw.slice(0, snippetLength) + "..." : raw}`;
|
|
152
152
|
}).join(useCompact ? "\n" : "\n\n---\n\n");
|
|
153
153
|
try {
|
|
154
|
-
const { saveQueryResult } = await import("./query-feedback-
|
|
154
|
+
const { saveQueryResult } = await import("./query-feedback-C7rSfiXU.mjs");
|
|
155
155
|
saveQueryResult({
|
|
156
156
|
query: params.query,
|
|
157
157
|
timestamp: Date.now(),
|
|
@@ -376,7 +376,7 @@ async function toolProjectHealth(registryDb, params) {
|
|
|
376
376
|
const { existsSync: fsExists, readdirSync, statSync } = await import("node:fs");
|
|
377
377
|
const { join: pathJoin, basename: pathBasename } = await import("node:path");
|
|
378
378
|
const { homedir } = await import("node:os");
|
|
379
|
-
const { encodeDir: enc } = await import("./utils-
|
|
379
|
+
const { encodeDir: enc } = await import("./utils-BD8g8oSf.mjs");
|
|
380
380
|
const rows = registryDb.prepare(`SELECT p.id, p.slug, p.display_name, p.root_path, p.encoded_dir, p.status, p.type,
|
|
381
381
|
(SELECT COUNT(*) FROM sessions s WHERE s.project_id = p.id) AS session_count
|
|
382
382
|
FROM projects p
|
|
@@ -676,7 +676,7 @@ function toolSessionList(registryDb, params) {
|
|
|
676
676
|
*/
|
|
677
677
|
async function toolSessionRoute(registryDb, federation, params) {
|
|
678
678
|
try {
|
|
679
|
-
const { autoRoute, formatAutoRouteJson } = await import("./auto-route-
|
|
679
|
+
const { autoRoute, formatAutoRouteJson } = await import("./auto-route-CcD0OWWB.mjs");
|
|
680
680
|
const result = await autoRoute(registryDb, federation, params.cwd, params.context);
|
|
681
681
|
if (!result) return { content: [{
|
|
682
682
|
type: "text",
|
|
@@ -740,7 +740,7 @@ function toolRegistrySearch(registryDb, params) {
|
|
|
740
740
|
//#region src/mcp/tools/zettel.ts
|
|
741
741
|
async function toolZettelExplore(backend, params) {
|
|
742
742
|
try {
|
|
743
|
-
const { zettelExplore } = await import("./zettelkasten-
|
|
743
|
+
const { zettelExplore } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
744
744
|
const result = await zettelExplore(backend, {
|
|
745
745
|
startNote: params.start_note,
|
|
746
746
|
depth: params.depth,
|
|
@@ -763,7 +763,7 @@ async function toolZettelExplore(backend, params) {
|
|
|
763
763
|
}
|
|
764
764
|
async function toolZettelHealth(backend, params) {
|
|
765
765
|
try {
|
|
766
|
-
const { zettelHealth } = await import("./zettelkasten-
|
|
766
|
+
const { zettelHealth } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
767
767
|
const result = await zettelHealth(backend, {
|
|
768
768
|
scope: params.scope,
|
|
769
769
|
projectPath: params.project_path,
|
|
@@ -786,7 +786,7 @@ async function toolZettelHealth(backend, params) {
|
|
|
786
786
|
}
|
|
787
787
|
async function toolZettelSurprise(backend, params) {
|
|
788
788
|
try {
|
|
789
|
-
const { zettelSurprise } = await import("./zettelkasten-
|
|
789
|
+
const { zettelSurprise } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
790
790
|
const results = await zettelSurprise(backend, {
|
|
791
791
|
referencePath: params.reference_path,
|
|
792
792
|
vaultProjectId: params.vault_project_id,
|
|
@@ -810,7 +810,7 @@ async function toolZettelSurprise(backend, params) {
|
|
|
810
810
|
}
|
|
811
811
|
async function toolZettelSuggest(backend, params) {
|
|
812
812
|
try {
|
|
813
|
-
const { zettelSuggest } = await import("./zettelkasten-
|
|
813
|
+
const { zettelSuggest } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
814
814
|
const results = await zettelSuggest(backend, {
|
|
815
815
|
notePath: params.note_path,
|
|
816
816
|
vaultProjectId: params.vault_project_id,
|
|
@@ -833,7 +833,7 @@ async function toolZettelSuggest(backend, params) {
|
|
|
833
833
|
}
|
|
834
834
|
async function toolZettelConverse(backend, params) {
|
|
835
835
|
try {
|
|
836
|
-
const { zettelConverse } = await import("./zettelkasten-
|
|
836
|
+
const { zettelConverse } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
837
837
|
const result = await zettelConverse(backend, {
|
|
838
838
|
question: params.question,
|
|
839
839
|
vaultProjectId: params.vault_project_id,
|
|
@@ -841,7 +841,7 @@ async function toolZettelConverse(backend, params) {
|
|
|
841
841
|
limit: params.limit
|
|
842
842
|
});
|
|
843
843
|
try {
|
|
844
|
-
const { saveQueryResult } = await import("./query-feedback-
|
|
844
|
+
const { saveQueryResult } = await import("./query-feedback-C7rSfiXU.mjs");
|
|
845
845
|
saveQueryResult({
|
|
846
846
|
query: params.question,
|
|
847
847
|
timestamp: Date.now(),
|
|
@@ -869,7 +869,7 @@ async function toolZettelConverse(backend, params) {
|
|
|
869
869
|
}
|
|
870
870
|
async function toolZettelThemes(backend, params) {
|
|
871
871
|
try {
|
|
872
|
-
const { zettelThemes } = await import("./zettelkasten-
|
|
872
|
+
const { zettelThemes } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
873
873
|
const result = await zettelThemes(backend, {
|
|
874
874
|
vaultProjectId: params.vault_project_id,
|
|
875
875
|
lookbackDays: params.lookback_days,
|
|
@@ -893,7 +893,7 @@ async function toolZettelThemes(backend, params) {
|
|
|
893
893
|
}
|
|
894
894
|
async function toolZettelGodNotes(backend, params) {
|
|
895
895
|
try {
|
|
896
|
-
const { zettelGodNotes } = await import("./zettelkasten-
|
|
896
|
+
const { zettelGodNotes } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
897
897
|
const result = await zettelGodNotes(backend, {
|
|
898
898
|
limit: params.limit,
|
|
899
899
|
minInbound: params.min_inbound
|
|
@@ -914,7 +914,7 @@ async function toolZettelGodNotes(backend, params) {
|
|
|
914
914
|
}
|
|
915
915
|
async function toolZettelCommunities(backend, params) {
|
|
916
916
|
try {
|
|
917
|
-
const { zettelCommunities } = await import("./zettelkasten-
|
|
917
|
+
const { zettelCommunities } = await import("./zettelkasten-BBjA7GcP.mjs");
|
|
918
918
|
const result = await zettelCommunities(backend, {
|
|
919
919
|
minSize: params.min_size,
|
|
920
920
|
maxCommunities: params.max_communities,
|
|
@@ -1045,209 +1045,6 @@ async function toolKgContradictions(pool, params) {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
1048
|
-
//#endregion
|
|
1049
|
-
//#region src/memory/wakeup.ts
|
|
1050
|
-
/**
|
|
1051
|
-
* Wake-up context system — progressive context loading inspired by mempalace.
|
|
1052
|
-
*
|
|
1053
|
-
* Layers:
|
|
1054
|
-
* L0 Identity (~100 tokens) — user identity from ~/.pai/identity.txt. Always loaded.
|
|
1055
|
-
* L1 Essential Story (~500-800t) — top session notes for the project, key lines extracted.
|
|
1056
|
-
* L2 On-Demand — triggered by topic queries (handled by memory_search).
|
|
1057
|
-
* L3 Deep Search — unlimited federated memory search (memory_search tool).
|
|
1058
|
-
*/
|
|
1059
|
-
/** Maximum tokens for the L1 essential story block. Approx 4 chars/token. */
|
|
1060
|
-
const L1_TOKEN_BUDGET = 800;
|
|
1061
|
-
L1_TOKEN_BUDGET * 4;
|
|
1062
|
-
/** Maximum session notes to scan when building L1. */
|
|
1063
|
-
const L1_MAX_NOTES = 10;
|
|
1064
|
-
/** Sections to extract from session notes (in priority order). */
|
|
1065
|
-
const EXTRACT_SECTIONS = [
|
|
1066
|
-
"Work Done",
|
|
1067
|
-
"Key Decisions",
|
|
1068
|
-
"Next Steps",
|
|
1069
|
-
"Checkpoint"
|
|
1070
|
-
];
|
|
1071
|
-
/** Identity file location. */
|
|
1072
|
-
const IDENTITY_FILE = join(homedir(), ".pai", "identity.txt");
|
|
1073
|
-
/**
|
|
1074
|
-
* Load L0 identity from ~/.pai/identity.txt.
|
|
1075
|
-
* Returns the file content, or an empty string if the file does not exist.
|
|
1076
|
-
* Never throws.
|
|
1077
|
-
*/
|
|
1078
|
-
function loadL0Identity() {
|
|
1079
|
-
if (!existsSync(IDENTITY_FILE)) return "";
|
|
1080
|
-
try {
|
|
1081
|
-
return readFileSync(IDENTITY_FILE, "utf-8").trim();
|
|
1082
|
-
} catch {
|
|
1083
|
-
return "";
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
/**
|
|
1087
|
-
* Find the Notes directory for a project given its root_path from the registry.
|
|
1088
|
-
* Checks local Notes/ first, then central ~/.claude/projects/... path.
|
|
1089
|
-
*/
|
|
1090
|
-
function findNotesDirForProject(rootPath) {
|
|
1091
|
-
const localCandidates = [
|
|
1092
|
-
join(rootPath, "Notes"),
|
|
1093
|
-
join(rootPath, "notes"),
|
|
1094
|
-
join(rootPath, ".claude", "Notes")
|
|
1095
|
-
];
|
|
1096
|
-
for (const p of localCandidates) if (existsSync(p)) return p;
|
|
1097
|
-
const encoded = rootPath.replace(/\//g, "-").replace(/\./g, "-").replace(/ /g, "-");
|
|
1098
|
-
const centralNotes = join(homedir(), ".claude", "projects", encoded, "Notes");
|
|
1099
|
-
if (existsSync(centralNotes)) return centralNotes;
|
|
1100
|
-
return null;
|
|
1101
|
-
}
|
|
1102
|
-
/**
|
|
1103
|
-
* Recursively find all .md session note files in a Notes directory.
|
|
1104
|
-
* Handles both flat layout (Notes/*.md) and month-subdirectory layout
|
|
1105
|
-
* (Notes/YYYY/MM/*.md). Returns files sorted newest-first by filename
|
|
1106
|
-
* (note numbers are monotonically increasing, so lexicographic = newest-last,
|
|
1107
|
-
* so we reverse).
|
|
1108
|
-
*/
|
|
1109
|
-
function findSessionNotes(notesDir) {
|
|
1110
|
-
const result = [];
|
|
1111
|
-
const scanDir = (dir) => {
|
|
1112
|
-
if (!existsSync(dir)) return;
|
|
1113
|
-
let entries;
|
|
1114
|
-
try {
|
|
1115
|
-
entries = readdirSync(dir, { withFileTypes: true }).map((e) => ({
|
|
1116
|
-
name: e.name,
|
|
1117
|
-
isDir: e.isDirectory()
|
|
1118
|
-
}));
|
|
1119
|
-
} catch {
|
|
1120
|
-
return;
|
|
1121
|
-
}
|
|
1122
|
-
for (const entry of entries) {
|
|
1123
|
-
const fullPath = join(dir, entry.name);
|
|
1124
|
-
if (entry.isDir) scanDir(fullPath);
|
|
1125
|
-
else if (entry.name.match(/^\d{3,4}[\s_-].*\.md$/)) result.push(fullPath);
|
|
1126
|
-
}
|
|
1127
|
-
};
|
|
1128
|
-
scanDir(notesDir);
|
|
1129
|
-
const dateOf = (p) => basename(p).match(/(\d{4}-\d{2}-\d{2})/)?.[1] ?? "";
|
|
1130
|
-
const numberOf = (p) => parseInt(basename(p).match(/^(\d+)/)?.[1] ?? "0", 10);
|
|
1131
|
-
const mtimeOf = (p) => {
|
|
1132
|
-
try {
|
|
1133
|
-
return statSync(p).mtimeMs;
|
|
1134
|
-
} catch {
|
|
1135
|
-
return 0;
|
|
1136
|
-
}
|
|
1137
|
-
};
|
|
1138
|
-
result.sort((a, b) => {
|
|
1139
|
-
const dateA = dateOf(a);
|
|
1140
|
-
const dateB = dateOf(b);
|
|
1141
|
-
if (dateA !== dateB) {
|
|
1142
|
-
if (!dateA) return 1;
|
|
1143
|
-
if (!dateB) return -1;
|
|
1144
|
-
return dateB.localeCompare(dateA);
|
|
1145
|
-
}
|
|
1146
|
-
const byNumber = numberOf(b) - numberOf(a);
|
|
1147
|
-
if (byNumber !== 0) return byNumber;
|
|
1148
|
-
return mtimeOf(b) - mtimeOf(a);
|
|
1149
|
-
});
|
|
1150
|
-
return result;
|
|
1151
|
-
}
|
|
1152
|
-
/**
|
|
1153
|
-
* Extract the most important lines from a session note.
|
|
1154
|
-
* Prioritises: Work Done items, Key Decisions, Next Steps, Checkpoint headings.
|
|
1155
|
-
* Returns a condensed string under maxChars.
|
|
1156
|
-
*/
|
|
1157
|
-
function extractKeyLines(content, maxChars) {
|
|
1158
|
-
const lines = content.split("\n");
|
|
1159
|
-
const selected = [];
|
|
1160
|
-
let inTargetSection = false;
|
|
1161
|
-
let currentSection = "";
|
|
1162
|
-
let charCount = 0;
|
|
1163
|
-
for (const line of lines) {
|
|
1164
|
-
const h2Match = line.match(/^## (.+)$/);
|
|
1165
|
-
const h3Match = line.match(/^### (.+)$/);
|
|
1166
|
-
if (h2Match) {
|
|
1167
|
-
currentSection = h2Match[1];
|
|
1168
|
-
inTargetSection = EXTRACT_SECTIONS.some((s) => currentSection.toLowerCase().includes(s.toLowerCase()));
|
|
1169
|
-
continue;
|
|
1170
|
-
}
|
|
1171
|
-
if (h3Match) {
|
|
1172
|
-
if (inTargetSection) {
|
|
1173
|
-
const label = `[${h3Match[1]}]`;
|
|
1174
|
-
if (charCount + label.length < maxChars) {
|
|
1175
|
-
selected.push(label);
|
|
1176
|
-
charCount += label.length + 1;
|
|
1177
|
-
}
|
|
1178
|
-
}
|
|
1179
|
-
continue;
|
|
1180
|
-
}
|
|
1181
|
-
if (!inTargetSection) continue;
|
|
1182
|
-
const trimmed = line.trim();
|
|
1183
|
-
if (!trimmed || trimmed.startsWith("<!--") || trimmed === "---") continue;
|
|
1184
|
-
if (trimmed.startsWith("- ") || trimmed.startsWith("* ") || trimmed.match(/^\d+\./) || trimmed.startsWith("**")) {
|
|
1185
|
-
if (charCount + trimmed.length + 1 > maxChars) break;
|
|
1186
|
-
selected.push(trimmed);
|
|
1187
|
-
charCount += trimmed.length + 1;
|
|
1188
|
-
}
|
|
1189
|
-
}
|
|
1190
|
-
return selected.join("\n");
|
|
1191
|
-
}
|
|
1192
|
-
/**
|
|
1193
|
-
* Build the L1 essential story block.
|
|
1194
|
-
*
|
|
1195
|
-
* Reads the most recent session notes for the project and extracts the key
|
|
1196
|
-
* lines (Work Done, Key Decisions, Next Steps) within the token budget.
|
|
1197
|
-
*
|
|
1198
|
-
* @param rootPath The project root path (from the registry).
|
|
1199
|
-
* @param tokenBudget Max tokens to consume. Default 800 (~3200 chars).
|
|
1200
|
-
* @returns Formatted L1 block, or empty string if no notes found.
|
|
1201
|
-
*/
|
|
1202
|
-
function buildL1EssentialStory(rootPath, tokenBudget = L1_TOKEN_BUDGET) {
|
|
1203
|
-
const charBudget = tokenBudget * 4;
|
|
1204
|
-
const notesDir = findNotesDirForProject(rootPath);
|
|
1205
|
-
if (!notesDir) return "";
|
|
1206
|
-
const noteFiles = findSessionNotes(notesDir).slice(0, L1_MAX_NOTES);
|
|
1207
|
-
if (noteFiles.length === 0) return "";
|
|
1208
|
-
const sections = [];
|
|
1209
|
-
let remaining = charBudget;
|
|
1210
|
-
for (const noteFile of noteFiles) {
|
|
1211
|
-
if (remaining <= 50) break;
|
|
1212
|
-
let content;
|
|
1213
|
-
try {
|
|
1214
|
-
content = readFileSync(noteFile, "utf-8");
|
|
1215
|
-
} catch {
|
|
1216
|
-
continue;
|
|
1217
|
-
}
|
|
1218
|
-
const name = basename(noteFile);
|
|
1219
|
-
const titleMatch = name.match(/^\d+ - (\d{4}-\d{2}-\d{2}) - (.+)\.md$/);
|
|
1220
|
-
const dateLabel = titleMatch ? titleMatch[1] : "";
|
|
1221
|
-
const titleLabel = titleMatch ? titleMatch[2] : name.replace(/^\d+ - /, "").replace(/\.md$/, "");
|
|
1222
|
-
const perNoteChars = Math.min(remaining, Math.floor(charBudget / noteFiles.length) + 200);
|
|
1223
|
-
const extracted = extractKeyLines(content, perNoteChars);
|
|
1224
|
-
if (!extracted) continue;
|
|
1225
|
-
const noteBlock = `[${dateLabel} - ${titleLabel}]\n${extracted}`;
|
|
1226
|
-
sections.push(noteBlock);
|
|
1227
|
-
remaining -= noteBlock.length + 1;
|
|
1228
|
-
}
|
|
1229
|
-
if (sections.length === 0) return "";
|
|
1230
|
-
return sections.join("\n\n");
|
|
1231
|
-
}
|
|
1232
|
-
/**
|
|
1233
|
-
* Build the combined wake-up context block (L0 + L1).
|
|
1234
|
-
*
|
|
1235
|
-
* Returns a formatted string suitable for injection as a system-reminder,
|
|
1236
|
-
* or an empty string if both layers are empty.
|
|
1237
|
-
*
|
|
1238
|
-
* @param rootPath Project root path for L1 note lookup. Optional.
|
|
1239
|
-
* @param tokenBudget L1 token budget. Default 800.
|
|
1240
|
-
*/
|
|
1241
|
-
function buildWakeupContext(rootPath, tokenBudget = L1_TOKEN_BUDGET) {
|
|
1242
|
-
const identity = loadL0Identity();
|
|
1243
|
-
const essentialStory = rootPath ? buildL1EssentialStory(rootPath, tokenBudget) : "";
|
|
1244
|
-
if (!identity && !essentialStory) return "";
|
|
1245
|
-
const parts = [];
|
|
1246
|
-
if (identity) parts.push(`## L0 Identity\n\n${identity}`);
|
|
1247
|
-
if (essentialStory) parts.push(`## L1 Essential Story\n\n${essentialStory}`);
|
|
1248
|
-
return parts.join("\n\n");
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
1048
|
//#endregion
|
|
1252
1049
|
//#region src/mcp/tools/wakeup.ts
|
|
1253
1050
|
const DEFAULT_TOKEN_BUDGET = 800;
|
|
@@ -1781,7 +1578,7 @@ async function bfsExpand(pool, entityNames, hops, projectId) {
|
|
|
1781
1578
|
*/
|
|
1782
1579
|
async function rerankTriples(triples, queryVec, maxTriples) {
|
|
1783
1580
|
if (triples.length === 0) return [];
|
|
1784
|
-
const { generateEmbedding } = await import("./embeddings-
|
|
1581
|
+
const { generateEmbedding } = await import("./embeddings-ClqKtLZ8.mjs");
|
|
1785
1582
|
return (await Promise.all(triples.map(async (triple) => {
|
|
1786
1583
|
const text = `${triple.subject} ${triple.predicate} ${triple.object}`;
|
|
1787
1584
|
try {
|
|
@@ -1815,7 +1612,7 @@ async function graphCompletionSearch(federationDb, pool, queryVec, opts = {}) {
|
|
|
1815
1612
|
};
|
|
1816
1613
|
let seedChunks = [];
|
|
1817
1614
|
try {
|
|
1818
|
-
const { searchMemorySemantic } = await import("./search-
|
|
1615
|
+
const { searchMemorySemantic } = await import("./search-fb-5ovj4.mjs");
|
|
1819
1616
|
seedChunks = searchMemorySemantic(federationDb, queryVec, seedSearchOpts);
|
|
1820
1617
|
} catch (e) {
|
|
1821
1618
|
process.stderr.write(`[kg-search] Phase 1 seed search error: ${e}\n`);
|
|
@@ -1877,7 +1674,7 @@ async function toolMemoryKgSearch(federationDb, pool, params) {
|
|
|
1877
1674
|
}],
|
|
1878
1675
|
isError: true
|
|
1879
1676
|
};
|
|
1880
|
-
const { generateEmbedding } = await import("./embeddings-
|
|
1677
|
+
const { generateEmbedding } = await import("./embeddings-ClqKtLZ8.mjs");
|
|
1881
1678
|
const result = await graphCompletionSearch(federationDb, pool, await generateEmbedding(params.query, true), {
|
|
1882
1679
|
seedCount: params.wide_k ?? 50,
|
|
1883
1680
|
hops: params.neighborhood_depth ?? 1,
|
|
@@ -1914,4 +1711,4 @@ async function toolMemoryKgSearch(federationDb, pool, params) {
|
|
|
1914
1711
|
|
|
1915
1712
|
//#endregion
|
|
1916
1713
|
export { formatProject as A, toolProjectInfo as C, toolMemoryGet as D, combineHybridResults as E, toolMemorySearch as O, toolProjectHealth as S, toolProjectTodo as T, toolZettelThemes as _, toolMemoryWakeup as a, toolSessionRoute as b, toolKgInvalidate as c, toolZettelConverse as d, toolZettelExplore as f, toolZettelSurprise as g, toolZettelSuggest as h, toolMemoryTaxonomy as i, lookupProjectId as j, detectProjectFromPath as k, toolKgQuery as l, toolZettelHealth as m, toolMemoryFeedback as n, toolKgAdd as o, toolZettelGodNotes as p, toolMemoryTunnels as r, toolKgContradictions as s, toolMemoryKgSearch as t, toolZettelCommunities as u, toolRegistrySearch as v, toolProjectList as w, toolProjectDetect as x, toolSessionList as y };
|
|
1917
|
-
//# sourceMappingURL=tools-
|
|
1714
|
+
//# sourceMappingURL=tools-UrSHIe29.mjs.map
|