@celljs/ta 4.9.0 → 4.10.0
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/cli.mjs +69 -15
- package/dist/gateway.mjs +170 -28
- package/dist/pi/CHANGELOG.md +11 -0
- package/dist/pi/dist/bundle/chunks/anthropic-messages-CA3HHOL3.js +6 -0
- package/dist/pi/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-76TWS6DT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/pi/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
- package/dist/pi/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
- package/dist/pi/dist/bundle/chunks/chunk-AUUCDC7R.js +4 -0
- package/dist/pi/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-BAC3QPNW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
- package/dist/pi/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
- package/dist/pi/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-IQUU5XIT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EBFHJFEE.js → chunk-LQLJ7CDW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-MMDXLZVS.js +30 -0
- package/dist/pi/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-QN4TOIZN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-RKNK4Y6L.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-V7SLUK6A.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-VEJDBY3O.js +1237 -0
- package/dist/pi/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
- package/dist/pi/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-ZBIZYD6W.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-ZGYS4UTC.js +2 -0
- package/dist/pi/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-7RHMDOHL.js} +7 -7
- package/dist/pi/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-U4J7D646.js} +1 -1
- package/dist/pi/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/pi/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
- package/dist/pi/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/pi/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-D5B6W47J.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-U4H5YDEW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-EJXCQRUQ.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-S277EKLB.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-TEQRB65N.js +10 -0
- package/dist/pi/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-HRZOSLBO.js} +3 -3
- package/dist/pi/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-F66BDLOM.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-responses-BAKFWTGE.js +4 -0
- package/dist/pi/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-VXF5TVIK.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-UBJKNDRN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-56TEMIHL.js} +1 -1
- package/dist/pi/dist/bundle/chunks/virtual-modules-KITQRTYM.js +2 -0
- package/dist/pi/dist/bundle/cli-runtime.js +1 -1
- package/dist/pi/dist/bundle/index.js +1 -1
- package/dist/pi/dist/bundle/rpc-entry.js +1 -1
- package/dist/pi/docs/cli.md +14 -1
- package/dist/pi/docs/extensions.md +27 -7
- package/dist/pi/docs/keybindings.md +1 -1
- package/dist/pi/docs/llama-cpp.md +5 -8
- package/dist/pi/docs/models-configuration.md +6 -1
- package/dist/pi/docs/models.md +2 -1
- package/dist/pi/docs/prompt-templates.md +1 -1
- package/dist/pi/docs/providers.md +1 -1
- package/dist/pi/docs/rpc.md +4 -2
- package/dist/pi/docs/sessions.md +7 -1
- package/dist/pi/docs/settings.md +1 -1
- package/dist/pi/docs/tui.md +1 -1
- package/dist/pi/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/dist/pi/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/dist/pi/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/dist/pi/examples/extensions/gondolin/package-lock.json +2 -2
- package/dist/pi/examples/extensions/gondolin/package.json +1 -1
- package/dist/pi/examples/extensions/plan-mode/index.ts +23 -13
- package/dist/pi/examples/extensions/plan-mode/utils.ts +42 -16
- package/dist/pi/examples/extensions/subagent/README.md +14 -11
- package/dist/pi/examples/extensions/subagent/index.ts +392 -171
- package/dist/pi/examples/extensions/with-deps/package-lock.json +2 -2
- package/dist/pi/examples/extensions/with-deps/package.json +1 -1
- package/dist/pi/examples/tsconfig.json +63 -35
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/README.en.md +2 -2
- package/dist/pi/packages/ta-agents/README.md +2 -2
- package/dist/pi/packages/ta-agents/extension/index.mjs +69 -13
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +19 -4
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +43 -9
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js +3 -0
- package/dist/pi/packages/ta-agents/lib/extension.d.ts +2 -1
- package/dist/pi/packages/ta-agents/lib/extension.js +26 -4
- package/dist/pi/packages/ta-agents/lib/json-rpc.js +7 -1
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +4 -0
- package/dist/pi/packages/ta-agents/package.json +3 -3
- package/dist/pi/packages/ta-bots/extension/index.mjs +46 -0
- package/dist/pi/packages/ta-bots/host/index.mjs +46 -0
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-channels/README.en.md +2 -2
- package/dist/pi/packages/ta-channels/README.md +2 -2
- package/dist/pi/packages/ta-channels/host/index.mjs +50 -0
- package/dist/pi/packages/ta-channels/lib/create.js +11 -3
- package/dist/pi/packages/ta-channels/lib/faces.js +1 -1
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts +6 -9
- package/dist/pi/packages/ta-channels/lib/i18n.js +12 -18
- package/dist/pi/packages/ta-channels/lib/more-menu.d.ts +3 -2
- package/dist/pi/packages/ta-channels/lib/more-menu.js +21 -29
- package/dist/pi/packages/ta-channels/lib/room.js +13 -8
- package/dist/pi/packages/ta-channels/lib/sidebar.js +241 -79
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +83 -37
- package/dist/pi/packages/ta-channels/lib/tasks.d.ts +2 -0
- package/dist/pi/packages/ta-channels/lib/tasks.js +22 -12
- package/dist/pi/packages/ta-channels/lib/views.d.ts +49 -1
- package/dist/pi/packages/ta-channels/lib/views.js +100 -1
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-channels/web/index.js +482 -259
- package/dist/pi/packages/ta-computer-use/package.json +2 -2
- package/dist/pi/packages/ta-cron/README.en.md +2 -2
- package/dist/pi/packages/ta-cron/README.md +2 -2
- package/dist/pi/packages/ta-cron/host/index.mjs +6 -0
- package/dist/pi/packages/ta-cron/lib/editor.js +60 -27
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +12 -1
- package/dist/pi/packages/ta-cron/lib/i18n.js +24 -2
- package/dist/pi/packages/ta-cron/lib/page.d.ts +33 -3
- package/dist/pi/packages/ta-cron/lib/page.js +119 -4
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +166 -46
- package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +15 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.js +56 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +2 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +11 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +4 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +102 -66
- package/dist/pi/packages/ta-cron/package.json +1 -1
- package/dist/pi/packages/ta-cron/web/index.js +928 -404
- package/dist/pi/packages/ta-extensions/README.en.md +3 -1
- package/dist/pi/packages/ta-extensions/README.md +3 -1
- package/dist/pi/packages/ta-extensions/lib/actions.js +3 -1
- package/dist/pi/packages/ta-extensions/lib/composer.d.ts +17 -0
- package/dist/pi/packages/ta-extensions/lib/composer.js +84 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +9 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.js +18 -0
- package/dist/pi/packages/ta-extensions/lib/index.js +4 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.d.ts +20 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.js +43 -0
- package/dist/pi/packages/ta-extensions/lib/page.js +42 -18
- package/dist/pi/packages/ta-extensions/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-extensions/lib/settings.js +44 -0
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +10 -4
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +7 -3
- package/dist/pi/packages/ta-extensions/web/index.js +269 -26
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-workspace/README.md +1 -1
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +1 -1
- package/dist/pi/packages/ta-workspace/lib/bytes.d.ts +11 -0
- package/dist/pi/packages/ta-workspace/lib/bytes.js +40 -0
- package/dist/pi/packages/ta-workspace/lib/common.d.ts +2 -1
- package/dist/pi/packages/ta-workspace/lib/common.js +15 -37
- package/dist/pi/packages/ta-workspace/lib/editors.js +12 -3
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +1 -2
- package/dist/pi/packages/ta-workspace/lib/i18n.js +2 -4
- package/dist/pi/packages/ta-workspace/lib/index.js +17 -1
- package/dist/pi/packages/ta-workspace/lib/launcher.d.ts +9 -0
- package/dist/pi/packages/ta-workspace/lib/launcher.js +39 -0
- package/dist/pi/packages/ta-workspace/lib/preview.d.ts +13 -3
- package/dist/pi/packages/ta-workspace/lib/preview.js +17 -14
- package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.js +20 -7
- package/dist/pi/packages/ta-workspace/lib/terminal-sessions.d.ts +51 -0
- package/dist/pi/packages/ta-workspace/lib/terminal-sessions.js +226 -0
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts +0 -39
- package/dist/pi/packages/ta-workspace/lib/terminal.js +28 -240
- package/dist/pi/packages/ta-workspace/lib/util/keys.d.ts +18 -0
- package/dist/pi/packages/ta-workspace/lib/util/keys.js +23 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.d.ts +19 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.js +32 -1
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +238 -68
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-C1tb6dM5.js → abnfDiagram-S7VZAUFO-BmIko5tV.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-DN1Va8BF.js → architecture-WOLXFQ4H-XgsdQ7ul.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-BmK2SYtQ.js → architectureDiagram-YGSQEFNW--sVhMS03.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-DvLrLzTm.js → blockDiagram-APKKGZFW-8f9b-9k2.js} +1 -1
- package/dist/public/assets/browser-DOHZ0JCf.js +12 -0
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CrQlWwrG.js → c4Diagram-KJ2TOQU5-CwYQ0Jfy.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-CHKMsuY_.js → chunk-6MUBBAK2-7Y9ezehi.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-CWJ7Np6s.js → chunk-AXFCVDMN-CZIH4pWz.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-3v5XbQGM.js → chunk-BG4553SI-DsNATY2m.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-2CC-yiCz.js → chunk-DQASFODM-CoXkfYE-.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-D2hzQPAy.js → chunk-HFQBQIA3-C5OLqki8.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-SifAZs2r.js → chunk-KQLB2F66-DMHuYGEF.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-BP0C0VCC.js → chunk-KS47KZWR-BKeOttO1.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-B1f5vw5b.js → chunk-LEVMRMFU-D6zCwkk7.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-B2MCJt7Y.js → chunk-M57EVK23-B5-QqcZg.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-cDpZJMk4.js → chunk-OY52VR5R-DQrq3n0T.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-BE0we2xc.js → chunk-QB3YPZ4I-j6ZT7EDR.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-D9wOfqqH.js → chunk-R3KSYZAL-D5MXUO36.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-BIaVsc0K.js → chunk-STOXU5M4-DaBkw4dD.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-BZc0OZEM.js → chunk-TU62E6Q5-vXcRfGci.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-Bngfwwzm.js → chunk-X4PVCEUW-CIh6H4Y2.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-C5FQ6XHK.js → chunk-XXDRQBXY-C_Vwv1FM.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-_om54nmt.js → classDiagram-v2-L25IHNXF-DccDWEJn.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-Dwpeee_6.js → cose-bilkent-JH36ORCC-BX47lumZ.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-MaI-3dMQ.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-DP5_y9Dq.js → cynefinDiagram-L36ESFBY-BE6WOGxW.js} +1 -1
- package/dist/public/assets/{d3-selection-DFiMlEmn.js → d3-selection-ZcE6yRN5.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-DYwsk6gk.js → dagre-SPEB5RXH-CE6SOOcN.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-Dq_nT3AZ.js → diagram-3B7GL73J-xC8VtiYL.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-ChURW6y9.js → diagram-DNEMPZML-4dmcBbjL.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-CgVp4Rto.js → diagram-L3MUGCDN-D14Yn3sQ.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-vrqLMDby.js → diagram-LA4NIPWU-GxSXIhsK.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-lvfOr5ij.js → diagram-MHCOC4E2-Cm7Prlpc.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-oQ18TeVp.js → diagram-XPFHEONP-mkUnnKFu.js} +1 -1
- package/dist/public/assets/{dist-BOxxmveI.js → dist-acJS-BlA.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-C7_tlZCS.js → ebnfDiagram-UZSYDL2S-m77ua3UQ.js} +1 -1
- package/dist/public/assets/{editor.api-CoZ8MEuz.js → editor.api-CljTm-EQ.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-Dkt5-ikg.js → elk-XV6XMXQE-DsQY1hw9.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-27kh3zlx.js → erDiagram-EYBAPDEH-CV8gJM0P.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-CxVEejjN.js → eventmodeling-K75KTNOO-C1pymbUr.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-shBnAQFk.js +1 -0
- package/dist/public/assets/{freemarker2-D6CwPIXh.js → freemarker2-DYJXaMHN.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-C-amlwpX.js → ganttDiagram-23REXITY-CppxOWRh.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BtQWboBz.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-DKhzI0Xz.js → gitGraphDiagram-STJD7YCW-CrQrZhcP.js} +1 -1
- package/dist/public/assets/{handlebars-mxNr68Gm.js → handlebars-DZCnH9e2.js} +1 -1
- package/dist/public/assets/{html-Bze6s9R9.js → html-DuzouNES.js} +1 -1
- package/dist/public/assets/{index-BhQUc9PU.js → index-B7OYKvCE.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-CDSLjba_.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-WHuWjEDO.js → infoDiagram-KBXO4MBG-6pby19tQ.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-DFHUwD0J.js → ishikawaDiagram-M35NCXHK-Duf8c8rQ.js} +1 -1
- package/dist/public/assets/{javascript-4NMPu7y1.js → javascript-2d_L6cVd.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-C7gV6zEr.js → journeyDiagram-OPLOXDXO-Dvv-xzNo.js} +1 -1
- package/dist/public/assets/{jsonMode-B1JEHPMp.js → jsonMode-CFadYXyI.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-DlRu_d2Q.js → kanban-definition-BZKZHSQY-Dsk6F-TT.js} +1 -1
- package/dist/public/assets/{liquid-B7sIf4NX.js → liquid-Din4CF34.js} +1 -1
- package/dist/public/assets/{mdx-CAN0qez6.js → mdx-DivDuCWI.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-BGmotBhf.js → mermaid-parser.core-BfCv4CYZ.js} +3 -3
- package/dist/public/assets/{mermaid.core-Cl6SS3cM.js → mermaid.core-DC20ZwJj.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DiQ8Feqr.js → mindmap-definition-I2QAS2VK-DRZRrJU_.js} +1 -1
- package/dist/public/assets/module-BAQaY56j.js +1 -0
- package/dist/public/assets/module-DxRGg3ED.js +1947 -0
- package/dist/public/assets/{monaco-CwCjTWAO.js → monaco-D1d6MOPe.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-dYb4P9eU.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-XhCpv6BX.js → pegDiagram-FD4XPPHP-DcGr3Tbk.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-CIompBnc.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-DUVzuXUd.js → pieDiagram-J4AKIIQI-GF7pu6ch.js} +1 -1
- package/dist/public/assets/{python-DsoF66Sp.js → python-BQbTTTT5.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-Ddobf0z0.js → quadrantDiagram-XTYBLID2-D-bcu7Ey.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-DiJl7BtK.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-B5cRBukM.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-DkrNo-Gf.js → railroad-abnf-LNEFI6M7-BiBHsI-K.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-DaB7gY8P.js → railroad-ebnf-DWYD2UWJ-zKjrfkHs.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-D_QG87QV.js → railroad-peg-JR7BVNR7-DKuVn0GT.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-x-nUoBjv.js → railroadDiagram-MRQ6NCDL-Cyn-16mJ.js} +1 -1
- package/dist/public/assets/{razor-DSrcJyQe.js → razor-DiLk54O0.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-kNNcbsty.js → requirementDiagram-Y7LWUY3S-CwU2EBkW.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-ClC12Odk.js → sankeyDiagram-WGJFYUXA-ajf00HyW.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-DDQITP2g.js → sequenceDiagram-5NDRBG5M-DiX_OIAw.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-N1t_36oh.js → stateDiagram-v2-FJ4FJNEA-CV5bRqB7.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-DSt9fFYE.js → swimlanes-UMQ2AFYF-BGQKSlj7.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-DxXlavVT.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-CfymOw_s.js → timeline-definition-SEUHKTQE-DhQoApff.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-BOP6mkZC.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-BJxuPMz3.js +1 -0
- package/dist/public/assets/{typescript-J7rF-zX8.js → typescript-COQ1g-up.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-CK_mRc2_.js → usecaseDiagram-AFA6YXN4-CmLFzjie.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-DW8xR6IJ.js → vennDiagram-NNMJR3RB-DOa6JR5K.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-jqlowjVL.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-Css55Zq5.js → wardleyDiagram-S7YFUSEH-BV7EEShp.js} +1 -1
- package/dist/public/assets/{xml-CJeviG_a.js → xml-BbvtjuaG.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-BnhK9cFS.js → xychartDiagram-GGNKY7IX-DtMpPbsq.js} +1 -1
- package/dist/public/assets/{yaml-Gw3uo6rF.js → yaml-Bw8NFga9.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/launch.svg +46 -42
- package/dist/serve/index.mjs +1367 -560
- package/package.json +25 -25
- package/dist/pi/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
- package/dist/pi/dist/bundle/chunks/chunk-44DLKSKE.js +0 -1232
- package/dist/pi/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
- package/dist/pi/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
- package/dist/pi/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
- package/dist/pi/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
- package/dist/pi/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
- package/dist/pi/dist/bundle/chunks/virtual-modules-O76XM3OB.js +0 -2
- package/dist/public/assets/browser-DAv3ly6M.js +0 -12
- package/dist/public/assets/cynefin-EF2NZ3EQ-CW_93VVD.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-BRowRdve.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BGmojXlx.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-CRRVgGj2.js +0 -1
- package/dist/public/assets/module-1nDbf1AK.js +0 -1761
- package/dist/public/assets/module-BkKfSTDV.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-DUlqTCWQ.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-2RgP4ScO.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Dap8k-yH.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-Ds10NBze.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-BHAN4SQO.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-f1hLUBjI.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-_NPRpuUC.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-CLBqtefx.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "1.5.
|
|
9
|
+
"version": "1.5.2",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
|
@@ -16,56 +16,83 @@
|
|
|
16
16
|
"@earendil-works/chord/delta": [
|
|
17
17
|
"../../../packages/chord/src/delta/index.ts"
|
|
18
18
|
],
|
|
19
|
-
"@earendil-works/chord/
|
|
20
|
-
"../../../packages/chord/src/
|
|
19
|
+
"@earendil-works/chord/json": [
|
|
20
|
+
"../../../packages/chord/src/json.ts"
|
|
21
21
|
],
|
|
22
|
-
"@earendil-works/chord/
|
|
23
|
-
"../../../packages/chord/src/
|
|
22
|
+
"@earendil-works/chord/watch": [
|
|
23
|
+
"../../../packages/chord/src/watch.ts"
|
|
24
24
|
],
|
|
25
|
-
"@earendil-works/chord/
|
|
26
|
-
"../../../packages/chord/src/
|
|
25
|
+
"@earendil-works/chord/output": [
|
|
26
|
+
"../../../packages/chord/src/output.ts"
|
|
27
27
|
],
|
|
28
|
-
"@
|
|
29
|
-
"../../../packages/chord/
|
|
28
|
+
"@earendil-works/chord/sqlite": [
|
|
29
|
+
"../../../packages/chord/src/sqlite/index.ts"
|
|
30
30
|
],
|
|
31
|
-
"@
|
|
32
|
-
"../../../packages/chord/
|
|
31
|
+
"@earendil-works/chord/sqlite/node": [
|
|
32
|
+
"../../../packages/chord/src/sqlite/node.ts"
|
|
33
33
|
],
|
|
34
|
-
"@
|
|
35
|
-
"../../../packages/chord/
|
|
34
|
+
"@earendil-works/chord/sqlite/cloudflare": [
|
|
35
|
+
"../../../packages/chord/src/sqlite/cloudflare.ts"
|
|
36
36
|
],
|
|
37
|
-
"@
|
|
38
|
-
"../../../packages/chord/
|
|
37
|
+
"@earendil-works/chord/telemetry-sqlite": [
|
|
38
|
+
"../../../packages/chord/src/telemetry-sqlite/index.ts"
|
|
39
39
|
],
|
|
40
|
-
"@
|
|
41
|
-
"../../../packages/chord/
|
|
40
|
+
"@earendil-works/chord/http": [
|
|
41
|
+
"../../../packages/chord/src/node/http/index.ts"
|
|
42
42
|
],
|
|
43
|
-
"@
|
|
44
|
-
"../../../packages/chord/
|
|
43
|
+
"@earendil-works/chord/workers": [
|
|
44
|
+
"../../../packages/chord/src/node/workers/index.ts"
|
|
45
45
|
],
|
|
46
|
-
"@earendil-works/chord/
|
|
47
|
-
"../../../packages/chord/src/
|
|
46
|
+
"@earendil-works/chord/workers/child": [
|
|
47
|
+
"../../../packages/chord/src/node/workers/child.ts"
|
|
48
48
|
],
|
|
49
|
-
"@earendil-works/chord/
|
|
50
|
-
"../../../packages/chord/src/
|
|
49
|
+
"@earendil-works/chord/plugins": [
|
|
50
|
+
"../../../packages/chord/src/node/plugins/index.ts"
|
|
51
51
|
],
|
|
52
|
-
"@earendil-works/chord/
|
|
53
|
-
"../../../packages/chord/src/node.ts"
|
|
52
|
+
"@earendil-works/chord/plugins/runtime": [
|
|
53
|
+
"../../../packages/chord/src/node/plugins/runtime.ts"
|
|
54
54
|
],
|
|
55
|
-
"@earendil-works/chord/
|
|
56
|
-
"../../../packages/chord/src/
|
|
55
|
+
"@earendil-works/chord/app": [
|
|
56
|
+
"../../../packages/chord/src/node/app/index.ts"
|
|
57
57
|
],
|
|
58
|
-
"@earendil-works/chord/
|
|
59
|
-
"../../../packages/chord/src/
|
|
58
|
+
"@earendil-works/chord/app/files": [
|
|
59
|
+
"../../../packages/chord/src/node/app/files-entry.ts"
|
|
60
60
|
],
|
|
61
|
-
"@earendil-works/chord/
|
|
62
|
-
"../../../packages/chord/src/
|
|
61
|
+
"@earendil-works/chord/web": [
|
|
62
|
+
"../../../packages/chord/src/web/index.ts"
|
|
63
63
|
],
|
|
64
|
-
"@earendil-works/chord/
|
|
65
|
-
"../../../packages/chord/src/
|
|
64
|
+
"@earendil-works/chord/surfaces": [
|
|
65
|
+
"../../../packages/chord/src/node/surfaces/index.ts"
|
|
66
66
|
],
|
|
67
|
-
"@earendil-works/chord/
|
|
68
|
-
"../../../packages/chord/src/
|
|
67
|
+
"@earendil-works/chord/react": [
|
|
68
|
+
"../../../packages/chord/src/react/index.ts"
|
|
69
|
+
],
|
|
70
|
+
"@earendil-works/chord/tui": [
|
|
71
|
+
"../../../packages/chord/src/tui/index.ts"
|
|
72
|
+
],
|
|
73
|
+
"@earendil-works/chord/tui/launcher": [
|
|
74
|
+
"../../../packages/chord/src/node/tui/index.ts"
|
|
75
|
+
],
|
|
76
|
+
"@earendil-works/chord/sync": [
|
|
77
|
+
"../../../packages/chord/src/sync/index.ts"
|
|
78
|
+
],
|
|
79
|
+
"@test/contracts/*": [
|
|
80
|
+
"../../chord/test/node/fixtures/plugins/contracts/*.ts"
|
|
81
|
+
],
|
|
82
|
+
"@example/contracts/*": [
|
|
83
|
+
"../../chord/test/examples/35-plugins/plugins/contracts/*.ts"
|
|
84
|
+
],
|
|
85
|
+
"@example/weather/*": [
|
|
86
|
+
"../../chord/test/examples/36-plugin-failures/plugins/weather/*.ts"
|
|
87
|
+
],
|
|
88
|
+
"@example/prices/*": [
|
|
89
|
+
"../../chord/test/examples/36-plugin-failures/plugins/prices/*.ts"
|
|
90
|
+
],
|
|
91
|
+
"@example/shapes/*": [
|
|
92
|
+
"../../chord/test/examples/37-plugin-imports/plugins/shapes/*.ts"
|
|
93
|
+
],
|
|
94
|
+
"@example/shared/*": [
|
|
95
|
+
"../../chord/test/examples/38-watch-and-rollout/plugins/contracts/*.ts"
|
|
69
96
|
],
|
|
70
97
|
"@earendil-works/pi-telemetry": [
|
|
71
98
|
"../../../packages/telemetry/src/index.ts"
|
|
@@ -171,7 +198,8 @@
|
|
|
171
198
|
"include": [
|
|
172
199
|
"./extensions/**/*",
|
|
173
200
|
"../../*/src/**/*.d.ts",
|
|
174
|
-
"../test/suite/regressions/8261-subagent-project-trust.test.ts"
|
|
201
|
+
"../test/suite/regressions/8261-subagent-project-trust.test.ts",
|
|
202
|
+
"../test/subagent-extension.test.ts"
|
|
175
203
|
],
|
|
176
204
|
"exclude": [
|
|
177
205
|
"**/node_modules/**",
|
package/dist/pi/package.json
CHANGED
|
@@ -32,7 +32,7 @@ Pick one in the model list of the + on the left of the input box, an agent's mod
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
Fields: `name`, `command`, `args`, `env`, `login` (the sign-in command to tell the user), `permissions`, `options` (the agent's settings of a new session, by the id or category of the option, such as `{ "mode": "default" }`), `clientMeta` (`_meta` of the client's capabilities in `initialize`). `env` and `options` of a built-in agent merge with those of the settings. `false` turns a built-in agent off. A built-in agent named in the settings is offered even when its program is not found, so it can run another one: the adapters read `CLAUDE_CODE_EXECUTABLE` (Claude Code's executable) and `CODEX_PATH` (the `codex` command), for example for wrappers built on the same code:
|
|
35
|
+
Fields: `name`, `command`, `args`, `env`, `login` (the sign-in command to tell the user), `permissions`, `options` (the agent's settings of a new session, by the id or category of the option, such as `{ "mode": "default" }`), `clientMeta` (`_meta` of the client's capabilities in `initialize`), `processPerSession` (a process for each pi session, for an agent whose process serves one session). `env` and `options` of a built-in agent merge with those of the settings. `false` turns a built-in agent off. A built-in agent named in the settings is offered even when its program is not found, so it can run another one: the adapters read `CLAUDE_CODE_EXECUTABLE` (Claude Code's executable) and `CODEX_PATH` (the `codex` command), for example for wrappers built on the same code:
|
|
36
36
|
|
|
37
37
|
```json
|
|
38
38
|
{
|
|
@@ -48,7 +48,7 @@ Fields: `name`, `command`, `args`, `env`, `login` (the sign-in command to tell t
|
|
|
48
48
|
- **A turn**: each time pi asks the model, only what the user said since the agent last answered goes to the agent (`session/prompt`), since the agent keeps its own history. The agent's text and thinking stream as pi's message.
|
|
49
49
|
- **Tool calls**: the agent uses its own tools; each call is recorded in pi as a call of `agent_tool` (its arguments are a title, a kind and a target, such as `{ kind: "execute", target: "npm test" }`), so Ta shows it as a line like its own tools, with the agent's output as the result. As soon as a call of kind edit, delete or move names the file it changes (`locations`, or `file_path` and the like in its arguments), or brings an ACP diff, the extension emits `ta:file-write` on `pi.events` (`{ path, before? }`, `TA_FILE_WRITE_EVENT` of ta-protocol), so that ta-changes keeps the file as it was before the agent writes it. When the agent starts a call, the assistant message ends (`toolUse`); pi "running" `agent_tool` only waits for the agent to finish the call, and pi's next request goes on with the same turn. some agents (CodeBuddy Code) stream the arguments first, so a call shows once the agent says they are complete (`toolArgumentsComplete` in `_meta`, or announcing the call again as `pending` with them); without such a sign, 1.5 seconds without news of the call, or the agent saying something else, will do; calls started together go in one message and show in parallel. `agent_tool` is active only while the model is an agent.
|
|
50
50
|
- **Sessions**: a pi session uses one session of each agent; its id is kept in the pi session (the custom entry `ta-agents.session`), and reopening the conversation loads it again (`session/load`). A fork, or going back to an earlier message in pi (`/tree`), starts a new session of the agent on the next turn and hands it the conversation so far as text; so does switching to an agent in the middle of a conversation (30,000 characters at most).
|
|
51
|
-
- **Processes**: the sessions of one agent in one directory share a process
|
|
51
|
+
- **Processes**: the sessions of one agent in one directory share a process; by directory, because CodeBuddy Code runs commands where it was started rather than in the directory of the session. CodeBuddy Code itself runs a process for each conversation (about 650 MB), stopped when the conversation closes: a process of it answers only the session it opened or loaded last, and a prompt of another one waits forever, or ends at once with nothing while that one works. A process stops after 10 minutes without a turn, and starts again, loading its sessions, when it is needed. It keeps pi's process alive only while a request waits for its answer, so `pi -p` exits once it answered.
|
|
52
52
|
- **When the agent goes on by itself**: after a background task, an agent may start a turn on its own (CodeBuddy Code starts it with `unsolicitedTurn` in a `session_info_update` and ends it with `session_end`; other agents give no end, and the turn ends after 3 quiet seconds). The extension sends pi a message that is not shown, which starts a pi turn that shows it.
|
|
53
53
|
- **When the user talks while the agent works**: ACP has no way to steer a turn, so it is kept and sent as the next turn as soon as this one ends. Stopping sends `session/cancel`; the next turn waits for the agent to end the cancelled one (5 seconds at most).
|
|
54
54
|
- **Permissions**: as in pi, nothing is held back: a permission request of the agent is answered "allow once". With `permissions: "ask"` the user picks in the UI. The agent's own permission mode (CodeBuddy Code's settings, for example) still applies.
|
|
@@ -32,7 +32,7 @@ CodeBuddy Code 和在它自己的终端里一样:用 PTC(代码模式,工
|
|
|
32
32
|
}
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
-
字段:`name`、`command`、`args`、`env`、`login`(提示用户执行的登录命令)、`permissions`、`options`(新会话的 Agent 设置,按选项的 id 或类别,如 `{ "mode": "default" }`)、`clientMeta`(`initialize` 里客户端能力的 `_meta
|
|
35
|
+
字段:`name`、`command`、`args`、`env`、`login`(提示用户执行的登录命令)、`permissions`、`options`(新会话的 Agent 设置,按选项的 id 或类别,如 `{ "mode": "default" }`)、`clientMeta`(`initialize` 里客户端能力的 `_meta`)、`processPerSession`(每个 pi 会话单独一个进程,用于一个进程只服务一个会话的 Agent)。内置 Agent 的 `env`、`options` 与设置里的合并。`false` 关掉一个内置 Agent。设置里写了某个内置 Agent,即使没找到它的程序也会提供,适合改用别的程序:适配器认环境变量 `CLAUDE_CODE_EXECUTABLE`(Claude Code 的可执行文件)和 `CODEX_PATH`(`codex` 命令),比如用同源的包装版:
|
|
36
36
|
|
|
37
37
|
```json
|
|
38
38
|
{
|
|
@@ -48,7 +48,7 @@ CodeBuddy Code 和在它自己的终端里一样:用 PTC(代码模式,工
|
|
|
48
48
|
- **一轮怎么走**:pi 每次请求模型时,只把用户自上次回答以来说的话发给 Agent(`session/prompt`),因为 Agent 自己保存历史。Agent 的文字和思考按流式转成 pi 的消息。
|
|
49
49
|
- **工具调用**:Agent 用自己的工具,每次调用在 pi 里记成一次 `agent_tool` 工具调用(参数是标题、种类和对象,例如 `{ kind: "execute", target: "npm test" }`),所以 Ta 显示成和自己的工具一样的一行,结果就是 Agent 工具的输出。种类是 edit、delete、move 的调用一说出要改的文件(`locations` 或参数里的 `file_path` 等),或者带来 ACP diff,扩展就经 `pi.events` 发 `ta:file-write`(`{ path, before? }`,见 ta-protocol 的 `TA_FILE_WRITE_EVENT`),让 ta-changes 在 Agent 动手前留下文件原样。具体做法:Agent 开始一次调用时,结束当前这条 assistant 消息(`toolUse`);pi “执行”`agent_tool` 时只是等 Agent 把这次调用做完;pi 下一次请求时接着流同一轮。有的 Agent(CodeBuddy Code)先流式发参数,等它说参数齐了(`_meta` 的 `toolArgumentsComplete`,或带着参数以 `pending` 再报一次这次调用)才显示;没有这类信号时,1.5 秒没有新消息或 Agent 开始说别的,也算齐了;同时开始的几次调用放进同一条消息,并行显示。`agent_tool` 只在当前模型是 Agent 时启用。
|
|
50
50
|
- **会话**:一个 pi 会话对一个 Agent 用一个 Agent 会话,它的 id 记在 pi 会话里(自定义条目 `ta-agents.session`),重新打开对话时用 `session/load` 接上。分叉,或在 pi 里回退到之前的消息(`/tree`),都会让下一轮新开一个 Agent 会话,并把到此为止的对话作为文字交给它;中途换到 Agent 时也一样(最多 3 万字)。
|
|
51
|
-
- **进程**:同一个 Agent
|
|
51
|
+
- **进程**:同一个 Agent 在同一个目录下的所有会话共用一个进程;按目录分开,是因为 CodeBuddy Code 在启动目录里执行命令,不看会话的目录。CodeBuddy Code 例外,每个对话单独一个进程(约 650 MB),对话关闭时停掉:它的一个进程只回答最后新建或加载的会话,其他会话发消息会一直等不到回复,或在那个会话忙时立刻空着结束。10 分钟没有任何一轮就停掉进程,下次用时再启动并加载会话。只在有请求等待回复时保持 pi 进程不退出,所以 `pi -p` 回答完就退出。
|
|
52
52
|
- **Agent 自己继续时**:后台任务结束后,Agent 可能自己开始一轮(CodeBuddy Code 用 `session_info_update` 的 `unsolicitedTurn` 开始、`session_end` 收尾;其他 Agent 没有明确的结束标志,就在 3 秒没有消息后收尾)。扩展发一条不显示的消息让 pi 开一轮,把这一轮显示出来。
|
|
53
53
|
- **用户在 Agent 干活时说话**:ACP 没有“插话”,所以先存下,这一轮结束后马上作为下一轮发出。停止(中止)会发 `session/cancel`,下一轮会等 Agent 把被取消的这轮收尾(最多 5 秒)。
|
|
54
54
|
- **权限**:和 pi 一样默认不拦:Agent 请求权限时选“允许一次”。设置 `permissions: "ask"` 后,改为在界面上让用户选。Agent 自己的权限模式(例如 CodeBuddy Code 的配置)照常生效。
|
|
@@ -657,7 +657,11 @@ class JsonRpcConnection {
|
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
} else if (message.id === undefined || message.id === null) {
|
|
660
|
-
|
|
660
|
+
try {
|
|
661
|
+
this.onNotification(message.method, message.params);
|
|
662
|
+
} catch (error) {
|
|
663
|
+
console.error(error);
|
|
664
|
+
}
|
|
661
665
|
} else {
|
|
662
666
|
this.answer(message.id, message.method, message.params);
|
|
663
667
|
}
|
|
@@ -695,6 +699,10 @@ var TEXTS = {
|
|
|
695
699
|
en: (agent, command) => `${agent} ran \`${command}\` and said nothing back; it may only show in ${agent}'s own interface.`,
|
|
696
700
|
zh: (agent, command) => `${agent} 已执行 \`${command}\`,没有返回内容(这个命令可能只在 ${agent} 自己的界面里有显示)。`
|
|
697
701
|
},
|
|
702
|
+
starting: {
|
|
703
|
+
en: (agent) => `Starting ${agent}…`,
|
|
704
|
+
zh: (agent) => `正在启动 ${agent}…`
|
|
705
|
+
},
|
|
698
706
|
unfinished: {
|
|
699
707
|
en: (agent) => `${agent} ended its turn before this call finished.`,
|
|
700
708
|
zh: (agent) => `${agent} 在这次调用完成前结束了这一轮。`
|
|
@@ -905,11 +913,9 @@ var BINDING_ENTRY = "ta-agents.session";
|
|
|
905
913
|
var POOL = Symbol.for("ta-agents.pool");
|
|
906
914
|
var AgentPool;
|
|
907
915
|
((AgentPool) => {
|
|
908
|
-
function of(config, cwd) {
|
|
909
|
-
const
|
|
910
|
-
const
|
|
911
|
-
global[POOL] = pool;
|
|
912
|
-
const key = JSON.stringify([config.command, config.args, config.env ?? {}, config.clientMeta ?? {}, cwd]);
|
|
916
|
+
function of(config, cwd, owner) {
|
|
917
|
+
const pool = all();
|
|
918
|
+
const key = keyOf(config, cwd, owner);
|
|
913
919
|
let agent = pool.get(key);
|
|
914
920
|
if (!agent) {
|
|
915
921
|
agent = new AcpAgent(config.name, { command: config.command, args: config.args, env: config.env, clientMeta: config.clientMeta, cwd });
|
|
@@ -918,6 +924,25 @@ var AgentPool;
|
|
|
918
924
|
return agent;
|
|
919
925
|
}
|
|
920
926
|
AgentPool.of = of;
|
|
927
|
+
function release(config, cwd, owner) {
|
|
928
|
+
if (!config.processPerSession) {
|
|
929
|
+
return;
|
|
930
|
+
}
|
|
931
|
+
const pool = all();
|
|
932
|
+
const key = keyOf(config, cwd, owner);
|
|
933
|
+
pool.get(key)?.stop();
|
|
934
|
+
pool.delete(key);
|
|
935
|
+
}
|
|
936
|
+
AgentPool.release = release;
|
|
937
|
+
function keyOf(config, cwd, owner) {
|
|
938
|
+
return JSON.stringify([config.command, config.args, config.env ?? {}, config.clientMeta ?? {}, cwd, config.processPerSession ? owner ?? "" : ""]);
|
|
939
|
+
}
|
|
940
|
+
function all() {
|
|
941
|
+
const global = globalThis;
|
|
942
|
+
const pool = global[POOL] ?? create();
|
|
943
|
+
global[POOL] = pool;
|
|
944
|
+
return pool;
|
|
945
|
+
}
|
|
921
946
|
function create() {
|
|
922
947
|
const pool = new Map;
|
|
923
948
|
process.once("exit", () => {
|
|
@@ -933,13 +958,17 @@ class AgentBindings {
|
|
|
933
958
|
save;
|
|
934
959
|
prepare;
|
|
935
960
|
agentOf;
|
|
961
|
+
release;
|
|
936
962
|
cwd = process.cwd();
|
|
963
|
+
owner;
|
|
937
964
|
ids = new Map;
|
|
938
965
|
opened = new Map;
|
|
939
|
-
|
|
966
|
+
used = new Map;
|
|
967
|
+
constructor(save, prepare, agentOf = AgentPool.of, release = AgentPool.release) {
|
|
940
968
|
this.save = save;
|
|
941
969
|
this.prepare = prepare;
|
|
942
970
|
this.agentOf = agentOf;
|
|
971
|
+
this.release = release;
|
|
943
972
|
}
|
|
944
973
|
restore(entries, fork) {
|
|
945
974
|
this.ids.clear();
|
|
@@ -961,8 +990,12 @@ class AgentBindings {
|
|
|
961
990
|
sessionId(agent) {
|
|
962
991
|
return this.ids.get(agent);
|
|
963
992
|
}
|
|
993
|
+
ready(config) {
|
|
994
|
+
return this.opened.has(config.id) && this.agentOf(config, this.cwd, this.owner).running;
|
|
995
|
+
}
|
|
964
996
|
open(config, signal) {
|
|
965
|
-
|
|
997
|
+
this.used.set(JSON.stringify([config.id, this.cwd, this.owner]), { config, cwd: this.cwd, owner: this.owner });
|
|
998
|
+
const agent = this.agentOf(config, this.cwd, this.owner);
|
|
966
999
|
let opened = this.opened.get(config.id);
|
|
967
1000
|
if (opened) {
|
|
968
1001
|
opened = opened.then((value) => agent.running && agent.sessions.get(value.session.id) === value.session ? { ...value, fresh: false } : this.connect(config, agent, signal));
|
|
@@ -975,6 +1008,10 @@ class AgentBindings {
|
|
|
975
1008
|
}
|
|
976
1009
|
close() {
|
|
977
1010
|
this.opened.clear();
|
|
1011
|
+
for (const { config, cwd, owner } of this.used.values()) {
|
|
1012
|
+
this.release(config, cwd, owner);
|
|
1013
|
+
}
|
|
1014
|
+
this.used.clear();
|
|
978
1015
|
}
|
|
979
1016
|
async connect(config, agent, signal) {
|
|
980
1017
|
if (AgentBindings.isRemote(this.cwd)) {
|
|
@@ -1024,7 +1061,8 @@ var PRESETS = [
|
|
|
1024
1061
|
login: "cbc",
|
|
1025
1062
|
env: { CODEBUDDY_CODE_MODE_ENABLED: "1" },
|
|
1026
1063
|
clientMeta: { "codebuddy.ai": { mainAgentSupport: true, toolModeSupport: true } },
|
|
1027
|
-
options: { mode: "fullAccess" }
|
|
1064
|
+
options: { mode: "fullAccess" },
|
|
1065
|
+
processPerSession: true
|
|
1028
1066
|
},
|
|
1029
1067
|
{
|
|
1030
1068
|
id: "claude-code",
|
|
@@ -1666,24 +1704,38 @@ function activate(pi, options = {}) {
|
|
|
1666
1704
|
return option ? { outcome: "selected", optionId: option.optionId } : { outcome: "cancelled" };
|
|
1667
1705
|
},
|
|
1668
1706
|
title: (title) => {
|
|
1669
|
-
if (!pi.getSessionName()) {
|
|
1707
|
+
if (context && !pi.getSessionName()) {
|
|
1670
1708
|
pi.setSessionName(title);
|
|
1671
1709
|
}
|
|
1672
1710
|
},
|
|
1673
1711
|
activity: () => {
|
|
1674
|
-
if (context
|
|
1712
|
+
if (context && context.model?.provider === config.id) {
|
|
1675
1713
|
pi.sendMessage({ customType: ACTIVITY_ENTRY, content: ACTIVITY_TEXT, display: false }, { triggerTurn: true });
|
|
1676
1714
|
}
|
|
1677
1715
|
},
|
|
1678
1716
|
write: (path, before) => {
|
|
1717
|
+
if (!context) {
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1679
1720
|
const file = { path: resolve(context?.cwd ?? bindings.cwd, path), ...before !== undefined ? { before } : {} };
|
|
1680
1721
|
pi.events.emit(TA_FILE_WRITE_EVENT, file);
|
|
1681
1722
|
}
|
|
1682
1723
|
};
|
|
1683
1724
|
learn(config, session);
|
|
1684
|
-
}, options.agentOf);
|
|
1725
|
+
}, options.agentOf, options.release);
|
|
1685
1726
|
const streamer = new AgentStreamer({
|
|
1686
|
-
open: (config, signal) =>
|
|
1727
|
+
open: async (config, signal) => {
|
|
1728
|
+
if (bindings.ready(config)) {
|
|
1729
|
+
return bindings.open(config, signal);
|
|
1730
|
+
}
|
|
1731
|
+
const ui = context?.hasUI ? context.ui : undefined;
|
|
1732
|
+
ui?.setWorkingMessage(text("starting", config.name));
|
|
1733
|
+
try {
|
|
1734
|
+
return await bindings.open(config, signal);
|
|
1735
|
+
} finally {
|
|
1736
|
+
ui?.setWorkingMessage();
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1687
1739
|
calls,
|
|
1688
1740
|
ended: (config, session) => {
|
|
1689
1741
|
if (session.title && !pi.getSessionName()) {
|
|
@@ -1706,6 +1758,10 @@ function activate(pi, options = {}) {
|
|
|
1706
1758
|
}
|
|
1707
1759
|
sessionId = ctx.sessionManager.getSessionId();
|
|
1708
1760
|
Sessions.set(sessionId, self);
|
|
1761
|
+
if (bindings.owner !== sessionId) {
|
|
1762
|
+
bindings.close();
|
|
1763
|
+
bindings.owner = sessionId;
|
|
1764
|
+
}
|
|
1709
1765
|
bindings.cwd = ctx.cwd;
|
|
1710
1766
|
bindings.restore(ctx.sessionManager.getBranch(), event.reason === "fork");
|
|
1711
1767
|
const settings = pi.getSettings().agents;
|
|
@@ -10,10 +10,13 @@ export interface Binding {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* The agents' processes of this process, shared by its pi sessions, which load this package each: one
|
|
13
|
-
* per agent and directory, since some agents run commands where they were started
|
|
13
|
+
* per agent and directory, since some agents run commands where they were started, and one per pi
|
|
14
|
+
* session too for an agent that serves one session per process (`processPerSession`).
|
|
14
15
|
*/
|
|
15
16
|
export declare namespace AgentPool {
|
|
16
|
-
function of(config: AgentConfig, cwd: string): AcpAgent;
|
|
17
|
+
function of(config: AgentConfig, cwd: string, owner?: string): AcpAgent;
|
|
18
|
+
/** Stops the process of `owner`'s own, if it has one: its pi session closed. */
|
|
19
|
+
function release(config: AgentConfig, cwd: string, owner?: string): void;
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* The sessions of agents one pi session talks to, one per agent. Which session that is stays in the
|
|
@@ -23,11 +26,20 @@ export declare namespace AgentPool {
|
|
|
23
26
|
export declare class AgentBindings {
|
|
24
27
|
protected readonly save: (binding: Binding) => void;
|
|
25
28
|
protected readonly prepare: (config: AgentConfig, session: AgentSession) => void;
|
|
26
|
-
protected readonly agentOf: (config: AgentConfig, cwd: string) => AcpAgent;
|
|
29
|
+
protected readonly agentOf: (config: AgentConfig, cwd: string, owner?: string) => AcpAgent;
|
|
30
|
+
protected readonly release: (config: AgentConfig, cwd: string, owner?: string) => void;
|
|
27
31
|
cwd: string;
|
|
32
|
+
/** The pi session: an agent that serves one session per process runs a process for it alone. */
|
|
33
|
+
owner?: string;
|
|
28
34
|
protected readonly ids: Map<string, string>;
|
|
29
35
|
protected readonly opened: Map<string, Promise<OpenedSession>>;
|
|
30
|
-
|
|
36
|
+
/** The agents opened, with where, to let their own processes go on close. */
|
|
37
|
+
protected readonly used: Map<string, {
|
|
38
|
+
config: AgentConfig;
|
|
39
|
+
cwd: string;
|
|
40
|
+
owner?: string;
|
|
41
|
+
}>;
|
|
42
|
+
constructor(save: (binding: Binding) => void, prepare: (config: AgentConfig, session: AgentSession) => void, agentOf?: (config: AgentConfig, cwd: string, owner?: string) => AcpAgent, release?: (config: AgentConfig, cwd: string, owner?: string) => void);
|
|
31
43
|
restore(entries: readonly unknown[], fork: boolean): void;
|
|
32
44
|
/**
|
|
33
45
|
* The conversation went back (pi's tree): the agents' sessions remember what came after, so the next
|
|
@@ -35,7 +47,10 @@ export declare class AgentBindings {
|
|
|
35
47
|
*/
|
|
36
48
|
forget(): void;
|
|
37
49
|
sessionId(agent: string): string | undefined;
|
|
50
|
+
/** Its session is open in a program that runs: `open` gives it at once. */
|
|
51
|
+
ready(config: AgentConfig): boolean;
|
|
38
52
|
open(config: AgentConfig, signal?: AbortSignal): Promise<OpenedSession>;
|
|
53
|
+
/** The pi session closed: the processes it had of its own stop; shared ones stay for the others. */
|
|
39
54
|
close(): void;
|
|
40
55
|
protected connect(config: AgentConfig, agent: AcpAgent, signal?: AbortSignal): Promise<OpenedSession>;
|
|
41
56
|
static dirs(cwd: string): string[];
|
|
@@ -11,16 +11,14 @@ exports.BINDING_ENTRY = 'ta-agents.session';
|
|
|
11
11
|
const POOL = Symbol.for('ta-agents.pool');
|
|
12
12
|
/**
|
|
13
13
|
* The agents' processes of this process, shared by its pi sessions, which load this package each: one
|
|
14
|
-
* per agent and directory, since some agents run commands where they were started
|
|
14
|
+
* per agent and directory, since some agents run commands where they were started, and one per pi
|
|
15
|
+
* session too for an agent that serves one session per process (`processPerSession`).
|
|
15
16
|
*/
|
|
16
17
|
var AgentPool;
|
|
17
18
|
(function (AgentPool) {
|
|
18
|
-
function of(config, cwd) {
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const pool = (_a = global[POOL]) !== null && _a !== void 0 ? _a : create();
|
|
22
|
-
global[POOL] = pool;
|
|
23
|
-
const key = JSON.stringify([config.command, config.args, (_b = config.env) !== null && _b !== void 0 ? _b : {}, (_c = config.clientMeta) !== null && _c !== void 0 ? _c : {}, cwd]);
|
|
19
|
+
function of(config, cwd, owner) {
|
|
20
|
+
const pool = all();
|
|
21
|
+
const key = keyOf(config, cwd, owner);
|
|
24
22
|
let agent = pool.get(key);
|
|
25
23
|
if (!agent) {
|
|
26
24
|
agent = new acp_agent_1.AcpAgent(config.name, { command: config.command, args: config.args, env: config.env, clientMeta: config.clientMeta, cwd });
|
|
@@ -29,6 +27,29 @@ var AgentPool;
|
|
|
29
27
|
return agent;
|
|
30
28
|
}
|
|
31
29
|
AgentPool.of = of;
|
|
30
|
+
/** Stops the process of `owner`'s own, if it has one: its pi session closed. */
|
|
31
|
+
function release(config, cwd, owner) {
|
|
32
|
+
var _a;
|
|
33
|
+
if (!config.processPerSession) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const pool = all();
|
|
37
|
+
const key = keyOf(config, cwd, owner);
|
|
38
|
+
(_a = pool.get(key)) === null || _a === void 0 ? void 0 : _a.stop();
|
|
39
|
+
pool.delete(key);
|
|
40
|
+
}
|
|
41
|
+
AgentPool.release = release;
|
|
42
|
+
function keyOf(config, cwd, owner) {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return JSON.stringify([config.command, config.args, (_a = config.env) !== null && _a !== void 0 ? _a : {}, (_b = config.clientMeta) !== null && _b !== void 0 ? _b : {}, cwd, config.processPerSession ? (owner !== null && owner !== void 0 ? owner : '') : '']);
|
|
45
|
+
}
|
|
46
|
+
function all() {
|
|
47
|
+
var _a;
|
|
48
|
+
const global = globalThis;
|
|
49
|
+
const pool = (_a = global[POOL]) !== null && _a !== void 0 ? _a : create();
|
|
50
|
+
global[POOL] = pool;
|
|
51
|
+
return pool;
|
|
52
|
+
}
|
|
32
53
|
function create() {
|
|
33
54
|
const pool = new Map();
|
|
34
55
|
process.once('exit', () => {
|
|
@@ -45,13 +66,16 @@ var AgentPool;
|
|
|
45
66
|
* session again; a fork, or going back in the conversation, starts a new one.
|
|
46
67
|
*/
|
|
47
68
|
class AgentBindings {
|
|
48
|
-
constructor(save, prepare, agentOf = AgentPool.of) {
|
|
69
|
+
constructor(save, prepare, agentOf = AgentPool.of, release = AgentPool.release) {
|
|
49
70
|
this.save = save;
|
|
50
71
|
this.prepare = prepare;
|
|
51
72
|
this.agentOf = agentOf;
|
|
73
|
+
this.release = release;
|
|
52
74
|
this.cwd = process.cwd();
|
|
53
75
|
this.ids = new Map();
|
|
54
76
|
this.opened = new Map();
|
|
77
|
+
/** The agents opened, with where, to let their own processes go on close. */
|
|
78
|
+
this.used = new Map();
|
|
55
79
|
}
|
|
56
80
|
restore(entries, fork) {
|
|
57
81
|
this.ids.clear();
|
|
@@ -77,8 +101,13 @@ class AgentBindings {
|
|
|
77
101
|
sessionId(agent) {
|
|
78
102
|
return this.ids.get(agent);
|
|
79
103
|
}
|
|
104
|
+
/** Its session is open in a program that runs: `open` gives it at once. */
|
|
105
|
+
ready(config) {
|
|
106
|
+
return this.opened.has(config.id) && this.agentOf(config, this.cwd, this.owner).running;
|
|
107
|
+
}
|
|
80
108
|
open(config, signal) {
|
|
81
|
-
|
|
109
|
+
this.used.set(JSON.stringify([config.id, this.cwd, this.owner]), { config, cwd: this.cwd, owner: this.owner });
|
|
110
|
+
const agent = this.agentOf(config, this.cwd, this.owner);
|
|
82
111
|
let opened = this.opened.get(config.id);
|
|
83
112
|
if (opened) {
|
|
84
113
|
// The program may have stopped since, idle, and its sessions with it.
|
|
@@ -92,8 +121,13 @@ class AgentBindings {
|
|
|
92
121
|
this.opened.set(config.id, opened);
|
|
93
122
|
return opened;
|
|
94
123
|
}
|
|
124
|
+
/** The pi session closed: the processes it had of its own stop; shared ones stay for the others. */
|
|
95
125
|
close() {
|
|
96
126
|
this.opened.clear();
|
|
127
|
+
for (const { config, cwd, owner } of this.used.values()) {
|
|
128
|
+
this.release(config, cwd, owner);
|
|
129
|
+
}
|
|
130
|
+
this.used.clear();
|
|
97
131
|
}
|
|
98
132
|
async connect(config, agent, signal) {
|
|
99
133
|
var _a, _b, _c;
|
|
@@ -13,6 +13,8 @@ export interface AgentConfig {
|
|
|
13
13
|
clientMeta?: Record<string, unknown>;
|
|
14
14
|
/** Settings of a new session, by the id or category of the agent's option (`mode`, `model`...). */
|
|
15
15
|
options?: Record<string, string>;
|
|
16
|
+
/** A process of its own for each pi session, for an agent that serves one session per process. */
|
|
17
|
+
processPerSession?: boolean;
|
|
16
18
|
}
|
|
17
19
|
/** An agent of `agents` in pi's settings.json; `false` turns a built-in one off. */
|
|
18
20
|
export type AgentSetting = false | Partial<AgentConfig>;
|
|
@@ -22,6 +22,9 @@ const PRESETS = [
|
|
|
22
22
|
env: { CODEBUDDY_CODE_MODE_ENABLED: '1' },
|
|
23
23
|
clientMeta: { 'codebuddy.ai': { mainAgentSupport: true, toolModeSupport: true } },
|
|
24
24
|
options: { mode: 'fullAccess' },
|
|
25
|
+
// It answers only the session it opened or loaded last: a prompt of another one waits forever, or
|
|
26
|
+
// ends at once with nothing while that one works.
|
|
27
|
+
processPerSession: true,
|
|
25
28
|
},
|
|
26
29
|
{
|
|
27
30
|
id: 'claude-code',
|
|
@@ -5,7 +5,8 @@ import type { ExtensionAPI } from './pi-types';
|
|
|
5
5
|
export interface AgentsOptions {
|
|
6
6
|
find?: (program: string) => string | undefined;
|
|
7
7
|
cache?: ModelCache;
|
|
8
|
-
agentOf?: (config: AgentConfig, cwd: string) => AcpAgent;
|
|
8
|
+
agentOf?: (config: AgentConfig, cwd: string, owner?: string) => AcpAgent;
|
|
9
|
+
release?: (config: AgentConfig, cwd: string, owner?: string) => void;
|
|
9
10
|
/** `agents` of the user's settings.json, read when the extension loads, before pi's settings are there. */
|
|
10
11
|
userAgents?: () => Record<string, AgentSetting> | undefined;
|
|
11
12
|
}
|
|
@@ -14,6 +14,7 @@ const agent_session_1 = require("./agent-session");
|
|
|
14
14
|
const agent_streamer_1 = require("./agent-streamer");
|
|
15
15
|
const agent_tool_1 = require("./agent-tool");
|
|
16
16
|
const message_stream_1 = require("./message-stream");
|
|
17
|
+
const texts_1 = require("./texts");
|
|
17
18
|
/** TA_FILE_WRITE_EVENT of @celljs/ta-protocol, which this bundle does not import. */
|
|
18
19
|
const TA_FILE_WRITE_EVENT = 'ta:file-write';
|
|
19
20
|
/** The custom message that starts a pi turn when an agent began one on its own. */
|
|
@@ -144,28 +145,45 @@ function activate(pi, options = {}) {
|
|
|
144
145
|
const option = request.options.find(candidate => candidate.name === chosen);
|
|
145
146
|
return option ? { outcome: 'selected', optionId: option.optionId } : { outcome: 'cancelled' };
|
|
146
147
|
},
|
|
148
|
+
// The agent may still speak after the pi session closed, when pi's API is no longer usable.
|
|
147
149
|
title: title => {
|
|
148
|
-
if (!pi.getSessionName()) {
|
|
150
|
+
if (context && !pi.getSessionName()) {
|
|
149
151
|
pi.setSessionName(title);
|
|
150
152
|
}
|
|
151
153
|
},
|
|
152
154
|
activity: () => {
|
|
153
155
|
var _a;
|
|
154
|
-
if (((_a = context
|
|
156
|
+
if (context && ((_a = context.model) === null || _a === void 0 ? void 0 : _a.provider) === config.id) {
|
|
155
157
|
pi.sendMessage({ customType: ACTIVITY_ENTRY, content: agent_prompt_1.ACTIVITY_TEXT, display: false }, { triggerTurn: true });
|
|
156
158
|
}
|
|
157
159
|
},
|
|
158
160
|
// Other extensions (the list of changed files) hear of the files the agent writes with its own tools.
|
|
159
161
|
write: (path, before) => {
|
|
160
162
|
var _a;
|
|
163
|
+
if (!context) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
161
166
|
const file = { path: (0, node_path_1.resolve)((_a = context === null || context === void 0 ? void 0 : context.cwd) !== null && _a !== void 0 ? _a : bindings.cwd, path), ...(before !== undefined ? { before } : {}) };
|
|
162
167
|
pi.events.emit(TA_FILE_WRITE_EVENT, file);
|
|
163
168
|
},
|
|
164
169
|
};
|
|
165
170
|
learn(config, session);
|
|
166
|
-
}, options.agentOf);
|
|
171
|
+
}, options.agentOf, options.release);
|
|
167
172
|
const streamer = new agent_streamer_1.AgentStreamer({
|
|
168
|
-
open: (config, signal) =>
|
|
173
|
+
open: async (config, signal) => {
|
|
174
|
+
if (bindings.ready(config)) {
|
|
175
|
+
return bindings.open(config, signal);
|
|
176
|
+
}
|
|
177
|
+
// Starting the program and loading its session takes a moment: the user sees what it waits for.
|
|
178
|
+
const ui = (context === null || context === void 0 ? void 0 : context.hasUI) ? context.ui : undefined;
|
|
179
|
+
ui === null || ui === void 0 ? void 0 : ui.setWorkingMessage((0, texts_1.text)('starting', config.name));
|
|
180
|
+
try {
|
|
181
|
+
return await bindings.open(config, signal);
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
ui === null || ui === void 0 ? void 0 : ui.setWorkingMessage();
|
|
185
|
+
}
|
|
186
|
+
},
|
|
169
187
|
calls,
|
|
170
188
|
ended: (config, session) => {
|
|
171
189
|
var _a;
|
|
@@ -190,6 +208,10 @@ function activate(pi, options = {}) {
|
|
|
190
208
|
}
|
|
191
209
|
sessionId = ctx.sessionManager.getSessionId();
|
|
192
210
|
Sessions.set(sessionId, self);
|
|
211
|
+
if (bindings.owner !== sessionId) {
|
|
212
|
+
bindings.close();
|
|
213
|
+
bindings.owner = sessionId;
|
|
214
|
+
}
|
|
193
215
|
bindings.cwd = ctx.cwd;
|
|
194
216
|
bindings.restore(ctx.sessionManager.getBranch(), event.reason === 'fork');
|
|
195
217
|
const settings = pi.getSettings().agents;
|