@celljs/ta 4.6.1 → 4.8.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 +112 -0
- package/README.md +15 -2
- package/dist/cli.mjs +168 -110
- package/dist/pi/CHANGELOG.md +36 -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 +1746 -0
- package/dist/pi/packages/ta-agents/fixtures/fake-acp-agent.mjs +183 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.d.ts +52 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.js +218 -0
- package/dist/pi/packages/ta-agents/lib/acp-agent.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +153 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +45 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +45 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +135 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +50 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js +143 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +18 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +86 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +71 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.js +215 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.d.ts +41 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +163 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts +22 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +88 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +115 -0
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +343 -0
- package/dist/pi/packages/ta-agents/lib/agent-turn.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/extension.d.ts +26 -0
- package/dist/pi/packages/ta-agents/lib/extension.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/extension.js +247 -0
- package/dist/pi/packages/ta-agents/lib/extension.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/json-rpc.d.ts +41 -0
- package/dist/pi/packages/ta-agents/lib/json-rpc.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/json-rpc.js +145 -0
- package/dist/pi/packages/ta-agents/lib/json-rpc.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/message-stream.d.ts +31 -0
- package/dist/pi/packages/ta-agents/lib/message-stream.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/message-stream.js +134 -0
- package/dist/pi/packages/ta-agents/lib/message-stream.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/pi-types.d.ts +20 -0
- package/dist/pi/packages/ta-agents/lib/pi-types.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/pi-types.js +3 -0
- package/dist/pi/packages/ta-agents/lib/pi-types.js.map +1 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +36 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts.map +1 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +43 -0
- package/dist/pi/packages/ta-agents/lib/texts.js.map +1 -0
- package/dist/pi/packages/ta-agents/package.json +53 -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.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/blob-store.js +69 -0
- package/dist/pi/packages/ta-changes/lib/blob-store.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/card.d.ts +12 -0
- package/dist/pi/packages/ta-changes/lib/card.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/card.js +149 -0
- package/dist/pi/packages/ta-changes/lib/card.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/changes-protocol.d.ts +76 -0
- package/dist/pi/packages/ta-changes/lib/changes-protocol.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/changes-protocol.js +20 -0
- package/dist/pi/packages/ta-changes/lib/changes-protocol.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/changes-service.d.ts +20 -0
- package/dist/pi/packages/ta-changes/lib/changes-service.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/changes-service.js +70 -0
- package/dist/pi/packages/ta-changes/lib/changes-service.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/changes-util.d.ts +21 -0
- package/dist/pi/packages/ta-changes/lib/changes-util.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/changes-util.js +44 -0
- package/dist/pi/packages/ta-changes/lib/changes-util.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/diff-tab.d.ts +4 -0
- package/dist/pi/packages/ta-changes/lib/diff-tab.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/diff-tab.js +45 -0
- package/dist/pi/packages/ta-changes/lib/diff-tab.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/extension.d.ts +21 -0
- package/dist/pi/packages/ta-changes/lib/extension.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/extension.js +106 -0
- package/dist/pi/packages/ta-changes/lib/extension.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-changes/lib/host.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/host.js +16 -0
- package/dist/pi/packages/ta-changes/lib/host.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/i18n.d.ts +30 -0
- package/dist/pi/packages/ta-changes/lib/i18n.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/i18n.js +61 -0
- package/dist/pi/packages/ta-changes/lib/i18n.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-changes/lib/index.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/index.js +28 -0
- package/dist/pi/packages/ta-changes/lib/index.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/line-diff.d.ts +11 -0
- package/dist/pi/packages/ta-changes/lib/line-diff.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/line-diff.js +69 -0
- package/dist/pi/packages/ta-changes/lib/line-diff.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/page.d.ts +29 -0
- package/dist/pi/packages/ta-changes/lib/page.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/page.js +106 -0
- package/dist/pi/packages/ta-changes/lib/page.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-changes/lib/react.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/react.js +8 -0
- package/dist/pi/packages/ta-changes/lib/react.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/recorder.d.ts +25 -0
- package/dist/pi/packages/ta-changes/lib/recorder.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/recorder.js +117 -0
- package/dist/pi/packages/ta-changes/lib/recorder.js.map +1 -0
- package/dist/pi/packages/ta-changes/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-changes/lib/style.d.ts.map +1 -0
- package/dist/pi/packages/ta-changes/lib/style.js +44 -0
- package/dist/pi/packages/ta-changes/lib/style.js.map +1 -0
- package/dist/pi/packages/ta-changes/package.json +46 -0
- package/dist/pi/packages/ta-changes/web/index.js +460 -0
- package/dist/pi/packages/ta-channels/README.en.md +48 -0
- package/dist/pi/packages/ta-channels/README.md +1 -1
- package/dist/pi/packages/ta-channels/extension/index.mjs +8 -4
- package/dist/pi/packages/ta-channels/host/index.mjs +22 -3
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts +4 -1
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts.map +1 -1
- package/dist/pi/packages/ta-channels/lib/channels-model.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts +2 -0
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts.map +1 -1
- package/dist/pi/packages/ta-channels/lib/channels-util.js +6 -1
- package/dist/pi/packages/ta-channels/lib/channels-util.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/channels.js +1 -1
- package/dist/pi/packages/ta-channels/lib/channels.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/extension.d.ts +2 -2
- package/dist/pi/packages/ta-channels/lib/extension.d.ts.map +1 -1
- package/dist/pi/packages/ta-channels/lib/extension.js +2 -2
- package/dist/pi/packages/ta-channels/lib/extension.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts.map +1 -1
- package/dist/pi/packages/ta-channels/lib/sidebar.js +4 -2
- package/dist/pi/packages/ta-channels/lib/sidebar.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.d.ts.map +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +1 -0
- package/dist/pi/packages/ta-channels/lib/style.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/team-tools.js +1 -1
- package/dist/pi/packages/ta-channels/lib/team-tools.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/team.d.ts +7 -1
- package/dist/pi/packages/ta-channels/lib/team.d.ts.map +1 -1
- package/dist/pi/packages/ta-channels/lib/team.js +25 -2
- package/dist/pi/packages/ta-channels/lib/team.js.map +1 -1
- package/dist/pi/packages/ta-channels/lib/views.d.ts +3 -1
- package/dist/pi/packages/ta-channels/lib/views.d.ts.map +1 -1
- package/dist/pi/packages/ta-channels/lib/views.js +12 -1
- package/dist/pi/packages/ta-channels/lib/views.js.map +1 -1
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-channels/web/index.js +23 -5
- package/dist/pi/packages/ta-computer-use/README.en.md +37 -0
- package/dist/pi/packages/ta-computer-use/README.md +37 -0
- package/dist/pi/packages/ta-computer-use/extension/index.mjs +551 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.d.ts +72 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.d.ts.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.js +149 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-access.js.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-daemon.d.ts +78 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-daemon.d.ts.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-daemon.js +250 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver-daemon.js.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver.d.ts +56 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver.d.ts.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver.js +112 -0
- package/dist/pi/packages/ta-computer-use/lib/cua-driver.js.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/extension.d.ts +39 -0
- package/dist/pi/packages/ta-computer-use/lib/extension.d.ts.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/extension.js +174 -0
- package/dist/pi/packages/ta-computer-use/lib/extension.js.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/pi-types.d.ts +3 -0
- package/dist/pi/packages/ta-computer-use/lib/pi-types.d.ts.map +1 -0
- package/dist/pi/packages/ta-computer-use/lib/pi-types.js +3 -0
- package/dist/pi/packages/ta-computer-use/lib/pi-types.js.map +1 -0
- package/dist/pi/packages/ta-computer-use/package.json +51 -0
- 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 +877 -0
- package/dist/pi/packages/ta-cron/lib/commands.d.ts +61 -0
- package/dist/pi/packages/ta-cron/lib/commands.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/commands.js +250 -0
- package/dist/pi/packages/ta-cron/lib/commands.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.d.ts +39 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.js +146 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts +160 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js +38 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/editor.d.ts +17 -0
- package/dist/pi/packages/ta-cron/lib/editor.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/editor.js +145 -0
- package/dist/pi/packages/ta-cron/lib/editor.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/extension.d.ts +27 -0
- package/dist/pi/packages/ta-cron/lib/extension.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/extension.js +142 -0
- package/dist/pi/packages/ta-cron/lib/extension.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/form-util.d.ts +39 -0
- package/dist/pi/packages/ta-cron/lib/form-util.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/form-util.js +121 -0
- package/dist/pi/packages/ta-cron/lib/form-util.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-cron/lib/host.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/host.js +14 -0
- package/dist/pi/packages/ta-cron/lib/host.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +90 -0
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/i18n.js +177 -0
- package/dist/pi/packages/ta-cron/lib/i18n.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-cron/lib/index.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/index.js +37 -0
- package/dist/pi/packages/ta-cron/lib/index.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/model-picker.d.ts +33 -0
- package/dist/pi/packages/ta-cron/lib/model-picker.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/model-picker.js +178 -0
- package/dist/pi/packages/ta-cron/lib/model-picker.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/notifier.d.ts +6 -0
- package/dist/pi/packages/ta-cron/lib/notifier.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/notifier.js +50 -0
- package/dist/pi/packages/ta-cron/lib/notifier.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +39 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/page.js +113 -0
- package/dist/pi/packages/ta-cron/lib/page.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-cron/lib/react.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/react.js +8 -0
- package/dist/pi/packages/ta-cron/lib/react.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/reply.d.ts +6 -0
- package/dist/pi/packages/ta-cron/lib/reply.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/reply.js +53 -0
- package/dist/pi/packages/ta-cron/lib/reply.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.d.ts +25 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.js +223 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.d.ts +76 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.js +319 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/server-texts.d.ts +7 -0
- package/dist/pi/packages/ta-cron/lib/server-texts.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/server-texts.js +24 -0
- package/dist/pi/packages/ta-cron/lib/server-texts.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-cron/lib/style.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/style.js +137 -0
- package/dist/pi/packages/ta-cron/lib/style.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/task-store.d.ts +25 -0
- package/dist/pi/packages/ta-cron/lib/task-store.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/task-store.js +60 -0
- package/dist/pi/packages/ta-cron/lib/task-store.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +18 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +167 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +6 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +189 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.js.map +1 -0
- package/dist/pi/packages/ta-cron/lib/tool.d.ts +85 -0
- package/dist/pi/packages/ta-cron/lib/tool.d.ts.map +1 -0
- package/dist/pi/packages/ta-cron/lib/tool.js +127 -0
- package/dist/pi/packages/ta-cron/lib/tool.js.map +1 -0
- package/dist/pi/packages/ta-cron/package.json +46 -0
- package/dist/pi/packages/ta-cron/web/index.js +1985 -0
- package/dist/pi/packages/ta-extensions/README.en.md +27 -0
- package/dist/pi/packages/ta-extensions/README.md +10 -3
- package/dist/pi/packages/ta-extensions/host/index.mjs +331 -1
- package/dist/pi/packages/ta-extensions/lib/actions.d.ts +5 -1
- package/dist/pi/packages/ta-extensions/lib/actions.d.ts.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/actions.js +20 -1
- package/dist/pi/packages/ta-extensions/lib/actions.js.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/context.d.ts +20 -0
- package/dist/pi/packages/ta-extensions/lib/context.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/context.js +8 -0
- package/dist/pi/packages/ta-extensions/lib/context.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/host.d.ts +8 -2
- package/dist/pi/packages/ta-extensions/lib/host.d.ts.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/host.js +11 -2
- package/dist/pi/packages/ta-extensions/lib/host.js.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +32 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/i18n.js +78 -2
- package/dist/pi/packages/ta-extensions/lib/i18n.js.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/index.d.ts +2 -1
- package/dist/pi/packages/ta-extensions/lib/index.d.ts.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/index.js +25 -21
- package/dist/pi/packages/ta-extensions/lib/index.js.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/market-detail.d.ts +12 -0
- package/dist/pi/packages/ta-extensions/lib/market-detail.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-detail.js +95 -0
- package/dist/pi/packages/ta-extensions/lib/market-detail.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-parts.d.ts +33 -0
- package/dist/pi/packages/ta-extensions/lib/market-parts.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-parts.js +56 -0
- package/dist/pi/packages/ta-extensions/lib/market-parts.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-store.d.ts +41 -0
- package/dist/pi/packages/ta-extensions/lib/market-store.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-store.js +99 -0
- package/dist/pi/packages/ta-extensions/lib/market-store.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-style.d.ts +3 -0
- package/dist/pi/packages/ta-extensions/lib/market-style.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-style.js +98 -0
- package/dist/pi/packages/ta-extensions/lib/market-style.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-util.d.ts +74 -0
- package/dist/pi/packages/ta-extensions/lib/market-util.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-util.js +193 -0
- package/dist/pi/packages/ta-extensions/lib/market-util.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-view.d.ts +9 -0
- package/dist/pi/packages/ta-extensions/lib/market-view.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market-view.js +144 -0
- package/dist/pi/packages/ta-extensions/lib/market-view.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market.d.ts +88 -0
- package/dist/pi/packages/ta-extensions/lib/market.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/market.js +198 -0
- package/dist/pi/packages/ta-extensions/lib/market.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/page.d.ts +3 -16
- package/dist/pi/packages/ta-extensions/lib/page.d.ts.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/page.js +87 -58
- package/dist/pi/packages/ta-extensions/lib/page.js.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/signal.d.ts +12 -0
- package/dist/pi/packages/ta-extensions/lib/signal.d.ts.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/signal.js +32 -0
- package/dist/pi/packages/ta-extensions/lib/signal.js.map +1 -0
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.d.ts.map +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +3 -2
- package/dist/pi/packages/ta-extensions/lib/style.js.map +1 -1
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +3 -2
- package/dist/pi/packages/ta-extensions/web/index.js +937 -54
- package/dist/pi/packages/ta-workspace/README.md +5 -5
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +29 -0
- package/dist/pi/packages/ta-workspace/lib/browser-agent.d.ts +36 -0
- package/dist/pi/packages/ta-workspace/lib/browser-agent.d.ts.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-agent.js +396 -0
- package/dist/pi/packages/ta-workspace/lib/browser-agent.js.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts +48 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.js +180 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.js.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-import.d.ts +5 -0
- package/dist/pi/packages/ta-workspace/lib/browser-import.d.ts.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-import.js +97 -0
- package/dist/pi/packages/ta-workspace/lib/browser-import.js.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.d.ts +7 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.d.ts.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.js +202 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.js.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser.d.ts +1 -7
- package/dist/pi/packages/ta-workspace/lib/browser.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/browser.js +14 -130
- package/dist/pi/packages/ta-workspace/lib/browser.js.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/explorer.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/explorer.js +214 -3
- package/dist/pi/packages/ta-workspace/lib/explorer.js.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +37 -0
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/i18n.js +76 -2
- package/dist/pi/packages/ta-workspace/lib/i18n.js.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/index.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/index.js +7 -1
- package/dist/pi/packages/ta-workspace/lib/index.js.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.js +35 -6
- package/dist/pi/packages/ta-workspace/lib/style.js.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts +2 -2
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/terminal.js +50 -104
- package/dist/pi/packages/ta-workspace/lib/terminal.js.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.d.ts +52 -0
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.d.ts.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.js +207 -0
- package/dist/pi/packages/ta-workspace/lib/util/browser-snapshot.js.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/util/upload.d.ts +34 -0
- package/dist/pi/packages/ta-workspace/lib/util/upload.d.ts.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/util/upload.js +109 -0
- package/dist/pi/packages/ta-workspace/lib/util/upload.js.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/util/workspace.d.ts +20 -0
- package/dist/pi/packages/ta-workspace/lib/util/workspace.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/util/workspace.js +67 -0
- package/dist/pi/packages/ta-workspace/lib/util/workspace.js.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/util/zip.d.ts +20 -0
- package/dist/pi/packages/ta-workspace/lib/util/zip.d.ts.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/util/zip.js +128 -0
- package/dist/pi/packages/ta-workspace/lib/util/zip.js.map +1 -0
- package/dist/pi/packages/ta-workspace/lib/workspace-client.d.ts +12 -1
- package/dist/pi/packages/ta-workspace/lib/workspace-client.d.ts.map +1 -1
- package/dist/pi/packages/ta-workspace/lib/workspace-client.js +101 -0
- package/dist/pi/packages/ta-workspace/lib/workspace-client.js.map +1 -1
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +1955 -637
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-3_0FZVeo.js → abnfDiagram-S7VZAUFO-CNqfsCwx.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-BX-N-_gd.js → architecture-WOLXFQ4H-_WaGq-Qk.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-Daeu1xjI.js → architectureDiagram-YGSQEFNW-Bn63Lctu.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-DjJS8902.js → blockDiagram-APKKGZFW-BGaAecnk.js} +1 -1
- package/dist/public/assets/{browser-DZ1aJcgd.js → browser-DKagIN4Y.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-mKfHFqh9.js → c4Diagram-KJ2TOQU5-CK9Z_9Zp.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-Cnx7dsB1.js → chunk-6MUBBAK2-H3j3MGva.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-g4Y7Pg2t.js → chunk-AXFCVDMN-Beljdjs9.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-QNE6A_Vg.js → chunk-BG4553SI-TYEV5wLO.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-DPHr08r0.js → chunk-DQASFODM-gmWJrizf.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-CenkxHlV.js → chunk-HFQBQIA3-BTa7yKXI.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-C3Z8V8R_.js → chunk-KQLB2F66-BlwMm4R0.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-BbUyxMWY.js → chunk-KS47KZWR-CKTXjzwD.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-CKECy4cp.js → chunk-LEVMRMFU-Bn9Xkefl.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-DuZd8RGI.js → chunk-M57EVK23-B_QLqohG.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-DatO2fu-.js → chunk-OY52VR5R-BflzJHPz.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-11782Ox2.js → chunk-QB3YPZ4I-BXucfaFg.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-CCTi2rHV.js → chunk-R3KSYZAL-CGwkwxm9.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-DU6EHCIH.js → chunk-STOXU5M4-DQGOPuM5.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-BtgGljqq.js → chunk-TU62E6Q5-BCrs6AYI.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-Dd_Qy0Gx.js → chunk-X4PVCEUW-MTv7nXJX.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-DjOrWHxV.js → chunk-XXDRQBXY-fPaX8VIb.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-KfN1--CA.js → classDiagram-v2-L25IHNXF-tm4uT08q.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-BuWVQ5UC.js → cose-bilkent-JH36ORCC-Dkk3pDZj.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-D_QV_BJg.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-BKljxAVP.js → cynefinDiagram-L36ESFBY-BcoArW00.js} +1 -1
- package/dist/public/assets/{d3-selection-CtCbiJ-r.js → d3-selection-BzUITLov.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-nD3f86OL.js → dagre-SPEB5RXH-oiU-wJxw.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-wSVpHF4f.js → diagram-3B7GL73J-BwlCOIW4.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-BOkeaSpr.js → diagram-DNEMPZML-CZGQiFrl.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-CRCErdiz.js → diagram-L3MUGCDN-BJGDa24C.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-y5kaOsii.js → diagram-LA4NIPWU-DdwHRhnP.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-D7l7ybij.js → diagram-MHCOC4E2-IjreLUB9.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-kHzV_Ibv.js → diagram-XPFHEONP-CvaG0Zzq.js} +1 -1
- package/dist/public/assets/{dist-B-aKVhGg.js → dist-Cm4zqoMA.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-BX_-WdHG.js → ebnfDiagram-UZSYDL2S-C-FOI67M.js} +1 -1
- package/dist/public/assets/{editor.api-Dwz0wCaW.js → editor.api-hteKufWf.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-YaOVo5bZ.js → elk-XV6XMXQE-C_ClfkLy.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-BXQPjKDV.js → erDiagram-EYBAPDEH-DSr0aRYm.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-SiGVyftr.js → eventmodeling-K75KTNOO-COU_atV6.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-QGLBPpjQ.js +1 -0
- package/dist/public/assets/{freemarker2-DmbpSxx5.js → freemarker2-CBJnhymu.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-B_i7AN7O.js → ganttDiagram-23REXITY-BAcXXNjI.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-ByODkoVe.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-BMA1YavS.js → gitGraphDiagram-STJD7YCW-Bk9sns6k.js} +1 -1
- package/dist/public/assets/{handlebars-BVNKBeJT.js → handlebars-CiqYW1im.js} +1 -1
- package/dist/public/assets/{html-BHaxuuAl.js → html-kafkm1Z0.js} +1 -1
- package/dist/public/assets/{index-DtU34jhH.js → index-DPLd0-lb.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-BMphWS2h.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-BkNpfsDm.js → infoDiagram-KBXO4MBG-2hRQLVWa.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-xTM6C-Kn.js → ishikawaDiagram-M35NCXHK-hrOnhWJs.js} +1 -1
- package/dist/public/assets/{javascript-C5dXKvxq.js → javascript-Dt5MiA9w.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-C6iaT7vL.js → journeyDiagram-OPLOXDXO-d8HJd04q.js} +1 -1
- package/dist/public/assets/{jsonMode-Ia_aRv-z.js → jsonMode-DBICoo6P.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-MobAdBhz.js → kanban-definition-BZKZHSQY-DOUuZDiv.js} +1 -1
- package/dist/public/assets/{liquid-CIbIBxiN.js → liquid-BGYhBP2h.js} +1 -1
- package/dist/public/assets/{mdx-BqruHcEe.js → mdx-Ct_gzcP3.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-kBQmxOUn.js → mermaid-parser.core-2yhxYNxq.js} +3 -3
- package/dist/public/assets/{mermaid.core-BFkQwIYu.js → mermaid.core-sx7teU8z.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DxpTmvUG.js → mindmap-definition-I2QAS2VK-DIc9LejH.js} +1 -1
- package/dist/public/assets/module-BX2fJibj.js +1124 -0
- package/dist/public/assets/module-N1D-AOa6.js +1 -0
- package/dist/public/assets/{monaco-BRwac88s.js → monaco-DJecWyyV.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-Ca8klABu.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-B3bIVo4u.js → pegDiagram-FD4XPPHP-BfiT6-Vx.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-B-SN2eCI.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-CgnbwU0I.js → pieDiagram-J4AKIIQI-DJ0sF_Eg.js} +1 -1
- package/dist/public/assets/{python-Cwjb3hEe.js → python-BrnocsK9.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-DWx4wRau.js → quadrantDiagram-XTYBLID2-C3iF5PG6.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-DzDnNRnq.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-7QAv0_1N.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-CyjF4cc_.js → railroad-abnf-LNEFI6M7-BI4N-mtq.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-D2ypsr5c.js → railroad-ebnf-DWYD2UWJ-Ck2MUlyV.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-Cy6Mde1c.js → railroad-peg-JR7BVNR7-Cuc9S0f4.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-B6ya_k_l.js → railroadDiagram-MRQ6NCDL-Cw24sb_5.js} +1 -1
- package/dist/public/assets/{razor-D_ClW9Lh.js → razor-BDHTAmlI.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-Brg8B8VS.js → requirementDiagram-Y7LWUY3S-QQUXFr1R.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-DbzPDfky.js → sankeyDiagram-WGJFYUXA-mSlfAHND.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-BuN84drT.js → sequenceDiagram-5NDRBG5M-3t8hVott.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-C_CTpHMj.js → stateDiagram-v2-FJ4FJNEA-9EW807AL.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-BvD4v9jw.js → swimlanes-UMQ2AFYF-EbMBX_e0.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CIFqDFf2.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-VE2xWGk8.js → timeline-definition-SEUHKTQE-D14kjjsp.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-cznq7PJK.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-CBYUiQGU.js +1 -0
- package/dist/public/assets/{typescript-upeNz2VW.js → typescript-BEEbbq69.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-ZtyyvKye.js → usecaseDiagram-AFA6YXN4-DKemtzU9.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-BTEvzrNd.js → vennDiagram-NNMJR3RB-DOBq9oeY.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-DV8bp8Ml.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-CF8wIUhx.js → wardleyDiagram-S7YFUSEH-DquSJ4y-.js} +1 -1
- package/dist/public/assets/{xml-Cki0HxGb.js → xml-DvTQKQ_W.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-DcDpoJ4n.js → xychartDiagram-GGNKY7IX-ClE_9jz4.js} +1 -1
- package/dist/public/assets/{yaml-YIY66l1U.js → yaml-ffiFfPtJ.js} +1 -1
- package/dist/public/index.html +21 -3
- package/dist/serve/index.mjs +6892 -5061
- package/package.json +22 -18
- 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/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/public/assets/cynefin-EF2NZ3EQ-D_GZWaFs.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-BHpEyQnS.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-CSv9x0vY.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-Bx2U6fFU.js +0 -1
- package/dist/public/assets/module-C1y_4M09.js +0 -1061
- package/dist/public/assets/module-DYWqfyIP.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-Dy7GyfNz.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-B4D2CjUH.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Dtf3tObc.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DKGa9xBx.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CMvLg13v.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-ETecwv1j.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-er6ceAYK.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-CzrxsjBc.js +0 -1
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
// web-src/cron-protocol.ts
|
|
2
|
+
var NAME = "@celljs/ta-cron";
|
|
3
|
+
var RUN_MARK = "<ta-cron-run>";
|
|
4
|
+
var Keys;
|
|
5
|
+
((Keys) => {
|
|
6
|
+
Keys.TASKS = "tasks";
|
|
7
|
+
Keys.LATEST = "latest";
|
|
8
|
+
function runs(taskId) {
|
|
9
|
+
return `runs/${taskId}`;
|
|
10
|
+
}
|
|
11
|
+
Keys.runs = runs;
|
|
12
|
+
})(Keys ||= {});
|
|
13
|
+
var Limits;
|
|
14
|
+
((Limits) => {
|
|
15
|
+
Limits.RUNS_KEPT = 20;
|
|
16
|
+
Limits.SUMMARY_MAX = 4000;
|
|
17
|
+
Limits.MIN_INTERVAL_MS = 60000;
|
|
18
|
+
Limits.RUN_TIMEOUT_MS = 30 * 60000;
|
|
19
|
+
Limits.GRACE_MS = 5 * 60000;
|
|
20
|
+
Limits.PARALLEL_RUNS = 3;
|
|
21
|
+
})(Limits ||= {});
|
|
22
|
+
|
|
23
|
+
// web-src/cron-expression.ts
|
|
24
|
+
var FIELDS = [
|
|
25
|
+
{ name: "minute", min: 0, max: 59 },
|
|
26
|
+
{ name: "hour", min: 0, max: 23 },
|
|
27
|
+
{ name: "day of month", min: 1, max: 31 },
|
|
28
|
+
{ name: "month", min: 1, max: 12, names: ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"] },
|
|
29
|
+
{ name: "day of week", min: 0, max: 7, names: ["sun", "mon", "tue", "wed", "thu", "fri", "sat"] }
|
|
30
|
+
];
|
|
31
|
+
var NICKNAMES = {
|
|
32
|
+
"@yearly": "0 0 1 1 *",
|
|
33
|
+
"@annually": "0 0 1 1 *",
|
|
34
|
+
"@monthly": "0 0 1 * *",
|
|
35
|
+
"@weekly": "0 0 * * 0",
|
|
36
|
+
"@daily": "0 0 * * *",
|
|
37
|
+
"@midnight": "0 0 * * *",
|
|
38
|
+
"@hourly": "0 * * * *"
|
|
39
|
+
};
|
|
40
|
+
var MAX_STEPS = 200000;
|
|
41
|
+
|
|
42
|
+
class CronExpression {
|
|
43
|
+
source;
|
|
44
|
+
minutes;
|
|
45
|
+
hours;
|
|
46
|
+
days;
|
|
47
|
+
months;
|
|
48
|
+
weekdays;
|
|
49
|
+
anyDay;
|
|
50
|
+
anyWeekday;
|
|
51
|
+
constructor(source, minutes, hours, days, months, weekdays, anyDay, anyWeekday) {
|
|
52
|
+
this.source = source;
|
|
53
|
+
this.minutes = minutes;
|
|
54
|
+
this.hours = hours;
|
|
55
|
+
this.days = days;
|
|
56
|
+
this.months = months;
|
|
57
|
+
this.weekdays = weekdays;
|
|
58
|
+
this.anyDay = anyDay;
|
|
59
|
+
this.anyWeekday = anyWeekday;
|
|
60
|
+
}
|
|
61
|
+
static parse(text) {
|
|
62
|
+
const source = text.trim().replace(/\s+/g, " ");
|
|
63
|
+
const expanded = NICKNAMES[source.toLowerCase()] ?? source;
|
|
64
|
+
const parts = expanded.split(" ");
|
|
65
|
+
if (parts.length !== 5) {
|
|
66
|
+
throw new Error(`A cron expression has five fields (minute hour day month weekday), or is one of ${Object.keys(NICKNAMES).join(", ")}: ${JSON.stringify(text)} has ${parts.length}.`);
|
|
67
|
+
}
|
|
68
|
+
const sets = parts.map((part, index) => CronExpression.field(part, FIELDS[index]));
|
|
69
|
+
const weekdays = sets[4];
|
|
70
|
+
if (weekdays.delete(7)) {
|
|
71
|
+
weekdays.add(0);
|
|
72
|
+
}
|
|
73
|
+
return new CronExpression(source, sets[0], sets[1], sets[2], sets[3], weekdays, parts[2] === "*", parts[4] === "*");
|
|
74
|
+
}
|
|
75
|
+
static isValid(text) {
|
|
76
|
+
try {
|
|
77
|
+
CronExpression.parse(text);
|
|
78
|
+
return true;
|
|
79
|
+
} catch {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
static field(text, field) {
|
|
84
|
+
const values = new Set;
|
|
85
|
+
for (const item of text.toLowerCase().split(",")) {
|
|
86
|
+
const [range, stepText, extra] = item.split("/");
|
|
87
|
+
const step = stepText === undefined ? 1 : Number(stepText);
|
|
88
|
+
if (extra !== undefined || !Number.isInteger(step) || step < 1) {
|
|
89
|
+
throw new Error(`${JSON.stringify(item)} is not a valid ${field.name}: a step is a whole number from 1.`);
|
|
90
|
+
}
|
|
91
|
+
let from;
|
|
92
|
+
let to;
|
|
93
|
+
if (range === "*") {
|
|
94
|
+
from = field.min;
|
|
95
|
+
to = field.max;
|
|
96
|
+
} else {
|
|
97
|
+
const [first, last, more] = range.split("-");
|
|
98
|
+
if (more !== undefined) {
|
|
99
|
+
throw new Error(`${JSON.stringify(item)} is not a valid ${field.name}.`);
|
|
100
|
+
}
|
|
101
|
+
from = CronExpression.value(first, field);
|
|
102
|
+
to = last === undefined ? stepText === undefined ? from : field.max : CronExpression.value(last, field);
|
|
103
|
+
}
|
|
104
|
+
if (from > to) {
|
|
105
|
+
throw new Error(`${JSON.stringify(item)} is not a valid ${field.name}: the range goes backwards.`);
|
|
106
|
+
}
|
|
107
|
+
for (let value = from;value <= to; value += step) {
|
|
108
|
+
values.add(value);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return values;
|
|
112
|
+
}
|
|
113
|
+
static value(text, field) {
|
|
114
|
+
const named = field.names?.indexOf(text) ?? -1;
|
|
115
|
+
const value = named >= 0 ? named + (field.min === 1 ? 1 : 0) : /^\d+$/.test(text) ? Number(text) : Number.NaN;
|
|
116
|
+
if (!(value >= field.min && value <= field.max)) {
|
|
117
|
+
throw new Error(`${JSON.stringify(text)} is not a valid ${field.name}: from ${field.min} to ${field.max}.`);
|
|
118
|
+
}
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
next(after) {
|
|
122
|
+
const time = new Date(after.getTime());
|
|
123
|
+
time.setSeconds(0, 0);
|
|
124
|
+
time.setMinutes(time.getMinutes() + 1);
|
|
125
|
+
for (let step = 0;step < MAX_STEPS; step++) {
|
|
126
|
+
if (!this.months.has(time.getMonth() + 1)) {
|
|
127
|
+
time.setMonth(time.getMonth() + 1, 1);
|
|
128
|
+
time.setHours(0, 0, 0, 0);
|
|
129
|
+
} else if (!this.matchesDay(time)) {
|
|
130
|
+
time.setDate(time.getDate() + 1);
|
|
131
|
+
time.setHours(0, 0, 0, 0);
|
|
132
|
+
} else if (!this.hours.has(time.getHours())) {
|
|
133
|
+
time.setHours(time.getHours() + 1, 0, 0, 0);
|
|
134
|
+
} else if (!this.minutes.has(time.getMinutes())) {
|
|
135
|
+
time.setMinutes(time.getMinutes() + 1, 0, 0);
|
|
136
|
+
} else {
|
|
137
|
+
return time;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
matchesDay(time) {
|
|
143
|
+
const day = this.days.has(time.getDate());
|
|
144
|
+
const weekday = this.weekdays.has(time.getDay());
|
|
145
|
+
if (this.anyDay || this.anyWeekday) {
|
|
146
|
+
return day && weekday;
|
|
147
|
+
}
|
|
148
|
+
return day || weekday;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// web-src/schedule-util.ts
|
|
153
|
+
var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
|
|
154
|
+
var NOTIFY_LEVELS = ["always", "error", "never"];
|
|
155
|
+
var UNITS = {
|
|
156
|
+
s: 1000,
|
|
157
|
+
sec: 1000,
|
|
158
|
+
m: 60000,
|
|
159
|
+
min: 60000,
|
|
160
|
+
h: 3600000,
|
|
161
|
+
hr: 3600000,
|
|
162
|
+
d: 86400000,
|
|
163
|
+
w: 7 * 86400000
|
|
164
|
+
};
|
|
165
|
+
var Duration;
|
|
166
|
+
((Duration) => {
|
|
167
|
+
const PART = /(\d+)\s*(sec|min|hr|s|m|h|d|w)/gy;
|
|
168
|
+
function parse(text) {
|
|
169
|
+
const source = text.trim().toLowerCase();
|
|
170
|
+
if (!source) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
PART.lastIndex = 0;
|
|
174
|
+
let total = 0;
|
|
175
|
+
let match;
|
|
176
|
+
let end = 0;
|
|
177
|
+
while (match = PART.exec(source)) {
|
|
178
|
+
total += Number(match[1]) * UNITS[match[2]];
|
|
179
|
+
end = PART.lastIndex;
|
|
180
|
+
}
|
|
181
|
+
return end === source.length && total > 0 ? total : undefined;
|
|
182
|
+
}
|
|
183
|
+
Duration.parse = parse;
|
|
184
|
+
function format(ms) {
|
|
185
|
+
const parts = [];
|
|
186
|
+
let rest = Math.round(ms / 1000);
|
|
187
|
+
for (const [unit, size] of [
|
|
188
|
+
["d", 86400],
|
|
189
|
+
["h", 3600],
|
|
190
|
+
["m", 60],
|
|
191
|
+
["s", 1]
|
|
192
|
+
]) {
|
|
193
|
+
if (rest >= size) {
|
|
194
|
+
parts.push(`${Math.floor(rest / size)}${unit}`);
|
|
195
|
+
rest %= size;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return parts.join("") || "0s";
|
|
199
|
+
}
|
|
200
|
+
Duration.format = format;
|
|
201
|
+
})(Duration ||= {});
|
|
202
|
+
var EN_DAYS = ["Sundays", "Mondays", "Tuesdays", "Wednesdays", "Thursdays", "Fridays", "Saturdays"];
|
|
203
|
+
var ZH_DAYS = ["日", "一", "二", "三", "四", "五", "六"];
|
|
204
|
+
var WORDS = {
|
|
205
|
+
en: {
|
|
206
|
+
once: (time) => `Once, ${time}`,
|
|
207
|
+
every: (amount, unit) => amount === 1 ? `Every ${unit}` : `Every ${amount} ${unit}s`,
|
|
208
|
+
everyRaw: (duration) => `Every ${duration}`,
|
|
209
|
+
daily: (time) => `Daily at ${time}`,
|
|
210
|
+
weekdays: (time) => `Weekdays at ${time}`,
|
|
211
|
+
weekly: (day, time) => `${EN_DAYS[day]} at ${time}`,
|
|
212
|
+
monthly: (day, time) => `Monthly on day ${day} at ${time}`,
|
|
213
|
+
hourly: (minute) => minute === 0 ? "Hourly" : `Hourly at :${pad(minute)}`,
|
|
214
|
+
cron: (expression) => `Cron ${expression}`
|
|
215
|
+
},
|
|
216
|
+
zh: {
|
|
217
|
+
once: (time) => `${time} 运行一次`,
|
|
218
|
+
every: (amount, unit) => `每 ${amount === 1 ? "" : `${amount} `}${{ minute: "分钟", hour: "小时", day: "天" }[unit]}`.replace("每 天", "每天"),
|
|
219
|
+
everyRaw: (duration) => `每 ${duration}`,
|
|
220
|
+
daily: (time) => `每天 ${time}`,
|
|
221
|
+
weekdays: (time) => `工作日 ${time}`,
|
|
222
|
+
weekly: (day, time) => `每周${ZH_DAYS[day]} ${time}`,
|
|
223
|
+
monthly: (day, time) => `每月 ${day} 日 ${time}`,
|
|
224
|
+
hourly: (minute) => minute === 0 ? "每小时" : `每小时第 ${minute} 分`,
|
|
225
|
+
cron: (expression) => `cron ${expression}`
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
function pad(value) {
|
|
229
|
+
return String(value).padStart(2, "0");
|
|
230
|
+
}
|
|
231
|
+
var ScheduleUtil;
|
|
232
|
+
((ScheduleUtil) => {
|
|
233
|
+
function check(value) {
|
|
234
|
+
const schedule = value ?? {};
|
|
235
|
+
switch (schedule.kind) {
|
|
236
|
+
case "once": {
|
|
237
|
+
const at = new Date(String(schedule.at ?? ""));
|
|
238
|
+
if (typeof schedule.at !== "string" || Number.isNaN(at.getTime())) {
|
|
239
|
+
throw new Error("A task that runs once needs `at`, a time such as 2026-11-12T09:00 (local time) or an ISO time.");
|
|
240
|
+
}
|
|
241
|
+
return { kind: "once", at: at.toISOString() };
|
|
242
|
+
}
|
|
243
|
+
case "interval": {
|
|
244
|
+
const every = typeof schedule.every === "string" ? schedule.every.trim() : "";
|
|
245
|
+
const ms = Duration.parse(every);
|
|
246
|
+
if (ms === undefined) {
|
|
247
|
+
throw new Error("An interval needs `every`, a duration such as 30m, 2h or 1d.");
|
|
248
|
+
}
|
|
249
|
+
if (ms < Limits.MIN_INTERVAL_MS) {
|
|
250
|
+
throw new Error(`An interval is at least 1m; ${every} is shorter.`);
|
|
251
|
+
}
|
|
252
|
+
return { kind: "interval", every: Duration.format(ms) };
|
|
253
|
+
}
|
|
254
|
+
case "cron": {
|
|
255
|
+
const expression = typeof schedule.expression === "string" ? schedule.expression : "";
|
|
256
|
+
return { kind: "cron", expression: CronExpression.parse(expression).source };
|
|
257
|
+
}
|
|
258
|
+
default:
|
|
259
|
+
throw new Error('A schedule is { kind: "once", at }, { kind: "interval", every } or { kind: "cron", expression }.');
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
ScheduleUtil.check = check;
|
|
263
|
+
function next(schedule, now) {
|
|
264
|
+
switch (schedule.kind) {
|
|
265
|
+
case "once": {
|
|
266
|
+
const at = new Date(schedule.at);
|
|
267
|
+
return at.getTime() > now.getTime() ? at : undefined;
|
|
268
|
+
}
|
|
269
|
+
case "interval":
|
|
270
|
+
return new Date(now.getTime() + (Duration.parse(schedule.every) ?? Limits.MIN_INTERVAL_MS));
|
|
271
|
+
case "cron":
|
|
272
|
+
return CronExpression.parse(schedule.expression).next(now);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
ScheduleUtil.next = next;
|
|
276
|
+
function repeats(schedule) {
|
|
277
|
+
return schedule.kind !== "once";
|
|
278
|
+
}
|
|
279
|
+
ScheduleUtil.repeats = repeats;
|
|
280
|
+
function notifyLevel(task) {
|
|
281
|
+
return task.notify ?? (repeats(task.schedule) ? "error" : "always");
|
|
282
|
+
}
|
|
283
|
+
ScheduleUtil.notifyLevel = notifyLevel;
|
|
284
|
+
function shouldNotify(level, failed) {
|
|
285
|
+
return level === "always" || level === "error" && failed;
|
|
286
|
+
}
|
|
287
|
+
ScheduleUtil.shouldNotify = shouldNotify;
|
|
288
|
+
function clock(time, now = new Date) {
|
|
289
|
+
const day = `${time.getMonth() + 1}/${time.getDate()}`;
|
|
290
|
+
const year = time.getFullYear() === now.getFullYear() ? "" : `${time.getFullYear()}/`;
|
|
291
|
+
return `${year}${day} ${pad(time.getHours())}:${pad(time.getMinutes())}`;
|
|
292
|
+
}
|
|
293
|
+
ScheduleUtil.clock = clock;
|
|
294
|
+
function describe(schedule, language, now = new Date) {
|
|
295
|
+
const words = WORDS[language.startsWith("zh") ? "zh" : "en"];
|
|
296
|
+
switch (schedule.kind) {
|
|
297
|
+
case "once":
|
|
298
|
+
return words.once(clock(new Date(schedule.at), now));
|
|
299
|
+
case "interval":
|
|
300
|
+
return describeInterval(schedule.every, words);
|
|
301
|
+
case "cron":
|
|
302
|
+
return describeCron(schedule.expression, words);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
ScheduleUtil.describe = describe;
|
|
306
|
+
function describeInterval(every, words) {
|
|
307
|
+
const ms = Duration.parse(every) ?? 0;
|
|
308
|
+
for (const [unit, size] of [
|
|
309
|
+
["day", 86400000],
|
|
310
|
+
["hour", 3600000],
|
|
311
|
+
["minute", 60000]
|
|
312
|
+
]) {
|
|
313
|
+
if (ms >= size && ms % size === 0) {
|
|
314
|
+
return words.every(ms / size, unit);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return words.everyRaw(every);
|
|
318
|
+
}
|
|
319
|
+
function describeCron(expression, words) {
|
|
320
|
+
const fields = (NICKNAMES[expression.toLowerCase()] ?? expression).split(" ");
|
|
321
|
+
const [minute, hour, day, month, weekday] = fields;
|
|
322
|
+
const number = (text) => /^\d+$/.test(text) ? Number(text) : undefined;
|
|
323
|
+
const m = number(minute);
|
|
324
|
+
const h = number(hour);
|
|
325
|
+
const time = m !== undefined && h !== undefined ? `${pad(h)}:${pad(m)}` : undefined;
|
|
326
|
+
if (month === "*") {
|
|
327
|
+
if (time && day === "*" && weekday === "*") {
|
|
328
|
+
return words.daily(time);
|
|
329
|
+
}
|
|
330
|
+
if (time && day === "*" && weekday === "1-5") {
|
|
331
|
+
return words.weekdays(time);
|
|
332
|
+
}
|
|
333
|
+
const d = number(weekday);
|
|
334
|
+
if (time && day === "*" && d !== undefined && d <= 7) {
|
|
335
|
+
return words.weekly(d % 7, time);
|
|
336
|
+
}
|
|
337
|
+
const date = number(day);
|
|
338
|
+
if (time && date !== undefined && weekday === "*") {
|
|
339
|
+
return words.monthly(date, time);
|
|
340
|
+
}
|
|
341
|
+
if (m !== undefined && hour === "*" && day === "*" && weekday === "*") {
|
|
342
|
+
return words.hourly(m);
|
|
343
|
+
}
|
|
344
|
+
const everyMinutes = /^\*\/(\d+)$/.exec(minute);
|
|
345
|
+
if (everyMinutes && hour === "*" && day === "*" && weekday === "*") {
|
|
346
|
+
return words.every(Number(everyMinutes[1]), "minute");
|
|
347
|
+
}
|
|
348
|
+
const everyHours = /^\*\/(\d+)$/.exec(hour);
|
|
349
|
+
if (m === 0 && everyHours && day === "*" && weekday === "*") {
|
|
350
|
+
return words.every(Number(everyHours[1]), "hour");
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return words.cron(expression);
|
|
354
|
+
}
|
|
355
|
+
})(ScheduleUtil ||= {});
|
|
356
|
+
|
|
357
|
+
// web-src/task-store.ts
|
|
358
|
+
class TaskStore {
|
|
359
|
+
host;
|
|
360
|
+
writing = Promise.resolve();
|
|
361
|
+
constructor(host) {
|
|
362
|
+
this.host = host;
|
|
363
|
+
}
|
|
364
|
+
async tasks() {
|
|
365
|
+
const value = await this.host.getExtensionData(NAME, Keys.TASKS);
|
|
366
|
+
return Array.isArray(value) ? value.filter(TaskStore.isTask) : [];
|
|
367
|
+
}
|
|
368
|
+
saveTasks(tasks) {
|
|
369
|
+
const copy = tasks.map((task) => ({ ...task }));
|
|
370
|
+
return this.queue(() => this.host.setExtensionData(NAME, Keys.TASKS, copy));
|
|
371
|
+
}
|
|
372
|
+
async runs(taskId) {
|
|
373
|
+
await this.writing.catch(() => {
|
|
374
|
+
return;
|
|
375
|
+
});
|
|
376
|
+
const value = await this.host.getExtensionData(NAME, Keys.runs(taskId));
|
|
377
|
+
return Array.isArray(value) ? value : [];
|
|
378
|
+
}
|
|
379
|
+
saveRun(run) {
|
|
380
|
+
const copy = { ...run };
|
|
381
|
+
return this.queue(async () => {
|
|
382
|
+
const value = await this.host.getExtensionData(NAME, Keys.runs(run.taskId));
|
|
383
|
+
const runs = Array.isArray(value) ? value : [];
|
|
384
|
+
const index = runs.findIndex((other) => other.id === run.id);
|
|
385
|
+
const next = index >= 0 ? runs.map((other) => other.id === run.id ? copy : other) : [copy, ...runs];
|
|
386
|
+
await this.host.setExtensionData(NAME, Keys.runs(run.taskId), next.slice(0, Limits.RUNS_KEPT));
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
removeRuns(taskId) {
|
|
390
|
+
return this.queue(() => this.host.setExtensionData(NAME, Keys.runs(taskId), null));
|
|
391
|
+
}
|
|
392
|
+
finished(finished) {
|
|
393
|
+
return this.queue(() => this.host.setExtensionData(NAME, Keys.LATEST, finished));
|
|
394
|
+
}
|
|
395
|
+
async flush() {
|
|
396
|
+
await this.writing.catch(() => {
|
|
397
|
+
return;
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
queue(write) {
|
|
401
|
+
const next = this.writing.catch(() => {
|
|
402
|
+
return;
|
|
403
|
+
}).then(write);
|
|
404
|
+
this.writing = next;
|
|
405
|
+
return next;
|
|
406
|
+
}
|
|
407
|
+
static isTask(value) {
|
|
408
|
+
const task = value;
|
|
409
|
+
return typeof task?.id === "string" && typeof task.prompt === "string" && typeof task.schedule === "object" && typeof task.cwd === "string";
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
// web-src/task-util.ts
|
|
414
|
+
var PROMPT_MAX = 20000;
|
|
415
|
+
var NAME_MAX = 80;
|
|
416
|
+
var PREFIX_MIN = 4;
|
|
417
|
+
var TaskUtil;
|
|
418
|
+
((TaskUtil) => {
|
|
419
|
+
function newId(prefix) {
|
|
420
|
+
const bytes = new Uint8Array(4);
|
|
421
|
+
crypto.getRandomValues(bytes);
|
|
422
|
+
return `${prefix}_${Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
423
|
+
}
|
|
424
|
+
TaskUtil.newId = newId;
|
|
425
|
+
function create(input, cwd, now) {
|
|
426
|
+
const prompt = checkPrompt(input?.prompt);
|
|
427
|
+
const schedule = ScheduleUtil.check(input.schedule);
|
|
428
|
+
const at = now.toISOString();
|
|
429
|
+
const task = {
|
|
430
|
+
id: newId("task"),
|
|
431
|
+
name: checkName(input.name) ?? defaultName(prompt),
|
|
432
|
+
prompt,
|
|
433
|
+
schedule,
|
|
434
|
+
cwd: checkCwd(input.cwd) ?? cwd,
|
|
435
|
+
enabled: input.enabled !== false,
|
|
436
|
+
runCount: 0,
|
|
437
|
+
failCount: 0,
|
|
438
|
+
createdAt: at,
|
|
439
|
+
updatedAt: at
|
|
440
|
+
};
|
|
441
|
+
setOptional(task, input);
|
|
442
|
+
return arm(task, now);
|
|
443
|
+
}
|
|
444
|
+
TaskUtil.create = create;
|
|
445
|
+
function patch(task, patch2, now) {
|
|
446
|
+
const next = { ...task, updatedAt: now.toISOString() };
|
|
447
|
+
if (patch2.prompt !== undefined) {
|
|
448
|
+
next.prompt = checkPrompt(patch2.prompt);
|
|
449
|
+
}
|
|
450
|
+
if (patch2.name !== undefined) {
|
|
451
|
+
next.name = checkName(patch2.name) ?? defaultName(next.prompt);
|
|
452
|
+
}
|
|
453
|
+
if (patch2.cwd !== undefined) {
|
|
454
|
+
next.cwd = checkCwd(patch2.cwd) ?? task.cwd;
|
|
455
|
+
}
|
|
456
|
+
setOptional(next, patch2);
|
|
457
|
+
if (patch2.enabled !== undefined) {
|
|
458
|
+
next.enabled = patch2.enabled === true;
|
|
459
|
+
}
|
|
460
|
+
if (patch2.schedule !== undefined) {
|
|
461
|
+
next.schedule = ScheduleUtil.check(patch2.schedule);
|
|
462
|
+
}
|
|
463
|
+
const rearm = patch2.schedule !== undefined || next.enabled && !task.enabled;
|
|
464
|
+
return rearm ? arm(next, now) : next;
|
|
465
|
+
}
|
|
466
|
+
TaskUtil.patch = patch;
|
|
467
|
+
function arm(task, now) {
|
|
468
|
+
if (!task.enabled) {
|
|
469
|
+
return task;
|
|
470
|
+
}
|
|
471
|
+
const next = ScheduleUtil.next(task.schedule, now);
|
|
472
|
+
if (!next) {
|
|
473
|
+
throw new Error(task.schedule.kind === "once" ? `The time of ${task.name} (${task.schedule.at}) has passed: give it a time to come.` : `The rule of ${task.name} never comes round: check the cron expression.`);
|
|
474
|
+
}
|
|
475
|
+
return { ...task, nextRunAt: next.toISOString() };
|
|
476
|
+
}
|
|
477
|
+
TaskUtil.arm = arm;
|
|
478
|
+
function find(tasks, ref) {
|
|
479
|
+
const text = typeof ref === "string" ? ref.trim() : "";
|
|
480
|
+
const found = tasks.find((task) => task.id === text) ?? tasks.find((task) => task.name === text) ?? (text.length >= PREFIX_MIN ? only(tasks.filter((task) => task.id.startsWith(text))) : undefined);
|
|
481
|
+
if (!found) {
|
|
482
|
+
const known = tasks.length ? tasks.map((task) => `${task.id} (${task.name})`).join(", ") : "none yet";
|
|
483
|
+
throw new Error(`No task is ${JSON.stringify(text)}. The tasks: ${known}.`);
|
|
484
|
+
}
|
|
485
|
+
return found;
|
|
486
|
+
}
|
|
487
|
+
TaskUtil.find = find;
|
|
488
|
+
function systemPrompt(task, now) {
|
|
489
|
+
return [
|
|
490
|
+
RUN_MARK,
|
|
491
|
+
`This conversation is a scheduled run of the task "${task.name}" (${ScheduleUtil.describe(task.schedule, "en", now)}), started by the Ta service at ${now.toISOString()}.`,
|
|
492
|
+
"Nobody watches it while it runs: do the work without asking the user anything, and end with a short summary of what you found or did, which the user reads first.",
|
|
493
|
+
"</ta-cron-run>"
|
|
494
|
+
].join(`
|
|
495
|
+
`);
|
|
496
|
+
}
|
|
497
|
+
TaskUtil.systemPrompt = systemPrompt;
|
|
498
|
+
function only(tasks) {
|
|
499
|
+
return tasks.length === 1 ? tasks[0] : undefined;
|
|
500
|
+
}
|
|
501
|
+
function setOptional(task, input) {
|
|
502
|
+
if (input.model !== undefined) {
|
|
503
|
+
task.model = checkModel(input.model);
|
|
504
|
+
}
|
|
505
|
+
if (input.thinking !== undefined) {
|
|
506
|
+
task.thinking = checkThinking(input.thinking);
|
|
507
|
+
}
|
|
508
|
+
if (input.notify !== undefined) {
|
|
509
|
+
task.notify = checkNotify(input.notify);
|
|
510
|
+
}
|
|
511
|
+
for (const key of ["model", "thinking", "notify"]) {
|
|
512
|
+
if (task[key] === undefined) {
|
|
513
|
+
delete task[key];
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
function checkPrompt(value) {
|
|
518
|
+
const prompt = typeof value === "string" ? value.trim() : "";
|
|
519
|
+
if (!prompt) {
|
|
520
|
+
throw new Error("A task needs a prompt: what Ta should do each time it runs.");
|
|
521
|
+
}
|
|
522
|
+
if (prompt.length > PROMPT_MAX) {
|
|
523
|
+
throw new Error(`A prompt is at most ${PROMPT_MAX} characters; keep long instructions in a file and name it.`);
|
|
524
|
+
}
|
|
525
|
+
return prompt;
|
|
526
|
+
}
|
|
527
|
+
function checkName(value) {
|
|
528
|
+
const name = typeof value === "string" ? value.trim() : "";
|
|
529
|
+
return name ? name.slice(0, NAME_MAX) : undefined;
|
|
530
|
+
}
|
|
531
|
+
function defaultName(prompt) {
|
|
532
|
+
const line = prompt.split(`
|
|
533
|
+
`)[0].trim();
|
|
534
|
+
return line.length > 40 ? `${line.slice(0, 39)}…` : line;
|
|
535
|
+
}
|
|
536
|
+
function checkCwd(value) {
|
|
537
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
538
|
+
}
|
|
539
|
+
function checkModel(value) {
|
|
540
|
+
const model = typeof value === "string" ? value.trim() : "";
|
|
541
|
+
return model || undefined;
|
|
542
|
+
}
|
|
543
|
+
function checkThinking(value) {
|
|
544
|
+
const level = typeof value === "string" ? value.trim() : "";
|
|
545
|
+
if (level && !THINKING_LEVELS.includes(level)) {
|
|
546
|
+
throw new Error(`A thinking level is one of ${THINKING_LEVELS.join(", ")}; not ${JSON.stringify(level)}.`);
|
|
547
|
+
}
|
|
548
|
+
return level || undefined;
|
|
549
|
+
}
|
|
550
|
+
function checkNotify(value) {
|
|
551
|
+
if (value === "" || value === null) {
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
if (!NOTIFY_LEVELS.includes(value)) {
|
|
555
|
+
throw new Error(`notify is one of ${NOTIFY_LEVELS.join(", ")}; not ${JSON.stringify(value)}.`);
|
|
556
|
+
}
|
|
557
|
+
return value;
|
|
558
|
+
}
|
|
559
|
+
function missed(task, now) {
|
|
560
|
+
return task.schedule.kind === "once" && !!task.nextRunAt && now.getTime() - new Date(task.nextRunAt).getTime() > Limits.GRACE_MS;
|
|
561
|
+
}
|
|
562
|
+
TaskUtil.missed = missed;
|
|
563
|
+
})(TaskUtil ||= {});
|
|
564
|
+
|
|
565
|
+
// web-src/scheduler.ts
|
|
566
|
+
class CronScheduler {
|
|
567
|
+
host;
|
|
568
|
+
tasks = [];
|
|
569
|
+
store;
|
|
570
|
+
options;
|
|
571
|
+
active = new Map;
|
|
572
|
+
waiting = [];
|
|
573
|
+
working = 0;
|
|
574
|
+
lingering = new Set;
|
|
575
|
+
timer;
|
|
576
|
+
disposed = false;
|
|
577
|
+
constructor(host, options = {}) {
|
|
578
|
+
this.host = host;
|
|
579
|
+
this.store = new TaskStore(host);
|
|
580
|
+
this.options = { now: () => new Date, tickMs: 60000, pollMs: 1000, timeoutMs: Limits.RUN_TIMEOUT_MS, parallel: Limits.PARALLEL_RUNS, ...options };
|
|
581
|
+
}
|
|
582
|
+
async start() {
|
|
583
|
+
this.tasks = await this.store.tasks();
|
|
584
|
+
const now = this.options.now();
|
|
585
|
+
for (const task of this.tasks) {
|
|
586
|
+
if (task.lastStatus === "running") {
|
|
587
|
+
await this.reclaim(task, now);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
for (const task of [...this.tasks]) {
|
|
591
|
+
if (task.enabled && TaskUtil.missed(task, now)) {
|
|
592
|
+
await this.miss(task, now);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
await this.store.saveTasks(this.tasks);
|
|
596
|
+
this.arm();
|
|
597
|
+
}
|
|
598
|
+
async dispose() {
|
|
599
|
+
this.disposed = true;
|
|
600
|
+
clearTimeout(this.timer);
|
|
601
|
+
await this.store.flush();
|
|
602
|
+
}
|
|
603
|
+
async list() {
|
|
604
|
+
return this.tasks.map((task) => ({ ...task }));
|
|
605
|
+
}
|
|
606
|
+
async get(ref) {
|
|
607
|
+
return { ...TaskUtil.find(this.tasks, ref) };
|
|
608
|
+
}
|
|
609
|
+
async runs(ref, limit = Limits.RUNS_KEPT) {
|
|
610
|
+
const task = TaskUtil.find(this.tasks, ref);
|
|
611
|
+
return (await this.store.runs(task.id)).slice(0, Math.max(1, limit));
|
|
612
|
+
}
|
|
613
|
+
async add(input) {
|
|
614
|
+
const cwd = (await this.host.getServerInfo()).cwd;
|
|
615
|
+
const task = TaskUtil.create(input, cwd, this.options.now());
|
|
616
|
+
await this.save([...this.tasks, task]);
|
|
617
|
+
return { ...task };
|
|
618
|
+
}
|
|
619
|
+
async update(ref, patch) {
|
|
620
|
+
const task = TaskUtil.find(this.tasks, ref);
|
|
621
|
+
const next = TaskUtil.patch(task, patch ?? {}, this.options.now());
|
|
622
|
+
await this.replace(next);
|
|
623
|
+
return { ...next };
|
|
624
|
+
}
|
|
625
|
+
setEnabled(ref, enabled) {
|
|
626
|
+
return this.update(ref, { enabled: enabled === true });
|
|
627
|
+
}
|
|
628
|
+
async remove(ref) {
|
|
629
|
+
const task = TaskUtil.find(this.tasks, ref);
|
|
630
|
+
await this.drop([task]);
|
|
631
|
+
return task;
|
|
632
|
+
}
|
|
633
|
+
async clear(cwd) {
|
|
634
|
+
const gone = this.tasks.filter((task) => !cwd || task.cwd === cwd);
|
|
635
|
+
await this.drop(gone);
|
|
636
|
+
return gone;
|
|
637
|
+
}
|
|
638
|
+
async run(ref) {
|
|
639
|
+
const task = TaskUtil.find(this.tasks, ref);
|
|
640
|
+
if (this.active.has(task.id)) {
|
|
641
|
+
throw new Error(`${task.name} is running now; wait for its run to end.`);
|
|
642
|
+
}
|
|
643
|
+
return this.begin(task, "manual", this.options.now());
|
|
644
|
+
}
|
|
645
|
+
isRun(sessionId) {
|
|
646
|
+
return [...this.active.values()].some((active) => active.sessionId === sessionId);
|
|
647
|
+
}
|
|
648
|
+
arm() {
|
|
649
|
+
clearTimeout(this.timer);
|
|
650
|
+
if (this.disposed) {
|
|
651
|
+
return;
|
|
652
|
+
}
|
|
653
|
+
const now = this.options.now().getTime();
|
|
654
|
+
let delay = this.options.tickMs;
|
|
655
|
+
for (const task of this.tasks) {
|
|
656
|
+
if (task.enabled && task.nextRunAt) {
|
|
657
|
+
delay = Math.min(delay, Math.max(0, new Date(task.nextRunAt).getTime() - now));
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
this.timer = setTimeout(() => void this.tick().catch((error) => console.error(`${NAME}: ${message(error)}`)), delay);
|
|
661
|
+
this.timer.unref?.();
|
|
662
|
+
}
|
|
663
|
+
async tick() {
|
|
664
|
+
if (this.disposed) {
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
const now = this.options.now();
|
|
668
|
+
for (const task of this.tasks) {
|
|
669
|
+
if (!task.enabled || !task.nextRunAt || new Date(task.nextRunAt).getTime() > now.getTime()) {
|
|
670
|
+
continue;
|
|
671
|
+
}
|
|
672
|
+
if (this.active.has(task.id)) {
|
|
673
|
+
await this.replace(this.advance(task, now));
|
|
674
|
+
} else {
|
|
675
|
+
await this.begin(task, "schedule", now);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
await this.sweep();
|
|
679
|
+
this.arm();
|
|
680
|
+
}
|
|
681
|
+
advance(task, now) {
|
|
682
|
+
if (!ScheduleUtil.repeats(task.schedule)) {
|
|
683
|
+
const { nextRunAt: _done, ...rest } = task;
|
|
684
|
+
return { ...rest, enabled: false };
|
|
685
|
+
}
|
|
686
|
+
const next = ScheduleUtil.next(task.schedule, now);
|
|
687
|
+
return { ...task, nextRunAt: next?.toISOString() };
|
|
688
|
+
}
|
|
689
|
+
async begin(task, trigger, now) {
|
|
690
|
+
const run = { id: TaskUtil.newId("run"), taskId: task.id, trigger, status: "running", startedAt: now.toISOString(), cwd: task.cwd };
|
|
691
|
+
const started = trigger === "schedule" ? this.advance(task, now) : task;
|
|
692
|
+
await this.replace({ ...started, lastRunAt: run.startedAt, lastStatus: "running" });
|
|
693
|
+
await this.store.saveRun(run);
|
|
694
|
+
const active = { run, task: { ...task } };
|
|
695
|
+
this.active.set(task.id, active);
|
|
696
|
+
this.waiting.push(active);
|
|
697
|
+
this.pump();
|
|
698
|
+
return { ...run };
|
|
699
|
+
}
|
|
700
|
+
pump() {
|
|
701
|
+
while (this.working < this.options.parallel && this.waiting.length > 0 && !this.disposed) {
|
|
702
|
+
const active = this.waiting.shift();
|
|
703
|
+
this.working++;
|
|
704
|
+
this.execute(active).catch((error) => console.error(`${NAME}: ${message(error)}`)).finally(() => {
|
|
705
|
+
this.working--;
|
|
706
|
+
this.pump();
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
async execute(active) {
|
|
711
|
+
const { task, run } = active;
|
|
712
|
+
if (active.dropped) {
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
715
|
+
try {
|
|
716
|
+
const now = this.options.now();
|
|
717
|
+
const { sessionId } = await this.host.openSession({
|
|
718
|
+
cwd: task.cwd,
|
|
719
|
+
group: NAME,
|
|
720
|
+
appendSystemPrompt: TaskUtil.systemPrompt(task, now),
|
|
721
|
+
...task.model ? { model: task.model } : {},
|
|
722
|
+
...task.thinking ? { thinkingLevel: task.thinking } : {}
|
|
723
|
+
});
|
|
724
|
+
active.sessionId = sessionId;
|
|
725
|
+
await this.host.setSessionName(sessionId, `${task.name} · ${ScheduleUtil.clock(now)}`).catch(() => {
|
|
726
|
+
return;
|
|
727
|
+
});
|
|
728
|
+
const state = await this.host.getState(sessionId);
|
|
729
|
+
run.sessionFile = state.sessionFile;
|
|
730
|
+
await this.store.saveRun(run);
|
|
731
|
+
await this.host.prompt(sessionId, { clientMessageId: run.id, message: task.prompt });
|
|
732
|
+
await this.settled(active, state.messageCount);
|
|
733
|
+
const { text } = await this.host.getLastAssistantText(sessionId);
|
|
734
|
+
if (!text?.trim()) {
|
|
735
|
+
throw new Error("The run ended without an answer; the model may have failed. Open its conversation to see.");
|
|
736
|
+
}
|
|
737
|
+
await this.finish(active, { status: "success", summary: clip(text.trim()) });
|
|
738
|
+
} catch (error) {
|
|
739
|
+
await this.finish(active, { status: "error", error: message(error), ...error instanceof TimeoutError ? { reason: "timeout" } : {} });
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
async settled(active, before) {
|
|
743
|
+
const sessionId = active.sessionId;
|
|
744
|
+
const start = Date.now();
|
|
745
|
+
for (;; ) {
|
|
746
|
+
if (active.dropped || this.disposed) {
|
|
747
|
+
throw new Error("The task was removed while it ran.");
|
|
748
|
+
}
|
|
749
|
+
const state = await this.host.getState(sessionId);
|
|
750
|
+
if (!state.isStreaming && state.pendingMessageCount === 0 && state.messageCount > before) {
|
|
751
|
+
return;
|
|
752
|
+
}
|
|
753
|
+
if (Date.now() - start > this.options.timeoutMs) {
|
|
754
|
+
await this.host.abort(sessionId).catch(() => {
|
|
755
|
+
return;
|
|
756
|
+
});
|
|
757
|
+
throw new TimeoutError(`The run took longer than ${Math.round(this.options.timeoutMs / 60000)} minutes and was stopped.`);
|
|
758
|
+
}
|
|
759
|
+
await new Promise((resolve) => setTimeout(resolve, this.options.pollMs));
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
async finish(active, end) {
|
|
763
|
+
this.active.delete(active.task.id);
|
|
764
|
+
const sessionId = active.sessionId;
|
|
765
|
+
if (sessionId) {
|
|
766
|
+
this.lingering.add(sessionId);
|
|
767
|
+
}
|
|
768
|
+
if (active.dropped || this.disposed) {
|
|
769
|
+
await this.sweep();
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
const run = { ...active.run, ...end, endedAt: this.options.now().toISOString() };
|
|
773
|
+
await this.store.saveRun(run);
|
|
774
|
+
const current = this.tasks.find((task) => task.id === active.task.id);
|
|
775
|
+
if (current) {
|
|
776
|
+
const failed = run.status === "error";
|
|
777
|
+
await this.replace({
|
|
778
|
+
...current,
|
|
779
|
+
lastStatus: run.status,
|
|
780
|
+
runCount: current.runCount + 1,
|
|
781
|
+
failCount: current.failCount + (failed ? 1 : 0)
|
|
782
|
+
});
|
|
783
|
+
await this.store.finished({ run, taskName: current.name, notify: ScheduleUtil.shouldNotify(ScheduleUtil.notifyLevel(current), failed) });
|
|
784
|
+
}
|
|
785
|
+
await this.sweep();
|
|
786
|
+
}
|
|
787
|
+
async sweep() {
|
|
788
|
+
if (this.lingering.size === 0) {
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
const open = new Map((await this.host.listSessions()).map((info) => [info.sessionId, info]));
|
|
792
|
+
for (const sessionId of [...this.lingering]) {
|
|
793
|
+
const info = open.get(sessionId);
|
|
794
|
+
if (!info) {
|
|
795
|
+
this.lingering.delete(sessionId);
|
|
796
|
+
} else if (info.attached === 0 && !info.isStreaming) {
|
|
797
|
+
this.lingering.delete(sessionId);
|
|
798
|
+
await this.host.closeSession(sessionId).catch(() => {
|
|
799
|
+
return;
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
async reclaim(task, now) {
|
|
805
|
+
for (const run of await this.store.runs(task.id)) {
|
|
806
|
+
if (run.status === "running") {
|
|
807
|
+
await this.store.saveRun({
|
|
808
|
+
...run,
|
|
809
|
+
status: "error",
|
|
810
|
+
reason: "interrupted",
|
|
811
|
+
error: "The Ta service stopped before the run ended.",
|
|
812
|
+
endedAt: now.toISOString()
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
this.tasks = this.tasks.map((other) => other.id === task.id ? { ...other, lastStatus: "error", failCount: other.failCount + 1 } : other);
|
|
817
|
+
}
|
|
818
|
+
async miss(task, now) {
|
|
819
|
+
const run = {
|
|
820
|
+
id: TaskUtil.newId("run"),
|
|
821
|
+
taskId: task.id,
|
|
822
|
+
trigger: "schedule",
|
|
823
|
+
status: "missed",
|
|
824
|
+
startedAt: task.nextRunAt ?? now.toISOString(),
|
|
825
|
+
endedAt: now.toISOString(),
|
|
826
|
+
error: "The Ta service was not running at its time; run it by hand if it is still wanted.",
|
|
827
|
+
cwd: task.cwd
|
|
828
|
+
};
|
|
829
|
+
await this.store.saveRun(run);
|
|
830
|
+
const { nextRunAt: _gone, ...rest } = task;
|
|
831
|
+
this.tasks = this.tasks.map((other) => other.id === task.id ? { ...rest, enabled: false, lastStatus: "missed", lastRunAt: run.startedAt } : other);
|
|
832
|
+
await this.store.finished({ run, taskName: task.name, notify: ScheduleUtil.notifyLevel(task) !== "never" });
|
|
833
|
+
}
|
|
834
|
+
async drop(tasks) {
|
|
835
|
+
const ids = new Set(tasks.map((task) => task.id));
|
|
836
|
+
for (const id of ids) {
|
|
837
|
+
const active = this.active.get(id);
|
|
838
|
+
if (active) {
|
|
839
|
+
active.dropped = true;
|
|
840
|
+
if (active.sessionId) {
|
|
841
|
+
await this.host.abort(active.sessionId).catch(() => {
|
|
842
|
+
return;
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
await this.store.removeRuns(id);
|
|
847
|
+
}
|
|
848
|
+
await this.save(this.tasks.filter((task) => !ids.has(task.id)));
|
|
849
|
+
}
|
|
850
|
+
replace(task) {
|
|
851
|
+
return this.save(this.tasks.map((other) => other.id === task.id ? task : other));
|
|
852
|
+
}
|
|
853
|
+
async save(tasks) {
|
|
854
|
+
this.tasks = tasks;
|
|
855
|
+
await this.store.saveTasks(tasks);
|
|
856
|
+
this.arm();
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
class TimeoutError extends Error {
|
|
861
|
+
}
|
|
862
|
+
function clip(text) {
|
|
863
|
+
return text.length > Limits.SUMMARY_MAX ? `${text.slice(0, Limits.SUMMARY_MAX - 1)}…` : text;
|
|
864
|
+
}
|
|
865
|
+
function message(error) {
|
|
866
|
+
return error instanceof Error ? error.message : String(error);
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
// web-src/host.ts
|
|
870
|
+
async function activate(host) {
|
|
871
|
+
const scheduler = new CronScheduler(host);
|
|
872
|
+
await scheduler.start();
|
|
873
|
+
return scheduler;
|
|
874
|
+
}
|
|
875
|
+
export {
|
|
876
|
+
activate as default
|
|
877
|
+
};
|