zidane 9.1.1 → 9.1.3
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/{acp-Di9WvMDF.js → acp-CeCavNlg.js} +7 -7
- package/dist/{acp-Di9WvMDF.js.map → acp-CeCavNlg.js.map} +1 -1
- package/dist/acp-cli.js +5 -5
- package/dist/acp.d.ts +2 -2
- package/dist/acp.js +1 -1
- package/dist/{agent-DJhpTS-B.js → agent-Dh_XZ7fj.js} +74 -19
- package/dist/agent-Dh_XZ7fj.js.map +1 -0
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{auth-store-port-DFgf22oo.js → auth-store-port-BKpjlJ8a.js} +2 -2
- package/dist/{auth-store-port-DFgf22oo.js.map → auth-store-port-BKpjlJ8a.js.map} +1 -1
- package/dist/{auto-update-restart-BFB7Ek87.js → auto-update-restart-CQJtndMG.js} +277 -41
- package/dist/auto-update-restart-CQJtndMG.js.map +1 -0
- package/dist/{browser-BcoCCB_n.js → browser-BkdeKnxO.js} +56 -2
- package/dist/browser-BkdeKnxO.js.map +1 -0
- package/dist/{browser-entry-ypi8CyE-.d.ts → browser-entry-BCwruqNa.d.ts} +10 -10
- package/dist/{browser-entry-ypi8CyE-.d.ts.map → browser-entry-BCwruqNa.d.ts.map} +1 -1
- package/dist/channels.d.ts +5 -5
- package/dist/chat/browser.d.ts +4 -4
- package/dist/chat/browser.js +6 -6
- package/dist/chat/pure.d.ts +5 -5
- package/dist/chat/pure.js +8 -8
- package/dist/chat.d.ts +5 -5
- package/dist/chat.js +55 -55
- package/dist/chat.js.map +1 -1
- package/dist/{cli-shared-CabruH8Z.js → cli-shared-DeRHgYvl.js} +4 -4
- package/dist/{cli-shared-CabruH8Z.js.map → cli-shared-DeRHgYvl.js.map} +1 -1
- package/dist/cli-style-DBEm6CyT.js +105 -0
- package/dist/cli-style-DBEm6CyT.js.map +1 -0
- package/dist/{client-core-CIixwznM.d.ts → client-core-C_4m_oL6.d.ts} +4 -4
- package/dist/{client-core-CIixwznM.d.ts.map → client-core-C_4m_oL6.d.ts.map} +1 -1
- package/dist/{client-CCaIXWue.d.ts → client-ygTASGis.d.ts} +2 -2
- package/dist/{client-CCaIXWue.d.ts.map → client-ygTASGis.d.ts.map} +1 -1
- package/dist/codemode-worker.js +8 -5
- package/dist/codemode-worker.js.map +1 -1
- package/dist/codemode.d.ts +16 -0
- package/dist/codemode.d.ts.map +1 -1
- package/dist/codemode.js +2 -2
- package/dist/{connection-loop-QmWL-fJf.d.ts → connection-loop-D_pRONCr.d.ts} +4 -4
- package/dist/{connection-loop-QmWL-fJf.d.ts.map → connection-loop-D_pRONCr.d.ts.map} +1 -1
- package/dist/contexts/daytona.d.ts +3 -3
- package/dist/contexts/docker.d.ts +1 -1
- package/dist/contexts/e2b.d.ts +2 -2
- package/dist/contexts/sandbox.d.ts +1 -1
- package/dist/{contexts-C72b0mMa.js → contexts-DLZTSRHU.js} +17 -106
- package/dist/contexts-DLZTSRHU.js.map +1 -0
- package/dist/contexts.d.ts +4 -4
- package/dist/contexts.js +2 -2
- package/dist/{credentials-wwETW8rI.js → credentials-Bqg-qNBM.js} +2 -2
- package/dist/{credentials-wwETW8rI.js.map → credentials-Bqg-qNBM.js.map} +1 -1
- package/dist/{cwd-picker-CcekODCt.js → cwd-picker-BsHA6HKv.js} +4 -4
- package/dist/{cwd-picker-CcekODCt.js.map → cwd-picker-BsHA6HKv.js.map} +1 -1
- package/dist/daemon-cli.js +4 -3
- package/dist/daemon-cli.js.map +1 -1
- package/dist/{decisions-CXmK0nz9.js → decisions-hsw5XS2g.js} +3 -1
- package/dist/decisions-hsw5XS2g.js.map +1 -0
- package/dist/{discovery-DycXFxdA.js → discovery-CX7nbMCn.js} +4 -4
- package/dist/{discovery-DycXFxdA.js.map → discovery-CX7nbMCn.js.map} +1 -1
- package/dist/durable/sqlite.d.ts +2 -2
- package/dist/durable.d.ts +1 -1
- package/dist/{engine-VQ86XGdG.js → engine-CxBGgU94.js} +6 -6
- package/dist/{engine-VQ86XGdG.js.map → engine-CxBGgU94.js.map} +1 -1
- package/dist/{eval-Bod0I1W_.js → eval-CfGUDAkN.js} +3 -3
- package/dist/{eval-Bod0I1W_.js.map → eval-CfGUDAkN.js.map} +1 -1
- package/dist/eval.d.ts +1 -1
- package/dist/eval.js +1 -1
- package/dist/{executor-C7RQrkEq.js → executor-j_LFRBwS.js} +4 -4
- package/dist/{executor-C7RQrkEq.js.map → executor-j_LFRBwS.js.map} +1 -1
- package/dist/{extension-mark-BqKdEZwF.js → extension-mark-_rhkDWL5.js} +9 -6
- package/dist/extension-mark-_rhkDWL5.js.map +1 -0
- package/dist/extensions/testing.d.ts +1 -1
- package/dist/extensions/testing.js +2 -2
- package/dist/{extensions-BCx4QuGB.js → extensions-ADlhBQ_1.js} +8 -8
- package/dist/{extensions-BCx4QuGB.js.map → extensions-ADlhBQ_1.js.map} +1 -1
- package/dist/{extensions-client-D8tEAcMw.d.ts → extensions-client-D4Q2XRKV.d.ts} +31 -5
- package/dist/extensions-client-D4Q2XRKV.d.ts.map +1 -0
- package/dist/extensions.d.ts +1 -1
- package/dist/extensions.js +6 -6
- package/dist/{fold-rules-DvLK8pbf.d.ts → fold-rules-1DpDwG9h.d.ts} +2 -2
- package/dist/{fold-rules-DvLK8pbf.d.ts.map → fold-rules-1DpDwG9h.d.ts.map} +1 -1
- package/dist/{google-Crva32sk.js → google-B-Dhmzzf.js} +2 -2
- package/dist/{google-Crva32sk.js.map → google-B-Dhmzzf.js.map} +1 -1
- package/dist/{headless-CCm-jLLT.js → headless-CQm19BL0.js} +4 -4
- package/dist/{headless-CCm-jLLT.js.map → headless-CQm19BL0.js.map} +1 -1
- package/dist/headless.d.ts +1 -1
- package/dist/headless.js +1 -1
- package/dist/history-worker.js +1 -1
- package/dist/{host-wO_6GW0y.js → host-C61ntFBC.js} +276 -103
- package/dist/host-C61ntFBC.js.map +1 -0
- package/dist/{host-BHMs9jsN.js → host-DEoEzQal.js} +13 -4
- package/dist/host-DEoEzQal.js.map +1 -0
- package/dist/{host-scoped-settings-CrbcqOkP.js → host-scoped-settings-WBYaCork.js} +2 -2
- package/dist/{host-scoped-settings-CrbcqOkP.js.map → host-scoped-settings-WBYaCork.js.map} +1 -1
- package/dist/{host-signals-Jsjd_-4g.js → host-signals-Cb2TlGtN.js} +5 -5
- package/dist/{host-signals-Jsjd_-4g.js.map → host-signals-Cb2TlGtN.js.map} +1 -1
- package/dist/{host-version-CNAr9pov.js → host-version-BIx4CuBM.js} +2 -2
- package/dist/{host-version-CNAr9pov.js.map → host-version-BIx4CuBM.js.map} +1 -1
- package/dist/{index-C6nnKu32.d.ts → index-B0PLo9jn.d.ts} +4 -4
- package/dist/{index-C6nnKu32.d.ts.map → index-B0PLo9jn.d.ts.map} +1 -1
- package/dist/{index-Djnc8Peh.d.ts → index-De4x-s76.d.ts} +14 -14
- package/dist/{index-Djnc8Peh.d.ts.map → index-De4x-s76.d.ts.map} +1 -1
- package/dist/{index-CGbOWa7y.d.ts → index-WlE93Q6d.d.ts} +411 -3
- package/dist/index-WlE93Q6d.d.ts.map +1 -0
- package/dist/{index-CCf_WeTQ.d.ts → index-f-XWIoYo.d.ts} +2 -2
- package/dist/{index-CCf_WeTQ.d.ts.map → index-f-XWIoYo.d.ts.map} +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +17 -17
- package/dist/ipc/browser-types.d.ts +304 -7
- package/dist/ipc/browser-types.d.ts.map +1 -1
- package/dist/ipc/browser.d.ts +4 -4
- package/dist/ipc/browser.js +2 -2
- package/dist/ipc/remote.d.ts +6 -6
- package/dist/ipc/remote.js +3 -3
- package/dist/{ipc-BzWhIybr.js → ipc-DiH_P-wr.js} +4 -4
- package/dist/{ipc-BzWhIybr.js.map → ipc-DiH_P-wr.js.map} +1 -1
- package/dist/ipc.d.ts +10 -10
- package/dist/ipc.js +8 -8
- package/dist/{json-Dj-YATkZ.js → json-BjClr43H.js} +2 -20
- package/dist/json-BjClr43H.js.map +1 -0
- package/dist/{links-CJG_rFvf.js → links-BbC_lOnn.js} +9 -9
- package/dist/{links-CJG_rFvf.js.map → links-BbC_lOnn.js.map} +1 -1
- package/dist/{loaded-entry-DTURJo_R.js → loaded-entry-C0vkCVNQ.js} +2 -2
- package/dist/{loaded-entry-DTURJo_R.js.map → loaded-entry-C0vkCVNQ.js.map} +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/{media-type-BtA0cbfI.d.ts → media-type-ZSmAGHvg.d.ts} +188 -7
- package/dist/media-type-ZSmAGHvg.d.ts.map +1 -0
- package/dist/{memory-DuVGrzbl.js → memory-C3w8nO8f.js} +132 -31
- package/dist/memory-C3w8nO8f.js.map +1 -0
- package/dist/model-test-CAtJ76kM.js.map +1 -1
- package/dist/{move-session-kylExJ5H.js → move-session-D7ILECs-.js} +4 -4
- package/dist/{move-session-kylExJ5H.js.map → move-session-D7ILECs-.js.map} +1 -1
- package/dist/{nested-call-record-DlzPeTB7.js → nested-call-record-OayszZBQ.js} +4 -3
- package/dist/nested-call-record-OayszZBQ.js.map +1 -0
- package/dist/output/stream-json.d.ts +1 -1
- package/dist/output/terminal.d.ts +1 -1
- package/dist/{path-display-COVV71Yu.js → path-display-DRAEpKOU.js} +3 -3
- package/dist/{path-display-COVV71Yu.js.map → path-display-DRAEpKOU.js.map} +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/{prelude-CVKoUzV8.js → prelude-BwiSR1uA.js} +16 -5
- package/dist/prelude-BwiSR1uA.js.map +1 -0
- package/dist/{presets-CBt6rFfS.js → presets-CMY43nUP.js} +3 -3
- package/dist/{presets-CBt6rFfS.js.map → presets-CMY43nUP.js.map} +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +1 -1
- package/dist/{protocol-CEVqBO-q.d.ts → protocol-C2lqKuMd.d.ts} +50 -7
- package/dist/protocol-C2lqKuMd.d.ts.map +1 -0
- package/dist/protocol-DOGyHgLQ.js.map +1 -1
- package/dist/protocol-NSllElLw.js.map +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/arcee.d.ts +1 -1
- package/dist/providers/baseten.d.ts +1 -1
- package/dist/providers/cerebras.d.ts +1 -1
- package/dist/providers/google.d.ts +1 -1
- package/dist/providers/google.js +1 -1
- package/dist/providers/local.d.ts +1 -1
- package/dist/providers/neuralwatt.d.ts +1 -1
- package/dist/providers/openai-compat.d.ts +1 -1
- package/dist/providers/openai.d.ts +1 -1
- package/dist/providers/openrouter.d.ts +1 -1
- package/dist/providers/xai.d.ts +1 -1
- package/dist/{providers-Z0TaBp1O.js → providers-CpXV_uLE.js} +5 -5
- package/dist/providers-CpXV_uLE.js.map +1 -0
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +1 -1
- package/dist/{readonly-db-D7Z-k0pQ.js → readonly-db-DrbT8tX6.js} +2 -2
- package/dist/{readonly-db-D7Z-k0pQ.js.map → readonly-db-DrbT8tX6.js.map} +1 -1
- package/dist/{registry-BKjeBnoy.js → registry-CJHvmvaP.js} +2 -2
- package/dist/{registry-BKjeBnoy.js.map → registry-CJHvmvaP.js.map} +1 -1
- package/dist/{registry-B6Ww76iW.js → registry-CN6JlZKj.js} +2 -2
- package/dist/{registry-B6Ww76iW.js.map → registry-CN6JlZKj.js.map} +1 -1
- package/dist/{registry-B9INJwJR.js → registry-CnnKaY9s.js} +324 -39
- package/dist/registry-CnnKaY9s.js.map +1 -0
- package/dist/{remote-hosts-BMWoHCWO.js → remote-hosts-DoO9CJUQ.js} +4 -4
- package/dist/{remote-hosts-BMWoHCWO.js.map → remote-hosts-DoO9CJUQ.js.map} +1 -1
- package/dist/{repo-url-D4Dr8NfZ.js → repo-url-DLjjuVk_.js} +169 -2
- package/dist/repo-url-DLjjuVk_.js.map +1 -0
- package/dist/restate.d.ts +2 -2
- package/dist/{sandbox-BwiPGKF7.d.ts → sandbox-B4OW6oNx.d.ts} +2 -2
- package/dist/{sandbox-BwiPGKF7.d.ts.map → sandbox-B4OW6oNx.d.ts.map} +1 -1
- package/dist/script-progress-CrZ507Qq.js +900 -0
- package/dist/script-progress-CrZ507Qq.js.map +1 -0
- package/dist/session/sqlite.d.ts +1 -1
- package/dist/session.d.ts +1 -1
- package/dist/{setting-BQBSyUq0.js → setting-D_FpKFMw.js} +6 -6
- package/dist/{setting-BQBSyUq0.js.map → setting-D_FpKFMw.js.map} +1 -1
- package/dist/{settings-catalog-4IU2i_jG.js → settings-catalog-DEZlXP51.js} +14 -2
- package/dist/settings-catalog-DEZlXP51.js.map +1 -0
- package/dist/{settings-keys-iI_Y-7MC.js → settings-keys-CW2UgHgb.js} +3 -3
- package/dist/{settings-keys-iI_Y-7MC.js.map → settings-keys-CW2UgHgb.js.map} +1 -1
- package/dist/{skills-CFXRItJ6.js → skills-CEbosUlM.js} +2 -2
- package/dist/{skills-CFXRItJ6.js.map → skills-CEbosUlM.js.map} +1 -1
- package/dist/skills.d.ts +1 -1
- package/dist/skills.js +1 -1
- package/dist/{source-Bl1Z501r.js → source-3ZnEPOSa.js} +3 -2
- package/dist/source-3ZnEPOSa.js.map +1 -0
- package/dist/{sqlite-runtime-BZ2L4RaG.d.ts → sqlite-runtime-CS_LBaAN.d.ts} +2 -2
- package/dist/sqlite-runtime-CS_LBaAN.d.ts.map +1 -0
- package/dist/{src-BY_ND2xn.js → src-BmTXDta8.js} +2 -2
- package/dist/{src-BY_ND2xn.js.map → src-BmTXDta8.js.map} +1 -1
- package/dist/{store-C6gI7FfZ.js → store-ByCDaKgJ.js} +14 -3
- package/dist/store-ByCDaKgJ.js.map +1 -0
- package/dist/{system-freeze-m5o1sGIM.js → system-freeze-XgDPIwQS.js} +3 -3
- package/dist/{system-freeze-m5o1sGIM.js.map → system-freeze-XgDPIwQS.js.map} +1 -1
- package/dist/{todo-edits-CbukbjyV.js → todo-edits-Dyj32ds6.js} +4 -3
- package/dist/todo-edits-Dyj32ds6.js.map +1 -0
- package/dist/tools/fetch-url.d.ts +1 -1
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/{tools-CVTGhggj.js → tools-BsrGQ8K4.js} +2 -2
- package/dist/{tools-CVTGhggj.js.map → tools-BsrGQ8K4.js.map} +1 -1
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +3 -3
- package/dist/{transcript-anchors-CiSi_UBn.js → transcript-anchors-DMjvyUjk.js} +3 -3
- package/dist/{transcript-anchors-CiSi_UBn.js.map → transcript-anchors-DMjvyUjk.js.map} +1 -1
- package/dist/{transcript-reconcile-jbSBjLq2.js → transcript-reconcile-DpQO85wl.js} +3 -3
- package/dist/{transcript-reconcile-jbSBjLq2.js.map → transcript-reconcile-DpQO85wl.js.map} +1 -1
- package/dist/tui.d.ts +9 -9
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +289 -38
- package/dist/tui.js.map +1 -1
- package/dist/{types-bDQagoiL.d.ts → types-2HrgolQz.d.ts} +20 -8
- package/dist/types-2HrgolQz.d.ts.map +1 -0
- package/dist/types-4q1bFG53.js +122 -0
- package/dist/types-4q1bFG53.js.map +1 -0
- package/dist/{types-DnRd9_cA.d.ts → types-SXqk6hLD.d.ts} +3 -3
- package/dist/{types-DnRd9_cA.d.ts.map → types-SXqk6hLD.d.ts.map} +1 -1
- package/dist/types-myxheQkw.js.map +1 -1
- package/dist/types.d.ts +3 -3
- package/dist/{usage-summary-BfcXjiSM.js → usage-summary-BM7B3JdI.js} +2 -2
- package/dist/{usage-summary-BfcXjiSM.js.map → usage-summary-BM7B3JdI.js.map} +1 -1
- package/dist/{version-DqqqvHDP.js → version-szdW1Od9.js} +2 -2
- package/dist/{version-DqqqvHDP.js.map → version-szdW1Od9.js.map} +1 -1
- package/dist/{wait-task-BX4NcOOm.js → wait-task-BiI5UaZQ.js} +13 -3
- package/dist/wait-task-BiI5UaZQ.js.map +1 -0
- package/dist/{wire-CLm2rMK0.js → wire-C3l9jl9x.js} +2 -2
- package/dist/{wire-CLm2rMK0.js.map → wire-C3l9jl9x.js.map} +1 -1
- package/dist/{write-file-0E6TUJ9A.js → write-file-Dquu7MzB.js} +5 -3
- package/dist/write-file-Dquu7MzB.js.map +1 -0
- package/dist/{ws-DfGGYQ4W.js → ws-CEHi0CiB.js} +4 -4
- package/dist/{ws-DfGGYQ4W.js.map → ws-CEHi0CiB.js.map} +1 -1
- package/dist/{ws-client-CFMbhsNq.js → ws-client-t8XNWxcq.js} +2 -2
- package/dist/{ws-client-CFMbhsNq.js.map → ws-client-t8XNWxcq.js.map} +1 -1
- package/docs/CHAT.md +55 -0
- package/docs/CODEMODE.md +37 -0
- package/docs/EXTENSIONS.md +8 -6
- package/docs/RELEASE-NOTES-NEXT.md +48 -1
- package/docs/RELEASE.md +9 -1
- package/package.json +2 -3
- package/dist/agent-DJhpTS-B.js.map +0 -1
- package/dist/auto-update-restart-BFB7Ek87.js.map +0 -1
- package/dist/browser-BcoCCB_n.js.map +0 -1
- package/dist/contexts-C72b0mMa.js.map +0 -1
- package/dist/decisions-CXmK0nz9.js.map +0 -1
- package/dist/extension-mark-BqKdEZwF.js.map +0 -1
- package/dist/extensions-client-D8tEAcMw.d.ts.map +0 -1
- package/dist/host-BHMs9jsN.js.map +0 -1
- package/dist/host-wO_6GW0y.js.map +0 -1
- package/dist/index-CGbOWa7y.d.ts.map +0 -1
- package/dist/json-Dj-YATkZ.js.map +0 -1
- package/dist/media-type-BtA0cbfI.d.ts.map +0 -1
- package/dist/memory-DuVGrzbl.js.map +0 -1
- package/dist/nested-call-events-BYk8XvGX.js +0 -182
- package/dist/nested-call-events-BYk8XvGX.js.map +0 -1
- package/dist/nested-call-record-DlzPeTB7.js.map +0 -1
- package/dist/prelude-CVKoUzV8.js.map +0 -1
- package/dist/protocol-CEVqBO-q.d.ts.map +0 -1
- package/dist/providers-Z0TaBp1O.js.map +0 -1
- package/dist/registry-B9INJwJR.js.map +0 -1
- package/dist/repo-url-D4Dr8NfZ.js.map +0 -1
- package/dist/settings-catalog-4IU2i_jG.js.map +0 -1
- package/dist/source-Bl1Z501r.js.map +0 -1
- package/dist/sqlite-runtime-BZ2L4RaG.d.ts.map +0 -1
- package/dist/store-C6gI7FfZ.js.map +0 -1
- package/dist/todo-edits-CbukbjyV.js.map +0 -1
- package/dist/types-DTMEhKJO.js +0 -14
- package/dist/types-DTMEhKJO.js.map +0 -1
- package/dist/types-bDQagoiL.d.ts.map +0 -1
- package/dist/wait-task-BX4NcOOm.js.map +0 -1
- package/dist/write-file-0E6TUJ9A.js.map +0 -1
- package/scripts/eval.ts +0 -179
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { n as previewNestedOutput } from "./nested-call-record-DlzPeTB7.js";
|
|
2
|
-
//#region src/chat/command-notes.ts
|
|
3
|
-
/** The persisted invocation header block: `` `❯ /commit args` ``. */
|
|
4
|
-
function commandHeaderBlock(invocation) {
|
|
5
|
-
return `\`❯ ${invocation}\``;
|
|
6
|
-
}
|
|
7
|
-
/** `/name args` from a persisted header block, or null when the text is not one. */
|
|
8
|
-
function parseCommandHeader(text) {
|
|
9
|
-
const match = /^`❯ (\/[\s\S]+)`$/.exec(text.trim());
|
|
10
|
-
return match ? match[1] : null;
|
|
11
|
-
}
|
|
12
|
-
const PREFIX_SEPARATOR = /^\s*(?:[:·—-]\s*)?/;
|
|
13
|
-
/**
|
|
14
|
-
* The receipt text for one note. Older displays repeat the command
|
|
15
|
-
* (`/commit: 83dfea7`, `/review — 3 reviewers, fixes applied`); the prompt
|
|
16
|
-
* bubble above already names it, so the prefix goes, and a leftover ` — `
|
|
17
|
-
* becomes a comma. A note without a display shows its first line.
|
|
18
|
-
*/
|
|
19
|
-
function commandNoteText(display, text, invocation) {
|
|
20
|
-
let line = (display ?? text.split("\n").find((l) => l.trim()) ?? "").trim();
|
|
21
|
-
const prefix = [invocation, invocation?.split(/\s/, 1)[0]].filter((p) => Boolean(p)).find((p) => line.startsWith(p)) ?? /^\/[\w.:-]+/.exec(line)?.[0];
|
|
22
|
-
if (prefix) {
|
|
23
|
-
const rest = line.slice(prefix.length).replace(PREFIX_SEPARATOR, "");
|
|
24
|
-
if (rest) line = /^[0-9a-f]{7,40}$/.test(rest) ? `committed ${rest}` : rest;
|
|
25
|
-
}
|
|
26
|
-
line = line.replace(/\s+—\s+/g, ", ");
|
|
27
|
-
return line.length > 160 ? `${line.slice(0, 159)}…` : line;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The `display` a context note persists with: the command's marker, its
|
|
31
|
-
* first line when it gave none, or `''` for a model-only note
|
|
32
|
-
* (`display: false`), which shows nothing.
|
|
33
|
-
*/
|
|
34
|
-
function noteDisplay(display, text) {
|
|
35
|
-
return display === false ? "" : display ?? commandNoteText(void 0, text);
|
|
36
|
-
}
|
|
37
|
-
/** A command step label: the display as given, a leftover ` — ` turned into a comma. */
|
|
38
|
-
function commandStepLabel(display) {
|
|
39
|
-
return display.replace(/\s+—\s+/g, ", ");
|
|
40
|
-
}
|
|
41
|
-
const merged = /* @__PURE__ */ new WeakMap();
|
|
42
|
-
function isTopPrompt(event) {
|
|
43
|
-
return event.kind === "user-prompt" && !event.childId && (event.depth ?? 0) === 0;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* One receipt line per exchange: every `command-note` in an exchange moves
|
|
47
|
-
* to its end and joins into a single event (`committed 83dfea7, pushed to
|
|
48
|
-
* origin/main`). Returns `events` itself when there is nothing to merge;
|
|
49
|
-
* the merged event keeps its identity while its notes do not change, so
|
|
50
|
-
* memoised rows stay put.
|
|
51
|
-
*
|
|
52
|
-
* @param events - Transcript events in display order.
|
|
53
|
-
*/
|
|
54
|
-
function gatherCommandNotes(events) {
|
|
55
|
-
if (!events.some((e) => e.kind === "command-note")) return events;
|
|
56
|
-
const out = [];
|
|
57
|
-
let notes = [];
|
|
58
|
-
const flush = () => {
|
|
59
|
-
if (notes.length === 0) return;
|
|
60
|
-
const first = notes[0];
|
|
61
|
-
const key = notes.map((n) => n.text).join("\0");
|
|
62
|
-
let event = first;
|
|
63
|
-
if (notes.length > 1) {
|
|
64
|
-
const cached = merged.get(first);
|
|
65
|
-
event = cached?.key === key ? cached.event : {
|
|
66
|
-
...first,
|
|
67
|
-
text: notes.map((n) => n.text).join(", ")
|
|
68
|
-
};
|
|
69
|
-
merged.set(first, {
|
|
70
|
-
key,
|
|
71
|
-
event
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
let at = out.length;
|
|
75
|
-
while (at > 0 && out[at - 1].kind === "separator") at--;
|
|
76
|
-
out.splice(at, 0, event);
|
|
77
|
-
notes = [];
|
|
78
|
-
};
|
|
79
|
-
for (const event of events) {
|
|
80
|
-
if (isTopPrompt(event)) flush();
|
|
81
|
-
if (event.kind === "command-note" && !event.childId) {
|
|
82
|
-
notes.push(event);
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
out.push(event);
|
|
86
|
-
}
|
|
87
|
-
flush();
|
|
88
|
-
return out.length === events.length && out.every((e, i) => e === events[i]) ? events : out;
|
|
89
|
-
}
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region src/chat/nested-call-events.ts
|
|
92
|
-
/** `name(json args)`, as `store.ts`' `toolCallPreview` writes it (not imported: `store.ts` imports this module). */
|
|
93
|
-
function callPreview(name, input) {
|
|
94
|
-
const args = JSON.stringify(input);
|
|
95
|
-
return args && args !== "{}" ? `${name}(${args})` : name;
|
|
96
|
-
}
|
|
97
|
-
function tagFields(tag) {
|
|
98
|
-
return {
|
|
99
|
-
...tag?.turnId ? { turnId: tag.turnId } : {},
|
|
100
|
-
...tag?.childId !== void 0 ? { childId: tag.childId } : {},
|
|
101
|
-
...tag?.depth !== void 0 ? { depth: tag.depth } : {}
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* The `tool` row for a nested call as it starts.
|
|
106
|
-
*
|
|
107
|
-
* @param call - The nested call.
|
|
108
|
-
* @param call.callId - Its call id.
|
|
109
|
-
* @param call.name - Tool it called.
|
|
110
|
-
* @param call.input - Arguments it passed.
|
|
111
|
-
* @param call.parentToolCallId - Id of the calling tool, which the row groups under.
|
|
112
|
-
* @param call.runsNestedAgent - The called tool runs a subagent.
|
|
113
|
-
* @param call.startedAt - When the call started (epoch ms, the host's clock), live only.
|
|
114
|
-
* @param tag - Turn, subagent and depth to stamp on the event.
|
|
115
|
-
*/
|
|
116
|
-
function nestedToolEvent(call, tag) {
|
|
117
|
-
return {
|
|
118
|
-
kind: "tool",
|
|
119
|
-
text: callPreview(call.name, call.input),
|
|
120
|
-
tool: call.name,
|
|
121
|
-
callId: call.callId,
|
|
122
|
-
input: call.input,
|
|
123
|
-
parentToolCallId: call.parentToolCallId,
|
|
124
|
-
...call.runsNestedAgent ? { runsNestedAgent: true } : {},
|
|
125
|
-
...call.startedAt !== void 0 ? { startedAt: call.startedAt } : {},
|
|
126
|
-
...tagFields(tag)
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* The `tool-result` row for a nested call as it ends; the output is cut to a preview.
|
|
131
|
-
*
|
|
132
|
-
* @param result - The nested call's result.
|
|
133
|
-
* @param result.callId - Its call id.
|
|
134
|
-
* @param result.name - Tool it called.
|
|
135
|
-
* @param result.output - Full output; the row keeps a preview.
|
|
136
|
-
* @param result.isError - The call failed.
|
|
137
|
-
* @param result.parentToolCallId - Id of the calling tool, which the row groups under.
|
|
138
|
-
* @param result.runsNestedAgent - The called tool runs a subagent.
|
|
139
|
-
* @param result.durationMs - How long the call ran. `0` reads as unknown: a durable run's records carry no wall time.
|
|
140
|
-
* @param tag - Turn, subagent and depth to stamp on the event.
|
|
141
|
-
*/
|
|
142
|
-
function nestedResultEvent(result, tag) {
|
|
143
|
-
return {
|
|
144
|
-
kind: "tool-result",
|
|
145
|
-
text: previewNestedOutput(result.output).output,
|
|
146
|
-
tool: result.name,
|
|
147
|
-
callId: result.callId,
|
|
148
|
-
parentToolCallId: result.parentToolCallId,
|
|
149
|
-
...result.runsNestedAgent ? { runsNestedAgent: true } : {},
|
|
150
|
-
...result.isError ? { isError: true } : {},
|
|
151
|
-
...result.durationMs ? { durationMs: result.durationMs } : {},
|
|
152
|
-
...tagFields(tag)
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* A persisted record as the events the live run emitted for it.
|
|
157
|
-
*
|
|
158
|
-
* @param records - Nested calls stored on the calling tool's result.
|
|
159
|
-
* @param parentToolCallId - Id of the calling tool.
|
|
160
|
-
* @param tag - Turn, subagent and depth to stamp on the events.
|
|
161
|
-
*/
|
|
162
|
-
function nestedRecordEvents(records, parentToolCallId, tag) {
|
|
163
|
-
return records.flatMap((record) => [nestedToolEvent({
|
|
164
|
-
callId: record.id,
|
|
165
|
-
name: record.name,
|
|
166
|
-
input: record.input ?? {},
|
|
167
|
-
parentToolCallId,
|
|
168
|
-
runsNestedAgent: record.runsNestedAgent
|
|
169
|
-
}, tag), nestedResultEvent({
|
|
170
|
-
callId: record.id,
|
|
171
|
-
name: record.name,
|
|
172
|
-
output: record.output ?? "",
|
|
173
|
-
isError: record.status !== "ok",
|
|
174
|
-
parentToolCallId,
|
|
175
|
-
runsNestedAgent: record.runsNestedAgent,
|
|
176
|
-
durationMs: record.durationMs
|
|
177
|
-
}, tag)]);
|
|
178
|
-
}
|
|
179
|
-
//#endregion
|
|
180
|
-
export { commandNoteText as a, noteDisplay as c, commandHeaderBlock as i, parseCommandHeader as l, nestedResultEvent as n, commandStepLabel as o, nestedToolEvent as r, gatherCommandNotes as s, nestedRecordEvents as t };
|
|
181
|
-
|
|
182
|
-
//# sourceMappingURL=nested-call-events-BYk8XvGX.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nested-call-events-BYk8XvGX.js","names":[],"sources":["../src/chat/command-notes.ts","../src/chat/nested-call-events.ts"],"sourcesContent":["/**\n * How a `/` command reads in the transcript: the invocation is the user's\n * prompt, everything the command did is that one exchange, and the notes it\n * left for the model (`ctx.appendContext`) close it as one quiet receipt\n * line. Shared by the live hosts, the replay in `eventsFromTurns`, and both\n * renderers, so the shape cannot drift between them.\n */\nimport type { StreamEvent } from './types'\n\n/** The persisted invocation header block: `` `❯ /commit args` ``. */\nexport function commandHeaderBlock(invocation: string): string {\n return `\\`❯ ${invocation}\\``\n}\n\n/** `/name args` from a persisted header block, or null when the text is not one. */\nexport function parseCommandHeader(text: string): string | null {\n const match = /^`❯ (\\/[\\s\\S]+)`$/.exec(text.trim())\n return match ? match[1]! : null\n}\n\nconst PREFIX_SEPARATOR = /^\\s*(?:[:·—-]\\s*)?/\n\n/**\n * The receipt text for one note. Older displays repeat the command\n * (`/commit: 83dfea7`, `/review — 3 reviewers, fixes applied`); the prompt\n * bubble above already names it, so the prefix goes, and a leftover ` — `\n * becomes a comma. A note without a display shows its first line.\n */\nexport function commandNoteText(display: string | undefined, text: string, invocation?: string): string {\n let line = (display ?? text.split('\\n').find(l => l.trim()) ?? '').trim()\n const name = invocation?.split(/\\s/, 1)[0]\n const prefixes = [invocation, name].filter((p): p is string => Boolean(p))\n const prefix = prefixes.find(p => line.startsWith(p))\n ?? /^\\/[\\w.:-]+/.exec(line)?.[0]\n if (prefix) {\n const rest = line.slice(prefix.length).replace(PREFIX_SEPARATOR, '')\n // Older /commit displays were the bare sha.\n if (rest)\n line = /^[0-9a-f]{7,40}$/.test(rest) ? `committed ${rest}` : rest\n }\n line = line.replace(/\\s+—\\s+/g, ', ')\n return line.length > 160 ? `${line.slice(0, 159)}…` : line\n}\n\n/**\n * The `display` a context note persists with: the command's marker, its\n * first line when it gave none, or `''` for a model-only note\n * (`display: false`), which shows nothing.\n */\nexport function noteDisplay(display: string | false | undefined, text: string): string {\n return display === false ? '' : (display ?? commandNoteText(undefined, text))\n}\n\n/** A command step label: the display as given, a leftover ` — ` turned into a comma. */\nexport function commandStepLabel(display: string): string {\n return display.replace(/\\s+—\\s+/g, ', ')\n}\n\nconst merged = new WeakMap<StreamEvent, { key: string, event: StreamEvent }>()\n\nfunction isTopPrompt(event: StreamEvent): boolean {\n return event.kind === 'user-prompt' && !event.childId && (event.depth ?? 0) === 0\n}\n\n/**\n * One receipt line per exchange: every `command-note` in an exchange moves\n * to its end and joins into a single event (`committed 83dfea7, pushed to\n * origin/main`). Returns `events` itself when there is nothing to merge;\n * the merged event keeps its identity while its notes do not change, so\n * memoised rows stay put.\n *\n * @param events - Transcript events in display order.\n */\nexport function gatherCommandNotes<E extends StreamEvent>(events: readonly E[]): readonly E[] {\n if (!events.some(e => e.kind === 'command-note'))\n return events\n const out: E[] = []\n let notes: E[] = []\n const flush = () => {\n if (notes.length === 0)\n return\n const first = notes[0]!\n const key = notes.map(n => n.text).join('\\u0000')\n let event = first\n if (notes.length > 1) {\n const cached = merged.get(first)\n event = cached?.key === key ? cached.event as E : { ...first, text: notes.map(n => n.text).join(', ') }\n merged.set(first, { key, event })\n }\n // Ahead of the separators that close the exchange.\n let at = out.length\n while (at > 0 && out[at - 1]!.kind === 'separator')\n at--\n out.splice(at, 0, event)\n notes = []\n }\n for (const event of events) {\n if (isTopPrompt(event))\n flush()\n if (event.kind === 'command-note' && !event.childId) {\n notes.push(event)\n continue\n }\n out.push(event)\n }\n flush()\n return out.length === events.length && out.every((e, i) => e === events[i]) ? events : out\n}\n","/**\n * Transcript events for calls a tool made through `ToolContext.callTool`\n * (a codemode script's `tools.*`). One builder for both paths, so a live\n * run and a reload produce the same rows: the live hooks call\n * {@link nestedToolEvent} / {@link nestedResultEvent} as each call starts and\n * ends, the replay expands the persisted record with {@link nestedRecordEvents}.\n *\n * Every event carries `parentToolCallId`; renderers group them under the\n * calling row (and hide them unless `Settings.codemodeShowCalls`). Results are\n * previews (`previewNestedOutput`), the same length either way.\n *\n * Node-free (exported from `zidane/chat/pure`).\n */\n\nimport type { NestedToolCallRecord } from '../types'\nimport type { StreamEvent } from './types'\nimport { previewNestedOutput } from '../nested-call-record'\n\n/** `name(json args)`, as `store.ts`' `toolCallPreview` writes it (not imported: `store.ts` imports this module). */\nfunction callPreview(name: string, input: Record<string, unknown>): string {\n const args = JSON.stringify(input)\n return args && args !== '{}' ? `${name}(${args})` : name\n}\n\n/** Where nested events sit in the transcript; copied onto each event when set. */\nexport interface NestedEventTag {\n /** Turn of the calling tool. */\n turnId?: string\n /** Subagent that made the call; absent for the top-level agent. */\n childId?: string\n /** Nesting depth: 0 for the top-level agent, 1 and up for subagents. */\n depth?: number\n}\n\nfunction tagFields(tag: NestedEventTag | undefined): NestedEventTag {\n return {\n ...(tag?.turnId ? { turnId: tag.turnId } : {}),\n ...(tag?.childId !== undefined ? { childId: tag.childId } : {}),\n ...(tag?.depth !== undefined ? { depth: tag.depth } : {}),\n }\n}\n\n/**\n * The `tool` row for a nested call as it starts.\n *\n * @param call - The nested call.\n * @param call.callId - Its call id.\n * @param call.name - Tool it called.\n * @param call.input - Arguments it passed.\n * @param call.parentToolCallId - Id of the calling tool, which the row groups under.\n * @param call.runsNestedAgent - The called tool runs a subagent.\n * @param call.startedAt - When the call started (epoch ms, the host's clock), live only.\n * @param tag - Turn, subagent and depth to stamp on the event.\n */\nexport function nestedToolEvent(call: { callId: string, name: string, input: Record<string, unknown>, parentToolCallId: string, runsNestedAgent?: boolean, startedAt?: number }, tag?: NestedEventTag): StreamEvent {\n return {\n kind: 'tool',\n text: callPreview(call.name, call.input),\n tool: call.name,\n callId: call.callId,\n input: call.input,\n parentToolCallId: call.parentToolCallId,\n ...(call.runsNestedAgent ? { runsNestedAgent: true as const } : {}),\n ...(call.startedAt !== undefined ? { startedAt: call.startedAt } : {}),\n ...tagFields(tag),\n }\n}\n\n/**\n * The `tool-result` row for a nested call as it ends; the output is cut to a preview.\n *\n * @param result - The nested call's result.\n * @param result.callId - Its call id.\n * @param result.name - Tool it called.\n * @param result.output - Full output; the row keeps a preview.\n * @param result.isError - The call failed.\n * @param result.parentToolCallId - Id of the calling tool, which the row groups under.\n * @param result.runsNestedAgent - The called tool runs a subagent.\n * @param result.durationMs - How long the call ran. `0` reads as unknown: a durable run's records carry no wall time.\n * @param tag - Turn, subagent and depth to stamp on the event.\n */\nexport function nestedResultEvent(result: { callId: string, name: string, output: string, isError: boolean, parentToolCallId: string, runsNestedAgent?: boolean, durationMs?: number }, tag?: NestedEventTag): StreamEvent {\n return {\n kind: 'tool-result',\n text: previewNestedOutput(result.output).output,\n tool: result.name,\n callId: result.callId,\n parentToolCallId: result.parentToolCallId,\n ...(result.runsNestedAgent ? { runsNestedAgent: true as const } : {}),\n ...(result.isError ? { isError: true as const } : {}),\n ...(result.durationMs ? { durationMs: result.durationMs } : {}),\n ...tagFields(tag),\n }\n}\n\n/**\n * A persisted record as the events the live run emitted for it.\n *\n * @param records - Nested calls stored on the calling tool's result.\n * @param parentToolCallId - Id of the calling tool.\n * @param tag - Turn, subagent and depth to stamp on the events.\n */\nexport function nestedRecordEvents(records: readonly NestedToolCallRecord[], parentToolCallId: string, tag?: NestedEventTag): StreamEvent[] {\n return records.flatMap(record => [\n nestedToolEvent({ callId: record.id, name: record.name, input: record.input ?? {}, parentToolCallId, runsNestedAgent: record.runsNestedAgent }, tag),\n nestedResultEvent({ callId: record.id, name: record.name, output: record.output ?? '', isError: record.status !== 'ok', parentToolCallId, runsNestedAgent: record.runsNestedAgent, durationMs: record.durationMs }, tag),\n ])\n}\n"],"mappings":";;;AAUA,SAAgB,mBAAmB,YAA4B;CAC7D,OAAO,OAAO,WAAW;AAC3B;;AAGA,SAAgB,mBAAmB,MAA6B;CAC9D,MAAM,QAAQ,oBAAoB,KAAK,KAAK,KAAK,CAAC;CAClD,OAAO,QAAQ,MAAM,KAAM;AAC7B;AAEA,MAAM,mBAAmB;;;;;;;AAQzB,SAAgB,gBAAgB,SAA6B,MAAc,YAA6B;CACtG,IAAI,QAAQ,WAAW,KAAK,MAAM,IAAI,CAAC,CAAC,MAAK,MAAK,EAAE,KAAK,CAAC,KAAK,GAAA,CAAI,KAAK;CAGxE,MAAM,SADW,CAAC,YADL,YAAY,MAAM,MAAM,CAAC,CAAC,CAAC,EACN,CAAC,CAAC,QAAQ,MAAmB,QAAQ,CAAC,CAClD,CAAC,CAAC,MAAK,MAAK,KAA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AAO;EACL,MAAM;EACN,MAAM,oBAAoB,OAAO,MAAM,CAAC,CAAC;EACzC,MAAM,OAAO;EACb,QAAQ,OAAO;EACf,kBAAkB,OAAO;EACzB,GAAI,OAAO,kBAAkB,EAAE,iBAAiB,KAAc,IAAI,CAAC;EACnE,GAAI,OAAO,UAAU,EAAE,SAAS,KAAc,IAAI,CAAC;EACnD,GAAI,OAAO,aAAa,EAAE,YAAY,OAAO,WAAW,IAAI,CAAC;EAC7D,GAAG,UAAU,GAAG;CAClB;AACF;;;;;;;;AASA,SAAgB,mBAAmB,SAA0C,kBAA0B,KAAqC;CAC1I,OAAO,QAAQ,SAAQ,WAAU,CAC/B,gBAAgB;EAAE,QAAQ,OAAO;EAAI,MAAM,OAAO;EAAM,OAAO,OAAO,SAAS,CAAC;EAAG;EAAkB,iBAAiB,OAAO;CAAgB,GAAG,GAAG,GACnJ,kBAAkB;EAAE,QAAQ,OAAO;EAAI,MAAM,OAAO;EAAM,QAAQ,OAAO,UAAU;EAAI,SAAS,OAAO,WAAW;EAAM;EAAkB,iBAAiB,OAAO;EAAiB,YAAY,OAAO;CAAW,GAAG,GAAG,CACzN,CAAC;AACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nested-call-record-DlzPeTB7.js","names":[],"sources":["../src/nested-call-record.ts"],"sourcesContent":["/**\n * Bounded record of the calls a tool makes through `ToolContext.callTool`\n * (a codemode script's `tools.*`). Built by `loop-nested-calls.ts`,\n * persisted on the caller's `tool_result` block as `calls`, and rebuilt into\n * transcript rows on reload. Pure and dependency-free: the chat layer uses\n * {@link previewNestedOutput} for live rows so live and reloaded rows read alike.\n */\n\nimport type { NestedToolCallRecord } from './types'\n\nexport const NESTED_CALL_RECORD_LIMITS = {\n /** Calls kept per caller; later ones are counted in `omitted`. */\n maxCalls: 256,\n maxInputBytesPerCall: 8 * 1024,\n maxInputBytesTotal: 32 * 1024,\n /** Characters of result text kept per call: a row's preview, not the payload. */\n maxOutputChars: 2_000,\n maxOutputCharsTotal: 64 * 1024,\n} as const\n\nconst encoder = new TextEncoder()\n\n/** The start of a nested call's result text, as its transcript row shows it (live and reloaded). */\nexport function previewNestedOutput(text: string, max: number = NESTED_CALL_RECORD_LIMITS.maxOutputChars): { output: string, truncated: boolean } {\n return text.length > max ? { output: text.slice(0, max), truncated: true } : { output: text, truncated: false }\n}\n\nexport interface NestedCallRecorder {\n /** `false` when the call is past the record's call limit (not recorded). */\n start: (call: { id: string, name: string, input: Record<string, unknown>, runsNestedAgent?: boolean }) => boolean\n finish: (id: string, result: { status: 'ok' | 'error', output: string }) => void\n /** Calls still running are reported `cancelled`. Undefined when no call was made. */\n snapshot: () => NestedToolCallRecord[] | undefined\n /** One call's record as it stands (a copy), when it was recorded. */\n get: (id: string) => NestedToolCallRecord | undefined\n}\n\nexport function createNestedCallRecorder(now: () => number = () => Date.now()): NestedCallRecorder {\n const calls: NestedToolCallRecord[] = []\n const byId = new Map<string, { record: NestedToolCallRecord, startedAt: number }>()\n let inputBytes = 0\n let outputChars = 0\n return {\n start({ id, name, input, runsNestedAgent }) {\n if (calls.length >= NESTED_CALL_RECORD_LIMITS.maxCalls)\n return false\n const record: NestedToolCallRecord = { id, name, status: 'cancelled', durationMs: 0, ...(runsNestedAgent ? { runsNestedAgent: true as const } : {}) }\n const json = JSON.stringify(input ?? {})\n const bytes = encoder.encode(json).length\n if (bytes <= NESTED_CALL_RECORD_LIMITS.maxInputBytesPerCall && inputBytes + bytes <= NESTED_CALL_RECORD_LIMITS.maxInputBytesTotal) {\n record.input = JSON.parse(json) as Record<string, unknown>\n inputBytes += bytes\n }\n else {\n record.inputBytes = bytes\n }\n calls.push(record)\n byId.set(id, { record, startedAt: now() })\n return true\n },\n finish(id, result) {\n const entry = byId.get(id)\n if (!entry)\n return\n byId.delete(id)\n const { record, startedAt } = entry\n record.status = result.status\n record.durationMs = Math.max(0, Math.round(now() - startedAt))\n const room = Math.max(0, NESTED_CALL_RECORD_LIMITS.maxOutputCharsTotal - outputChars)\n const { output, truncated } = previewNestedOutput(result.output, Math.min(NESTED_CALL_RECORD_LIMITS.maxOutputChars, room))\n if (output) {\n record.output = output\n outputChars += output.length\n }\n if (truncated)\n record.outputTruncated = true\n },\n get(id) {\n const record = byId.get(id)?.record ?? calls.find(call => call.id === id)\n return record ? { ...record } : undefined\n },\n snapshot() {\n if (calls.length === 0)\n return undefined\n const at = now()\n return calls.map((call) => {\n const running = byId.get(call.id)\n return running ? { ...call, durationMs: Math.max(0, Math.round(at - running.startedAt)) } : { ...call }\n })\n },\n }\n}\n"],"mappings":";AAUA,MAAa,4BAA4B;;CAEvC,UAAU;CACV,sBAAsB;CACtB,oBAAoB;;CAEpB,gBAAgB;CAChB,qBAAqB;AACvB;AAEA,MAAM,UAAU,IAAI,YAAY;;AAGhC,SAAgB,oBAAoB,MAAc,MAAc,0BAA0B,gBAAwD;CAChJ,OAAO,KAAK,SAAS,MAAM;EAAE,QAAQ,KAAK,MAAM,GAAG,GAAG;EAAG,WAAW;CAAK,IAAI;EAAE,QAAQ;EAAM,WAAW;CAAM;AAChH;AAYA,SAAgB,yBAAyB,YAA0B,KAAK,IAAI,GAAuB;CACjG,MAAM,QAAgC,CAAC;CACvC,MAAM,uBAAO,IAAI,IAAiE;CAClF,IAAI,aAAa;CACjB,IAAI,cAAc;CAClB,OAAO;EACL,MAAM,EAAE,IAAI,MAAM,OAAO,mBAAmB;GAC1C,IAAI,MAAM,UAAU,0BAA0B,UAC5C,OAAO;GACT,MAAM,SAA+B;IAAE;IAAI;IAAM,QAAQ;IAAa,YAAY;IAAG,GAAI,kBAAkB,EAAE,iBAAiB,KAAc,IAAI,CAAC;GAAG;GACpJ,MAAM,OAAO,KAAK,UAAU,SAAS,CAAC,CAAC;GACvC,MAAM,QAAQ,QAAQ,OAAO,IAAI,CAAC,CAAC;GACnC,IAAI,SAAS,0BAA0B,wBAAwB,aAAa,SAAS,0BAA0B,oBAAoB;IACjI,OAAO,QAAQ,KAAK,MAAM,IAAI;IAC9B,cAAc;GAChB,OAEE,OAAO,aAAa;GAEtB,MAAM,KAAK,MAAM;GACjB,KAAK,IAAI,IAAI;IAAE;IAAQ,WAAW,IAAI;GAAE,CAAC;GACzC,OAAO;EACT;EACA,OAAO,IAAI,QAAQ;GACjB,MAAM,QAAQ,KAAK,IAAI,EAAE;GACzB,IAAI,CAAC,OACH;GACF,KAAK,OAAO,EAAE;GACd,MAAM,EAAE,QAAQ,cAAc;GAC9B,OAAO,SAAS,OAAO;GACvB,OAAO,aAAa,KAAK,IAAI,GAAG,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC;GAC7D,MAAM,OAAO,KAAK,IAAI,GAAG,0BAA0B,sBAAsB,WAAW;GACpF,MAAM,EAAE,QAAQ,cAAc,oBAAoB,OAAO,QAAQ,KAAK,IAAI,0BAA0B,gBAAgB,IAAI,CAAC;GACzH,IAAI,QAAQ;IACV,OAAO,SAAS;IAChB,eAAe,OAAO;GACxB;GACA,IAAI,WACF,OAAO,kBAAkB;EAC7B;EACA,IAAI,IAAI;GACN,MAAM,SAAS,KAAK,IAAI,EAAE,CAAC,EAAE,UAAU,MAAM,MAAK,SAAQ,KAAK,OAAO,EAAE;GACxE,OAAO,SAAS,EAAE,GAAG,OAAO,IAAI,KAAA;EAClC;EACA,WAAW;GACT,IAAI,MAAM,WAAW,GACnB,OAAO,KAAA;GACT,MAAM,KAAK,IAAI;GACf,OAAO,MAAM,KAAK,SAAS;IACzB,MAAM,UAAU,KAAK,IAAI,KAAK,EAAE;IAChC,OAAO,UAAU;KAAE,GAAG;KAAM,YAAY,KAAK,IAAI,GAAG,KAAK,MAAM,KAAK,QAAQ,SAAS,CAAC;IAAE,IAAI,EAAE,GAAG,KAAK;GACxG,CAAC;EACH;CACF;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prelude-CVKoUzV8.js","names":[],"sources":["../src/codemode/runtime/prelude.ts"],"sourcesContent":["// Ported from @earendil-works/pi-codemode (MIT, Earendil Works). Owned here so\n// it can diverge; keep behavior changes covered by test/codemode.\n/** Maximum size, in characters of JSON, of one value a script writes with `store()`. */\nexport const MAX_STORE_VALUE_CHARS = 256 * 1024\n/** Maximum total size, in characters of JSON, of all values a script writes with `store()` in one execution. */\nexport const MAX_STORE_TOTAL_CHARS = 1024 * 1024\n/**\n * Output one script may produce with `text()`, `image()`, and `console.*`: characters of text and\n * base64 image data, and items. The host keeps all output until the script ends, so without a\n * limit a script that prints in a loop grows the host's memory until it crashes. The item limit\n * covers loops that print empty strings.\n */\nexport const MAX_OUTPUT_CHARS = 16 * 1024 * 1024\n/** Maximum number of output items one script may produce. */\nexport const MAX_OUTPUT_ITEMS = 100_000\n\nconst IMAGE_HELPER_EXPECTS\n = 'image expects a non-empty image URL string, an object with image_url, a raw MCP image block, or a tool result holding images'\n\n/**\n * JavaScript evaluated inside the QuickJS VM before the script runs.\n *\n * The VM is its own wasm instance, so nothing here guards a realm boundary.\n * The prelude keeps the host bridge in a closure so the script cannot call it\n * directly, and builds `tools`, `ALL_TOOLS`, the output helpers (`text`, `image`,\n * `exit`, `console`), and globals on top of it. Tool arguments and results cross\n * as JSON strings and are parsed on this side.\n *\n * Output helpers: `text(value)` appends a text item (a tool result prints as the text a direct\n * call returns and attaches the images it holds, other non-strings are JSON-stringified), `image(urlOrItem)` appends an image from a base64 `data:` URL, an\n * `{ image_url }` object, or an MCP `ImageContent` block, and `exit()` ends the script\n * successfully. `console.*` appends text items marked as console output.\n *\n * `store(key, value)` and `load(key)` are synchronous: they work on a snapshot of\n * JSON text passed in as `storeJson`, and the keys the script wrote are reported\n * with a successful \"done\".\n *\n * Evaluates to a function `(bridge, toolsJson, globalsJson, storeJson, hintsJson, shortcutsJson) => { settle, run, stalled }`.\n * `toolsJson` lists `{ name, jsName, description, stringArg? }`: `tools[jsName]` and `tools[name]` call the\n * tool, a bare string argument fills `stringArg`, and `ALL_TOOLS` lists `{ name: jsName, description }`.\n * `shortcutsJson` maps global function names to tool names (`{ sh: \"shell\" }`).\n * `settle(id, ok, payload, text)` resolves a call; `text`, when given, is what printing the value shows.\n * `stalled()` reports a script that has not finished while no host call is pending: with no timers\n * or I/O in the VM, nothing can ever resume it.\n * `globalsJson` lists `{ name, spread }`; `a.b` names are grouped into a frozen `a` object.\n * `bridge(kind, a, b, c)` with kind \"call\" or \"global\" (id, name, argsJson),\n * \"output\" (\"text\" or \"console\", text) or (\"image\", data, mimeType), or \"done\" (ok, valueJsonOrErrorJson, writesJson).\n *\n * Calls get ids from one counter shared by tools and globals, in issue order: the host exposes\n * them as `CodemodeToolContext.seq`.\n *\n * Before anything else the prelude freezes the built-ins and makes the built-in globals read-only.\n * The prelude shares them with the script, so a script that patched one (for example\n * `Array.prototype.toJSON`) could otherwise corrupt what the prelude reports to the host.\n */\nexport const PRELUDE_SOURCE: string = `(function (bridge, toolsJson, globalsJson, storeJson, hintsJson, shortcutsJson) {\n \"use strict\";\n\n // Freeze every object reachable from the built-in globals, plus the intrinsics that are only\n // reachable from instances (iterator and generator prototypes, %TypedArray%).\n //\n // Freezing alone breaks ordinary code through the \"override mistake\": a data property that is\n // read-only on a prototype cannot be assigned on an instance either, so\n // this.name = \"MyError\" in an Error subclass would throw. Commonly overridden properties\n // become accessors whose setter defines an own property on the instance instead.\n (function lockdown() {\n const OVERRIDABLE = new Set([\"constructor\", \"name\", \"message\", \"toString\", \"toLocaleString\", \"valueOf\", \"toJSON\"]);\n const seen = new Set([globalThis]);\n const queue = [];\n const add = (value) => {\n if ((typeof value === \"object\" && value !== null) || typeof value === \"function\") {\n if (!seen.has(value)) {\n seen.add(value);\n queue.push(value);\n }\n }\n };\n\n // Accessors from an object literal have no own prototype object, unlike function expressions,\n // whose prototype.constructor would be converted again without end.\n function allowOverride(object, key, value, enumerable) {\n const { get, set } = Object.getOwnPropertyDescriptor(\n {\n get accessor() {\n return value;\n },\n set accessor(next) {\n if (this === object) {\n throw new TypeError(\"Cannot assign to read only property '\" + String(key) + \"' of a built-in\");\n }\n if ((typeof this !== \"object\" || this === null) && typeof this !== \"function\") return;\n Object.defineProperty(this, key, { value: next, writable: true, enumerable: true, configurable: true });\n },\n },\n \"accessor\",\n );\n Object.defineProperty(object, key, { get, set, enumerable, configurable: false });\n add(get);\n add(set);\n }\n\n for (const key of Reflect.ownKeys(globalThis)) {\n const descriptor = Object.getOwnPropertyDescriptor(globalThis, key);\n add(descriptor.value);\n add(descriptor.get);\n add(descriptor.set);\n if (\"value\" in descriptor && descriptor.configurable) {\n Object.defineProperty(globalThis, key, { writable: false, configurable: false });\n }\n }\n add(Object.getPrototypeOf(function* () {}));\n add(Object.getPrototypeOf(async function () {}));\n add(Object.getPrototypeOf(async function* () {}));\n add(Object.getPrototypeOf(Int8Array));\n add(Object.getPrototypeOf([][Symbol.iterator]()));\n add(Object.getPrototypeOf(new Map()[Symbol.iterator]()));\n add(Object.getPrototypeOf(new Set()[Symbol.iterator]()));\n add(Object.getPrototypeOf(\"\"[Symbol.iterator]()));\n add(Object.getPrototypeOf(/a/[Symbol.matchAll](\"\")));\n if (typeof Iterator === \"function\") {\n if (typeof Iterator.prototype.map === \"function\") add(Object.getPrototypeOf([].values().map((x) => x)));\n if (typeof Iterator.from === \"function\") add(Object.getPrototypeOf(Iterator.from({ next() {} })));\n }\n\n while (queue.length > 0) {\n const object = queue.pop();\n add(Object.getPrototypeOf(object));\n const descriptors = Object.getOwnPropertyDescriptors(object);\n for (const key of Reflect.ownKeys(descriptors)) {\n const descriptor = descriptors[key];\n if (\"value\" in descriptor) {\n add(descriptor.value);\n if (\n descriptor.writable &&\n descriptor.configurable &&\n (object === Object.prototype || OVERRIDABLE.has(key))\n ) {\n allowOverride(object, key, descriptor.value, descriptor.enumerable);\n }\n } else {\n add(descriptor.get);\n add(descriptor.set);\n }\n }\n Object.freeze(object);\n }\n })();\n const stringify = JSON.stringify;\n const parse = JSON.parse;\n const defineProperty = Object.defineProperty;\n const TO_PRIMITIVE = Symbol.toPrimitive;\n const promiseThen = Promise.prototype.then;\n const ErrorCtor = Error;\n const TypeErrorCtor = TypeError;\n const RangeErrorCtor = RangeError;\n const pending = new Map();\n // What a tool result prints as (the text a direct call returns), keyed by the value the script got.\n const printedText = new WeakMap();\n // Image blocks already attached, so printing a result twice (text(r) then return r) sends each once.\n const emittedImages = new WeakSet();\n let nextId = 1;\n let finished = false;\n // Thrown by exit() to unwind the script after it already reported success.\n const EXIT = Object.freeze({});\n\n function done(ok, payload, writes) {\n if (finished) return;\n finished = true;\n bridge(\"done\", ok, payload, writes);\n }\n\n function serialize(value) {\n return value === undefined ? undefined : stringify(value);\n }\n\n // QuickJS stacks list frames only. Prefix \"Name: message\" like V8 so the\n // text reads the same as a Node error, and drop this prelude's frames.\n function errorText(error) {\n const head = error.message ? error.name + \": \" + error.message : String(error.name);\n const frames =\n typeof error.stack === \"string\"\n ? error.stack.split(\"\\\\n\").filter((line) => line.trim() && !line.includes(\"codemode-prelude.js\"))\n : [];\n return [head, ...frames].join(\"\\\\n\");\n }\n\n // The images a printed tool result holds (MCP image blocks in its value), an array of results' in order.\n function printedImages(value) {\n if (value === null || typeof value !== \"object\" || !Array.isArray(value)) return [];\n if (printedText.has(value)) {\n return value.filter(\n (item) => item !== null && typeof item === \"object\" && item.type === \"image\" && typeof item.data === \"string\",\n );\n }\n return value.flatMap((item) => (item !== null && typeof item === \"object\" && printedText.has(item) ? printedImages(item) : []));\n }\n\n function outputImages(value) {\n for (const block of printedImages(value)) {\n if (emittedImages.has(block)) continue;\n emittedImages.add(block);\n output(\"image\", block.data, block.mimeType);\n }\n }\n\n // A tool result prints as its text, an array holding tool results (and strings) as sections.\n function printable(value) {\n if (value === null || typeof value !== \"object\") return undefined;\n if (printedText.has(value)) return printedText.get(value);\n if (!Array.isArray(value)) return undefined;\n const parts = [];\n let results = 0;\n for (const item of value) {\n if (typeof item === \"string\") {\n parts.push(item);\n } else if (item !== null && typeof item === \"object\" && printedText.has(item)) {\n parts.push(printedText.get(item));\n results++;\n } else {\n return undefined;\n }\n }\n return results > 0 ? parts.join(\"\\\\n\\\\n\") : undefined;\n }\n\n function format(value) {\n if (typeof value === \"string\") return value;\n if (value instanceof ErrorCtor) return errorText(value);\n const printed = printable(value);\n if (printed !== undefined) return printed;\n try {\n const json = stringify(value);\n return json === undefined ? String(value) : json;\n } catch {\n return String(value);\n }\n }\n\n // The host requires string fields. A script can set an error's name or message to anything, so\n // they are coerced, and a value whose coercion throws gets a placeholder.\n function describeError(error) {\n try {\n if (error instanceof ErrorCtor) {\n return stringify({ name: String(error.name), message: String(error.message), stack: errorText(error) });\n }\n return stringify({ message: String(format(error)) });\n } catch {\n return stringify({ message: \"The script threw a value that cannot be described\" });\n }\n }\n\n function caller(kind, name, spread) {\n return (...args) =>\n new Promise((resolve, reject) => {\n let json;\n try {\n json = serialize(spread ? args : args[0]);\n } catch (error) {\n reject(error);\n return;\n }\n const id = nextId++;\n pending.set(id, { resolve, reject });\n bridge(kind, id, name, json);\n });\n }\n\n const tools = Object.create(null);\n const allTools = [];\n // tools.shell(\"ls\", { timeout: 5000 }) is tools.shell({ timeout: 5000, command: \"ls\" }).\n function withStringArg(key, value, rest) {\n const input = {};\n if (rest !== null && typeof rest === \"object\" && !Array.isArray(rest)) {\n for (const restKey of Object.keys(rest)) input[restKey] = rest[restKey];\n }\n input[key] = value;\n return input;\n }\n\n for (const { name, jsName, description, stringArg } of parse(toolsJson)) {\n const call = caller(\"call\", name);\n const fn = stringArg === undefined\n ? call\n : (args, rest) => call(typeof args === \"string\" ? withStringArg(stringArg, args, rest) : args);\n // The first tool wins when two names normalize to the same identifier.\n if (!(jsName in tools)) {\n tools[jsName] = fn;\n allTools.push(Object.freeze({ name: jsName, description }));\n }\n if (!(name in tools)) tools[name] = fn;\n }\n Object.freeze(tools);\n Object.freeze(allTools);\n\n // Reading a member that does not exist throws an error that names the close matches, instead of\n // a later \"not a function\". \\`in\\` checks still work.\n const comparable = (name) => name.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n function guard(target, label, names, hint, missingHints) {\n return new Proxy(target, {\n get(object, property, receiver) {\n if (typeof property !== \"string\" || property in object || property in Object.prototype || property === \"then\" || property === \"toJSON\") {\n return Reflect.get(object, property, receiver);\n }\n // A tool the host knows but keeps out of scripts (spawn, call_tool, ...): its own advice.\n if (missingHints && Object.prototype.hasOwnProperty.call(missingHints, property)) {\n throw new TypeErrorCtor(label + \".\" + property + \" is not available in scripts. \" + missingHints[property]);\n }\n const wanted = comparable(property);\n const exact = names.filter((name) => comparable(name) === wanted);\n const close = exact.length > 0 ? exact : names.filter((name) => wanted && (comparable(name).includes(wanted) || wanted.includes(comparable(name))));\n let message = label + \".\" + property + \" does not exist.\";\n if (close.length > 0) message += \" Did you mean \" + close.slice(0, 5).map((name) => label + \".\" + name).join(\", \") + \"?\";\n else if (names.length <= 20) message += \" Available: \" + names.join(\", \") + \".\";\n if (hint) message += \" \" + hint;\n message += ' Check for a member with \"' + property + '\" in ' + label + \".\";\n throw new TypeErrorCtor(message);\n },\n });\n }\n const toolsProxy = guard(\n tools,\n \"tools\",\n allTools.map((tool) => tool.name),\n \"ALL_TOOLS lists every tool; searchTools(query) finds tools by topic.\",\n hintsJson ? parse(hintsJson) : undefined,\n );\n\n const namespaces = new Map();\n for (const { name, spread } of parse(globalsJson)) {\n const fn = caller(\"global\", name, spread);\n const dot = name.indexOf(\".\");\n if (dot === -1) {\n Object.defineProperty(globalThis, name, { value: fn, enumerable: true });\n continue;\n }\n const namespace = name.slice(0, dot);\n if (!namespaces.has(namespace)) namespaces.set(namespace, Object.create(null));\n namespaces.get(namespace)[name.slice(dot + 1)] = fn;\n }\n for (const [namespace, members] of namespaces) {\n Object.freeze(members);\n const value = guard(members, namespace, Object.keys(members));\n Object.defineProperty(globalThis, namespace, { value, enumerable: true });\n }\n\n // sh(\"ls\") is tools.shell(\"ls\"): the same call, recorded the same way.\n for (const [alias, target] of Object.entries(parse(shortcutsJson || \"{}\"))) {\n if (!Object.prototype.hasOwnProperty.call(tools, target) || alias in globalThis) continue;\n const fn = tools[target];\n Object.defineProperty(globalThis, alias, { value: (...args) => fn(...args), enumerable: true });\n }\n\n // key -> JSON text. Sizes count key and JSON characters.\n const stored = new Map(Object.entries(parse(storeJson)));\n const writes = new Map();\n let storedChars = 0;\n for (const [key, json] of stored) storedChars += key.length + json.length;\n\n const STORE_HINT =\n \"store() is for small state such as IDs or summaries. Show images with image(), keep large data in variables, or write it to a file with a tool.\";\n\n function checkKey(name, key) {\n if (typeof key !== \"string\") throw new TypeError(name + \"() key must be a string\");\n }\n\n function store(key, value) {\n checkKey(\"store\", key);\n const previous = stored.has(key) ? key.length + stored.get(key).length : 0;\n if (value === undefined) {\n stored.delete(key);\n storedChars -= previous;\n writes.set(key, undefined);\n return;\n }\n let json;\n try {\n json = stringify(value);\n } catch (error) {\n throw new TypeError(\"store(\" + stringify(key) + \") value is not JSON-serializable: \" + format(error));\n }\n if (json === undefined) {\n throw new TypeError(\"store(\" + stringify(key) + \") value is not JSON-serializable\");\n }\n if (json.length > ${MAX_STORE_VALUE_CHARS}) {\n throw new RangeError(\n \"store(\" + stringify(key) + \") value has \" + json.length + \" characters of JSON, more than the limit of ${MAX_STORE_VALUE_CHARS}. \" +\n STORE_HINT,\n );\n }\n const next = storedChars - previous + key.length + json.length;\n if (next > ${MAX_STORE_TOTAL_CHARS}) {\n throw new RangeError(\n \"store is full: stored values would exceed ${MAX_STORE_TOTAL_CHARS} characters of JSON. Delete keys with store(key, undefined). \" +\n STORE_HINT,\n );\n }\n stored.set(key, json);\n storedChars = next;\n writes.set(key, json);\n }\n\n function load(key) {\n checkKey(\"load\", key);\n const json = stored.get(key);\n return json === undefined ? undefined : parse(json);\n }\n\n function serializeWrites() {\n const entries = [];\n for (const [key, json] of writes) entries.push(json === undefined ? [key] : [key, json]);\n return stringify(entries);\n }\n\n Object.defineProperty(globalThis, \"store\", { value: store, enumerable: true });\n Object.defineProperty(globalThis, \"load\", { value: load, enumerable: true });\n\n let outputChars = 0;\n let outputItems = 0;\n\n // Past the output limits the script fails: done() reports the error, so catching it does not\n // resume output, and the host ends the script.\n function output(kind, data, mimeType) {\n if (finished) return;\n outputChars += data.length;\n outputItems++;\n if (outputChars > ${MAX_OUTPUT_CHARS} || outputItems > ${MAX_OUTPUT_ITEMS}) {\n const error = new RangeErrorCtor(\n \"script output exceeded the limit of ${MAX_OUTPUT_CHARS} characters or ${MAX_OUTPUT_ITEMS} text(), image(), and console calls. \" +\n \"Print a summary instead, or write large data to a file with a tool.\",\n );\n done(false, describeError(error));\n throw error;\n }\n bridge(\"output\", kind, data, mimeType);\n }\n\n // Primitives become their string form, everything else JSON.\n function outputText(value) {\n if (value === undefined || value === null || typeof value !== \"object\" && typeof value !== \"function\") {\n return String(value);\n }\n const printed = printable(value);\n if (printed !== undefined) return printed;\n const json = stringify(value);\n return json === undefined ? String(value) : json;\n }\n\n function text(value) {\n let rendered;\n try {\n rendered = outputText(value);\n } catch (error) {\n throw new TypeErrorCtor(error instanceof ErrorCtor ? error.message : String(error));\n }\n output(\"text\", rendered);\n outputImages(value);\n }\n\n function imageUrl(value) {\n if (typeof value === \"string\") return value;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new TypeErrorCtor(${JSON.stringify(IMAGE_HELPER_EXPECTS)});\n }\n if (value.image_url !== undefined) {\n if (typeof value.image_url !== \"string\") throw new TypeErrorCtor(${JSON.stringify(IMAGE_HELPER_EXPECTS)});\n return value.image_url;\n }\n if (typeof value.type !== \"string\") throw new TypeErrorCtor(${JSON.stringify(IMAGE_HELPER_EXPECTS)});\n if (value.type !== \"image\") {\n throw new TypeErrorCtor('image only accepts MCP image blocks, got \"' + value.type + '\"');\n }\n if (typeof value.data !== \"string\" || value.data === \"\") throw new TypeErrorCtor(\"image expected MCP image data\");\n if (value.data.toLowerCase().startsWith(\"data:\")) return value.data;\n return \"data:;base64,\" + value.data;\n }\n\n // Base64 of the signatures of the formats providers accept inline (PNG, JPEG except\n // JPEG-LS, GIF, \"RIFF....WEBP\"). Signatures start at byte 0, so their encodings are prefixes.\n const IMAGE_SIGNATURES = [\n [\"image/png\", /^iVBORw0KGg/],\n [\"image/jpeg\", /^[/]9j[/](?!9)/],\n [\"image/gif\", /^R0lGOD[dl]h/],\n [\"image/webp\", /^UklG.{8}RUJQ/],\n ];\n\n // A tool result (or an array of image blocks) attaches every image it holds, once.\n function image(value) {\n if (!Array.isArray(value)) return emitImage(value);\n const blocks = printedText.has(value) ? printedImages(value) : value.filter((item) => item !== null && typeof item === \"object\" && item.type === \"image\");\n if (blocks.length === 0) {\n throw new TypeErrorCtor(\"image found no image in \" + (printedText.has(value) ? \"that tool result\" : \"that array\") + \". \" + ${JSON.stringify(IMAGE_HELPER_EXPECTS)});\n }\n for (const block of blocks) {\n if (emittedImages.has(block)) continue;\n emitImage(block);\n emittedImages.add(block);\n }\n }\n\n function emitImage(value) {\n const url = imageUrl(value);\n if (url === \"\") throw new TypeErrorCtor(${JSON.stringify(IMAGE_HELPER_EXPECTS)});\n const colon = url.indexOf(\":\");\n const scheme = colon === -1 ? \"\" : url.slice(0, colon).toLowerCase();\n if (scheme === \"http\" || scheme === \"https\") {\n throw new TypeErrorCtor(\"remote image URLs are not supported in tool outputs. Pass a base64 data URI instead\");\n }\n const comma = url.indexOf(\",\");\n const header = comma === -1 ? [] : url.slice(colon + 1, comma).split(\";\");\n if (scheme !== \"data\" || comma === -1 || header.slice(1).every((part) => part.toLowerCase() !== \"base64\")) {\n throw new TypeErrorCtor(\"invalid image output. Pass a base64 data URI instead\");\n }\n // Providers reject the whole request on a bad image, and a persisted image block would be\n // resent on every later turn. Line breaks from wrapped base64 are dropped. The declared type\n // is ignored in favor of the detected one, as providers also reject mismatches.\n const data = url.slice(comma + 1).replace(/\\\\s+/g, \"\");\n if (data.length % 4 !== 0 || !/^[A-Za-z0-9+/]+={0,2}$/.test(data)) {\n throw new TypeErrorCtor(\"invalid image output. The image data is not valid base64 (truncated or corrupted?)\");\n }\n const head = data.slice(0, 16);\n const signature = IMAGE_SIGNATURES.find(([, pattern]) => pattern.test(head));\n if (!signature) {\n throw new TypeErrorCtor(\"invalid image output. The image data is not a PNG, JPEG, GIF, or WebP image\");\n }\n output(\"image\", data, signature[0]);\n }\n\n function exit() {\n let writesJson;\n try {\n writesJson = serializeWrites();\n } catch (error) {\n done(false, describeError(error));\n throw EXIT;\n }\n done(true, undefined, writesJson);\n throw EXIT;\n }\n\n const console = {};\n for (const level of [\"log\", \"info\", \"warn\", \"error\", \"debug\"]) {\n console[level] = (...args) => {\n output(\"console\", args.map(format).join(\" \"));\n for (const arg of args) outputImages(arg);\n };\n }\n Object.freeze(console);\n\n Object.defineProperty(globalThis, \"tools\", { value: toolsProxy, enumerable: true });\n Object.defineProperty(globalThis, \"ALL_TOOLS\", { value: allTools, enumerable: true });\n Object.defineProperty(globalThis, \"console\", { value: console, enumerable: true });\n Object.defineProperty(globalThis, \"text\", { value: text, enumerable: true });\n Object.defineProperty(globalThis, \"image\", { value: image, enumerable: true });\n Object.defineProperty(globalThis, \"exit\", { value: exit, enumerable: true });\n\n return {\n settle(id, ok, payload, text) {\n const entry = pending.get(id);\n if (!entry) return;\n pending.delete(id);\n if (!ok) {\n entry.reject(new ErrorCtor(payload));\n return;\n }\n let value;\n try {\n value = payload === undefined ? undefined : parse(payload);\n } catch (error) {\n entry.reject(error);\n return;\n }\n if (text !== undefined && value !== null && typeof value === \"object\") {\n printedText.set(value, text);\n // Inside a string (\"\" + r, a template literal), a tool result reads as its text too.\n defineProperty(value, TO_PRIMITIVE, { value: () => text });\n }\n entry.resolve(value);\n },\n run(fn) {\n let promise;\n try {\n promise = fn();\n } catch (error) {\n done(false, describeError(error));\n return;\n }\n promiseThen.call(\n promise,\n (value) => {\n let json;\n try {\n const printed = printable(value);\n json = serialize(printed === undefined ? value : printed);\n if (printed !== undefined) outputImages(value);\n } catch (error) {\n done(false, describeError(error));\n return;\n }\n done(true, json, serializeWrites());\n },\n (error) => {\n done(false, describeError(error));\n },\n );\n },\n stalled() {\n if (finished || pending.size > 0) return false;\n done(\n false,\n stringify({\n name: \"Error\",\n message:\n \"The script is waiting on a promise that can never settle: no tool call is pending, and timers do not exist here.\",\n }),\n );\n return true;\n },\n };\n})`\n"],"mappings":";;AAGA,MAAa,wBAAwB;;AAErC,MAAa,wBAAwB;;;;;;;AAOrC,MAAa,mBAAmB;;AAEhC,MAAa,mBAAmB;AAEhC,MAAM,uBACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCJ,MAAa,iBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwUd,sBAAsB;;kHAEoE,sBAAsB;;;;;iBAKvH,sBAAsB;;qDAEc,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiCnD,iBAAiB,oBAAoB,iBAAiB;;+CAE/B,iBAAiB,iBAAiB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAkClE,KAAK,UAAU,oBAAoB,EAAE;;;yEAGI,KAAK,UAAU,oBAAoB,EAAE;;;kEAG5C,KAAK,UAAU,oBAAoB,EAAE;;;;;;;;;;;;;;;;;;;;;;;mIAuB4B,KAAK,UAAU,oBAAoB,EAAE;;;;;;;;;;;8CAW1H,KAAK,UAAU,oBAAoB,EAAE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"protocol-CEVqBO-q.d.ts","names":["OrchestrationCreateParams","OrchestrationWorkerRow","OrchestrationWorkerSummary","OrchestrationWaitResult","OrchestrationEventQuery","OrchestrationPendingRequest"],"sources":["../src/chat/session-policy.ts","../src/ipc/scopes.ts","../src/ipc/protocol.ts"],"mappings":";;;;;;;;;;UAgBiB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;IAAW;IAAqB;;;;;;cCArB;;KAED,qBAAqB;;;;;;iBAOjB,cAAc,iBAAiB,SAAS;;;;;;;iBAUxC,YAAY,SAAS,aAAa,UAAU;;cAK/C,2BAA2B,KAAK,gBAAgB;;;;;;iBAsT7C,YAAY,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCLhC;;;;;;;;;;cAYA;;;;;;cAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAiCI;;EAEf;;EAEA;;;;;;;;iBASc,0BAA0B,gBAAgB;;;;;;;cAsB7C;;UAGI;;EAEf;;;UAIe;;EAEf;;EAEA,QAAQ;;;KAIE;EACJ;EAAU,SAAS;;;;EAEnB;EAAW;;;;;;;;;;;;UAgBF;EACf;;;;;;;;;;UAWe;;;;;;;;;;EAUf;IAAe,QAAQ,KAAK,uBAAuB;IAAe;MAAU;MAAe;;;;EAE3F;IAAoB;MAAU;;IAAqB;;;;;;EAKnD;IAAgB;MAAU;MAAmB;MAAiB;;IAA4B;;;;;;EAK1F;IAAmB;MAAU;MAAmB;MAAiB;;IAA4B;;;;;;EAK7F;IACE;MAAU;MAAmB;MAAiB;MAA4B;MAAqB,SAAS;MAAuB;MAAmB;MAA0B,WAAW;QAA4B;IACnN;MAAU;MAAoD;;;;EAGhE;IAAoB;MAAU;;IAAqB;;;;;;;EAMnD;IAAuB;MAAU;;IAAqB;;;;;;;EAMtD;IAAiC;MAAU;QAAsB;IAAwB;;;;;;;;;;EASzF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src/extensions/runtime/domains/sessions.ts","../src/extensions/catalog/clone.ts","../src/extensions/catalog/engine.ts","../src/extensions/catalog/domain.ts","../src/extensions/catalog/models.ts","../src/extensions/catalog/providers.ts"],"sourcesContent":["/**\n * `ctx.sessions` (extension API): the orchestration verbs mapped 1:1,\n * plus the lifecycle verbs. Everything goes through the host's\n * session control, acting as the extension, so what it creates is tagged\n * with the extension id. Without a host, or when the host lacks a verb, the\n * call rejects with a message naming both.\n */\n\nimport type { CommandOutputBlock } from '../../../chat/commands'\nimport type { SessionQuery, SessionQueryIssue, SessionSort } from '../../../chat/session-query'\nimport type { SessionListQuery, SessionListRow, SessionsDomain } from '../../api/sessions'\nimport type { ExtensionSessionLifecycleVerbs, ExtensionSessionRow, ExtensionSessionVerbs } from '../../host-runtime'\nimport type { DomainDeps } from '../deps'\nimport type { SessionsPort } from './ports'\nimport { projectNameOf, querySessions, SessionQueryError, validateQuery, validateSort } from '../../../chat/session-query'\nimport { assertAlive } from '../owner'\n\ntype Verbs = ExtensionSessionVerbs & ExtensionSessionLifecycleVerbs\n\n/**\n * Prefixes bare renderer ids of `custom` blocks with the extension id, as\n * `ctx.appendNote` does.\n */\nfunction namespaceBlocks(extensionId: string, blocks: readonly CommandOutputBlock[]): CommandOutputBlock[] {\n return blocks.map(block =>\n block.custom && !block.custom.renderer.includes('/')\n ? { ...block, custom: { ...block.custom, renderer: `${extensionId}/${block.custom.renderer}` } }\n : block)\n}\n\n/** Rows per page of `ctx.sessions.list` when the query names none, and the most it hands out. */\nexport const SESSION_LIST_DEFAULT_LIMIT = 30\n/** The most rows one `ctx.sessions.list` page holds. */\nexport const SESSION_LIST_MAX_LIMIT = 100\n\n/** A list query with its defaults filled, as the host's `query` verb gets it. */\nexport type NormalizedSessionListQuery = Parameters<NonNullable<ExtensionSessionLifecycleVerbs['query']>>[0]\n\n/**\n * Checks a `ctx.sessions.list` query and fills its defaults. Throws a\n * `SessionQueryError` naming every problem.\n *\n * @param query - The query as the extension gave it.\n */\nexport function normalizeSessionListQuery(query: unknown): NormalizedSessionListQuery {\n if (query === undefined)\n query = {}\n if (typeof query === 'number')\n throw new SessionQueryError([{ path: 'query', message: `list takes a query object now: call list({ limit: ${query} })` }])\n if (!query || typeof query !== 'object' || Array.isArray(query))\n throw new SessionQueryError([{ path: 'query', message: 'must be { where?, sort?, limit?, cursor?, archived? }' }])\n const q = query as Record<string, unknown>\n const issues: SessionQueryIssue[] = []\n for (const key of Object.keys(q)) {\n if (!['where', 'sort', 'limit', 'cursor', 'archived'].includes(key))\n issues.push({ path: key, message: 'unknown key; a list query holds where, sort, limit, cursor and archived' })\n }\n if (q.where !== undefined)\n issues.push(...validateQuery(q.where))\n if (q.sort !== undefined)\n issues.push(...validateSort(q.sort))\n const limit = q.limit ?? SESSION_LIST_DEFAULT_LIMIT\n if (!Number.isInteger(limit) || (limit as number) < 1 || (limit as number) > SESSION_LIST_MAX_LIMIT)\n issues.push({ path: 'limit', message: `must be a whole number from 1 to ${SESSION_LIST_MAX_LIMIT}` })\n if (q.cursor !== undefined && (typeof q.cursor !== 'string' || q.cursor.length === 0))\n issues.push({ path: 'cursor', message: 'must be the cursor of a previous page' })\n if (q.archived !== undefined && typeof q.archived !== 'boolean' && q.archived !== 'all')\n issues.push({ path: 'archived', message: 'must be true, false or \\'all\\'' })\n if (issues.length > 0)\n throw new SessionQueryError(issues)\n return {\n ...(q.where !== undefined ? { where: q.where as NonNullable<SessionListQuery['where']> } : {}),\n sort: (q.sort as SessionListQuery['sort']) ?? [{ field: 'updatedAt', dir: 'desc' }],\n limit: limit as number,\n ...(q.cursor !== undefined ? { cursor: q.cursor as string } : {}),\n archived: (q.archived as SessionListQuery['archived']) ?? false,\n }\n}\n\n/**\n * Every field path a query reads (conditions at any depth) and a sort reads,\n * as written (`facet.<ext>.<key>` paths whole).\n *\n * @param where - The query.\n * @param sort - The sort keys.\n */\nexport function fieldsReadBy(where: SessionQuery | undefined, sort: readonly SessionSort[] = []): Set<string> {\n const out = new Set<string>(sort.map(s => s.field))\n const walk = (q: SessionQuery): void => {\n if ('field' in q)\n out.add(q.field)\n else if ('all' in q)\n q.all.forEach(walk)\n else if ('any' in q)\n q.any.forEach(walk)\n else if ('not' in q)\n walk(q.not)\n }\n if (where)\n walk(where)\n return out\n}\n\n/** The fields an orchestration row fills (`orchestrationRow`): what a host without the `query` verb can filter and sort on. */\nconst ORCHESTRATION_FIELDS: ReadonlySet<string> = new Set(['id', 'title', 'cwd', 'projectName', 'status', 'updatedAt', 'archived'])\n\nfunction isDefaultSort(sort: readonly SessionSort[]): boolean {\n return sort.length === 1 && sort[0]!.field === 'updatedAt' && sort[0]!.dir === 'desc'\n}\n\n/** An orchestration row as a list row: the fields it has, no facets. */\nfunction orchestrationRow(row: ExtensionSessionRow): SessionListRow {\n return { id: row.sessionId, title: row.title, projectRoot: null, projectName: projectNameOf({ cwd: row.cwd }) ?? '', cwd: row.cwd, status: row.state, updatedAt: row.updatedAt, archived: false, worker: row.worker, facets: {} }\n}\n\n/**\n * Creates one extension's `ctx.sessions`.\n *\n * @param deps - The extension's id, owner, guard and logger.\n * @param port - The host's session control and prompt bridge.\n * @returns The domain without `facets` (the context adds them). Every call rejects with `DisposedError` once the owner is disposed.\n */\nexport function createSessionsDomain(deps: DomainDeps, port: SessionsPort): Omit<SessionsDomain, 'facets'> {\n const { extensionId, owner } = deps\n\n const verbs = (method: string): Verbs => {\n assertAlive(owner, `sessions.${method}`)\n const control = port.sessionControl()\n if (!control)\n throw new Error(`sessions.${method}: no chat host is attached (extension \"${extensionId}\").`)\n return control.verbs(extensionId)\n }\n\n /** The lifecycle verb `method`, or a rejection when the host does not implement it. */\n const lifecycle = <K extends keyof ExtensionSessionLifecycleVerbs>(method: K): NonNullable<Verbs[K]> => {\n const all = verbs(method)\n const verb = all[method]\n if (typeof verb !== 'function')\n throw new Error(`sessions.${method}: this host does not support it (extension \"${extensionId}\").`)\n return verb.bind(all) as NonNullable<Verbs[K]>\n }\n\n return {\n create: async params => verbs('create').create(params),\n list: async (query) => {\n const all = verbs('list')\n const q = normalizeSessionListQuery(query)\n if (typeof all.query === 'function')\n return all.query(q)\n // A host without the query verb: its newest orchestration rows, filtered here. A query that needs more fails rather than answering wrong.\n const unsupported = (why: string): Error => new Error(`sessions.list: this host does not support queries (extension \"${extensionId}\"): ${why}.`)\n const missing = [...fieldsReadBy(q.where, q.sort)].filter(f => !ORCHESTRATION_FIELDS.has(f))\n if (missing.length > 0)\n throw unsupported(`it lists only ${[...ORCHESTRATION_FIELDS].join(', ')}, not ${missing.join(', ')}`)\n if (q.archived !== false)\n throw unsupported('it lists no archived sessions')\n const listed = await all.list(SESSION_LIST_MAX_LIMIT)\n const truncated = listed.length >= SESSION_LIST_MAX_LIMIT\n if (truncated && (q.where !== undefined || !isDefaultSort(q.sort)))\n throw unsupported(`it lists only its ${SESSION_LIST_MAX_LIMIT} newest sessions, so it can only page them newest first, unfiltered`)\n const page = querySessions(listed.map(orchestrationRow), { ...q, scope: q.archived })\n // A page that ends exactly at the last listed row is whole (no cursor); one cut short by the end of the list may miss older sessions.\n if (truncated && page.cursor === undefined && page.rows.length < q.limit)\n throw unsupported(`it lists only its ${SESSION_LIST_MAX_LIMIT} newest sessions; this page reaches past them`)\n return page\n },\n read: async sessionId => verbs('read').read(sessionId),\n send: async (sessionId, prompt) => verbs('send').send(sessionId, prompt),\n steer: async (sessionId, message) => verbs('steer').steer(sessionId, message),\n cancel: async sessionId => verbs('cancel').cancel(sessionId),\n transcript: async (sessionId, limit) => verbs('transcript').transcript(sessionId, limit),\n wait: async (sessionId, timeoutSec) => verbs('wait').wait(sessionId, timeoutSec),\n events: async query => verbs('events').events(query),\n pending: async sessionId => verbs('pending').pending(sessionId),\n answer: async (requestId, response) => verbs('answer').answer(requestId, response),\n approve: async (requestId, decision) => verbs('approve').approve(requestId, decision),\n\n get: async sessionId => lifecycle('get')(sessionId),\n remove: async sessionId => lifecycle('remove')(sessionId),\n compact: async sessionId => lifecycle('compact')(sessionId),\n switchModel: async (sessionId, model) => lifecycle('switchModel')(sessionId, model),\n switchAgent: async (sessionId, agentId) => lifecycle('switchAgent')(sessionId, agentId),\n setThinking: async (sessionId, level) => lifecycle('setThinking')(sessionId, level),\n synthetic: async (sessionId, message) => lifecycle('synthetic')(sessionId, message),\n note: async (sessionId, blocks) => lifecycle('note')(sessionId, namespaceBlocks(extensionId, blocks)),\n\n submit: async (text, opts = {}) => {\n const delivery = opts.delivery ? { delivery: opts.delivery } : undefined\n if (opts.sessionId !== undefined)\n return lifecycle('submit')(opts.sessionId, text, delivery)\n // The session in view: the host's prompt pipeline, as `ctx.submitPrompt`.\n assertAlive(owner, 'sessions.submit')\n if (!port.promptBridge)\n throw new Error(`sessions.submit: this host has no prompt pipeline; pass a sessionId (extension \"${extensionId}\").`)\n return port.promptBridge.submit(text, delivery)\n },\n }\n}\n","/**\n * Copy-on-edit cloning for catalog items. Items mix plain data (specs,\n * presets, labels) with functions and class instances (`execute`,\n * `factory`, OAuth providers, zod schemas). Only the plain data is copied;\n * everything else is shared by reference, so an edit never reaches a value\n * an earlier read handed out.\n */\n\n/** `true` for arrays and objects whose prototype is `Object.prototype` or `null`. */\nfunction isPlain(value: unknown): value is Record<string, unknown> | unknown[] {\n if (Array.isArray(value))\n return true\n if (value === null || typeof value !== 'object')\n return false\n const proto = Object.getPrototypeOf(value)\n return proto === Object.prototype || proto === null\n}\n\n/**\n * Deep-copies arrays and plain objects. Functions, class instances, Maps,\n * Sets and primitives are kept as they are. Cycles are preserved.\n */\nexport function clonePlain<T>(value: T): T {\n const seen = new Map<object, unknown>()\n const walk = (v: unknown): unknown => {\n if (!isPlain(v))\n return v\n const hit = seen.get(v)\n if (hit !== undefined)\n return hit\n if (Array.isArray(v)) {\n const out: unknown[] = []\n seen.set(v, out)\n for (const item of v)\n out.push(walk(item))\n return out\n }\n const out: Record<string, unknown> = Object.create(Object.getPrototypeOf(v))\n seen.set(v, out)\n for (const key of Object.keys(v))\n out[key] = walk(v[key])\n return out\n }\n return walk(value) as T\n}\n","/**\n * The catalog transform engine shared by every extension catalog (tools, agents,\n * models, providers, MCP servers, skills).\n *\n * A catalog value is rebuilt by replay: the base items (built-ins, config),\n * then registrations in the order they were made, then every transform in\n * extension load order. The result is memoized until a registration,\n * transform or `reload()` changes it. Each item records who added,\n * modified or removed it, so Settings can name the extension, and disposing\n * the extension's registrations restores the item on the next read.\n *\n * Edits are copy-on-edit: `update` clones the item before the transform\n * sees it, so a value an earlier read handed out is never mutated. A\n * transform that throws is rolled back as a whole and reported.\n */\n\nimport type { Disposable, ItemOrigin } from '../api'\nimport type { Guard } from '../runtime/deps'\nimport { clonePlain } from './clone'\n\n/** An item with the origin a base or registration gives it. */\nexport interface Sourced<T> {\n /** The item. */\n readonly item: T\n /** Who put it in the catalog. */\n readonly origin: ItemOrigin\n}\n\n/** One keyed collection inside a catalog. */\nexport interface SectionSpec<T, C> {\n /** The id of an item. Must be a non-empty string. */\n key: (item: T) => string\n /** The base items for a context: built-ins and config. Cached until `reload()`. */\n base: (context: C) => readonly Sourced<T>[]\n /** Copy used by `update`. Default: {@link clonePlain}. */\n clone?: (item: T) => T\n}\n\n/** Catalog-wide state beside the sections (a default id, auto-invoked names). */\nexport interface StateSpec<X, C> {\n /** The state before any transform. */\n base: (context: C) => X\n /** Copy taken before each transform, restored when it throws. */\n clone: (state: X) => X\n}\n\n/** Who touched one id. Removed ids keep theirs with `removedBy`. */\nexport interface Provenance {\n /** The item id. */\n readonly id: string\n /** Who put the item in the catalog. A transform's `add` makes it `{ kind: 'extension' }`. */\n readonly origin: ItemOrigin\n /** The origin of an item this one replaced at registration (same id). */\n readonly replaced?: ItemOrigin\n /** The extension whose transform added the item. */\n readonly addedBy?: string\n /** Extensions whose transforms edited the item, in replay order. */\n readonly modifiedBy: readonly string[]\n /** The extension whose transform removed the item. */\n readonly removedBy?: string\n}\n\n/** A transform that threw during replay; its edits were rolled back. */\nexport interface TransformFailure {\n /** The extension that registered the transform. */\n readonly extensionId: string\n /** The guard label it ran under. */\n readonly label: string\n}\n\n/** One section of a replayed catalog value. Frozen. */\nexport interface SectionValue<T> {\n /** The items, in insertion order. */\n readonly items: readonly T[]\n /** The item with this id. */\n get: (id: string) => T | undefined\n /** The origin of a present item. */\n origin: (id: string) => ItemOrigin | undefined\n /** Who touched an id, present or removed. */\n provenance: (id: string) => Provenance | undefined\n /** Provenance of every id, present ones first, then removed ones. */\n readonly entries: readonly Provenance[]\n}\n\n/** A replayed catalog value. Never mutated after it is returned. */\nexport interface CatalogValue<S extends Sections, X> {\n /** Every section after replay. */\n readonly sections: { readonly [K in keyof S]: SectionValue<S[K]> }\n /** The state after replay. */\n readonly state: Readonly<X>\n /** Transforms that threw and were skipped. */\n readonly failures: readonly TransformFailure[]\n}\n\n/** The section item types of a catalog, by section name (an object type such as `{ tools: NamedTool }`). */\nexport type Sections = object\n\n/** The editable form of a section that a transform works on. */\nexport interface SectionDraft<T> {\n /** Present items, in order. Treat them as read-only; edit through `update`. */\n list: () => readonly T[]\n /** The item with this id. Read-only, like `list`. */\n get: (id: string) => T | undefined\n /** Origin of a present item. */\n origin: (id: string) => ItemOrigin | undefined\n /** Adds an item, or replaces the one with the same id. */\n add: (item: T) => void\n /** Edits a clone of the item. A missing id is a no-op. The edit must keep the id. */\n update: (id: string, edit: (item: T) => void) => void\n /** Puts `item` in place of the item with its id (or adds it), marking it modified. */\n replace: (item: T) => void\n /** Removes an item. A missing id is a no-op. */\n remove: (id: string) => void\n /** A clone of an item, for callbacks that may mutate what they get. */\n cloneOf: (id: string) => T | undefined\n}\n\n/** What a transform gets: every section, the state, and who is editing. */\nexport interface CatalogDraft<S extends Sections, X, C> {\n /** The sections. */\n readonly sections: { readonly [K in keyof S]: SectionDraft<S[K]> }\n /** The state. Replace or mutate it; it is cloned before each transform. */\n state: X\n /** The context the catalog is read for. */\n readonly context: C\n /** The extension whose transform is running. */\n readonly extensionId: string\n /** Throws when the transform already returned (an editor kept past its call). */\n assertOpen: () => void\n}\n\n/** A transform registration. */\nexport interface TransformRegistration<S extends Sections, X, C> {\n /** The extension that owns the transform (orders replay and attributes edits). */\n extensionId: string\n /** Runs the transform with error attribution. */\n guard: Guard\n /** Guard label. Default: `<catalog>.transform`. */\n label?: string\n /** Edits the draft. */\n apply: (draft: CatalogDraft<S, X, C>) => void\n}\n\n/** Options shared by every catalog. */\nexport interface CatalogOptions {\n /** Load-order rank of an extension; lower replays first. Ties keep registration order. */\n order?: (extensionId: string) => number\n /** Most memoized values kept (one per context key). Default 32. */\n cacheSize?: number\n}\n\n/** Spec of a multi-section catalog. */\nexport interface CatalogSetSpec<S extends Sections, X, C> extends CatalogOptions {\n /** Name used in guard labels and errors. */\n name: string\n /** The sections. */\n sections: { [K in keyof S]: SectionSpec<S[K], C> }\n /** Optional catalog-wide state. */\n state?: StateSpec<X, C>\n /** Memo key of a context. `undefined` means \"don't memoize\". Default: one key for all. */\n contextKey?: (context: C) => string | undefined\n}\n\n/** A shared catalog: registrations, transforms, replayed reads. */\nexport interface CatalogSet<S extends Sections, X, C> {\n /** Catalog name. */\n readonly name: string\n /** Adds an item to a section after the base. A later registration of the same id replaces an earlier one. */\n register: <K extends keyof S>(section: K, item: S[K], origin: ItemOrigin) => Disposable\n /** Adds a transform. Replays in `order`, then registration order. */\n transform: (registration: TransformRegistration<S, X, C>) => Disposable\n /** Drops the cached base and every memoized value, then notifies. */\n reload: () => void\n /** The replayed value for a context, memoized until the next change. */\n read: (context: C) => CatalogValue<S, X>\n /** Calls `listener` after each change (the next `read` replays). Returns the unsubscribe. */\n subscribe: (listener: () => void) => () => void\n}\n\ninterface Entry<T> extends Provenance { readonly item: T }\n\ninterface Gate { open: boolean, extensionId: string }\n\nconst BUILTIN: ItemOrigin = Object.freeze({ kind: 'builtin' })\n\nfunction withExtension(list: readonly string[], extensionId: string): readonly string[] {\n return list.includes(extensionId) ? list : [...list, extensionId]\n}\n\nfunction provenanceOf<T>(entry: Entry<T>): Provenance {\n const { item: _item, ...rest } = entry\n return rest\n}\n\nclass SectionDraftImpl<T> implements SectionDraft<T> {\n entries = new Map<string, Entry<T>>()\n removed = new Map<string, Provenance>()\n\n constructor(private readonly name: string, private readonly spec: SectionSpec<T, unknown>, private readonly gate: Gate) {}\n\n idOf(item: T): string {\n const id = this.spec.key(item)\n if (typeof id !== 'string' || id.length === 0)\n throw new TypeError(`${this.name}: item needs a non-empty string id`)\n return id\n }\n\n seed(item: T, origin: ItemOrigin): void {\n const id = this.idOf(item)\n const prev = this.entries.get(id)\n this.entries.set(id, { id, item, origin, modifiedBy: [], ...(prev ? { replaced: prev.origin } : {}) })\n }\n\n private check(): void {\n if (!this.gate.open)\n throw new Error(`${this.name}: the editor was used after its transform returned`)\n }\n\n private cloneItem(item: T): T {\n return (this.spec.clone ?? clonePlain)(item)\n }\n\n list = (): readonly T[] => {\n this.check()\n return [...this.entries.values()].map(entry => entry.item)\n }\n\n get = (id: string): T | undefined => {\n this.check()\n return this.entries.get(id)?.item\n }\n\n origin = (id: string): ItemOrigin | undefined => {\n this.check()\n return this.entries.get(id)?.origin\n }\n\n cloneOf = (id: string): T | undefined => {\n this.check()\n const entry = this.entries.get(id)\n return entry ? this.cloneItem(entry.item) : undefined\n }\n\n add = (item: T): void => {\n this.check()\n const id = this.idOf(item)\n const ext = this.gate.extensionId\n const prev = this.entries.get(id) ?? this.removed.get(id)\n this.removed.delete(id)\n if (prev) {\n const { removedBy: _removedBy, ...rest } = provenanceOf(prev as Entry<T>)\n this.entries.set(id, { ...rest, item, modifiedBy: withExtension(prev.modifiedBy, ext) })\n return\n }\n this.entries.set(id, { id, item, origin: { kind: 'extension', id: ext }, addedBy: ext, modifiedBy: [] })\n }\n\n update = (id: string, edit: (item: T) => void): void => {\n this.check()\n const prev = this.entries.get(id)\n if (!prev)\n return\n const copy = this.cloneItem(prev.item)\n edit(copy)\n if (this.idOf(copy) !== id)\n throw new Error(`${this.name}: update must not change the id of \"${id}\"`)\n this.entries.set(id, { ...prev, item: copy, modifiedBy: withExtension(prev.modifiedBy, this.gate.extensionId) })\n }\n\n replace = (item: T): void => {\n this.check()\n const id = this.idOf(item)\n const prev = this.entries.get(id)\n if (!prev) {\n this.add(item)\n return\n }\n this.entries.set(id, { ...prev, item, modifiedBy: withExtension(prev.modifiedBy, this.gate.extensionId) })\n }\n\n remove = (id: string): void => {\n this.check()\n const prev = this.entries.get(id)\n if (!prev)\n return\n this.entries.delete(id)\n this.removed.set(id, { ...provenanceOf(prev), removedBy: this.gate.extensionId })\n }\n\n checkpoint(): () => void {\n const entries = new Map(this.entries)\n const removed = new Map(this.removed)\n return () => {\n this.entries = entries\n this.removed = removed\n }\n }\n\n freeze(): SectionValue<T> {\n const entries = new Map(this.entries)\n const provenance = new Map<string, Provenance>()\n for (const [id, entry] of entries)\n provenance.set(id, Object.freeze(provenanceOf(entry)))\n for (const [id, prov] of this.removed)\n provenance.set(id, Object.freeze(prov))\n return Object.freeze({\n items: Object.freeze([...entries.values()].map(entry => entry.item)),\n get: (id: string) => entries.get(id)?.item,\n origin: (id: string) => entries.get(id)?.origin,\n provenance: (id: string) => provenance.get(id),\n entries: Object.freeze([...provenance.values()]),\n })\n }\n}\n\ninterface StoredRegistration { seq: number, section: PropertyKey, item: unknown, origin: ItemOrigin }\ninterface StoredTransform<S extends Sections, X, C> extends TransformRegistration<S, X, C> { seq: number }\n\n/** Creates a catalog with several sections and optional state. */\nexport function createCatalogSet<S extends Sections, X = undefined, C = void>(spec: CatalogSetSpec<S, X, C>): CatalogSet<S, X, C> {\n const sectionNames = Object.keys(spec.sections) as (keyof S & string)[]\n const registrations: StoredRegistration[] = []\n const transforms: StoredTransform<S, X, C>[] = []\n const baseCache = new Map<string, { [K in keyof S]: readonly Sourced<S[K]>[] }>()\n const valueCache = new Map<string, CatalogValue<S, X>>()\n const listeners = new Set<() => void>()\n const cacheSize = spec.cacheSize ?? 32\n let seq = 0\n\n const notify = (): void => {\n for (const listener of [...listeners]) {\n try {\n listener()\n }\n catch {\n // A host listener must not break other listeners or the registration.\n }\n }\n }\n\n const invalidate = (): void => {\n valueCache.clear()\n notify()\n }\n\n const baseFor = (context: C, key: string | undefined): { [K in keyof S]: readonly Sourced<S[K]>[] } => {\n const hit = key === undefined ? undefined : baseCache.get(key)\n if (hit)\n return hit\n const base = {} as { [K in keyof S]: readonly Sourced<S[K]>[] }\n for (const name of sectionNames)\n base[name] = spec.sections[name].base(context)\n if (key !== undefined)\n baseCache.set(key, base)\n return base\n }\n\n const rank = (extensionId: string): number => {\n const value = spec.order?.(extensionId)\n return typeof value === 'number' && Number.isFinite(value) ? value : Number.MAX_SAFE_INTEGER\n }\n\n const build = (context: C, key: string | undefined): CatalogValue<S, X> => {\n const gate: Gate = { open: false, extensionId: '' }\n const drafts = {} as { [K in keyof S]: SectionDraftImpl<S[K]> }\n const base = baseFor(context, key)\n for (const name of sectionNames) {\n const draft = new SectionDraftImpl<S[typeof name]>(`${spec.name}.${name}`, spec.sections[name] as SectionSpec<S[typeof name], unknown>, gate)\n for (const { item, origin } of base[name])\n draft.seed(item, origin ?? BUILTIN)\n drafts[name] = draft\n }\n for (const reg of registrations)\n (drafts[reg.section as keyof S] as SectionDraftImpl<unknown>).seed(reg.item, reg.origin)\n\n const draft: CatalogDraft<S, X, C> = {\n sections: drafts,\n state: (spec.state ? spec.state.base(context) : undefined) as X,\n context,\n get extensionId() { return gate.extensionId },\n assertOpen: () => {\n if (!gate.open)\n throw new Error(`${spec.name}: the editor was used after its transform returned`)\n },\n }\n\n const failures: TransformFailure[] = []\n const ordered = [...transforms].sort((a, b) => rank(a.extensionId) - rank(b.extensionId) || a.seq - b.seq)\n for (const transform of ordered) {\n const restores = sectionNames.map(name => drafts[name].checkpoint())\n const savedState = spec.state ? spec.state.clone(draft.state) : draft.state\n const label = transform.label ?? `${spec.name}.transform`\n gate.open = true\n gate.extensionId = transform.extensionId\n let ok = false\n try {\n ok = transform.guard.callSync(label, () => {\n transform.apply(draft)\n return true\n }, { fallback: false }) === true\n }\n catch {\n ok = false\n }\n finally {\n gate.open = false\n }\n if (!ok) {\n for (const restore of restores)\n restore()\n draft.state = savedState\n failures.push(Object.freeze({ extensionId: transform.extensionId, label }))\n }\n }\n\n const sections = {} as { [K in keyof S]: SectionValue<S[K]> }\n for (const name of sectionNames)\n sections[name] = drafts[name].freeze()\n return Object.freeze({ sections: Object.freeze(sections), state: draft.state, failures: Object.freeze(failures) })\n }\n\n return {\n name: spec.name,\n register(section, item, origin) {\n if (!sectionNames.includes(section as keyof S & string))\n throw new TypeError(`${spec.name}: unknown section \"${String(section)}\"`)\n const id = spec.sections[section].key(item)\n if (typeof id !== 'string' || id.length === 0)\n throw new TypeError(`${spec.name}.${String(section)}: item needs a non-empty string id`)\n const stored: StoredRegistration = { seq: seq++, section, item, origin }\n registrations.push(stored)\n invalidate()\n return once(() => {\n const index = registrations.indexOf(stored)\n if (index >= 0) {\n registrations.splice(index, 1)\n invalidate()\n }\n })\n },\n transform(registration) {\n if (typeof registration.apply !== 'function')\n throw new TypeError(`${spec.name}: transform must be a function`)\n const stored: StoredTransform<S, X, C> = { ...registration, seq: seq++ }\n transforms.push(stored)\n invalidate()\n return once(() => {\n const index = transforms.indexOf(stored)\n if (index >= 0) {\n transforms.splice(index, 1)\n invalidate()\n }\n })\n },\n reload() {\n baseCache.clear()\n invalidate()\n },\n read(context) {\n const key = spec.contextKey ? spec.contextKey(context) : ''\n if (key !== undefined) {\n const hit = valueCache.get(key)\n if (hit)\n return hit\n }\n const value = build(context, key)\n if (key !== undefined) {\n valueCache.set(key, value)\n if (valueCache.size > cacheSize)\n valueCache.delete(valueCache.keys().next().value as string)\n }\n return value\n },\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n\n/** Spec of a single-section catalog. */\nexport interface CatalogSpec<T> extends CatalogOptions {\n /** Name used in guard labels and errors. Default `'catalog'`. */\n name?: string\n /** The id of an item. */\n key: (item: T) => string\n /** The base items. Plain items are `builtin`; give `Sourced` entries for another origin. */\n base: () => readonly (T | Sourced<T>)[]\n /** Copy used by `update`. Default: {@link clonePlain}. */\n clone?: (item: T) => T\n /** Tells a `Sourced` entry from a plain item. Default: an object with exactly `item` and `origin`. */\n isSourced?: (entry: T | Sourced<T>) => entry is Sourced<T>\n}\n\n/** A single-section catalog. */\nexport interface Catalog<T> {\n /** Adds an item after the base. */\n register: (item: T, origin: ItemOrigin) => Disposable\n /** Adds a transform owned by `extensionId`, run through `guard`. */\n transform: (fn: (editor: SectionDraft<T>) => void, extensionId: string, guard: Guard) => Disposable\n /** Re-reads the base and replays. */\n reload: () => void\n /** The replayed items, memoized until the next change. */\n read: () => readonly T[]\n /** The replayed section, with provenance. */\n value: () => SectionValue<T>\n /** Transforms that threw on the last replay. */\n failures: () => readonly TransformFailure[]\n /** Calls `listener` after each change. */\n subscribe: (listener: () => void) => () => void\n}\n\nfunction defaultIsSourced<T>(entry: T | Sourced<T>): entry is Sourced<T> {\n if (entry === null || typeof entry !== 'object')\n return false\n const keys = Object.keys(entry)\n return keys.length === 2 && keys.includes('item') && keys.includes('origin')\n}\n\n/** Creates a catalog with one keyed collection: the generic transform engine. */\nexport function createCatalog<T>(spec: CatalogSpec<T>): Catalog<T> {\n const isSourced = spec.isSourced ?? defaultIsSourced\n const set = createCatalogSet<{ items: T }, undefined, void>({\n name: spec.name ?? 'catalog',\n order: spec.order,\n cacheSize: spec.cacheSize,\n sections: {\n items: {\n key: spec.key,\n clone: spec.clone,\n base: () => spec.base().map(entry => isSourced(entry) ? entry : { item: entry, origin: BUILTIN }),\n },\n },\n })\n return {\n register: (item, origin) => set.register('items', item, origin),\n transform: (fn, extensionId, guard) => set.transform({ extensionId, guard, apply: draft => fn(draft.sections.items) }),\n reload: set.reload,\n read: () => set.read().sections.items.items,\n value: () => set.read().sections.items,\n failures: () => set.read().failures,\n subscribe: set.subscribe,\n }\n}\n\n/** Wraps a function so it runs at most once: the Disposable contract. */\nexport function once(fn: () => void): Disposable {\n let done = false\n return {\n dispose() {\n if (done)\n return\n done = true\n fn()\n },\n }\n}\n","/**\n * Glue between the shared catalogs and one extension's domain: owner\n * binding, guarded transforms, extension origins.\n */\n\nimport type { Disposable, ItemOrigin, Transform } from '../api'\nimport type { DomainDeps } from '../runtime/deps'\nimport type { CatalogDraft, CatalogSet, Sections } from './engine'\nimport { DisposedError } from '../api'\nimport { once } from './engine'\n\n/** A host port that can re-read external data before a catalog replays. */\nexport interface RefreshablePort {\n /** Re-reads the base (config files, a server list). `reload()` awaits it before replaying. */\n refresh?: () => Promise<void>\n}\n\n/** The origin of items the extension registers. */\nexport function extensionOrigin(deps: DomainDeps): ItemOrigin {\n return { kind: 'extension', id: deps.extensionId }\n}\n\n/**\n * Makes a registration through the extension's owner: refused once the owner\n * is disposed, withdrawn when it is, and withdrawable on its own.\n */\nexport function owned(deps: DomainDeps, what: string, make: () => Disposable): Disposable {\n if (deps.owner.disposed)\n throw new DisposedError(what)\n const inner = make()\n let cleanup: Disposable | undefined\n const handle = once(() => {\n cleanup?.dispose()\n inner.dispose()\n })\n cleanup = deps.owner.onCleanup(() => handle.dispose())\n return handle\n}\n\n/** Registers `fn` as a guarded transform of `set`, with the editor `makeEditor` builds. */\nexport function addTransform<S extends Sections, X, C, E>(\n deps: DomainDeps,\n set: CatalogSet<S, X, C>,\n what: string,\n makeEditor: (draft: CatalogDraft<S, X, C>) => E,\n fn: Transform<E>,\n): Disposable {\n if (typeof fn !== 'function')\n throw new TypeError(`${what}: transform must be a function`)\n return owned(deps, what, () => set.transform({\n extensionId: deps.extensionId,\n guard: deps.guard,\n label: what,\n apply: draft => fn(makeEditor(draft)),\n }))\n}\n\n/** `reload()` of a catalog domain: refresh the port, then drop the cached base. */\nexport function reloadWith(set: { reload: () => void }, port: RefreshablePort): () => Promise<void> {\n return async () => {\n await port.refresh?.()\n set.reload()\n }\n}\n","/**\n * The models catalog: `ctx.models`. Models of the active providers, keyed\n * by provider and model id, plus the default selection. Models are not added\n * here: a provider brings them (see `ctx.providers`).\n */\n\nimport type { Disposable, ItemOrigin, ModelEditor, ModelInfo, ModelsDomain } from '../api'\nimport type { DomainDeps } from '../runtime/deps'\nimport type { RefreshablePort } from './domain'\nimport type { CatalogDraft, CatalogOptions, CatalogValue, Sourced } from './engine'\nimport { addTransform, reloadWith } from './domain'\nimport { createCatalogSet } from './engine'\n\n/** The catalog id of a model: `<providerId>/<modelId>`. */\nexport function modelKey(providerId: string, modelId: string): string {\n return `${providerId}/${modelId}`\n}\n\n/** A model selection. */\nexport interface ModelSelection {\n /** Provider id. */\n readonly providerId: string\n /** Model id. */\n readonly modelId: string\n}\n\n/** Supplies the base models and default. The host connects the active providers (after `providers` transforms). */\nexport interface ModelsCatalogPort extends RefreshablePort {\n /** Models of the active providers. */\n models: () => readonly Sourced<ModelInfo>[]\n /** The configured default selection. */\n default?: () => ModelSelection | undefined\n}\n\n/** Catalog-wide model state. */\nexport interface ModelsState {\n /** The default selection. */\n default?: ModelSelection\n /** The extension whose transform set it. */\n defaultSetBy?: string\n}\n\n/** Section item types of the models catalog. */\nexport interface ModelsSections {\n /** Models, by {@link modelKey}. */\n models: ModelInfo\n}\n\n/** A replayed models value. `state.default` is cleared when its model is gone. */\nexport type ModelsValue = CatalogValue<ModelsSections, ModelsState>\n\n/** The shared models catalog a host builds once. */\nexport interface ModelsCatalog {\n /** The replayed value. */\n read: () => ModelsValue\n /** Adds a model outside the provider base (host use; extensions go through providers). */\n register: (model: ModelInfo, origin: ItemOrigin) => Disposable\n /** Re-reads the base and replays. */\n reload: () => Promise<void>\n /** Calls `listener` after each change. */\n subscribe: (listener: () => void) => () => void\n /**\n * Engine access for the domain factory.\n *\n * @internal\n */\n readonly engine: ReturnType<typeof createModelsEngine>\n}\n\nfunction createModelsEngine(port: ModelsCatalogPort, options: CatalogOptions) {\n return createCatalogSet<ModelsSections, ModelsState, void>({\n ...options,\n name: 'models',\n sections: { models: { key: model => modelKey(model.providerId, model.id), base: () => port.models() } },\n state: {\n base: () => {\n const selection = port.default?.()\n return selection ? { default: { ...selection } } : {}\n },\n clone: state => ({ ...state }),\n },\n })\n}\n\nfunction modelEditor(draft: CatalogDraft<ModelsSections, ModelsState, void>): ModelEditor {\n const models = draft.sections.models\n return {\n list: providerId => providerId === undefined ? models.list() : models.list().filter(model => model.providerId === providerId),\n get: (providerId, modelId) => models.get(modelKey(providerId, modelId)),\n update: (providerId, modelId, edit) => models.update(modelKey(providerId, modelId), edit),\n remove: (providerId, modelId) => models.remove(modelKey(providerId, modelId)),\n default: {\n get: () => {\n draft.assertOpen()\n return draft.state.default ? { ...draft.state.default } : undefined\n },\n set: (providerId, modelId) => {\n draft.assertOpen()\n if (!models.get(modelKey(providerId, modelId)))\n throw new Error(`models.default.set: no model \"${modelKey(providerId, modelId)}\"`)\n draft.state = { default: { providerId, modelId }, defaultSetBy: draft.extensionId }\n },\n },\n }\n}\n\n/** Creates the shared models catalog. */\nexport function createModelsCatalog(port: ModelsCatalogPort, options: CatalogOptions = {}): ModelsCatalog {\n const engine = createModelsEngine(port, options)\n return {\n engine,\n read: () => {\n const value = engine.read()\n const selection = value.state.default\n if (!selection || value.sections.models.get(modelKey(selection.providerId, selection.modelId)))\n return value\n return Object.freeze({ ...value, state: Object.freeze({}) })\n },\n register: (model, origin) => engine.register('models', model, origin),\n reload: reloadWith(engine, port),\n subscribe: engine.subscribe,\n }\n}\n\n/** Creates one extension's `ctx.models` over the shared catalog. */\nexport function createModelsDomain(deps: DomainDeps, catalog: ModelsCatalog): ModelsDomain {\n return {\n transform: fn => addTransform(deps, catalog.engine, 'models.transform', modelEditor, fn),\n reload: catalog.reload,\n list: () => catalog.read().sections.models.items,\n default: () => {\n const selection = catalog.read().state.default\n return selection ? { providerId: selection.providerId, modelId: selection.modelId } : undefined\n },\n }\n}\n","/**\n * The providers catalog: `ctx.providers`. Provider descriptors (active or\n * not) and the models each provider offers, edited together by one\n * {@link ProviderEditor} per transform. Removing a provider removes its\n * models. The host feeds the models of active providers into the models catalog.\n *\n * A provider can also hold a model list per account (`models.set(id, list,\n * { account })`): the list a picker shows for that account. Accounts without\n * one fall back to the provider's own list. Provider transforms read accounts,\n * so hosts re-run them when accounts change ({@link watchProviderAccounts}).\n */\n\nimport type { ProviderDescriptor } from '../../chat/providers'\nimport type { Disposable, ItemOrigin, ModelInfo, ProviderEditor, ProvidersDomain } from '../api'\nimport type { IntegrationRegistry } from '../integrations/registry'\nimport type { DomainDeps } from '../runtime/deps'\nimport type { RefreshablePort } from './domain'\nimport type { CatalogDraft, CatalogOptions, CatalogValue, Sourced } from './engine'\nimport { addTransform, extensionOrigin, owned, reloadWith } from './domain'\nimport { createCatalogSet } from './engine'\nimport { modelKey } from './models'\n\n/** Supplies the base descriptors and their models. The host connects the provider registry. */\nexport interface ProvidersCatalogPort extends RefreshablePort {\n /** Built-in and config provider descriptors. */\n providers: () => readonly Sourced<ProviderDescriptor>[]\n /** Models of those providers. */\n models?: () => readonly Sourced<ModelInfo>[]\n}\n\n/** Section item types of the providers catalog. */\nexport interface ProvidersSections {\n /** Descriptors, by `key`. */\n providers: ProviderDescriptor\n /** Models, by `<providerId>/<modelId>` (see {@link modelKey}). */\n models: ModelInfo\n /** Account-scoped models, by {@link accountModelKey}. */\n accountModels: AccountModelInfo\n}\n\n/** A model of one account's list (`models.set(providerId, list, { account })`). */\nexport interface AccountModelInfo extends ModelInfo {\n /** The account whose list holds it. */\n account: string\n}\n\n/**\n * The catalog id of an account-scoped model: `<providerId>@<account>/<modelId>`.\n *\n * @param providerId - Provider id.\n * @param account - The account the list belongs to.\n * @param modelId - Model id.\n */\nexport function accountModelKey(providerId: string, account: string, modelId: string): string {\n return `${providerId}@${account}/${modelId}`\n}\n\n/** A replayed providers value. */\nexport type ProvidersValue = CatalogValue<ProvidersSections, undefined>\n\n/** The shared providers catalog a host builds once. */\nexport interface ProvidersCatalog {\n /** The replayed value. */\n read: () => ProvidersValue\n /**\n * Models of one provider (or all), after transforms. With `account` (and a\n * provider): that account's own list when it has one, else the provider's.\n */\n models: (providerId?: string, opts?: { account?: string }) => readonly ModelInfo[]\n /** The accounts of a provider that have their own model list, in insertion order. */\n accounts: (providerId: string) => readonly string[]\n /** Adds a descriptor. */\n register: (descriptor: ProviderDescriptor, origin: ItemOrigin) => Disposable\n /** Re-reads the base and replays. */\n reload: () => Promise<void>\n /** Calls `listener` after each change. */\n subscribe: (listener: () => void) => () => void\n /**\n * Engine access for the domain factory.\n *\n * @internal\n */\n readonly engine: ReturnType<typeof createProvidersEngine>\n}\n\nfunction createProvidersEngine(port: ProvidersCatalogPort, options: CatalogOptions) {\n return createCatalogSet<ProvidersSections, undefined, void>({\n ...options,\n name: 'providers',\n sections: {\n providers: { key: descriptor => descriptor.key, base: () => port.providers() },\n models: { key: model => modelKey(model.providerId, model.id), base: () => port.models?.() ?? [] },\n accountModels: { key: model => accountModelKey(model.providerId, model.account, model.id), base: () => [] },\n },\n })\n}\n\nfunction providerEditor(draft: CatalogDraft<ProvidersSections, undefined, void>): ProviderEditor {\n const providers = draft.sections.providers\n const models = draft.sections.models\n const accountModels = draft.sections.accountModels\n const modelsOf = (providerId: string) => models.list().filter(model => model.providerId === providerId)\n const accountModelsOf = (providerId: string, account?: string) => accountModels.list().filter(model => model.providerId === providerId && (account === undefined || model.account === account))\n const checkOwner = (providerId: string, next: readonly ModelInfo[]): void => {\n for (const model of next) {\n if (model.providerId !== providerId)\n throw new Error(`providers.models.set: model \"${model.id}\" belongs to \"${model.providerId}\", not \"${providerId}\"`)\n }\n }\n return {\n list: providers.list,\n get: providers.get,\n origin: providers.origin,\n add: providers.add,\n update: providers.update,\n remove: (id) => {\n providers.remove(id)\n for (const model of modelsOf(id))\n models.remove(modelKey(id, model.id))\n for (const model of accountModelsOf(id))\n accountModels.remove(accountModelKey(id, model.account, model.id))\n },\n models: {\n set: (providerId, next, opts) => {\n checkOwner(providerId, next)\n const wanted = new Set(next.map(model => model.id))\n const account = opts?.account\n if (account !== undefined) {\n if (typeof account !== 'string' || account.length === 0)\n throw new TypeError('providers.models.set: account must be a non-empty string')\n for (const model of accountModelsOf(providerId, account)) {\n if (!wanted.has(model.id))\n accountModels.remove(accountModelKey(providerId, account, model.id))\n }\n for (const model of next)\n accountModels.replace({ ...model, account })\n return\n }\n for (const model of modelsOf(providerId)) {\n if (!wanted.has(model.id))\n models.remove(modelKey(providerId, model.id))\n }\n for (const model of next)\n models.replace(model)\n },\n // An edit by id applies to every list that holds the model: the provider's and each account's.\n update: (providerId, modelId, edit) => {\n models.update(modelKey(providerId, modelId), edit)\n for (const model of accountModelsOf(providerId)) {\n if (model.id === modelId)\n accountModels.update(accountModelKey(providerId, model.account, modelId), edit)\n }\n },\n remove: (providerId, modelId) => {\n models.remove(modelKey(providerId, modelId))\n for (const model of accountModelsOf(providerId)) {\n if (model.id === modelId)\n accountModels.remove(accountModelKey(providerId, model.account, modelId))\n }\n },\n },\n }\n}\n\n/** Creates the shared providers catalog. */\nexport function createProvidersCatalog(port: ProvidersCatalogPort, options: CatalogOptions = {}): ProvidersCatalog {\n const engine = createProvidersEngine(port, options)\n return {\n engine,\n read: () => engine.read(),\n models: (providerId, opts) => {\n const value = engine.read()\n if (providerId === undefined)\n return value.sections.models.items\n const account = opts?.account\n if (account !== undefined) {\n const own = value.sections.accountModels.items.filter(model => model.providerId === providerId && model.account === account)\n if (own.length > 0)\n return own.map(({ account: _account, ...model }) => model)\n }\n return value.sections.models.items.filter(model => model.providerId === providerId)\n },\n accounts: (providerId) => {\n const out = new Set<string>()\n for (const model of engine.read().sections.accountModels.items) {\n if (model.providerId === providerId)\n out.add(model.account)\n }\n return [...out]\n },\n register: (descriptor, origin) => engine.register('providers', descriptor, origin),\n reload: reloadWith(engine, port),\n subscribe: engine.subscribe,\n }\n}\n\n/** Creates one extension's `ctx.providers` over the shared catalog. */\nexport function createProvidersDomain(deps: DomainDeps, catalog: ProvidersCatalog): ProvidersDomain {\n return {\n register(descriptor) {\n if (!descriptor || typeof descriptor.key !== 'string' || descriptor.key.length === 0)\n throw new TypeError('providers.register: descriptor needs a non-empty key')\n if (typeof descriptor.factory !== 'function')\n throw new TypeError(`providers.register: \"${descriptor.key}\" needs a factory`)\n return owned(deps, 'providers.register', () => catalog.register(descriptor, extensionOrigin(deps)))\n },\n transform: fn => addTransform(deps, catalog.engine, 'providers.transform', providerEditor, fn),\n reload: catalog.reload,\n list: () => catalog.read().sections.providers.items,\n }\n}\n\n/** Something that says when provider accounts change. Returns the unsubscribe. */\nexport type AccountChangeSource = (listener: () => void) => () => void\n\n/**\n * Re-runs provider transforms (`catalog.reload()`) when accounts change: any\n * integration connection (connect, disconnect, a new default) and any other\n * source the host passes (its stored provider accounts). Changes in one turn\n * of the event loop reload once. Returns the unsubscribe.\n *\n * @param catalog - The providers catalog.\n * @param integrations - The integration registry, when the host has one.\n * @param sources - Other account change sources (the credentials file).\n */\nexport function watchProviderAccounts(catalog: Pick<ProvidersCatalog, 'reload'>, integrations: Pick<IntegrationRegistry, 'subscribe'> | undefined, sources: readonly AccountChangeSource[] = []): () => void {\n let queued = false\n let stopped = false\n const changed = (): void => {\n if (queued || stopped)\n return\n queued = true\n queueMicrotask(() => {\n queued = false\n if (!stopped)\n void catalog.reload()\n })\n }\n const offs = [...(integrations ? [integrations.subscribe(changed)] : []), ...sources.map(source => source(changed))]\n return () => {\n stopped = true\n for (const off of offs)\n off()\n }\n}\n"],"mappings":";;;;;;;;AAuBA,SAAS,gBAAgB,aAAqB,QAA6D;CACzG,OAAO,OAAO,KAAI,UAChB,MAAM,UAAU,CAAC,MAAM,OAAO,SAAS,SAAS,GAAG,IAC/C;EAAE,GAAG;EAAO,QAAQ;GAAE,GAAG,MAAM;GAAQ,UAAU,GAAG,YAAY,GAAG,MAAM,OAAO;EAAW;CAAE,IAC7F,KAAK;AACb;;;;;;;AAgBA,SAAgB,0BAA0B,OAA4C;CACpF,IAAI,UAAU,KAAA,GACZ,QAAQ,CAAC;CACX,IAAI,OAAO,UAAU,UACnB,MAAM,IAAI,kBAAkB,CAAC;EAAE,MAAM;EAAS,SAAS,qDAAqD,MAAM;CAAK,CAAC,CAAC;CAC3H,IA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