@celljs/ta 4.11.0 → 4.13.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 +2 -2
- package/README.md +2 -2
- package/dist/cli.mjs +1006 -164
- package/dist/gateway.mjs +161 -2
- package/dist/pi/CHANGELOG.md +15 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/README.en.md +1 -1
- package/dist/pi/packages/ta-agents/README.md +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +266 -25
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +7 -2
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +5 -2
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +8 -3
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +12 -4
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +72 -2
- package/dist/pi/packages/ta-agents/lib/agent-session.js +183 -18
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +16 -2
- package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +45 -4
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +17 -1
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +51 -3
- package/dist/pi/packages/ta-agents/lib/extension.js +7 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +12 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +12 -0
- package/dist/pi/packages/ta-agents/package.json +1 -1
- package/dist/pi/packages/ta-bots/extension/index.mjs +51 -0
- package/dist/pi/packages/ta-bots/host/index.mjs +157 -0
- package/dist/pi/packages/ta-bots/package.json +7 -2
- package/dist/pi/packages/ta-changes/extension/index.mjs +51 -0
- package/dist/pi/packages/ta-changes/package.json +8 -2
- package/dist/pi/packages/ta-channels/README.en.md +3 -1
- package/dist/pi/packages/ta-channels/README.md +3 -1
- package/dist/pi/packages/ta-channels/extension/index.mjs +55 -2
- package/dist/pi/packages/ta-channels/host/index.mjs +268 -8
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts +25 -0
- package/dist/pi/packages/ta-channels/lib/channels-util.js +8 -2
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-channels/lib/i18n.js +2 -0
- package/dist/pi/packages/ta-channels/lib/room.d.ts +0 -4
- package/dist/pi/packages/ta-channels/lib/room.js +31 -5
- package/dist/pi/packages/ta-channels/lib/sidebar.js +31 -13
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +10 -13
- package/dist/pi/packages/ta-channels/lib/team-view.d.ts +19 -0
- package/dist/pi/packages/ta-channels/lib/team-view.js +45 -0
- package/dist/pi/packages/ta-channels/lib/team.d.ts +20 -4
- package/dist/pi/packages/ta-channels/lib/team.js +87 -6
- package/dist/pi/packages/ta-channels/lib/views.d.ts +12 -0
- package/dist/pi/packages/ta-channels/lib/views.js +19 -0
- package/dist/pi/packages/ta-channels/package.json +26 -2
- package/dist/pi/packages/ta-channels/web/index.js +191 -36
- package/dist/pi/packages/ta-computer-use/package.json +1 -1
- package/dist/pi/packages/ta-cron/README.en.md +2 -2
- package/dist/pi/packages/ta-cron/README.md +2 -2
- package/dist/pi/packages/ta-cron/extension/index.mjs +91 -257
- package/dist/pi/packages/ta-cron/host/index.mjs +9 -0
- package/dist/pi/packages/ta-cron/lib/chat-task.d.ts +16 -15
- package/dist/pi/packages/ta-cron/lib/chat-task.js +45 -36
- package/dist/pi/packages/ta-cron/lib/extension.js +11 -7
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +5 -7
- package/dist/pi/packages/ta-cron/lib/i18n.js +10 -14
- package/dist/pi/packages/ta-cron/lib/index.js +0 -2
- package/dist/pi/packages/ta-cron/lib/page.d.ts +5 -0
- package/dist/pi/packages/ta-cron/lib/page.js +24 -0
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +8 -0
- package/dist/pi/packages/ta-cron/lib/task-change.d.ts +11 -0
- package/dist/pi/packages/ta-cron/lib/task-change.js +43 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +3 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.js +2 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +5 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +13 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +26 -2
- package/dist/pi/packages/ta-cron/package.json +10 -2
- package/dist/pi/packages/ta-cron/web/index.js +607 -784
- package/dist/pi/packages/ta-extensions/README.en.md +1 -2
- package/dist/pi/packages/ta-extensions/README.md +1 -2
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +0 -4
- package/dist/pi/packages/ta-extensions/lib/i18n.js +2 -10
- package/dist/pi/packages/ta-extensions/lib/index.js +0 -2
- package/dist/pi/packages/ta-extensions/package.json +10 -2
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +16 -11
- package/dist/pi/packages/ta-extensions/web/index.js +176 -97
- package/dist/pi/packages/ta-games/package.json +8 -2
- package/dist/pi/packages/ta-glance/README.en.md +1 -0
- package/dist/pi/packages/ta-glance/README.md +1 -0
- package/dist/pi/packages/ta-glance/extension/index.mjs +425 -3
- package/dist/pi/packages/ta-glance/lib/card.js +42 -15
- package/dist/pi/packages/ta-glance/lib/extension.d.ts +3 -0
- package/dist/pi/packages/ta-glance/lib/extension.js +10 -0
- package/dist/pi/packages/ta-glance/lib/glance-ask.d.ts +15 -0
- package/dist/pi/packages/ta-glance/lib/glance-ask.js +97 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +3 -3
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-glance/lib/glance-protocol.js +3 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.d.ts +7 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +45 -9
- package/dist/pi/packages/ta-glance/lib/i18n.d.ts +5 -0
- package/dist/pi/packages/ta-glance/lib/i18n.js +9 -0
- package/dist/pi/packages/ta-glance/lib/index.js +4 -1
- package/dist/pi/packages/ta-glance/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/style.js +187 -102
- package/dist/pi/packages/ta-glance/package.json +1 -1
- package/dist/pi/packages/ta-glance/web/index.js +272 -124
- package/dist/pi/packages/ta-initiative/README.en.md +66 -0
- package/dist/pi/packages/ta-initiative/README.md +66 -0
- package/dist/pi/packages/ta-initiative/extension/index.mjs +720 -0
- package/dist/pi/packages/ta-initiative/host/index.mjs +1169 -0
- package/dist/pi/packages/ta-initiative/lib/chat-kinds.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/chat-kinds.js +17 -0
- package/dist/pi/packages/ta-initiative/lib/chat-proposals.d.ts +28 -0
- package/dist/pi/packages/ta-initiative/lib/chat-proposals.js +79 -0
- package/dist/pi/packages/ta-initiative/lib/conversation.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/conversation.js +27 -0
- package/dist/pi/packages/ta-initiative/lib/cron-proposals.d.ts +23 -0
- package/dist/pi/packages/ta-initiative/lib/cron-proposals.js +94 -0
- package/dist/pi/packages/ta-initiative/lib/event-proposals.d.ts +13 -0
- package/dist/pi/packages/ta-initiative/lib/event-proposals.js +76 -0
- package/dist/pi/packages/ta-initiative/lib/extension.d.ts +30 -0
- package/dist/pi/packages/ta-initiative/lib/extension.js +238 -0
- package/dist/pi/packages/ta-initiative/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/host.js +11 -0
- package/dist/pi/packages/ta-initiative/lib/i18n.d.ts +79 -0
- package/dist/pi/packages/ta-initiative/lib/i18n.js +159 -0
- package/dist/pi/packages/ta-initiative/lib/inbox-util.d.ts +19 -0
- package/dist/pi/packages/ta-initiative/lib/inbox-util.js +45 -0
- package/dist/pi/packages/ta-initiative/lib/inbox.d.ts +23 -0
- package/dist/pi/packages/ta-initiative/lib/inbox.js +142 -0
- package/dist/pi/packages/ta-initiative/lib/index.d.ts +10 -0
- package/dist/pi/packages/ta-initiative/lib/index.js +121 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-protocol.d.ts +320 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-protocol.js +96 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-service.d.ts +37 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-service.js +104 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-store.d.ts +44 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-store.js +112 -0
- package/dist/pi/packages/ta-initiative/lib/level-util.d.ts +22 -0
- package/dist/pi/packages/ta-initiative/lib/level-util.js +86 -0
- package/dist/pi/packages/ta-initiative/lib/material-util.d.ts +34 -0
- package/dist/pi/packages/ta-initiative/lib/material-util.js +155 -0
- package/dist/pi/packages/ta-initiative/lib/notices.d.ts +13 -0
- package/dist/pi/packages/ta-initiative/lib/notices.js +65 -0
- package/dist/pi/packages/ta-initiative/lib/notify-util.d.ts +25 -0
- package/dist/pi/packages/ta-initiative/lib/notify-util.js +60 -0
- package/dist/pi/packages/ta-initiative/lib/pace-util.d.ts +21 -0
- package/dist/pi/packages/ta-initiative/lib/pace-util.js +60 -0
- package/dist/pi/packages/ta-initiative/lib/page-initiative.d.ts +9 -0
- package/dist/pi/packages/ta-initiative/lib/page-initiative.js +40 -0
- package/dist/pi/packages/ta-initiative/lib/proposal-book.d.ts +61 -0
- package/dist/pi/packages/ta-initiative/lib/proposal-book.js +397 -0
- package/dist/pi/packages/ta-initiative/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-initiative/lib/react.js +16 -0
- package/dist/pi/packages/ta-initiative/lib/review-service.d.ts +32 -0
- package/dist/pi/packages/ta-initiative/lib/review-service.js +155 -0
- package/dist/pi/packages/ta-initiative/lib/server-texts.d.ts +7 -0
- package/dist/pi/packages/ta-initiative/lib/server-texts.js +17 -0
- package/dist/pi/packages/ta-initiative/lib/settings.d.ts +10 -0
- package/dist/pi/packages/ta-initiative/lib/settings.js +226 -0
- package/dist/pi/packages/ta-initiative/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/style.js +56 -0
- package/dist/pi/packages/ta-initiative/lib/tool.d.ts +106 -0
- package/dist/pi/packages/ta-initiative/lib/tool.js +98 -0
- package/dist/pi/packages/ta-initiative/package.json +63 -0
- package/dist/pi/packages/ta-initiative/web/index.js +1226 -0
- package/dist/pi/packages/ta-launcher/README.en.md +2 -1
- package/dist/pi/packages/ta-launcher/README.md +2 -1
- package/dist/pi/packages/ta-launcher/lib/i18n.d.ts +2 -0
- package/dist/pi/packages/ta-launcher/lib/i18n.js +4 -0
- package/dist/pi/packages/ta-launcher/lib/launcher-view.js +32 -0
- package/dist/pi/packages/ta-launcher/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-launcher/lib/style.js +11 -0
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-launcher/web/index.js +58 -1
- package/dist/pi/packages/ta-manual/lib/pictures-b.js +29 -0
- package/dist/pi/packages/ta-manual/lib/pictures-c.d.ts +2 -0
- package/dist/pi/packages/ta-manual/lib/pictures-c.js +160 -0
- package/dist/pi/packages/ta-manual/lib/pictures.js +2 -1
- package/dist/pi/packages/ta-manual/lib/topics.d.ts +5 -0
- package/dist/pi/packages/ta-manual/lib/topics.js +155 -9
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +54 -8
- package/dist/pi/packages/ta-manual/web/index.js +750 -10
- package/dist/pi/packages/ta-moments/README.en.md +29 -0
- package/dist/pi/packages/ta-moments/README.md +29 -0
- package/dist/pi/packages/ta-moments/extension/index.mjs +1766 -0
- package/dist/pi/packages/ta-moments/host/index.mjs +2394 -0
- package/dist/pi/packages/ta-moments/lib/brief-util.d.ts +30 -0
- package/dist/pi/packages/ta-moments/lib/brief-util.js +92 -0
- package/dist/pi/packages/ta-moments/lib/context.d.ts +18 -0
- package/dist/pi/packages/ta-moments/lib/context.js +35 -0
- package/dist/pi/packages/ta-moments/lib/draft-card.d.ts +6 -0
- package/dist/pi/packages/ta-moments/lib/draft-card.js +60 -0
- package/dist/pi/packages/ta-moments/lib/editor.d.ts +16 -0
- package/dist/pi/packages/ta-moments/lib/editor.js +126 -0
- package/dist/pi/packages/ta-moments/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-moments/lib/extension.js +136 -0
- package/dist/pi/packages/ta-moments/lib/friends.d.ts +13 -0
- package/dist/pi/packages/ta-moments/lib/friends.js +27 -0
- package/dist/pi/packages/ta-moments/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-moments/lib/host.js +11 -0
- package/dist/pi/packages/ta-moments/lib/i18n.d.ts +92 -0
- package/dist/pi/packages/ta-moments/lib/i18n.js +201 -0
- package/dist/pi/packages/ta-moments/lib/image-util.d.ts +18 -0
- package/dist/pi/packages/ta-moments/lib/image-util.js +71 -0
- package/dist/pi/packages/ta-moments/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-moments/lib/index.js +50 -0
- package/dist/pi/packages/ta-moments/lib/moments-host.d.ts +133 -0
- package/dist/pi/packages/ta-moments/lib/moments-host.js +821 -0
- package/dist/pi/packages/ta-moments/lib/moments-protocol.d.ts +334 -0
- package/dist/pi/packages/ta-moments/lib/moments-protocol.js +99 -0
- package/dist/pi/packages/ta-moments/lib/page.d.ts +7 -0
- package/dist/pi/packages/ta-moments/lib/page.js +307 -0
- package/dist/pi/packages/ta-moments/lib/post-util.d.ts +31 -0
- package/dist/pi/packages/ta-moments/lib/post-util.js +205 -0
- package/dist/pi/packages/ta-moments/lib/server-texts.d.ts +29 -0
- package/dist/pi/packages/ta-moments/lib/server-texts.js +104 -0
- package/dist/pi/packages/ta-moments/lib/store.d.ts +33 -0
- package/dist/pi/packages/ta-moments/lib/store.js +108 -0
- package/dist/pi/packages/ta-moments/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-moments/lib/style.js +155 -0
- package/dist/pi/packages/ta-moments/lib/talk-host.d.ts +112 -0
- package/dist/pi/packages/ta-moments/lib/talk-host.js +582 -0
- package/dist/pi/packages/ta-moments/lib/talk-util.d.ts +26 -0
- package/dist/pi/packages/ta-moments/lib/talk-util.js +145 -0
- package/dist/pi/packages/ta-moments/lib/tool.d.ts +48 -0
- package/dist/pi/packages/ta-moments/lib/tool.js +56 -0
- package/dist/pi/packages/ta-moments/package.json +61 -0
- package/dist/pi/packages/ta-moments/web/index.js +1987 -0
- package/dist/pi/packages/ta-nearby/README.en.md +33 -0
- package/dist/pi/packages/ta-nearby/README.md +33 -0
- package/dist/pi/packages/ta-nearby/extension/index.mjs +389 -0
- package/dist/pi/packages/ta-nearby/host/index.mjs +1859 -0
- package/dist/pi/packages/ta-nearby/lib/extension.d.ts +27 -0
- package/dist/pi/packages/ta-nearby/lib/extension.js +190 -0
- package/dist/pi/packages/ta-nearby/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-nearby/lib/host.js +20 -0
- package/dist/pi/packages/ta-nearby/lib/i18n.d.ts +92 -0
- package/dist/pi/packages/ta-nearby/lib/i18n.js +183 -0
- package/dist/pi/packages/ta-nearby/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-nearby/lib/index.js +38 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-crypto.d.ts +31 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-crypto.js +59 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet.d.ts +35 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet.js +93 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-net.d.ts +59 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-net.js +253 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-protocol.d.ts +274 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-protocol.js +31 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service.d.ts +199 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service.js +1012 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.d.ts +50 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.js +167 -0
- package/dist/pi/packages/ta-nearby/lib/page.d.ts +52 -0
- package/dist/pi/packages/ta-nearby/lib/page.js +588 -0
- package/dist/pi/packages/ta-nearby/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-nearby/lib/react.js +8 -0
- package/dist/pi/packages/ta-nearby/lib/server-texts.d.ts +45 -0
- package/dist/pi/packages/ta-nearby/lib/server-texts.js +148 -0
- package/dist/pi/packages/ta-nearby/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-nearby/lib/style.js +92 -0
- package/dist/pi/packages/ta-nearby/package.json +65 -0
- package/dist/pi/packages/ta-nearby/web/index.js +1055 -0
- package/dist/pi/packages/ta-notify/README.en.md +3 -1
- package/dist/pi/packages/ta-notify/README.md +3 -1
- package/dist/pi/packages/ta-notify/extension/index.mjs +64 -0
- package/dist/pi/packages/ta-notify/host/index.mjs +24 -1
- package/dist/pi/packages/ta-notify/lib/extension.d.ts +4 -1
- package/dist/pi/packages/ta-notify/lib/extension.js +20 -1
- package/dist/pi/packages/ta-notify/lib/notify-protocol.d.ts +23 -3
- package/dist/pi/packages/ta-notify/lib/notify-service.d.ts +4 -2
- package/dist/pi/packages/ta-notify/lib/notify-service.js +27 -2
- package/dist/pi/packages/ta-notify/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-notify/lib/style.js +1 -1
- package/dist/pi/packages/ta-notify/lib/watcher.js +2 -1
- package/dist/pi/packages/ta-notify/package.json +7 -2
- package/dist/pi/packages/ta-notify/web/index.js +3 -2
- package/dist/pi/packages/ta-recall/README.en.md +15 -6
- package/dist/pi/packages/ta-recall/README.md +15 -6
- package/dist/pi/packages/ta-recall/extension/index.mjs +291 -134
- package/dist/pi/packages/ta-recall/host/index.mjs +451 -116
- package/dist/pi/packages/ta-recall/lib/block-util.d.ts +11 -0
- package/dist/pi/packages/ta-recall/lib/block-util.js +43 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.d.ts +25 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.js +38 -1
- package/dist/pi/packages/ta-recall/lib/composer.d.ts +3 -2
- package/dist/pi/packages/ta-recall/lib/composer.js +9 -8
- package/dist/pi/packages/ta-recall/lib/conversations.js +6 -0
- package/dist/pi/packages/ta-recall/lib/extension-util.d.ts +21 -0
- package/dist/pi/packages/ta-recall/lib/extension-util.js +104 -0
- package/dist/pi/packages/ta-recall/lib/extension.d.ts +3 -3
- package/dist/pi/packages/ta-recall/lib/extension.js +35 -26
- package/dist/pi/packages/ta-recall/lib/i18n.d.ts +18 -10
- package/dist/pi/packages/ta-recall/lib/i18n.js +40 -24
- package/dist/pi/packages/ta-recall/lib/index.d.ts +2 -2
- package/dist/pi/packages/ta-recall/lib/index.js +5 -4
- package/dist/pi/packages/ta-recall/lib/keep-card.d.ts +10 -0
- package/dist/pi/packages/ta-recall/lib/keep-card.js +83 -0
- package/dist/pi/packages/ta-recall/lib/keep-util.d.ts +15 -0
- package/dist/pi/packages/ta-recall/lib/keep-util.js +55 -0
- package/dist/pi/packages/ta-recall/lib/recall-protocol.d.ts +92 -18
- package/dist/pi/packages/ta-recall/lib/recall-protocol.js +19 -9
- package/dist/pi/packages/ta-recall/lib/recall-service.d.ts +16 -6
- package/dist/pi/packages/ta-recall/lib/recall-service.js +101 -11
- package/dist/pi/packages/ta-recall/lib/requests-util.d.ts +6 -0
- package/dist/pi/packages/ta-recall/lib/requests-util.js +37 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.d.ts +2 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.js +5 -0
- package/dist/pi/packages/ta-recall/lib/settings.d.ts +1 -1
- package/dist/pi/packages/ta-recall/lib/settings.js +1 -1
- package/dist/pi/packages/ta-recall/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-recall/lib/style.js +2 -2
- package/dist/pi/packages/ta-recall/lib/tool-line.d.ts +2 -2
- package/dist/pi/packages/ta-recall/lib/tool-line.js +10 -5
- package/dist/pi/packages/ta-recall/lib/tool.d.ts +14 -5
- package/dist/pi/packages/ta-recall/lib/tool.js +29 -17
- package/dist/pi/packages/ta-recall/package.json +13 -5
- package/dist/pi/packages/ta-recall/web/index.js +397 -153
- package/dist/pi/packages/ta-rooms/README.en.md +14 -5
- package/dist/pi/packages/ta-rooms/README.md +14 -5
- package/dist/pi/packages/ta-rooms/extension/index.mjs +526 -0
- package/dist/pi/packages/ta-rooms/host/index.mjs +1734 -0
- package/dist/pi/packages/ta-rooms/lib/agents-view.d.ts +25 -0
- package/dist/pi/packages/ta-rooms/lib/agents-view.js +128 -0
- package/dist/pi/packages/ta-rooms/lib/dialogs.js +5 -0
- package/dist/pi/packages/ta-rooms/lib/double-agents.d.ts +26 -0
- package/dist/pi/packages/ta-rooms/lib/double-agents.js +84 -0
- package/dist/pi/packages/ta-rooms/lib/double-grants.d.ts +22 -0
- package/dist/pi/packages/ta-rooms/lib/double-grants.js +140 -0
- package/dist/pi/packages/ta-rooms/lib/double-host.d.ts +117 -0
- package/dist/pi/packages/ta-rooms/lib/double-host.js +476 -0
- package/dist/pi/packages/ta-rooms/lib/double-i18n.d.ts +105 -0
- package/dist/pi/packages/ta-rooms/lib/double-i18n.js +212 -0
- package/dist/pi/packages/ta-rooms/lib/double-protocol.d.ts +258 -0
- package/dist/pi/packages/ta-rooms/lib/double-protocol.js +128 -0
- package/dist/pi/packages/ta-rooms/lib/double-tasks.d.ts +82 -0
- package/dist/pi/packages/ta-rooms/lib/double-tasks.js +527 -0
- package/dist/pi/packages/ta-rooms/lib/double-user.d.ts +19 -0
- package/dist/pi/packages/ta-rooms/lib/double-user.js +124 -0
- package/dist/pi/packages/ta-rooms/lib/double-util.d.ts +131 -0
- package/dist/pi/packages/ta-rooms/lib/double-util.js +238 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-store.d.ts +48 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-store.js +151 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-view.d.ts +34 -0
- package/dist/pi/packages/ta-rooms/lib/doubles-view.js +228 -0
- package/dist/pi/packages/ta-rooms/lib/extension.d.ts +33 -0
- package/dist/pi/packages/ta-rooms/lib/extension.js +203 -0
- package/dist/pi/packages/ta-rooms/lib/friend-notices.d.ts +12 -0
- package/dist/pi/packages/ta-rooms/lib/friend-notices.js +47 -0
- package/dist/pi/packages/ta-rooms/lib/friends-view.d.ts +20 -0
- package/dist/pi/packages/ta-rooms/lib/friends-view.js +224 -0
- package/dist/pi/packages/ta-rooms/lib/host.d.ts +8 -0
- package/dist/pi/packages/ta-rooms/lib/host.js +25 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +27 -2
- package/dist/pi/packages/ta-rooms/lib/i18n.js +68 -18
- package/dist/pi/packages/ta-rooms/lib/index.js +41 -3
- package/dist/pi/packages/ta-rooms/lib/members-view.js +44 -3
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +97 -10
- package/dist/pi/packages/ta-rooms/lib/page.js +223 -45
- package/dist/pi/packages/ta-rooms/lib/room-view.d.ts +2 -4
- package/dist/pi/packages/ta-rooms/lib/room-view.js +57 -35
- package/dist/pi/packages/ta-rooms/lib/rooms-home.d.ts +32 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-home.js +141 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-page.d.ts +8 -2
- package/dist/pi/packages/ta-rooms/lib/rooms-page.js +68 -36
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-rooms/lib/style.js +126 -50
- package/dist/pi/packages/ta-rooms/lib/tasks-view.d.ts +41 -0
- package/dist/pi/packages/ta-rooms/lib/tasks-view.js +228 -0
- package/dist/pi/packages/ta-rooms/package.json +19 -4
- package/dist/pi/packages/ta-rooms/web/index.js +2585 -470
- package/dist/pi/packages/ta-share/README.en.md +1 -1
- package/dist/pi/packages/ta-share/README.md +1 -1
- package/dist/pi/packages/ta-share/extension/index.mjs +51 -0
- package/dist/pi/packages/ta-share/lib/i18n.js +6 -6
- package/dist/pi/packages/ta-share/lib/share-dialog.js +1 -1
- package/dist/pi/packages/ta-share/lib/shares-page.js +35 -11
- package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-share/lib/style.js +14 -10
- package/dist/pi/packages/ta-share/package.json +10 -2
- package/dist/pi/packages/ta-share/web/index.js +56 -31
- package/dist/pi/packages/ta-sync/README.en.md +55 -0
- package/dist/pi/packages/ta-sync/README.md +55 -0
- package/dist/pi/packages/ta-sync/host/index.mjs +3763 -0
- package/dist/pi/packages/ta-sync/lib/host.d.ts +10 -0
- package/dist/pi/packages/ta-sync/lib/host.js +94 -0
- package/dist/pi/packages/ta-sync/lib/i18n.d.ts +98 -0
- package/dist/pi/packages/ta-sync/lib/i18n.js +202 -0
- package/dist/pi/packages/ta-sync/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-sync/lib/index.js +115 -0
- package/dist/pi/packages/ta-sync/lib/migrate-archive.d.ts +88 -0
- package/dist/pi/packages/ta-sync/lib/migrate-archive.js +439 -0
- package/dist/pi/packages/ta-sync/lib/migrate-frames.d.ts +77 -0
- package/dist/pi/packages/ta-sync/lib/migrate-frames.js +210 -0
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.d.ts +99 -0
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.js +210 -0
- package/dist/pi/packages/ta-sync/lib/migrate-net.d.ts +51 -0
- package/dist/pi/packages/ta-sync/lib/migrate-net.js +170 -0
- package/dist/pi/packages/ta-sync/lib/migrate-protocol.d.ts +126 -0
- package/dist/pi/packages/ta-sync/lib/migrate-protocol.js +43 -0
- package/dist/pi/packages/ta-sync/lib/migrate-service.d.ts +86 -0
- package/dist/pi/packages/ta-sync/lib/migrate-service.js +521 -0
- package/dist/pi/packages/ta-sync/lib/move-panel.d.ts +16 -0
- package/dist/pi/packages/ta-sync/lib/move-panel.js +320 -0
- package/dist/pi/packages/ta-sync/lib/move-store.d.ts +15 -0
- package/dist/pi/packages/ta-sync/lib/move-store.js +42 -0
- package/dist/pi/packages/ta-sync/lib/panel.d.ts +28 -0
- package/dist/pi/packages/ta-sync/lib/panel.js +305 -0
- package/dist/pi/packages/ta-sync/lib/pictures.d.ts +22 -0
- package/dist/pi/packages/ta-sync/lib/pictures.js +92 -0
- package/dist/pi/packages/ta-sync/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-sync/lib/react.js +16 -0
- package/dist/pi/packages/ta-sync/lib/server-texts.d.ts +29 -0
- package/dist/pi/packages/ta-sync/lib/server-texts.js +111 -0
- package/dist/pi/packages/ta-sync/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-sync/lib/style.js +108 -0
- package/dist/pi/packages/ta-sync/lib/sync-codec.d.ts +16 -0
- package/dist/pi/packages/ta-sync/lib/sync-codec.js +61 -0
- package/dist/pi/packages/ta-sync/lib/sync-engine.d.ts +57 -0
- package/dist/pi/packages/ta-sync/lib/sync-engine.js +203 -0
- package/dist/pi/packages/ta-sync/lib/sync-folder.d.ts +156 -0
- package/dist/pi/packages/ta-sync/lib/sync-folder.js +385 -0
- package/dist/pi/packages/ta-sync/lib/sync-identity.d.ts +60 -0
- package/dist/pi/packages/ta-sync/lib/sync-identity.js +201 -0
- package/dist/pi/packages/ta-sync/lib/sync-items.d.ts +104 -0
- package/dist/pi/packages/ta-sync/lib/sync-items.js +426 -0
- package/dist/pi/packages/ta-sync/lib/sync-merge.d.ts +42 -0
- package/dist/pi/packages/ta-sync/lib/sync-merge.js +109 -0
- package/dist/pi/packages/ta-sync/lib/sync-protocol.d.ts +134 -0
- package/dist/pi/packages/ta-sync/lib/sync-protocol.js +72 -0
- package/dist/pi/packages/ta-sync/lib/sync-service.d.ts +128 -0
- package/dist/pi/packages/ta-sync/lib/sync-service.js +679 -0
- package/dist/pi/packages/ta-sync/lib/sync-store.d.ts +15 -0
- package/dist/pi/packages/ta-sync/lib/sync-store.js +41 -0
- package/dist/pi/packages/ta-sync/package.json +57 -0
- package/dist/pi/packages/ta-sync/web/index.js +2018 -0
- package/dist/pi/packages/ta-sync-cloud/README.en.md +31 -0
- package/dist/pi/packages/ta-sync-cloud/README.md +31 -0
- package/dist/pi/packages/ta-sync-cloud/host/index.mjs +810 -0
- package/dist/pi/packages/ta-sync-cloud/lib/git-store.d.ts +90 -0
- package/dist/pi/packages/ta-sync-cloud/lib/git-store.js +393 -0
- package/dist/pi/packages/ta-sync-cloud/lib/host.d.ts +13 -0
- package/dist/pi/packages/ta-sync-cloud/lib/host.js +112 -0
- package/dist/pi/packages/ta-sync-cloud/lib/s3-store.d.ts +72 -0
- package/dist/pi/packages/ta-sync-cloud/lib/s3-store.js +206 -0
- package/dist/pi/packages/ta-sync-cloud/lib/store-util.d.ts +17 -0
- package/dist/pi/packages/ta-sync-cloud/lib/store-util.js +69 -0
- package/dist/pi/packages/ta-sync-cloud/lib/webdav-store.d.ts +40 -0
- package/dist/pi/packages/ta-sync-cloud/lib/webdav-store.js +144 -0
- package/dist/pi/packages/ta-sync-cloud/package.json +63 -0
- package/dist/pi/packages/ta-team/README.en.md +28 -0
- package/dist/pi/packages/ta-team/README.md +28 -0
- package/dist/pi/packages/ta-team/extension/index.mjs +264 -0
- package/dist/pi/packages/ta-team/host/index.mjs +2100 -0
- package/dist/pi/packages/ta-team/lib/dialogs.d.ts +13 -0
- package/dist/pi/packages/ta-team/lib/dialogs.js +335 -0
- package/dist/pi/packages/ta-team/lib/extension.d.ts +21 -0
- package/dist/pi/packages/ta-team/lib/extension.js +123 -0
- package/dist/pi/packages/ta-team/lib/host.d.ts +13 -0
- package/dist/pi/packages/ta-team/lib/host.js +45 -0
- package/dist/pi/packages/ta-team/lib/i18n.d.ts +200 -0
- package/dist/pi/packages/ta-team/lib/i18n.js +401 -0
- package/dist/pi/packages/ta-team/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/index.js +67 -0
- package/dist/pi/packages/ta-team/lib/join.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/join.js +48 -0
- package/dist/pi/packages/ta-team/lib/member-dialog.d.ts +2 -0
- package/dist/pi/packages/ta-team/lib/member-dialog.js +121 -0
- package/dist/pi/packages/ta-team/lib/members-tab.d.ts +11 -0
- package/dist/pi/packages/ta-team/lib/members-tab.js +133 -0
- package/dist/pi/packages/ta-team/lib/page.d.ts +42 -0
- package/dist/pi/packages/ta-team/lib/page.js +142 -0
- package/dist/pi/packages/ta-team/lib/parts.d.ts +39 -0
- package/dist/pi/packages/ta-team/lib/parts.js +47 -0
- package/dist/pi/packages/ta-team/lib/policy.d.ts +37 -0
- package/dist/pi/packages/ta-team/lib/policy.js +215 -0
- package/dist/pi/packages/ta-team/lib/protocol.d.ts +285 -0
- package/dist/pi/packages/ta-team/lib/protocol.js +119 -0
- package/dist/pi/packages/ta-team/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/react.js +8 -0
- package/dist/pi/packages/ta-team/lib/record-tab.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/record-tab.js +90 -0
- package/dist/pi/packages/ta-team/lib/remote.d.ts +31 -0
- package/dist/pi/packages/ta-team/lib/remote.js +128 -0
- package/dist/pi/packages/ta-team/lib/roles-tab.d.ts +9 -0
- package/dist/pi/packages/ta-team/lib/roles-tab.js +76 -0
- package/dist/pi/packages/ta-team/lib/seal.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/seal.js +75 -0
- package/dist/pi/packages/ta-team/lib/shared-home.d.ts +23 -0
- package/dist/pi/packages/ta-team/lib/shared-home.js +123 -0
- package/dist/pi/packages/ta-team/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-team/lib/style.js +99 -0
- package/dist/pi/packages/ta-team/lib/team-admin.d.ts +31 -0
- package/dist/pi/packages/ta-team/lib/team-admin.js +140 -0
- package/dist/pi/packages/ta-team/lib/team-audit.d.ts +35 -0
- package/dist/pi/packages/ta-team/lib/team-audit.js +152 -0
- package/dist/pi/packages/ta-team/lib/team-core.d.ts +58 -0
- package/dist/pi/packages/ta-team/lib/team-core.js +115 -0
- package/dist/pi/packages/ta-team/lib/team-error.d.ts +4 -0
- package/dist/pi/packages/ta-team/lib/team-error.js +8 -0
- package/dist/pi/packages/ta-team/lib/team-expiry.d.ts +15 -0
- package/dist/pi/packages/ta-team/lib/team-expiry.js +67 -0
- package/dist/pi/packages/ta-team/lib/team-files.d.ts +21 -0
- package/dist/pi/packages/ta-team/lib/team-files.js +119 -0
- package/dist/pi/packages/ta-team/lib/team-inbox.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/team-inbox.js +32 -0
- package/dist/pi/packages/ta-team/lib/team-invites.d.ts +46 -0
- package/dist/pi/packages/ta-team/lib/team-invites.js +204 -0
- package/dist/pi/packages/ta-team/lib/team-page.d.ts +6 -0
- package/dist/pi/packages/ta-team/lib/team-page.js +41 -0
- package/dist/pi/packages/ta-team/lib/team-paths.d.ts +15 -0
- package/dist/pi/packages/ta-team/lib/team-paths.js +70 -0
- package/dist/pi/packages/ta-team/lib/team-people.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/team-people.js +106 -0
- package/dist/pi/packages/ta-team/lib/team-requests.d.ts +24 -0
- package/dist/pi/packages/ta-team/lib/team-requests.js +126 -0
- package/dist/pi/packages/ta-team/lib/team-runs.d.ts +38 -0
- package/dist/pi/packages/ta-team/lib/team-runs.js +136 -0
- package/dist/pi/packages/ta-team/lib/team-service.d.ts +32 -0
- package/dist/pi/packages/ta-team/lib/team-service.js +58 -0
- package/dist/pi/packages/ta-team/lib/team-shares.d.ts +52 -0
- package/dist/pi/packages/ta-team/lib/team-shares.js +145 -0
- package/dist/pi/packages/ta-team/lib/team-waits.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/team-waits.js +42 -0
- package/dist/pi/packages/ta-team/lib/team-watch.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/team-watch.js +136 -0
- package/dist/pi/packages/ta-team/package.json +68 -0
- package/dist/pi/packages/ta-team/web/index.js +2741 -0
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +157 -0
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-D9uU0Tx2.js → abnfDiagram-S7VZAUFO-DJMZKA5d.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-f7Nm7EIo.js → architecture-WOLXFQ4H-DwZ8A2Bp.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-DSAqlcms.js → architectureDiagram-YGSQEFNW-DPezb7-w.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-C0lPIW9g.js → blockDiagram-APKKGZFW-SrFYBlSp.js} +1 -1
- package/dist/public/assets/{browser-WLpgVYno.js → browser-CljOqDFz.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CDcZ7mJq.js → c4Diagram-KJ2TOQU5-COCMkiJ6.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-CXPuyqPL.js → chunk-6MUBBAK2-CWRxZCiu.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-Du6JRX1x.js → chunk-AXFCVDMN-Dgn3RHlx.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-D592E55X.js → chunk-BG4553SI-BDnAChfb.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-BW2r2SL4.js → chunk-DQASFODM-DSgprMfc.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-C3yoe54R.js → chunk-HFQBQIA3-ChtjyKjP.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-DF8gfYCy.js → chunk-KQLB2F66-B2o0ufJC.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-C8CRMTv1.js → chunk-KS47KZWR-C4qJvDaX.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-BDcMKiwj.js → chunk-LEVMRMFU-2jTGUstS.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-CKJPBygc.js → chunk-M57EVK23-CKAWW7fj.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-B3ZWH07L.js → chunk-OY52VR5R-B5TUKZAt.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-DI-z4UPL.js → chunk-QB3YPZ4I-CyQFTqwG.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-Bg4-haAc.js → chunk-R3KSYZAL-C6git_yh.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-l_SHib3p.js → chunk-STOXU5M4-AwEqcNnS.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-BINu9tIm.js → chunk-TU62E6Q5-GKcRDmvw.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BQn-mvV5.js → chunk-X4PVCEUW-CMG5EfZ9.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-uvpAu0Ys.js → chunk-XXDRQBXY-BHd-dKtZ.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-BIowooW1.js → classDiagram-v2-L25IHNXF-HaRsBCG9.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-BTyx1Mh2.js → cose-bilkent-JH36ORCC-BPBTCfj3.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-DyqqRII3.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-D64EU9I0.js → cynefinDiagram-L36ESFBY-dAmWDtva.js} +1 -1
- package/dist/public/assets/{d3-selection-CN9k6_B9.js → d3-selection-BhemR5ul.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-FCbz2-Kk.js → dagre-SPEB5RXH-D93g6hNI.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-OhHUSI7j.js → diagram-3B7GL73J-FJBKgG3X.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-Be4xMtp6.js → diagram-DNEMPZML-BP22T976.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-CmKSs3aG.js → diagram-L3MUGCDN-DcrCJXRt.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-D1C32rMN.js → diagram-LA4NIPWU-DUgd3PHQ.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BjoE6JXs.js → diagram-MHCOC4E2-ejTInqzQ.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-B22k4v8R.js → diagram-XPFHEONP-BLjkgho1.js} +1 -1
- package/dist/public/assets/{dist-DcBP8Cf6.js → dist-C9xqTt0E.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-Tn-K8-X7.js → ebnfDiagram-UZSYDL2S-CB1QQ4_T.js} +1 -1
- package/dist/public/assets/{editor.api-Bz4sjRz_.js → editor.api-lz6I1oVk.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-COnQsWlN.js → elk-XV6XMXQE-CLBx1s2b.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-c53dJilq.js → erDiagram-EYBAPDEH-Dsj6RYi5.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-DaFpPPks.js → eventmodeling-K75KTNOO-smOORsSG.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-DFmQPJ7B.js +1 -0
- package/dist/public/assets/{freemarker2-BLxfRHsw.js → freemarker2-DrLPw7Mc.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-Md-SavIS.js → ganttDiagram-23REXITY-BV9WK0rK.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-ybrJCK6u.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-CMSwTghO.js → gitGraphDiagram-STJD7YCW-CsSpSQ0T.js} +1 -1
- package/dist/public/assets/{handlebars-sNpu01kP.js → handlebars-CLx5-csF.js} +1 -1
- package/dist/public/assets/{html-C_tKd-uP.js → html-C9LmGm46.js} +1 -1
- package/dist/public/assets/{index-Bn86rI4n.js → index-CLWW0mVu.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-n41_wZE4.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-CwgNj-7i.js → infoDiagram-KBXO4MBG-wm5AnXDz.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-BSlzQNMN.js → ishikawaDiagram-M35NCXHK-BLUBDeS3.js} +1 -1
- package/dist/public/assets/{javascript-l3qKw0L-.js → javascript-C4S1eQb7.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-B09LPEnF.js → journeyDiagram-OPLOXDXO-DXc7-I_g.js} +1 -1
- package/dist/public/assets/{jsonMode-5SQQn1EX.js → jsonMode-lLJKR2M6.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-BiW4aJ29.js → kanban-definition-BZKZHSQY-D5Ra4L_5.js} +1 -1
- package/dist/public/assets/{liquid-BGyTIIUt.js → liquid-DRlm-XZd.js} +1 -1
- package/dist/public/assets/{mdx-8tGjz4em.js → mdx-CzIqeqPy.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-CctN5b0z.js → mermaid-parser.core-BIPB1BgS.js} +3 -3
- package/dist/public/assets/{mermaid.core-7ERSdZ4-.js → mermaid.core-DxBlQ6oF.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-D-GOUwW1.js → mindmap-definition-I2QAS2VK-BdupvuYr.js} +1 -1
- package/dist/public/assets/module-BPxWyxwR.js +2362 -0
- package/dist/public/assets/module-C_MSCGQC.js +1 -0
- package/dist/public/assets/{monaco-B_9hlk78.js → monaco-ChpJIYsY.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-BjrqMgis.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-Dmy1fWB3.js → pegDiagram-FD4XPPHP-C_GF7Fng.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-CJSA88kr.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-CXFHLYTg.js → pieDiagram-J4AKIIQI-WlpNP-IM.js} +1 -1
- package/dist/public/assets/{python-e-JK0s5M.js → python-BJgFCfc8.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-RQvEpGWO.js → quadrantDiagram-XTYBLID2-CkCL5rJY.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-4nLUXAkG.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-BD2LqZSr.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-CDOSPZwX.js → railroad-abnf-LNEFI6M7-DZZKUytl.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-BTrNQ0DX.js → railroad-ebnf-DWYD2UWJ-CS7KsJdb.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-B7NtVofS.js → railroad-peg-JR7BVNR7-CiukTZVd.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-DsDrT0Jf.js → railroadDiagram-MRQ6NCDL-BS0R_H3-.js} +1 -1
- package/dist/public/assets/{razor-DtSPwumi.js → razor-jcBIjr45.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-BQh0hFuA.js → requirementDiagram-Y7LWUY3S-C0_T9jgl.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-BUXNAQEF.js → sankeyDiagram-WGJFYUXA-DF15sUfS.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-05f-N5V_.js → sequenceDiagram-5NDRBG5M-7AkTLleX.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-D6V1fGWV.js → stateDiagram-v2-FJ4FJNEA-CU3i-U9q.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-DWhlPvKs.js → swimlanes-UMQ2AFYF-CR-ieLeo.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-COK2pFDF.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-CMdocOui.js → timeline-definition-SEUHKTQE-DeM0Uekm.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-BL13z_2J.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-Lx2qjQpO.js +1 -0
- package/dist/public/assets/{typescript-65jNyipU.js → typescript-B7zp7QPf.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-BQTHUX1f.js → usecaseDiagram-AFA6YXN4-D6rDIgdU.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-BULkVTfA.js → vennDiagram-NNMJR3RB-CncVDcMl.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-B4j5rilS.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-Cek6l8lz.js → wardleyDiagram-S7YFUSEH-DKPAMfTE.js} +1 -1
- package/dist/public/assets/{xml-DWBejfu-.js → xml-BJIgLD52.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-ujnZQTWA.js → xychartDiagram-GGNKY7IX-DmmXGebm.js} +1 -1
- package/dist/public/assets/{yaml-CwRCT7q1.js → yaml-Dxb2gmP5.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +7767 -3392
- package/package.json +37 -31
- package/dist/pi/packages/ta-cron/lib/composer.d.ts +0 -11
- package/dist/pi/packages/ta-cron/lib/composer.js +0 -58
- package/dist/pi/packages/ta-extensions/lib/composer.d.ts +0 -17
- package/dist/pi/packages/ta-extensions/lib/composer.js +0 -84
- package/dist/pi/packages/ta-recall/lib/skill-card.d.ts +0 -9
- package/dist/pi/packages/ta-recall/lib/skill-card.js +0 -51
- package/dist/pi/packages/ta-recall/lib/skill-util.d.ts +0 -19
- package/dist/pi/packages/ta-recall/lib/skill-util.js +0 -110
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dg54eFzZ.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-V5qkYWIO.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-1q8ldRXU.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-Crere6sx.js +0 -1
- package/dist/public/assets/module-DEqsdd00.js +0 -1
- package/dist/public/assets/module-TWc52XwT.js +0 -2244
- package/dist/public/assets/packet-JDAUHWVQ-qMf5LkHT.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-BjqLn4qm.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-DWO6t_4C.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-D1XOJPWy.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CRn5uHsY.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-D09wHNzT.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-ChxAT7Fq.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-DfSjKzbJ.js +0 -1
|
@@ -33,6 +33,7 @@ var EN = {
|
|
|
33
33
|
editTask: "Edit task",
|
|
34
34
|
count: "{count} tasks",
|
|
35
35
|
runningCount: "{count} running",
|
|
36
|
+
offGroup: "Off",
|
|
36
37
|
emptyTitle: "Let Ta work on a schedule",
|
|
37
38
|
emptyHint: "Each run is a new conversation; you get the summary.",
|
|
38
39
|
example1: "Sum up yesterday’s commits",
|
|
@@ -105,6 +106,10 @@ var EN = {
|
|
|
105
106
|
makeExtension: "Make an extension",
|
|
106
107
|
makeExtensionHint: "Ta makes a page of its own for what this task finds",
|
|
107
108
|
extensionAsk: 'Make the scheduled task "{name}" an extension that shows its results',
|
|
109
|
+
change: "Ask Ta to change",
|
|
110
|
+
changeTitle: 'Ask Ta to change "{name}"',
|
|
111
|
+
changePlaceholder: "What should change? Say, only on weekdays at 9",
|
|
112
|
+
changeAsk: 'Change the scheduled task "{name}": {text}',
|
|
108
113
|
promptLabel: "What Ta does",
|
|
109
114
|
showAll: "Show all",
|
|
110
115
|
showLess: "Show less",
|
|
@@ -114,13 +119,6 @@ var EN = {
|
|
|
114
119
|
moreOptions: "More options",
|
|
115
120
|
shortcut: "{key} + Enter to {action}",
|
|
116
121
|
modelFailed: "The model for making extensions ({model}) cannot be used, so the default one is: {message}",
|
|
117
|
-
fromChat: "Make a scheduled task",
|
|
118
|
-
fromChatDetail: "Do this again on a schedule",
|
|
119
|
-
fromChatWhen: "How often",
|
|
120
|
-
fromChatOther: "Another time",
|
|
121
|
-
fromChatOtherDetail: "Ta asks you",
|
|
122
|
-
fromChatAsk: "Make what this conversation did a scheduled task: {when}",
|
|
123
|
-
fromChatAskWhen: "Make what this conversation did a scheduled task; ask me how often first",
|
|
124
122
|
toolAdd: "Schedule",
|
|
125
123
|
toolUpdate: "Change scheduled task",
|
|
126
124
|
toolList: "List scheduled tasks",
|
|
@@ -141,6 +139,7 @@ var ZH = {
|
|
|
141
139
|
editTask: "编辑任务",
|
|
142
140
|
count: "{count} 个任务",
|
|
143
141
|
runningCount: "{count} 个运行中",
|
|
142
|
+
offGroup: "已停用",
|
|
144
143
|
emptyTitle: "让 Ta 按时干活",
|
|
145
144
|
emptyHint: "每次运行都是一个新对话,结束后给你看总结。",
|
|
146
145
|
example1: "汇总昨天的提交",
|
|
@@ -213,6 +212,10 @@ var ZH = {
|
|
|
213
212
|
makeExtension: "做成扩展",
|
|
214
213
|
makeExtensionHint: "让 Ta 为这个任务的结果做一个专属页面",
|
|
215
214
|
extensionAsk: "把定时任务“{name}”做成扩展,用专属页面呈现它的运行结果",
|
|
215
|
+
change: "让 Ta 改",
|
|
216
|
+
changeTitle: "让 Ta 修改“{name}”",
|
|
217
|
+
changePlaceholder: "想怎么改?比如:只在工作日早上 9 点运行",
|
|
218
|
+
changeAsk: "修改定时任务“{name}”:{text}",
|
|
216
219
|
promptLabel: "Ta 要做的事",
|
|
217
220
|
showAll: "展开全文",
|
|
218
221
|
showLess: "收起",
|
|
@@ -222,13 +225,6 @@ var ZH = {
|
|
|
222
225
|
moreOptions: "更多选项",
|
|
223
226
|
shortcut: "{key} + 回车{action}",
|
|
224
227
|
modelFailed: "做扩展的模型({model})现在用不了,已改用默认模型:{message}",
|
|
225
|
-
fromChat: "做成定时任务",
|
|
226
|
-
fromChatDetail: "定期再做一遍这次的事",
|
|
227
|
-
fromChatWhen: "多久运行一次",
|
|
228
|
-
fromChatOther: "其他时间",
|
|
229
|
-
fromChatOtherDetail: "让 Ta 问我",
|
|
230
|
-
fromChatAsk: "把这次对话做的事做成定时任务,{when} 运行",
|
|
231
|
-
fromChatAskWhen: "把这次对话做的事做成定时任务,先问我多久运行一次",
|
|
232
228
|
toolAdd: "新建定时任务",
|
|
233
229
|
toolUpdate: "修改定时任务",
|
|
234
230
|
toolList: "查看定时任务",
|
|
@@ -587,486 +583,6 @@ var ScheduleUtil;
|
|
|
587
583
|
}
|
|
588
584
|
})(ScheduleUtil ||= {});
|
|
589
585
|
|
|
590
|
-
// web-src/commands.ts
|
|
591
|
-
var FLAG_NAMES = ["name", "notify", "model", "thinking", "cwd", "timeout"];
|
|
592
|
-
var TRAILING_FLAG = new RegExp(`(?:^|\\s)--(${FLAG_NAMES.join("|")})(?:=|\\s+)("[^"]*"|'[^']*'|\\S*)\\s*$`);
|
|
593
|
-
var ACTIONS = ["add", "list", "show", "runs", "run", "enable", "disable", "set", "remove", "clear", "help"];
|
|
594
|
-
var HELP = `Scheduled tasks: each run is a conversation of its own in the Ta service, which runs them while it runs.
|
|
595
|
-
|
|
596
|
-
/loop <when> <prompt> repeat: 30m, 2h, @daily, @hourly, or a cron expression in quotes ("0 9 * * 1-5")
|
|
597
|
-
/remind in <duration> <prompt> once, after a while: in 45m
|
|
598
|
-
/remind at <time> <prompt> once, at a time: at 15:30, at 2026-11-12 09:00
|
|
599
|
-
/schedule add <when> <prompt> as /loop
|
|
600
|
-
/schedule list the tasks
|
|
601
|
-
/schedule show <task> a task and its last runs
|
|
602
|
-
/schedule run <task> run it now; its schedule stays
|
|
603
|
-
/schedule enable|disable <task>
|
|
604
|
-
/schedule set <task> [flags] change it; a value of - clears the flag
|
|
605
|
-
/schedule remove <task>
|
|
606
|
-
/schedule clear remove the tasks of this directory
|
|
607
|
-
|
|
608
|
-
A task is its id, the start of it, or its name. Flags at the end of a prompt:
|
|
609
|
-
--name <name> --notify always|error|never --model <provider/model> --thinking <level> --cwd <directory>
|
|
610
|
-
--timeout <duration> how long a run may take before it is stopped, 5m to 4h; default 30m`;
|
|
611
|
-
var CommandParser;
|
|
612
|
-
((CommandParser) => {
|
|
613
|
-
function splitFlags(text) {
|
|
614
|
-
const flags = {};
|
|
615
|
-
let rest = text.trim();
|
|
616
|
-
for (let match = TRAILING_FLAG.exec(rest);match; match = TRAILING_FLAG.exec(rest)) {
|
|
617
|
-
const key = match[1];
|
|
618
|
-
if (flags[key] === undefined) {
|
|
619
|
-
flags[key] = unquote(match[2]);
|
|
620
|
-
}
|
|
621
|
-
rest = rest.slice(0, match.index).trimEnd();
|
|
622
|
-
}
|
|
623
|
-
return { rest, flags };
|
|
624
|
-
}
|
|
625
|
-
CommandParser.splitFlags = splitFlags;
|
|
626
|
-
function repeating(text) {
|
|
627
|
-
const { rest, flags } = splitFlags(text);
|
|
628
|
-
const { schedule, remainder } = leadingSchedule(rest);
|
|
629
|
-
return input(schedule, remainder, flags);
|
|
630
|
-
}
|
|
631
|
-
CommandParser.repeating = repeating;
|
|
632
|
-
function reminder(text, now) {
|
|
633
|
-
const { rest, flags } = splitFlags(text);
|
|
634
|
-
const words = rest.split(/\s+/);
|
|
635
|
-
let at;
|
|
636
|
-
let used = 0;
|
|
637
|
-
if (words[0] === "at") {
|
|
638
|
-
const time = clockTime(words.slice(1, 3), now);
|
|
639
|
-
at = time?.date;
|
|
640
|
-
used = 1 + (time?.words ?? 0);
|
|
641
|
-
} else {
|
|
642
|
-
const offset = words[0] === "in" ? 1 : 0;
|
|
643
|
-
const ms = Duration.parse(words[offset] ?? "");
|
|
644
|
-
at = ms === undefined ? undefined : new Date(now.getTime() + ms);
|
|
645
|
-
used = offset + 1;
|
|
646
|
-
}
|
|
647
|
-
if (!at) {
|
|
648
|
-
throw new Error("Say when: /remind in 45m <prompt>, or /remind at 15:30 <prompt>.");
|
|
649
|
-
}
|
|
650
|
-
return input({ kind: "once", at: at.toISOString() }, words.slice(used).join(" "), flags);
|
|
651
|
-
}
|
|
652
|
-
CommandParser.reminder = reminder;
|
|
653
|
-
function action(text) {
|
|
654
|
-
const trimmed = text.trim();
|
|
655
|
-
const first = trimmed.split(/\s+/, 1)[0] || "list";
|
|
656
|
-
const action2 = first === "delete" ? "remove" : first === "ls" ? "list" : first;
|
|
657
|
-
if (!ACTIONS.includes(action2)) {
|
|
658
|
-
throw new Error(`/schedule does not know ${JSON.stringify(first)}. It takes: ${ACTIONS.join(", ")}.`);
|
|
659
|
-
}
|
|
660
|
-
return { action: action2, rest: trimmed.slice(trimmed ? first.length : 0).trim() };
|
|
661
|
-
}
|
|
662
|
-
CommandParser.action = action;
|
|
663
|
-
function patch(text) {
|
|
664
|
-
const { rest, flags } = splitFlags(text);
|
|
665
|
-
if (!rest) {
|
|
666
|
-
throw new Error("Name the task: /schedule set <task> --model <provider/model>.");
|
|
667
|
-
}
|
|
668
|
-
const value = (flag) => flag === undefined ? undefined : flag === "-" ? "" : flag;
|
|
669
|
-
const patch2 = {};
|
|
670
|
-
if (flags.name !== undefined) {
|
|
671
|
-
patch2.name = value(flags.name);
|
|
672
|
-
}
|
|
673
|
-
if (flags.cwd !== undefined) {
|
|
674
|
-
patch2.cwd = value(flags.cwd);
|
|
675
|
-
}
|
|
676
|
-
if (flags.model !== undefined) {
|
|
677
|
-
patch2.model = value(flags.model);
|
|
678
|
-
}
|
|
679
|
-
if (flags.thinking !== undefined) {
|
|
680
|
-
patch2.thinking = value(flags.thinking);
|
|
681
|
-
}
|
|
682
|
-
if (flags.notify !== undefined) {
|
|
683
|
-
patch2.notify = value(flags.notify);
|
|
684
|
-
}
|
|
685
|
-
if (flags.timeout !== undefined) {
|
|
686
|
-
patch2.timeout = value(flags.timeout);
|
|
687
|
-
}
|
|
688
|
-
if (Object.keys(patch2).length === 0) {
|
|
689
|
-
throw new Error("Say what changes: --name, --notify, --model, --thinking, --cwd or --timeout.");
|
|
690
|
-
}
|
|
691
|
-
return { ref: rest, patch: patch2 };
|
|
692
|
-
}
|
|
693
|
-
CommandParser.patch = patch;
|
|
694
|
-
function leadingSchedule(text) {
|
|
695
|
-
const trimmed = text.trim();
|
|
696
|
-
const quote = trimmed[0];
|
|
697
|
-
if (quote === '"' || quote === "'") {
|
|
698
|
-
const end = trimmed.indexOf(quote, 1);
|
|
699
|
-
if (end < 0) {
|
|
700
|
-
throw new Error("The cron expression has no closing quote.");
|
|
701
|
-
}
|
|
702
|
-
return { schedule: ScheduleUtil.check({ kind: "cron", expression: trimmed.slice(1, end) }), remainder: trimmed.slice(end + 1) };
|
|
703
|
-
}
|
|
704
|
-
const [first = ""] = trimmed.split(/\s+/, 1);
|
|
705
|
-
const remainder = trimmed.slice(first.length);
|
|
706
|
-
if (first.startsWith("@")) {
|
|
707
|
-
return { schedule: ScheduleUtil.check({ kind: "cron", expression: first }), remainder };
|
|
708
|
-
}
|
|
709
|
-
if (Duration.parse(first) !== undefined) {
|
|
710
|
-
return { schedule: ScheduleUtil.check({ kind: "interval", every: first }), remainder };
|
|
711
|
-
}
|
|
712
|
-
throw new Error('Start with when: 30m, 2h, @daily, or a cron expression in quotes such as "0 9 * * 1-5".');
|
|
713
|
-
}
|
|
714
|
-
CommandParser.leadingSchedule = leadingSchedule;
|
|
715
|
-
function clockTime(words, now) {
|
|
716
|
-
const [first = "", second = ""] = words;
|
|
717
|
-
const hm = /^(\d{1,2}):(\d{2})$/;
|
|
718
|
-
const day = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
|
|
719
|
-
const time = hm.exec(first);
|
|
720
|
-
if (time) {
|
|
721
|
-
const date2 = new Date(now.getTime());
|
|
722
|
-
date2.setHours(Number(time[1]), Number(time[2]), 0, 0);
|
|
723
|
-
if (date2.getTime() <= now.getTime()) {
|
|
724
|
-
date2.setDate(date2.getDate() + 1);
|
|
725
|
-
}
|
|
726
|
-
return valid(date2, Number(time[1]) < 24 && Number(time[2]) < 60) ? { date: date2, words: 1 } : undefined;
|
|
727
|
-
}
|
|
728
|
-
const date = day.exec(first);
|
|
729
|
-
const later = hm.exec(second);
|
|
730
|
-
if (date) {
|
|
731
|
-
const at = new Date(Number(date[1]), Number(date[2]) - 1, Number(date[3]), later ? Number(later[1]) : 9, later ? Number(later[2]) : 0);
|
|
732
|
-
return valid(at, true) ? { date: at, words: later ? 2 : 1 } : undefined;
|
|
733
|
-
}
|
|
734
|
-
const iso = /^\d{4}-\d{2}-\d{2}T/.test(first) ? new Date(first) : undefined;
|
|
735
|
-
return iso && valid(iso, true) ? { date: iso, words: 1 } : undefined;
|
|
736
|
-
}
|
|
737
|
-
CommandParser.clockTime = clockTime;
|
|
738
|
-
function valid(date, ok) {
|
|
739
|
-
return ok && !Number.isNaN(date.getTime());
|
|
740
|
-
}
|
|
741
|
-
function input(schedule, prompt, flags) {
|
|
742
|
-
const text = prompt.trim();
|
|
743
|
-
if (!text) {
|
|
744
|
-
throw new Error("Then say what Ta should do: the prompt of the task.");
|
|
745
|
-
}
|
|
746
|
-
return {
|
|
747
|
-
schedule,
|
|
748
|
-
prompt: text,
|
|
749
|
-
...flags.name ? { name: flags.name } : {},
|
|
750
|
-
...flags.cwd ? { cwd: flags.cwd } : {},
|
|
751
|
-
...flags.model ? { model: flags.model } : {},
|
|
752
|
-
...flags.thinking ? { thinking: flags.thinking } : {},
|
|
753
|
-
...flags.notify ? { notify: flags.notify } : {},
|
|
754
|
-
...flags.timeout ? { timeout: flags.timeout } : {}
|
|
755
|
-
};
|
|
756
|
-
}
|
|
757
|
-
function unquote(value) {
|
|
758
|
-
return /^(["']).*\1$/.test(value) ? value.slice(1, -1) : value;
|
|
759
|
-
}
|
|
760
|
-
function completions(prefix, tasks) {
|
|
761
|
-
const parts = prefix.split(/\s+/);
|
|
762
|
-
if (parts.length <= 1) {
|
|
763
|
-
return ACTIONS.filter((action3) => action3.startsWith(parts[0] ?? "")).map((action3) => ({ value: `${action3} `, label: action3 }));
|
|
764
|
-
}
|
|
765
|
-
const [action2, ref] = parts;
|
|
766
|
-
if (!["show", "runs", "run", "enable", "disable", "set", "remove"].includes(action2) || parts.length > 2) {
|
|
767
|
-
return [];
|
|
768
|
-
}
|
|
769
|
-
return tasks.filter((task) => task.id.startsWith(ref) || task.name.startsWith(ref)).map((task) => ({ value: `${action2} ${task.id} `, label: task.id, description: task.name }));
|
|
770
|
-
}
|
|
771
|
-
CommandParser.completions = completions;
|
|
772
|
-
function loopCompletions(prefix) {
|
|
773
|
-
if (/\s/.test(prefix)) {
|
|
774
|
-
return [];
|
|
775
|
-
}
|
|
776
|
-
return [...Object.keys(NICKNAMES), "5m", "30m", "1h", "1d"].filter((item) => item.startsWith(prefix)).map((item) => ({ value: `${item} `, label: item }));
|
|
777
|
-
}
|
|
778
|
-
CommandParser.loopCompletions = loopCompletions;
|
|
779
|
-
})(CommandParser ||= {});
|
|
780
|
-
var CronText;
|
|
781
|
-
((CronText) => {
|
|
782
|
-
function task(task2, now = new Date) {
|
|
783
|
-
const state = !task2.enabled ? "off" : task2.lastStatus === "running" ? "running" : task2.nextRunAt ? `next ${ScheduleUtil.clock(new Date(task2.nextRunAt), now)}` : "done";
|
|
784
|
-
const last = task2.lastStatus && task2.lastStatus !== "running" ? `, last ${task2.lastStatus}` : "";
|
|
785
|
-
const timeout = task2.timeout ? `, stops after ${task2.timeout}` : "";
|
|
786
|
-
return `${task2.id} ${task2.name} (${ScheduleUtil.describe(task2.schedule, "en", now)}; ${state}${last}${timeout}) in ${task2.cwd}`;
|
|
787
|
-
}
|
|
788
|
-
CronText.task = task;
|
|
789
|
-
function run(run2, now = new Date) {
|
|
790
|
-
const time = ScheduleUtil.clock(new Date(run2.startedAt), now);
|
|
791
|
-
const took = run2.endedAt ? ` in ${Duration.format(new Date(run2.endedAt).getTime() - new Date(run2.startedAt).getTime())}` : "";
|
|
792
|
-
const what = run2.error ?? run2.summary ?? "";
|
|
793
|
-
const file = run2.sessionFile ? `
|
|
794
|
-
conversation: ${run2.sessionFile}` : "";
|
|
795
|
-
return `${run2.id} ${time} ${run2.status}${took}${run2.trigger === "manual" ? " (by hand)" : ""}${what ? `
|
|
796
|
-
${what.replace(/\n/g, `
|
|
797
|
-
`)}` : ""}${file}`;
|
|
798
|
-
}
|
|
799
|
-
CronText.run = run;
|
|
800
|
-
function reply(reply2) {
|
|
801
|
-
switch (reply2.kind) {
|
|
802
|
-
case "task":
|
|
803
|
-
return `${capital(reply2.event)}: ${task(reply2.task)}`;
|
|
804
|
-
case "removed":
|
|
805
|
-
return reply2.tasks.length ? `Removed ${reply2.tasks.map((item) => item.name).join(", ")}.` : "No tasks to remove.";
|
|
806
|
-
case "started":
|
|
807
|
-
return `Started ${reply2.task.name} (${reply2.run.id}); it runs in a conversation of its own.`;
|
|
808
|
-
case "list":
|
|
809
|
-
return reply2.tasks.length ? reply2.tasks.map((item) => task(item)).join(`
|
|
810
|
-
`) : "No scheduled tasks. Make one with /loop or /remind.";
|
|
811
|
-
case "show":
|
|
812
|
-
return `${task(reply2.task)}
|
|
813
|
-
prompt: ${reply2.task.prompt}
|
|
814
|
-
${reply2.runs.length ? reply2.runs.map((item) => run(item)).join(`
|
|
815
|
-
`) : "No runs yet."}`;
|
|
816
|
-
case "help":
|
|
817
|
-
return HELP;
|
|
818
|
-
case "error":
|
|
819
|
-
return reply2.message;
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
CronText.reply = reply;
|
|
823
|
-
function capital(text) {
|
|
824
|
-
return text[0].toUpperCase() + text.slice(1);
|
|
825
|
-
}
|
|
826
|
-
})(CronText ||= {});
|
|
827
|
-
|
|
828
|
-
// web-src/server-texts.ts
|
|
829
|
-
var CronServerTexts;
|
|
830
|
-
((CronServerTexts) => {
|
|
831
|
-
function zh(env = process.env) {
|
|
832
|
-
return /^zh/i.test(env.TA_LANGUAGE || env.LC_ALL || env.LC_MESSAGES || env.LANG || "");
|
|
833
|
-
}
|
|
834
|
-
CronServerTexts.zh = zh;
|
|
835
|
-
function removeTask(name) {
|
|
836
|
-
return zh() ? ["删除这个任务?", `${name} 和它的运行记录会被删除,运行产生的对话会保留。`] : ["Delete the scheduled task?", `${name} and its runs go; their conversations stay.`];
|
|
837
|
-
}
|
|
838
|
-
CronServerTexts.removeTask = removeTask;
|
|
839
|
-
function removeTasks(count) {
|
|
840
|
-
return zh() ? ["删除这个目录的所有定时任务?", `${count} 个任务和它们的运行记录会被删除。`] : ["Delete the scheduled tasks of this directory?", `${count} tasks and their runs go.`];
|
|
841
|
-
}
|
|
842
|
-
CronServerTexts.removeTasks = removeTasks;
|
|
843
|
-
})(CronServerTexts ||= {});
|
|
844
|
-
|
|
845
|
-
// web-src/tool.ts
|
|
846
|
-
var SCHEDULE = {
|
|
847
|
-
type: "object",
|
|
848
|
-
description: 'When it runs, in the local time of the Ta service: { "kind": "once", "at": "2026-11-12T09:00" }, { "kind": "interval", "every": "30m" } (at least 1m), or { "kind": "cron", "expression": "0 9 * * 1-5" } (five fields, or @daily, @hourly, @weekly, @monthly).',
|
|
849
|
-
properties: {
|
|
850
|
-
kind: { type: "string", enum: ["once", "interval", "cron"] },
|
|
851
|
-
at: { type: "string" },
|
|
852
|
-
every: { type: "string" },
|
|
853
|
-
expression: { type: "string" }
|
|
854
|
-
},
|
|
855
|
-
required: ["kind"]
|
|
856
|
-
};
|
|
857
|
-
var CronTool;
|
|
858
|
-
((CronTool) => {
|
|
859
|
-
CronTool.NAME = TOOL_NAME;
|
|
860
|
-
CronTool.DEFINITION = {
|
|
861
|
-
name: CronTool.NAME,
|
|
862
|
-
label: "Schedule task",
|
|
863
|
-
description: `Schedules a prompt for Ta to run later, once or again and again (reminders, checks, reports), and manages those tasks. Each run is a new conversation of its own in the Ta service, in the task's directory, with no user watching; its last answer is the summary the user sees. Actions: add (prompt and schedule; name, cwd, model, thinking, notify, timeout optional), update (id and the fields to change; "" clears model, thinking, notify or timeout), list, show (with its last runs), enable, disable, delete, run (now, by hand), runs, clear (the tasks of this directory). Deleting and clearing ask the user first.`,
|
|
864
|
-
parameters: {
|
|
865
|
-
type: "object",
|
|
866
|
-
properties: {
|
|
867
|
-
action: { type: "string", enum: ["add", "update", "list", "show", "enable", "disable", "delete", "run", "runs", "clear"] },
|
|
868
|
-
id: { type: "string", description: "The task: its id, the start of it, or its name." },
|
|
869
|
-
name: { type: "string", description: "Short, for the list." },
|
|
870
|
-
prompt: { type: "string", description: "What Ta does each run, complete in itself: the run does not see this conversation." },
|
|
871
|
-
schedule: SCHEDULE,
|
|
872
|
-
cwd: { type: "string", description: "The directory it runs in; default: this conversation's." },
|
|
873
|
-
model: { type: "string", description: "<provider>/<model id>; default: the settings." },
|
|
874
|
-
thinking: { type: "string", enum: [...THINKING_LEVELS, ""] },
|
|
875
|
-
notify: {
|
|
876
|
-
type: "string",
|
|
877
|
-
enum: [...NOTIFY_LEVELS, ""],
|
|
878
|
-
description: "When the pages of Ta tell the user a run ended; default always for once, error for repeating."
|
|
879
|
-
},
|
|
880
|
-
timeout: { type: "string", description: "How long a run may take before it is stopped, as 90m or 2h (5m to 4h); default 30m." },
|
|
881
|
-
enabled: { type: "boolean" },
|
|
882
|
-
limit: { type: "number", description: "How many runs to list; default 10." }
|
|
883
|
-
},
|
|
884
|
-
required: ["action"]
|
|
885
|
-
}
|
|
886
|
-
};
|
|
887
|
-
async function run(service, params, context) {
|
|
888
|
-
const id = typeof params.id === "string" ? params.id : "";
|
|
889
|
-
switch (params.action) {
|
|
890
|
-
case "add": {
|
|
891
|
-
const cwd = typeof params.cwd === "string" && params.cwd ? params.cwd : await context.cwd();
|
|
892
|
-
const task = await service.add({
|
|
893
|
-
prompt: String(params.prompt ?? ""),
|
|
894
|
-
schedule: params.schedule,
|
|
895
|
-
name: optional(params.name),
|
|
896
|
-
cwd,
|
|
897
|
-
model: optional(params.model),
|
|
898
|
-
thinking: optional(params.thinking),
|
|
899
|
-
notify: optional(params.notify),
|
|
900
|
-
timeout: optional(params.timeout),
|
|
901
|
-
enabled: params.enabled === false ? false : undefined
|
|
902
|
-
});
|
|
903
|
-
return `Scheduled: ${CronText.task(task)}`;
|
|
904
|
-
}
|
|
905
|
-
case "update": {
|
|
906
|
-
const patch = {};
|
|
907
|
-
for (const key of ["name", "prompt", "cwd", "model", "thinking", "notify", "timeout"]) {
|
|
908
|
-
if (typeof params[key] === "string") {
|
|
909
|
-
patch[key] = params[key];
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
if (params.schedule !== undefined) {
|
|
913
|
-
patch.schedule = params.schedule;
|
|
914
|
-
}
|
|
915
|
-
if (typeof params.enabled === "boolean") {
|
|
916
|
-
patch.enabled = params.enabled;
|
|
917
|
-
}
|
|
918
|
-
return `Updated: ${CronText.task(await service.update(id, patch))}`;
|
|
919
|
-
}
|
|
920
|
-
case "list": {
|
|
921
|
-
const tasks = await service.list();
|
|
922
|
-
return tasks.length ? tasks.map((task) => CronText.task(task)).join(`
|
|
923
|
-
`) : "No scheduled tasks.";
|
|
924
|
-
}
|
|
925
|
-
case "show":
|
|
926
|
-
case "runs": {
|
|
927
|
-
const task = await service.get(id);
|
|
928
|
-
const runs = await service.runs(task.id, typeof params.limit === "number" ? params.limit : 10);
|
|
929
|
-
return CronText.reply({ kind: "show", task, runs });
|
|
930
|
-
}
|
|
931
|
-
case "enable":
|
|
932
|
-
case "disable":
|
|
933
|
-
return `${params.action === "enable" ? "Enabled" : "Disabled"}: ${CronText.task(await service.setEnabled(id, params.action === "enable"))}`;
|
|
934
|
-
case "run": {
|
|
935
|
-
const task = await service.get(id);
|
|
936
|
-
const run2 = await service.run(task.id);
|
|
937
|
-
return `Started ${task.name} (${run2.id}). It runs in a conversation of its own; see its result later with action "show".`;
|
|
938
|
-
}
|
|
939
|
-
case "delete": {
|
|
940
|
-
const task = await service.get(id);
|
|
941
|
-
if (!await context.confirm(...CronServerTexts.removeTask(task.name))) {
|
|
942
|
-
return "The user kept the task.";
|
|
943
|
-
}
|
|
944
|
-
await service.remove(task.id);
|
|
945
|
-
return `Deleted ${task.name}.`;
|
|
946
|
-
}
|
|
947
|
-
case "clear": {
|
|
948
|
-
const cwd = await context.cwd();
|
|
949
|
-
const tasks = (await service.list()).filter((task) => task.cwd === cwd);
|
|
950
|
-
if (tasks.length === 0) {
|
|
951
|
-
return "This directory has no scheduled tasks.";
|
|
952
|
-
}
|
|
953
|
-
if (!await context.confirm(...CronServerTexts.removeTasks(tasks.length))) {
|
|
954
|
-
return "The user kept the tasks.";
|
|
955
|
-
}
|
|
956
|
-
return `Deleted ${(await service.clear(cwd)).length} tasks.`;
|
|
957
|
-
}
|
|
958
|
-
default:
|
|
959
|
-
throw new Error("action is one of add, update, list, show, enable, disable, delete, run, runs, clear.");
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
CronTool.run = run;
|
|
963
|
-
function optional(value) {
|
|
964
|
-
return typeof value === "string" && value ? value : undefined;
|
|
965
|
-
}
|
|
966
|
-
})(CronTool ||= {});
|
|
967
|
-
|
|
968
|
-
// web-src/chat-task.ts
|
|
969
|
-
var TASK_BLOCK = "ta-cron-task";
|
|
970
|
-
var MARK = /\[ta-cron:from-chat(?: (\{[^}]*\}))?\]/;
|
|
971
|
-
var ChatTask;
|
|
972
|
-
((ChatTask) => {
|
|
973
|
-
function message(language, schedule2) {
|
|
974
|
-
const words = CronWords.of(language);
|
|
975
|
-
const ask = schedule2 ? CronWords.format(words.fromChatAsk, { when: ScheduleUtil.describe(schedule2, language) }) : words.fromChatAskWhen;
|
|
976
|
-
return `<context>
|
|
977
|
-
${context(schedule2)}
|
|
978
|
-
</context>
|
|
979
|
-
${ask}`;
|
|
980
|
-
}
|
|
981
|
-
ChatTask.message = message;
|
|
982
|
-
function context(schedule2) {
|
|
983
|
-
const fence = "```";
|
|
984
|
-
return [
|
|
985
|
-
schedule2 ? `[ta-cron:from-chat ${JSON.stringify(schedule2)}]` : "[ta-cron:from-chat]",
|
|
986
|
-
schedule2 ? `The user wants what was done in this conversation made a scheduled task of Ta that does it again and again, ${ScheduleUtil.describe(schedule2, "en-US")}.` : "The user wants what was done in this conversation made a scheduled task of Ta that does it again and again, and has not said how often: unless the conversation says it, ask, with two or three choices that suit the work, and write the task once you know.",
|
|
987
|
-
"- Each run is a new conversation in this directory with nobody watching, and it does not see this one: write a prompt complete in itself, with the goal, the repository, branch, files, commands, links and other specifics found here, the steps that worked, and what its last answer should report (short: what it found, what changed since the run before, what needs the user).",
|
|
988
|
-
'- Leave out what was only tried and dropped, and what holds only this once: say "since the last run" or "yesterday" rather than a date.',
|
|
989
|
-
`- Say in a line or two what the task does, then end your answer with it in a fenced block of the language ${TASK_BLOCK}, which Ta reads to create the task: do not create it with ${CronTool.NAME} or a command. A longer fence when the prompt has one of its own:`,
|
|
990
|
-
`${fence}${TASK_BLOCK}`,
|
|
991
|
-
"name: <short, for the list>",
|
|
992
|
-
schedule2 ? "when: <only when the user asked for another time since: 30m, 2h, @daily, or five fields of cron>" : "when: <30m, 2h, @daily, or five fields of cron, as 0 9 * * 1-5>",
|
|
993
|
-
"---",
|
|
994
|
-
"<the prompt>",
|
|
995
|
-
fence,
|
|
996
|
-
"- When the conversation holds nothing worth doing again, say so, ask what the task should do, and leave the block out until you know."
|
|
997
|
-
].join(`
|
|
998
|
-
`);
|
|
999
|
-
}
|
|
1000
|
-
ChatTask.context = context;
|
|
1001
|
-
function find(text2) {
|
|
1002
|
-
const lines = text2.split(/\r?\n/);
|
|
1003
|
-
let found;
|
|
1004
|
-
for (let index = 0;index < lines.length; index++) {
|
|
1005
|
-
const open = /^\s*(`{3,})\s*([\w-]+)\s*$/.exec(lines[index]);
|
|
1006
|
-
if (open?.[2] !== TASK_BLOCK) {
|
|
1007
|
-
continue;
|
|
1008
|
-
}
|
|
1009
|
-
const close = new RegExp(`^\\s*${open[1]}\`*\\s*$`);
|
|
1010
|
-
const end = lines.findIndex((line, at) => at > index && close.test(line));
|
|
1011
|
-
found = lines.slice(index + 1, end < 0 ? lines.length : end);
|
|
1012
|
-
index = end < 0 ? lines.length : end;
|
|
1013
|
-
}
|
|
1014
|
-
return found && parse(found);
|
|
1015
|
-
}
|
|
1016
|
-
ChatTask.find = find;
|
|
1017
|
-
function parse(lines) {
|
|
1018
|
-
const rule = lines.findIndex((line) => line.trim() === "---");
|
|
1019
|
-
const head = rule < 0 ? [] : lines.slice(0, rule);
|
|
1020
|
-
const prompt = lines.slice(rule + 1).join(`
|
|
1021
|
-
`).trim();
|
|
1022
|
-
if (!prompt) {
|
|
1023
|
-
return;
|
|
1024
|
-
}
|
|
1025
|
-
const field = (key) => head.map((line) => new RegExp(`^\\s*${key}\\s*:\\s*(.*)$`, "i").exec(line)?.[1].trim()).find((value) => value !== undefined);
|
|
1026
|
-
const name = field("name") ?? "";
|
|
1027
|
-
const when = field("when");
|
|
1028
|
-
return { name, prompt, schedule: when ? schedule(when) : undefined };
|
|
1029
|
-
}
|
|
1030
|
-
function schedule(text2) {
|
|
1031
|
-
const when = text2.replace(/^["'`]|["'`]$/g, "").trim();
|
|
1032
|
-
if (Duration.parse(when) !== undefined) {
|
|
1033
|
-
return ScheduleUtil.check({ kind: "interval", every: when });
|
|
1034
|
-
}
|
|
1035
|
-
return ScheduleUtil.check({ kind: "cron", expression: when });
|
|
1036
|
-
}
|
|
1037
|
-
ChatTask.schedule = schedule;
|
|
1038
|
-
function pending(entries) {
|
|
1039
|
-
for (let index = entries.length - 1;index >= 0; index--) {
|
|
1040
|
-
const entry = entries[index];
|
|
1041
|
-
const custom = entry.type === "custom_message" ? entry : entry.message?.role === "custom" ? entry.message : undefined;
|
|
1042
|
-
if (custom?.customType === REPLY_TYPE && created(custom.details)) {
|
|
1043
|
-
return;
|
|
1044
|
-
}
|
|
1045
|
-
if (entry.type !== "message" || entry.message?.role !== "user") {
|
|
1046
|
-
continue;
|
|
1047
|
-
}
|
|
1048
|
-
const mark = MARK.exec(text(entry.message.content));
|
|
1049
|
-
if (mark) {
|
|
1050
|
-
return { schedule: mark[1] ? ScheduleUtil.check(JSON.parse(mark[1])) : undefined };
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
return;
|
|
1054
|
-
}
|
|
1055
|
-
ChatTask.pending = pending;
|
|
1056
|
-
function text(content) {
|
|
1057
|
-
if (typeof content === "string") {
|
|
1058
|
-
return content;
|
|
1059
|
-
}
|
|
1060
|
-
return Array.isArray(content) ? content.filter((part) => part?.type === "text" && typeof part.text === "string").map((part) => part.text).join(`
|
|
1061
|
-
`) : "";
|
|
1062
|
-
}
|
|
1063
|
-
ChatTask.text = text;
|
|
1064
|
-
function created(details) {
|
|
1065
|
-
const reply = details;
|
|
1066
|
-
return reply?.kind === "task" && reply.event === "created";
|
|
1067
|
-
}
|
|
1068
|
-
})(ChatTask ||= {});
|
|
1069
|
-
|
|
1070
586
|
// web-src/task-extension.ts
|
|
1071
587
|
var PROMPT_MAX = 4000;
|
|
1072
588
|
var ANSWER_MAX = 2000;
|
|
@@ -1104,6 +620,7 @@ ${CronWords.format(words.extensionAsk, { name: task.name })}`;
|
|
|
1104
620
|
function clip(text, max) {
|
|
1105
621
|
return text.length > max ? `${text.slice(0, max - 1)}…` : text;
|
|
1106
622
|
}
|
|
623
|
+
TaskExtension.clip = clip;
|
|
1107
624
|
function fence(text) {
|
|
1108
625
|
const longest = Math.max(2, ...Array.from(text.matchAll(/`+/g), (match) => match[0].length));
|
|
1109
626
|
const marks = "`".repeat(longest + 1);
|
|
@@ -1111,8 +628,45 @@ ${CronWords.format(words.extensionAsk, { name: task.name })}`;
|
|
|
1111
628
|
${text}
|
|
1112
629
|
${marks}`;
|
|
1113
630
|
}
|
|
631
|
+
TaskExtension.fence = fence;
|
|
1114
632
|
})(TaskExtension ||= {});
|
|
1115
633
|
|
|
634
|
+
// web-src/task-change.ts
|
|
635
|
+
var PROMPT_MAX2 = 4000;
|
|
636
|
+
var ANSWER_MAX2 = 2000;
|
|
637
|
+
var TaskChange;
|
|
638
|
+
((TaskChange) => {
|
|
639
|
+
function message(task, runs, request, language) {
|
|
640
|
+
const words = CronWords.of(language);
|
|
641
|
+
return `<context>
|
|
642
|
+
${context(task, runs)}
|
|
643
|
+
</context>
|
|
644
|
+
${CronWords.format(words.changeAsk, { name: task.name, text: request.trim() })}`;
|
|
645
|
+
}
|
|
646
|
+
TaskChange.message = message;
|
|
647
|
+
function context(task, runs) {
|
|
648
|
+
const last = runs?.[0];
|
|
649
|
+
const lines = [
|
|
650
|
+
`The user wants the scheduled task "${task.name}" changed as they say below. Change it with schedule_task (action "update", id ${task.id}), only the fields their words touch; a new prompt stays complete in itself, since a run does not see this conversation. Do not run the task unless they ask. When their words leave the change unclear, ask before changing it. Then say in a line or two what changed and when it runs next. Without that tool, give the user the new values to put in the Edit dialog of the task.`,
|
|
651
|
+
"",
|
|
652
|
+
`Task: ${task.id}, ${ScheduleUtil.describe(task.schedule, "en-US")} (schedule ${JSON.stringify(task.schedule)}), in ${task.cwd}, ${task.enabled ? "on" : "off"}, ran ${task.runCount} times (${task.failCount} failed).`,
|
|
653
|
+
`Settings: model ${task.model || "default"}, thinking ${task.thinking || "default"}, notify ${task.notify || "default"}, timeout ${task.timeout || "default 30m"}.`,
|
|
654
|
+
"Its prompt:",
|
|
655
|
+
TaskExtension.fence(TaskExtension.clip(task.prompt, PROMPT_MAX2))
|
|
656
|
+
];
|
|
657
|
+
const text = last?.error ?? last?.summary;
|
|
658
|
+
if (last && last.status !== "running") {
|
|
659
|
+
lines.push(`Its last run ${last.reason ?? last.status}${text ? ":" : "."}`);
|
|
660
|
+
if (text) {
|
|
661
|
+
lines.push(TaskExtension.fence(TaskExtension.clip(text, ANSWER_MAX2)));
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
return lines.join(`
|
|
665
|
+
`);
|
|
666
|
+
}
|
|
667
|
+
TaskChange.context = context;
|
|
668
|
+
})(TaskChange ||= {});
|
|
669
|
+
|
|
1116
670
|
// web-src/page.ts
|
|
1117
671
|
var pi;
|
|
1118
672
|
var PAGE = `${NAME}/tasks`;
|
|
@@ -1142,307 +696,518 @@ function basename(path) {
|
|
|
1142
696
|
return path.replace(/[\\/]+$/, "").split(/[\\/]/).pop() || path;
|
|
1143
697
|
}
|
|
1144
698
|
|
|
1145
|
-
class CronClient {
|
|
1146
|
-
api;
|
|
1147
|
-
state = { tasks: [], loaded: false, runs: {} };
|
|
1148
|
-
listeners = new Set;
|
|
1149
|
-
newAsks = new Set;
|
|
1150
|
-
writing = new Set;
|
|
1151
|
-
reading;
|
|
1152
|
-
again = false;
|
|
1153
|
-
stop;
|
|
1154
|
-
constructor(api) {
|
|
1155
|
-
this.api = api;
|
|
1156
|
-
}
|
|
1157
|
-
start() {
|
|
1158
|
-
this.stop = this.api.storage.onChange((keys) => {
|
|
1159
|
-
if (keys.includes(Keys.TASKS)) {
|
|
1160
|
-
this.load();
|
|
1161
|
-
}
|
|
1162
|
-
for (const key of keys) {
|
|
1163
|
-
const id = key.startsWith("runs/") ? key.slice(5) : undefined;
|
|
1164
|
-
if (id && this.state.runs[id]) {
|
|
1165
|
-
this.loadRuns(id);
|
|
1166
|
-
}
|
|
699
|
+
class CronClient {
|
|
700
|
+
api;
|
|
701
|
+
state = { tasks: [], loaded: false, runs: {} };
|
|
702
|
+
listeners = new Set;
|
|
703
|
+
newAsks = new Set;
|
|
704
|
+
writing = new Set;
|
|
705
|
+
reading;
|
|
706
|
+
again = false;
|
|
707
|
+
stop;
|
|
708
|
+
constructor(api) {
|
|
709
|
+
this.api = api;
|
|
710
|
+
}
|
|
711
|
+
start() {
|
|
712
|
+
this.stop = this.api.storage.onChange((keys) => {
|
|
713
|
+
if (keys.includes(Keys.TASKS)) {
|
|
714
|
+
this.load();
|
|
715
|
+
}
|
|
716
|
+
for (const key of keys) {
|
|
717
|
+
const id = key.startsWith("runs/") ? key.slice(5) : undefined;
|
|
718
|
+
if (id && this.state.runs[id]) {
|
|
719
|
+
this.loadRuns(id);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
this.load();
|
|
724
|
+
}
|
|
725
|
+
dispose() {
|
|
726
|
+
this.stop?.();
|
|
727
|
+
this.listeners.clear();
|
|
728
|
+
this.newAsks.clear();
|
|
729
|
+
}
|
|
730
|
+
subscribe(listener) {
|
|
731
|
+
this.listeners.add(listener);
|
|
732
|
+
return () => this.listeners.delete(listener);
|
|
733
|
+
}
|
|
734
|
+
askNew() {
|
|
735
|
+
for (const listener of this.newAsks) {
|
|
736
|
+
listener();
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
onAskNew(listener) {
|
|
740
|
+
this.newAsks.add(listener);
|
|
741
|
+
return () => {
|
|
742
|
+
this.newAsks.delete(listener);
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
async load() {
|
|
746
|
+
if (this.reading) {
|
|
747
|
+
this.again = true;
|
|
748
|
+
return this.reading;
|
|
749
|
+
}
|
|
750
|
+
this.reading = this.read();
|
|
751
|
+
try {
|
|
752
|
+
await this.reading;
|
|
753
|
+
} finally {
|
|
754
|
+
this.reading = undefined;
|
|
755
|
+
if (this.again) {
|
|
756
|
+
this.again = false;
|
|
757
|
+
this.load();
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
async read() {
|
|
762
|
+
await this.api.storage.get(Keys.TASKS).catch(() => {
|
|
763
|
+
return;
|
|
764
|
+
});
|
|
765
|
+
const tasks = await this.api.callHost("list");
|
|
766
|
+
if (this.writing.size === 0) {
|
|
767
|
+
this.set({ tasks, loaded: true });
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
async loadRuns(taskId) {
|
|
771
|
+
await this.api.storage.get(Keys.runs(taskId)).catch(() => {
|
|
772
|
+
return;
|
|
773
|
+
});
|
|
774
|
+
const runs = await this.api.callHost("runs", taskId);
|
|
775
|
+
this.set({ runs: { ...this.state.runs, [taskId]: runs } });
|
|
776
|
+
}
|
|
777
|
+
call(method, ...params) {
|
|
778
|
+
return this.api.callHost(method, ...params);
|
|
779
|
+
}
|
|
780
|
+
async add(input) {
|
|
781
|
+
const task = await this.call("add", input);
|
|
782
|
+
await this.load();
|
|
783
|
+
return task;
|
|
784
|
+
}
|
|
785
|
+
async update(id, patch) {
|
|
786
|
+
const task = await this.call("update", id, patch);
|
|
787
|
+
await this.load();
|
|
788
|
+
return task;
|
|
789
|
+
}
|
|
790
|
+
setEnabled(id, enabled) {
|
|
791
|
+
return this.change(id, (task) => ({ ...task, enabled }), () => this.call("setEnabled", id, enabled));
|
|
792
|
+
}
|
|
793
|
+
runNow(id) {
|
|
794
|
+
return this.change(id, (task) => ({ ...task, lastStatus: "running" }), () => this.call("run", id));
|
|
795
|
+
}
|
|
796
|
+
remove(id) {
|
|
797
|
+
return this.change(id, () => {
|
|
798
|
+
return;
|
|
799
|
+
}, async () => {
|
|
800
|
+
await this.call("remove", id);
|
|
801
|
+
const { [id]: _gone, ...runs } = this.state.runs;
|
|
802
|
+
this.set({ runs });
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
async change(id, patch, send) {
|
|
806
|
+
const before = this.state.tasks;
|
|
807
|
+
this.writing.add(id);
|
|
808
|
+
this.set({ tasks: before.map((task) => task.id === id ? patch(task) : task).filter((task) => task !== undefined) });
|
|
809
|
+
try {
|
|
810
|
+
await send();
|
|
811
|
+
} catch (error) {
|
|
812
|
+
this.set({ tasks: before });
|
|
813
|
+
throw error;
|
|
814
|
+
} finally {
|
|
815
|
+
this.writing.delete(id);
|
|
816
|
+
}
|
|
817
|
+
await this.load();
|
|
818
|
+
}
|
|
819
|
+
set(change) {
|
|
820
|
+
this.state = { ...this.state, ...change };
|
|
821
|
+
for (const listener of this.listeners) {
|
|
822
|
+
listener();
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
async function openRun(run) {
|
|
827
|
+
if (!run.sessionFile) {
|
|
828
|
+
pi.ui.notify(t("noChat"), "warning");
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
831
|
+
try {
|
|
832
|
+
const open = (await pi.server.listSessions()).find((session) => session.sessionFile === run.sessionFile);
|
|
833
|
+
const sessionId = open?.sessionId ?? (await pi.server.openSession({ cwd: run.cwd, sessionFile: run.sessionFile, group: NAME })).sessionId;
|
|
834
|
+
await pi.switchSession(sessionId);
|
|
835
|
+
pi.ui.showView("");
|
|
836
|
+
} catch (error) {
|
|
837
|
+
pi.ui.notify(t("failedAction", { message: message(error) }), "error");
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
async function openMaking(cwd) {
|
|
841
|
+
const model = await pi.packages.getExtensionData(EXTENSIONS, "makeModel").catch(() => {
|
|
842
|
+
return;
|
|
843
|
+
});
|
|
844
|
+
if (typeof model === "string" && model) {
|
|
845
|
+
try {
|
|
846
|
+
return (await pi.server.openSession({ cwd, model })).sessionId;
|
|
847
|
+
} catch (error) {
|
|
848
|
+
pi.ui.notify(t("modelFailed", { model, message: message(error) }), "warning");
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
return (await pi.server.openSession({ cwd })).sessionId;
|
|
852
|
+
}
|
|
853
|
+
async function makeExtension(task, runs) {
|
|
854
|
+
try {
|
|
855
|
+
const { cwd } = await pi.server.getServerInfo();
|
|
856
|
+
const sessionId = openMaking(cwd);
|
|
857
|
+
await pi.switchSession(sessionId, { title: t("makeExtension"), cwd });
|
|
858
|
+
await pi.server.prompt(await sessionId, {
|
|
859
|
+
clientMessageId: `ta-cron-extension:${task.id}:${Date.now()}`,
|
|
860
|
+
message: TaskExtension.message(task, runs, pi.ui.language)
|
|
861
|
+
});
|
|
862
|
+
} catch (error) {
|
|
863
|
+
pi.ui.notify(t("failedAction", { message: message(error) }), "error");
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
async function changeTask(task, runs) {
|
|
867
|
+
const text = (await pi.ui.input(t("changeTitle", { name: task.name }), t("changePlaceholder")))?.trim();
|
|
868
|
+
if (!text) {
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
try {
|
|
872
|
+
const sessionId = pi.server.openSession({ cwd: task.cwd }).then((session) => session.sessionId);
|
|
873
|
+
await pi.switchSession(sessionId, { title: t("changeTitle", { name: task.name }), cwd: task.cwd });
|
|
874
|
+
await pi.server.prompt(await sessionId, {
|
|
875
|
+
clientMessageId: `ta-cron-change:${task.id}:${Date.now()}`,
|
|
876
|
+
message: TaskChange.message(task, runs, text, pi.ui.language)
|
|
877
|
+
});
|
|
878
|
+
} catch (error) {
|
|
879
|
+
pi.ui.notify(t("failedAction", { message: message(error) }), "error");
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
// web-src/react.ts
|
|
884
|
+
var React;
|
|
885
|
+
function bind(react) {
|
|
886
|
+
React = react;
|
|
887
|
+
}
|
|
888
|
+
var idle = () => [false, async (action) => await action()];
|
|
889
|
+
function useBusy(ui) {
|
|
890
|
+
return (ui.useBusy ?? idle)();
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// web-src/next-card.tsx
|
|
894
|
+
var SHOWN = 3;
|
|
895
|
+
function nextTasks(tasks, shown = SHOWN) {
|
|
896
|
+
const at = (task) => task.lastStatus === "running" ? 0 : task.nextRunAt ? new Date(task.nextRunAt).getTime() : Number.POSITIVE_INFINITY;
|
|
897
|
+
return tasks.filter((task) => task.lastStatus === "running" || task.enabled && task.nextRunAt).sort((a, b) => at(a) - at(b)).slice(0, shown);
|
|
898
|
+
}
|
|
899
|
+
function NextCard({ client }) {
|
|
900
|
+
const { tasks, loaded } = React.useSyncExternalStore((listener) => client.subscribe(listener), () => client.state);
|
|
901
|
+
const [now, setNow] = React.useState(Date.now());
|
|
902
|
+
React.useEffect(() => {
|
|
903
|
+
const timer = setInterval(() => setNow(Date.now()), 30000);
|
|
904
|
+
return () => clearInterval(timer);
|
|
905
|
+
}, []);
|
|
906
|
+
if (!loaded) {
|
|
907
|
+
return /* @__PURE__ */ React.createElement(pi.ui.Skeleton, {
|
|
908
|
+
rows: 2
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
const next = nextTasks(tasks);
|
|
912
|
+
if (next.length === 0) {
|
|
913
|
+
return /* @__PURE__ */ React.createElement(pi.ui.Empty, {
|
|
914
|
+
title: t("cardEmpty"),
|
|
915
|
+
compact: true
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
919
|
+
className: "tcr-card"
|
|
920
|
+
}, next.map((task) => /* @__PURE__ */ React.createElement("button", {
|
|
921
|
+
key: task.id,
|
|
922
|
+
type: "button",
|
|
923
|
+
className: "tcr-card-row",
|
|
924
|
+
onClick: () => pi.ui.showView(PAGE)
|
|
925
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
926
|
+
className: "tcr-card-name"
|
|
927
|
+
}, task.name), /* @__PURE__ */ React.createElement("span", {
|
|
928
|
+
className: "tcr-card-when"
|
|
929
|
+
}, task.lastStatus === "running" ? t("running") : t("next", { time: until(new Date(task.nextRunAt ?? now).getTime(), now) })))));
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// web-src/notifier.ts
|
|
933
|
+
var FRESH_MS = 2 * 60000;
|
|
934
|
+
function watchRuns() {
|
|
935
|
+
const told = new Set;
|
|
936
|
+
let ready = false;
|
|
937
|
+
const tell = async () => {
|
|
938
|
+
const finished = await pi.storage.get(Keys.LATEST).catch(() => {
|
|
939
|
+
return;
|
|
940
|
+
});
|
|
941
|
+
const run = finished?.run;
|
|
942
|
+
if (!run || told.has(run.id)) {
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
945
|
+
told.add(run.id);
|
|
946
|
+
const ended = run.endedAt ? new Date(run.endedAt).getTime() : 0;
|
|
947
|
+
if (!ready || !finished.notify || Date.now() - ended > FRESH_MS) {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
const failed = run.status !== "success";
|
|
951
|
+
const title = t(failed ? "failed" : "finished", { name: finished.taskName });
|
|
952
|
+
pi.ui.notify(title, failed ? "error" : "info");
|
|
953
|
+
if (typeof document !== "undefined" && document.hidden && typeof Notification !== "undefined" && Notification.permission === "granted") {
|
|
954
|
+
const body = (run.error ?? run.summary ?? "").split(`
|
|
955
|
+
`)[0].slice(0, 160);
|
|
956
|
+
const notice = new Notification(title, { body, tag: run.id });
|
|
957
|
+
notice.onclick = () => {
|
|
958
|
+
window.focus();
|
|
959
|
+
pi.ui.showView(PAGE);
|
|
960
|
+
notice.close();
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
};
|
|
964
|
+
tell().finally(() => {
|
|
965
|
+
ready = true;
|
|
966
|
+
});
|
|
967
|
+
return pi.storage.onChange((keys) => {
|
|
968
|
+
if (keys.includes(Keys.LATEST)) {
|
|
969
|
+
tell();
|
|
970
|
+
}
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// web-src/commands.ts
|
|
975
|
+
var FLAG_NAMES = ["name", "notify", "model", "thinking", "cwd", "timeout"];
|
|
976
|
+
var TRAILING_FLAG = new RegExp(`(?:^|\\s)--(${FLAG_NAMES.join("|")})(?:=|\\s+)("[^"]*"|'[^']*'|\\S*)\\s*$`);
|
|
977
|
+
var ACTIONS = ["add", "list", "show", "runs", "run", "enable", "disable", "set", "remove", "clear", "help"];
|
|
978
|
+
var HELP = `Scheduled tasks: each run is a conversation of its own in the Ta service, which runs them while it runs.
|
|
979
|
+
|
|
980
|
+
/loop <when> <prompt> repeat: 30m, 2h, @daily, @hourly, or a cron expression in quotes ("0 9 * * 1-5")
|
|
981
|
+
/remind in <duration> <prompt> once, after a while: in 45m
|
|
982
|
+
/remind at <time> <prompt> once, at a time: at 15:30, at 2026-11-12 09:00
|
|
983
|
+
/schedule add <when> <prompt> as /loop
|
|
984
|
+
/schedule list the tasks
|
|
985
|
+
/schedule show <task> a task and its last runs
|
|
986
|
+
/schedule run <task> run it now; its schedule stays
|
|
987
|
+
/schedule enable|disable <task>
|
|
988
|
+
/schedule set <task> [flags] change it; a value of - clears the flag
|
|
989
|
+
/schedule remove <task>
|
|
990
|
+
/schedule clear remove the tasks of this directory
|
|
991
|
+
|
|
992
|
+
A task is its id, the start of it, or its name. Flags at the end of a prompt:
|
|
993
|
+
--name <name> --notify always|error|never --model <provider/model> --thinking <level> --cwd <directory>
|
|
994
|
+
--timeout <duration> how long a run may take before it is stopped, 5m to 4h; default 30m`;
|
|
995
|
+
var CommandParser;
|
|
996
|
+
((CommandParser) => {
|
|
997
|
+
function splitFlags(text) {
|
|
998
|
+
const flags = {};
|
|
999
|
+
let rest = text.trim();
|
|
1000
|
+
for (let match = TRAILING_FLAG.exec(rest);match; match = TRAILING_FLAG.exec(rest)) {
|
|
1001
|
+
const key = match[1];
|
|
1002
|
+
if (flags[key] === undefined) {
|
|
1003
|
+
flags[key] = unquote(match[2]);
|
|
1167
1004
|
}
|
|
1168
|
-
|
|
1169
|
-
this.load();
|
|
1170
|
-
}
|
|
1171
|
-
dispose() {
|
|
1172
|
-
this.stop?.();
|
|
1173
|
-
this.listeners.clear();
|
|
1174
|
-
this.newAsks.clear();
|
|
1175
|
-
}
|
|
1176
|
-
subscribe(listener) {
|
|
1177
|
-
this.listeners.add(listener);
|
|
1178
|
-
return () => this.listeners.delete(listener);
|
|
1179
|
-
}
|
|
1180
|
-
askNew() {
|
|
1181
|
-
for (const listener of this.newAsks) {
|
|
1182
|
-
listener();
|
|
1005
|
+
rest = rest.slice(0, match.index).trimEnd();
|
|
1183
1006
|
}
|
|
1007
|
+
return { rest, flags };
|
|
1184
1008
|
}
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1009
|
+
CommandParser.splitFlags = splitFlags;
|
|
1010
|
+
function repeating(text) {
|
|
1011
|
+
const { rest, flags } = splitFlags(text);
|
|
1012
|
+
const { schedule, remainder } = leadingSchedule(rest);
|
|
1013
|
+
return input(schedule, remainder, flags);
|
|
1190
1014
|
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1015
|
+
CommandParser.repeating = repeating;
|
|
1016
|
+
function reminder(text, now) {
|
|
1017
|
+
const { rest, flags } = splitFlags(text);
|
|
1018
|
+
const words = rest.split(/\s+/);
|
|
1019
|
+
let at;
|
|
1020
|
+
let used = 0;
|
|
1021
|
+
if (words[0] === "at") {
|
|
1022
|
+
const time = clockTime(words.slice(1, 3), now);
|
|
1023
|
+
at = time?.date;
|
|
1024
|
+
used = 1 + (time?.words ?? 0);
|
|
1025
|
+
} else {
|
|
1026
|
+
const offset = words[0] === "in" ? 1 : 0;
|
|
1027
|
+
const ms = Duration.parse(words[offset] ?? "");
|
|
1028
|
+
at = ms === undefined ? undefined : new Date(now.getTime() + ms);
|
|
1029
|
+
used = offset + 1;
|
|
1195
1030
|
}
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
await this.reading;
|
|
1199
|
-
} finally {
|
|
1200
|
-
this.reading = undefined;
|
|
1201
|
-
if (this.again) {
|
|
1202
|
-
this.again = false;
|
|
1203
|
-
this.load();
|
|
1204
|
-
}
|
|
1031
|
+
if (!at) {
|
|
1032
|
+
throw new Error("Say when: /remind in 45m <prompt>, or /remind at 15:30 <prompt>.");
|
|
1205
1033
|
}
|
|
1034
|
+
return input({ kind: "once", at: at.toISOString() }, words.slice(used).join(" "), flags);
|
|
1206
1035
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1213
|
-
|
|
1036
|
+
CommandParser.reminder = reminder;
|
|
1037
|
+
function action(text) {
|
|
1038
|
+
const trimmed = text.trim();
|
|
1039
|
+
const first = trimmed.split(/\s+/, 1)[0] || "list";
|
|
1040
|
+
const action2 = first === "delete" ? "remove" : first === "ls" ? "list" : first;
|
|
1041
|
+
if (!ACTIONS.includes(action2)) {
|
|
1042
|
+
throw new Error(`/schedule does not know ${JSON.stringify(first)}. It takes: ${ACTIONS.join(", ")}.`);
|
|
1214
1043
|
}
|
|
1044
|
+
return { action: action2, rest: trimmed.slice(trimmed ? first.length : 0).trim() };
|
|
1215
1045
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1046
|
+
CommandParser.action = action;
|
|
1047
|
+
function patch(text) {
|
|
1048
|
+
const { rest, flags } = splitFlags(text);
|
|
1049
|
+
if (!rest) {
|
|
1050
|
+
throw new Error("Name the task: /schedule set <task> --model <provider/model>.");
|
|
1051
|
+
}
|
|
1052
|
+
const value = (flag) => flag === undefined ? undefined : flag === "-" ? "" : flag;
|
|
1053
|
+
const patch2 = {};
|
|
1054
|
+
if (flags.name !== undefined) {
|
|
1055
|
+
patch2.name = value(flags.name);
|
|
1056
|
+
}
|
|
1057
|
+
if (flags.cwd !== undefined) {
|
|
1058
|
+
patch2.cwd = value(flags.cwd);
|
|
1059
|
+
}
|
|
1060
|
+
if (flags.model !== undefined) {
|
|
1061
|
+
patch2.model = value(flags.model);
|
|
1062
|
+
}
|
|
1063
|
+
if (flags.thinking !== undefined) {
|
|
1064
|
+
patch2.thinking = value(flags.thinking);
|
|
1065
|
+
}
|
|
1066
|
+
if (flags.notify !== undefined) {
|
|
1067
|
+
patch2.notify = value(flags.notify);
|
|
1068
|
+
}
|
|
1069
|
+
if (flags.timeout !== undefined) {
|
|
1070
|
+
patch2.timeout = value(flags.timeout);
|
|
1071
|
+
}
|
|
1072
|
+
if (Object.keys(patch2).length === 0) {
|
|
1073
|
+
throw new Error("Say what changes: --name, --notify, --model, --thinking, --cwd or --timeout.");
|
|
1074
|
+
}
|
|
1075
|
+
return { ref: rest, patch: patch2 };
|
|
1241
1076
|
}
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
|
|
1077
|
+
CommandParser.patch = patch;
|
|
1078
|
+
function leadingSchedule(text) {
|
|
1079
|
+
const trimmed = text.trim();
|
|
1080
|
+
const quote = trimmed[0];
|
|
1081
|
+
if (quote === '"' || quote === "'") {
|
|
1082
|
+
const end = trimmed.indexOf(quote, 1);
|
|
1083
|
+
if (end < 0) {
|
|
1084
|
+
throw new Error("The cron expression has no closing quote.");
|
|
1085
|
+
}
|
|
1086
|
+
return { schedule: ScheduleUtil.check({ kind: "cron", expression: trimmed.slice(1, end) }), remainder: trimmed.slice(end + 1) };
|
|
1087
|
+
}
|
|
1088
|
+
const [first = ""] = trimmed.split(/\s+/, 1);
|
|
1089
|
+
const remainder = trimmed.slice(first.length);
|
|
1090
|
+
if (first.startsWith("@")) {
|
|
1091
|
+
return { schedule: ScheduleUtil.check({ kind: "cron", expression: first }), remainder };
|
|
1092
|
+
}
|
|
1093
|
+
if (Duration.parse(first) !== undefined) {
|
|
1094
|
+
return { schedule: ScheduleUtil.check({ kind: "interval", every: first }), remainder };
|
|
1095
|
+
}
|
|
1096
|
+
throw new Error('Start with when: 30m, 2h, @daily, or a cron expression in quotes such as "0 9 * * 1-5".');
|
|
1250
1097
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1098
|
+
CommandParser.leadingSchedule = leadingSchedule;
|
|
1099
|
+
function clockTime(words, now) {
|
|
1100
|
+
const [first = "", second = ""] = words;
|
|
1101
|
+
const hm = /^(\d{1,2}):(\d{2})$/;
|
|
1102
|
+
const day = /^(\d{4})-(\d{1,2})-(\d{1,2})$/;
|
|
1103
|
+
const time = hm.exec(first);
|
|
1104
|
+
if (time) {
|
|
1105
|
+
const date2 = new Date(now.getTime());
|
|
1106
|
+
date2.setHours(Number(time[1]), Number(time[2]), 0, 0);
|
|
1107
|
+
if (date2.getTime() <= now.getTime()) {
|
|
1108
|
+
date2.setDate(date2.getDate() + 1);
|
|
1109
|
+
}
|
|
1110
|
+
return valid(date2, Number(time[1]) < 24 && Number(time[2]) < 60) ? { date: date2, words: 1 } : undefined;
|
|
1262
1111
|
}
|
|
1263
|
-
|
|
1112
|
+
const date = day.exec(first);
|
|
1113
|
+
const later = hm.exec(second);
|
|
1114
|
+
if (date) {
|
|
1115
|
+
const at = new Date(Number(date[1]), Number(date[2]) - 1, Number(date[3]), later ? Number(later[1]) : 9, later ? Number(later[2]) : 0);
|
|
1116
|
+
return valid(at, true) ? { date: at, words: later ? 2 : 1 } : undefined;
|
|
1117
|
+
}
|
|
1118
|
+
const iso = /^\d{4}-\d{2}-\d{2}T/.test(first) ? new Date(first) : undefined;
|
|
1119
|
+
return iso && valid(iso, true) ? { date: iso, words: 1 } : undefined;
|
|
1264
1120
|
}
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1121
|
+
CommandParser.clockTime = clockTime;
|
|
1122
|
+
function valid(date, ok) {
|
|
1123
|
+
return ok && !Number.isNaN(date.getTime());
|
|
1124
|
+
}
|
|
1125
|
+
function input(schedule, prompt, flags) {
|
|
1126
|
+
const text = prompt.trim();
|
|
1127
|
+
if (!text) {
|
|
1128
|
+
throw new Error("Then say what Ta should do: the prompt of the task.");
|
|
1269
1129
|
}
|
|
1130
|
+
return {
|
|
1131
|
+
schedule,
|
|
1132
|
+
prompt: text,
|
|
1133
|
+
...flags.name ? { name: flags.name } : {},
|
|
1134
|
+
...flags.cwd ? { cwd: flags.cwd } : {},
|
|
1135
|
+
...flags.model ? { model: flags.model } : {},
|
|
1136
|
+
...flags.thinking ? { thinking: flags.thinking } : {},
|
|
1137
|
+
...flags.notify ? { notify: flags.notify } : {},
|
|
1138
|
+
...flags.timeout ? { timeout: flags.timeout } : {}
|
|
1139
|
+
};
|
|
1270
1140
|
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
if (!run.sessionFile) {
|
|
1274
|
-
pi.ui.notify(t("noChat"), "warning");
|
|
1275
|
-
return;
|
|
1141
|
+
function unquote(value) {
|
|
1142
|
+
return /^(["']).*\1$/.test(value) ? value.slice(1, -1) : value;
|
|
1276
1143
|
}
|
|
1277
|
-
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1144
|
+
function completions(prefix, tasks) {
|
|
1145
|
+
const parts = prefix.split(/\s+/);
|
|
1146
|
+
if (parts.length <= 1) {
|
|
1147
|
+
return ACTIONS.filter((action3) => action3.startsWith(parts[0] ?? "")).map((action3) => ({ value: `${action3} `, label: action3 }));
|
|
1148
|
+
}
|
|
1149
|
+
const [action2, ref] = parts;
|
|
1150
|
+
if (!["show", "runs", "run", "enable", "disable", "set", "remove"].includes(action2) || parts.length > 2) {
|
|
1151
|
+
return [];
|
|
1152
|
+
}
|
|
1153
|
+
return tasks.filter((task) => task.id.startsWith(ref) || task.name.startsWith(ref)).map((task) => ({ value: `${action2} ${task.id} `, label: task.id, description: task.name }));
|
|
1284
1154
|
}
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
});
|
|
1290
|
-
if (typeof model === "string" && model) {
|
|
1291
|
-
try {
|
|
1292
|
-
return (await pi.server.openSession({ cwd, model })).sessionId;
|
|
1293
|
-
} catch (error) {
|
|
1294
|
-
pi.ui.notify(t("modelFailed", { model, message: message(error) }), "warning");
|
|
1155
|
+
CommandParser.completions = completions;
|
|
1156
|
+
function loopCompletions(prefix) {
|
|
1157
|
+
if (/\s/.test(prefix)) {
|
|
1158
|
+
return [];
|
|
1295
1159
|
}
|
|
1160
|
+
return [...Object.keys(NICKNAMES), "5m", "30m", "1h", "1d"].filter((item) => item.startsWith(prefix)).map((item) => ({ value: `${item} `, label: item }));
|
|
1296
1161
|
}
|
|
1297
|
-
|
|
1298
|
-
}
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
message: TaskExtension.message(task, runs, pi.ui.language)
|
|
1307
|
-
});
|
|
1308
|
-
} catch (error) {
|
|
1309
|
-
pi.ui.notify(t("failedAction", { message: message(error) }), "error");
|
|
1162
|
+
CommandParser.loopCompletions = loopCompletions;
|
|
1163
|
+
})(CommandParser ||= {});
|
|
1164
|
+
var CronText;
|
|
1165
|
+
((CronText) => {
|
|
1166
|
+
function task(task2, now = new Date) {
|
|
1167
|
+
const state = !task2.enabled ? "off" : task2.lastStatus === "running" ? "running" : task2.nextRunAt ? `next ${ScheduleUtil.clock(new Date(task2.nextRunAt), now)}` : "done";
|
|
1168
|
+
const last = task2.lastStatus && task2.lastStatus !== "running" ? `, last ${task2.lastStatus}` : "";
|
|
1169
|
+
const timeout = task2.timeout ? `, stops after ${task2.timeout}` : "";
|
|
1170
|
+
return `${task2.id} ${task2.name} (${ScheduleUtil.describe(task2.schedule, "en", now)}; ${state}${last}${timeout}) in ${task2.cwd}`;
|
|
1310
1171
|
}
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
}
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
return [
|
|
1344
|
-
{
|
|
1345
|
-
key: "make-task",
|
|
1346
|
-
label: t("fromChat"),
|
|
1347
|
-
detail: t("fromChatDetail"),
|
|
1348
|
-
icon: /* @__PURE__ */ React.createElement(AlarmClock, {
|
|
1349
|
-
size: 16
|
|
1350
|
-
}),
|
|
1351
|
-
items: [
|
|
1352
|
-
...PRESETS.map((schedule) => ({
|
|
1353
|
-
key: `make-task:${schedule.kind === "cron" ? schedule.expression : ""}`,
|
|
1354
|
-
label: ScheduleUtil.describe(schedule, pi.ui.language),
|
|
1355
|
-
group,
|
|
1356
|
-
run: () => send(conversation, schedule)
|
|
1357
|
-
})),
|
|
1358
|
-
{ key: "make-task:ask", label: t("fromChatOther"), detail: t("fromChatOtherDetail"), group, run: () => send(conversation) }
|
|
1359
|
-
]
|
|
1360
|
-
}
|
|
1361
|
-
];
|
|
1172
|
+
CronText.task = task;
|
|
1173
|
+
function run(run2, now = new Date) {
|
|
1174
|
+
const time = ScheduleUtil.clock(new Date(run2.startedAt), now);
|
|
1175
|
+
const took = run2.endedAt ? ` in ${Duration.format(new Date(run2.endedAt).getTime() - new Date(run2.startedAt).getTime())}` : "";
|
|
1176
|
+
const what = run2.error ?? run2.summary ?? "";
|
|
1177
|
+
const file = run2.sessionFile ? `
|
|
1178
|
+
conversation: ${run2.sessionFile}` : "";
|
|
1179
|
+
return `${run2.id} ${time} ${run2.status}${took}${run2.trigger === "manual" ? " (by hand)" : ""}${what ? `
|
|
1180
|
+
${what.replace(/\n/g, `
|
|
1181
|
+
`)}` : ""}${file}`;
|
|
1182
|
+
}
|
|
1183
|
+
CronText.run = run;
|
|
1184
|
+
function reply(reply2) {
|
|
1185
|
+
switch (reply2.kind) {
|
|
1186
|
+
case "task":
|
|
1187
|
+
return `${capital(reply2.event)}: ${task(reply2.task)}`;
|
|
1188
|
+
case "removed":
|
|
1189
|
+
return reply2.tasks.length ? `Removed ${reply2.tasks.map((item) => item.name).join(", ")}.` : "No tasks to remove.";
|
|
1190
|
+
case "started":
|
|
1191
|
+
return `Started ${reply2.task.name} (${reply2.run.id}); it runs in a conversation of its own.`;
|
|
1192
|
+
case "list":
|
|
1193
|
+
return reply2.tasks.length ? reply2.tasks.map((item) => task(item)).join(`
|
|
1194
|
+
`) : "No scheduled tasks. Make one with /loop or /remind.";
|
|
1195
|
+
case "show":
|
|
1196
|
+
return `${task(reply2.task)}
|
|
1197
|
+
prompt: ${reply2.task.prompt}
|
|
1198
|
+
${reply2.runs.length ? reply2.runs.map((item) => run(item)).join(`
|
|
1199
|
+
`) : "No runs yet."}`;
|
|
1200
|
+
case "help":
|
|
1201
|
+
return HELP;
|
|
1202
|
+
case "error":
|
|
1203
|
+
return reply2.message;
|
|
1362
1204
|
}
|
|
1363
|
-
};
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
// web-src/next-card.tsx
|
|
1367
|
-
var SHOWN = 3;
|
|
1368
|
-
function nextTasks(tasks, shown = SHOWN) {
|
|
1369
|
-
const at = (task) => task.lastStatus === "running" ? 0 : task.nextRunAt ? new Date(task.nextRunAt).getTime() : Number.POSITIVE_INFINITY;
|
|
1370
|
-
return tasks.filter((task) => task.lastStatus === "running" || task.enabled && task.nextRunAt).sort((a, b) => at(a) - at(b)).slice(0, shown);
|
|
1371
|
-
}
|
|
1372
|
-
function NextCard({ client }) {
|
|
1373
|
-
const { tasks, loaded } = React.useSyncExternalStore((listener) => client.subscribe(listener), () => client.state);
|
|
1374
|
-
const [now, setNow] = React.useState(Date.now());
|
|
1375
|
-
React.useEffect(() => {
|
|
1376
|
-
const timer = setInterval(() => setNow(Date.now()), 30000);
|
|
1377
|
-
return () => clearInterval(timer);
|
|
1378
|
-
}, []);
|
|
1379
|
-
if (!loaded) {
|
|
1380
|
-
return /* @__PURE__ */ React.createElement(pi.ui.Skeleton, {
|
|
1381
|
-
rows: 2
|
|
1382
|
-
});
|
|
1383
1205
|
}
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
return
|
|
1387
|
-
title: t("cardEmpty"),
|
|
1388
|
-
compact: true
|
|
1389
|
-
});
|
|
1206
|
+
CronText.reply = reply;
|
|
1207
|
+
function capital(text) {
|
|
1208
|
+
return text[0].toUpperCase() + text.slice(1);
|
|
1390
1209
|
}
|
|
1391
|
-
|
|
1392
|
-
className: "tcr-card"
|
|
1393
|
-
}, next.map((task) => /* @__PURE__ */ React.createElement("button", {
|
|
1394
|
-
key: task.id,
|
|
1395
|
-
type: "button",
|
|
1396
|
-
className: "tcr-card-row",
|
|
1397
|
-
onClick: () => pi.ui.showView(PAGE)
|
|
1398
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
1399
|
-
className: "tcr-card-name"
|
|
1400
|
-
}, task.name), /* @__PURE__ */ React.createElement("span", {
|
|
1401
|
-
className: "tcr-card-when"
|
|
1402
|
-
}, task.lastStatus === "running" ? t("running") : t("next", { time: until(new Date(task.nextRunAt ?? now).getTime(), now) })))));
|
|
1403
|
-
}
|
|
1404
|
-
|
|
1405
|
-
// web-src/notifier.ts
|
|
1406
|
-
var FRESH_MS = 2 * 60000;
|
|
1407
|
-
function watchRuns() {
|
|
1408
|
-
const told = new Set;
|
|
1409
|
-
let ready = false;
|
|
1410
|
-
const tell = async () => {
|
|
1411
|
-
const finished = await pi.storage.get(Keys.LATEST).catch(() => {
|
|
1412
|
-
return;
|
|
1413
|
-
});
|
|
1414
|
-
const run = finished?.run;
|
|
1415
|
-
if (!run || told.has(run.id)) {
|
|
1416
|
-
return;
|
|
1417
|
-
}
|
|
1418
|
-
told.add(run.id);
|
|
1419
|
-
const ended = run.endedAt ? new Date(run.endedAt).getTime() : 0;
|
|
1420
|
-
if (!ready || !finished.notify || Date.now() - ended > FRESH_MS) {
|
|
1421
|
-
return;
|
|
1422
|
-
}
|
|
1423
|
-
const failed = run.status !== "success";
|
|
1424
|
-
const title = t(failed ? "failed" : "finished", { name: finished.taskName });
|
|
1425
|
-
pi.ui.notify(title, failed ? "error" : "info");
|
|
1426
|
-
if (typeof document !== "undefined" && document.hidden && typeof Notification !== "undefined" && Notification.permission === "granted") {
|
|
1427
|
-
const body = (run.error ?? run.summary ?? "").split(`
|
|
1428
|
-
`)[0].slice(0, 160);
|
|
1429
|
-
const notice = new Notification(title, { body, tag: run.id });
|
|
1430
|
-
notice.onclick = () => {
|
|
1431
|
-
window.focus();
|
|
1432
|
-
pi.ui.showView(PAGE);
|
|
1433
|
-
notice.close();
|
|
1434
|
-
};
|
|
1435
|
-
}
|
|
1436
|
-
};
|
|
1437
|
-
tell().finally(() => {
|
|
1438
|
-
ready = true;
|
|
1439
|
-
});
|
|
1440
|
-
return pi.storage.onChange((keys) => {
|
|
1441
|
-
if (keys.includes(Keys.LATEST)) {
|
|
1442
|
-
tell();
|
|
1443
|
-
}
|
|
1444
|
-
});
|
|
1445
|
-
}
|
|
1210
|
+
})(CronText ||= {});
|
|
1446
1211
|
|
|
1447
1212
|
// web-src/reply.tsx
|
|
1448
1213
|
function TaskLine({ task }) {
|
|
@@ -1565,6 +1330,12 @@ var STYLE = `
|
|
|
1565
1330
|
|
|
1566
1331
|
/* The tasks */
|
|
1567
1332
|
.tcr-list { display: flex; flex-direction: column; gap: 10px; }
|
|
1333
|
+
/* The tasks that are off, folded under the list: a quiet title that opens them. */
|
|
1334
|
+
.tcr-off-group { margin-top: 18px; }
|
|
1335
|
+
.tcr-fold { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px -4px; padding: 4px 8px 4px 4px; border: 0; border-radius: 8px; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; cursor: pointer; }
|
|
1336
|
+
.tcr-fold:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
1337
|
+
.tcr-fold .tcr-count { margin-left: 2px; }
|
|
1338
|
+
.tcr-off-group.tcr-open .tcr-fold .tcr-chevron { transform: rotate(90deg); }
|
|
1568
1339
|
.tcr-task { border: 1px solid var(--ta-border-muted); border-radius: 14px; background: var(--ta-card); transition: border-color 140ms, box-shadow 180ms; animation: tcr-in 160ms var(--ta-ease) both; }
|
|
1569
1340
|
.tcr-task:hover, .tcr-task.tcr-open { border-color: var(--ta-border); }
|
|
1570
1341
|
.tcr-task.tcr-open { box-shadow: var(--ta-shadow-pop); }
|
|
@@ -1737,6 +1508,8 @@ var STYLE = `
|
|
|
1737
1508
|
[data-touch] .tcr-run-head:hover { background: none; }
|
|
1738
1509
|
[data-touch] .tcr-run-head:active { background: var(--ta-hover); }
|
|
1739
1510
|
[data-touch] .tcr-button { height: 36px; padding: 0 14px; }
|
|
1511
|
+
[data-touch] .tcr-fold { min-height: 40px; font-size: max(15px, calc(13px * var(--ta-font-scale))); }
|
|
1512
|
+
[data-touch] .tcr-fold:hover { background: none; }
|
|
1740
1513
|
[data-touch] .tcr-segment { height: 32px; }
|
|
1741
1514
|
[data-touch] .tcr-more-toggle { padding: 8px 6px 8px 4px; font-size: max(15px, calc(13.5px * var(--ta-font-scale))); }
|
|
1742
1515
|
/* A link of the dialog, which a finger taps too: a line of its own height. */
|
|
@@ -2262,7 +2035,7 @@ function ExampleArt({ picture }) {
|
|
|
2262
2035
|
}
|
|
2263
2036
|
|
|
2264
2037
|
// web-src/task-util.ts
|
|
2265
|
-
var
|
|
2038
|
+
var PROMPT_MAX3 = 20000;
|
|
2266
2039
|
var NAME_MAX = 80;
|
|
2267
2040
|
var PREFIX_MIN = 4;
|
|
2268
2041
|
var TaskUtil;
|
|
@@ -2373,8 +2146,8 @@ var TaskUtil;
|
|
|
2373
2146
|
if (!prompt) {
|
|
2374
2147
|
throw new Error("A task needs a prompt: what Ta should do each time it runs.");
|
|
2375
2148
|
}
|
|
2376
|
-
if (prompt.length >
|
|
2377
|
-
throw new Error(`A prompt is at most ${
|
|
2149
|
+
if (prompt.length > PROMPT_MAX3) {
|
|
2150
|
+
throw new Error(`A prompt is at most ${PROMPT_MAX3} characters; keep long instructions in a file and name it.`);
|
|
2378
2151
|
}
|
|
2379
2152
|
return prompt;
|
|
2380
2153
|
}
|
|
@@ -2431,6 +2204,15 @@ var TaskUtil;
|
|
|
2431
2204
|
return line.replace(/^\s*(?:#{1,6}\s+|[-*+]\s+|>\s*|\d+[.)]\s+)/, "").replace(/\*\*|__|`/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").trim();
|
|
2432
2205
|
}
|
|
2433
2206
|
TaskUtil.firstLine = firstLine;
|
|
2207
|
+
function split(tasks, stay = new Set) {
|
|
2208
|
+
const listed = [];
|
|
2209
|
+
const off = [];
|
|
2210
|
+
for (const task of tasks) {
|
|
2211
|
+
(task.enabled || task.lastStatus === "running" || stay.has(task.id) ? listed : off).push(task);
|
|
2212
|
+
}
|
|
2213
|
+
return [listed, off];
|
|
2214
|
+
}
|
|
2215
|
+
TaskUtil.split = split;
|
|
2434
2216
|
function missed(task, now) {
|
|
2435
2217
|
return task.schedule.kind === "once" && !!task.nextRunAt && now.getTime() - new Date(task.nextRunAt).getTime() > Limits.GRACE_MS;
|
|
2436
2218
|
}
|
|
@@ -2618,6 +2400,7 @@ function Detail({ client, task, now, onEdit }) {
|
|
|
2618
2400
|
const Play = icon("Play");
|
|
2619
2401
|
const Pencil = icon("Pencil");
|
|
2620
2402
|
const Sparkles = icon("Sparkles");
|
|
2403
|
+
const Ask = icon("MessageCircle");
|
|
2621
2404
|
const running = task.lastStatus === "running";
|
|
2622
2405
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2623
2406
|
className: "tcr-detail"
|
|
@@ -2637,6 +2420,12 @@ function Detail({ client, task, now, onEdit }) {
|
|
|
2637
2420
|
}, /* @__PURE__ */ React.createElement(Pencil, {
|
|
2638
2421
|
size: 14
|
|
2639
2422
|
}), t("edit")), /* @__PURE__ */ React.createElement("button", {
|
|
2423
|
+
type: "button",
|
|
2424
|
+
className: "tcr-button",
|
|
2425
|
+
onClick: () => void changeTask(task, list)
|
|
2426
|
+
}, /* @__PURE__ */ React.createElement(Ask, {
|
|
2427
|
+
size: 14
|
|
2428
|
+
}), t("change")), /* @__PURE__ */ React.createElement("button", {
|
|
2640
2429
|
type: "button",
|
|
2641
2430
|
className: "tcr-button tcr-accent",
|
|
2642
2431
|
title: t("makeExtensionHint"),
|
|
@@ -2666,7 +2455,13 @@ function Detail({ client, task, now, onEdit }) {
|
|
|
2666
2455
|
last: index === list.length - 1
|
|
2667
2456
|
}))));
|
|
2668
2457
|
}
|
|
2669
|
-
function TaskRow({
|
|
2458
|
+
function TaskRow({
|
|
2459
|
+
client,
|
|
2460
|
+
task,
|
|
2461
|
+
now,
|
|
2462
|
+
onEdit,
|
|
2463
|
+
onSwitch
|
|
2464
|
+
}) {
|
|
2670
2465
|
const [open, setOpen] = React.useState(false);
|
|
2671
2466
|
const [menu, openMenu] = pi.ui.useContextMenu();
|
|
2672
2467
|
const More = icon("Ellipsis");
|
|
@@ -2684,6 +2479,7 @@ function TaskRow({ client, task, now, onEdit }) {
|
|
|
2684
2479
|
[
|
|
2685
2480
|
{ key: "run", label: t("runNow"), icon: icon("Play"), disabled: running, run: () => void guard(() => client.runNow(task.id)) },
|
|
2686
2481
|
{ key: "edit", label: t("edit"), icon: icon("Pencil"), run: () => onEdit(task) },
|
|
2482
|
+
{ key: "change", label: t("change"), icon: icon("MessageCircle"), run: () => void changeTask(task, client.state.runs[task.id]) },
|
|
2687
2483
|
{ key: "extension", label: t("makeExtension"), icon: icon("Sparkles"), run: () => void makeExtension(task, client.state.runs[task.id]) }
|
|
2688
2484
|
],
|
|
2689
2485
|
[{ key: "delete", label: t("delete"), icon: icon("Trash2"), danger: true, run: () => void remove() }]
|
|
@@ -2737,6 +2533,7 @@ function TaskRow({ client, task, now, onEdit }) {
|
|
|
2737
2533
|
"aria-busy": switching || undefined,
|
|
2738
2534
|
onChange: (event) => {
|
|
2739
2535
|
const on = event.target.checked;
|
|
2536
|
+
onSwitch(task, on);
|
|
2740
2537
|
run(() => guard(() => client.setEnabled(task.id, on)));
|
|
2741
2538
|
}
|
|
2742
2539
|
})), /* @__PURE__ */ React.createElement("button", {
|
|
@@ -2777,7 +2574,24 @@ function TasksPage({ client }) {
|
|
|
2777
2574
|
React.useEffect(() => client.onAskNew(() => setEditing({})), [client]);
|
|
2778
2575
|
const running = tasks.filter((task) => task.lastStatus === "running").length;
|
|
2779
2576
|
const sorted = [...tasks].sort((a, b) => Number(b.enabled) - Number(a.enabled) || (a.nextRunAt ?? "~").localeCompare(b.nextRunAt ?? "~"));
|
|
2577
|
+
const [stay, setStay] = React.useState(new Set);
|
|
2578
|
+
const [offOpen, setOffOpen] = React.useState(false);
|
|
2579
|
+
const [listed, off] = TaskUtil.split(sorted, stay);
|
|
2780
2580
|
const edit = React.useCallback((task) => setEditing({ task }), []);
|
|
2581
|
+
const onSwitch = React.useCallback((task, on) => {
|
|
2582
|
+
if (!on) {
|
|
2583
|
+
setStay((ids) => new Set(ids).add(task.id));
|
|
2584
|
+
}
|
|
2585
|
+
}, []);
|
|
2586
|
+
const Chevron = icon("ChevronRight");
|
|
2587
|
+
const row = (task) => /* @__PURE__ */ React.createElement(TaskRow, {
|
|
2588
|
+
key: task.id,
|
|
2589
|
+
client,
|
|
2590
|
+
task,
|
|
2591
|
+
now,
|
|
2592
|
+
onEdit: edit,
|
|
2593
|
+
onSwitch
|
|
2594
|
+
});
|
|
2781
2595
|
return /* @__PURE__ */ React.createElement("div", {
|
|
2782
2596
|
className: "tcr-scroll"
|
|
2783
2597
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
@@ -2794,13 +2608,23 @@ function TasksPage({ client }) {
|
|
|
2794
2608
|
onPick: setEditing
|
|
2795
2609
|
}), /* @__PURE__ */ React.createElement("div", {
|
|
2796
2610
|
className: "tcr-list"
|
|
2797
|
-
},
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2611
|
+
}, listed.map(row)), off.length > 0 && /* @__PURE__ */ React.createElement("section", {
|
|
2612
|
+
className: `tcr-off-group${offOpen ? " tcr-open" : ""}`
|
|
2613
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
2614
|
+
type: "button",
|
|
2615
|
+
className: "tcr-fold",
|
|
2616
|
+
"aria-expanded": offOpen,
|
|
2617
|
+
onClick: () => setOffOpen(!offOpen)
|
|
2618
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
2619
|
+
className: "tcr-chevron",
|
|
2620
|
+
"aria-hidden": "true"
|
|
2621
|
+
}, /* @__PURE__ */ React.createElement(Chevron, {
|
|
2622
|
+
size: 14
|
|
2623
|
+
})), t("offGroup"), /* @__PURE__ */ React.createElement("span", {
|
|
2624
|
+
className: "tcr-count"
|
|
2625
|
+
}, off.length)), offOpen && /* @__PURE__ */ React.createElement("div", {
|
|
2626
|
+
className: "tcr-list"
|
|
2627
|
+
}, off.map(row)))), editing && /* @__PURE__ */ React.createElement(TaskEditor, {
|
|
2804
2628
|
client,
|
|
2805
2629
|
editing,
|
|
2806
2630
|
onClose: () => setEditing(undefined)
|
|
@@ -2870,7 +2694,6 @@ function activate(pi2) {
|
|
|
2870
2694
|
})
|
|
2871
2695
|
});
|
|
2872
2696
|
pi2.registerMessageRenderer(REPLY_TYPE, ReplyMessage);
|
|
2873
|
-
pi2.registerComposerAddon(composerAddon());
|
|
2874
2697
|
CronToolLine.register(pi2, (key) => t(key));
|
|
2875
2698
|
const stopWatching = watchRuns();
|
|
2876
2699
|
return () => {
|