@celljs/ta 4.7.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 +42 -3
- package/README.md +41 -2
- package/bin/ta.mjs +1 -1
- package/dist/cli.mjs +611 -22
- package/dist/gateway.mjs +2812 -0
- package/dist/pi/CHANGELOG.md +51 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/README.en.md +68 -0
- package/dist/pi/packages/ta-agents/README.md +68 -0
- package/dist/pi/packages/ta-agents/extension/index.mjs +1756 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.d.ts +52 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.js +218 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +153 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +45 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +45 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +135 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +50 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js +143 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +18 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +86 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +71 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.js +220 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.d.ts +41 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +172 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts +22 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +88 -0
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +115 -0
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +343 -0
- package/dist/pi/packages/ta-agents/lib/extension.d.ts +26 -0
- package/dist/pi/packages/ta-agents/lib/extension.js +247 -0
- package/dist/pi/packages/ta-agents/lib/json-rpc.d.ts +41 -0
- package/dist/pi/packages/ta-agents/lib/json-rpc.js +145 -0
- package/dist/pi/packages/ta-agents/lib/message-stream.d.ts +31 -0
- package/dist/pi/packages/ta-agents/lib/message-stream.js +134 -0
- package/dist/pi/packages/ta-agents/lib/pi-types.d.ts +20 -0
- package/dist/pi/packages/ta-agents/lib/pi-types.js +3 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +36 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +43 -0
- package/dist/pi/packages/ta-agents/package.json +61 -0
- 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/README.en.md +21 -0
- package/dist/pi/packages/ta-changes/README.md +21 -0
- package/dist/pi/packages/ta-changes/extension/index.mjs +296 -0
- package/dist/pi/packages/ta-changes/host/index.mjs +309 -0
- package/dist/pi/packages/ta-changes/lib/blob-store.d.ts +16 -0
- package/dist/pi/packages/ta-changes/lib/blob-store.js +69 -0
- package/dist/pi/packages/ta-changes/lib/card.d.ts +12 -0
- package/dist/pi/packages/ta-changes/lib/card.js +149 -0
- package/dist/pi/packages/ta-changes/lib/changes-protocol.d.ts +76 -0
- package/dist/pi/packages/ta-changes/lib/changes-protocol.js +20 -0
- package/dist/pi/packages/ta-changes/lib/changes-service.d.ts +20 -0
- package/dist/pi/packages/ta-changes/lib/changes-service.js +70 -0
- package/dist/pi/packages/ta-changes/lib/changes-util.d.ts +21 -0
- package/dist/pi/packages/ta-changes/lib/changes-util.js +44 -0
- package/dist/pi/packages/ta-changes/lib/diff-tab.d.ts +4 -0
- package/dist/pi/packages/ta-changes/lib/diff-tab.js +45 -0
- package/dist/pi/packages/ta-changes/lib/extension.d.ts +21 -0
- package/dist/pi/packages/ta-changes/lib/extension.js +106 -0
- package/dist/pi/packages/ta-changes/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-changes/lib/host.js +16 -0
- package/dist/pi/packages/ta-changes/lib/i18n.d.ts +30 -0
- package/dist/pi/packages/ta-changes/lib/i18n.js +61 -0
- package/dist/pi/packages/ta-changes/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-changes/lib/index.js +28 -0
- package/dist/pi/packages/ta-changes/lib/line-diff.d.ts +11 -0
- package/dist/pi/packages/ta-changes/lib/line-diff.js +69 -0
- package/dist/pi/packages/ta-changes/lib/page.d.ts +29 -0
- package/dist/pi/packages/ta-changes/lib/page.js +106 -0
- package/dist/pi/packages/ta-changes/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-changes/lib/react.js +8 -0
- package/dist/pi/packages/ta-changes/lib/recorder.d.ts +25 -0
- package/dist/pi/packages/ta-changes/lib/recorder.js +117 -0
- package/dist/pi/packages/ta-changes/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-changes/lib/style.js +46 -0
- package/dist/pi/packages/ta-changes/package.json +55 -0
- package/dist/pi/packages/ta-changes/web/index.js +463 -0
- 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 +45 -9
- package/dist/pi/packages/ta-channels/package.json +11 -2
- package/dist/pi/packages/ta-channels/web/index.js +996 -205
- package/dist/pi/packages/ta-computer-use/extension/index.mjs +4 -2
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.d.ts +2 -1
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.js +9 -3
- package/dist/pi/packages/ta-computer-use/package.json +11 -2
- package/dist/pi/packages/ta-cron/README.en.md +48 -0
- package/dist/pi/packages/ta-cron/README.md +48 -0
- package/dist/pi/packages/ta-cron/extension/index.mjs +856 -0
- package/dist/pi/packages/ta-cron/host/index.mjs +884 -0
- package/dist/pi/packages/ta-cron/lib/commands.d.ts +61 -0
- package/dist/pi/packages/ta-cron/lib/commands.js +250 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.d.ts +39 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.js +146 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts +160 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js +38 -0
- package/dist/pi/packages/ta-cron/lib/editor.d.ts +17 -0
- package/dist/pi/packages/ta-cron/lib/editor.js +143 -0
- package/dist/pi/packages/ta-cron/lib/extension.d.ts +27 -0
- package/dist/pi/packages/ta-cron/lib/extension.js +142 -0
- package/dist/pi/packages/ta-cron/lib/form-util.d.ts +39 -0
- package/dist/pi/packages/ta-cron/lib/form-util.js +121 -0
- package/dist/pi/packages/ta-cron/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-cron/lib/host.js +14 -0
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +88 -0
- package/dist/pi/packages/ta-cron/lib/i18n.js +173 -0
- package/dist/pi/packages/ta-cron/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-cron/lib/index.js +48 -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/notifier.d.ts +6 -0
- package/dist/pi/packages/ta-cron/lib/notifier.js +50 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +42 -0
- package/dist/pi/packages/ta-cron/lib/page.js +116 -0
- 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/react.d.ts +8 -0
- package/dist/pi/packages/ta-cron/lib/react.js +8 -0
- package/dist/pi/packages/ta-cron/lib/reply.d.ts +6 -0
- package/dist/pi/packages/ta-cron/lib/reply.js +53 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.d.ts +25 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.js +223 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.d.ts +78 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.js +329 -0
- package/dist/pi/packages/ta-cron/lib/server-texts.d.ts +7 -0
- package/dist/pi/packages/ta-cron/lib/server-texts.js +24 -0
- package/dist/pi/packages/ta-cron/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-cron/lib/style.js +123 -0
- package/dist/pi/packages/ta-cron/lib/task-store.d.ts +25 -0
- package/dist/pi/packages/ta-cron/lib/task-store.js +60 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +18 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +167 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +10 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +204 -0
- package/dist/pi/packages/ta-cron/lib/tool.d.ts +85 -0
- package/dist/pi/packages/ta-cron/lib/tool.js +127 -0
- package/dist/pi/packages/ta-cron/package.json +55 -0
- package/dist/pi/packages/ta-cron/web/index.js +1953 -0
- 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 -7
- 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 +6 -6
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +6 -6
- package/dist/pi/packages/ta-workspace/lib/browser-agent.d.ts +36 -0
- package/dist/pi/packages/ta-workspace/lib/browser-agent.js +396 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts +48 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.js +180 -0
- package/dist/pi/packages/ta-workspace/lib/browser-import.d.ts +5 -0
- package/dist/pi/packages/ta-workspace/lib/browser-import.js +97 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.d.ts +7 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.js +202 -0
- package/dist/pi/packages/ta-workspace/lib/browser.d.ts +1 -7
- package/dist/pi/packages/ta-workspace/lib/browser.js +14 -154
- 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 +121 -18
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +47 -0
- package/dist/pi/packages/ta-workspace/lib/i18n.js +106 -12
- package/dist/pi/packages/ta-workspace/lib/index.js +7 -1
- 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 +130 -56
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts +25 -3
- package/dist/pi/packages/ta-workspace/lib/terminal.js +327 -119
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.d.ts +52 -0
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.js +207 -0
- 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/upload.d.ts +34 -0
- package/dist/pi/packages/ta-workspace/lib/util/upload.js +109 -0
- package/dist/pi/packages/ta-workspace/lib/util/workspace.d.ts +19 -2
- package/dist/pi/packages/ta-workspace/lib/util/workspace.js +50 -3
- package/dist/pi/packages/ta-workspace/lib/util/zip.d.ts +20 -0
- package/dist/pi/packages/ta-workspace/lib/util/zip.js +128 -0
- package/dist/pi/packages/ta-workspace/lib/workspace-client.d.ts +12 -1
- package/dist/pi/packages/ta-workspace/lib/workspace-client.js +101 -0
- package/dist/pi/packages/ta-workspace/package.json +11 -2
- package/dist/pi/packages/ta-workspace/web/index.js +2695 -799
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-D1ZeYB9c.js → abnfDiagram-S7VZAUFO-C1tb6dM5.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-RV_x_iFj.js → architecture-WOLXFQ4H-DN1Va8BF.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-BGOmzcpZ.js → architectureDiagram-YGSQEFNW-BmK2SYtQ.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-BkoflIym.js → blockDiagram-APKKGZFW-DvLrLzTm.js} +1 -1
- package/dist/public/assets/{browser-Cl9_lr0X.js → browser-DAv3ly6M.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CfrQTIEs.js → c4Diagram-KJ2TOQU5-CrQlWwrG.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-C-VxnXsG.js → chunk-6MUBBAK2-CHKMsuY_.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-aqbxPiaN.js → chunk-AXFCVDMN-CWJ7Np6s.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-DDgvFLBP.js → chunk-BG4553SI-3v5XbQGM.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-CItpjfW5.js → chunk-DQASFODM-2CC-yiCz.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-BATYGV1I.js → chunk-HFQBQIA3-D2hzQPAy.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BVAqVjgq.js → chunk-KQLB2F66-SifAZs2r.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-Bk0_a-eE.js → chunk-KS47KZWR-BP0C0VCC.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-DsFG_U8r.js → chunk-LEVMRMFU-B1f5vw5b.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-BgeE81Y7.js → chunk-M57EVK23-B2MCJt7Y.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-2Rp6C2LJ.js → chunk-OY52VR5R-cDpZJMk4.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-BhcIp-Bl.js → chunk-QB3YPZ4I-BE0we2xc.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-i9n2AYPG.js → chunk-R3KSYZAL-D9wOfqqH.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-DOSqSu65.js → chunk-STOXU5M4-BIaVsc0K.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-BDA8bjy3.js → chunk-TU62E6Q5-BZc0OZEM.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-Cs-r9l_d.js → chunk-X4PVCEUW-Bngfwwzm.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-DEcanQFC.js → chunk-XXDRQBXY-C5FQ6XHK.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-BS8XxKRR.js → classDiagram-v2-L25IHNXF-_om54nmt.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC--RPleOJ8.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-DZHM2oEU.js → cynefinDiagram-L36ESFBY-DP5_y9Dq.js} +1 -1
- package/dist/public/assets/{d3-selection-D2iIEb1P.js → d3-selection-DFiMlEmn.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-h_G5ukMB.js → dagre-SPEB5RXH-DYwsk6gk.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-BnThWj9P.js → diagram-3B7GL73J-Dq_nT3AZ.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-DHCMo8sZ.js → diagram-DNEMPZML-ChURW6y9.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-DxJZnIKT.js → diagram-L3MUGCDN-CgVp4Rto.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-Cn0SGxqL.js → diagram-LA4NIPWU-vrqLMDby.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BafBOkBk.js → diagram-MHCOC4E2-lvfOr5ij.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-D7UnEMcU.js → diagram-XPFHEONP-oQ18TeVp.js} +1 -1
- package/dist/public/assets/{dist-CN9JBoER.js → dist-BOxxmveI.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-Us1rkKwp.js → ebnfDiagram-UZSYDL2S-C7_tlZCS.js} +1 -1
- package/dist/public/assets/{editor.api-S_CuXudU.js → editor.api-CoZ8MEuz.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-Czvqrn49.js → elk-XV6XMXQE-Dkt5-ikg.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-C0g3K15f.js → erDiagram-EYBAPDEH-27kh3zlx.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-DIcU7mQ5.js → eventmodeling-K75KTNOO-CxVEejjN.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-BRowRdve.js +1 -0
- package/dist/public/assets/{freemarker2-CkAEBjHO.js → freemarker2-D6CwPIXh.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-CIkKvihz.js → ganttDiagram-23REXITY-C-amlwpX.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BGmojXlx.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-BxM3589j.js → gitGraphDiagram-STJD7YCW-DKhzI0Xz.js} +1 -1
- package/dist/public/assets/{handlebars-CPBNiVZ2.js → handlebars-mxNr68Gm.js} +1 -1
- package/dist/public/assets/{html-CJBVALoy.js → html-Bze6s9R9.js} +1 -1
- package/dist/public/assets/{index-CBMmE3BQ.js → index-BhQUc9PU.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-CRRVgGj2.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-BIcStK_t.js → infoDiagram-KBXO4MBG-WHuWjEDO.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-CpV2hKA6.js → ishikawaDiagram-M35NCXHK-DFHUwD0J.js} +1 -1
- package/dist/public/assets/{javascript-dv6GQsa3.js → javascript-4NMPu7y1.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-B_vnmdId.js → journeyDiagram-OPLOXDXO-C7gV6zEr.js} +1 -1
- package/dist/public/assets/{jsonMode-DG_orhvz.js → jsonMode-B1JEHPMp.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-q5uWw99H.js → kanban-definition-BZKZHSQY-DlRu_d2Q.js} +1 -1
- package/dist/public/assets/{liquid-CD-LM2Kh.js → liquid-B7sIf4NX.js} +1 -1
- package/dist/public/assets/{mdx-C9mfI8up.js → mdx-CAN0qez6.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-DNe1duhT.js → mermaid-parser.core-BGmotBhf.js} +3 -3
- package/dist/public/assets/{mermaid.core-B1AcqJgl.js → mermaid.core-Cl6SS3cM.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-CwYG3Fl3.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-C0ktZo3r.js → monaco-CwCjTWAO.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-DUlqTCWQ.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-DxtA4QDS.js → pegDiagram-FD4XPPHP-XhCpv6BX.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-2RgP4ScO.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-CfcIi0Vn.js → pieDiagram-J4AKIIQI-DUVzuXUd.js} +1 -1
- package/dist/public/assets/{python-DCA1j2QE.js → python-DsoF66Sp.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-BxkJdurF.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--H3g5ywg.js → railroad-abnf-LNEFI6M7-DkrNo-Gf.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-C2LAUFu6.js → railroad-ebnf-DWYD2UWJ-DaB7gY8P.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-Kq_ZXQMl.js → railroad-peg-JR7BVNR7-D_QG87QV.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-i4xIvHJV.js → railroadDiagram-MRQ6NCDL-x-nUoBjv.js} +1 -1
- package/dist/public/assets/{razor-CEeNaFx5.js → razor-DSrcJyQe.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CYNXjuJm.js → requirementDiagram-Y7LWUY3S-kNNcbsty.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-CRQiHcW6.js → sankeyDiagram-WGJFYUXA-ClC12Odk.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-BSDVFsi2.js → sequenceDiagram-5NDRBG5M-DDQITP2g.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-uyUAaysl.js → stateDiagram-v2-FJ4FJNEA-N1t_36oh.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-DdEjQumY.js → swimlanes-UMQ2AFYF-DSt9fFYE.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-BHAN4SQO.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-DZl-TXXh.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-DrF8YGbQ.js → typescript-J7rF-zX8.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-DkG3gLrp.js → usecaseDiagram-AFA6YXN4-CK_mRc2_.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-B_lj8x7-.js → vennDiagram-NNMJR3RB-DW8xR6IJ.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-CLBqtefx.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-B1VFrC5a.js → wardleyDiagram-S7YFUSEH-Css55Zq5.js} +1 -1
- package/dist/public/assets/{xml-DfL-Brke.js → xml-CJeviG_a.js} +1 -1
- package/dist/public/assets/xterm-BrP-ENHg.css +1 -0
- package/dist/public/assets/xterm-wtHqjrNn.js +85 -0
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-CM2CpXu9.js → xychartDiagram-GGNKY7IX-BnhK9cFS.js} +1 -1
- package/dist/public/assets/{yaml-CpmxRjjF.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 +8862 -5822
- package/package.json +24 -18
- 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-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.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/ansi.d.ts +0 -72
- package/dist/pi/packages/ta-workspace/lib/util/ansi.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/ansi.js +0 -434
- package/dist/pi/packages/ta-workspace/lib/util/ansi.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/keys.d.ts +0 -14
- package/dist/pi/packages/ta-workspace/lib/util/keys.d.ts.map +0 -1
- package/dist/pi/packages/ta-workspace/lib/util/keys.js +0 -52
- package/dist/pi/packages/ta-workspace/lib/util/keys.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/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/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-CXQC7Jwi.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-D5Z_jzJ0.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-CvdLb7m6.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-BLs8wjUC.js +0 -1
- package/dist/public/assets/module-BLLqRvli.js +0 -1099
- package/dist/public/assets/module-BZPCnGxA.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-jwWITUaQ.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-CeTVZZgy.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-BGI8J8LU.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-CFkpx3Pr.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-BJsun6CT.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-CL1mG6td.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-Bk3Z1uEC.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-1E8i3qpD.js +0 -1
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScheduleUtil = exports.Duration = exports.NOTIFY_LEVELS = exports.THINKING_LEVELS = void 0;
|
|
4
|
+
const cron_expression_1 = require("./cron-expression");
|
|
5
|
+
const cron_protocol_1 = require("./cron-protocol");
|
|
6
|
+
exports.THINKING_LEVELS = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
7
|
+
exports.NOTIFY_LEVELS = ['always', 'error', 'never'];
|
|
8
|
+
const UNITS = {
|
|
9
|
+
s: 1000,
|
|
10
|
+
sec: 1000,
|
|
11
|
+
m: 60000,
|
|
12
|
+
min: 60000,
|
|
13
|
+
h: 3600000,
|
|
14
|
+
hr: 3600000,
|
|
15
|
+
d: 86400000,
|
|
16
|
+
w: 7 * 86400000,
|
|
17
|
+
};
|
|
18
|
+
/** Durations as people write them: `30m`, `1h30m`, `2d`. */
|
|
19
|
+
var Duration;
|
|
20
|
+
(function (Duration) {
|
|
21
|
+
const PART = /(\d+)\s*(sec|min|hr|s|m|h|d|w)/gy;
|
|
22
|
+
/** Milliseconds; undefined when the text is not a duration. */
|
|
23
|
+
function parse(text) {
|
|
24
|
+
const source = text.trim().toLowerCase();
|
|
25
|
+
if (!source) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
PART.lastIndex = 0;
|
|
29
|
+
let total = 0;
|
|
30
|
+
let match;
|
|
31
|
+
let end = 0;
|
|
32
|
+
// biome-ignore lint/suspicious/noAssignInExpressions: a sticky regular expression, part after part
|
|
33
|
+
while ((match = PART.exec(source))) {
|
|
34
|
+
total += Number(match[1]) * UNITS[match[2]];
|
|
35
|
+
end = PART.lastIndex;
|
|
36
|
+
}
|
|
37
|
+
return end === source.length && total > 0 ? total : undefined;
|
|
38
|
+
}
|
|
39
|
+
Duration.parse = parse;
|
|
40
|
+
/** `1h30m`. */
|
|
41
|
+
function format(ms) {
|
|
42
|
+
const parts = [];
|
|
43
|
+
let rest = Math.round(ms / 1000);
|
|
44
|
+
for (const [unit, size] of [
|
|
45
|
+
['d', 86400],
|
|
46
|
+
['h', 3600],
|
|
47
|
+
['m', 60],
|
|
48
|
+
['s', 1],
|
|
49
|
+
]) {
|
|
50
|
+
if (rest >= size) {
|
|
51
|
+
parts.push(`${Math.floor(rest / size)}${unit}`);
|
|
52
|
+
rest %= size;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return parts.join('') || '0s';
|
|
56
|
+
}
|
|
57
|
+
Duration.format = format;
|
|
58
|
+
})(Duration || (exports.Duration = Duration = {}));
|
|
59
|
+
const EN_DAYS = ['Sundays', 'Mondays', 'Tuesdays', 'Wednesdays', 'Thursdays', 'Fridays', 'Saturdays'];
|
|
60
|
+
const ZH_DAYS = ['日', '一', '二', '三', '四', '五', '六'];
|
|
61
|
+
const WORDS = {
|
|
62
|
+
en: {
|
|
63
|
+
once: time => `Once, ${time}`,
|
|
64
|
+
every: (amount, unit) => (amount === 1 ? `Every ${unit}` : `Every ${amount} ${unit}s`),
|
|
65
|
+
everyRaw: duration => `Every ${duration}`,
|
|
66
|
+
daily: time => `Daily at ${time}`,
|
|
67
|
+
weekdays: time => `Weekdays at ${time}`,
|
|
68
|
+
weekly: (day, time) => `${EN_DAYS[day]} at ${time}`,
|
|
69
|
+
monthly: (day, time) => `Monthly on day ${day} at ${time}`,
|
|
70
|
+
hourly: minute => (minute === 0 ? 'Hourly' : `Hourly at :${pad(minute)}`),
|
|
71
|
+
cron: expression => `Cron ${expression}`,
|
|
72
|
+
},
|
|
73
|
+
zh: {
|
|
74
|
+
once: time => `${time} 运行一次`,
|
|
75
|
+
every: (amount, unit) => `每 ${amount === 1 ? '' : `${amount} `}${{ minute: '分钟', hour: '小时', day: '天' }[unit]}`.replace('每 天', '每天'),
|
|
76
|
+
everyRaw: duration => `每 ${duration}`,
|
|
77
|
+
daily: time => `每天 ${time}`,
|
|
78
|
+
weekdays: time => `工作日 ${time}`,
|
|
79
|
+
weekly: (day, time) => `每周${ZH_DAYS[day]} ${time}`,
|
|
80
|
+
monthly: (day, time) => `每月 ${day} 日 ${time}`,
|
|
81
|
+
hourly: minute => (minute === 0 ? '每小时' : `每小时第 ${minute} 分`),
|
|
82
|
+
cron: expression => `cron ${expression}`,
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
function pad(value) {
|
|
86
|
+
return String(value).padStart(2, '0');
|
|
87
|
+
}
|
|
88
|
+
var ScheduleUtil;
|
|
89
|
+
(function (ScheduleUtil) {
|
|
90
|
+
/** A rule as a tool or a page sends it, checked; a time of `once` becomes ISO. Throws with what is wrong. */
|
|
91
|
+
function check(value) {
|
|
92
|
+
var _a;
|
|
93
|
+
const schedule = (value !== null && value !== void 0 ? value : {});
|
|
94
|
+
switch (schedule.kind) {
|
|
95
|
+
case 'once': {
|
|
96
|
+
const at = new Date(String((_a = schedule.at) !== null && _a !== void 0 ? _a : ''));
|
|
97
|
+
if (typeof schedule.at !== 'string' || Number.isNaN(at.getTime())) {
|
|
98
|
+
throw new Error('A task that runs once needs `at`, a time such as 2026-11-12T09:00 (local time) or an ISO time.');
|
|
99
|
+
}
|
|
100
|
+
return { kind: 'once', at: at.toISOString() };
|
|
101
|
+
}
|
|
102
|
+
case 'interval': {
|
|
103
|
+
const every = typeof schedule.every === 'string' ? schedule.every.trim() : '';
|
|
104
|
+
const ms = Duration.parse(every);
|
|
105
|
+
if (ms === undefined) {
|
|
106
|
+
throw new Error('An interval needs `every`, a duration such as 30m, 2h or 1d.');
|
|
107
|
+
}
|
|
108
|
+
if (ms < cron_protocol_1.Limits.MIN_INTERVAL_MS) {
|
|
109
|
+
throw new Error(`An interval is at least 1m; ${every} is shorter.`);
|
|
110
|
+
}
|
|
111
|
+
return { kind: 'interval', every: Duration.format(ms) };
|
|
112
|
+
}
|
|
113
|
+
case 'cron': {
|
|
114
|
+
const expression = typeof schedule.expression === 'string' ? schedule.expression : '';
|
|
115
|
+
return { kind: 'cron', expression: cron_expression_1.CronExpression.parse(expression).source };
|
|
116
|
+
}
|
|
117
|
+
default:
|
|
118
|
+
throw new Error('A schedule is { kind: "once", at }, { kind: "interval", every } or { kind: "cron", expression }.');
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
ScheduleUtil.check = check;
|
|
122
|
+
/** The next time after `now`; undefined when there is none (a time that passed, a rule that never matches). */
|
|
123
|
+
function next(schedule, now) {
|
|
124
|
+
var _a;
|
|
125
|
+
switch (schedule.kind) {
|
|
126
|
+
case 'once': {
|
|
127
|
+
const at = new Date(schedule.at);
|
|
128
|
+
return at.getTime() > now.getTime() ? at : undefined;
|
|
129
|
+
}
|
|
130
|
+
case 'interval':
|
|
131
|
+
return new Date(now.getTime() + ((_a = Duration.parse(schedule.every)) !== null && _a !== void 0 ? _a : cron_protocol_1.Limits.MIN_INTERVAL_MS));
|
|
132
|
+
case 'cron':
|
|
133
|
+
return cron_expression_1.CronExpression.parse(schedule.expression).next(now);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
ScheduleUtil.next = next;
|
|
137
|
+
function repeats(schedule) {
|
|
138
|
+
return schedule.kind !== 'once';
|
|
139
|
+
}
|
|
140
|
+
ScheduleUtil.repeats = repeats;
|
|
141
|
+
/** What the task's notify level is, with its default. */
|
|
142
|
+
function notifyLevel(task) {
|
|
143
|
+
var _a;
|
|
144
|
+
return (_a = task.notify) !== null && _a !== void 0 ? _a : (repeats(task.schedule) ? 'error' : 'always');
|
|
145
|
+
}
|
|
146
|
+
ScheduleUtil.notifyLevel = notifyLevel;
|
|
147
|
+
function shouldNotify(level, failed) {
|
|
148
|
+
return level === 'always' || (level === 'error' && failed);
|
|
149
|
+
}
|
|
150
|
+
ScheduleUtil.shouldNotify = shouldNotify;
|
|
151
|
+
/** `11/12 09:00` in local time; the year too when it is not this one. */
|
|
152
|
+
function clock(time, now = new Date()) {
|
|
153
|
+
const day = `${time.getMonth() + 1}/${time.getDate()}`;
|
|
154
|
+
const year = time.getFullYear() === now.getFullYear() ? '' : `${time.getFullYear()}/`;
|
|
155
|
+
return `${year}${day} ${pad(time.getHours())}:${pad(time.getMinutes())}`;
|
|
156
|
+
}
|
|
157
|
+
ScheduleUtil.clock = clock;
|
|
158
|
+
/** The rule in words: `Daily at 09:00`, `每 30 分钟`. */
|
|
159
|
+
function describe(schedule, language, now = new Date()) {
|
|
160
|
+
const words = WORDS[language.startsWith('zh') ? 'zh' : 'en'];
|
|
161
|
+
switch (schedule.kind) {
|
|
162
|
+
case 'once':
|
|
163
|
+
return words.once(clock(new Date(schedule.at), now));
|
|
164
|
+
case 'interval':
|
|
165
|
+
return describeInterval(schedule.every, words);
|
|
166
|
+
case 'cron':
|
|
167
|
+
return describeCron(schedule.expression, words);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
ScheduleUtil.describe = describe;
|
|
171
|
+
function describeInterval(every, words) {
|
|
172
|
+
var _a;
|
|
173
|
+
const ms = (_a = Duration.parse(every)) !== null && _a !== void 0 ? _a : 0;
|
|
174
|
+
for (const [unit, size] of [
|
|
175
|
+
['day', 86400000],
|
|
176
|
+
['hour', 3600000],
|
|
177
|
+
['minute', 60000],
|
|
178
|
+
]) {
|
|
179
|
+
if (ms >= size && ms % size === 0) {
|
|
180
|
+
return words.every(ms / size, unit);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
return words.everyRaw(every);
|
|
184
|
+
}
|
|
185
|
+
function describeCron(expression, words) {
|
|
186
|
+
var _a;
|
|
187
|
+
const fields = ((_a = cron_expression_1.NICKNAMES[expression.toLowerCase()]) !== null && _a !== void 0 ? _a : expression).split(' ');
|
|
188
|
+
const [minute, hour, day, month, weekday] = fields;
|
|
189
|
+
const number = (text) => (/^\d+$/.test(text) ? Number(text) : undefined);
|
|
190
|
+
const m = number(minute);
|
|
191
|
+
const h = number(hour);
|
|
192
|
+
const time = m !== undefined && h !== undefined ? `${pad(h)}:${pad(m)}` : undefined;
|
|
193
|
+
if (month === '*') {
|
|
194
|
+
if (time && day === '*' && weekday === '*') {
|
|
195
|
+
return words.daily(time);
|
|
196
|
+
}
|
|
197
|
+
if (time && day === '*' && weekday === '1-5') {
|
|
198
|
+
return words.weekdays(time);
|
|
199
|
+
}
|
|
200
|
+
const d = number(weekday);
|
|
201
|
+
if (time && day === '*' && d !== undefined && d <= 7) {
|
|
202
|
+
return words.weekly(d % 7, time);
|
|
203
|
+
}
|
|
204
|
+
const date = number(day);
|
|
205
|
+
if (time && date !== undefined && weekday === '*') {
|
|
206
|
+
return words.monthly(date, time);
|
|
207
|
+
}
|
|
208
|
+
if (m !== undefined && hour === '*' && day === '*' && weekday === '*') {
|
|
209
|
+
return words.hourly(m);
|
|
210
|
+
}
|
|
211
|
+
const everyMinutes = /^\*\/(\d+)$/.exec(minute);
|
|
212
|
+
if (everyMinutes && hour === '*' && day === '*' && weekday === '*') {
|
|
213
|
+
return words.every(Number(everyMinutes[1]), 'minute');
|
|
214
|
+
}
|
|
215
|
+
const everyHours = /^\*\/(\d+)$/.exec(hour);
|
|
216
|
+
if (m === 0 && everyHours && day === '*' && weekday === '*') {
|
|
217
|
+
return words.every(Number(everyHours[1]), 'hour');
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return words.cron(expression);
|
|
221
|
+
}
|
|
222
|
+
})(ScheduleUtil || (exports.ScheduleUtil = ScheduleUtil = {}));
|
|
223
|
+
//# sourceMappingURL=schedule-util.js.map
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { TaExtensionHost, TaPackageService } from '@celljs/ta-protocol';
|
|
2
|
+
import { type CronService, type Run, type Task, type TaskInput, type TaskPatch } from './cron-protocol';
|
|
3
|
+
import { TaskStore } from './task-store';
|
|
4
|
+
/** What the scheduler needs of the Ta service: its sessions and the data of this package. */
|
|
5
|
+
export type CronHost = Pick<TaExtensionHost, 'getServerInfo' | 'listSessions' | 'openSession' | 'closeSession' | 'setSessionName' | 'prompt' | 'abort' | 'getState' | 'getLastAssistantText' | 'getExtensionData' | 'setExtensionData'>;
|
|
6
|
+
export interface SchedulerOptions {
|
|
7
|
+
now(): Date;
|
|
8
|
+
/** The longest the timer sleeps: it looks again at least this often, so a changed clock or a sleeping machine is caught up. */
|
|
9
|
+
tickMs: number;
|
|
10
|
+
/** How often a run is looked at while it works. */
|
|
11
|
+
pollMs: number;
|
|
12
|
+
timeoutMs: number;
|
|
13
|
+
parallel: number;
|
|
14
|
+
}
|
|
15
|
+
/** A run that has started or waits for a slot. */
|
|
16
|
+
interface Active {
|
|
17
|
+
run: Run;
|
|
18
|
+
task: Task;
|
|
19
|
+
sessionId?: string;
|
|
20
|
+
/** The task went while it ran: its end is not recorded. */
|
|
21
|
+
dropped?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The tasks, in the Ta service: one timer to the next time a task is due (at most a minute), and each run
|
|
25
|
+
* in a conversation of its own (the package's group, closed once it ended and nobody looks at it). A due
|
|
26
|
+
* task whose run has not ended is not run again: its next time comes instead. When the service starts,
|
|
27
|
+
* runs it left unfinished fail, a repeating task that was due while it was not running runs once (the
|
|
28
|
+
* missed times collapse into one), and a task that runs once and is more than five minutes late is missed.
|
|
29
|
+
*/
|
|
30
|
+
export declare class CronScheduler implements CronService, TaPackageService {
|
|
31
|
+
protected readonly host: CronHost;
|
|
32
|
+
protected tasks: Task[];
|
|
33
|
+
protected readonly store: TaskStore;
|
|
34
|
+
protected readonly options: SchedulerOptions;
|
|
35
|
+
protected readonly active: Map<string, Active>;
|
|
36
|
+
protected readonly waiting: Active[];
|
|
37
|
+
protected working: number;
|
|
38
|
+
/** Conversations of runs that ended while someone looked at them: closed once nobody does. */
|
|
39
|
+
protected readonly lingering: Set<string>;
|
|
40
|
+
protected timer?: ReturnType<typeof setTimeout>;
|
|
41
|
+
/** A tick is at work: the timer is armed when it ends, not by the saves it makes. */
|
|
42
|
+
protected ticking: boolean;
|
|
43
|
+
protected disposed: boolean;
|
|
44
|
+
constructor(host: CronHost, options?: Partial<SchedulerOptions>);
|
|
45
|
+
start(): Promise<void>;
|
|
46
|
+
dispose(): Promise<void>;
|
|
47
|
+
list(): Promise<Task[]>;
|
|
48
|
+
get(ref: string): Promise<Task>;
|
|
49
|
+
runs(ref: string, limit?: number): Promise<Run[]>;
|
|
50
|
+
add(input: TaskInput): Promise<Task>;
|
|
51
|
+
update(ref: string, patch: TaskPatch): Promise<Task>;
|
|
52
|
+
setEnabled(ref: string, enabled: boolean): Promise<Task>;
|
|
53
|
+
remove(ref: string): Promise<Task>;
|
|
54
|
+
clear(cwd?: string): Promise<Task[]>;
|
|
55
|
+
run(ref: string): Promise<Run>;
|
|
56
|
+
/** Whether the conversation is that of a run (by the id of its open session). */
|
|
57
|
+
isRun(sessionId: string): boolean;
|
|
58
|
+
protected arm(): void;
|
|
59
|
+
protected tick(): Promise<void>;
|
|
60
|
+
/** The task after a run started at `now` by its schedule: its next time, or done for one that runs once. */
|
|
61
|
+
protected advance(task: Task, now: Date): Task;
|
|
62
|
+
protected begin(task: Task, trigger: Run['trigger'], now: Date): Promise<Run>;
|
|
63
|
+
protected pump(): void;
|
|
64
|
+
protected execute(active: Active): Promise<void>;
|
|
65
|
+
protected settled(active: Active, before: number): Promise<void>;
|
|
66
|
+
protected finish(active: Active, end: Pick<Run, 'status' | 'summary' | 'error' | 'reason'>): Promise<void>;
|
|
67
|
+
/** Closes the conversations of runs that ended, unless someone looks at one: then the next time. */
|
|
68
|
+
protected sweep(): Promise<void>;
|
|
69
|
+
/** A run the service left unfinished when it stopped. */
|
|
70
|
+
protected reclaim(task: Task, now: Date): Promise<void>;
|
|
71
|
+
/** A task that runs once, whose time passed while the service was not running. */
|
|
72
|
+
protected miss(task: Task, now: Date): Promise<void>;
|
|
73
|
+
protected drop(tasks: Task[]): Promise<void>;
|
|
74
|
+
protected replace(task: Task): Promise<void>;
|
|
75
|
+
protected save(tasks: Task[]): Promise<void>;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
78
|
+
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CronScheduler = void 0;
|
|
4
|
+
const cron_protocol_1 = require("./cron-protocol");
|
|
5
|
+
const schedule_util_1 = require("./schedule-util");
|
|
6
|
+
const task_store_1 = require("./task-store");
|
|
7
|
+
const task_util_1 = require("./task-util");
|
|
8
|
+
/**
|
|
9
|
+
* The tasks, in the Ta service: one timer to the next time a task is due (at most a minute), and each run
|
|
10
|
+
* in a conversation of its own (the package's group, closed once it ended and nobody looks at it). A due
|
|
11
|
+
* task whose run has not ended is not run again: its next time comes instead. When the service starts,
|
|
12
|
+
* runs it left unfinished fail, a repeating task that was due while it was not running runs once (the
|
|
13
|
+
* missed times collapse into one), and a task that runs once and is more than five minutes late is missed.
|
|
14
|
+
*/
|
|
15
|
+
class CronScheduler {
|
|
16
|
+
constructor(host, options = {}) {
|
|
17
|
+
this.host = host;
|
|
18
|
+
this.tasks = [];
|
|
19
|
+
this.active = new Map();
|
|
20
|
+
this.waiting = [];
|
|
21
|
+
this.working = 0;
|
|
22
|
+
/** Conversations of runs that ended while someone looked at them: closed once nobody does. */
|
|
23
|
+
this.lingering = new Set();
|
|
24
|
+
/** A tick is at work: the timer is armed when it ends, not by the saves it makes. */
|
|
25
|
+
this.ticking = false;
|
|
26
|
+
this.disposed = false;
|
|
27
|
+
this.store = new task_store_1.TaskStore(host);
|
|
28
|
+
this.options = { now: () => new Date(), tickMs: 60000, pollMs: 1000, timeoutMs: cron_protocol_1.Limits.RUN_TIMEOUT_MS, parallel: cron_protocol_1.Limits.PARALLEL_RUNS, ...options };
|
|
29
|
+
}
|
|
30
|
+
async start() {
|
|
31
|
+
this.tasks = await this.store.tasks();
|
|
32
|
+
const now = this.options.now();
|
|
33
|
+
for (const task of this.tasks) {
|
|
34
|
+
if (task.lastStatus === 'running') {
|
|
35
|
+
await this.reclaim(task, now);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
for (const task of [...this.tasks]) {
|
|
39
|
+
if (task.enabled && task_util_1.TaskUtil.missed(task, now)) {
|
|
40
|
+
await this.miss(task, now);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
await this.store.saveTasks(this.tasks);
|
|
44
|
+
this.arm();
|
|
45
|
+
}
|
|
46
|
+
async dispose() {
|
|
47
|
+
this.disposed = true;
|
|
48
|
+
clearTimeout(this.timer);
|
|
49
|
+
await this.store.flush();
|
|
50
|
+
}
|
|
51
|
+
async list() {
|
|
52
|
+
return this.tasks.map(task => ({ ...task }));
|
|
53
|
+
}
|
|
54
|
+
async get(ref) {
|
|
55
|
+
return { ...task_util_1.TaskUtil.find(this.tasks, ref) };
|
|
56
|
+
}
|
|
57
|
+
async runs(ref, limit = cron_protocol_1.Limits.RUNS_KEPT) {
|
|
58
|
+
const task = task_util_1.TaskUtil.find(this.tasks, ref);
|
|
59
|
+
return (await this.store.runs(task.id)).slice(0, Math.max(1, limit));
|
|
60
|
+
}
|
|
61
|
+
async add(input) {
|
|
62
|
+
const cwd = (await this.host.getServerInfo()).cwd;
|
|
63
|
+
const task = task_util_1.TaskUtil.create(input, cwd, this.options.now());
|
|
64
|
+
await this.save([...this.tasks, task]);
|
|
65
|
+
return { ...task };
|
|
66
|
+
}
|
|
67
|
+
async update(ref, patch) {
|
|
68
|
+
const task = task_util_1.TaskUtil.find(this.tasks, ref);
|
|
69
|
+
const next = task_util_1.TaskUtil.patch(task, patch !== null && patch !== void 0 ? patch : {}, this.options.now());
|
|
70
|
+
await this.replace(next);
|
|
71
|
+
return { ...next };
|
|
72
|
+
}
|
|
73
|
+
setEnabled(ref, enabled) {
|
|
74
|
+
return this.update(ref, { enabled: enabled === true });
|
|
75
|
+
}
|
|
76
|
+
async remove(ref) {
|
|
77
|
+
const task = task_util_1.TaskUtil.find(this.tasks, ref);
|
|
78
|
+
await this.drop([task]);
|
|
79
|
+
return task;
|
|
80
|
+
}
|
|
81
|
+
async clear(cwd) {
|
|
82
|
+
const gone = this.tasks.filter(task => !cwd || task.cwd === cwd);
|
|
83
|
+
await this.drop(gone);
|
|
84
|
+
return gone;
|
|
85
|
+
}
|
|
86
|
+
async run(ref) {
|
|
87
|
+
const task = task_util_1.TaskUtil.find(this.tasks, ref);
|
|
88
|
+
if (this.active.has(task.id)) {
|
|
89
|
+
throw new Error(`${task.name} is running now; wait for its run to end.`);
|
|
90
|
+
}
|
|
91
|
+
return this.begin(task, 'manual', this.options.now());
|
|
92
|
+
}
|
|
93
|
+
/** Whether the conversation is that of a run (by the id of its open session). */
|
|
94
|
+
isRun(sessionId) {
|
|
95
|
+
return [...this.active.values()].some(active => active.sessionId === sessionId);
|
|
96
|
+
}
|
|
97
|
+
arm() {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
clearTimeout(this.timer);
|
|
100
|
+
if (this.disposed || this.ticking) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const now = this.options.now().getTime();
|
|
104
|
+
let delay = this.options.tickMs;
|
|
105
|
+
for (const task of this.tasks) {
|
|
106
|
+
if (task.enabled && task.nextRunAt) {
|
|
107
|
+
delay = Math.min(delay, Math.max(0, new Date(task.nextRunAt).getTime() - now));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
this.timer = setTimeout(() => void this.tick().catch(error => console.error(`${cron_protocol_1.NAME}: ${message(error)}`)), delay);
|
|
111
|
+
(_b = (_a = this.timer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
112
|
+
}
|
|
113
|
+
async tick() {
|
|
114
|
+
if (this.disposed) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
this.ticking = true;
|
|
118
|
+
try {
|
|
119
|
+
const now = this.options.now();
|
|
120
|
+
for (const { id } of [...this.tasks]) {
|
|
121
|
+
// As it is now: an earlier await may have changed or removed it.
|
|
122
|
+
const task = this.tasks.find(other => other.id === id);
|
|
123
|
+
if (!(task === null || task === void 0 ? void 0 : task.enabled) || !task.nextRunAt || new Date(task.nextRunAt).getTime() > now.getTime()) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (this.active.has(task.id)) {
|
|
127
|
+
// Still at work: the time that came is let go.
|
|
128
|
+
await this.replace(this.advance(task, now));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
await this.begin(task, 'schedule', now);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
await this.sweep();
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
this.ticking = false;
|
|
138
|
+
this.arm();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** The task after a run started at `now` by its schedule: its next time, or done for one that runs once. */
|
|
142
|
+
advance(task, now) {
|
|
143
|
+
if (!schedule_util_1.ScheduleUtil.repeats(task.schedule)) {
|
|
144
|
+
const { nextRunAt: _done, ...rest } = task;
|
|
145
|
+
return { ...rest, enabled: false };
|
|
146
|
+
}
|
|
147
|
+
const next = schedule_util_1.ScheduleUtil.next(task.schedule, now);
|
|
148
|
+
return { ...task, nextRunAt: next === null || next === void 0 ? void 0 : next.toISOString() };
|
|
149
|
+
}
|
|
150
|
+
async begin(task, trigger, now) {
|
|
151
|
+
const run = { id: task_util_1.TaskUtil.newId('run'), taskId: task.id, trigger, status: 'running', startedAt: now.toISOString(), cwd: task.cwd };
|
|
152
|
+
const started = trigger === 'schedule' ? this.advance(task, now) : task;
|
|
153
|
+
await this.replace({ ...started, lastRunAt: run.startedAt, lastStatus: 'running' });
|
|
154
|
+
await this.store.saveRun(run);
|
|
155
|
+
const active = { run, task: { ...task } };
|
|
156
|
+
this.active.set(task.id, active);
|
|
157
|
+
this.waiting.push(active);
|
|
158
|
+
this.pump();
|
|
159
|
+
return { ...run };
|
|
160
|
+
}
|
|
161
|
+
pump() {
|
|
162
|
+
while (this.working < this.options.parallel && this.waiting.length > 0 && !this.disposed) {
|
|
163
|
+
const active = this.waiting.shift();
|
|
164
|
+
this.working++;
|
|
165
|
+
void this.execute(active)
|
|
166
|
+
.catch(error => console.error(`${cron_protocol_1.NAME}: ${message(error)}`))
|
|
167
|
+
.finally(() => {
|
|
168
|
+
this.working--;
|
|
169
|
+
this.pump();
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
async execute(active) {
|
|
174
|
+
const { task, run } = active;
|
|
175
|
+
if (active.dropped) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
try {
|
|
179
|
+
const now = this.options.now();
|
|
180
|
+
const { sessionId } = await this.host.openSession({
|
|
181
|
+
cwd: task.cwd,
|
|
182
|
+
group: cron_protocol_1.NAME,
|
|
183
|
+
appendSystemPrompt: task_util_1.TaskUtil.systemPrompt(task, now),
|
|
184
|
+
...(task.model ? { model: task.model } : {}),
|
|
185
|
+
...(task.thinking ? { thinkingLevel: task.thinking } : {}),
|
|
186
|
+
});
|
|
187
|
+
active.sessionId = sessionId;
|
|
188
|
+
await this.host.setSessionName(sessionId, `${task.name} · ${schedule_util_1.ScheduleUtil.clock(now)}`).catch(() => undefined);
|
|
189
|
+
const state = await this.host.getState(sessionId);
|
|
190
|
+
run.sessionFile = state.sessionFile;
|
|
191
|
+
await this.store.saveRun(run);
|
|
192
|
+
await this.host.prompt(sessionId, { clientMessageId: run.id, message: task.prompt });
|
|
193
|
+
await this.settled(active, state.messageCount);
|
|
194
|
+
const { text } = await this.host.getLastAssistantText(sessionId);
|
|
195
|
+
if (!(text === null || text === void 0 ? void 0 : text.trim())) {
|
|
196
|
+
throw new Error('The run ended without an answer; the model may have failed. Open its conversation to see.');
|
|
197
|
+
}
|
|
198
|
+
await this.finish(active, { status: 'success', summary: clip(text.trim()) });
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
await this.finish(active, { status: 'error', error: message(error), ...(error instanceof TimeoutError ? { reason: 'timeout' } : {}) });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
async settled(active, before) {
|
|
205
|
+
const sessionId = active.sessionId;
|
|
206
|
+
const start = Date.now();
|
|
207
|
+
for (;;) {
|
|
208
|
+
if (active.dropped || this.disposed) {
|
|
209
|
+
throw new Error('The task was removed while it ran.');
|
|
210
|
+
}
|
|
211
|
+
const state = await this.host.getState(sessionId);
|
|
212
|
+
if (!state.isStreaming && state.pendingMessageCount === 0 && state.messageCount > before) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (Date.now() - start > this.options.timeoutMs) {
|
|
216
|
+
await this.host.abort(sessionId).catch(() => undefined);
|
|
217
|
+
throw new TimeoutError(`The run took longer than ${Math.round(this.options.timeoutMs / 60000)} minutes and was stopped.`);
|
|
218
|
+
}
|
|
219
|
+
await new Promise(resolve => setTimeout(resolve, this.options.pollMs));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async finish(active, end) {
|
|
223
|
+
this.active.delete(active.task.id);
|
|
224
|
+
const sessionId = active.sessionId;
|
|
225
|
+
if (sessionId) {
|
|
226
|
+
this.lingering.add(sessionId);
|
|
227
|
+
}
|
|
228
|
+
if (active.dropped || this.disposed) {
|
|
229
|
+
await this.sweep();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const run = { ...active.run, ...end, endedAt: this.options.now().toISOString() };
|
|
233
|
+
await this.store.saveRun(run);
|
|
234
|
+
const current = this.tasks.find(task => task.id === active.task.id);
|
|
235
|
+
if (current) {
|
|
236
|
+
const failed = run.status === 'error';
|
|
237
|
+
await this.replace({
|
|
238
|
+
...current,
|
|
239
|
+
lastStatus: run.status,
|
|
240
|
+
runCount: current.runCount + 1,
|
|
241
|
+
failCount: current.failCount + (failed ? 1 : 0),
|
|
242
|
+
});
|
|
243
|
+
await this.store.finished({ run, taskName: current.name, notify: schedule_util_1.ScheduleUtil.shouldNotify(schedule_util_1.ScheduleUtil.notifyLevel(current), failed) });
|
|
244
|
+
}
|
|
245
|
+
await this.sweep();
|
|
246
|
+
}
|
|
247
|
+
/** Closes the conversations of runs that ended, unless someone looks at one: then the next time. */
|
|
248
|
+
async sweep() {
|
|
249
|
+
if (this.lingering.size === 0) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const open = new Map((await this.host.listSessions()).map(info => [info.sessionId, info]));
|
|
253
|
+
for (const sessionId of [...this.lingering]) {
|
|
254
|
+
const info = open.get(sessionId);
|
|
255
|
+
if (!info) {
|
|
256
|
+
this.lingering.delete(sessionId);
|
|
257
|
+
}
|
|
258
|
+
else if (info.attached === 0 && !info.isStreaming) {
|
|
259
|
+
this.lingering.delete(sessionId);
|
|
260
|
+
await this.host.closeSession(sessionId).catch(() => undefined);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
/** A run the service left unfinished when it stopped. */
|
|
265
|
+
async reclaim(task, now) {
|
|
266
|
+
for (const run of await this.store.runs(task.id)) {
|
|
267
|
+
if (run.status === 'running') {
|
|
268
|
+
await this.store.saveRun({
|
|
269
|
+
...run,
|
|
270
|
+
status: 'error',
|
|
271
|
+
reason: 'interrupted',
|
|
272
|
+
error: 'The Ta service stopped before the run ended.',
|
|
273
|
+
endedAt: now.toISOString(),
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
this.tasks = this.tasks.map(other => (other.id === task.id ? { ...other, lastStatus: 'error', failCount: other.failCount + 1 } : other));
|
|
278
|
+
}
|
|
279
|
+
/** A task that runs once, whose time passed while the service was not running. */
|
|
280
|
+
async miss(task, now) {
|
|
281
|
+
var _a;
|
|
282
|
+
const run = {
|
|
283
|
+
id: task_util_1.TaskUtil.newId('run'),
|
|
284
|
+
taskId: task.id,
|
|
285
|
+
trigger: 'schedule',
|
|
286
|
+
status: 'missed',
|
|
287
|
+
startedAt: (_a = task.nextRunAt) !== null && _a !== void 0 ? _a : now.toISOString(),
|
|
288
|
+
endedAt: now.toISOString(),
|
|
289
|
+
error: 'The Ta service was not running at its time; run it by hand if it is still wanted.',
|
|
290
|
+
cwd: task.cwd,
|
|
291
|
+
};
|
|
292
|
+
await this.store.saveRun(run);
|
|
293
|
+
const { nextRunAt: _gone, ...rest } = task;
|
|
294
|
+
this.tasks = this.tasks.map(other => (other.id === task.id ? { ...rest, enabled: false, lastStatus: 'missed', lastRunAt: run.startedAt } : other));
|
|
295
|
+
await this.store.finished({ run, taskName: task.name, notify: schedule_util_1.ScheduleUtil.notifyLevel(task) !== 'never' });
|
|
296
|
+
}
|
|
297
|
+
async drop(tasks) {
|
|
298
|
+
const ids = new Set(tasks.map(task => task.id));
|
|
299
|
+
for (const id of ids) {
|
|
300
|
+
const active = this.active.get(id);
|
|
301
|
+
if (active) {
|
|
302
|
+
active.dropped = true;
|
|
303
|
+
if (active.sessionId) {
|
|
304
|
+
await this.host.abort(active.sessionId).catch(() => undefined);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
await this.store.removeRuns(id);
|
|
308
|
+
}
|
|
309
|
+
await this.save(this.tasks.filter(task => !ids.has(task.id)));
|
|
310
|
+
}
|
|
311
|
+
replace(task) {
|
|
312
|
+
return this.save(this.tasks.map(other => (other.id === task.id ? task : other)));
|
|
313
|
+
}
|
|
314
|
+
async save(tasks) {
|
|
315
|
+
this.tasks = tasks;
|
|
316
|
+
await this.store.saveTasks(tasks);
|
|
317
|
+
this.arm();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
exports.CronScheduler = CronScheduler;
|
|
321
|
+
class TimeoutError extends Error {
|
|
322
|
+
}
|
|
323
|
+
function clip(text) {
|
|
324
|
+
return text.length > cron_protocol_1.Limits.SUMMARY_MAX ? `${text.slice(0, cron_protocol_1.Limits.SUMMARY_MAX - 1)}…` : text;
|
|
325
|
+
}
|
|
326
|
+
function message(error) {
|
|
327
|
+
return error instanceof Error ? error.message : String(error);
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=scheduler.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** What the pi extension of ta-cron asks the user, in the language of Ta's pages (`TA_LANGUAGE`) or the computer's. */
|
|
2
|
+
export declare namespace CronServerTexts {
|
|
3
|
+
function zh(env?: NodeJS.ProcessEnv): boolean;
|
|
4
|
+
function removeTask(name: string): [string, string];
|
|
5
|
+
function removeTasks(count: number): [string, string];
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=server-texts.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CronServerTexts = void 0;
|
|
4
|
+
/** What the pi extension of ta-cron asks the user, in the language of Ta's pages (`TA_LANGUAGE`) or the computer's. */
|
|
5
|
+
var CronServerTexts;
|
|
6
|
+
(function (CronServerTexts) {
|
|
7
|
+
function zh(env = process.env) {
|
|
8
|
+
return /^zh/i.test(env.TA_LANGUAGE || env.LC_ALL || env.LC_MESSAGES || env.LANG || '');
|
|
9
|
+
}
|
|
10
|
+
CronServerTexts.zh = zh;
|
|
11
|
+
function removeTask(name) {
|
|
12
|
+
return zh()
|
|
13
|
+
? ['删除这个任务?', `${name} 和它的运行记录会被删除,运行产生的对话会保留。`]
|
|
14
|
+
: ['Delete the scheduled task?', `${name} and its runs go; their conversations stay.`];
|
|
15
|
+
}
|
|
16
|
+
CronServerTexts.removeTask = removeTask;
|
|
17
|
+
function removeTasks(count) {
|
|
18
|
+
return zh()
|
|
19
|
+
? ['删除这个目录的所有定时任务?', `${count} 个任务和它们的运行记录会被删除。`]
|
|
20
|
+
: ['Delete the scheduled tasks of this directory?', `${count} tasks and their runs go.`];
|
|
21
|
+
}
|
|
22
|
+
CronServerTexts.removeTasks = removeTasks;
|
|
23
|
+
})(CronServerTexts || (exports.CronServerTexts = CronServerTexts = {}));
|
|
24
|
+
//# sourceMappingURL=server-texts.js.map
|