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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts-DLZTSRHU.js","names":[],"sources":["../src/contexts/entries.ts","../src/contexts/process-background.ts","../src/contexts/process-exec.ts","../src/contexts/git-ls-files-local.ts","../src/contexts/glob.ts","../src/contexts/process-files.ts","../src/contexts/process-shell.ts","../src/contexts/process-stream.ts","../src/contexts/process-tasks.ts","../src/contexts/process.ts"],"sourcesContent":["/**\n * The two ways to run an `EntryPort` (`./types`): node's fs (the process\n * context, a desktop app's local folders, a machine serving its host) and\n * POSIX commands through a context's `exec` (docker, e2b, daytona, a machine\n * too old to answer the `fs.*` entry calls). `entryPortOf` picks the\n * context's own port, else the commands. The rules every action follows\n * (names, conflicts, folders made in between) are not here: they are\n * `createEntryOps` (`chat/workspace/entries.ts`), written once over a port.\n */\nimport type { EntryKind, EntryPort, ExecutionContext, ExecutionHandle } from './types'\nimport { Buffer } from 'node:buffer'\nimport { cp, lstat, mkdir, readdir, rename, rm, writeFile } from 'node:fs/promises'\nimport { join, relative } from 'node:path'\n\n/** Folders an empty-folder scan never walks into (what a code browser never lists). */\nconst SKIPPED_DIRS = new Set(['.git', 'node_modules'])\n\n/** POSIX single quotes. */\nfunction q(value: string): string {\n return `'${value.replace(/'/g, `'\\\\''`)}'`\n}\n\nconst isMissing = (error: unknown): boolean => (error as NodeJS.ErrnoException)?.code === 'ENOENT'\n\n/** Options of {@link nodeEntryPort}. */\nexport interface NodeEntryPortOptions {\n /** A path as the caller names it → the absolute path to act on; throws when it is out of bounds. */\n resolve: (path: string) => Promise<string>\n /** Same, for the entry itself, its own link never followed (stat, move, remove, a target to create). Default: `resolve`. */\n entry?: (path: string) => Promise<string>\n /** Throws when the caller may not change `absolute` (a sandbox's writable roots). Default: anything goes. */\n writable?: (absolute: string, path: string) => Promise<void>\n /** Removes `absolute` recoverably (the system trash). Default: removed for good. */\n trash?: (absolute: string) => Promise<void>\n}\n\n/**\n * An {@link EntryPort} on this machine's filesystem.\n *\n * @param options - How paths resolve, what may change, and where removed entries go.\n */\nexport function nodeEntryPort(options: NodeEntryPortOptions): EntryPort {\n const { resolve: at, entry = at, writable = async () => {}, trash } = options\n const changing = async (path: string): Promise<string> => {\n const absolute = await entry(path)\n await writable(absolute, path)\n return absolute\n }\n const absent = async (absolute: string): Promise<void> => {\n if (await lstat(absolute).then(() => true, error => (isMissing(error) ? false : Promise.reject(error))))\n throw Object.assign(new Error(`${absolute} already exists.`), { code: 'EEXIST' })\n }\n return {\n async stat(path) {\n try {\n return (await lstat(await entry(path))).isDirectory() ? 'dir' : 'file'\n }\n catch (error) {\n if (isMissing(error))\n return null\n throw error\n }\n },\n list: async path => readdir(await at(path)),\n async mkdir(path) {\n await mkdir(await changing(path), { recursive: true })\n },\n async write(path, bytes) {\n // `wx`: a file that appeared since the check is refused, not replaced.\n await writeFile(await changing(path), bytes, { flag: 'wx' })\n },\n async move(from, to) {\n const source = await changing(from)\n const target = await changing(to)\n await absent(target)\n try {\n await rename(source, target)\n }\n catch (error) {\n // Another volume under the same root (a mount): copy, then remove.\n if ((error as NodeJS.ErrnoException).code !== 'EXDEV')\n throw error\n await cp(source, target, { recursive: true, errorOnExist: true, force: false, verbatimSymlinks: true })\n await rm(source, { recursive: true })\n }\n },\n async copy(from, to) {\n const source = await at(from)\n const target = await changing(to)\n await absent(target)\n await cp(source, target, { recursive: true, errorOnExist: true, force: false, verbatimSymlinks: true })\n },\n async remove(path) {\n const absolute = await changing(path)\n if (trash)\n await trash(absolute)\n else\n await rm(absolute, { recursive: true })\n },\n async emptyDirs(path, limit) {\n const root = await at(path)\n const found: string[] = []\n const walk = async (dir: string): Promise<void> => {\n if (found.length >= limit)\n return\n const entries = await readdir(dir, { withFileTypes: true }).catch(() => null)\n if (!entries)\n return\n if (entries.length === 0 && dir !== root) {\n found.push(relative(root, dir))\n return\n }\n for (const entry of entries) {\n if (entry.isDirectory() && !SKIPPED_DIRS.has(entry.name))\n await walk(join(dir, entry.name))\n }\n }\n await walk(root)\n return found\n },\n }\n}\n\n/**\n * An {@link EntryPort} over a context's `exec` (POSIX `sh`), its files written with the context's `writeFile`.\n *\n * @param context - The context: its commands and its file write.\n * @param handle - The handle to run them in.\n */\nexport function execEntryPort(context: Pick<ExecutionContext, 'exec' | 'writeFile'>, handle: ExecutionHandle): EntryPort {\n const run = async (command: string): Promise<string> => {\n const result = await context.exec(handle, command, { timeout: 120 })\n if (result.exitCode !== 0)\n throw new Error(result.stderr.trim() || `\\`${command}\\` exited with ${result.exitCode}.`)\n return result.stdout\n }\n // Refuses a target that exists (a link included) before acting: `mv` and `cp` would replace or nest into it.\n const absent = (path: string): string => `if [ -e ${q(path)} ] || [ -L ${q(path)} ]; then printf '%s already exists.\\\\n' ${q(path)} >&2; exit 17; fi`\n return {\n async stat(path) {\n const out = await run(`if [ -L ${q(path)} ] || [ -f ${q(path)} ]; then echo file; elif [ -d ${q(path)} ]; then echo dir; elif [ -e ${q(path)} ]; then echo file; else echo none; fi`)\n const kind = out.trim()\n return kind === 'none' ? null : kind as EntryKind\n },\n async list(path) {\n // A glob loop, not `ls`: names with spaces or newlines survive, NUL-separated.\n const out = await run(`cd ${q(path)} && for f in * .[!.]* ..?*; do if [ -e \"$f\" ] || [ -L \"$f\" ]; then printf '%s\\\\0' \"$f\"; fi; done`)\n return out.split('\\0').filter(Boolean)\n },\n async mkdir(path) {\n await run(`mkdir -p -- ${q(path)}`)\n },\n async write(path, bytes) {\n await run(absent(path))\n await context.writeFile(handle, path, Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength))\n },\n async move(from, to) {\n await run(`${absent(to)}; mv -- ${q(from)} ${q(to)}`)\n },\n async copy(from, to) {\n await run(`${absent(to)}; cp -RP -- ${q(from)} ${q(to)}`)\n },\n async remove(path) {\n await run(`rm -rf -- ${q(path)}`)\n },\n async emptyDirs(path, limit) {\n const out = await run(`cd ${q(path)} && find . \\\\( -name .git -o -name node_modules \\\\) -prune -o -type d -empty -print | head -n ${Math.max(0, Math.floor(limit))}`)\n return out.split('\\n').map(line => line.replace(/^\\.\\//, '')).filter(line => line && line !== '.')\n },\n }\n}\n\n/**\n * The context's own entry port for `handle`, else one over its commands.\n *\n * @param context - The execution context.\n * @param handle - The handle the operations run in.\n */\nexport function entryPortOf(context: ExecutionContext, handle: ExecutionHandle): EntryPort {\n const own = context.entries?.(handle)\n if (own)\n return own\n if (!context.capabilities.shell)\n throw new Error(`The ${context.type} context can't create, move or remove files.`)\n return execEntryPort(context, handle)\n}\n","/**\n * `execBackground` (background task spawn + settle) of the in-process\n * execution context. Internal module.\n */\n\nimport type { Buffer } from 'node:buffer'\nimport type { WriteStream } from 'node:fs'\nimport type { ProcessShell } from './process-shell'\nimport type { ProcessContextState, TaskState } from './process-state'\nimport type { BackgroundTerminalOptions, ExecutionContext, ExecutionHandle, TaskExitInfo, TaskHandle, TaskStallInfo } from './types'\nimport { constants, createWriteStream, openSync } from 'node:fs'\nimport { mkdir } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport { hasLocalPty } from './local-terminal'\nimport { assertSafeTaskId, EXIT_PIPE_DRAIN_GRACE_MS, loadSpawn, stateToTaskExitInfo, SUPPORTS_PROCESS_GROUPS, TERMINAL_TASK_ENV } from './process-state'\n\nconst NO_FOLLOW = constants.O_NOFOLLOW ?? 0\n\n/**\n * Finished tasks a context keeps for `listBackground` / `waitBackground` /\n * `killBackground` (and `wait_task`'s \"no such task\" check): past this, the\n * oldest finished go first. Running tasks are never dropped.\n */\nexport const MAX_FINISHED_TASKS = 256\n\n/**\n * Tasks whose exit callbacks already ran. `settled` flips before the output\n * stream flushes, so it alone would let a task be dropped while its waiters\n * are still to be told.\n */\nconst exitNotified = new WeakSet<TaskState>()\n\n/**\n * After a task's exit callbacks fired (once, never again): let go of the\n * owner's closures (its hook bus), and drop the oldest finished tasks past\n * {@link MAX_FINISHED_TASKS}. `tasks` is in finish order (`settle`\n * re-inserts), running tasks still in spawn order among them.\n */\nfunction releaseFinishedTask(tasks: Map<string, TaskState>, settled: TaskState): void {\n settled.onExit = undefined\n settled.onStall = undefined\n exitNotified.add(settled)\n let finished = 0\n for (const state of tasks.values()) {\n if (exitNotified.has(state))\n finished++\n }\n for (const [taskId, state] of tasks) {\n if (finished <= MAX_FINISHED_TASKS)\n break\n if (!exitNotified.has(state))\n continue\n tasks.delete(taskId)\n finished--\n }\n}\n\n/**\n * The log's fd: a new file (exclusive), never through a symlink planted at\n * its path. A name collision keeps the old append behavior on the existing\n * regular file (still not following a link), as the comment at the call says.\n */\nfunction openTaskLog(path: string): number {\n const write = constants.O_WRONLY | constants.O_APPEND | NO_FOLLOW\n try {\n return openSync(path, write | constants.O_CREAT | constants.O_EXCL, 0o600)\n }\n catch (err) {\n if ((err as NodeJS.ErrnoException).code !== 'EEXIST')\n throw err\n return openSync(path, write)\n }\n}\n\n/**\n * Same pipe-hostage hazard as foreground `exec`: a grandchild that inherited\n * the pipes blocks `close` forever, leaving the task `running` (and any\n * waiter parked) long after the command exited. Settle after a short drain\n * grace. Not armed once `close` already settled the task; `settle` clears it\n * when `close` comes first.\n */\nfunction settleAfterExitGrace(child: NonNullable<TaskState['child']>, state: TaskState, settleNow: () => void): NodeJS.Timeout | undefined {\n if (state.settled)\n return undefined\n const timer = setTimeout(() => {\n if (state.settled)\n return\n child.stdout?.destroy()\n child.stderr?.destroy()\n settleNow()\n }, EXIT_PIPE_DRAIN_GRACE_MS)\n timer.unref?.()\n return timer\n}\n\nexport function processBackgroundMethods(s: ProcessContextState, sh: ProcessShell): Required<Pick<ExecutionContext, 'execBackground'>> {\n const { baseEnv, defaultEnv, tasks, contextTimestamp, registerExitHandler, trackSession } = s\n const { shellCommand, isolationBlocker, spawnTerminalTask } = sh\n\n return {\n async execBackground(\n handle: ExecutionHandle,\n command: string,\n options: {\n cwd?: string\n env?: Record<string, string>\n outputDir: string\n onExit?: (info: TaskExitInfo) => void\n maxOutputBytes?: number\n stallTimeoutMs?: number\n onStall?: (info: TaskStallInfo) => void\n terminal?: BackgroundTerminalOptions\n },\n ): Promise<TaskHandle> {\n const cwd = options.cwd ? resolve(handle.cwd, options.cwd) : handle.cwd\n\n // Resolve the subprocess primitive up front (see `loadSpawn`) so a runtime\n // without `node:child_process` fails BEFORE we allocate the log dir +\n // output stream — no orphaned fd / log file on an unsupported host.\n const spawnChild = await loadSpawn()\n const blocked = isolationBlocker()\n if (blocked)\n throw new Error(blocked.stderr)\n\n await mkdir(options.outputDir, { recursive: true })\n\n // Mint id + path. The id is sequential per context (model-facing,\n // short, ergonomic for `shell_kill`). The log FILENAME embeds the\n // context's start timestamp so two contexts sharing an `outputDir`\n // (TUI restart on the same session, concurrent zidane instances,\n // …) never resolve to the same file — we open with `flags: 'a'`\n // and a name collision would interleave their output. Path\n // validation is defensive — we mint our own ids so it never trips\n // today, but it pins the invariant for forks / third parties.\n const taskId = `bash_${++s.taskCounter}`\n assertSafeTaskId(taskId)\n const outputPath = resolve(options.outputDir, `${taskId}.${contextTimestamp}.log`)\n\n // Install the orphan reaper on first task. See `exitHandler`'s\n // JSDoc for the kill-on-shutdown rationale.\n registerExitHandler()\n\n // Open the output file. The timestamped path is unique per context\n // so a brand-new file is the expected outcome; `flags: 'a'` is kept\n // as the safe default (preserves bytes if the path collides for any\n // reason — same-millisecond context creation, manual pre-population,\n // etc.) rather than blindly truncating. Streams are opened BEFORE\n // the spawn to avoid a race where the child writes before the stream\n // is ready — `child_process` buffers stdio until the consumer\n // attaches, but the FS handle has to exist either way for our pipe.\n const outputStream: WriteStream = createWriteStream(outputPath, { fd: openTaskLog(outputPath) })\n // Surface FS errors (ENOSPC, EACCES on a remounted FS, etc.)\n // under ZIDANE_DEBUG instead of crashing the host via an\n // unhandled 'error' event. Without a listener Node escalates\n // any stream-level error to an uncaughtException and the whole\n // process exits — the model and the user would lose every\n // unrelated in-flight piece of work to one bad task's disk\n // hiccup. Swallow + log is the safer default for a fire-and-\n // forget log writer; the task's exit code still reports.\n outputStream.on('error', (err) => {\n if (process.env.ZIDANE_DEBUG)\n process.stderr.write(`[zidane/contexts] task ${taskId} log stream error: ${err.message}\\n`)\n })\n\n // Spawn as a NEW process group leader so we can kill the whole\n // subtree on demand. Same primitive `exec` uses for foreground\n // shells — see the long comment in that method for the\n // process-group rationale.\n const shell = shellCommand(command)\n // Terminal mode: same registry, a PTY instead of pipes. The log gets\n // plain text (control sequences stripped, redraws collapsed); the raw\n // bytes go to whoever shows the terminal.\n const tty = options.terminal && hasLocalPty() ? options.terminal : undefined\n const child = tty\n ? spawnTerminalTask([shell.file, ...shell.args], cwd, { ...TERMINAL_TASK_ENV, ...options.env }, tty)\n : spawnChild(shell.file, shell.args, {\n cwd,\n env: { ...baseEnv, ...defaultEnv, ...options.env },\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SUPPORTS_PROCESS_GROUPS,\n })\n\n const state: TaskState = {\n taskId,\n handleId: handle.id,\n pid: child.pid ?? -1,\n command,\n cwd,\n startedAt: Date.now(),\n outputPath,\n outputStream,\n child,\n status: 'running',\n bytesWritten: 0,\n settled: false,\n onExit: options.onExit,\n onStall: options.onStall,\n exitWatchers: [],\n }\n tasks.set(taskId, state)\n const untrack = trackSession(child.pid)\n\n // Output cap (optional). Beyond the cap the process keeps\n // running — head-priority retention: bytes already on disk stay,\n // subsequent bytes are counted but dropped, and a structured\n // truncation marker is appended at settle so the model can\n // pattern-match the loss. Killing on overflow (what the\n // foreground `exec` does) would be wrong here: long-running\n // servers legitimately log forever.\n const maxOutputBytes = typeof options.maxOutputBytes === 'number' && options.maxOutputBytes > 0\n ? options.maxOutputBytes\n : undefined\n let droppedBytes = 0\n // Latched on the first overflowing chunk. Without it, a codepoint-\n // boundary backoff (below) leaves a few bytes of \"room\" that later\n // chunks would dribble into — appending disjoint fragments from\n // much-later output right after the cut point.\n let capExhausted = false\n\n // Stall watchdog (optional). One-shot per quiet period: fires\n // `onStall` after `stallTimeoutMs` of no output, then stays quiet\n // until fresh output re-arms it. `unref()` so a pending timer\n // never holds the host process open.\n const stallTimeoutMs = typeof options.stallTimeoutMs === 'number' && options.stallTimeoutMs > 0\n ? options.stallTimeoutMs\n : undefined\n let stallTimer: NodeJS.Timeout | undefined\n let lastOutputAt = Date.now()\n const armStallTimer = (): void => {\n // Read through `state` (not a captured option) so a rebind via\n // `reassignBackgroundTasks` redirects later stalls too.\n if (!stallTimeoutMs || !state.onStall)\n return\n if (stallTimer)\n clearTimeout(stallTimer)\n stallTimer = setTimeout(() => {\n stallTimer = undefined\n if (state.settled)\n return\n try {\n state.onStall?.({\n taskId,\n command,\n outputPath,\n stalledForMs: Date.now() - lastOutputAt,\n bytesWritten: state.bytesWritten,\n })\n }\n catch (err) {\n if (process.env.ZIDANE_DEBUG)\n process.stderr.write(`[zidane/contexts] task ${taskId} onStall threw: ${err instanceof Error ? err.message : String(err)}\\n`)\n }\n }, stallTimeoutMs)\n stallTimer.unref?.()\n }\n const clearStallTimer = (): void => {\n if (stallTimer) {\n clearTimeout(stallTimer)\n stallTimer = undefined\n }\n }\n armStallTimer()\n\n // Pipe both streams into the same file. Order between stdout and\n // stderr is preserved per-stream; cross-stream ordering depends on\n // Node's event loop — acceptable interleaving for log-shaped\n // output. Tracked-bytes is updated on every chunk for the\n // listBackground UX (counted even past the cap, so the UX shows\n // the task's TRUE output volume).\n const appendChunk = (chunk: Buffer): void => {\n state.bytesWritten += chunk.length\n lastOutputAt = Date.now()\n armStallTimer()\n if (maxOutputBytes !== undefined) {\n const onDisk = state.bytesWritten - droppedBytes - chunk.length\n if (capExhausted || onDisk >= maxOutputBytes) {\n capExhausted = true\n droppedBytes += chunk.length\n return\n }\n const room = maxOutputBytes - onDisk\n if (chunk.length > room) {\n capExhausted = true\n // Cut on a UTF-8 codepoint boundary, same as the foreground\n // exec cap: back off while the byte after the cut is a\n // continuation byte (0b10xxxxxx) so the log never ends in a\n // mangled half-codepoint right before the truncation marker.\n let end = room\n while (end > 0 && (chunk[end] & 0xC0) === 0x80)\n end--\n droppedBytes += chunk.length - end\n if (end > 0)\n outputStream.write(chunk.subarray(0, end))\n return\n }\n }\n outputStream.write(chunk)\n }\n child.stdout?.on('data', chunk => appendChunk(chunk as Buffer))\n child.stderr?.on('data', chunk => appendChunk(chunk as Buffer))\n\n // Settle path — at-most-once via `settled` flag (checklist #14).\n // Three trigger sources: `close` (natural OR signal-killed),\n // `error` (spawn failure), explicit `killBackground` (which\n // routes through `close` itself after the SIGTERM lands).\n let exitGraceTimer: NodeJS.Timeout | undefined\n const settle = (cause: 'close' | 'error', code: number | null, signal: NodeJS.Signals | null, errMessage?: string): void => {\n if (state.settled)\n return\n state.settled = true\n // Move to the end: eviction drops the oldest FINISHED, so a long task\n // that started first must not go the moment it ends.\n if (tasks.get(taskId) === state) {\n tasks.delete(taskId)\n tasks.set(taskId, state)\n }\n untrack()\n clearStallTimer()\n clearTimeout(exitGraceTimer)\n state.endedAt = Date.now()\n\n // Determine final status from cause + signal.\n const status: TaskExitInfo['status']\n = signal === 'SIGTERM' || state.killRequested\n ? 'killed'\n : 'exited'\n // Signal-killed children report null `code` from Node; map back\n // to the POSIX `128 + signum` convention so consumers can read\n // an integer either way.\n const exitCode = code !== null\n ? code\n : signal === 'SIGTERM'\n ? 143\n : signal\n ? 128\n : 1\n state.status = status\n state.exitCode = exitCode\n if (signal)\n state.signal = signal\n\n // Flush + close the WriteStream BEFORE firing onExit — model\n // may read the file in the same turn it receives the\n // notification, and a still-open stream can hold tail bytes\n // back from disk. `stream.end(callback)` is the documented\n // \"all queued writes are flushed when this fires\" idiom.\n //\n // ORDER MATTERS: any error preamble we want in the log file\n // (spawn failures with no stdout, buffer overflows) MUST be\n // written BEFORE `end()` — once `end()` is called the stream\n // is closed for writing and subsequent `.write()` calls are\n // dropped, which would silently lose ENOENT-on-`/bin/sh` messages.\n if (errMessage) {\n try {\n outputStream.write(`\\n${errMessage}\\n`)\n }\n catch {\n // Stream may have errored before this — best-effort only.\n }\n }\n if (droppedBytes > 0) {\n try {\n // Structured + loud — the model can pattern-match the tag\n // rather than misread a truncated log as the full output.\n outputStream.write(`\\n<output-truncated bytes-dropped=\"${droppedBytes}\"/>\\n`)\n }\n catch {\n // Best-effort only, same as the error preamble above.\n }\n }\n outputStream.end(() => {\n // `stateToTaskExitInfo` reads the same fields we just set\n // on `state`, so the snapshot the consumer gets matches the\n // post-settle state exactly. `onExit` is optional — pull-based\n // consumers reconcile via `listBackground` instead. The owner's\n // callback fires first, then every kill/wait/destroy watcher.\n const info = stateToTaskExitInfo(state)\n for (const callback of [state.onExit, ...state.exitWatchers.splice(0)]) {\n try {\n callback?.(info)\n }\n catch (err) {\n // Defensive — a buggy onExit callback shouldn't crash the\n // host. Surface via stderr under ZIDANE_DEBUG; otherwise\n // swallow. Matches the spawn-tool's bubbleError pattern.\n if (process.env.ZIDANE_DEBUG)\n process.stderr.write(`[zidane/contexts] task ${taskId} onExit threw: ${err instanceof Error ? err.message : String(err)}\\n`)\n }\n }\n releaseFinishedTask(tasks, state)\n })\n // Release the process + stream references at settle: entries\n // outlive their processes in the registry (until explicit\n // `destroy`), and a session that backgrounds many tasks would\n // otherwise retain every dead ChildProcess and ended\n // WriteStream — plus the closures they anchor — for its whole\n // lifetime. Everything the post-exit readers (`listBackground` /\n // `waitBackground` / `killBackground`) project stays on `state`.\n state.child = undefined\n state.outputStream = undefined\n }\n\n child.on('close', (code, signal) => settle('close', code, signal))\n child.on('error', err => settle('error', null, null, `[spawn error] ${err.message}`))\n\n child.on('exit', (code, signal) => {\n exitGraceTimer = settleAfterExitGrace(child, state, () => settle('close', code, signal))\n })\n\n return { taskId, pid: state.pid, outputPath, ...(tty ? { terminal: true } : {}) }\n },\n }\n}\n","/**\n * Foreground `exec` of the in-process execution context. Internal module.\n */\n\nimport type { ChildProcess } from 'node:child_process'\nimport type { CappedSlot } from './output-cap'\nimport type { ProcessShell } from './process-shell'\nimport type { ProcessContextState } from './process-state'\nimport type { ExecOptions, ExecResult, ExecutionContext, ExecutionHandle } from './types'\nimport { Buffer } from 'node:buffer'\nimport { resolve } from 'node:path'\nimport { annotateDenial } from './isolation'\nimport { appendCapped, DEFAULT_MAX_OUTPUT_BUFFER, outputExceededMessage } from './output-cap'\nimport { EXEC_KILL_ESCALATION_GRACE_MS, EXIT_PIPE_DRAIN_GRACE_MS, killProcessGroup, loadSpawn, SUPPORTS_PROCESS_GROUPS } from './process-state'\n\n/** What a running command reports, wired before it starts. */\ninterface ChildHandlers {\n data: (stream: 'stdout' | 'stderr', chunk: Buffer) => void\n /** It could not start (ENOENT on the shell, EACCES, …). */\n error: (err: Error) => void\n /** It exited; its pipes may still be open. */\n exit: (code: number | null, signal: NodeJS.Signals | null) => void\n /** It exited and its pipes closed. */\n close: (code: number | null, signal: NodeJS.Signals | null) => void\n}\n\n/** A started command: signal its group, stop reading its pipes. */\ninterface ExecChild {\n pid: number | undefined\n kill: (signal: NodeJS.Signals) => void\n releasePipes: () => void\n}\n\ninterface ChildSpec {\n file: string\n args: string[]\n cwd: string\n env: NodeJS.ProcessEnv\n}\n\n/** `node:child_process`, off Bun. */\nfunction startNodeChild(spawnChild: Awaited<ReturnType<typeof loadSpawn>>, spec: ChildSpec, on: ChildHandlers): ExecChild {\n const child: ChildProcess = spawnChild(spec.file, spec.args, {\n cwd: spec.cwd,\n env: spec.env,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SUPPORTS_PROCESS_GROUPS,\n })\n child.stdout?.on('data', chunk => on.data('stdout', chunk as Buffer))\n child.stderr?.on('data', chunk => on.data('stderr', chunk as Buffer))\n child.on('error', on.error)\n child.on('close', on.close)\n child.on('exit', on.exit)\n return {\n pid: child.pid,\n kill: signal => killProcessGroup(child, signal),\n releasePipes: () => {\n child.stdout?.destroy()\n child.stderr?.destroy()\n },\n }\n}\n\n/**\n * `Bun.spawn`, under Bun (as `src/tui/bash-runner.ts` and `./run-bounded`):\n * Bun's `node:child_process` runs the exit callback synchronously when the\n * child is already gone by the time it watches it (a slow spawn on a loaded\n * or cold machine), so 'exit', every 'data' and 'close' fire inside\n * `spawn()`, before any listener exists, and the command only ends at its\n * timeout. `Bun.spawn`'s pipes and `exited` promise keep what happened\n * until they are read.\n */\nfunction startBunChild(spec: ChildSpec, on: ChildHandlers): ExecChild | null {\n let proc: ReturnType<typeof Bun.spawn<'ignore', 'pipe', 'pipe'>>\n try {\n proc = Bun.spawn([spec.file, ...spec.args], {\n cwd: spec.cwd,\n env: spec.env,\n stdio: ['ignore', 'pipe', 'pipe'],\n detached: SUPPORTS_PROCESS_GROUPS,\n })\n }\n catch (err) {\n on.error(err instanceof Error ? err : new Error(String(err)))\n return null\n }\n const readers = [proc.stdout.getReader(), proc.stderr.getReader()] as const\n const drain = async (reader: ReadableStreamDefaultReader<Uint8Array>, stream: 'stdout' | 'stderr'): Promise<void> => {\n try {\n for (;;) {\n const { done, value } = await reader.read()\n if (done)\n return\n on.data(stream, Buffer.from(value))\n }\n }\n catch {\n // Released, or the pipe broke (the group was killed): what was read is kept.\n }\n }\n const drained = Promise.all([drain(readers[0], 'stdout'), drain(readers[1], 'stderr')])\n void proc.exited.then(() => {\n on.exit(proc.exitCode, proc.signalCode)\n void drained.then(() => on.close(proc.exitCode, proc.signalCode))\n })\n return {\n pid: proc.pid,\n kill: signal => killProcessGroup(proc, signal),\n releasePipes: () => {\n for (const reader of readers)\n reader.cancel().catch(() => undefined)\n },\n }\n}\n\nexport function processExecMethods(s: ProcessContextState, sh: ProcessShell): Required<Pick<ExecutionContext, 'exec'>> {\n const { config, baseEnv, defaultEnv, isolation, trackSession } = s\n const { shellCommand, isolationBlocker } = sh\n\n return {\n async exec(\n handle: ExecutionHandle,\n command: string,\n options?: ExecOptions,\n ): Promise<ExecResult> {\n const cwd = options?.cwd ? resolve(handle.cwd, options.cwd) : handle.cwd\n\n // Pre-aborted fast path: skip the spawn entirely and synthesize a\n // killed-by-signal result. Saves a spawn round-trip + dodges Node\n // emitting an immediate `AbortError`.\n if (options?.signal?.aborted) {\n return { stdout: '', stderr: 'aborted by signal before spawn', exitCode: 143 }\n }\n\n const blocked = isolationBlocker()\n if (blocked)\n return blocked\n\n const timeoutMs = (options?.timeout ?? config?.limits?.timeout ?? 30) * 1000\n const maxBuffer = DEFAULT_MAX_OUTPUT_BUFFER\n\n // Off Bun, the lazy `node:child_process` load (see `loadSpawn`), awaited\n // before the Promise executor so it is ready synchronously inside it.\n // Under Bun, `startBunChild` uses `Bun.spawn` instead.\n const spawnChild = typeof Bun === 'undefined' ? await loadSpawn() : null\n\n return new Promise<ExecResult>((resolveP) => {\n // Spawn as a NEW process group leader so we can kill the whole\n // subtree on abort. Without `detached: true`, sending SIGTERM to\n // the shell's pid only kills the shell wrapper — its child\n // processes (the actual `sleep`, `npm`, `python`, …) get\n // reparented to init and keep running. `process.kill(-pid, …)`\n // with a NEGATIVE pid targets the whole process group; that's\n // the POSIX idiom for \"shut down everything I started\".\n //\n // On Windows there are no process groups in the POSIX sense, so\n // we leave `detached` off and accept the shell-only kill — the\n // platform's job-object machinery is the path forward there if\n // we ever need it, but it's not the bug zidane's users are\n // hitting today.\n const shell = shellCommand(command)\n let child: ExecChild | null = null\n let untrack = (): void => {}\n\n // Byte-capped accumulation via the shared exec-transport primitive\n // (see contexts/output-cap.ts) — byte accounting + codepoint-safe\n // cuts. Overflow orchestration (kill the process group, matching\n // `execAsync`'s maxBuffer behavior) stays here.\n const stdoutSlot: CappedSlot = { text: '', bytes: 0 }\n const stderrSlot: CappedSlot = { text: '', bytes: 0 }\n let bufferTruncated = false\n let timedOut = false\n let killedByAbort = false\n let settled = false\n\n // Every exec-initiated kill escalates: SIGTERM now, SIGKILL after a\n // short grace unless the child settled in between. Without this, a\n // TERM-ignoring child leaves the promise pending forever.\n const killWithEscalation = (): void => {\n child?.kill('SIGTERM')\n const escalation = setTimeout(() => {\n if (!settled)\n child?.kill('SIGKILL')\n }, EXEC_KILL_ESCALATION_GRACE_MS)\n escalation.unref?.()\n }\n\n const onChunk = (slot: CappedSlot, chunk: Buffer): void => {\n const outcome = appendCapped(slot, chunk, maxBuffer)\n if (outcome !== 'ok' && !bufferTruncated) {\n bufferTruncated = true\n killWithEscalation()\n }\n }\n\n const timeoutTimer = timeoutMs > 0\n ? setTimeout(() => {\n timedOut = true\n killWithEscalation()\n }, timeoutMs)\n : undefined\n\n const onAbort = (): void => {\n killedByAbort = true\n killWithEscalation()\n }\n const userSignal = options?.signal\n if (userSignal)\n userSignal.addEventListener('abort', onAbort, { once: true })\n\n let exitGraceTimer: NodeJS.Timeout | undefined\n\n const settle = (exitCode: number, extraStderr?: string): void => {\n if (settled)\n return\n settled = true\n untrack()\n if (timeoutTimer)\n clearTimeout(timeoutTimer)\n if (exitGraceTimer)\n clearTimeout(exitGraceTimer)\n if (userSignal)\n userSignal.removeEventListener('abort', onAbort)\n const finalStderr = extraStderr\n ? (stderrSlot.text ? `${stderrSlot.text}\\n${extraStderr}` : extraStderr)\n : stderrSlot.text\n const result: ExecResult = { stdout: stdoutSlot.text, stderr: finalStderr, exitCode }\n // Name the sandbox when a failure looks like a kernel denial so the\n // model asks the user to widen the policy instead of guessing.\n resolveP(isolation ? annotateDenial(result, isolation) : result)\n }\n\n // Shared classification ladder for `close` (fast path: pipes\n // drained normally) and the post-`exit` grace (pipes held open\n // by a daemonized grandchild). Order matters: killed-by-our-\n // abort wins over timeout wins over natural exit, because the\n // abort listener fires first when the user cancels mid-\n // timeout-window.\n const settleFromStatus = (code: number | null, signal: NodeJS.Signals | null): void => {\n if (killedByAbort) {\n settle(143, 'aborted by signal')\n return\n }\n if (timedOut) {\n settle(124, `command timed out after ${timeoutMs}ms`)\n return\n }\n if (bufferTruncated) {\n settle(143, outputExceededMessage(maxBuffer, 'process killed'))\n return\n }\n if (signal) {\n // Killed by some other signal we didn't issue. Treat as\n // signal-killed for consumer compat.\n settle(128 + 15, `terminated by signal ${signal}`)\n return\n }\n settle(typeof code === 'number' ? code : 1)\n }\n\n // Live output for `onOutput`: one streaming decoder per stream, so a\n // codepoint split across chunks decodes whole.\n const listen = options?.onOutput\n const decoders = listen ? { stdout: new TextDecoder(), stderr: new TextDecoder() } : undefined\n const handlers: ChildHandlers = {\n data: (stream, chunk) => {\n onChunk(stream === 'stdout' ? stdoutSlot : stderrSlot, chunk)\n if (!listen || !decoders || settled)\n return\n const text = decoders[stream].decode(chunk, { stream: true })\n if (!text)\n return\n try {\n listen(stream, text)\n }\n catch {\n // A listener's failure is not the command's.\n }\n },\n // Spawn failure (ENOENT on `/bin/sh`, EACCES, …). Mirror\n // `execAsync`'s \"rejects with an Error\" shape by surfacing\n // the message on stderr and a non-zero exit.\n error: err => settle(1, err.message),\n close: (code, signal) => settleFromStatus(code, signal),\n exit: (code, signal) => {\n // The command is DONE here: `close` only adds \"every stdio\n // pipe closed\", which a daemonized grandchild can block\n // forever (see EXIT_PIPE_DRAIN_GRACE_MS). Give the pipes a\n // short drain grace, then settle with what we have and\n // release them. The daemon keeps running: that was the\n // command's intent, so killing the group here would be wrong.\n exitGraceTimer = setTimeout(() => {\n if (settled)\n return\n child?.releasePipes()\n settleFromStatus(code, signal)\n }, EXIT_PIPE_DRAIN_GRACE_MS)\n exitGraceTimer.unref?.()\n },\n }\n const spec: ChildSpec = { file: shell.file, args: shell.args, cwd, env: { ...baseEnv, ...defaultEnv, ...options?.env } }\n child = spawnChild ? startNodeChild(spawnChild, spec, handlers) : startBunChild(spec, handlers)\n if (!settled)\n untrack = trackSession(child?.pid)\n })\n },\n }\n}\n","/**\n * Node-spawn `git ls-files` runner used by the local process context's glob.\n *\n * Kept separate from `./git-ls-files` (which stays node-free for edge bundles)\n * because this leg imports `node:child_process`.\n */\n\nimport { spawn } from 'node:child_process'\nimport { GIT_LS_FILES_ARGS, parseGitLsFiles } from './git-ls-files'\n\n/**\n * Run `git ls-files` in `cwd` and return its non-ignored paths (relative to\n * `cwd`). Returns `null` when the directory is not a git repo, git is missing,\n * or the call aborts — callers treat `null` as \"fall back to a filesystem\n * walk\". Never throws.\n */\nexport async function gitListFilesLocal(cwd: string, signal?: AbortSignal): Promise<string[] | null> {\n return new Promise<string[] | null>((resolveP) => {\n let child: ReturnType<typeof spawn>\n try {\n child = spawn('git', [...GIT_LS_FILES_ARGS], { cwd, stdio: ['ignore', 'pipe', 'pipe'] })\n }\n catch {\n resolveP(null)\n return\n }\n if (signal?.aborted) {\n child.kill('SIGTERM')\n resolveP(null)\n return\n }\n const stdoutChunks: string[] = []\n const onAbort = () => child.kill('SIGTERM')\n signal?.addEventListener('abort', onAbort, { once: true })\n child.stdout?.setEncoding('utf8')\n child.stdout?.on('data', chunk => stdoutChunks.push(chunk as string))\n child.on('error', () => {\n signal?.removeEventListener('abort', onAbort)\n resolveP(null)\n })\n child.on('close', (code) => {\n signal?.removeEventListener('abort', onAbort)\n if (code !== 0 || signal?.aborted) {\n resolveP(null)\n return\n }\n resolveP(parseGitLsFiles(stdoutChunks.join('')))\n })\n })\n}\n","import type { ListFileMetadata } from './types'\nimport { readdir, stat } from 'node:fs/promises'\nimport { dirname, resolve, sep } from 'node:path'\nimport { lazyAsync } from '../lazy'\nimport { gitListFilesLocal } from './git-ls-files-local'\n\ntype NodeGlob = (pattern: string, options: { cwd: string }) => AsyncIterable<string>\n\ninterface BunGlobInstance { scan: (options: { cwd: string, onlyFiles?: boolean, dot?: boolean }) => AsyncIterable<string> }\ntype BunGlobCtor = new (pattern: string) => BunGlobInstance\n\nconst loadNativeNodeGlob = lazyAsync(async (): Promise<NodeGlob | undefined> => {\n const candidate = (await import('node:fs/promises') as { glob?: unknown }).glob\n return typeof candidate === 'function' ? candidate as NodeGlob : undefined\n})\n\nfunction forcePortable(): boolean {\n return (globalThis as { __zidaneForcePortableGlobForTests?: boolean }).__zidaneForcePortableGlobForTests === true\n}\n\nasync function loadNodeGlob(): Promise<NodeGlob | undefined> {\n if (forcePortable())\n return undefined\n return loadNativeNodeGlob()\n}\n\n/**\n * Bun's `node:fs/promises.glob` buffers the entire directory walk before\n * yielding (so an early `limit` break never fires — a broad `**` pattern over\n * a large `node_modules` hangs). `Bun.Glob().scan()` streams incrementally and\n * is the fast path under Bun. Returns undefined off Bun or when tests force the\n * portable walker.\n */\nfunction loadBunGlob(): BunGlobCtor | undefined {\n if (forcePortable())\n return undefined\n const bun = (globalThis as { Bun?: { Glob?: unknown } }).Bun\n return bun && typeof bun.Glob === 'function' ? bun.Glob as BunGlobCtor : undefined\n}\n\nfunction escapeRegexChar(char: string): string {\n return /[\\\\^$.*+?()[\\]{}|]/.test(char) ? `\\\\${char}` : char\n}\n\n/** Expand the first `{a,b}` group of a glob pattern into one pattern per alternative, recursively. Returns the pattern unchanged when it has no group with a comma. */\nexport function expandBraces(pattern: string): string[] {\n const start = pattern.indexOf('{')\n if (start === -1)\n return [pattern]\n const end = pattern.indexOf('}', start + 1)\n if (end === -1)\n return [pattern]\n const body = pattern.slice(start + 1, end)\n if (!body || !body.includes(','))\n return [pattern]\n return body\n .split(',')\n .flatMap(part => expandBraces(`${pattern.slice(0, start)}${part}${pattern.slice(end + 1)}`))\n}\n\n/** Convert a glob pattern without braces into an anchored `RegExp`. `*` and `?` stay inside one path segment, `**` crosses segments, and `[!x]` negates a class. */\nexport function globPatternToRegex(pattern: string): RegExp {\n let out = '^'\n for (let i = 0; i < pattern.length; i++) {\n const char = pattern[i]\n const next = pattern[i + 1]\n if (char === '*') {\n if (next === '*') {\n const after = pattern[i + 2]\n if (after === '/') {\n out += '(?:[^/]+/)*'\n i += 2\n }\n else {\n out += '.*'\n i += 1\n }\n }\n else {\n out += '[^/]*'\n }\n }\n else if (char === '?') {\n out += '[^/]'\n }\n else if (char === '[') {\n const end = pattern.indexOf(']', i + 1)\n if (end === -1) {\n out += '\\\\['\n }\n else {\n let cls = pattern.slice(i + 1, end)\n if (cls.startsWith('!'))\n cls = `^${cls.slice(1)}`\n out += `[${cls}]`\n i = end\n }\n }\n else {\n out += escapeRegexChar(char)\n }\n }\n return new RegExp(`${out}$`)\n}\n\nexport function globLiteralPrefix(pattern: string): string {\n const firstMeta = pattern.search(/[*?[\\]{}]/)\n const prefix = firstMeta === -1 ? dirname(pattern) : pattern.slice(0, firstMeta)\n const slash = prefix.lastIndexOf('/')\n if (slash === -1)\n return ''\n return prefix.slice(0, slash)\n}\n\n/**\n * True when a pattern can match files outside `cwd` — an absolute path, a\n * Windows drive, or any `..` segment. Such patterns can't use the `git\n * ls-files` path (git only knows files under the repo) and fall back to the\n * filesystem walk.\n */\nfunction patternEscapesCwd(pattern: string): boolean {\n const norm = pattern.split(sep).join('/')\n if (norm.startsWith('/') || /^[a-z]:/i.test(norm))\n return true\n return norm.split('/').includes('..')\n}\n\nasync function addMetadata(cwd: string, rel: string, includeMetadata: boolean): Promise<ListFileMetadata | null> {\n try {\n const s = await stat(resolve(cwd, rel))\n if (!s.isFile())\n return null\n return includeMetadata ? { path: rel, size: s.size, mtimeMs: s.mtimeMs } : { path: rel }\n }\n catch {\n return null\n }\n}\n\nfunction compilePattern(pattern: string): RegExp[] {\n return expandBraces(pattern.split(sep).join('/')).map(globPatternToRegex)\n}\n\n/** Match the (already non-ignored) `git ls-files` set against the glob pattern. */\nasync function matchGitFiles(\n gitFiles: readonly string[],\n pattern: string,\n cwd: string,\n limit: number,\n includeMetadata: boolean,\n signal: AbortSignal | undefined,\n): Promise<ListFileMetadata[]> {\n const regexes = compilePattern(pattern)\n const out: ListFileMetadata[] = []\n for (const rel of gitFiles) {\n if (signal?.aborted || out.length >= limit)\n break\n if (!regexes.some(regex => regex.test(rel)))\n continue\n out.push(includeMetadata ? await addMetadata(cwd, rel, true) ?? { path: rel } : { path: rel })\n }\n return out.sort((a, b) => a.path.localeCompare(b.path))\n}\n\n/** Depth-first walk that matches against `regexes` and stops at `limit`. */\nasync function walkMatch(\n root: string,\n prefix: string,\n regexes: RegExp[],\n cwd: string,\n limit: number,\n includeMetadata: boolean,\n signal: AbortSignal | undefined,\n out: ListFileMetadata[],\n): Promise<void> {\n if (out.length >= limit || signal?.aborted)\n return\n let entries: Array<{ name: string, isDirectory: () => boolean, isFile: () => boolean }>\n try {\n entries = await readdir(resolve(root, prefix), { encoding: 'utf8', withFileTypes: true })\n }\n catch {\n return\n }\n for (const entry of entries) {\n if (out.length >= limit || signal?.aborted)\n return\n const rel = prefix ? `${prefix}/${entry.name}` : entry.name\n if (entry.isDirectory()) {\n await walkMatch(root, rel, regexes, cwd, limit, includeMetadata, signal, out)\n }\n else if (entry.isFile() && regexes.some(regex => regex.test(rel))) {\n out.push(includeMetadata ? await addMetadata(cwd, rel, true) ?? { path: rel } : { path: rel })\n }\n }\n}\n\nasync function globPortable(\n pattern: string,\n cwd: string,\n limit: number,\n includeMetadata: boolean,\n signal: AbortSignal | undefined,\n): Promise<ListFileMetadata[]> {\n const normalized = pattern.split(sep).join('/')\n const startPrefix = globLiteralPrefix(normalized)\n const regexes = expandBraces(normalized).map(globPatternToRegex)\n const out: ListFileMetadata[] = []\n await walkMatch(cwd, startPrefix, regexes, cwd, limit, includeMetadata, signal, out)\n return out.sort((a, b) => a.path.localeCompare(b.path))\n}\n\nasync function collectFromIterable(\n iter: AsyncIterable<string>,\n cwd: string,\n limit: number,\n includeMetadata: boolean,\n signal: AbortSignal | undefined,\n): Promise<ListFileMetadata[] | null> {\n const results: ListFileMetadata[] = []\n // A native scan can throw mid-iteration on a pathological tree (e.g. a\n // recursive symlink cycle → ENAMETOOLONG) and there's no way to resume it.\n // Signal the caller (null) to recover via the portable walk, which recurses\n // only into real directories and isolates per-directory errors.\n try {\n for await (const rel of iter) {\n if (signal?.aborted)\n break\n const entry = await addMetadata(cwd, rel, includeMetadata)\n if (!entry)\n continue\n results.push(entry)\n if (results.length >= limit)\n break\n }\n }\n catch {\n return null\n }\n return results.sort((a, b) => a.path.localeCompare(b.path))\n}\n\nfunction globViaBun(\n BunGlob: BunGlobCtor,\n pattern: string,\n cwd: string,\n limit: number,\n includeMetadata: boolean,\n signal: AbortSignal | undefined,\n): Promise<ListFileMetadata[] | null> {\n // `dot: true` keeps dotfile matching consistent with the Node + portable\n // paths; `onlyFiles: true` mirrors their file-only results.\n const scan = new BunGlob(pattern).scan({ cwd, onlyFiles: true, dot: true })\n return collectFromIterable(scan, cwd, limit, includeMetadata, signal)\n}\n\n/**\n * Match files under `cwd` against a glob pattern. Uses `git ls-files` unless\n * `options.gitignore` is `false`, the pattern escapes `cwd` or `cwd` is not a\n * git repo, and falls back to a filesystem scan otherwise. Returns\n * cwd-relative paths sorted by path, at most `options.limit`, with size and\n * mtime when `options.metadata` is set.\n */\nexport async function globFilesLocal(\n pattern: string,\n cwd: string,\n options: { limit: number, metadata?: boolean, gitignore?: boolean, signal?: AbortSignal },\n): Promise<ListFileMetadata[]> {\n const includeMetadata = options.metadata === true\n const { limit, signal } = options\n\n // Default path: intersect the pattern with git's non-ignored file set. Git\n // skips `.gitignore`d trees (`node_modules`, build dirs) entirely, so this is\n // both correct and fast — and never triggers the Bun `fs.glob` hang. The\n // test-only force-portable flag also bypasses it so the filesystem walker\n // stays directly exercisable.\n if (options.gitignore !== false && !forcePortable() && !patternEscapesCwd(pattern)) {\n const gitFiles = await gitListFilesLocal(cwd, signal)\n if (gitFiles)\n return matchGitFiles(gitFiles, pattern, cwd, limit, includeMetadata, signal)\n }\n\n // Fallback path: filesystem glob (gitignore disabled, not a git repo, or the\n // pattern escapes cwd). Prefer a fast native scanner; if it throws on a\n // pathological tree (null), recover via the portable walk.\n const bunGlob = loadBunGlob()\n if (bunGlob) {\n const viaBun = await globViaBun(bunGlob, pattern, cwd, limit, includeMetadata, signal)\n if (viaBun)\n return viaBun\n }\n else {\n const nodeGlob = await loadNodeGlob()\n if (nodeGlob) {\n const viaNode = await collectFromIterable(nodeGlob(pattern, { cwd }), cwd, limit, includeMetadata, signal)\n if (viaNode)\n return viaNode\n }\n }\n\n return globPortable(pattern, cwd, limit, includeMetadata, signal)\n}\n\n// `globFilesViaShell` moved to `./glob-shell` (node-free) so remote-only\n// contexts can import it without pulling this module's `node:fs` imports.\n// Re-exported here for back-compat.\nexport { globFilesViaShell } from './glob-shell'\n","/**\n * File methods (with workspace containment + sandbox write policy) of the\n * in-process execution context. Internal module.\n */\n\nimport type { Buffer } from 'node:buffer'\nimport type { ProcessContextState } from './process-state'\nimport type { ExecutionContext, ExecutionHandle, ListFilesEntry } from './types'\nimport { mkdir, readdir, readFile, realpath, stat, writeFile } from 'node:fs/promises'\nimport { basename, dirname, join, relative, resolve } from 'node:path'\nimport { nodeEntryPort } from './entries'\nimport { globFilesLocal, globLiteralPrefix } from './glob'\nimport { isWithinRoot } from './isolation'\n\nexport function processFileMethods(s: ProcessContextState): Required<Pick<ExecutionContext, 'readFile' | 'fileSize' | 'readFileBinary' | 'writeFile' | 'listFiles' | 'entries'>> {\n const { workspaceRoot, isolation } = s\n\n /**\n * Resolve `path` against the handle cwd and, when a `workspaceRoot` is\n * configured, reject anything that escapes it. Uses `realpath` on the\n * nearest existing ancestor so symlink escapes (and `..`) are caught for\n * both existing and not-yet-created targets.\n */\n async function resolveContained(handle: ExecutionHandle, path: string): Promise<string> {\n const full = resolve(handle.cwd, path)\n if (workspaceRoot === undefined)\n return full\n\n const canonical = await canonicalizeForCheck(full)\n const canonicalRoot = await realpath(workspaceRoot).catch(() => workspaceRoot)\n if (!isWithinRoot(canonicalRoot, canonical)) {\n throw new Error(\n `Path escapes the workspace root: ${path} (resolved outside ${canonicalRoot})`,\n )\n }\n return full\n }\n\n /**\n * `resolveContained` for the entry itself: its parent folder real-pathed,\n * its own name kept, so a link pointing out can still be renamed or removed.\n */\n async function resolveContainedEntry(handle: ExecutionHandle, path: string): Promise<string> {\n const full = resolve(handle.cwd, path)\n if (workspaceRoot === undefined)\n return full\n const canonical = await canonicalizeEntry(full)\n const canonicalRoot = await realpath(workspaceRoot).catch(() => workspaceRoot)\n // The root itself is in, however its own path is spelled (a parent that real-paths elsewhere).\n if (full !== resolve(workspaceRoot) && !isWithinRoot(canonicalRoot, canonical)) {\n throw new Error(\n `Path escapes the workspace root: ${path} (resolved outside ${canonicalRoot})`,\n )\n }\n return full\n }\n\n /** The entry `full` with its parent folder canonicalized and its own name kept (never followed). */\n async function canonicalizeEntry(full: string): Promise<string> {\n const parent = dirname(full)\n return parent === full ? full : join(await canonicalizeForCheck(parent), basename(full))\n }\n\n /**\n * Canonicalize the deepest existing ancestor of `full` to defeat symlink\n * escapes; the non-existent tail (for writes) is appended back verbatim.\n */\n async function canonicalizeForCheck(full: string): Promise<string> {\n let existing = full\n const tail: string[] = []\n while (true) {\n try {\n existing = await realpath(existing)\n break\n }\n catch {\n const parent = dirname(existing)\n if (parent === existing) {\n // Reached the filesystem root without an existing ancestor.\n existing = parent\n break\n }\n // `relative` (not slice) so the segment is correct even on Windows\n // drive roots where `dirname('C:\\\\foo')` is `C:\\\\` (no 1-char sep).\n tail.unshift(relative(parent, existing))\n existing = parent\n }\n }\n return tail.length ? resolve(existing, ...tail) : existing\n }\n\n /**\n * In-process counterpart of the sandbox's write policy: `writeFile` (and\n * so the `write_file` / `edit` tools) may only target `isolation.writableRoots`.\n * Reads are deliberately unrestricted — same boundary the kernel enforces\n * for shell commands, so the two never disagree about where writes land.\n */\n async function assertWritable(full: string, path: string, entry = false): Promise<void> {\n if (!isolation)\n return\n const canonical = entry ? await canonicalizeEntry(full) : await canonicalizeForCheck(full)\n if (!isolation.writableRoots.some(root => isWithinRoot(root, canonical))) {\n throw new Error(\n `[sandbox] write denied: ${path} is outside the writable roots (${isolation.writableRoots.join(', ')}). `\n + 'Ask the user to add it under Settings → \"Sandbox writable paths\" or turn off \"Sandbox shell commands\".',\n )\n }\n }\n\n return {\n // Same containment and write policy as `writeFile`, on the entry itself (a link is never followed) where it is the entry acted on.\n entries: handle => nodeEntryPort({\n resolve: path => resolveContained(handle, path),\n entry: path => resolveContainedEntry(handle, path),\n writable: (full, path) => assertWritable(full, path, true),\n }),\n\n async readFile(handle: ExecutionHandle, path: string): Promise<string> {\n return readFile(await resolveContained(handle, path), 'utf-8')\n },\n\n async fileSize(handle: ExecutionHandle, path: string): Promise<number | null> {\n try {\n // Same containment as every other file method. `stat` (NOT lstat):\n // the caller wants the TARGET's size — an lstat of a symlink\n // reports the link itself and a link to a 10GB file would sail\n // past the whole-read guard this probe exists to feed.\n const info = await stat(await resolveContained(handle, path))\n return info.isFile() ? info.size : null\n }\n catch {\n return null\n }\n },\n\n async readFileBinary(handle: ExecutionHandle, path: string): Promise<Uint8Array> {\n // No encoding → returns a Buffer (which is a Uint8Array). Used by\n // read_file to ferry image / binary content into the multimodal route.\n const buf = await readFile(await resolveContained(handle, path))\n return new Uint8Array(buf)\n },\n\n async writeFile(handle: ExecutionHandle, path: string, content: string | Buffer, encoding: BufferEncoding = 'utf-8'): Promise<void> {\n const fullPath = await resolveContained(handle, path)\n await assertWritable(fullPath, path)\n await mkdir(dirname(fullPath), { recursive: true })\n if (typeof content === 'string')\n await writeFile(fullPath, content, encoding)\n else\n await writeFile(fullPath, content)\n },\n\n async listFiles(handle: ExecutionHandle, path: string, options): Promise<ListFilesEntry[]> {\n if (options?.glob) {\n await resolveContained(handle, globLiteralPrefix(path) || '.')\n const entries = await globFilesLocal(path, handle.cwd, {\n limit: options?.limit ?? 1000,\n metadata: options?.metadata,\n gitignore: options?.gitignore,\n signal: options?.signal,\n })\n if (workspaceRoot === undefined)\n return entries\n const contained: ListFilesEntry[] = []\n for (const entry of entries) {\n try {\n await resolveContained(handle, entry.path)\n contained.push(entry)\n }\n catch {\n // Symlink escapes can be discovered by broad globs like `**/*`.\n // Keep the process context's workspaceRoot invariant by filtering\n // them exactly as read/write paths are filtered.\n }\n }\n return contained\n }\n // Literal listing — suffix directories with `/` so consumers (the\n // `list_files` tool, path suggestions) can tell files from dirs\n // without a second probe. Mirrors `ls -p` in the docker context.\n const dirents = await readdir(await resolveContained(handle, path), { withFileTypes: true })\n return dirents.map(d => (d.isDirectory() ? `${d.name}/` : d.name))\n },\n }\n}\n","/**\n * Shell / terminal spawn helpers of the in-process execution context.\n * Internal module.\n */\n\nimport type { ChildProcess } from 'node:child_process'\nimport type { ProcessContextState } from './process-state'\nimport type { BackgroundTerminalOptions, ExecResult } from './types'\nimport { createAnsiStripper } from './ansi-strip'\nimport { unavailableResult, wrapCommand } from './isolation'\nimport { ptyChildProcess, spawnLocalPty, TERMINAL_ENV } from './local-terminal'\n\nexport interface ProcessShell {\n shellCommand: (command: string) => { file: string, args: string[] }\n isolationBlocker: () => ExecResult | undefined\n spawnTerminalTask: (argv: string[], cwd: string, extraEnv: Record<string, string> | undefined, tty: BackgroundTerminalOptions) => ChildProcess\n terminalEnv: (extra?: Record<string, string>, unset?: readonly string[]) => Record<string, string>\n}\n\nexport function createProcessShell(s: ProcessContextState): ProcessShell {\n const { baseEnv, defaultEnv, isolation, isolationState } = s\n\n /**\n * `{ file, args }` for `/bin/sh -c command`, wrapped in the sandbox when\n * isolation is on. Callers check `isolationState.ok` first (the three\n * shell entry points return `unavailableResult` / throw before spawning).\n */\n function shellCommand(command: string): { file: string, args: string[] } {\n if (isolation && isolationState?.ok)\n return wrapCommand(isolationState.backend, isolationState.executable, isolation, command)\n return { file: '/bin/sh', args: ['-c', command] }\n }\n\n /** Failure result when isolation was requested but cannot be enforced; `undefined` = proceed. */\n function isolationBlocker(): ExecResult | undefined {\n return isolationState && !isolationState.ok ? unavailableResult(isolationState.reason) : undefined\n }\n\n /**\n * A background task in a PTY, as a `ChildProcess` look-alike whose stdout\n * carries the log text. A line still unfinished after a quiet moment (a\n * prompt waiting for input) is written out too, so the log shows it.\n */\n function spawnTerminalTask(argv: string[], cwd: string, extraEnv: Record<string, string> | undefined, tty: BackgroundTerminalOptions): ChildProcess {\n const stripper = createAnsiStripper()\n const decoder = new TextDecoder()\n let quiet: NodeJS.Timeout | undefined\n let emitLog: (text: string) => void = () => {}\n const flushPartial = () => {\n const rest = stripper.takePartial()\n if (rest)\n emitLog(rest)\n }\n const pty = spawnLocalPty(argv, {\n cwd,\n env: terminalEnv(extraEnv),\n cols: tty.cols,\n rows: tty.rows,\n onData: (data) => {\n tty.onData(data)\n const text = stripper.push(decoder.decode(data, { stream: true }))\n if (text)\n emitLog(text)\n if (quiet)\n clearTimeout(quiet)\n quiet = setTimeout(flushPartial, 300)\n quiet.unref?.()\n },\n })\n const { child, stdout } = ptyChildProcess(pty)\n const encoder = new TextEncoder()\n emitLog = text => stdout.emit('data', encoder.encode(text))\n void pty.exited.then(() => {\n if (quiet)\n clearTimeout(quiet)\n flushPartial()\n })\n tty.onReady?.({ write: pty.write, resize: pty.resize })\n return child\n }\n\n /** The environment of a terminal: what commands get, plus terminal identity, minus `unset`. */\n function terminalEnv(extra?: Record<string, string>, unset: readonly string[] = []): Record<string, string> {\n const env: Record<string, string> = {}\n for (const [key, value] of Object.entries({ ...baseEnv, ...defaultEnv, ...extra, ...TERMINAL_ENV })) {\n if (typeof value === 'string' && !unset.includes(key))\n env[key] = value\n }\n return env\n }\n\n return { shellCommand, isolationBlocker, spawnTerminalTask, terminalEnv }\n}\n","/**\n * Live bidirectional `execStream` of the in-process execution context.\n * Internal module.\n */\n\nimport type { ProcessShell } from './process-shell'\nimport type { ProcessContextState } from './process-state'\nimport type { ExecutionContext, ExecutionHandle, StreamHandle } from './types'\nimport { resolve } from 'node:path'\nimport { EXEC_KILL_ESCALATION_GRACE_MS, killProcessGroup, loadSpawn, SUPPORTS_PROCESS_GROUPS } from './process-state'\n\nexport function processStreamMethods(s: ProcessContextState, sh: ProcessShell): Required<Pick<ExecutionContext, 'execStream'>> {\n const { baseEnv, defaultEnv, registerExitHandler, streamChildren, trackSession } = s\n const { shellCommand, isolationBlocker } = sh\n\n return {\n /**\n * Live bidirectional stream to a child process — see\n * `ExecutionContext.execStream` for the seam contract.\n *\n * The reference implementation: an ordinary piped `spawn`, so both\n * streams stay separate and no terminal line discipline sits between\n * the caller and the child. Sandbox-backed contexts have to work\n * harder to reach the same shape.\n *\n * Unlike `execBackground`, nothing here lands in the `tasks` registry:\n * this handle is owned by its caller (an MCP transport's `close()`),\n * not by the model-facing background-task list that `shell_kill` /\n * `wait_task` walk. It IS tracked in `streamChildren` so the shared\n * orphan reaper and `destroy()` can sweep it — detached process-group\n * semantics (needed so `kill()` takes the child's own children with\n * it) are exactly what would otherwise leak a live server per crash.\n */\n async execStream(\n handle: ExecutionHandle,\n command: string,\n options?: { cwd?: string, env?: Record<string, string>, signal?: AbortSignal },\n ): Promise<StreamHandle> {\n const cwd = options?.cwd ? resolve(handle.cwd, options.cwd) : handle.cwd\n const spawnChild = await loadSpawn()\n\n options?.signal?.throwIfAborted()\n const blocked = isolationBlocker()\n if (blocked)\n throw new Error(blocked.stderr)\n\n const shell = shellCommand(command)\n const child = spawnChild(shell.file, shell.args, {\n cwd,\n env: { ...baseEnv, ...defaultEnv, ...options?.env },\n stdio: ['pipe', 'pipe', 'pipe'],\n detached: SUPPORTS_PROCESS_GROUPS,\n })\n\n // Same orphan-reaper coverage as `execBackground`: the detached\n // spawn (needed for kill-tree) means an unclean host exit (Ctrl+C,\n // uncaught exception, OOM) would otherwise leave the server running\n // indefinitely. Tracked in a side map rather than `tasks` — these\n // are caller-owned, invisible to `shell_kill` / `wait_task`.\n registerExitHandler()\n streamChildren.set(child, handle.id)\n const untrack = trackSession(child.pid)\n\n // A spawn failure (ENOENT on /bin/sh, EACCES on cwd) arrives as an\n // async 'error' event, never a throw. Without a listener Node\n // escalates it to an uncaughtException and takes the host down.\n let spawnError: Error | null = null\n child.on('error', (err) => { spawnError = err })\n\n let closed = false\n let escalation: ReturnType<typeof setTimeout> | undefined\n const exited = new Promise<number>((resolveExit) => {\n // 'close' rather than 'exit': it fires after the stdio streams\n // have flushed and ended, so a consumer awaiting `exited` can\n // trust that it has already seen every byte. `exit` can beat the\n // final stdout chunk and truncate the last protocol frame.\n child.once('close', (code, signalName) => {\n closed = true\n clearTimeout(escalation)\n streamChildren.delete(child)\n untrack()\n // Signal-killed children report a null code. Same mapping as\n // `execBackground`'s exit handler in process-background.ts — SIGTERM (our own\n // `kill()`) is the common case and lands on 143.\n resolveExit(\n code !== null\n ? code\n : signalName === 'SIGTERM'\n ? 143\n : signalName\n ? 128\n : 1,\n )\n })\n })\n\n /*\n * TERM the group, then KILL it if its pipes are still open after the\n * grace. Keyed on `close`, not on the shell's own exit: a TERM that\n * lands while the shell is forking (`sh -c 'echo up; sleep 30'`) kills\n * the shell but not the child it was starting, which keeps the pipes\n * (and `exited`) open for its whole life. Idempotent by contract.\n */\n const kill = async (): Promise<void> => {\n if (closed || child.pid === undefined)\n return\n killProcessGroup(child, 'SIGTERM')\n if (escalation)\n return\n escalation = setTimeout(killProcessGroup, EXEC_KILL_ESCALATION_GRACE_MS, child, 'SIGKILL')\n escalation.unref?.()\n }\n\n if (options?.signal) {\n if (options.signal.aborted) {\n void kill()\n }\n else {\n // Detach on exit: the signal is typically the RUN-long abort\n // signal, so a listener left behind after the child exits retains\n // the `kill` closure (and through it the ChildProcess) for the\n // rest of the run — one dead closure per exec on shell-heavy runs.\n const onAbort = () => { void kill() }\n const detach = () => options.signal!.removeEventListener('abort', onAbort)\n options.signal.addEventListener('abort', onAbort, { once: true })\n exited.then(detach, detach)\n }\n }\n\n return {\n pid: child.pid ?? -1,\n // Node's Readable is an async iterable of Buffer, and Buffer is a\n // Uint8Array — no adaptation needed on this context.\n stdout: child.stdout!,\n stderr: child.stderr!,\n write: async (data: Uint8Array): Promise<void> => {\n if (spawnError)\n throw spawnError\n const stdin = child.stdin\n if (!stdin || stdin.destroyed)\n throw new Error(`execStream: stdin is closed (pid ${child.pid ?? -1})`)\n // Resolve from the write callback, which fires once the chunk is\n // actually flushed to the pipe — that IS the backpressure signal,\n // so awaiting it pushes backpressure out to the caller. (Watching\n // the boolean return + 'drain' instead is a trap: for a small\n // write the callback runs synchronously, before the return value\n // is even bound.)\n await new Promise<void>((resolveWrite, rejectWrite) => {\n stdin.write(data, err => err ? rejectWrite(err) : resolveWrite())\n })\n },\n kill,\n exited,\n }\n },\n }\n}\n","/**\n * Background-task registry operations (kill / wait / reassign / list) and\n * `destroy` of the in-process execution context. Internal module.\n */\n\nimport type { ProcessContextState } from './process-state'\nimport type { ExecutionContext, ExecutionHandle, TaskEntry, TaskExitInfo, TaskStallInfo } from './types'\nimport { killProcessGroup, stateToTaskEntry, stateToTaskExitInfo } from './process-state'\n\nexport function processTaskMethods(s: ProcessContextState): Required<Pick<ExecutionContext, 'killBackground' | 'waitBackground' | 'reassignBackgroundTasks' | 'listBackground' | 'destroy'>> {\n const { tasks, destroyGraceMs, streamChildren, handles } = s\n\n return {\n async killBackground(handle: ExecutionHandle, taskId: string): Promise<TaskExitInfo | null> {\n const state = tasks.get(taskId)\n // Two miss cases collapse into one `null` return: unknown id, AND\n // known-id-but-not-owned-by-this-handle. The second case is the\n // subagent-can't-kill-parent-tasks defense; surfacing it as a\n // distinct error would leak the existence of the parent's task\n // to the subagent's model, which violates the per-handle\n // isolation contract.\n if (!state || state.handleId !== handle.id)\n return null\n // Already exited — return the cached info. We don't keep a\n // separate cached exit; the state itself carries every field\n // `TaskExitInfo` needs and `stateToTaskExitInfo` projects it.\n if (state.status !== 'running')\n return stateToTaskExitInfo(state)\n\n // Mark the intent BEFORE issuing the kill so the close handler\n // classifies the exit as `'killed'` even on platforms where the\n // SIGTERM-via-group lands faster than the close event drains.\n // (Checklist #14: at-most-once settle, plus correct status\n // classification regardless of event ordering.)\n state.killRequested = true\n\n // Wait for the existing close listener to fire — `settle()` does\n // all the flushing + onExit work. We just sit on a one-shot\n // promise tied to the `child.on('close')` we already registered\n // at spawn time.\n const closed = new Promise<void>((resolveP) => {\n if (state.settled) {\n resolveP()\n return\n }\n state.exitWatchers.push(() => resolveP())\n })\n\n killProcessGroup(state.child, 'SIGTERM')\n await closed\n return stateToTaskExitInfo(state)\n },\n\n async waitBackground(\n handle: ExecutionHandle,\n taskId: string,\n options?: { timeoutMs?: number, signal?: AbortSignal },\n ): Promise<TaskExitInfo | null> {\n const state = tasks.get(taskId)\n // Same two-misses-collapse-to-null contract as `killBackground`:\n // unknown id AND known-but-other-handle both return `null` so a\n // subagent can't observe the parent's tasks through the wait seam.\n if (!state || state.handleId !== handle.id)\n return null\n if (state.settled)\n return stateToTaskExitInfo(state)\n\n return new Promise<TaskExitInfo | null>((resolveP) => {\n let done = false\n let timer: NodeJS.Timeout | undefined\n const signal = options?.signal\n const finish = (value: TaskExitInfo | null): void => {\n if (done)\n return\n done = true\n if (timer)\n clearTimeout(timer)\n signal?.removeEventListener('abort', onAbort)\n const index = state.exitWatchers.indexOf(watcher)\n if (index >= 0)\n state.exitWatchers.splice(index, 1)\n resolveP(value)\n }\n function onAbort(): void {\n finish(null)\n }\n // A watcher alongside the owner's `onExit` (never replacing it —\n // the notification enqueue, a kill-waiter, a sibling waiter must\n // keep firing). Removed on timeout/abort so abandoned waits don't\n // pile up on a long-running task.\n const task = state\n function watcher(): void {\n finish(stateToTaskExitInfo(task))\n }\n state.exitWatchers.push(watcher)\n\n if (signal) {\n if (signal.aborted) {\n finish(null)\n return\n }\n signal.addEventListener('abort', onAbort, { once: true })\n }\n const timeoutMs = options?.timeoutMs\n if (typeof timeoutMs === 'number' && Number.isFinite(timeoutMs) && timeoutMs > 0) {\n timer = setTimeout(finish, timeoutMs, null)\n timer.unref?.()\n }\n })\n },\n\n async reassignBackgroundTasks(\n fromHandle: ExecutionHandle,\n toHandle: ExecutionHandle,\n newOnExit?: (info: TaskExitInfo) => void,\n newOnStall?: (info: TaskStallInfo) => void,\n ): Promise<readonly TaskEntry[]> {\n // `fromHandle === toHandle` keeps ownership and only rebinds the\n // callbacks — a host rebuilding the agent on a handle it keeps.\n const promoted: TaskEntry[] = []\n for (const state of tasks.values()) {\n if (state.handleId !== fromHandle.id || state.status !== 'running')\n continue\n state.handleId = toHandle.id\n // Replace the OWNER callbacks. The originals closed over the\n // spawning agent's hook bus, which is about to be destroyed —\n // without rewiring, the task's eventual `background:exit` (or a\n // stall) fires into a torn-down hookable and the new owner never\n // learns. In-flight kill/wait watchers are separate and survive.\n if (newOnExit)\n state.onExit = newOnExit\n if (newOnStall)\n state.onStall = newOnStall\n promoted.push(stateToTaskEntry(state))\n }\n return promoted\n },\n\n async listBackground(handle: ExecutionHandle): Promise<readonly TaskEntry[]> {\n // Snapshot — callers must not assume the returned array stays\n // in sync with the live registry. Sorted by startedAt so the\n // model / UI sees consistent ordering across calls. Scoped to\n // the calling handle so subagents don't see the parent's tasks\n // (and vice versa) in their listing.\n return [...tasks.values()]\n .filter(s => s.handleId === handle.id)\n .sort((a, b) => a.startedAt - b.startedAt)\n .map(stateToTaskEntry)\n },\n\n async destroy(handle: ExecutionHandle): Promise<void> {\n // Kill every still-running background task SPAWNED THROUGH THIS\n // HANDLE before tearing the handle down. SIGTERM the groups,\n // await the close + flush, THEN drop the registry entries.\n // Sequential — destroy is one-shot teardown, the few ms of extra\n // latency aren't worth the synchronization complexity.\n //\n // The handle scope matters when the same `ExecutionContext` is\n // shared across a parent agent and its `spawn`-ed subagents (the\n // default — `spawn.ts` passes `execution: ctx.execution`). Each\n // agent mints its own `ExecutionHandle` and registers its\n // background tasks under that handle's id. Without the filter,\n // a child agent's `destroy()` (fired by `spawn.ts`'s `finally`\n // when the subagent finishes / is cancelled) would walk the\n // shared registry and SIGTERM the parent's tasks too. So\n // cancelling a subagent that has its own background shells kills\n // just those subagent shells, leaving the parent's intact.\n const survivors = [...tasks.values()].filter(s => s.handleId === handle.id && !s.settled)\n await Promise.all(survivors.map(async (state) => {\n state.killRequested = true\n await new Promise<void>((resolveP) => {\n let graceTimer: NodeJS.Timeout | undefined\n state.exitWatchers.push(() => {\n if (graceTimer)\n clearTimeout(graceTimer)\n resolveP()\n })\n killProcessGroup(state.child, 'SIGTERM')\n // Bounded drain: a task that traps/ignores SIGTERM — or whose\n // `close` event is held back by an escaped grandchild (setsid'd\n // out of the process group) keeping the inherited stdio pipe\n // open — must not wedge `agent.destroy()` forever. After the\n // grace period, SIGKILL the group and stop waiting: `close`\n // may STILL never fire (the pipe holder isn't in the group),\n // so resolving here is the only way destroy() stays bounded.\n graceTimer = setTimeout(() => {\n killProcessGroup(state.child, 'SIGKILL')\n // settle() normally flushes + ends the log stream, but it\n // only runs off `close` — which we just gave up on. Tear the\n // stream down so the fd doesn't leak into a long-lived host.\n state.outputStream?.destroy()\n resolveP()\n }, destroyGraceMs)\n graceTimer.unref?.()\n })\n }))\n // Drop only this handle's tasks from the registry. Other handles\n // (siblings, parent) keep their entries.\n for (const [taskId, state] of tasks) {\n if (state.handleId === handle.id)\n tasks.delete(taskId)\n }\n // Stream children are caller-owned (the MCP transport's close(), which\n // the agent runs BEFORE executionContext.destroy()), so live entries\n // here mean the owner leaked them. Sweep this handle's slice — same\n // scoping rationale as the task loop above.\n for (const [child, ownerId] of streamChildren) {\n if (ownerId === handle.id) {\n killProcessGroup(child, 'SIGTERM')\n streamChildren.delete(child)\n }\n }\n handles.delete(handle.id)\n // Drop the orphan reaper ONLY when no handles remain — otherwise\n // a child's `destroy()` would strip the parent's safety net. The\n // reaper protects every still-tracked task in the context, so it\n // sticks around until the LAST handle is gone.\n //\n // Without this guard, the spawn-tool sequence\n // parent.spawn(child) → child.run() → child.destroy() (auto)\n // would deregister the handler mid-parent-lifetime. The parent's\n // own subsequent Ctrl+C orphan-kill safety would silently degrade.\n if (s.exitHandlerRegistered && handles.size === 0) {\n process.off('exit', s.exitHandler)\n s.exitHandlerRegistered = false\n }\n },\n }\n}\n","/**\n * In-process execution context.\n *\n * Runs everything in the current Node/Bun process.\n * No isolation — fastest, used as the default.\n */\n\nimport type { ContextCapabilities, ExecutionContext, ExecutionHandle, SpawnConfig, TerminalOptions, TerminalProcess } from './types'\nimport { mkdir, stat } from 'node:fs/promises'\nimport { resolve } from 'node:path'\nimport { hasLocalPty, localTerminalProcess, loginShell, spawnLocalPty } from './local-terminal'\nimport { processBackgroundMethods } from './process-background'\nimport { processExecMethods } from './process-exec'\nimport { processFileMethods } from './process-files'\nimport { createProcessShell } from './process-shell'\nimport { createProcessState } from './process-state'\nimport { processStreamMethods } from './process-stream'\nimport { processTaskMethods } from './process-tasks'\n\nexport { formatContextTimestamp, killProcessGroup, SUPPORTS_PROCESS_GROUPS, TASK_LOG_FILENAME_RE } from './process-state'\n\n/**\n * Creates an execution context that runs commands and file operations in the current process.\n * No isolation unless `config.isolation` asks for an OS sandbox. This is the default context.\n *\n * @param config - Default spawn settings, such as `cwd`, file containment root and isolation.\n *\n * @example\n * ```ts\n * import { createAgent } from 'zidane'\n * import { createProcessContext } from 'zidane/contexts'\n * import { basic } from 'zidane/presets'\n * import { anthropic } from 'zidane/providers/anthropic'\n *\n * const agent = createAgent({\n * ...basic,\n * provider: anthropic(),\n * execution: createProcessContext({ cwd: process.cwd() }),\n * })\n * ```\n */\nexport function createProcessContext(config?: SpawnConfig): ExecutionContext {\n const s = createProcessState(config)\n const { handles, defaultCwd, isolation, isolationState } = s\n const sh = createProcessShell(s)\n const { shellCommand, isolationBlocker, terminalEnv } = sh\n const files = processFileMethods(s)\n const execM = processExecMethods(s, sh)\n const streamM = processStreamMethods(s, sh)\n const bg = processBackgroundMethods(s, sh)\n const taskM = processTaskMethods(s)\n\n return {\n type: 'process',\n\n capabilities: {\n shell: true,\n filesystem: true,\n glob: true,\n network: true,\n gpu: false,\n stream: true,\n // Enforced, not requested: a requested sandbox whose backend is\n // missing fails every command closed, which is not \"isolated\".\n isolated: isolation !== undefined && isolationState?.ok === true,\n // Background tasks are OS children of this process's machine —\n // they survive `agent.destroy()` reassignment games but NOT a\n // host machine reboot, and the orphan reaper kills them on\n // process exit. That's the 'process-lifetime' tier.\n detachedTasks: 'process-lifetime',\n } satisfies ContextCapabilities,\n\n async spawn(overrides?: SpawnConfig): Promise<ExecutionHandle> {\n const id = `process-${++s.counter}`\n const cwd = overrides?.cwd ?? defaultCwd\n\n // Only create `cwd` when it is genuinely missing. An unconditional\n // `mkdir(cwd, { recursive: true })` on an already-existing directory is a\n // wasted write that needlessly demands FS-write permission — which breaks\n // read-only / no-write runtimes (Supabase Edge Functions write only to\n // `/tmp`; Deno edge isolates) where the cwd already exists. `stat` is a\n // read (permitted there); the write is attempted only on a confirmed\n // ENOENT. Any other stat failure (e.g. EACCES on a sandbox-restricted\n // path) must NOT escalate to a mkdir we'd also be denied — assume present\n // and let a later file op surface a precise error if it truly isn't.\n let needsCreate = false\n try {\n await stat(cwd)\n }\n catch (err) {\n needsCreate = (err as NodeJS.ErrnoException)?.code === 'ENOENT'\n }\n if (needsCreate)\n await mkdir(cwd, { recursive: true })\n\n const handle: ExecutionHandle = { id, type: 'process', cwd }\n handles.set(id, handle)\n return handle\n },\n\n exec: execM.exec,\n\n readFile: files.readFile,\n\n fileSize: files.fileSize,\n\n readFileBinary: files.readFileBinary,\n\n writeFile: files.writeFile,\n\n listFiles: files.listFiles,\n\n entries: files.entries,\n\n execStream: streamM.execStream,\n\n // Only where a PTY exists (Bun): no terminal beats a pretend one.\n ...(hasLocalPty()\n ? {\n async openTerminal(handle: ExecutionHandle, options: TerminalOptions): Promise<TerminalProcess> {\n const blocked = isolationBlocker()\n if (blocked)\n throw new Error(blocked.stderr)\n const env = terminalEnv(options.env, options.unsetEnv)\n const shell = loginShell(env)\n // Under OS isolation the shell runs inside the same sandbox as the agent's commands.\n const argv = isolation && isolationState?.ok\n ? (({ file, args }) => [file, ...args])(shellCommand(`exec ${JSON.stringify(shell)} -l`))\n : [shell, '-l']\n const pty = spawnLocalPty(argv, {\n cwd: options.cwd ? resolve(handle.cwd, options.cwd) : handle.cwd,\n env,\n cols: options.cols,\n rows: options.rows,\n onData: options.onData,\n })\n return localTerminalProcess(pty, { id: `pty-${pty.pid}` })\n },\n }\n : {}),\n\n execBackground: bg.execBackground,\n\n killBackground: taskM.killBackground,\n\n waitBackground: taskM.waitBackground,\n\n reassignBackgroundTasks: taskM.reassignBackgroundTasks,\n\n listBackground: taskM.listBackground,\n\n destroy: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,GAAG;GAE5B,MAAM,OAAO,aAAa,gBAAgB,OACpC,EAAE,MAAM,WAAW,CAAC,MAAM,GAAG,IAAI,EAAA,CAAG,aAAa,QAAQ,KAAK,UAAU,KAAK,EAAE,IAAI,CAAC,IACtF,CAAC,OAAO,IAAI;GAChB,MAAM,MAAM,cAAc,MAAM;IAC9B,KAAK,QAAQ,MAAM,QAAQ,OAAO,KAAK,QAAQ,GAAG,IAAI,OAAO;IAC7D;IACA,MAAM,QAAQ;IACd,MAAM,QAAQ;IACd,QAAQ,QAAQ;GAClB,CAAC;GACD,OAAO,qBAAqB,KAAK,EAAE,IAAI,OAAO,IAAI,MAAM,CAAC;EAC3D,EACF,IACA,CAAC;EAEL,gBAAgB,GAAG;EAEnB,gBAAgB,MAAM;EAEtB,gBAAgB,MAAM;EAEtB,yBAAyB,MAAM;EAE/B,gBAAgB,MAAM;EAEtB,SAAS,MAAM;CACjB;AACF"}
|
package/dist/contexts.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { a as OwnedProcess, c as NodeEntryPortOptions, d as nodeEntryPort, i as createProcessContext, l as entryPortOf, n as listSessionProcesses, o as OwnedProcessRole, r as registerSessionProcess, s as listOwnedProcesses, t as SessionProcess, u as execEntryPort } from "./index-
|
|
3
|
-
import { n as createSandboxContext, t as SandboxProvider } from "./sandbox-
|
|
4
|
-
export { type BackgroundTaskStatus, type ContextCapabilities, type ContextHardening, type ContextMount, type ContextType, type DetachedTasksCapability, type EntryKind, type EntryPort, type ExecResult, type ExecutionContext, type ExecutionHandle, type IsolationBackend, type IsolationPolicy, type ListFileMetadata, type ListFilesEntry, type ListFilesOptions, type NodeEntryPortOptions, type OwnedProcess, type OwnedProcessRole, type SandboxProvider, type SessionProcess, type SpawnConfig, type StreamHandle, type TaskEntry, type TaskExitInfo, type TaskHandle, type TaskStallInfo, createProcessContext, createSandboxContext, entryPortOf, execEntryPort, isolationAvailability, listOwnedProcesses, listSessionProcesses, nodeEntryPort, parseAllowWriteSetting, registerSessionProcess, resolveDetachedTasksCapability, resolveWritableRoots, resolveWritableRootsAsync };
|
|
1
|
+
import { A as resolveWritableRoots, D as IsolationPolicy, E as IsolationBackend, O as isolationAvailability, S as TaskStallInfo, T as resolveDetachedTasksCapability, _ as SpawnConfig, a as ContextMount, b as TaskExitInfo, c as EntryKind, d as ExecResult, f as ExecutionContext, g as ListFilesOptions, h as ListFilesEntry, i as ContextHardening, j as resolveWritableRootsAsync, k as parseAllowWriteSetting, l as EntryPort, m as ListFileMetadata, o as ContextType, p as ExecutionHandle, r as ContextCapabilities, s as DetachedTasksCapability, t as BackgroundTaskStatus, u as ExecOptions, v as StreamHandle, x as TaskHandle, y as TaskEntry } from "./types-2HrgolQz.js";
|
|
2
|
+
import { a as OwnedProcess, c as NodeEntryPortOptions, d as nodeEntryPort, i as createProcessContext, l as entryPortOf, n as listSessionProcesses, o as OwnedProcessRole, r as registerSessionProcess, s as listOwnedProcesses, t as SessionProcess, u as execEntryPort } from "./index-f-XWIoYo.js";
|
|
3
|
+
import { n as createSandboxContext, t as SandboxProvider } from "./sandbox-B4OW6oNx.js";
|
|
4
|
+
export { type BackgroundTaskStatus, type ContextCapabilities, type ContextHardening, type ContextMount, type ContextType, type DetachedTasksCapability, type EntryKind, type EntryPort, type ExecOptions, type ExecResult, type ExecutionContext, type ExecutionHandle, type IsolationBackend, type IsolationPolicy, type ListFileMetadata, type ListFilesEntry, type ListFilesOptions, type NodeEntryPortOptions, type OwnedProcess, type OwnedProcessRole, type SandboxProvider, type SessionProcess, type SpawnConfig, type StreamHandle, type TaskEntry, type TaskExitInfo, type TaskHandle, type TaskStallInfo, createProcessContext, createSandboxContext, entryPortOf, execEntryPort, isolationAvailability, listOwnedProcesses, listSessionProcesses, nodeEntryPort, parseAllowWriteSetting, registerSessionProcess, resolveDetachedTasksCapability, resolveWritableRoots, resolveWritableRootsAsync };
|
package/dist/contexts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as resolveWritableRootsAsync, m as registerSessionProcess, p as listSessionProcesses, t as listOwnedProcesses, v as isolationAvailability, x as resolveWritableRoots, y as parseAllowWriteSetting } from "./owned-processes-DRuGDRmI.js";
|
|
2
|
-
import {
|
|
2
|
+
import { i as nodeEntryPort, n as entryPortOf, r as execEntryPort, t as createProcessContext } from "./contexts-DLZTSRHU.js";
|
|
3
|
+
import { t as resolveDetachedTasksCapability } from "./types-4q1bFG53.js";
|
|
3
4
|
import { createSandboxContext } from "./contexts/sandbox.js";
|
|
4
|
-
import { t as resolveDetachedTasksCapability } from "./types-DTMEhKJO.js";
|
|
5
5
|
export { createProcessContext, createSandboxContext, entryPortOf, execEntryPort, isolationAvailability, listOwnedProcesses, listSessionProcesses, nodeEntryPort, parseAllowWriteSetting, registerSessionProcess, resolveDetachedTasksCapability, resolveWritableRoots, resolveWritableRootsAsync };
|
|
@@ -12,7 +12,7 @@ import { cerebras } from "./providers/cerebras.js";
|
|
|
12
12
|
import { t as generatePkce } from "./pkce-CNABhw6J.js";
|
|
13
13
|
import { n as createCursorOAuthProvider } from "./cursor-ntwMDfyD.js";
|
|
14
14
|
import { n as zai, r as mistral } from "./providers-CShv3UgY.js";
|
|
15
|
-
import { i as google, l as GOOGLE_IMAGE_MODELS, n as GOOGLE_EXTRA_MODELS, o as googleVertex, t as GOOGLE_DEFAULT_MODEL } from "./google-
|
|
15
|
+
import { i as google, l as GOOGLE_IMAGE_MODELS, n as GOOGLE_EXTRA_MODELS, o as googleVertex, t as GOOGLE_DEFAULT_MODEL } from "./google-B-Dhmzzf.js";
|
|
16
16
|
import { a as OPENAI_DECISION_MODELS, o as OPENAI_IMAGE_MODELS, r as openai } from "./openai-CQw3EVu6.js";
|
|
17
17
|
import { a as openrouterImageModels, i as OPENROUTER_DECISION_MODELS, r as openrouter, t as OPENROUTER_DEFAULT_MODEL } from "./openrouter-CgBpQR6G.js";
|
|
18
18
|
import { n as XAI_IMAGE_MODELS, t as xai } from "./xai-BDoEXsjQ.js";
|
|
@@ -2393,4 +2393,4 @@ function configureProviderCredential(dataDir, descriptor, input) {
|
|
|
2393
2393
|
//#endregion
|
|
2394
2394
|
export { getContextWindow as A, restoreModelOptions as B, writeCredentials as C, credKeyOf as D, cerebrasDescriptor as E, modelSupportsReasoning as F, modelsForDescriptor as I, openaiDescriptor as L, localDescriptor as M, modelLabel as N, defaultModelOf as O, modelOptionsFor as P, openrouterDescriptor as R, writeCredentialEntry as S, anthropicDescriptor as T, setCredentialLabel as _, ensureCredentialIds as a, storedCredentialById as b, providerFactoryOptions as c, readCredentials as d, readProviderCredential as f, removeStoredCredential as g, removeProviderCredential as h, credentialsPath as i, getModelInfo as j, enabledModelOptions as k, providerFieldViews as l, readProviderCredentials as m, configureProviderCredential as n, isSecretCustomField as o, readProviderCredentialPair as p, configuredProviderFields as r, onProviderAccountsChange as s, applyApiKeyEnv as t, readCredentialEntry as u, setPreferredCredential as v, BUILTIN_PROVIDERS as w, storedCredentialsOf as x, setProviderCredential as y, piIdOf as z };
|
|
2395
2395
|
|
|
2396
|
-
//# sourceMappingURL=credentials-
|
|
2396
|
+
//# sourceMappingURL=credentials-Bqg-qNBM.js.map
|