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
|
@@ -2,15 +2,15 @@ import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.js";
|
|
|
2
2
|
import { c as validateQuery, h as parseFieldPath, l as validateSort, p as FACET_KEY, s as validateGroupBy, x as isThinkingLevel } from "./validate-D--OhUFD.js";
|
|
3
3
|
import { s as metadataForExtension } from "./facets-_ZhKMxS8.js";
|
|
4
4
|
import { l as normalizeArtifactInput } from "./artifacts-DPVc-oG0.js";
|
|
5
|
-
import {
|
|
5
|
+
import { i as isSafeRecordKey, n as frozenCopy, r as isJson, t as deepEqual } from "./json-BjClr43H.js";
|
|
6
6
|
import { i as writeJsonFileAtomic, n as writeFileAtomic, t as OWNER_ONLY } from "./atomic-write-BewQOXlD.js";
|
|
7
7
|
import { n as validateToolArgs } from "./validation-Rrpbb2zy.js";
|
|
8
8
|
import { t as isStandardSchema } from "./zod-Bcn20m2L.js";
|
|
9
9
|
import { i as isBadgeColor } from "./row-fields-CAYcZogp.js";
|
|
10
|
-
import { n as satisfiesVersionRange } from "./host-version-
|
|
10
|
+
import { n as satisfiesVersionRange } from "./host-version-BIx4CuBM.js";
|
|
11
11
|
import { C as isExtensionPanelScope, D as normalizePanelLoadContext, E as normalizePanelHomeLayout, F as parseBindingSpec, I as parseBindingSpecs, K as runBadgeAction, M as resolvePanelLoadContext, N as bindingAlternatives, R as badgeMenu, T as normalizePanelContent, i as referenceProviderWires, n as createReferenceResolver, u as validateTemplate, w as isPanelSurface, x as SessionQueryError } from "./references-DZ5qTYDl.js";
|
|
12
|
-
import { basename, dirname, join, resolve } from "node:path";
|
|
13
|
-
import { existsSync, mkdirSync, readFileSync, watch } from "node:fs";
|
|
12
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
13
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, rmdirSync, watch } from "node:fs";
|
|
14
14
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
15
15
|
//#region src/extensions/api/core.ts
|
|
16
16
|
/** Thrown by a ctx call made through a disposed owner. */
|
|
@@ -1775,9 +1775,10 @@ function toWireSettings(extensionId, schema, values = {}, opts = {}) {
|
|
|
1775
1775
|
* @param extensionId - The extension.
|
|
1776
1776
|
* @param displayName - Its display name; blank or absent: the id.
|
|
1777
1777
|
* @param icon - Its icon.
|
|
1778
|
+
* @param description - What it does; blank or absent: none.
|
|
1778
1779
|
* @returns The entry.
|
|
1779
1780
|
*/
|
|
1780
|
-
function wireExtension(extensionId, displayName, icon) {
|
|
1781
|
+
function wireExtension(extensionId, displayName, icon, description) {
|
|
1781
1782
|
const gui = icon?.gui?.trim() ? icon.gui : void 0;
|
|
1782
1783
|
const tui = icon?.tui?.trim() ? icon.tui : void 0;
|
|
1783
1784
|
return {
|
|
@@ -1785,7 +1786,8 @@ function wireExtension(extensionId, displayName, icon) {
|
|
|
1785
1786
|
...gui !== void 0 || tui !== void 0 ? { icon: {
|
|
1786
1787
|
...gui !== void 0 ? { gui } : {},
|
|
1787
1788
|
...tui !== void 0 ? { tui } : {}
|
|
1788
|
-
} } : {}
|
|
1789
|
+
} } : {},
|
|
1790
|
+
...description?.trim() ? { description: description.trim() } : {}
|
|
1789
1791
|
};
|
|
1790
1792
|
}
|
|
1791
1793
|
/**
|
|
@@ -2008,80 +2010,170 @@ function pairOps({ execution, handle }) {
|
|
|
2008
2010
|
fileSize: async (path) => await execution.fileSize?.(handle, path) ?? null
|
|
2009
2011
|
};
|
|
2010
2012
|
}
|
|
2011
|
-
//#endregion
|
|
2012
|
-
//#region src/extensions/runtime/owner.ts
|
|
2013
2013
|
const ON_ERROR = Symbol("owner.onError");
|
|
2014
2014
|
/**
|
|
2015
2015
|
* Makes an owner.
|
|
2016
2016
|
*
|
|
2017
2017
|
* @param parent - The owner this one belongs to. The child is disposed with it, and inherits its `onError`.
|
|
2018
|
-
* @param options - Error handler and
|
|
2018
|
+
* @param options - Error handler, label and drain bound.
|
|
2019
2019
|
* @returns A live owner.
|
|
2020
2020
|
* @throws DisposedError when `parent` is already disposed.
|
|
2021
2021
|
*/
|
|
2022
2022
|
function createOwner(parent, options = {}) {
|
|
2023
2023
|
const label = options.label ?? (parent ? `${parent.label}/scope` : "owner");
|
|
2024
2024
|
const onError = options.onError ?? (parent ? parent[ON_ERROR] : void 0);
|
|
2025
|
+
const drainMs = options.drainMs ?? 18e5;
|
|
2025
2026
|
const controller = new AbortController();
|
|
2026
2027
|
const entries = /* @__PURE__ */ new Set();
|
|
2028
|
+
const teardowns = /* @__PURE__ */ new Set();
|
|
2029
|
+
const leases = /* @__PURE__ */ new Set();
|
|
2027
2030
|
let disposed = false;
|
|
2031
|
+
let torn = false;
|
|
2032
|
+
let draining = false;
|
|
2033
|
+
let drainTimer;
|
|
2028
2034
|
let unlink;
|
|
2035
|
+
let unlinkTeardown;
|
|
2029
2036
|
let resolveSettled;
|
|
2030
2037
|
const settled = new Promise((resolve) => {
|
|
2031
2038
|
resolveSettled = resolve;
|
|
2032
2039
|
});
|
|
2040
|
+
let resolveWithdrawn;
|
|
2041
|
+
const withdrawn = new Promise((resolve) => {
|
|
2042
|
+
resolveWithdrawn = resolve;
|
|
2043
|
+
});
|
|
2033
2044
|
const report = (error, what) => {
|
|
2034
2045
|
try {
|
|
2035
2046
|
onError?.(error, what);
|
|
2036
2047
|
} catch {}
|
|
2037
2048
|
};
|
|
2049
|
+
/** Runs `set`'s cleanups in reverse order; resolves once the async ones settled. */
|
|
2050
|
+
const runAll = (set) => {
|
|
2051
|
+
const pending = [];
|
|
2052
|
+
for (const entry of [...set].reverse()) {
|
|
2053
|
+
set.delete(entry);
|
|
2054
|
+
try {
|
|
2055
|
+
const result = entry.run();
|
|
2056
|
+
if (result && typeof result.then === "function") pending.push(Promise.resolve(result).catch((error) => report(error, `${label} cleanup`)));
|
|
2057
|
+
} catch (error) {
|
|
2058
|
+
report(error, `${label} cleanup`);
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
return Promise.all(pending);
|
|
2062
|
+
};
|
|
2063
|
+
const add = (set, cleanup) => {
|
|
2064
|
+
const entry = { run: cleanup };
|
|
2065
|
+
set.add(entry);
|
|
2066
|
+
return { dispose: () => {
|
|
2067
|
+
set.delete(entry);
|
|
2068
|
+
} };
|
|
2069
|
+
};
|
|
2070
|
+
let withdrawDone = Promise.resolve();
|
|
2071
|
+
const finalize = () => {
|
|
2072
|
+
if (torn) return;
|
|
2073
|
+
torn = true;
|
|
2074
|
+
draining = false;
|
|
2075
|
+
clearTimeout(drainTimer);
|
|
2076
|
+
leases.clear();
|
|
2077
|
+
unlinkTeardown?.();
|
|
2078
|
+
if (!controller.signal.aborted) controller.abort(new DisposedError(label));
|
|
2079
|
+
Promise.all([withdrawDone, runAll(teardowns)]).then(() => resolveSettled());
|
|
2080
|
+
};
|
|
2081
|
+
const activeLabels = () => [...leases].map((l) => l.label);
|
|
2038
2082
|
const self = {
|
|
2039
2083
|
label,
|
|
2040
2084
|
parent,
|
|
2041
2085
|
signal: controller.signal,
|
|
2042
2086
|
settled,
|
|
2087
|
+
withdrawn,
|
|
2043
2088
|
get disposed() {
|
|
2044
2089
|
return disposed;
|
|
2045
2090
|
},
|
|
2091
|
+
get draining() {
|
|
2092
|
+
return draining;
|
|
2093
|
+
},
|
|
2094
|
+
get tornDown() {
|
|
2095
|
+
return torn;
|
|
2096
|
+
},
|
|
2046
2097
|
[ON_ERROR]: onError,
|
|
2047
2098
|
onCleanup(cleanup) {
|
|
2048
2099
|
if (disposed) throw new DisposedError(`${label}.onCleanup`);
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2100
|
+
return add(entries, cleanup);
|
|
2101
|
+
},
|
|
2102
|
+
onTeardown(cleanup) {
|
|
2103
|
+
if (torn) throw new DisposedError(`${label}.onCleanup`);
|
|
2104
|
+
return add(teardowns, cleanup);
|
|
2054
2105
|
},
|
|
2055
2106
|
scope(childLabel) {
|
|
2056
2107
|
if (disposed) throw new DisposedError(`${label}.scope`);
|
|
2057
2108
|
return createOwner(self, childLabel ? { label: childLabel } : {});
|
|
2058
2109
|
},
|
|
2110
|
+
lease(what, opts = {}) {
|
|
2111
|
+
if (disposed) throw new DisposedError(what);
|
|
2112
|
+
const record = {
|
|
2113
|
+
label: what,
|
|
2114
|
+
start: Date.now(),
|
|
2115
|
+
...opts.timeoutMs !== void 0 ? { timeoutMs: opts.timeoutMs } : {}
|
|
2116
|
+
};
|
|
2117
|
+
leases.add(record);
|
|
2118
|
+
return () => {
|
|
2119
|
+
if (!leases.delete(record)) return;
|
|
2120
|
+
if (draining && leases.size === 0) finalize();
|
|
2121
|
+
};
|
|
2122
|
+
},
|
|
2059
2123
|
dispose() {
|
|
2060
2124
|
if (disposed) return;
|
|
2061
2125
|
disposed = true;
|
|
2126
|
+
const parentDrains = parent?.disposed === true && parent.draining;
|
|
2062
2127
|
unlink?.();
|
|
2063
|
-
|
|
2064
|
-
const
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
}
|
|
2128
|
+
if (!parentDrains) unlinkTeardown?.();
|
|
2129
|
+
const defer = leases.size > 0 || parentDrains;
|
|
2130
|
+
if (!defer) controller.abort(new DisposedError(label));
|
|
2131
|
+
draining = defer;
|
|
2132
|
+
withdrawDone = runAll(entries);
|
|
2133
|
+
withdrawDone.then(() => resolveWithdrawn());
|
|
2134
|
+
if (!defer) {
|
|
2135
|
+
finalize();
|
|
2136
|
+
return;
|
|
2073
2137
|
}
|
|
2074
|
-
|
|
2138
|
+
if (leases.size === 0) return;
|
|
2139
|
+
const now = Date.now();
|
|
2140
|
+
const deadline = Math.max(...[...leases].map((l) => l.timeoutMs !== void 0 && Number.isFinite(l.timeoutMs) ? l.start + l.timeoutMs : now + drainMs));
|
|
2141
|
+
const ms = Math.max(0, deadline - now);
|
|
2142
|
+
try {
|
|
2143
|
+
options.onDrain?.({
|
|
2144
|
+
label,
|
|
2145
|
+
active: activeLabels(),
|
|
2146
|
+
ms
|
|
2147
|
+
});
|
|
2148
|
+
} catch {}
|
|
2149
|
+
drainTimer = setTimeout(() => {
|
|
2150
|
+
if (torn) return;
|
|
2151
|
+
try {
|
|
2152
|
+
options.onDrainTimeout?.({
|
|
2153
|
+
label,
|
|
2154
|
+
active: activeLabels(),
|
|
2155
|
+
ms: Date.now() - now
|
|
2156
|
+
});
|
|
2157
|
+
} catch {}
|
|
2158
|
+
finalize();
|
|
2159
|
+
}, ms);
|
|
2160
|
+
drainTimer.unref?.();
|
|
2075
2161
|
},
|
|
2076
2162
|
async disposeAsync() {
|
|
2077
2163
|
self.dispose();
|
|
2078
2164
|
await settled;
|
|
2079
2165
|
}
|
|
2080
2166
|
};
|
|
2081
|
-
if (parent)
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2167
|
+
if (parent) {
|
|
2168
|
+
unlink = parent.onCleanup(() => {
|
|
2169
|
+
self.dispose();
|
|
2170
|
+
return torn ? settled : withdrawn;
|
|
2171
|
+
}).dispose;
|
|
2172
|
+
unlinkTeardown = parent.onTeardown(() => {
|
|
2173
|
+
finalize();
|
|
2174
|
+
return settled;
|
|
2175
|
+
}).dispose;
|
|
2176
|
+
}
|
|
2085
2177
|
return self;
|
|
2086
2178
|
}
|
|
2087
2179
|
/**
|
|
@@ -2123,6 +2215,39 @@ function track(owner, disposable) {
|
|
|
2123
2215
|
function assertAlive(owner, what) {
|
|
2124
2216
|
if (owner.disposed) throw new DisposedError(what);
|
|
2125
2217
|
}
|
|
2218
|
+
/**
|
|
2219
|
+
* Whether `owner`'s domains refuse calls: torn down, or for an owner without
|
|
2220
|
+
* a teardown phase, disposed. A draining owner still serves its in-flight work.
|
|
2221
|
+
*
|
|
2222
|
+
* @param owner - The owner to check.
|
|
2223
|
+
*/
|
|
2224
|
+
function isTornDown(owner) {
|
|
2225
|
+
const tornDown = owner.tornDown;
|
|
2226
|
+
return typeof tornDown === "boolean" ? tornDown : owner.disposed;
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Throws when `owner` is torn down. Domains that in-flight work uses
|
|
2230
|
+
* (storage, sessions, generate, workspace) check this instead of
|
|
2231
|
+
* {@link assertAlive}, so a call that started before dispose finishes.
|
|
2232
|
+
*
|
|
2233
|
+
* @param owner - The owner to check.
|
|
2234
|
+
* @param what - The call being made, for the error message.
|
|
2235
|
+
* @throws DisposedError when `owner` is torn down.
|
|
2236
|
+
*/
|
|
2237
|
+
function assertUsable(owner, what) {
|
|
2238
|
+
if (isTornDown(owner)) throw new DisposedError(what);
|
|
2239
|
+
}
|
|
2240
|
+
/**
|
|
2241
|
+
* Adds `cleanup` to `owner`'s teardown phase (`onCleanup` for an owner
|
|
2242
|
+
* without one): it runs once the in-flight calls ended.
|
|
2243
|
+
*
|
|
2244
|
+
* @param owner - The owner.
|
|
2245
|
+
* @param cleanup - What to run at teardown.
|
|
2246
|
+
*/
|
|
2247
|
+
function onTeardown(owner, cleanup) {
|
|
2248
|
+
const runtime = owner;
|
|
2249
|
+
return typeof runtime.onTeardown === "function" ? runtime.onTeardown(cleanup) : owner.onCleanup(cleanup);
|
|
2250
|
+
}
|
|
2126
2251
|
//#endregion
|
|
2127
2252
|
//#region src/extensions/api/ui.ts
|
|
2128
2253
|
function token(name) {
|
|
@@ -3159,7 +3284,7 @@ function createStorageCache(deps, port, currentSessionId) {
|
|
|
3159
3284
|
domain: "storage"
|
|
3160
3285
|
});
|
|
3161
3286
|
const states = /* @__PURE__ */ new Map();
|
|
3162
|
-
owner
|
|
3287
|
+
onTeardown(owner, () => {
|
|
3163
3288
|
for (const state of states.values()) {
|
|
3164
3289
|
state.subscription?.dispose();
|
|
3165
3290
|
state.kvListeners.clear();
|
|
@@ -3168,7 +3293,7 @@ function createStorageCache(deps, port, currentSessionId) {
|
|
|
3168
3293
|
states.clear();
|
|
3169
3294
|
});
|
|
3170
3295
|
function assertLive(what) {
|
|
3171
|
-
if (owner
|
|
3296
|
+
if (isTornDown(owner)) throw new DisposedError(`storage.${what}`);
|
|
3172
3297
|
}
|
|
3173
3298
|
function resolve(scope, sessionId, what) {
|
|
3174
3299
|
if (scope !== "session") return {
|
|
@@ -3213,7 +3338,7 @@ function createStorageCache(deps, port, currentSessionId) {
|
|
|
3213
3338
|
return state;
|
|
3214
3339
|
}
|
|
3215
3340
|
function onRemote(state, change) {
|
|
3216
|
-
if (owner
|
|
3341
|
+
if (isTornDown(owner) || !isSafeRecordKey(change.key)) return;
|
|
3217
3342
|
if (change.value !== void 0 && !isJson(change.value)) {
|
|
3218
3343
|
logger.warn("storage: ignored a non-JSON remote value", { key: change.key });
|
|
3219
3344
|
return;
|
|
@@ -3238,7 +3363,7 @@ function createStorageCache(deps, port, currentSessionId) {
|
|
|
3238
3363
|
}
|
|
3239
3364
|
async function read(state) {
|
|
3240
3365
|
const snapshot = await port.load(state.loc);
|
|
3241
|
-
if (owner
|
|
3366
|
+
if (isTornDown(owner)) return;
|
|
3242
3367
|
for (const area of ["kv", "stores"]) {
|
|
3243
3368
|
const incoming = snapshot[area] ?? {};
|
|
3244
3369
|
const keys = /* @__PURE__ */ new Set([...state.entries[area].keys(), ...Object.keys(incoming)]);
|
|
@@ -3277,7 +3402,7 @@ function createStorageCache(deps, port, currentSessionId) {
|
|
|
3277
3402
|
if (value === void 0) await port.delete(state.loc, area, key);
|
|
3278
3403
|
else await port.save(state.loc, area, key, value);
|
|
3279
3404
|
} catch (err) {
|
|
3280
|
-
if (!owner
|
|
3405
|
+
if (!isTornDown(owner) && deepEqual(state.entries[area].get(key), value)) apply(state, area, key, previous, true);
|
|
3281
3406
|
throw err;
|
|
3282
3407
|
} finally {
|
|
3283
3408
|
const left = (pending.get(key) ?? 1) - 1;
|
|
@@ -3296,6 +3421,153 @@ function createStorageCache(deps, port, currentSessionId) {
|
|
|
3296
3421
|
};
|
|
3297
3422
|
}
|
|
3298
3423
|
//#endregion
|
|
3424
|
+
//#region src/extensions/storage/paths.ts
|
|
3425
|
+
/** The resolved `target` under `root`, or `root` itself when `..` segments would leave it. */
|
|
3426
|
+
function inside(root, segments) {
|
|
3427
|
+
const target = resolve(root, ...segments);
|
|
3428
|
+
return target === root || target.startsWith(root + sep) ? target : root;
|
|
3429
|
+
}
|
|
3430
|
+
function defaultFolderOf(paths) {
|
|
3431
|
+
return (extensionId, scope) => {
|
|
3432
|
+
const prefix = process.env.ZIDANE_PREFIX ?? ".zidane";
|
|
3433
|
+
const base = scope === "project" && paths.projectRoot ? join(paths.projectRoot, prefix, "extension-storage") : join(paths.dataDir, "extension-storage");
|
|
3434
|
+
return join(base, encodeURIComponent(extensionId));
|
|
3435
|
+
};
|
|
3436
|
+
}
|
|
3437
|
+
/**
|
|
3438
|
+
* The folder `storage.path(scope)` resolves in.
|
|
3439
|
+
*
|
|
3440
|
+
* @param options - The extension and the port's folders.
|
|
3441
|
+
* @param scope - The storage area.
|
|
3442
|
+
*/
|
|
3443
|
+
function storagePathRoot(options, scope) {
|
|
3444
|
+
if (scope === "cache") return resolve(options.paths.cacheDir, "extension-storage", encodeURIComponent(options.extensionId));
|
|
3445
|
+
const folderOf = options.folderOf ?? defaultFolderOf(options.paths);
|
|
3446
|
+
return resolve(folderOf(options.extensionId, scope === "project" || scope === "session" ? "project" : "user"), "files");
|
|
3447
|
+
}
|
|
3448
|
+
/**
|
|
3449
|
+
* Where `storage.path` resolved before it moved to the storage folders:
|
|
3450
|
+
* `<base>/extensions/<id>`, `base` the cache dir, the data dir, the project
|
|
3451
|
+
* root (project, session) or the config dir (user), else the data dir.
|
|
3452
|
+
*
|
|
3453
|
+
* @param paths - The host's paths.
|
|
3454
|
+
* @param extensionId - The extension id.
|
|
3455
|
+
* @param scope - The storage area.
|
|
3456
|
+
* @param segments - Path segments under the folder.
|
|
3457
|
+
*/
|
|
3458
|
+
function legacyStoragePath(paths, extensionId, scope, ...segments) {
|
|
3459
|
+
const base = scope === "cache" ? paths.cacheDir : scope === "data" ? paths.dataDir : scope === "project" || scope === "session" ? paths.projectRoot ?? paths.dataDir : paths.configDir ?? paths.dataDir;
|
|
3460
|
+
return inside(resolve(base, "extensions", extensionId), segments);
|
|
3461
|
+
}
|
|
3462
|
+
/** Files that make a folder an extension's install (or source) folder. */
|
|
3463
|
+
const INSTALL_MARKERS = [
|
|
3464
|
+
"index.ts",
|
|
3465
|
+
"index.tsx",
|
|
3466
|
+
"index.mjs",
|
|
3467
|
+
"index.js",
|
|
3468
|
+
"extension.json",
|
|
3469
|
+
"package.json",
|
|
3470
|
+
".install.json"
|
|
3471
|
+
];
|
|
3472
|
+
/** Entries of an install folder that are the extension, not its data. */
|
|
3473
|
+
const INSTALL_ENTRIES = /* @__PURE__ */ new Set([
|
|
3474
|
+
...INSTALL_MARKERS,
|
|
3475
|
+
"node_modules",
|
|
3476
|
+
"src",
|
|
3477
|
+
"dist",
|
|
3478
|
+
"tsconfig.json",
|
|
3479
|
+
"bun.lock",
|
|
3480
|
+
"bun.lockb",
|
|
3481
|
+
"package-lock.json",
|
|
3482
|
+
"pnpm-lock.yaml",
|
|
3483
|
+
"yarn.lock",
|
|
3484
|
+
"README.md",
|
|
3485
|
+
"LICENSE",
|
|
3486
|
+
"CHANGELOG.md"
|
|
3487
|
+
]);
|
|
3488
|
+
const SOURCE_FILE = /\.(?:[cm]?[jt]sx?|d\.ts)$/;
|
|
3489
|
+
function isInstallFolder(folder, dir) {
|
|
3490
|
+
return dir !== void 0 && resolve(dir) === folder || INSTALL_MARKERS.some((name) => existsSync(join(folder, name)));
|
|
3491
|
+
}
|
|
3492
|
+
function isInstallEntry(name) {
|
|
3493
|
+
return INSTALL_ENTRIES.has(name) || SOURCE_FILE.test(name) || name.startsWith(".");
|
|
3494
|
+
}
|
|
3495
|
+
/** Moves a file or folder, copying when it crosses file systems. */
|
|
3496
|
+
function move(from, to) {
|
|
3497
|
+
mkdirSync(dirname(to), { recursive: true });
|
|
3498
|
+
try {
|
|
3499
|
+
renameSync(from, to);
|
|
3500
|
+
} catch (err) {
|
|
3501
|
+
if (err.code !== "EXDEV") throw err;
|
|
3502
|
+
cpSync(from, to, {
|
|
3503
|
+
recursive: true,
|
|
3504
|
+
errorOnExist: true,
|
|
3505
|
+
force: false
|
|
3506
|
+
});
|
|
3507
|
+
rmSync(from, {
|
|
3508
|
+
recursive: true,
|
|
3509
|
+
force: true
|
|
3510
|
+
});
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
/** Old folders already merged in this process (the ones that hold data only). */
|
|
3514
|
+
const merged = /* @__PURE__ */ new Set();
|
|
3515
|
+
/**
|
|
3516
|
+
* Moves what the old folder of `scope` holds for this call. An install (or
|
|
3517
|
+
* source) folder gives up only the top entry the call names, when it is not
|
|
3518
|
+
* part of the extension and the new folder lacks it; any other old folder
|
|
3519
|
+
* moves whole, entry by entry, keeping what the new folder already has.
|
|
3520
|
+
* Throws when a move fails.
|
|
3521
|
+
*/
|
|
3522
|
+
function migrate(options, scope, root, target) {
|
|
3523
|
+
const legacy = legacyStoragePath(options.paths, options.extensionId, scope);
|
|
3524
|
+
if (legacy === root || !existsSync(legacy)) return;
|
|
3525
|
+
if (isInstallFolder(legacy, options.dir)) {
|
|
3526
|
+
const name = target === root ? void 0 : relative(root, target).split(sep)[0];
|
|
3527
|
+
if (!name || isInstallEntry(name)) return;
|
|
3528
|
+
const from = join(legacy, name);
|
|
3529
|
+
const to = join(root, name);
|
|
3530
|
+
if (!existsSync(to) && existsSync(from)) move(from, to);
|
|
3531
|
+
return;
|
|
3532
|
+
}
|
|
3533
|
+
const key = `${legacy}\u0000${root}`;
|
|
3534
|
+
if (merged.has(key)) return;
|
|
3535
|
+
merged.add(key);
|
|
3536
|
+
for (const name of readdirSync(legacy)) {
|
|
3537
|
+
const to = join(root, name);
|
|
3538
|
+
if (!existsSync(to)) move(join(legacy, name), to);
|
|
3539
|
+
}
|
|
3540
|
+
try {
|
|
3541
|
+
rmdirSync(legacy);
|
|
3542
|
+
} catch {}
|
|
3543
|
+
}
|
|
3544
|
+
/**
|
|
3545
|
+
* `storage.path(scope, ...segments)`: a path in the extension's folder for
|
|
3546
|
+
* `scope` ({@link storagePathRoot}); `..` cannot leave it. Files an earlier
|
|
3547
|
+
* build left in the old folder are moved first. When that fails, the old
|
|
3548
|
+
* path is returned while the file is only there, so no data goes missing.
|
|
3549
|
+
*
|
|
3550
|
+
* @param options - The extension, the port's folders, its own folder and a logger.
|
|
3551
|
+
* @param scope - The storage area.
|
|
3552
|
+
* @param segments - Path segments under the folder.
|
|
3553
|
+
*/
|
|
3554
|
+
function resolveStoragePath(options, scope, ...segments) {
|
|
3555
|
+
const root = storagePathRoot(options, scope);
|
|
3556
|
+
const target = inside(root, segments);
|
|
3557
|
+
if (scope === "cache") return target;
|
|
3558
|
+
try {
|
|
3559
|
+
migrate(options, scope, root, target);
|
|
3560
|
+
} catch (err) {
|
|
3561
|
+
options.logger?.warn("storage.path: could not move files from the old folder", {
|
|
3562
|
+
scope,
|
|
3563
|
+
error: String(err)
|
|
3564
|
+
});
|
|
3565
|
+
const old = legacyStoragePath(options.paths, options.extensionId, scope, ...segments);
|
|
3566
|
+
if (!existsSync(target) && existsSync(old)) return old;
|
|
3567
|
+
}
|
|
3568
|
+
return target;
|
|
3569
|
+
}
|
|
3570
|
+
//#endregion
|
|
3299
3571
|
//#region src/extensions/rpc/json-schema.ts
|
|
3300
3572
|
function isRecord(value) {
|
|
3301
3573
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
@@ -3854,7 +4126,7 @@ function createStorageDomain(deps, port, options) {
|
|
|
3854
4126
|
const cache = createStorageCache(deps, port, options.currentSessionId);
|
|
3855
4127
|
const stores = /* @__PURE__ */ new Map();
|
|
3856
4128
|
const specs = /* @__PURE__ */ new Map();
|
|
3857
|
-
deps.owner
|
|
4129
|
+
onTeardown(deps.owner, () => {
|
|
3858
4130
|
stores.clear();
|
|
3859
4131
|
specs.clear();
|
|
3860
4132
|
});
|
|
@@ -3916,7 +4188,13 @@ function createStorageDomain(deps, port, options) {
|
|
|
3916
4188
|
if (typeof key !== "string" || key.length === 0) throw new TypeError("storage.memory: key must be a non-empty string");
|
|
3917
4189
|
return options.memory.getOrInit(deps.extensionId, key, init);
|
|
3918
4190
|
},
|
|
3919
|
-
path: (scope, ...segments) =>
|
|
4191
|
+
path: (scope, ...segments) => resolveStoragePath({
|
|
4192
|
+
paths: options.paths,
|
|
4193
|
+
extensionId: deps.extensionId,
|
|
4194
|
+
...port.folderOf ? { folderOf: port.folderOf } : {},
|
|
4195
|
+
...options.dir !== void 0 ? { dir: options.dir } : {},
|
|
4196
|
+
logger: deps.logger
|
|
4197
|
+
}, scope, ...segments)
|
|
3920
4198
|
},
|
|
3921
4199
|
preload: (scope, sessionId) => {
|
|
3922
4200
|
cache.assertLive("preload");
|
|
@@ -4085,6 +4363,10 @@ function createFileStoragePort(options) {
|
|
|
4085
4363
|
}
|
|
4086
4364
|
return {
|
|
4087
4365
|
fileOf,
|
|
4366
|
+
folderOf: (extensionId, scope) => dirname(fileOf({
|
|
4367
|
+
extensionId,
|
|
4368
|
+
scope
|
|
4369
|
+
})),
|
|
4088
4370
|
load: async (loc) => {
|
|
4089
4371
|
const entry = entryOf(loc);
|
|
4090
4372
|
const next = readSnapshot(entry.path);
|
|
@@ -4145,7 +4427,10 @@ var storage_exports = /* @__PURE__ */ __exportAll({
|
|
|
4145
4427
|
deepEqual: () => deepEqual,
|
|
4146
4428
|
frozenCopy: () => frozenCopy,
|
|
4147
4429
|
isJson: () => isJson,
|
|
4430
|
+
legacyStoragePath: () => legacyStoragePath,
|
|
4148
4431
|
locationKey: () => locationKey,
|
|
4432
|
+
resolveStoragePath: () => resolveStoragePath,
|
|
4433
|
+
storagePathRoot: () => storagePathRoot,
|
|
4149
4434
|
validateStoreValue: () => validateStoreValue
|
|
4150
4435
|
});
|
|
4151
4436
|
//#endregion
|
|
@@ -4415,7 +4700,7 @@ function extensionSettingsWire(r, ui, opts = {}) {
|
|
|
4415
4700
|
...paged,
|
|
4416
4701
|
extensions: {
|
|
4417
4702
|
...paged.extensions,
|
|
4418
|
-
[r.id]: wireExtension(r.id, r.info.displayName, icon)
|
|
4703
|
+
[r.id]: wireExtension(r.id, r.info.displayName, icon, r.definition?.description)
|
|
4419
4704
|
}
|
|
4420
4705
|
};
|
|
4421
4706
|
}
|
|
@@ -5030,6 +5315,6 @@ function createUiRegistry(options = {}) {
|
|
|
5030
5315
|
};
|
|
5031
5316
|
}
|
|
5032
5317
|
//#endregion
|
|
5033
|
-
export {
|
|
5318
|
+
export { SidebarFilter as $, FACET_COMPUTE_TIMEOUT_MS as A, formatBindingForDisplay as At, wireWithSettingsPages as B, looksLikeDefinition as Bt, createFileStoragePort as C, normalizeChords as Ct, errorMessage as D, KEYBINDING_DEF_BY_ACTION as Dt, checkSchema as E, KEYBINDING_DEFS as Et, MAX_SLOT_BADGES as F, normalizeBindingValue as Ft, Menu as G, isSettingsIcon as Gt, ContextSection as H, actionScope as Ht, UI_TOKEN_NAMES as I, readKeybindings as It, Reference as J, settingDefault as Jt, NoUiError as K, isValueSetting as Kt, checkSettingsValues as L, readKeybindingsRaw as Lt, MAX_FACET_BYTES as M, keybindingsPath as Mt, SESSION_FACET_TRIGGERS as N, matchesBinding as Nt, isPlainRecord as O, KEYBINDING_KEY_COL_WIDTH as Ot, createFacetRegistry as P, mergeKeybindings as Pt, SidebarDecoration as Q, cleanSettingsSchema as R, resolveExtensionKeybindings as Rt, createMemoryRegistry as S, createKeymap as St, validateStoreValue as T, DEFAULT_KEYBINDINGS as Tt, DialogTimeoutError as U, checkSettingValue as Ut, BadgeAction as V, validateDefinition as Vt, LinkHandler as W, isSettingKey as Wt, Screen as X, settingsForDefinition as Xt, Renderer as Y, settingScopes as Yt, SettingsPage as Z, DisposedError as Zt, createMemorySettingsPort as _, toWireSettings as _t, systemClock as a, ThemeToken as at, createScriptedDialogPort as b, builtinKeymapEntries as bt, extensionSettingsWire as c, assertUsable as ct, touchesSettingsPages as d, track as dt, SidebarGroup as et, EMPTY_MCP_PORT as f, createArtifactsSurface as ft, NO_UI_CLIENT_PORT as g, toWireActionStatus as gt, NO_INTEGRATION_FLOWS as h, mergeWireSettings as ht, onPanelChanged as i, Space as it, MAX_FACETS_PER_EXTENSION as j, groupBindings as jt, resolveStoragePath as k, ensureKeybindingsFile as kt, onSettingsPagesChanged as l, createOwner as lt, NO_CLIENT_DIALOG_PORT as m, createWorkspaceSurface as mt, MAX_SIDEBAR_ROWS as n, SidebarSort as nt, LINK_SOURCES as o, Webview as ot, MEMORY_CLIENT_ID as p, createExtensionHostRuntimeBridge as pt, Panel as q, normalizeSettingValue as qt, createUiRegistry as r, Slot as rt, MAX_LINK_URL_LENGTH as s, assertAlive as st, MAX_COMPOSER_BADGES as t, SidebarRow as tt, runtimeSettingsWire as u, isTornDown as ut, createMemoryStoragePort as v, toWireValue as vt, createStorageDomain as w, resolveMod as wt, storage_exports as x, chordKey as xt, createRecordingUiClientPort as y, withSettingsPages as yt, settingsWire as z, stripJsonComments as zt };
|
|
5034
5319
|
|
|
5035
|
-
//# sourceMappingURL=registry-
|
|
5320
|
+
//# sourceMappingURL=registry-CnnKaY9s.js.map
|