@celljs/ta 4.15.0 → 4.15.2
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 +79 -4
- package/dist/gateway.mjs +1320 -178
- package/dist/pi/CHANGELOG.md +15 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-3d/README.en.md +11 -0
- package/dist/pi/packages/ta-3d/README.md +11 -0
- package/dist/pi/packages/ta-3d/extension/index.mjs +120 -0
- package/dist/pi/packages/ta-3d/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-3d/lib/extension.js +24 -0
- package/dist/pi/packages/ta-3d/lib/i18n.d.ts +19 -0
- package/dist/pi/packages/ta-3d/lib/i18n.js +50 -0
- package/dist/pi/packages/ta-3d/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-3d/lib/index.js +22 -0
- package/dist/pi/packages/ta-3d/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-3d/lib/react.js +8 -0
- package/dist/pi/packages/ta-3d/lib/scene-card.d.ts +4 -0
- package/dist/pi/packages/ta-3d/lib/scene-card.js +60 -0
- package/dist/pi/packages/ta-3d/lib/scene-prompt.d.ts +7 -0
- package/dist/pi/packages/ta-3d/lib/scene-prompt.js +15 -0
- package/dist/pi/packages/ta-3d/lib/scene-protocol.d.ts +5 -0
- package/dist/pi/packages/ta-3d/lib/scene-protocol.js +8 -0
- package/dist/pi/packages/ta-3d/lib/scene-spec.d.ts +59 -0
- package/dist/pi/packages/ta-3d/lib/scene-spec.js +141 -0
- package/dist/pi/packages/ta-3d/lib/scene-view.d.ts +57 -0
- package/dist/pi/packages/ta-3d/lib/scene-view.js +339 -0
- package/dist/pi/packages/ta-3d/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-3d/lib/style.js +33 -0
- package/dist/pi/packages/ta-3d/package.json +58 -0
- package/dist/pi/packages/ta-3d/web/index.js +660 -0
- 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 +198 -6
- package/dist/pi/packages/ta-agents/lib/acp-agent.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.js +20 -2
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +14 -5
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +13 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +29 -4
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +5 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +16 -4
- package/dist/pi/packages/ta-agents/lib/agent-session.js +34 -4
- package/dist/pi/packages/ta-agents/lib/agent-sign-in.d.ts +28 -0
- package/dist/pi/packages/ta-agents/lib/agent-sign-in.js +62 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.d.ts +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +40 -3
- package/dist/pi/packages/ta-agents/lib/extension.js +12 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +43 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +47 -0
- package/dist/pi/packages/ta-agents/package.json +1 -1
- package/dist/pi/packages/ta-bots/host/index.mjs +35 -4
- package/dist/pi/packages/ta-bots/lib/bot-service.d.ts +6 -0
- package/dist/pi/packages/ta-bots/lib/bot-service.js +27 -2
- package/dist/pi/packages/ta-bots/lib/bot-store.d.ts +8 -1
- package/dist/pi/packages/ta-bots/lib/bot-store.js +16 -2
- package/dist/pi/packages/ta-bots/lib/weixin-channel.js +3 -1
- 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/host/index.mjs +3 -0
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-computer-use/package.json +1 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +4 -2
- package/dist/pi/packages/ta-cron/package.json +1 -1
- package/dist/pi/packages/ta-cron/web/index.js +8 -4
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-extensions/web/index.js +2 -0
- package/dist/pi/packages/ta-games/package.json +1 -1
- package/dist/pi/packages/ta-glance/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +1 -0
- package/dist/pi/packages/ta-glance/package.json +1 -1
- package/dist/pi/packages/ta-initiative/lib/inbox.js +47 -29
- package/dist/pi/packages/ta-initiative/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-initiative/lib/style.js +27 -14
- package/dist/pi/packages/ta-initiative/package.json +1 -1
- package/dist/pi/packages/ta-initiative/web/index.js +92 -50
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-moments/extension/index.mjs +2 -0
- package/dist/pi/packages/ta-moments/host/index.mjs +2 -0
- package/dist/pi/packages/ta-moments/package.json +1 -1
- package/dist/pi/packages/ta-moments/web/index.js +2 -0
- package/dist/pi/packages/ta-nearby/lib/page.js +1 -1
- package/dist/pi/packages/ta-nearby/package.json +1 -1
- package/dist/pi/packages/ta-nearby/web/index.js +3 -4
- package/dist/pi/packages/ta-notify/lib/settings.js +9 -2
- package/dist/pi/packages/ta-notify/package.json +1 -1
- package/dist/pi/packages/ta-notify/web/index.js +18 -6
- package/dist/pi/packages/ta-plot/README.en.md +12 -0
- package/dist/pi/packages/ta-plot/README.md +12 -0
- package/dist/pi/packages/ta-plot/extension/index.mjs +121 -0
- package/dist/pi/packages/ta-plot/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-plot/lib/extension.js +24 -0
- package/dist/pi/packages/ta-plot/lib/i18n.d.ts +14 -0
- package/dist/pi/packages/ta-plot/lib/i18n.js +30 -0
- package/dist/pi/packages/ta-plot/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-plot/lib/index.js +25 -0
- package/dist/pi/packages/ta-plot/lib/plot-expression.d.ts +16 -0
- package/dist/pi/packages/ta-plot/lib/plot-expression.js +209 -0
- package/dist/pi/packages/ta-plot/lib/plot-painter.d.ts +28 -0
- package/dist/pi/packages/ta-plot/lib/plot-painter.js +208 -0
- package/dist/pi/packages/ta-plot/lib/plot-prompt.d.ts +7 -0
- package/dist/pi/packages/ta-plot/lib/plot-prompt.js +16 -0
- package/dist/pi/packages/ta-plot/lib/plot-protocol.d.ts +7 -0
- package/dist/pi/packages/ta-plot/lib/plot-protocol.js +10 -0
- package/dist/pi/packages/ta-plot/lib/plot-scene.d.ts +65 -0
- package/dist/pi/packages/ta-plot/lib/plot-scene.js +427 -0
- package/dist/pi/packages/ta-plot/lib/plot-spec.d.ts +86 -0
- package/dist/pi/packages/ta-plot/lib/plot-spec.js +165 -0
- package/dist/pi/packages/ta-plot/lib/plot-view.d.ts +4 -0
- package/dist/pi/packages/ta-plot/lib/plot-view.js +205 -0
- package/dist/pi/packages/ta-plot/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-plot/lib/react.js +8 -0
- package/dist/pi/packages/ta-plot/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-plot/lib/style.js +47 -0
- package/dist/pi/packages/ta-plot/package.json +57 -0
- package/dist/pi/packages/ta-plot/web/index.js +1320 -0
- package/dist/pi/packages/ta-recall/package.json +1 -1
- package/dist/pi/packages/ta-rooms/lib/doubles-view.js +8 -1
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-rooms/lib/style.js +1 -0
- package/dist/pi/packages/ta-rooms/package.json +1 -1
- package/dist/pi/packages/ta-rooms/web/index.js +17 -5
- package/dist/pi/packages/ta-share/lib/share-dialog.js +3 -1
- package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-share/lib/style.js +1 -0
- package/dist/pi/packages/ta-share/package.json +1 -1
- package/dist/pi/packages/ta-share/web/index.js +6 -2
- package/dist/pi/packages/ta-sync/lib/panel.js +4 -1
- package/dist/pi/packages/ta-sync/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-sync/lib/style.js +1 -0
- package/dist/pi/packages/ta-sync/package.json +1 -1
- package/dist/pi/packages/ta-sync/web/index.js +9 -3
- package/dist/pi/packages/ta-sync-cloud/package.json +1 -1
- package/dist/pi/packages/ta-team/lib/dialogs.js +6 -3
- package/dist/pi/packages/ta-team/package.json +1 -1
- package/dist/pi/packages/ta-team/web/index.js +11 -6
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +2 -0
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-sclOP11q.js → abnfDiagram-S7VZAUFO-Dd51Bqbx.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-Bitg4Dpy.js → architecture-WOLXFQ4H-BbG3_x7_.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-Hc0W5khF.js → architectureDiagram-YGSQEFNW-DbJO4t8I.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-D2ZWatLV.js → blockDiagram-APKKGZFW-BwtrHF1f.js} +1 -1
- package/dist/public/assets/{browser-D-etIMuL.js → browser-CTbeNBsA.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CWEcyfwV.js → c4Diagram-KJ2TOQU5-CfBe5A0H.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-CWbrJHxK.js → chunk-6MUBBAK2-C7R0mhrg.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-DJQdD4iX.js → chunk-AXFCVDMN-VQgQruZT.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-CYiiJcBj.js → chunk-BG4553SI-CkUi_vD5.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-NrNC1UeX.js → chunk-DQASFODM-BAQq7ktk.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-BIHXOwS2.js → chunk-HFQBQIA3-B1oF8lB7.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-CcU_AFwQ.js → chunk-KQLB2F66-DE5amcgT.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-DGfNbbcL.js → chunk-KS47KZWR-ev9S_csp.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-B4PSS_Pp.js → chunk-LEVMRMFU-ziqnRvTG.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-1555_mm4.js → chunk-M57EVK23-DaqPdEKA.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-zbNEbYJ8.js → chunk-OY52VR5R-DFOG8j6z.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-C-nNDGuN.js → chunk-QB3YPZ4I-eg35JLLN.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-DcXXuhbl.js → chunk-R3KSYZAL-J73nie-R.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-Bb77QkUj.js → chunk-STOXU5M4-B8EvDZvB.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-D8IJkNq5.js → chunk-TU62E6Q5-DyCM007V.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BzejexgB.js → chunk-X4PVCEUW-BBGeCNmA.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-D2GPHyll.js → chunk-XXDRQBXY-CAtJ2Wph.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-CUEzxxI8.js → classDiagram-v2-L25IHNXF-DhQM6yHy.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-CJdgJyUw.js → cose-bilkent-JH36ORCC-AqIcHabu.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-yFytgtiy.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-D0F_9jN8.js → cynefinDiagram-L36ESFBY-7SyXzhRd.js} +1 -1
- package/dist/public/assets/{d3-selection-BoARy1rP.js → d3-selection-DsahLieG.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-CzI5gZOv.js → dagre-SPEB5RXH-DalaGtMS.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-BCtNcE7M.js → diagram-3B7GL73J-BcY-qB9G.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-DV9U4KeH.js → diagram-DNEMPZML-NV7fbe0h.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-DHU45Sd4.js → diagram-L3MUGCDN-BPx4GHoj.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-Ba5oVP56.js → diagram-LA4NIPWU-BeUxqmw1.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-B1Nk6qet.js → diagram-MHCOC4E2-Dlg1S5na.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-DFwA3q09.js → diagram-XPFHEONP-DQhRoMkK.js} +1 -1
- package/dist/public/assets/{dist-Col1xVDT.js → dist-CQU8zJh_.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-BuBgxBJ2.js → ebnfDiagram-UZSYDL2S-gVEs3Um2.js} +1 -1
- package/dist/public/assets/{editor.api-BLlyFz5x.js → editor.api-SQ1snuat.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-BPEI--zX.js → elk-XV6XMXQE-CHtlrPwu.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-Cci0kYUw.js → erDiagram-EYBAPDEH-B0xok726.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-B0eT5X1_.js → eventmodeling-K75KTNOO-CFwphA0e.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Cwye_DsX.js +1 -0
- package/dist/public/assets/{freemarker2-CAZGFA3W.js → freemarker2-DJKO-X2B.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-DEm85e1I.js → ganttDiagram-23REXITY-B5wVGN1A.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BYzb--zb.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-DJAZD2LR.js → gitGraphDiagram-STJD7YCW-DEjNU1R_.js} +1 -1
- package/dist/public/assets/{handlebars-Agkl4nGr.js → handlebars-ChVN7JPd.js} +1 -1
- package/dist/public/assets/{html-Cu-CsqZI.js → html-CQ0znKSa.js} +1 -1
- package/dist/public/assets/{index-TeLHaE4u.js → index-CLlacdXR.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-na0qX3JP.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-4zHsBnIy.js → infoDiagram-KBXO4MBG-CJtrS72M.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-Bg8OYLGr.js → ishikawaDiagram-M35NCXHK-qYI1QBsK.js} +1 -1
- package/dist/public/assets/{javascript-BdMDRX8l.js → javascript-B-DHbkyI.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-B2xtzmpE.js → journeyDiagram-OPLOXDXO-BOQ2y2ZZ.js} +1 -1
- package/dist/public/assets/{jsonMode-Dg92qQvX.js → jsonMode-XuGC5N_z.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-DQ4N7t_w.js → kanban-definition-BZKZHSQY-BJ64tKdP.js} +1 -1
- package/dist/public/assets/{liquid-BydEnYkh.js → liquid-B0Ujylzc.js} +1 -1
- package/dist/public/assets/{mdx-XZXeM7ll.js → mdx-B19-V510.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-H24--uw9.js → mermaid-parser.core-Scb01iBq.js} +3 -3
- package/dist/public/assets/{mermaid.core-BmCrSjUU.js → mermaid.core-BMuvs7us.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-CGQXKItp.js → mindmap-definition-I2QAS2VK-BYfOS3XN.js} +1 -1
- package/dist/public/assets/module-B3SKdB70.js +1 -0
- package/dist/public/assets/module-DOrYVZ7B.js +2615 -0
- package/dist/public/assets/{monaco-DP8M_Ttp.js → monaco-Bbe2os7m.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-jhCd70vR.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CXKRGFUs.js → pegDiagram-FD4XPPHP-D-Vlq9Gm.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-DV0NJFsI.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-9XEDP1wR.js → pieDiagram-J4AKIIQI-_-94-aMD.js} +1 -1
- package/dist/public/assets/{python-C-0PA82u.js → python-CWnMIOYq.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-C-uxTp-5.js → quadrantDiagram-XTYBLID2-BhFUbUYz.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-Co-Hlf34.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-DKMPEjDD.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-CTft_ST0.js → railroad-abnf-LNEFI6M7-yUa9GGCQ.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-DfRJhL7G.js → railroad-ebnf-DWYD2UWJ-xY4YiL8M.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-DFePx4YD.js → railroad-peg-JR7BVNR7-BYFYCUAQ.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-BmK1KUsT.js → railroadDiagram-MRQ6NCDL-C9FVhj0k.js} +1 -1
- package/dist/public/assets/{razor-DEKNSiT7.js → razor-bDtpN6EJ.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-Ds27pS9Y.js → requirementDiagram-Y7LWUY3S-DLmAg-6C.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-e2OTzBma.js → sankeyDiagram-WGJFYUXA-Bl5IpDk4.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-BcoIpxF6.js → sequenceDiagram-5NDRBG5M-Z-N0OiT_.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-CNr67mC9.js → stateDiagram-v2-FJ4FJNEA-ctKQz8Mo.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-DKPgHCev.js → swimlanes-UMQ2AFYF-CWLKnALg.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CU76xJSu.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-BcCmuE6C.js → timeline-definition-SEUHKTQE-DP8Ph_d6.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-JMMnu_MW.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-CPlAD3X1.js +1 -0
- package/dist/public/assets/{typescript-B1Uk3m6A.js → typescript-CGpNlLbn.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-BpCD8dP7.js → usecaseDiagram-AFA6YXN4-DvFjNj3J.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-CQjX5_-8.js → vennDiagram-NNMJR3RB-3m2F2H-I.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-Dhc8wpLp.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-D7gYo9fV.js → wardleyDiagram-S7YFUSEH-CsMntu16.js} +1 -1
- package/dist/public/assets/{xml-DBh_LekU.js → xml-ByiLoakX.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-B_1aOZKU.js → xychartDiagram-GGNKY7IX-C80rxvM0.js} +1 -1
- package/dist/public/assets/{yaml-BE55tHva.js → yaml-Cz2Af5Rj.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +2589 -757
- package/package.json +39 -37
- package/dist/public/assets/cynefin-EF2NZ3EQ-DBnkPRHn.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-CmMdmAxj.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-DKo3OVhR.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-tKl26QqM.js +0 -1
- package/dist/public/assets/module-1mERtQ0Z.js +0 -1
- package/dist/public/assets/module-BxIQdJqY.js +0 -2449
- package/dist/public/assets/packet-JDAUHWVQ-CnBx3hR7.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-hogxgeR2.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-CdWiN8Cw.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DnYOBI5V.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-U0uzjboz.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-4ppY0Rs5.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-CAvLAs7q.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-D_F3qmRJ.js +0 -1
|
@@ -15,6 +15,8 @@ export interface AgentSessionCallbacks {
|
|
|
15
15
|
activity(session: AgentSession): void;
|
|
16
16
|
/** A call of the agent is about to change a file, or changed it (see WriteListener). */
|
|
17
17
|
write?: WriteListener;
|
|
18
|
+
/** What the user said while the agent worked and waits for its turn to end changed: when each was written. */
|
|
19
|
+
queued?(at: number[]): void;
|
|
18
20
|
}
|
|
19
21
|
/** What an agent says of a request of its model it retries: why (`network`), and which attempt, when it says. */
|
|
20
22
|
export interface AgentRetry {
|
|
@@ -22,8 +24,9 @@ export interface AgentRetry {
|
|
|
22
24
|
attempt?: number;
|
|
23
25
|
}
|
|
24
26
|
/**
|
|
25
|
-
* A session of an ACP agent: its settings, and its turn. A prompt starts a turn; what the user says
|
|
26
|
-
*
|
|
27
|
+
* A session of an ACP agent: its settings, and its turn. A prompt starts a turn; what the user says while it
|
|
28
|
+
* runs goes into it (`session/steer`, CodeBuddy Code's), which the agent reads before it asks its model again,
|
|
29
|
+
* or, to an agent without it, once the turn ended, since ACP itself has no way to steer a running turn.
|
|
27
30
|
*/
|
|
28
31
|
export declare class AgentSession {
|
|
29
32
|
protected readonly host: AgentSessionHost;
|
|
@@ -47,6 +50,10 @@ export declare class AgentSession {
|
|
|
47
50
|
/** How much of its context the agent last said it used, to see it compact. */
|
|
48
51
|
protected context?: number;
|
|
49
52
|
protected readonly queued: Acp.ContentBlock[][];
|
|
53
|
+
/** When what is queued was written. */
|
|
54
|
+
protected queuedAt: number[];
|
|
55
|
+
/** The agent takes `session/steer`: until it says it has no such method. */
|
|
56
|
+
protected steers: boolean;
|
|
50
57
|
protected quietTimer?: ReturnType<typeof setTimeout>;
|
|
51
58
|
protected abandoned?: AgentTurn;
|
|
52
59
|
/** The answer to the last `session/prompt`, settled or not. */
|
|
@@ -73,8 +80,13 @@ export declare class AgentSession {
|
|
|
73
80
|
update(update: Acp.SessionUpdate): void;
|
|
74
81
|
/** Starts a turn with `prompt`. */
|
|
75
82
|
prompt(prompt: Acp.ContentBlock[]): AgentTurn;
|
|
76
|
-
/**
|
|
77
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Gives `prompt` to the turn that runs, which the agent reads before it asks its model again: true when it
|
|
85
|
+
* took it. An agent that does not know `session/steer` is not asked again; one whose turn just ended says no.
|
|
86
|
+
*/
|
|
87
|
+
steer(prompt: Acp.ContentBlock[]): Promise<boolean>;
|
|
88
|
+
/** Keeps `prompt`, of the user messages written at `at`, for when the current turn ended. */
|
|
89
|
+
queue(prompt: Acp.ContentBlock[], at?: number[]): void;
|
|
78
90
|
/** The prompts kept while a turn ran, as one. */
|
|
79
91
|
takeQueued(): Acp.ContentBlock[] | undefined;
|
|
80
92
|
/**
|
|
@@ -10,8 +10,9 @@ const ABANDON_WAIT_MS = 5000;
|
|
|
10
10
|
/** How long a prompt waits for the agent to answer the one before, which it may still finish after saying it is idle. */
|
|
11
11
|
const ANSWER_WAIT_MS = 15000;
|
|
12
12
|
/**
|
|
13
|
-
* A session of an ACP agent: its settings, and its turn. A prompt starts a turn; what the user says
|
|
14
|
-
*
|
|
13
|
+
* A session of an ACP agent: its settings, and its turn. A prompt starts a turn; what the user says while it
|
|
14
|
+
* runs goes into it (`session/steer`, CodeBuddy Code's), which the agent reads before it asks its model again,
|
|
15
|
+
* or, to an agent without it, once the turn ended, since ACP itself has no way to steer a running turn.
|
|
15
16
|
*/
|
|
16
17
|
class AgentSession {
|
|
17
18
|
constructor(host, id, setup) {
|
|
@@ -22,6 +23,10 @@ class AgentSession {
|
|
|
22
23
|
/** The notes of Ta's packages the agent was given (AgentPrompt.notes), each once, until it compacts its context. */
|
|
23
24
|
this.told = new Set();
|
|
24
25
|
this.queued = [];
|
|
26
|
+
/** When what is queued was written. */
|
|
27
|
+
this.queuedAt = [];
|
|
28
|
+
/** The agent takes `session/steer`: until it says it has no such method. */
|
|
29
|
+
this.steers = true;
|
|
25
30
|
/** The agent said it works on the turn (a phase other than idle), so its next idle ends it. */
|
|
26
31
|
this.working = false;
|
|
27
32
|
/** When the last message of the user sent to the agent was written: sent once, not again with a retry. */
|
|
@@ -127,15 +132,40 @@ class AgentSession {
|
|
|
127
132
|
this.answer = answer;
|
|
128
133
|
return turn;
|
|
129
134
|
}
|
|
130
|
-
/**
|
|
131
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Gives `prompt` to the turn that runs, which the agent reads before it asks its model again: true when it
|
|
137
|
+
* took it. An agent that does not know `session/steer` is not asked again; one whose turn just ended says no.
|
|
138
|
+
*/
|
|
139
|
+
async steer(prompt) {
|
|
140
|
+
if (!this.steers || !this.turn) {
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
const answer = await this.host.request('session/steer', { sessionId: this.id, contentBlocks: prompt });
|
|
145
|
+
return (answer === null || answer === void 0 ? void 0 : answer.steered) === true;
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (error.code === acp_protocol_1.Acp.METHOD_NOT_FOUND) {
|
|
149
|
+
this.steers = false;
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Keeps `prompt`, of the user messages written at `at`, for when the current turn ended. */
|
|
155
|
+
queue(prompt, at = []) {
|
|
156
|
+
var _a, _b;
|
|
132
157
|
this.queued.push(prompt);
|
|
158
|
+
this.queuedAt.push(...at);
|
|
159
|
+
(_b = (_a = this.callbacks).queued) === null || _b === void 0 ? void 0 : _b.call(_a, [...this.queuedAt]);
|
|
133
160
|
}
|
|
134
161
|
/** The prompts kept while a turn ran, as one. */
|
|
135
162
|
takeQueued() {
|
|
163
|
+
var _a, _b;
|
|
136
164
|
if (!this.queued.length) {
|
|
137
165
|
return undefined;
|
|
138
166
|
}
|
|
167
|
+
this.queuedAt = [];
|
|
168
|
+
(_b = (_a = this.callbacks).queued) === null || _b === void 0 ? void 0 : _b.call(_a, []);
|
|
139
169
|
return this.queued.splice(0).flat();
|
|
140
170
|
}
|
|
141
171
|
/**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AcpAgent } from './acp-agent';
|
|
2
|
+
import { Acp } from './acp-protocol';
|
|
3
|
+
import type { AgentConfig } from './agent-catalog';
|
|
4
|
+
/** What signing in asks of the user, as pi's extension UI has it. */
|
|
5
|
+
export interface SignInUi {
|
|
6
|
+
select(title: string, options: string[], opts?: {
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
}): Promise<string | undefined>;
|
|
9
|
+
notify(message: string, type?: 'info' | 'warning' | 'error'): void;
|
|
10
|
+
setWorkingMessage(message?: string): void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Signing the user in to an agent that asks for it, as the agent offers in `initialize`: the user picks a
|
|
14
|
+
* way, the agent opens its page in the browser of this computer (CodeBuddy Code also says which page, for a
|
|
15
|
+
* user on another device, who gets it as a notice with a link), and the turn goes on once signed in.
|
|
16
|
+
*/
|
|
17
|
+
export declare class AgentSignIn {
|
|
18
|
+
protected readonly config: AgentConfig;
|
|
19
|
+
protected readonly agent: AcpAgent;
|
|
20
|
+
protected readonly ui: SignInUi;
|
|
21
|
+
constructor(config: AgentConfig, agent: AcpAgent, ui: SignInUi);
|
|
22
|
+
static required(error: unknown): boolean;
|
|
23
|
+
/** What a way to sign in says: `Sign in with WeChat`; its own name when the agent words it otherwise. */
|
|
24
|
+
static label(method: Acp.AuthMethod): string;
|
|
25
|
+
/** True once the user signed in; false when they picked no way, or it did not work. */
|
|
26
|
+
run(signal?: AbortSignal): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=agent-sign-in.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentSignIn = void 0;
|
|
4
|
+
const acp_protocol_1 = require("./acp-protocol");
|
|
5
|
+
const texts_1 = require("./texts");
|
|
6
|
+
/**
|
|
7
|
+
* Signing the user in to an agent that asks for it, as the agent offers in `initialize`: the user picks a
|
|
8
|
+
* way, the agent opens its page in the browser of this computer (CodeBuddy Code also says which page, for a
|
|
9
|
+
* user on another device, who gets it as a notice with a link), and the turn goes on once signed in.
|
|
10
|
+
*/
|
|
11
|
+
class AgentSignIn {
|
|
12
|
+
constructor(config, agent, ui) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.agent = agent;
|
|
15
|
+
this.ui = ui;
|
|
16
|
+
}
|
|
17
|
+
static required(error) {
|
|
18
|
+
return (error === null || error === void 0 ? void 0 : error.code) === acp_protocol_1.Acp.AUTH_REQUIRED;
|
|
19
|
+
}
|
|
20
|
+
/** What a way to sign in says: `Sign in with WeChat`; its own name when the agent words it otherwise. */
|
|
21
|
+
static label(method) {
|
|
22
|
+
const known = (0, texts_1.text)('signInMethod', method.id);
|
|
23
|
+
if (known) {
|
|
24
|
+
return (0, texts_1.text)('signInWith', known);
|
|
25
|
+
}
|
|
26
|
+
const named = /^(?:log ?in|sign ?in) (?:with|via) (.+)$/i.exec(method.name.trim());
|
|
27
|
+
return named ? (0, texts_1.text)('signInWith', named[1]) : method.name;
|
|
28
|
+
}
|
|
29
|
+
/** True once the user signed in; false when they picked no way, or it did not work. */
|
|
30
|
+
async run(signal) {
|
|
31
|
+
var _a;
|
|
32
|
+
var _b;
|
|
33
|
+
const methods = (_b = (_a = this.agent.initialized) === null || _a === void 0 ? void 0 : _a.authMethods) !== null && _b !== void 0 ? _b : [];
|
|
34
|
+
if (!methods.length) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
const labels = methods.map(method => AgentSignIn.label(method));
|
|
38
|
+
const chosen = await this.ui.select((0, texts_1.text)('signInPick', this.config.name), labels, { signal });
|
|
39
|
+
const method = chosen === undefined ? undefined : methods[labels.indexOf(chosen)];
|
|
40
|
+
if (!method || (signal === null || signal === void 0 ? void 0 : signal.aborted)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
this.ui.setWorkingMessage((0, texts_1.text)('signingIn', this.config.name));
|
|
44
|
+
try {
|
|
45
|
+
await this.agent.authenticate(method.id, url => this.ui.notify((0, texts_1.text)('signInPage', this.config.name, url)), signal);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
if (signal === null || signal === void 0 ? void 0 : signal.aborted) {
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
this.ui.notify((0, texts_1.text)('signInFailed', this.config.name), 'warning');
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
this.ui.setWorkingMessage();
|
|
56
|
+
}
|
|
57
|
+
this.ui.notify((0, texts_1.text)('signedIn', this.config.name));
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.AgentSignIn = AgentSignIn;
|
|
62
|
+
//# sourceMappingURL=agent-sign-in.js.map
|
|
@@ -11,12 +11,19 @@ export interface OpenedSession {
|
|
|
11
11
|
images: boolean;
|
|
12
12
|
/** The directory of the session, as given and as its real path: agents may report either. */
|
|
13
13
|
dirs: string[];
|
|
14
|
+
/**
|
|
15
|
+
* When the user messages were written that waited for a turn of the session that a stop of the process cut
|
|
16
|
+
* off (AgentSession.queue): the agent never had them. Only the first time the session opens again.
|
|
17
|
+
*/
|
|
18
|
+
missed?: number[];
|
|
14
19
|
}
|
|
15
20
|
export interface AgentStreamHost {
|
|
16
21
|
open(config: AgentConfig, signal?: AbortSignal): Promise<OpenedSession>;
|
|
17
22
|
readonly calls: Map<string, AgentCall>;
|
|
18
23
|
/** A turn of `session` ended. */
|
|
19
24
|
ended(config: AgentConfig, session: AgentSession): void;
|
|
25
|
+
/** The agent asks the user to sign in: true once they did, so that what asked is tried again. */
|
|
26
|
+
signIn?(config: AgentConfig, signal?: AbortSignal): Promise<boolean>;
|
|
20
27
|
}
|
|
21
28
|
/**
|
|
22
29
|
* pi's `streamSimple` for an agent. A pi turn sends what the user said since the agent last answered
|
|
@@ -4,6 +4,7 @@ exports.AgentStreamer = void 0;
|
|
|
4
4
|
const acp_protocol_1 = require("./acp-protocol");
|
|
5
5
|
const agent_catalog_1 = require("./agent-catalog");
|
|
6
6
|
const agent_prompt_1 = require("./agent-prompt");
|
|
7
|
+
const agent_sign_in_1 = require("./agent-sign-in");
|
|
7
8
|
const agent_tool_1 = require("./agent-tool");
|
|
8
9
|
const message_stream_1 = require("./message-stream");
|
|
9
10
|
const texts_1 = require("./texts");
|
|
@@ -42,21 +43,51 @@ class AgentStreamer {
|
|
|
42
43
|
return stream;
|
|
43
44
|
}
|
|
44
45
|
async run(config, model, context, options, builder) {
|
|
46
|
+
var _a, _b;
|
|
45
47
|
const signal = options === null || options === void 0 ? void 0 : options.signal;
|
|
46
|
-
|
|
48
|
+
// Signed in once, a request that asked for it is tried once more; again, it fails.
|
|
49
|
+
let signedIn = false;
|
|
50
|
+
const signIn = async (error) => {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
if (signedIn || !agent_sign_in_1.AgentSignIn.required(error) || !(await ((_b = (_a = this.host).signIn) === null || _b === void 0 ? void 0 : _b.call(_a, config, signal)))) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
signedIn = true;
|
|
56
|
+
return true;
|
|
57
|
+
};
|
|
58
|
+
const { session, fresh, images, dirs, missed } = await this.host.open(config, signal).catch(async (error) => {
|
|
59
|
+
if (await signIn(error)) {
|
|
60
|
+
return this.host.open(config, signal);
|
|
61
|
+
}
|
|
62
|
+
throw error;
|
|
63
|
+
});
|
|
47
64
|
let pending = agent_prompt_1.AgentPrompt.pending(context.messages);
|
|
48
65
|
if (session.failure !== undefined) {
|
|
49
66
|
// pi retries the turn that failed without its error: what the user said then went already.
|
|
50
67
|
pending = pending.filter(message => !(message.timestamp <= session.delivered));
|
|
51
68
|
}
|
|
52
69
|
let turn = session.turn;
|
|
70
|
+
/** What the turn of this message was started with: sent again after signing in. */
|
|
71
|
+
let sent;
|
|
53
72
|
if (turn) {
|
|
54
|
-
// What the user said while the agent works goes
|
|
73
|
+
// What the user said while the agent works goes into its turn, or, when it cannot take it, once the turn ended.
|
|
55
74
|
if (pending.length) {
|
|
56
|
-
|
|
75
|
+
const blocks = agent_prompt_1.AgentPrompt.blocks(pending, images);
|
|
76
|
+
const at = pending.map(message => { var _a; return (_a = message.timestamp) !== null && _a !== void 0 ? _a : 0; });
|
|
77
|
+
if (await session.steer(blocks)) {
|
|
78
|
+
session.delivered = Math.max(session.delivered, ...at);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
session.queue(blocks, at);
|
|
82
|
+
}
|
|
57
83
|
}
|
|
58
84
|
}
|
|
59
85
|
else {
|
|
86
|
+
if (missed === null || missed === void 0 ? void 0 : missed.length) {
|
|
87
|
+
// Said while the agent worked before a restart: it goes first, as it would have.
|
|
88
|
+
pending = [...agent_prompt_1.AgentPrompt.written(context.messages, missed).filter(message => !pending.includes(message)), ...pending];
|
|
89
|
+
(_b = (_a = session.callbacks).queued) === null || _b === void 0 ? void 0 : _b.call(_a, []);
|
|
90
|
+
}
|
|
60
91
|
let prompt = pending.length ? agent_prompt_1.AgentPrompt.blocks(pending, images) : session.takeQueued();
|
|
61
92
|
if (!(prompt === null || prompt === void 0 ? void 0 : prompt.length) && session.failure !== undefined) {
|
|
62
93
|
// pi's retry of a turn that failed: the agent keeps its history, and goes on from where it stopped.
|
|
@@ -81,6 +112,7 @@ class AgentStreamer {
|
|
|
81
112
|
await session.idle();
|
|
82
113
|
await this.configure(session, model, options, signal);
|
|
83
114
|
turn = session.prompt(prompt);
|
|
115
|
+
sent = prompt;
|
|
84
116
|
}
|
|
85
117
|
for (;;) {
|
|
86
118
|
const item = await turn.next(signal);
|
|
@@ -103,6 +135,7 @@ class AgentStreamer {
|
|
|
103
135
|
const queued = session.takeQueued();
|
|
104
136
|
if (queued) {
|
|
105
137
|
turn = session.prompt(queued);
|
|
138
|
+
sent = queued;
|
|
106
139
|
break;
|
|
107
140
|
}
|
|
108
141
|
if (item.reason === 'cancelled' && (signal === null || signal === void 0 ? void 0 : signal.aborted)) {
|
|
@@ -123,6 +156,10 @@ class AgentStreamer {
|
|
|
123
156
|
}
|
|
124
157
|
case 'error':
|
|
125
158
|
session.finished(turn);
|
|
159
|
+
if (sent && !turn.produced && (await signIn(item))) {
|
|
160
|
+
turn = session.prompt(sent);
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
126
163
|
session.failure = AgentStreamer.describe(config, item);
|
|
127
164
|
builder.error('error', session.failure);
|
|
128
165
|
return;
|
|
@@ -11,6 +11,7 @@ const agent_bindings_1 = require("./agent-bindings");
|
|
|
11
11
|
const agent_catalog_1 = require("./agent-catalog");
|
|
12
12
|
const agent_prompt_1 = require("./agent-prompt");
|
|
13
13
|
const agent_session_1 = require("./agent-session");
|
|
14
|
+
const agent_sign_in_1 = require("./agent-sign-in");
|
|
14
15
|
const agent_streamer_1 = require("./agent-streamer");
|
|
15
16
|
const agent_tool_1 = require("./agent-tool");
|
|
16
17
|
const message_stream_1 = require("./message-stream");
|
|
@@ -173,6 +174,12 @@ function activate(pi, options = {}) {
|
|
|
173
174
|
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 } : {}) };
|
|
174
175
|
pi.events.emit(TA_FILE_WRITE_EVENT, file);
|
|
175
176
|
},
|
|
177
|
+
queued: at => {
|
|
178
|
+
if (context) {
|
|
179
|
+
const entry = { agent: config.id, session: session.id, at };
|
|
180
|
+
pi.appendEntry(agent_bindings_1.QUEUE_ENTRY, entry);
|
|
181
|
+
}
|
|
182
|
+
},
|
|
176
183
|
};
|
|
177
184
|
learn(config, session);
|
|
178
185
|
}, options.agentOf, options.release);
|
|
@@ -192,6 +199,11 @@ function activate(pi, options = {}) {
|
|
|
192
199
|
}
|
|
193
200
|
},
|
|
194
201
|
calls,
|
|
202
|
+
// Only with someone to ask: pi without a UI (`pi -p`) says how to sign in instead.
|
|
203
|
+
signIn: (config, signal) => {
|
|
204
|
+
const ui = (context === null || context === void 0 ? void 0 : context.hasUI) ? context.ui : undefined;
|
|
205
|
+
return ui ? new agent_sign_in_1.AgentSignIn(config, bindings.agent(config), ui).run(signal) : Promise.resolve(false);
|
|
206
|
+
},
|
|
195
207
|
ended: (config, session) => {
|
|
196
208
|
var _a;
|
|
197
209
|
if (session.title && !pi.getSessionName()) {
|
|
@@ -12,6 +12,49 @@ declare const TEXTS: {
|
|
|
12
12
|
readonly 'zh-TW': (agent: string, command: string) => string;
|
|
13
13
|
readonly 'ja-JP': (agent: string, command: string) => string;
|
|
14
14
|
};
|
|
15
|
+
readonly signInPick: {
|
|
16
|
+
readonly 'en-US': (agent: string) => string;
|
|
17
|
+
readonly 'zh-CN': (agent: string) => string;
|
|
18
|
+
readonly 'zh-TW': (agent: string) => string;
|
|
19
|
+
readonly 'ja-JP': (agent: string) => string;
|
|
20
|
+
};
|
|
21
|
+
readonly signInWith: {
|
|
22
|
+
readonly 'en-US': (way: string) => string;
|
|
23
|
+
readonly 'zh-CN': (way: string) => string;
|
|
24
|
+
readonly 'zh-TW': (way: string) => string;
|
|
25
|
+
readonly 'ja-JP': (way: string) => string;
|
|
26
|
+
};
|
|
27
|
+
/** The ways CodeBuddy Code offers, by id; '' for another. */
|
|
28
|
+
readonly signInMethod: {
|
|
29
|
+
readonly 'en-US': (id: string) => string;
|
|
30
|
+
readonly 'zh-CN': (id: string) => string;
|
|
31
|
+
readonly 'zh-TW': (id: string) => string;
|
|
32
|
+
readonly 'ja-JP': (id: string) => string;
|
|
33
|
+
};
|
|
34
|
+
readonly signingIn: {
|
|
35
|
+
readonly 'en-US': (agent: string) => string;
|
|
36
|
+
readonly 'zh-CN': (agent: string) => string;
|
|
37
|
+
readonly 'zh-TW': (agent: string) => string;
|
|
38
|
+
readonly 'ja-JP': (agent: string) => string;
|
|
39
|
+
};
|
|
40
|
+
readonly signInPage: {
|
|
41
|
+
readonly 'en-US': (agent: string, url: string) => string;
|
|
42
|
+
readonly 'zh-CN': (agent: string, url: string) => string;
|
|
43
|
+
readonly 'zh-TW': (agent: string, url: string) => string;
|
|
44
|
+
readonly 'ja-JP': (agent: string, url: string) => string;
|
|
45
|
+
};
|
|
46
|
+
readonly signInFailed: {
|
|
47
|
+
readonly 'en-US': (agent: string) => string;
|
|
48
|
+
readonly 'zh-CN': (agent: string) => string;
|
|
49
|
+
readonly 'zh-TW': (agent: string) => string;
|
|
50
|
+
readonly 'ja-JP': (agent: string) => string;
|
|
51
|
+
};
|
|
52
|
+
readonly signedIn: {
|
|
53
|
+
readonly 'en-US': (agent: string) => string;
|
|
54
|
+
readonly 'zh-CN': (agent: string) => string;
|
|
55
|
+
readonly 'zh-TW': (agent: string) => string;
|
|
56
|
+
readonly 'ja-JP': (agent: string) => string;
|
|
57
|
+
};
|
|
15
58
|
readonly notFound: {
|
|
16
59
|
readonly 'en-US': (agent: string, command: string) => string;
|
|
17
60
|
readonly 'zh-CN': (agent: string, command: string) => string;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.language = language;
|
|
4
4
|
exports.text = text;
|
|
5
|
+
/** A Latin word among Chinese characters, with a space on each side. */
|
|
6
|
+
function spaced(word) {
|
|
7
|
+
return /^[\x20-\x7e]+$/.test(word) ? ` ${word} ` : word;
|
|
8
|
+
}
|
|
5
9
|
/** What the package says to the user, in English and Chinese. */
|
|
6
10
|
const TEXTS = {
|
|
7
11
|
remote: {
|
|
@@ -16,6 +20,49 @@ const TEXTS = {
|
|
|
16
20
|
'zh-TW': (agent, command) => `${agent} 還沒有登入。請在終端機裡執行 \`${command}\` 登入後再試。`,
|
|
17
21
|
'ja-JP': (agent, command) => `${agent} はサインインしていません。ターミナルで \`${command}\` を実行してサインインしてから、もう一度試してください。`,
|
|
18
22
|
},
|
|
23
|
+
signInPick: {
|
|
24
|
+
'en-US': (agent) => `${agent} is not signed in yet. Sign in to go on:`,
|
|
25
|
+
'zh-CN': (agent) => `${agent} 还没有登录,登录后接着做:`,
|
|
26
|
+
'zh-TW': (agent) => `${agent} 還沒有登入,登入後接著做:`,
|
|
27
|
+
'ja-JP': (agent) => `${agent} はまだサインインしていません。サインインして続けます:`,
|
|
28
|
+
},
|
|
29
|
+
signInWith: {
|
|
30
|
+
'en-US': (way) => `Sign in with ${way}`,
|
|
31
|
+
'zh-CN': (way) => `用${spaced(way)}登录`,
|
|
32
|
+
'zh-TW': (way) => `用${spaced(way)}登入`,
|
|
33
|
+
'ja-JP': (way) => `${way} でサインイン`,
|
|
34
|
+
},
|
|
35
|
+
/** The ways CodeBuddy Code offers, by id; '' for another. */
|
|
36
|
+
signInMethod: {
|
|
37
|
+
'en-US': (id) => { var _a; return (_a = ({ iOA: 'iOA', external: 'Google / GitHub', internal: 'WeChat', selfhosted: 'an enterprise domain' })[id]) !== null && _a !== void 0 ? _a : ''; },
|
|
38
|
+
'zh-CN': (id) => { var _a; return (_a = ({ iOA: 'iOA', external: 'Google / GitHub', internal: '微信', selfhosted: '企业域名' })[id]) !== null && _a !== void 0 ? _a : ''; },
|
|
39
|
+
'zh-TW': (id) => { var _a; return (_a = ({ iOA: 'iOA', external: 'Google / GitHub', internal: '微信', selfhosted: '企業網域' })[id]) !== null && _a !== void 0 ? _a : ''; },
|
|
40
|
+
'ja-JP': (id) => { var _a; return (_a = ({ iOA: 'iOA', external: 'Google / GitHub', internal: 'WeChat', selfhosted: '企業ドメイン' })[id]) !== null && _a !== void 0 ? _a : ''; },
|
|
41
|
+
},
|
|
42
|
+
signingIn: {
|
|
43
|
+
'en-US': (agent) => `Waiting for you to sign in to ${agent} in the browser…`,
|
|
44
|
+
'zh-CN': (agent) => `等你在浏览器里登录 ${agent}…`,
|
|
45
|
+
'zh-TW': (agent) => `等你在瀏覽器裡登入 ${agent}…`,
|
|
46
|
+
'ja-JP': (agent) => `ブラウザで ${agent} にサインインするのを待っています…`,
|
|
47
|
+
},
|
|
48
|
+
signInPage: {
|
|
49
|
+
'en-US': (agent, url) => `Sign in to ${agent} in the browser: ${url}`,
|
|
50
|
+
'zh-CN': (agent, url) => `在浏览器里登录 ${agent}:${url}`,
|
|
51
|
+
'zh-TW': (agent, url) => `在瀏覽器裡登入 ${agent}:${url}`,
|
|
52
|
+
'ja-JP': (agent, url) => `ブラウザで ${agent} にサインインしてください:${url}`,
|
|
53
|
+
},
|
|
54
|
+
signInFailed: {
|
|
55
|
+
'en-US': (agent) => `Could not sign in to ${agent}.`,
|
|
56
|
+
'zh-CN': (agent) => `没能登录 ${agent}。`,
|
|
57
|
+
'zh-TW': (agent) => `沒能登入 ${agent}。`,
|
|
58
|
+
'ja-JP': (agent) => `${agent} にサインインできませんでした。`,
|
|
59
|
+
},
|
|
60
|
+
signedIn: {
|
|
61
|
+
'en-US': (agent) => `Signed in to ${agent}`,
|
|
62
|
+
'zh-CN': (agent) => `已登录 ${agent}`,
|
|
63
|
+
'zh-TW': (agent) => `已登入 ${agent}`,
|
|
64
|
+
'ja-JP': (agent) => `${agent} にサインインしました`,
|
|
65
|
+
},
|
|
19
66
|
notFound: {
|
|
20
67
|
'en-US': (agent, command) => `${agent}: \`${command}\` was not found. Install it, or set its command in \`agents\` of settings.json.`,
|
|
21
68
|
'zh-CN': (agent, command) => `${agent}:找不到命令 \`${command}\`。请先安装,或在 settings.json 的 \`agents\` 里指定它的命令。`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-agents",
|
|
3
|
-
"version": "4.15.
|
|
3
|
+
"version": "4.15.2",
|
|
4
4
|
"description": "A pi package for Ta: other coding agents (CodeBuddy Code, Claude Code, Codex and any agent that speaks ACP) as models to pick, each running a conversation on its own harness",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package"
|
|
@@ -61,8 +61,16 @@ class BotStore {
|
|
|
61
61
|
async secret(id) {
|
|
62
62
|
return (await this.allSecrets())[id];
|
|
63
63
|
}
|
|
64
|
-
async tokens() {
|
|
65
|
-
|
|
64
|
+
async tokens(bots) {
|
|
65
|
+
const secrets = await this.allSecrets();
|
|
66
|
+
return bots.flatMap((bot) => {
|
|
67
|
+
const secret = secrets[bot.id];
|
|
68
|
+
return secret?.kind === "weixin" ? [secret.token] : [];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
async orphans(bots) {
|
|
72
|
+
const known = new Set(bots.map((bot) => bot.id));
|
|
73
|
+
return Object.entries(await this.allSecrets()).filter(([id]) => !known.has(id));
|
|
66
74
|
}
|
|
67
75
|
async setSecret(id, secret) {
|
|
68
76
|
const secrets = { ...await this.allSecrets() };
|
|
@@ -899,6 +907,8 @@ var TaActionUtil;
|
|
|
899
907
|
}
|
|
900
908
|
TaActionUtil2.inside = inside;
|
|
901
909
|
})(TaActionUtil || (TaActionUtil = {}));
|
|
910
|
+
// ../ta-protocol/esm/common/usage-protocol.js
|
|
911
|
+
var TaUsageServer = Symbol("TaUsageServer");
|
|
902
912
|
// ../ta-protocol/esm/common/workspace-protocol.js
|
|
903
913
|
var TaWorkspaceServer = Symbol("TaWorkspaceServer");
|
|
904
914
|
var TaTerminalServer = Symbol("TaTerminalServer");
|
|
@@ -2268,6 +2278,7 @@ class WeixinChannel {
|
|
|
2268
2278
|
texts.push(item.text_item.text);
|
|
2269
2279
|
} else if (item.type === WeixinItemType.VOICE && item.voice_item?.text) {
|
|
2270
2280
|
texts.push(item.voice_item.text);
|
|
2281
|
+
continue;
|
|
2271
2282
|
}
|
|
2272
2283
|
const file = await this.media(item).catch((error) => {
|
|
2273
2284
|
texts.push(`[${WeixinChannel.label(item.type)}: ${errorText(error)}]`);
|
|
@@ -2454,6 +2465,7 @@ class BotService {
|
|
|
2454
2465
|
}
|
|
2455
2466
|
async start() {
|
|
2456
2467
|
this.bots = await this.store.bots();
|
|
2468
|
+
await this.recover();
|
|
2457
2469
|
this.status = {};
|
|
2458
2470
|
for (const bot of this.bots) {
|
|
2459
2471
|
await this.connect(bot);
|
|
@@ -2479,7 +2491,7 @@ class BotService {
|
|
|
2479
2491
|
}
|
|
2480
2492
|
async startWeixinLogin(target) {
|
|
2481
2493
|
const where = BotTargetUtil.parse(target);
|
|
2482
|
-
return this.logins.start(await this.store.tokens(), (signIn) => this.signedIn(signIn, where));
|
|
2494
|
+
return this.logins.start(await this.store.tokens(this.bots), (signIn) => this.signedIn(signIn, where));
|
|
2483
2495
|
}
|
|
2484
2496
|
async startWecomLogin(target) {
|
|
2485
2497
|
const where = BotTargetUtil.parse(target);
|
|
@@ -2509,7 +2521,7 @@ class BotService {
|
|
|
2509
2521
|
id,
|
|
2510
2522
|
kind: "wecom",
|
|
2511
2523
|
name: typeof name === "string" && name.trim() || before?.name || BotServerTexts.defaultName("wecom", this.names()),
|
|
2512
|
-
account:
|
|
2524
|
+
account: BotService.wecomAccount(botId),
|
|
2513
2525
|
target: target ?? before?.target,
|
|
2514
2526
|
createdAt: before?.createdAt ?? Date.now()
|
|
2515
2527
|
};
|
|
@@ -2608,6 +2620,22 @@ class BotService {
|
|
|
2608
2620
|
return chat ? [{ botId: bot.id, chat }] : [];
|
|
2609
2621
|
});
|
|
2610
2622
|
}
|
|
2623
|
+
async recover() {
|
|
2624
|
+
const lost = await this.store.orphans(this.bots);
|
|
2625
|
+
if (!lost.length) {
|
|
2626
|
+
return;
|
|
2627
|
+
}
|
|
2628
|
+
for (const [id, secret] of lost) {
|
|
2629
|
+
this.bots.push({
|
|
2630
|
+
id,
|
|
2631
|
+
kind: secret.kind,
|
|
2632
|
+
name: BotServerTexts.defaultName(secret.kind, this.names()),
|
|
2633
|
+
account: secret.kind === "weixin" ? BotService.short(secret.userId ?? id.slice("weixin:".length)) : BotService.wecomAccount(secret.botId),
|
|
2634
|
+
createdAt: Date.now()
|
|
2635
|
+
});
|
|
2636
|
+
}
|
|
2637
|
+
await this.store.saveBots(this.bots);
|
|
2638
|
+
}
|
|
2611
2639
|
async signedIn(signIn, target) {
|
|
2612
2640
|
const id = `weixin:${signIn.botId}`;
|
|
2613
2641
|
const secrets = await Promise.all(this.bots.map(async (bot2) => [bot2, await this.store.secret(bot2.id)]));
|
|
@@ -2781,6 +2809,9 @@ ${origin.reply ?? ""}`;
|
|
|
2781
2809
|
return !seen.has(key) && seen.add(key) !== undefined;
|
|
2782
2810
|
});
|
|
2783
2811
|
}
|
|
2812
|
+
static wecomAccount(botId) {
|
|
2813
|
+
return botId.length > 10 ? `${botId.slice(0, 6)}…${botId.slice(-4)}` : botId;
|
|
2814
|
+
}
|
|
2784
2815
|
static short(account) {
|
|
2785
2816
|
const name = account.split("@")[0];
|
|
2786
2817
|
return name.length > 10 ? `${name.slice(0, 4)}…${name.slice(-4)}` : name;
|
|
@@ -73,6 +73,11 @@ export declare class BotService implements BotsHostApi, TaPackageService {
|
|
|
73
73
|
sendFile(origins: BotOrigin[], file: BotFile): Promise<SentDetails[]>;
|
|
74
74
|
/** The chats each of these bots heard from last: where a file goes when no message asked for it. */
|
|
75
75
|
lastChats(bots: Bot[]): BotOrigin[];
|
|
76
|
+
/**
|
|
77
|
+
* A bot whose secret is kept but which the list lost (its data written over) comes back, connected
|
|
78
|
+
* nowhere, rather than stay a secret no page shows, which WeChat still counts as connected.
|
|
79
|
+
*/
|
|
80
|
+
protected recover(): Promise<void>;
|
|
76
81
|
protected signedIn(signIn: WeixinSignIn, target: BotTarget | undefined): Promise<string>;
|
|
77
82
|
protected verify(bot: Bot, secret: BotSecret): Promise<void>;
|
|
78
83
|
protected channel(bot: Bot, secret: BotSecret): BotChannel;
|
|
@@ -90,6 +95,7 @@ export declare class BotService implements BotsHostApi, TaPackageService {
|
|
|
90
95
|
/** States change in bursts (connecting, online): written once for each burst. */
|
|
91
96
|
protected saveStatusLater(): void;
|
|
92
97
|
static unique(origins: BotOrigin[]): BotOrigin[];
|
|
98
|
+
static wecomAccount(botId: string): string;
|
|
93
99
|
static short(account: string): string;
|
|
94
100
|
}
|
|
95
101
|
export {};
|
|
@@ -39,6 +39,7 @@ class BotService {
|
|
|
39
39
|
}
|
|
40
40
|
async start() {
|
|
41
41
|
this.bots = await this.store.bots();
|
|
42
|
+
await this.recover();
|
|
42
43
|
this.status = {};
|
|
43
44
|
for (const bot of this.bots) {
|
|
44
45
|
await this.connect(bot);
|
|
@@ -62,7 +63,7 @@ class BotService {
|
|
|
62
63
|
}
|
|
63
64
|
async startWeixinLogin(target) {
|
|
64
65
|
const where = bots_protocol_1.BotTargetUtil.parse(target);
|
|
65
|
-
return this.logins.start(await this.store.tokens(), signIn => this.signedIn(signIn, where));
|
|
66
|
+
return this.logins.start(await this.store.tokens(this.bots), signIn => this.signedIn(signIn, where));
|
|
66
67
|
}
|
|
67
68
|
async startWecomLogin(target) {
|
|
68
69
|
const where = bots_protocol_1.BotTargetUtil.parse(target);
|
|
@@ -96,7 +97,7 @@ class BotService {
|
|
|
96
97
|
id,
|
|
97
98
|
kind: 'wecom',
|
|
98
99
|
name: (typeof name === 'string' && name.trim()) || (before === null || before === void 0 ? void 0 : before.name) || server_texts_1.BotServerTexts.defaultName('wecom', this.names()),
|
|
99
|
-
account:
|
|
100
|
+
account: BotService.wecomAccount(botId),
|
|
100
101
|
target: target !== null && target !== void 0 ? target : before === null || before === void 0 ? void 0 : before.target,
|
|
101
102
|
createdAt: (_a = before === null || before === void 0 ? void 0 : before.createdAt) !== null && _a !== void 0 ? _a : Date.now(),
|
|
102
103
|
};
|
|
@@ -206,6 +207,27 @@ class BotService {
|
|
|
206
207
|
return chat ? [{ botId: bot.id, chat }] : [];
|
|
207
208
|
});
|
|
208
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* A bot whose secret is kept but which the list lost (its data written over) comes back, connected
|
|
212
|
+
* nowhere, rather than stay a secret no page shows, which WeChat still counts as connected.
|
|
213
|
+
*/
|
|
214
|
+
async recover() {
|
|
215
|
+
var _a;
|
|
216
|
+
const lost = await this.store.orphans(this.bots);
|
|
217
|
+
if (!lost.length) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
for (const [id, secret] of lost) {
|
|
221
|
+
this.bots.push({
|
|
222
|
+
id,
|
|
223
|
+
kind: secret.kind,
|
|
224
|
+
name: server_texts_1.BotServerTexts.defaultName(secret.kind, this.names()),
|
|
225
|
+
account: secret.kind === 'weixin' ? BotService.short((_a = secret.userId) !== null && _a !== void 0 ? _a : id.slice('weixin:'.length)) : BotService.wecomAccount(secret.botId),
|
|
226
|
+
createdAt: Date.now(),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
await this.store.saveBots(this.bots);
|
|
230
|
+
}
|
|
209
231
|
async signedIn(signIn, target) {
|
|
210
232
|
var _a;
|
|
211
233
|
var _b, _c, _d, _e;
|
|
@@ -382,6 +404,9 @@ class BotService {
|
|
|
382
404
|
return !seen.has(key) && seen.add(key) !== undefined;
|
|
383
405
|
});
|
|
384
406
|
}
|
|
407
|
+
static wecomAccount(botId) {
|
|
408
|
+
return botId.length > 10 ? `${botId.slice(0, 6)}…${botId.slice(-4)}` : botId;
|
|
409
|
+
}
|
|
385
410
|
static short(account) {
|
|
386
411
|
const name = account.split('@')[0];
|
|
387
412
|
return name.length > 10 ? `${name.slice(0, 4)}…${name.slice(-4)}` : name;
|