@tekmidian/pai 0.42.4 → 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
package/docs/worker.md
CHANGED
|
@@ -59,69 +59,62 @@ main session (Anthropic) workers (configured provider)
|
|
|
59
59
|
|
|
60
60
|
## Config
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
"mcpSets": {
|
|
99
|
-
"office": ["memory", "github"],
|
|
100
|
-
"tiny": ["fetcher"]
|
|
101
|
-
},
|
|
102
|
-
"pane": { "enabled": true, "fontSize": 13, "autoExitSecs": 60 },
|
|
103
|
-
"logDir": "~/.claude/logs/workers",
|
|
104
|
-
"routing": { "order": [], "cooldownMinutes": 30, "retryOnQuota": true }
|
|
105
|
-
}
|
|
106
|
-
}
|
|
62
|
+
Providers, model roles, class routing and MCP sets live in one hand-editable
|
|
63
|
+
file, `~/.claude/pai/workers.yaml` (per-user state, kept 0600, never
|
|
64
|
+
committed — `PAI_WORKERS_YAML` overrides it, `PAI_HOME` moves the whole
|
|
65
|
+
namespace) — see **docs/workers-config.md** for the full reference (the
|
|
66
|
+
annotated example, how to add a provider, the load order, and
|
|
67
|
+
`pai worker config migrate` for configs still on the old JSON shape or an
|
|
68
|
+
old `workers.yaml` location). Everything else worker-related (pane, log
|
|
69
|
+
dir, routing cooldown, cache-keepalive cadence, fallback) stays in
|
|
70
|
+
`~/.claude/pai/config.json`'s `workers` section.
|
|
71
|
+
|
|
72
|
+
Quick summary of workers.yaml:
|
|
73
|
+
|
|
74
|
+
```yaml
|
|
75
|
+
active: glm
|
|
76
|
+
|
|
77
|
+
providers:
|
|
78
|
+
anthropic:
|
|
79
|
+
builtin: true
|
|
80
|
+
models:
|
|
81
|
+
default: claude-sonnet-5
|
|
82
|
+
fast: claude-haiku-4-5-20251001
|
|
83
|
+
glm:
|
|
84
|
+
url: https://api.z.ai/api/anthropic
|
|
85
|
+
key: "sk-…" # or key_file: ~/.config/zai/api_key
|
|
86
|
+
tier: 2
|
|
87
|
+
models:
|
|
88
|
+
default: glm-5.3
|
|
89
|
+
fast: glm-5.3-flash
|
|
90
|
+
|
|
91
|
+
classes:
|
|
92
|
+
implement: glm
|
|
93
|
+
spotcheck: glm/fast
|
|
94
|
+
|
|
95
|
+
mcp_sets:
|
|
96
|
+
office: [memory, github]
|
|
107
97
|
```
|
|
108
98
|
|
|
109
|
-
- `
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
- `
|
|
114
|
-
|
|
115
|
-
- `
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
99
|
+
- `key` holds the API token inline (quoted; wins over `key_file` when both
|
|
100
|
+
are set). `key_file` points at a 0600 file holding it instead, if you'd
|
|
101
|
+
rather keep the secret out of this file. Either way it is never printed
|
|
102
|
+
back — `pai worker providers`/`config check` show `key ****`+ last 4.
|
|
103
|
+
- `active` is one provider name, `"auto"` to walk `routing.order` (still in
|
|
104
|
+
the JSON config), or the built-in `anthropic`.
|
|
105
|
+
- `protocol: openai` (plus `upstream_url`) routes the provider through the
|
|
106
|
+
built-in proxy (next section); `engine: codex` runs it on the Codex CLI
|
|
107
|
+
instead of Claude Code. `tier` (1 cheapest … 5 most expensive, default 3)
|
|
108
|
+
and `tags` describe a provider for routing constraints. These, and a
|
|
109
|
+
provider's `env`/`note`/`quota_probe`/`context_window`/`model_tiers`, are
|
|
110
|
+
optional advanced fields not shown in the starter — docs/workers-config.md
|
|
111
|
+
lists them all.
|
|
112
|
+
- A class target is `provider[/role]`; the object form (`provider` + `mcp`
|
|
113
|
+
allowlist, or routing-only constraints `maxCostTier`/`requireTags`/`order`)
|
|
114
|
+
is still supported for advanced routing.
|
|
115
|
+
|
|
116
|
+
Or add a provider from the CLI (writes workers.yaml once it exists, else the
|
|
117
|
+
JSON `workers` section):
|
|
125
118
|
|
|
126
119
|
```
|
|
127
120
|
pai worker providers add glm \
|
|
@@ -132,7 +125,7 @@ pai worker providers add glm \
|
|
|
132
125
|
--cost-tier 2 --tags code,long-context
|
|
133
126
|
pai worker providers add oai \
|
|
134
127
|
--upstream-url https://api.openai.com/v1 \
|
|
135
|
-
--key-file ~/.
|
|
128
|
+
--key-file ~/.claude/pai/keys/oai --model gpt-5.2
|
|
136
129
|
pai worker providers update glm --cost-tier 1 # tiers/tags change later
|
|
137
130
|
```
|
|
138
131
|
|
|
@@ -234,7 +227,9 @@ pai worker ps # this session's workers
|
|
|
234
227
|
pai worker follow [id] # live transcript (type to talk to it)
|
|
235
228
|
pai worker replay <id> # transcript of one worker
|
|
236
229
|
pai worker say <id> "<text>" # message a running worker
|
|
230
|
+
pai worker goal <id> "<text>" # re-goal a running worker (ps/pane label), no message sent
|
|
237
231
|
pai worker resume <id> "<text>" # continue a finished one, context intact
|
|
232
|
+
pai worker kill <id> # SIGTERM a running worker
|
|
238
233
|
pai worker mcp list # MCP servers + sets usable in --mcp
|
|
239
234
|
pai worker proxy [--port N|stop] # the translating proxy, by hand
|
|
240
235
|
pai worker log [all|tail|<id>] # raw streams + routing ledger
|
|
@@ -323,7 +318,7 @@ What `on` does:
|
|
|
323
318
|
`CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`.
|
|
324
319
|
- Pins the top-level `model` key to the provider's default model.
|
|
325
320
|
- Saves the replaced values under `workers.fallback.saved` in
|
|
326
|
-
`~/.
|
|
321
|
+
`~/.claude/pai/config.json` and writes a `FALLBACK-ACTIVE.md` note into the
|
|
327
322
|
workers log dir telling running sessions what to do.
|
|
328
323
|
|
|
329
324
|
Notes:
|
|
@@ -368,6 +363,17 @@ Notes:
|
|
|
368
363
|
|
|
369
364
|
### The worker contract
|
|
370
365
|
|
|
366
|
+
A worker owns its task: it finishes the work itself in its own process,
|
|
367
|
+
never hands the whole thing to a single child and steps back. Children exist
|
|
368
|
+
for two things only — parallelising independent parts of the task (each a
|
|
369
|
+
self-contained spec), or cheaper bounded sub-tasks (probes, renders, test
|
|
370
|
+
runs, lookups) run one tier down with `--class spotcheck`/`simple`. A worker
|
|
371
|
+
owns its children's results too: run them in the foreground or poll until
|
|
372
|
+
each finishes, verify, fold into the report — ending the parent's turn ends
|
|
373
|
+
the run and kills any child still going, so nothing is ever left running
|
|
374
|
+
unattended. `WORKER_CONTRACT_PROMPT` in `src/workers/report.ts` is the exact
|
|
375
|
+
text appended to every headless run's system prompt.
|
|
376
|
+
|
|
371
377
|
Headless runs append a system prompt that fixes the shape of the final
|
|
372
378
|
answer: act, verify, then stop with ONE JSON message
|
|
373
379
|
|
|
@@ -531,6 +537,13 @@ on top. An unknown name fails fast, listing what exists;
|
|
|
531
537
|
`pai worker mcp list` shows servers and sets. A caller-provided
|
|
532
538
|
`--mcp-config` always wins; MCP is chosen at launch, not mid-run.
|
|
533
539
|
|
|
540
|
+
`claude-in-chrome` is not an MCP server — it rides the Chrome native-host
|
|
541
|
+
bridge, which no config file loads and which is off in a spawned worker
|
|
542
|
+
until `--chrome` is passed. Allowlisting any
|
|
543
|
+
`mcp__claude-in-chrome__<tool>` (or the bare name) in `--allowedTools`
|
|
544
|
+
appends `--chrome` automatically; a `--chrome` passed by hand is kept
|
|
545
|
+
rather than duplicated.
|
|
546
|
+
|
|
534
547
|
## Scoping (who sees whose workers)
|
|
535
548
|
|
|
536
549
|
`ps`/`follow`/status line show the workers of the asking terminal:
|
|
@@ -584,6 +597,21 @@ background instead. Decisions are ledgered (`DENIED-ANTHROPIC-AGENT`,
|
|
|
584
597
|
- `pai worker off` — Agent subagents run on Anthropic again.
|
|
585
598
|
- `ALLOW_ANTHROPIC_AGENTS=1` — bypass for one session.
|
|
586
599
|
|
|
600
|
+
## Whisper rules: `@orchestrator` / `@worker` tags
|
|
601
|
+
|
|
602
|
+
Whisper rules are injected into every claude process, spawned workers
|
|
603
|
+
included, but some rules only make sense for one side — "delegate to
|
|
604
|
+
workers" means nothing inside a worker that cannot spawn more workers past
|
|
605
|
+
the tree cap. A comment line `# @orchestrator` in whisper-rules.md marks
|
|
606
|
+
every rule that follows as orchestrator-only, `# @worker` marks worker-only,
|
|
607
|
+
and the next section header (`# N. TITLE`) resets to untagged (reaches
|
|
608
|
+
both); a section's own header/divider box does not count as that reset. A
|
|
609
|
+
process tells which side it is on from `PAI_WORKER=1` in its environment —
|
|
610
|
+
set by the worker runner on every spawn (see "What a worker is" above) and
|
|
611
|
+
absent on the interactive orchestrating session. Manage tags with the
|
|
612
|
+
Whisper skill (`/whisper`); the parsing lives in
|
|
613
|
+
`src/hooks/ts/user-prompt/whisper-rules.ts`.
|
|
614
|
+
|
|
587
615
|
## MCP tools
|
|
588
616
|
|
|
589
617
|
`worker_status`, `worker_providers`
|
|
@@ -595,29 +623,54 @@ worker or chain from chat, returns the id immediately), `worker_toggle`,
|
|
|
595
623
|
worker: send a proposal/question/blocker up to its parent) — the same library
|
|
596
624
|
the CLI calls.
|
|
597
625
|
`worker_providers add` accepts a raw `key`, parks it in
|
|
598
|
-
`~/.
|
|
626
|
+
`~/.claude/pai/keys/<name>` (mode 0600) and stores only the path.
|
|
599
627
|
|
|
600
628
|
## Status line
|
|
601
629
|
|
|
602
|
-
Line 4 of the statusline is the worker bar
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
630
|
+
Line 4 of the statusline is the worker bar, prefixed 🐝: a summary of every
|
|
631
|
+
running worker plus today's ✓/✗ tally, never one row per worker — three
|
|
632
|
+
workers used to spell out three goals, three ages and three models on one
|
|
633
|
+
line and none of it fit. It prefers the standalone
|
|
634
|
+
`~/.claude/worker-status-line.mjs` (plain node, built by `bun run build`)
|
|
635
|
+
and falls back to `pai worker status-line`.
|
|
636
|
+
|
|
637
|
+
Example: `anthropic ▶3 · sonnet-5 ×2 · haiku-4.5 · oldest 7m ✓35 ✗11 today`
|
|
638
|
+
|
|
639
|
+
Segment by segment (`renderStatusLine` in `src/workers/render.ts`):
|
|
640
|
+
|
|
641
|
+
- head (`anthropic`) — the live routing choice (`workers.active`) when it
|
|
642
|
+
names one provider; else the chat pane's provider; else `workers` when
|
|
643
|
+
several providers are running and there is no tracked chat pane
|
|
644
|
+
- `▶3` — this terminal's running spawned workers: `state=running` **and** a
|
|
645
|
+
live pid **and** not the chat pane; nothing at zero, so an idle terminal
|
|
646
|
+
shows just the head
|
|
647
|
+
- `sonnet-5 ×2 · haiku-4.5` — distinct short model names of the running
|
|
648
|
+
workers, most-populous first, each suffixed `×N` past one; a legacy
|
|
649
|
+
status with no recorded model counts under `?` rather than vanishing;
|
|
650
|
+
this segment alone shrinks to fit known terminal width, so the head, the
|
|
651
|
+
`▶N` count and the today tally never get cut
|
|
652
|
+
- `oldest 7m` — age of the longest-running worker
|
|
653
|
+
- `✓35 ✗11 today` — today's finished workers: done vs failed
|
|
606
654
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
655
|
+
The chat pane itself contributes only its provider — its age, state and
|
|
656
|
+
inbox live in `pai worker ps`, never in the bar. The per-worker detail that
|
|
657
|
+
used to live in the bar — goal, age, current tool — moved to each worker's
|
|
658
|
+
own pane bottom line and to `pai worker ps`:
|
|
610
659
|
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
- step (`grep …`) — the current tool trimmed to its verb: no `Bash:` prefix, no flags, no quotes, ≤24 chars; file tools keep their `Edit: button.ts` shape
|
|
615
|
-
- `✓75 ✗4 today` — today's finished workers: done vs failed
|
|
660
|
+
```
|
|
661
|
+
<goal> · <model> · started HH:MM · <age>
|
|
662
|
+
```
|
|
616
663
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
664
|
+
`paneStatusRow` in `src/workers/render.ts` renders it; the goal is the
|
|
665
|
+
worker's `--label` (else the first chars of the prompt, `unlabeled` when
|
|
666
|
+
the run had neither), shrunk first when the pane is narrow so the fixed
|
|
667
|
+
`model · started · age` tail always survives. Re-goal a running worker
|
|
668
|
+
without sending it a message — `pai worker goal <id> "<text>"` — or relabel
|
|
669
|
+
and message it in one call with `pai worker say --goal "<text>" <id>
|
|
670
|
+
"<message>"`. Both update the row in `ps`, the pane, and the bar's tally.
|
|
671
|
+
|
|
672
|
+
The worker forest (`↳` depth) and `◆N` inbox marks are `ps` territory too.
|
|
673
|
+
A status file from before the `origin` flag (a running entry with no
|
|
674
|
+
origin, the unlabeled placeholder and zero turns) is treated as the chat
|
|
675
|
+
pane so it does not render as a phantom worker — that shim goes away once
|
|
676
|
+
every pane runs code that writes `origin`.
|