@celljs/ta 4.8.0 → 4.9.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/README.en.md +37 -2
- package/README.md +37 -2
- package/bin/ta.mjs +1 -1
- package/dist/cli.mjs +591 -15
- package/dist/gateway.mjs +2812 -0
- package/dist/pi/CHANGELOG.md +27 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +11 -1
- package/dist/pi/packages/ta-agents/lib/agent-session.js +5 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +10 -1
- package/dist/pi/packages/ta-agents/package.json +11 -3
- package/dist/pi/packages/ta-bots/README.en.md +46 -0
- package/dist/pi/packages/ta-bots/README.md +46 -0
- package/dist/pi/packages/ta-bots/extension/index.mjs +629 -0
- package/dist/pi/packages/ta-bots/host/index.mjs +2313 -0
- package/dist/pi/packages/ta-bots/lib/bot-service.d.ts +96 -0
- package/dist/pi/packages/ta-bots/lib/bot-service.js +391 -0
- package/dist/pi/packages/ta-bots/lib/bot-store.d.ts +42 -0
- package/dist/pi/packages/ta-bots/lib/bot-store.js +97 -0
- package/dist/pi/packages/ta-bots/lib/bots-protocol.d.ts +131 -0
- package/dist/pi/packages/ta-bots/lib/bots-protocol.js +46 -0
- package/dist/pi/packages/ta-bots/lib/bots-view.d.ts +7 -0
- package/dist/pi/packages/ta-bots/lib/bots-view.js +84 -0
- package/dist/pi/packages/ta-bots/lib/channel-protocol.d.ts +58 -0
- package/dist/pi/packages/ta-bots/lib/channel-protocol.js +37 -0
- package/dist/pi/packages/ta-bots/lib/composer.d.ts +21 -0
- package/dist/pi/packages/ta-bots/lib/composer.js +104 -0
- package/dist/pi/packages/ta-bots/lib/connect-dialog.d.ts +18 -0
- package/dist/pi/packages/ta-bots/lib/connect-dialog.js +198 -0
- package/dist/pi/packages/ta-bots/lib/extension.d.ts +34 -0
- package/dist/pi/packages/ta-bots/lib/extension.js +207 -0
- package/dist/pi/packages/ta-bots/lib/host.d.ts +8 -0
- package/dist/pi/packages/ta-bots/lib/host.js +15 -0
- package/dist/pi/packages/ta-bots/lib/i18n.d.ts +87 -0
- package/dist/pi/packages/ta-bots/lib/i18n.js +175 -0
- package/dist/pi/packages/ta-bots/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-bots/lib/index.js +40 -0
- package/dist/pi/packages/ta-bots/lib/login-book.d.ts +17 -0
- package/dist/pi/packages/ta-bots/lib/login-book.js +55 -0
- package/dist/pi/packages/ta-bots/lib/media-crypto.d.ts +19 -0
- package/dist/pi/packages/ta-bots/lib/media-crypto.js +70 -0
- package/dist/pi/packages/ta-bots/lib/message.d.ts +13 -0
- package/dist/pi/packages/ta-bots/lib/message.js +74 -0
- package/dist/pi/packages/ta-bots/lib/page.d.ts +54 -0
- package/dist/pi/packages/ta-bots/lib/page.js +131 -0
- package/dist/pi/packages/ta-bots/lib/pictures.d.ts +3 -0
- package/dist/pi/packages/ta-bots/lib/pictures.js +21 -0
- package/dist/pi/packages/ta-bots/lib/qr-image.d.ts +16 -0
- package/dist/pi/packages/ta-bots/lib/qr-image.js +70 -0
- package/dist/pi/packages/ta-bots/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-bots/lib/react.js +8 -0
- package/dist/pi/packages/ta-bots/lib/server-texts.d.ts +12 -0
- package/dist/pi/packages/ta-bots/lib/server-texts.js +45 -0
- package/dist/pi/packages/ta-bots/lib/session-bridge.d.ts +43 -0
- package/dist/pi/packages/ta-bots/lib/session-bridge.js +118 -0
- package/dist/pi/packages/ta-bots/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-bots/lib/style.js +114 -0
- package/dist/pi/packages/ta-bots/lib/test-fakes.d.ts +37 -0
- package/dist/pi/packages/ta-bots/lib/test-fakes.js +94 -0
- package/dist/pi/packages/ta-bots/lib/text-util.d.ts +16 -0
- package/dist/pi/packages/ta-bots/lib/text-util.js +158 -0
- package/dist/pi/packages/ta-bots/lib/web-socket-client.d.ts +38 -0
- package/dist/pi/packages/ta-bots/lib/web-socket-client.js +213 -0
- package/dist/pi/packages/ta-bots/lib/wecom-channel.d.ts +38 -0
- package/dist/pi/packages/ta-bots/lib/wecom-channel.js +222 -0
- package/dist/pi/packages/ta-bots/lib/wecom-login.d.ts +34 -0
- package/dist/pi/packages/ta-bots/lib/wecom-login.js +84 -0
- package/dist/pi/packages/ta-bots/lib/wecom-socket.d.ts +74 -0
- package/dist/pi/packages/ta-bots/lib/wecom-socket.js +214 -0
- package/dist/pi/packages/ta-bots/lib/weixin-api.d.ts +112 -0
- package/dist/pi/packages/ta-bots/lib/weixin-api.js +171 -0
- package/dist/pi/packages/ta-bots/lib/weixin-channel.d.ts +49 -0
- package/dist/pi/packages/ta-bots/lib/weixin-channel.js +258 -0
- package/dist/pi/packages/ta-bots/lib/weixin-login.d.ts +31 -0
- package/dist/pi/packages/ta-bots/lib/weixin-login.js +110 -0
- package/dist/pi/packages/ta-bots/package.json +55 -0
- package/dist/pi/packages/ta-bots/web/index.js +1241 -0
- package/dist/pi/packages/ta-changes/lib/diff-tab.js +1 -1
- package/dist/pi/packages/ta-changes/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-changes/lib/style.js +12 -10
- package/dist/pi/packages/ta-changes/package.json +11 -2
- package/dist/pi/packages/ta-changes/web/index.js +16 -13
- package/dist/pi/packages/ta-channels/README.en.md +3 -2
- package/dist/pi/packages/ta-channels/README.md +3 -2
- package/dist/pi/packages/ta-channels/extension/index.mjs +109 -8
- package/dist/pi/packages/ta-channels/host/index.mjs +281 -5
- package/dist/pi/packages/ta-channels/lib/agent-menu.d.ts +2 -0
- package/dist/pi/packages/ta-channels/lib/agent-menu.js +19 -6
- package/dist/pi/packages/ta-channels/lib/channel-menu.d.ts +2 -0
- package/dist/pi/packages/ta-channels/lib/channel-menu.js +15 -12
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts +10 -0
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts +10 -0
- package/dist/pi/packages/ta-channels/lib/channels-util.js +29 -2
- package/dist/pi/packages/ta-channels/lib/channels.d.ts +2 -0
- package/dist/pi/packages/ta-channels/lib/channels.js +1 -0
- package/dist/pi/packages/ta-channels/lib/create.js +2 -2
- package/dist/pi/packages/ta-channels/lib/extension.d.ts +5 -0
- package/dist/pi/packages/ta-channels/lib/extension.js +25 -2
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts +40 -9
- package/dist/pi/packages/ta-channels/lib/i18n.js +81 -19
- package/dist/pi/packages/ta-channels/lib/index.d.ts +3 -2
- package/dist/pi/packages/ta-channels/lib/index.js +14 -2
- package/dist/pi/packages/ta-channels/lib/members.js +10 -5
- package/dist/pi/packages/ta-channels/lib/more-menu.d.ts +5 -1
- package/dist/pi/packages/ta-channels/lib/more-menu.js +55 -9
- package/dist/pi/packages/ta-channels/lib/room.d.ts +11 -2
- package/dist/pi/packages/ta-channels/lib/room.js +47 -6
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts +5 -1
- package/dist/pi/packages/ta-channels/lib/sidebar.js +189 -31
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +136 -73
- package/dist/pi/packages/ta-channels/lib/tasks.d.ts +48 -0
- package/dist/pi/packages/ta-channels/lib/tasks.js +226 -0
- package/dist/pi/packages/ta-channels/lib/team-ask.d.ts +21 -0
- package/dist/pi/packages/ta-channels/lib/team-ask.js +73 -0
- package/dist/pi/packages/ta-channels/lib/team-tools.d.ts +6 -1
- package/dist/pi/packages/ta-channels/lib/team-tools.js +5 -4
- package/dist/pi/packages/ta-channels/lib/team.d.ts +5 -1
- package/dist/pi/packages/ta-channels/lib/team.js +10 -4
- package/dist/pi/packages/ta-channels/lib/views.d.ts +18 -3
- package/dist/pi/packages/ta-channels/lib/views.js +40 -9
- package/dist/pi/packages/ta-channels/package.json +11 -2
- package/dist/pi/packages/ta-channels/web/index.js +992 -205
- package/dist/pi/packages/ta-computer-use/package.json +11 -2
- package/dist/pi/packages/ta-cron/README.en.md +3 -3
- package/dist/pi/packages/ta-cron/README.md +3 -3
- package/dist/pi/packages/ta-cron/host/index.mjs +19 -12
- package/dist/pi/packages/ta-cron/lib/editor.js +1 -3
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +2 -4
- package/dist/pi/packages/ta-cron/lib/i18n.js +4 -8
- package/dist/pi/packages/ta-cron/lib/index.js +11 -0
- package/dist/pi/packages/ta-cron/lib/next-card.d.ts +9 -0
- package/dist/pi/packages/ta-cron/lib/next-card.js +35 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +3 -0
- package/dist/pi/packages/ta-cron/lib/page.js +4 -1
- package/dist/pi/packages/ta-cron/lib/pictures.d.ts +6 -0
- package/dist/pi/packages/ta-cron/lib/pictures.js +46 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.d.ts +2 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.js +24 -14
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +30 -44
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +4 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +36 -21
- package/dist/pi/packages/ta-cron/package.json +11 -2
- package/dist/pi/packages/ta-cron/web/index.js +249 -281
- package/dist/pi/packages/ta-extensions/README.en.md +4 -1
- package/dist/pi/packages/ta-extensions/README.md +4 -1
- package/dist/pi/packages/ta-extensions/host/index.mjs +64 -61
- package/dist/pi/packages/ta-extensions/lib/actions.d.ts +2 -0
- package/dist/pi/packages/ta-extensions/lib/actions.js +9 -1
- package/dist/pi/packages/ta-extensions/lib/host.d.ts +0 -8
- package/dist/pi/packages/ta-extensions/lib/host.js +7 -49
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +8 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.js +20 -4
- package/dist/pi/packages/ta-extensions/lib/index.js +2 -0
- package/dist/pi/packages/ta-extensions/lib/market-detail.js +14 -2
- package/dist/pi/packages/ta-extensions/lib/market-style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/market-style.js +18 -18
- package/dist/pi/packages/ta-extensions/lib/page.js +22 -11
- package/dist/pi/packages/ta-extensions/lib/pictures.d.ts +3 -1
- package/dist/pi/packages/ta-extensions/lib/pictures.js +28 -32
- package/dist/pi/packages/ta-extensions/lib/search.d.ts +10 -0
- package/dist/pi/packages/ta-extensions/lib/search.js +139 -0
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +15 -34
- package/dist/pi/packages/ta-extensions/package.json +12 -2
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +12 -8
- package/dist/pi/packages/ta-extensions/web/index.js +488 -120
- package/dist/pi/packages/ta-launcher/README.en.md +15 -0
- package/dist/pi/packages/ta-launcher/README.md +15 -0
- package/dist/pi/packages/ta-launcher/lib/actions.d.ts +31 -0
- package/dist/pi/packages/ta-launcher/lib/actions.js +134 -0
- package/dist/pi/packages/ta-launcher/lib/i18n.d.ts +38 -0
- package/dist/pi/packages/ta-launcher/lib/i18n.js +77 -0
- package/dist/pi/packages/ta-launcher/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-launcher/lib/index.js +48 -0
- package/dist/pi/packages/ta-launcher/lib/launcher-util.d.ts +19 -0
- package/dist/pi/packages/ta-launcher/lib/launcher-util.js +47 -0
- package/dist/pi/packages/ta-launcher/lib/launcher-view.d.ts +20 -0
- package/dist/pi/packages/ta-launcher/lib/launcher-view.js +99 -0
- package/dist/pi/packages/ta-launcher/lib/mine-store.d.ts +22 -0
- package/dist/pi/packages/ta-launcher/lib/mine-store.js +60 -0
- package/dist/pi/packages/ta-launcher/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-launcher/lib/react.js +8 -0
- package/dist/pi/packages/ta-launcher/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-launcher/lib/style.js +48 -0
- package/dist/pi/packages/ta-launcher/package.json +49 -0
- package/dist/pi/packages/ta-launcher/web/index.js +553 -0
- package/dist/pi/packages/ta-workspace/README.md +2 -2
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +2 -2
- package/dist/pi/packages/ta-workspace/lib/common.d.ts +8 -5
- package/dist/pi/packages/ta-workspace/lib/common.js +53 -14
- package/dist/pi/packages/ta-workspace/lib/explorer-excluded.d.ts +3 -0
- package/dist/pi/packages/ta-workspace/lib/explorer-excluded.js +39 -0
- package/dist/pi/packages/ta-workspace/lib/explorer-transfer.d.ts +31 -0
- package/dist/pi/packages/ta-workspace/lib/explorer-transfer.js +156 -0
- package/dist/pi/packages/ta-workspace/lib/explorer.js +45 -153
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +10 -0
- package/dist/pi/packages/ta-workspace/lib/i18n.js +30 -10
- package/dist/pi/packages/ta-workspace/lib/open-files.js +1 -1
- package/dist/pi/packages/ta-workspace/lib/preview.js +6 -2
- package/dist/pi/packages/ta-workspace/lib/scm.js +4 -4
- package/dist/pi/packages/ta-workspace/lib/search.js +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.js +100 -55
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts +24 -2
- package/dist/pi/packages/ta-workspace/lib/terminal.js +305 -43
- package/dist/pi/packages/ta-workspace/lib/util/terminal.d.ts +25 -0
- package/dist/pi/packages/ta-workspace/lib/util/terminal.js +55 -0
- package/dist/pi/packages/ta-workspace/lib/util/workspace.d.ts +3 -2
- package/dist/pi/packages/ta-workspace/lib/util/workspace.js +7 -3
- package/dist/pi/packages/ta-workspace/lib/workspace-client.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/workspace-client.js +2 -2
- package/dist/pi/packages/ta-workspace/package.json +11 -2
- package/dist/pi/packages/ta-workspace/web/index.js +913 -294
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-CNqfsCwx.js → abnfDiagram-S7VZAUFO-C1tb6dM5.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-_WaGq-Qk.js → architecture-WOLXFQ4H-DN1Va8BF.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-Bn63Lctu.js → architectureDiagram-YGSQEFNW-BmK2SYtQ.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-BGaAecnk.js → blockDiagram-APKKGZFW-DvLrLzTm.js} +1 -1
- package/dist/public/assets/{browser-DKagIN4Y.js → browser-DAv3ly6M.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CK9Z_9Zp.js → c4Diagram-KJ2TOQU5-CrQlWwrG.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-H3j3MGva.js → chunk-6MUBBAK2-CHKMsuY_.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-Beljdjs9.js → chunk-AXFCVDMN-CWJ7Np6s.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-TYEV5wLO.js → chunk-BG4553SI-3v5XbQGM.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-gmWJrizf.js → chunk-DQASFODM-2CC-yiCz.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-BTa7yKXI.js → chunk-HFQBQIA3-D2hzQPAy.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BlwMm4R0.js → chunk-KQLB2F66-SifAZs2r.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-CKTXjzwD.js → chunk-KS47KZWR-BP0C0VCC.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-Bn9Xkefl.js → chunk-LEVMRMFU-B1f5vw5b.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-B_QLqohG.js → chunk-M57EVK23-B2MCJt7Y.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-BflzJHPz.js → chunk-OY52VR5R-cDpZJMk4.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-BXucfaFg.js → chunk-QB3YPZ4I-BE0we2xc.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-CGwkwxm9.js → chunk-R3KSYZAL-D9wOfqqH.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-DQGOPuM5.js → chunk-STOXU5M4-BIaVsc0K.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-BCrs6AYI.js → chunk-TU62E6Q5-BZc0OZEM.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-MTv7nXJX.js → chunk-X4PVCEUW-Bngfwwzm.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-fPaX8VIb.js → chunk-XXDRQBXY-C5FQ6XHK.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-tm4uT08q.js → classDiagram-v2-L25IHNXF-_om54nmt.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-Dkk3pDZj.js → cose-bilkent-JH36ORCC-Dwpeee_6.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-CW_93VVD.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-BcoArW00.js → cynefinDiagram-L36ESFBY-DP5_y9Dq.js} +1 -1
- package/dist/public/assets/{d3-selection-BzUITLov.js → d3-selection-DFiMlEmn.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-oiU-wJxw.js → dagre-SPEB5RXH-DYwsk6gk.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-BwlCOIW4.js → diagram-3B7GL73J-Dq_nT3AZ.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-CZGQiFrl.js → diagram-DNEMPZML-ChURW6y9.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-BJGDa24C.js → diagram-L3MUGCDN-CgVp4Rto.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-DdwHRhnP.js → diagram-LA4NIPWU-vrqLMDby.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-IjreLUB9.js → diagram-MHCOC4E2-lvfOr5ij.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-CvaG0Zzq.js → diagram-XPFHEONP-oQ18TeVp.js} +1 -1
- package/dist/public/assets/{dist-Cm4zqoMA.js → dist-BOxxmveI.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-C-FOI67M.js → ebnfDiagram-UZSYDL2S-C7_tlZCS.js} +1 -1
- package/dist/public/assets/{editor.api-hteKufWf.js → editor.api-CoZ8MEuz.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-C_ClfkLy.js → elk-XV6XMXQE-Dkt5-ikg.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-DSr0aRYm.js → erDiagram-EYBAPDEH-27kh3zlx.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-COU_atV6.js → eventmodeling-K75KTNOO-CxVEejjN.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-BRowRdve.js +1 -0
- package/dist/public/assets/{freemarker2-CBJnhymu.js → freemarker2-D6CwPIXh.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-BAcXXNjI.js → ganttDiagram-23REXITY-C-amlwpX.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BGmojXlx.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-Bk9sns6k.js → gitGraphDiagram-STJD7YCW-DKhzI0Xz.js} +1 -1
- package/dist/public/assets/{handlebars-CiqYW1im.js → handlebars-mxNr68Gm.js} +1 -1
- package/dist/public/assets/{html-kafkm1Z0.js → html-Bze6s9R9.js} +1 -1
- package/dist/public/assets/{index-DPLd0-lb.js → index-BhQUc9PU.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-CRRVgGj2.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-2hRQLVWa.js → infoDiagram-KBXO4MBG-WHuWjEDO.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-hrOnhWJs.js → ishikawaDiagram-M35NCXHK-DFHUwD0J.js} +1 -1
- package/dist/public/assets/{javascript-Dt5MiA9w.js → javascript-4NMPu7y1.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-d8HJd04q.js → journeyDiagram-OPLOXDXO-C7gV6zEr.js} +1 -1
- package/dist/public/assets/{jsonMode-DBICoo6P.js → jsonMode-B1JEHPMp.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-DOUuZDiv.js → kanban-definition-BZKZHSQY-DlRu_d2Q.js} +1 -1
- package/dist/public/assets/{liquid-BGYhBP2h.js → liquid-B7sIf4NX.js} +1 -1
- package/dist/public/assets/{mdx-Ct_gzcP3.js → mdx-CAN0qez6.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-2yhxYNxq.js → mermaid-parser.core-BGmotBhf.js} +3 -3
- package/dist/public/assets/{mermaid.core-sx7teU8z.js → mermaid.core-Cl6SS3cM.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DIc9LejH.js → mindmap-definition-I2QAS2VK-DiQ8Feqr.js} +1 -1
- package/dist/public/assets/module-1nDbf1AK.js +1761 -0
- package/dist/public/assets/module-BkKfSTDV.js +1 -0
- package/dist/public/assets/{monaco-DJecWyyV.js → monaco-CwCjTWAO.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-DUlqTCWQ.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-BfiT6-Vx.js → pegDiagram-FD4XPPHP-XhCpv6BX.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-2RgP4ScO.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-DJ0sF_Eg.js → pieDiagram-J4AKIIQI-DUVzuXUd.js} +1 -1
- package/dist/public/assets/{python-BrnocsK9.js → python-DsoF66Sp.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-C3iF5PG6.js → quadrantDiagram-XTYBLID2-Ddobf0z0.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-Dap8k-yH.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-Ds10NBze.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-BI4N-mtq.js → railroad-abnf-LNEFI6M7-DkrNo-Gf.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-Ck2MUlyV.js → railroad-ebnf-DWYD2UWJ-DaB7gY8P.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-Cuc9S0f4.js → railroad-peg-JR7BVNR7-D_QG87QV.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-Cw24sb_5.js → railroadDiagram-MRQ6NCDL-x-nUoBjv.js} +1 -1
- package/dist/public/assets/{razor-BDHTAmlI.js → razor-DSrcJyQe.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-QQUXFr1R.js → requirementDiagram-Y7LWUY3S-kNNcbsty.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-mSlfAHND.js → sankeyDiagram-WGJFYUXA-ClC12Odk.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-3t8hVott.js → sequenceDiagram-5NDRBG5M-DDQITP2g.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-9EW807AL.js → stateDiagram-v2-FJ4FJNEA-N1t_36oh.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-EbMBX_e0.js → swimlanes-UMQ2AFYF-DSt9fFYE.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-BHAN4SQO.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-D14kjjsp.js → timeline-definition-SEUHKTQE-CfymOw_s.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-f1hLUBjI.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-_NPRpuUC.js +1 -0
- package/dist/public/assets/{typescript-BEEbbq69.js → typescript-J7rF-zX8.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-DKemtzU9.js → usecaseDiagram-AFA6YXN4-CK_mRc2_.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-DOBq9oeY.js → vennDiagram-NNMJR3RB-DW8xR6IJ.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-CLBqtefx.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-DquSJ4y-.js → wardleyDiagram-S7YFUSEH-Css55Zq5.js} +1 -1
- package/dist/public/assets/{xml-DvTQKQ_W.js → xml-CJeviG_a.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-ClE_9jz4.js → xychartDiagram-GGNKY7IX-BnhK9cFS.js} +1 -1
- package/dist/public/assets/{yaml-ffiFfPtJ.js → yaml-Gw3uo6rF.js} +1 -1
- package/dist/public/index.html +35 -6
- package/dist/public/launch.svg +49 -0
- package/dist/serve/index.mjs +3693 -889
- package/package.json +25 -22
- package/dist/pi/packages/ta-agents/fixtures/fake-acp-agent.mjs +0 -183
- package/dist/pi/packages/ta-agents/lib/acp-agent.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/acp-agent.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-session.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-streamer.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-tool.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/agent-turn.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/extension.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/extension.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/json-rpc.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/json-rpc.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/message-stream.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/message-stream.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/pi-types.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/pi-types.js.map +0 -1
- package/dist/pi/packages/ta-agents/lib/texts.d.ts.map +0 -1
- package/dist/pi/packages/ta-agents/lib/texts.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/blob-store.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/blob-store.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/card.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/card.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/changes-protocol.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/changes-protocol.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/changes-service.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/changes-service.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/changes-util.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/changes-util.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/diff-tab.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/diff-tab.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/extension.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/extension.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/host.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/host.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/i18n.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/i18n.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/index.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/index.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/line-diff.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/line-diff.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/page.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/page.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/react.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/react.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/recorder.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/recorder.js.map +0 -1
- package/dist/pi/packages/ta-changes/lib/style.d.ts.map +0 -1
- package/dist/pi/packages/ta-changes/lib/style.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/agent-menu.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/agent-menu.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channel-menu.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channel-menu.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channels-model.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channels-util.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channels.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/channels.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/create.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/create.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/extension.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/extension.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/faces.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/faces.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/host.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/host.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/i18n.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/index.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/index.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/members.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/members.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/more-menu.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/more-menu.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/react.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/react.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/room.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/room.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/sidebar.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/style.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/style.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/team-tools.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/team-tools.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/team.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/team.js.map +0 -1
- package/dist/pi/packages/ta-channels/lib/views.d.ts.map +0 -1
- package/dist/pi/packages/ta-channels/lib/views.js.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.d.ts.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.js.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-daemon.d.ts.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-daemon.js.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/cua-driver.d.ts.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/cua-driver.js.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/extension.d.ts.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/extension.js.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/pi-types.d.ts.map +0 -1
- package/dist/pi/packages/ta-computer-use/lib/pi-types.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/commands.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/commands.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/cron-expression.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/cron-expression.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/editor.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/editor.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/extension.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/extension.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/form-util.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/form-util.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/host.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/host.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/i18n.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/index.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/index.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/model-picker.d.ts +0 -33
- package/dist/pi/packages/ta-cron/lib/model-picker.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/model-picker.js +0 -178
- package/dist/pi/packages/ta-cron/lib/model-picker.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/notifier.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/notifier.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/page.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/page.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/react.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/react.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/reply.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/reply.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/schedule-util.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/schedule-util.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/scheduler.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/scheduler.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/server-texts.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/server-texts.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/style.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/style.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/task-store.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/task-store.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/task-util.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js.map +0 -1
- package/dist/pi/packages/ta-cron/lib/tool.d.ts.map +0 -1
- package/dist/pi/packages/ta-cron/lib/tool.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/actions.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/actions.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/archive.d.ts +0 -30
- package/dist/pi/packages/ta-extensions/lib/archive.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/archive.js +0 -213
- package/dist/pi/packages/ta-extensions/lib/archive.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/context.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/context.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/extensions-util.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/extensions-util.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/host.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/host.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/i18n.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/import-dialog.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/import-dialog.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/index.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/index.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-detail.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-detail.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-parts.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-parts.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-store.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-store.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-style.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-style.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-util.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-util.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-view.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market-view.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/market.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/page.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/page.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/pictures.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/pictures.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/react.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/react.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/signal.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/signal.js.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/style.d.ts.map +0 -1
- package/dist/pi/packages/ta-extensions/lib/style.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-agent.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-agent.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-common.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-import.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-import.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-webview.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser-webview.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/browser.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/common.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/common.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/editors.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/editors.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/explorer.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/explorer.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/file-icon.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/file-icon.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/host.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/host.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/i18n.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/index.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/index.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/open-files.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/open-files.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/preview.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/preview.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/react.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/react.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/scm.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/scm.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/search.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/search.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/style.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/style.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/terminal.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/file-icon.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/file-icon.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/git.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/git.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/preview.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/preview.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/search.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/search.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/seti-font.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/seti-font.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/seti.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/seti.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/upload.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/upload.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/workspace.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/workspace.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/zip.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/zip.js.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/workspace-client.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/workspace-client.js.map +0 -1
- package/dist/pi/packages/ta-workspace/scripts/seti.ts +0 -173
- package/dist/public/assets/cynefin-EF2NZ3EQ-D_QV_BJg.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-QGLBPpjQ.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-ByODkoVe.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-BMphWS2h.js +0 -1
- package/dist/public/assets/module-BX2fJibj.js +0 -1124
- package/dist/public/assets/module-N1D-AOa6.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-Ca8klABu.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-B-SN2eCI.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-DzDnNRnq.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-7QAv0_1N.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CIFqDFf2.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-cznq7PJK.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-CBYUiQGU.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-DV8bp8Ml.js +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { TaExtensionHost, TaPackageService } from '@celljs/ta-protocol';
|
|
2
|
+
import { type BotSecret, BotStore } from './bot-store';
|
|
3
|
+
import { type Bot, type BotInfo, type BotOrigin, type BotState, type BotsHostApi, type BotTarget, type LoginState, type SentDetails, type WecomInput } from './bots-protocol';
|
|
4
|
+
import { type BotChannel, type BotEndpoints, type BotFile, type ChannelMessage, type ChannelReply } from './channel-protocol';
|
|
5
|
+
import { SessionBridge, type SessionHandler } from './session-bridge';
|
|
6
|
+
import { WecomLogins } from './wecom-login';
|
|
7
|
+
import { WeixinApi } from './weixin-api';
|
|
8
|
+
import { WeixinLogins, type WeixinSignIn } from './weixin-login';
|
|
9
|
+
export type BotsHost = Pick<TaExtensionHost, 'agentDir' | 'getExtensionData' | 'setExtensionData' | 'getServerInfo' | 'listSessions' | 'openSession' | 'closeSession' | 'sessionCwd'>;
|
|
10
|
+
export interface BotServiceOptions {
|
|
11
|
+
endpoints: BotEndpoints;
|
|
12
|
+
/** Makes the connection of a bot; tests give channels of their own. */
|
|
13
|
+
channel?(bot: Bot, secret: BotSecret): BotChannel;
|
|
14
|
+
/** How long a new robot of WeCom is given to sign in. */
|
|
15
|
+
verifyMs: number;
|
|
16
|
+
/** How the sign-ins of WeCom reach it; tests answer for it. */
|
|
17
|
+
fetcher?: typeof fetch;
|
|
18
|
+
}
|
|
19
|
+
/** An answer under way, by the id of BotOrigin.reply. */
|
|
20
|
+
interface Pending {
|
|
21
|
+
botId: string;
|
|
22
|
+
chat: string;
|
|
23
|
+
reply: ChannelReply;
|
|
24
|
+
timer: ReturnType<typeof setTimeout>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The bots, in the Ta service (`pi.host`): it keeps them connected while it runs, with no page open,
|
|
28
|
+
* takes each message to the conversation its bot is connected to (SessionBridge), and sends back what the
|
|
29
|
+
* pi extension of that conversation answers. A bot is in one place at most: connecting it elsewhere
|
|
30
|
+
* takes it from where it was. One account of WeChat is one bot: scanning with it again renews that bot.
|
|
31
|
+
*/
|
|
32
|
+
export declare class BotService implements BotsHostApi, TaPackageService {
|
|
33
|
+
protected readonly host: BotsHost;
|
|
34
|
+
protected bots: Bot[];
|
|
35
|
+
protected status: Record<string, BotState>;
|
|
36
|
+
protected readonly channels: Map<string, BotChannel>;
|
|
37
|
+
protected readonly pending: Map<string, Pending>;
|
|
38
|
+
/** By bot, the chat it heard from last. */
|
|
39
|
+
protected readonly lastChat: Map<string, string>;
|
|
40
|
+
protected readonly store: BotStore;
|
|
41
|
+
protected readonly bridge: SessionBridge;
|
|
42
|
+
protected readonly logins: WeixinLogins;
|
|
43
|
+
protected readonly wecomLogins: WecomLogins;
|
|
44
|
+
protected readonly api: WeixinApi;
|
|
45
|
+
protected readonly options: BotServiceOptions;
|
|
46
|
+
protected statusTimer?: ReturnType<typeof setTimeout>;
|
|
47
|
+
protected disposed: boolean;
|
|
48
|
+
constructor(host: BotsHost, options?: Partial<BotServiceOptions>);
|
|
49
|
+
start(): Promise<void>;
|
|
50
|
+
dispose(): Promise<void>;
|
|
51
|
+
list(): Promise<BotInfo[]>;
|
|
52
|
+
startWeixinLogin(target?: unknown): Promise<LoginState>;
|
|
53
|
+
startWecomLogin(target?: unknown): Promise<LoginState>;
|
|
54
|
+
login(id: string): Promise<LoginState>;
|
|
55
|
+
verifyLogin(id: string, code: string): Promise<LoginState>;
|
|
56
|
+
cancelLogin(id: string): Promise<void>;
|
|
57
|
+
/** Signs a robot of WeCom in once to check its id and secret, then keeps it. */
|
|
58
|
+
addWecom(input: WecomInput): Promise<BotInfo>;
|
|
59
|
+
/** Keeps a robot of WeCom (the same Bot ID again updates it), checked first by signing it in once when `check`. */
|
|
60
|
+
protected keepWecom(botId: string, secret: string, name: unknown, target: BotTarget | undefined, check: boolean): Promise<BotInfo>;
|
|
61
|
+
bind(botId: string, target: unknown): Promise<{
|
|
62
|
+
bot: BotInfo;
|
|
63
|
+
before?: BotTarget;
|
|
64
|
+
}>;
|
|
65
|
+
rename(botId: string, name: string): Promise<BotInfo>;
|
|
66
|
+
remove(botId: string): Promise<void>;
|
|
67
|
+
attach(piSessionId: string, handler: SessionHandler): () => void;
|
|
68
|
+
/** The bots connected to the conversation of a session file (to the double when it is the double's). */
|
|
69
|
+
boundTo(sessionFile: string | undefined): Promise<Bot[]>;
|
|
70
|
+
/** The answer of a run to the messages that started it (each origin once); what went back, per bot. */
|
|
71
|
+
replied(origins: BotOrigin[], text: string): Promise<SentDetails[]>;
|
|
72
|
+
/** Sends a file to the chats of `origins`; without any, to the last chat of each bot of the conversation. */
|
|
73
|
+
sendFile(origins: BotOrigin[], file: BotFile): Promise<SentDetails[]>;
|
|
74
|
+
/** The chats each of these bots heard from last: where a file goes when no message asked for it. */
|
|
75
|
+
lastChats(bots: Bot[]): BotOrigin[];
|
|
76
|
+
protected signedIn(signIn: WeixinSignIn, target: BotTarget | undefined): Promise<string>;
|
|
77
|
+
protected verify(bot: Bot, secret: BotSecret): Promise<void>;
|
|
78
|
+
protected channel(bot: Bot, secret: BotSecret): BotChannel;
|
|
79
|
+
protected connect(bot: Bot): Promise<void>;
|
|
80
|
+
protected disconnect(id: string): Promise<void>;
|
|
81
|
+
protected receive(botId: string, channel: BotChannel, message: ChannelMessage): Promise<void>;
|
|
82
|
+
protected done(id: string): void;
|
|
83
|
+
/** The sign-ins a sign-in of this id is one of. */
|
|
84
|
+
protected book(id: string): WeixinLogins | WecomLogins;
|
|
85
|
+
protected names(): string[];
|
|
86
|
+
protected find(id: string): Bot;
|
|
87
|
+
protected put(bot: Bot): Promise<void>;
|
|
88
|
+
protected info(bot: Bot): BotInfo;
|
|
89
|
+
protected setStatus(id: string, state: BotState): void;
|
|
90
|
+
/** States change in bursts (connecting, online): written once for each burst. */
|
|
91
|
+
protected saveStatusLater(): void;
|
|
92
|
+
static unique(origins: BotOrigin[]): BotOrigin[];
|
|
93
|
+
static short(account: string): string;
|
|
94
|
+
}
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=bot-service.d.ts.map
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BotService = void 0;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const bot_store_1 = require("./bot-store");
|
|
6
|
+
const bots_protocol_1 = require("./bots-protocol");
|
|
7
|
+
const channel_protocol_1 = require("./channel-protocol");
|
|
8
|
+
const server_texts_1 = require("./server-texts");
|
|
9
|
+
const session_bridge_1 = require("./session-bridge");
|
|
10
|
+
const wecom_channel_1 = require("./wecom-channel");
|
|
11
|
+
const wecom_login_1 = require("./wecom-login");
|
|
12
|
+
const weixin_api_1 = require("./weixin-api");
|
|
13
|
+
const weixin_channel_1 = require("./weixin-channel");
|
|
14
|
+
const weixin_login_1 = require("./weixin-login");
|
|
15
|
+
/** An answer not given within this long is let go (its typing, its stream). */
|
|
16
|
+
const PENDING_MS = 30 * 60000;
|
|
17
|
+
/**
|
|
18
|
+
* The bots, in the Ta service (`pi.host`): it keeps them connected while it runs, with no page open,
|
|
19
|
+
* takes each message to the conversation its bot is connected to (SessionBridge), and sends back what the
|
|
20
|
+
* pi extension of that conversation answers. A bot is in one place at most: connecting it elsewhere
|
|
21
|
+
* takes it from where it was. One account of WeChat is one bot: scanning with it again renews that bot.
|
|
22
|
+
*/
|
|
23
|
+
class BotService {
|
|
24
|
+
constructor(host, options = {}) {
|
|
25
|
+
this.host = host;
|
|
26
|
+
this.bots = [];
|
|
27
|
+
this.status = {};
|
|
28
|
+
this.channels = new Map();
|
|
29
|
+
this.pending = new Map();
|
|
30
|
+
/** By bot, the chat it heard from last. */
|
|
31
|
+
this.lastChat = new Map();
|
|
32
|
+
this.disposed = false;
|
|
33
|
+
this.options = { endpoints: channel_protocol_1.BotEndpointsUtil.of(), verifyMs: 15000, ...options };
|
|
34
|
+
this.store = new bot_store_1.BotStore(host);
|
|
35
|
+
this.bridge = new session_bridge_1.SessionBridge(host);
|
|
36
|
+
this.api = new weixin_api_1.WeixinApi(this.options.endpoints);
|
|
37
|
+
this.logins = new weixin_login_1.WeixinLogins(this.api, this.options.endpoints.weixinApi);
|
|
38
|
+
this.wecomLogins = new wecom_login_1.WecomLogins(this.options.endpoints.wecomQr, options.fetcher);
|
|
39
|
+
}
|
|
40
|
+
async start() {
|
|
41
|
+
this.bots = await this.store.bots();
|
|
42
|
+
this.status = {};
|
|
43
|
+
for (const bot of this.bots) {
|
|
44
|
+
await this.connect(bot);
|
|
45
|
+
}
|
|
46
|
+
await this.store.saveStatus(this.status);
|
|
47
|
+
}
|
|
48
|
+
async dispose() {
|
|
49
|
+
this.disposed = true;
|
|
50
|
+
this.logins.dispose();
|
|
51
|
+
this.wecomLogins.dispose();
|
|
52
|
+
this.bridge.dispose();
|
|
53
|
+
clearTimeout(this.statusTimer);
|
|
54
|
+
for (const pending of this.pending.values()) {
|
|
55
|
+
clearTimeout(pending.timer);
|
|
56
|
+
}
|
|
57
|
+
await Promise.all([...this.channels.values()].map(channel => channel.stop().catch(() => undefined)));
|
|
58
|
+
this.channels.clear();
|
|
59
|
+
}
|
|
60
|
+
async list() {
|
|
61
|
+
return this.bots.map(bot => this.info(bot));
|
|
62
|
+
}
|
|
63
|
+
async startWeixinLogin(target) {
|
|
64
|
+
const where = bots_protocol_1.BotTargetUtil.parse(target);
|
|
65
|
+
return this.logins.start(await this.store.tokens(), signIn => this.signedIn(signIn, where));
|
|
66
|
+
}
|
|
67
|
+
async startWecomLogin(target) {
|
|
68
|
+
const where = bots_protocol_1.BotTargetUtil.parse(target);
|
|
69
|
+
// WeCom made the robot just now: it is kept without signing it in first.
|
|
70
|
+
return this.wecomLogins.start(async ({ botId, secret }) => (await this.keepWecom(botId, secret, undefined, where, false)).id);
|
|
71
|
+
}
|
|
72
|
+
async login(id) {
|
|
73
|
+
return this.book(String(id)).get(String(id));
|
|
74
|
+
}
|
|
75
|
+
async verifyLogin(id, code) {
|
|
76
|
+
return this.logins.verify(String(id), String(code !== null && code !== void 0 ? code : ''));
|
|
77
|
+
}
|
|
78
|
+
async cancelLogin(id) {
|
|
79
|
+
this.book(String(id)).cancel(String(id));
|
|
80
|
+
}
|
|
81
|
+
/** Signs a robot of WeCom in once to check its id and secret, then keeps it. */
|
|
82
|
+
async addWecom(input) {
|
|
83
|
+
const botId = typeof (input === null || input === void 0 ? void 0 : input.botId) === 'string' ? input.botId.trim() : '';
|
|
84
|
+
const secret = typeof (input === null || input === void 0 ? void 0 : input.secret) === 'string' ? input.secret.trim() : '';
|
|
85
|
+
if (!botId || !secret) {
|
|
86
|
+
throw new Error('Give the Bot ID and the Secret of the robot, from its page in the admin console of WeCom.');
|
|
87
|
+
}
|
|
88
|
+
return this.keepWecom(botId, secret, input.name, bots_protocol_1.BotTargetUtil.parse(input.target), true);
|
|
89
|
+
}
|
|
90
|
+
/** Keeps a robot of WeCom (the same Bot ID again updates it), checked first by signing it in once when `check`. */
|
|
91
|
+
async keepWecom(botId, secret, name, target, check) {
|
|
92
|
+
var _a;
|
|
93
|
+
const id = `wecom:${botId}`;
|
|
94
|
+
const before = this.bots.find(bot => bot.id === id);
|
|
95
|
+
const bot = {
|
|
96
|
+
id,
|
|
97
|
+
kind: 'wecom',
|
|
98
|
+
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: botId.length > 10 ? `${botId.slice(0, 6)}…${botId.slice(-4)}` : botId,
|
|
100
|
+
target: target !== null && target !== void 0 ? target : before === null || before === void 0 ? void 0 : before.target,
|
|
101
|
+
createdAt: (_a = before === null || before === void 0 ? void 0 : before.createdAt) !== null && _a !== void 0 ? _a : Date.now(),
|
|
102
|
+
};
|
|
103
|
+
if (check) {
|
|
104
|
+
await this.verify(bot, { kind: 'wecom', botId, secret });
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
await this.disconnect(id);
|
|
108
|
+
}
|
|
109
|
+
await this.store.setSecret(id, { kind: 'wecom', botId, secret });
|
|
110
|
+
await this.put(bot);
|
|
111
|
+
await this.connect(bot);
|
|
112
|
+
return this.info(bot);
|
|
113
|
+
}
|
|
114
|
+
async bind(botId, target) {
|
|
115
|
+
const bot = this.find(botId);
|
|
116
|
+
const next = target === null ? undefined : bots_protocol_1.BotTargetUtil.parse(target);
|
|
117
|
+
if (target !== null && !next) {
|
|
118
|
+
throw new Error('Connect a bot to the double or to a conversation that has a session file.');
|
|
119
|
+
}
|
|
120
|
+
const before = bot.target;
|
|
121
|
+
await this.put({ ...bot, target: next });
|
|
122
|
+
return { bot: this.info(this.find(botId)), before };
|
|
123
|
+
}
|
|
124
|
+
async rename(botId, name) {
|
|
125
|
+
const bot = this.find(botId);
|
|
126
|
+
const trimmed = String(name !== null && name !== void 0 ? name : '')
|
|
127
|
+
.trim()
|
|
128
|
+
.slice(0, 40);
|
|
129
|
+
if (!trimmed) {
|
|
130
|
+
throw new Error('A bot needs a name.');
|
|
131
|
+
}
|
|
132
|
+
await this.put({ ...bot, name: trimmed });
|
|
133
|
+
return this.info(this.find(botId));
|
|
134
|
+
}
|
|
135
|
+
async remove(botId) {
|
|
136
|
+
const bot = this.find(botId);
|
|
137
|
+
await this.disconnect(bot.id);
|
|
138
|
+
await this.store.setSecret(bot.id, undefined);
|
|
139
|
+
await this.store.memory(bot.id).forget();
|
|
140
|
+
this.bots = this.bots.filter(other => other.id !== bot.id);
|
|
141
|
+
delete this.status[bot.id];
|
|
142
|
+
await this.store.saveBots(this.bots);
|
|
143
|
+
this.saveStatusLater();
|
|
144
|
+
}
|
|
145
|
+
// What the pi extension of a conversation calls.
|
|
146
|
+
attach(piSessionId, handler) {
|
|
147
|
+
return this.bridge.attach(piSessionId, handler);
|
|
148
|
+
}
|
|
149
|
+
/** The bots connected to the conversation of a session file (to the double when it is the double's). */
|
|
150
|
+
async boundTo(sessionFile) {
|
|
151
|
+
if (!sessionFile) {
|
|
152
|
+
return [];
|
|
153
|
+
}
|
|
154
|
+
const double = await this.bridge.sessionFile({ kind: 'double' });
|
|
155
|
+
return this.bots.filter(bot => bot.target && (bot.target.kind === 'double' ? double === sessionFile : bot.target.sessionFile === sessionFile));
|
|
156
|
+
}
|
|
157
|
+
/** The answer of a run to the messages that started it (each origin once); what went back, per bot. */
|
|
158
|
+
async replied(origins, text) {
|
|
159
|
+
const sent = [];
|
|
160
|
+
for (const origin of BotService.unique(origins)) {
|
|
161
|
+
const bot = this.bots.find(other => other.id === origin.botId);
|
|
162
|
+
const channel = this.channels.get(origin.botId);
|
|
163
|
+
if (!bot || !channel) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const pending = origin.reply ? this.pending.get(origin.reply) : undefined;
|
|
167
|
+
try {
|
|
168
|
+
if (pending) {
|
|
169
|
+
this.done(origin.reply);
|
|
170
|
+
await (text ? pending.reply.finish(text) : pending.reply.cancel());
|
|
171
|
+
}
|
|
172
|
+
else if (text) {
|
|
173
|
+
await channel.sendText(origin.chat, text);
|
|
174
|
+
}
|
|
175
|
+
sent.push({ botId: bot.id, kind: bot.kind, botName: bot.name, text });
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
sent.push({ botId: bot.id, kind: bot.kind, botName: bot.name, error: (0, channel_protocol_1.errorText)(error) });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return sent;
|
|
182
|
+
}
|
|
183
|
+
/** Sends a file to the chats of `origins`; without any, to the last chat of each bot of the conversation. */
|
|
184
|
+
async sendFile(origins, file) {
|
|
185
|
+
const sent = [];
|
|
186
|
+
for (const origin of BotService.unique(origins)) {
|
|
187
|
+
const bot = this.bots.find(other => other.id === origin.botId);
|
|
188
|
+
const channel = this.channels.get(origin.botId);
|
|
189
|
+
if (!bot || !channel) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
try {
|
|
193
|
+
await channel.sendFile(origin.chat, file);
|
|
194
|
+
sent.push({ botId: bot.id, kind: bot.kind, botName: bot.name, files: [file.name] });
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
sent.push({ botId: bot.id, kind: bot.kind, botName: bot.name, files: [file.name], error: (0, channel_protocol_1.errorText)(error) });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return sent;
|
|
201
|
+
}
|
|
202
|
+
/** The chats each of these bots heard from last: where a file goes when no message asked for it. */
|
|
203
|
+
lastChats(bots) {
|
|
204
|
+
return bots.flatMap(bot => {
|
|
205
|
+
const chat = this.lastChat.get(bot.id);
|
|
206
|
+
return chat ? [{ botId: bot.id, chat }] : [];
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
async signedIn(signIn, target) {
|
|
210
|
+
var _a;
|
|
211
|
+
var _b, _c, _d, _e;
|
|
212
|
+
const id = `weixin:${signIn.botId}`;
|
|
213
|
+
// One bot per account of WeChat: another sign-in of the account takes the place of its bot.
|
|
214
|
+
const secrets = await Promise.all(this.bots.map(async (bot) => [bot, await this.store.secret(bot.id)]));
|
|
215
|
+
const before = (_b = this.bots.find(bot => bot.id === id)) !== null && _b !== void 0 ? _b : (_a = secrets.find(([bot, secret]) => bot.kind === 'weixin' && signIn.userId && (secret === null || secret === void 0 ? void 0 : secret.kind) === 'weixin' && secret.userId === signIn.userId)) === null || _a === void 0 ? void 0 : _a[0];
|
|
216
|
+
if (before && before.id !== id) {
|
|
217
|
+
await this.remove(before.id);
|
|
218
|
+
}
|
|
219
|
+
const bot = {
|
|
220
|
+
id,
|
|
221
|
+
kind: 'weixin',
|
|
222
|
+
name: (_c = before === null || before === void 0 ? void 0 : before.name) !== null && _c !== void 0 ? _c : server_texts_1.BotServerTexts.defaultName('weixin', this.names()),
|
|
223
|
+
account: BotService.short((_d = signIn.userId) !== null && _d !== void 0 ? _d : signIn.botId),
|
|
224
|
+
target: target !== null && target !== void 0 ? target : before === null || before === void 0 ? void 0 : before.target,
|
|
225
|
+
createdAt: (_e = before === null || before === void 0 ? void 0 : before.createdAt) !== null && _e !== void 0 ? _e : Date.now(),
|
|
226
|
+
};
|
|
227
|
+
await this.disconnect(id);
|
|
228
|
+
await this.store.setSecret(id, { kind: 'weixin', token: signIn.token, baseUrl: signIn.baseUrl, userId: signIn.userId });
|
|
229
|
+
await this.put(bot);
|
|
230
|
+
await this.connect(bot);
|
|
231
|
+
return id;
|
|
232
|
+
}
|
|
233
|
+
async verify(bot, secret) {
|
|
234
|
+
const channel = this.channel(bot, secret);
|
|
235
|
+
try {
|
|
236
|
+
await new Promise((resolve, reject) => {
|
|
237
|
+
const timer = setTimeout(() => reject(new Error('WeCom did not answer; check the network of this computer.')), this.options.verifyMs);
|
|
238
|
+
channel.onState(state => {
|
|
239
|
+
if (state.status === 'online') {
|
|
240
|
+
clearTimeout(timer);
|
|
241
|
+
resolve();
|
|
242
|
+
}
|
|
243
|
+
else if (state.error && state.status !== 'offline') {
|
|
244
|
+
clearTimeout(timer);
|
|
245
|
+
reject(new Error(state.error));
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
// Another connection of the robot is replaced by this one: the one kept is stopped first.
|
|
249
|
+
void this.disconnect(bot.id).then(() => channel.start());
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
finally {
|
|
253
|
+
await channel.stop();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
channel(bot, secret) {
|
|
257
|
+
if (this.options.channel) {
|
|
258
|
+
return this.options.channel(bot, secret);
|
|
259
|
+
}
|
|
260
|
+
if (secret.kind === 'weixin') {
|
|
261
|
+
return new weixin_channel_1.WeixinChannel(this.api, { token: secret.token, baseUrl: secret.baseUrl }, this.store.memory(bot.id));
|
|
262
|
+
}
|
|
263
|
+
return new wecom_channel_1.WecomChannel(this.options.endpoints.wecomSocket, { botId: secret.botId, secret: secret.secret });
|
|
264
|
+
}
|
|
265
|
+
async connect(bot) {
|
|
266
|
+
if (this.disposed || this.channels.has(bot.id)) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
const secret = await this.store.secret(bot.id);
|
|
270
|
+
if (!secret) {
|
|
271
|
+
this.setStatus(bot.id, { status: 'expired', error: 'Its credentials are gone; connect it again.' });
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const channel = this.channel(bot, secret);
|
|
275
|
+
this.channels.set(bot.id, channel);
|
|
276
|
+
channel.onState(state => {
|
|
277
|
+
var _a;
|
|
278
|
+
if (this.channels.get(bot.id) === channel) {
|
|
279
|
+
this.setStatus(bot.id, { ...state, lastMessageAt: (_a = this.status[bot.id]) === null || _a === void 0 ? void 0 : _a.lastMessageAt });
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
channel.onMessage(message => void this.receive(bot.id, channel, message));
|
|
283
|
+
channel.start();
|
|
284
|
+
}
|
|
285
|
+
async disconnect(id) {
|
|
286
|
+
const channel = this.channels.get(id);
|
|
287
|
+
this.channels.delete(id);
|
|
288
|
+
await (channel === null || channel === void 0 ? void 0 : channel.stop().catch(() => undefined));
|
|
289
|
+
}
|
|
290
|
+
async receive(botId, channel, message) {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
var _c;
|
|
293
|
+
const bot = this.bots.find(other => other.id === botId);
|
|
294
|
+
if (!bot) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
this.lastChat.set(bot.id, message.chat);
|
|
298
|
+
this.setStatus(bot.id, { ...((_c = this.status[bot.id]) !== null && _c !== void 0 ? _c : { status: 'online' }), lastMessageAt: Date.now() });
|
|
299
|
+
if (!bot.target) {
|
|
300
|
+
await channel.sendText(message.chat, server_texts_1.BotServerTexts.unbound()).catch(() => undefined);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const reply = channel.begin(message.chat, message.handle);
|
|
304
|
+
const id = (0, node_crypto_1.randomBytes)(8).toString('hex');
|
|
305
|
+
const timer = setTimeout(() => {
|
|
306
|
+
this.done(id);
|
|
307
|
+
void reply.cancel().catch(() => undefined);
|
|
308
|
+
}, PENDING_MS);
|
|
309
|
+
(_b = (_a = timer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
310
|
+
this.pending.set(id, { botId: bot.id, chat: message.chat, reply, timer });
|
|
311
|
+
try {
|
|
312
|
+
await this.bridge.deliver(bot.target, {
|
|
313
|
+
details: {
|
|
314
|
+
origin: { botId: bot.id, chat: message.chat, reply: id },
|
|
315
|
+
kind: bot.kind,
|
|
316
|
+
botName: bot.name,
|
|
317
|
+
from: message.from,
|
|
318
|
+
...(message.group ? { group: true } : {}),
|
|
319
|
+
text: message.text,
|
|
320
|
+
attachments: [],
|
|
321
|
+
at: Date.now(),
|
|
322
|
+
},
|
|
323
|
+
files: message.files,
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
catch (error) {
|
|
327
|
+
this.done(id);
|
|
328
|
+
const text = error instanceof session_bridge_1.NoDoubleError ? server_texts_1.BotServerTexts.noDouble() : server_texts_1.BotServerTexts.failed((0, channel_protocol_1.errorText)(error));
|
|
329
|
+
await reply.finish(text).catch(() => undefined);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
done(id) {
|
|
333
|
+
const pending = this.pending.get(id);
|
|
334
|
+
if (pending) {
|
|
335
|
+
clearTimeout(pending.timer);
|
|
336
|
+
this.pending.delete(id);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/** The sign-ins a sign-in of this id is one of. */
|
|
340
|
+
book(id) {
|
|
341
|
+
return this.wecomLogins.owns(id) ? this.wecomLogins : this.logins;
|
|
342
|
+
}
|
|
343
|
+
names() {
|
|
344
|
+
return this.bots.map(bot => bot.name);
|
|
345
|
+
}
|
|
346
|
+
find(id) {
|
|
347
|
+
const bot = this.bots.find(other => other.id === id);
|
|
348
|
+
if (!bot) {
|
|
349
|
+
throw new Error(`No bot is ${id}.`);
|
|
350
|
+
}
|
|
351
|
+
return bot;
|
|
352
|
+
}
|
|
353
|
+
async put(bot) {
|
|
354
|
+
const index = this.bots.findIndex(other => other.id === bot.id);
|
|
355
|
+
this.bots = index < 0 ? [...this.bots, bot] : this.bots.map(other => (other.id === bot.id ? bot : other));
|
|
356
|
+
await this.store.saveBots(this.bots);
|
|
357
|
+
}
|
|
358
|
+
info(bot) {
|
|
359
|
+
var _a;
|
|
360
|
+
return { ...bot, ...((_a = this.status[bot.id]) !== null && _a !== void 0 ? _a : { status: 'offline' }) };
|
|
361
|
+
}
|
|
362
|
+
setStatus(id, state) {
|
|
363
|
+
const before = this.status[id];
|
|
364
|
+
if (before && before.status === state.status && before.error === state.error && before.lastMessageAt === state.lastMessageAt) {
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
this.status = { ...this.status, [id]: state };
|
|
368
|
+
this.saveStatusLater();
|
|
369
|
+
}
|
|
370
|
+
/** States change in bursts (connecting, online): written once for each burst. */
|
|
371
|
+
saveStatusLater() {
|
|
372
|
+
var _a, _b;
|
|
373
|
+
clearTimeout(this.statusTimer);
|
|
374
|
+
this.statusTimer = setTimeout(() => void this.store.saveStatus(this.status).catch(() => undefined), 200);
|
|
375
|
+
(_b = (_a = this.statusTimer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
376
|
+
}
|
|
377
|
+
static unique(origins) {
|
|
378
|
+
const seen = new Set();
|
|
379
|
+
return origins.filter(origin => {
|
|
380
|
+
var _a;
|
|
381
|
+
const key = `${origin.botId}\n${origin.chat}\n${(_a = origin.reply) !== null && _a !== void 0 ? _a : ''}`;
|
|
382
|
+
return !seen.has(key) && seen.add(key) !== undefined;
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
static short(account) {
|
|
386
|
+
const name = account.split('@')[0];
|
|
387
|
+
return name.length > 10 ? `${name.slice(0, 4)}…${name.slice(-4)}` : name;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
exports.BotService = BotService;
|
|
391
|
+
//# sourceMappingURL=bot-service.js.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { TaExtensionHost } from '@celljs/ta-protocol';
|
|
2
|
+
import { type Bot, type BotState } from './bots-protocol';
|
|
3
|
+
import type { WeixinMemory } from './weixin-channel';
|
|
4
|
+
export type BotSecret = {
|
|
5
|
+
kind: 'weixin';
|
|
6
|
+
token: string;
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
userId?: string;
|
|
9
|
+
} | {
|
|
10
|
+
kind: 'wecom';
|
|
11
|
+
botId: string;
|
|
12
|
+
secret: string;
|
|
13
|
+
};
|
|
14
|
+
type Host = Pick<TaExtensionHost, 'agentDir' | 'getExtensionData' | 'setExtensionData'>;
|
|
15
|
+
/**
|
|
16
|
+
* What the bots keep: the list and how each is, in the data of the package (pages read them); their
|
|
17
|
+
* tokens and secrets in a file of their own that only the user can read (`<agent dir>/bots/secrets.json`),
|
|
18
|
+
* never in the data a page reads; and per bot of WeChat where its updates stand.
|
|
19
|
+
*/
|
|
20
|
+
export declare class BotStore {
|
|
21
|
+
protected readonly host: Host;
|
|
22
|
+
protected readonly dir: string;
|
|
23
|
+
protected secrets?: Record<string, BotSecret>;
|
|
24
|
+
protected writing: Promise<void>;
|
|
25
|
+
constructor(host: Host);
|
|
26
|
+
bots(): Promise<Bot[]>;
|
|
27
|
+
saveBots(bots: Bot[]): Promise<void>;
|
|
28
|
+
saveStatus(status: Record<string, BotState>): Promise<void>;
|
|
29
|
+
secret(id: string): Promise<BotSecret | undefined>;
|
|
30
|
+
tokens(): Promise<string[]>;
|
|
31
|
+
setSecret(id: string, secret: BotSecret | undefined): Promise<void>;
|
|
32
|
+
/** Where the updates of a bot of WeChat stand, and the context token of each of its chats. */
|
|
33
|
+
memory(id: string): WeixinMemory & {
|
|
34
|
+
forget(): Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
protected allSecrets(): Promise<Record<string, BotSecret>>;
|
|
37
|
+
protected read(file: string): Promise<unknown>;
|
|
38
|
+
/** One write at a time, through a file beside it, so that a crash leaves the old one whole. */
|
|
39
|
+
protected write(file: string, value: unknown): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=bot-store.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BotStore = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const bots_protocol_1 = require("./bots-protocol");
|
|
7
|
+
/**
|
|
8
|
+
* What the bots keep: the list and how each is, in the data of the package (pages read them); their
|
|
9
|
+
* tokens and secrets in a file of their own that only the user can read (`<agent dir>/bots/secrets.json`),
|
|
10
|
+
* never in the data a page reads; and per bot of WeChat where its updates stand.
|
|
11
|
+
*/
|
|
12
|
+
class BotStore {
|
|
13
|
+
constructor(host) {
|
|
14
|
+
this.host = host;
|
|
15
|
+
this.writing = Promise.resolve();
|
|
16
|
+
this.dir = (0, node_path_1.join)(host.agentDir, 'bots');
|
|
17
|
+
}
|
|
18
|
+
async bots() {
|
|
19
|
+
const value = await this.host.getExtensionData(bots_protocol_1.NAME, bots_protocol_1.Keys.BOTS);
|
|
20
|
+
return Array.isArray(value) ? value.filter(bot => bot && typeof bot.id === 'string') : [];
|
|
21
|
+
}
|
|
22
|
+
saveBots(bots) {
|
|
23
|
+
return this.host.setExtensionData(bots_protocol_1.NAME, bots_protocol_1.Keys.BOTS, bots);
|
|
24
|
+
}
|
|
25
|
+
saveStatus(status) {
|
|
26
|
+
return this.host.setExtensionData(bots_protocol_1.NAME, bots_protocol_1.Keys.STATUS, status);
|
|
27
|
+
}
|
|
28
|
+
async secret(id) {
|
|
29
|
+
return (await this.allSecrets())[id];
|
|
30
|
+
}
|
|
31
|
+
async tokens() {
|
|
32
|
+
return Object.values(await this.allSecrets()).flatMap(secret => (secret.kind === 'weixin' ? [secret.token] : []));
|
|
33
|
+
}
|
|
34
|
+
async setSecret(id, secret) {
|
|
35
|
+
const secrets = { ...(await this.allSecrets()) };
|
|
36
|
+
if (secret) {
|
|
37
|
+
secrets[id] = secret;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
delete secrets[id];
|
|
41
|
+
}
|
|
42
|
+
this.secrets = secrets;
|
|
43
|
+
await this.write('secrets.json', secrets);
|
|
44
|
+
}
|
|
45
|
+
/** Where the updates of a bot of WeChat stand, and the context token of each of its chats. */
|
|
46
|
+
memory(id) {
|
|
47
|
+
const file = `${id.replace(/[^\w.-]+/g, '_')}.json`;
|
|
48
|
+
let state;
|
|
49
|
+
const load = async () => { var _a; return (state !== null && state !== void 0 ? state : (state = (_a = (await this.read(file))) !== null && _a !== void 0 ? _a : {})); };
|
|
50
|
+
const save = () => this.write(file, state);
|
|
51
|
+
return {
|
|
52
|
+
cursor: async () => { var _a; var _b; return (_b = (_a = (await load())) === null || _a === void 0 ? void 0 : _a.cursor) !== null && _b !== void 0 ? _b : ''; },
|
|
53
|
+
setCursor: async (cursor) => {
|
|
54
|
+
(await load()).cursor = cursor;
|
|
55
|
+
await save();
|
|
56
|
+
},
|
|
57
|
+
contexts: async () => { var _a; var _b; return ({ ...((_b = (_a = (await load())) === null || _a === void 0 ? void 0 : _a.contexts) !== null && _b !== void 0 ? _b : {}) }); },
|
|
58
|
+
setContext: async (chat, token) => {
|
|
59
|
+
const current = await load();
|
|
60
|
+
current.contexts = { ...current.contexts, [chat]: token };
|
|
61
|
+
await save();
|
|
62
|
+
},
|
|
63
|
+
forget: async () => {
|
|
64
|
+
state = {};
|
|
65
|
+
await save();
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async allSecrets() {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
(_a = this.secrets) !== null && _a !== void 0 ? _a : (this.secrets = (_b = (await this.read('secrets.json'))) !== null && _b !== void 0 ? _b : {});
|
|
72
|
+
return this.secrets;
|
|
73
|
+
}
|
|
74
|
+
async read(file) {
|
|
75
|
+
try {
|
|
76
|
+
return JSON.parse(await (0, promises_1.readFile)((0, node_path_1.join)(this.dir, file), 'utf8'));
|
|
77
|
+
}
|
|
78
|
+
catch (_a) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** One write at a time, through a file beside it, so that a crash leaves the old one whole. */
|
|
83
|
+
write(file, value) {
|
|
84
|
+
const next = this.writing.then(async () => {
|
|
85
|
+
await (0, promises_1.mkdir)(this.dir, { recursive: true, mode: 0o700 });
|
|
86
|
+
const path = (0, node_path_1.join)(this.dir, file);
|
|
87
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
88
|
+
await (0, promises_1.writeFile)(temporary, `${JSON.stringify(value !== null && value !== void 0 ? value : {}, null, 2)}\n`, { mode: 0o600 });
|
|
89
|
+
await (0, promises_1.rename)(temporary, path);
|
|
90
|
+
await (0, promises_1.chmod)(path, 0o600).catch(() => undefined);
|
|
91
|
+
});
|
|
92
|
+
this.writing = next.catch(() => undefined);
|
|
93
|
+
return next;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.BotStore = BotStore;
|
|
97
|
+
//# sourceMappingURL=bot-store.js.map
|