@celljs/ta 4.12.0 → 4.13.1
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 +182 -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 +75 -11
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +2 -2
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +5 -2
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +6 -4
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +7 -5
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.js +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +44 -3
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +12 -2
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +29 -4
- package/dist/pi/packages/ta-agents/package.json +1 -1
- package/dist/pi/packages/ta-bots/extension/index.mjs +72 -0
- package/dist/pi/packages/ta-bots/host/index.mjs +178 -0
- package/dist/pi/packages/ta-bots/package.json +7 -2
- package/dist/pi/packages/ta-changes/extension/index.mjs +72 -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 +78 -4
- package/dist/pi/packages/ta-channels/host/index.mjs +289 -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/extension.js +2 -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/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +7 -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/package.json +26 -2
- package/dist/pi/packages/ta-channels/web/index.js +137 -27
- 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 +113 -258
- 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 +12 -8
- 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 +15 -11
- package/dist/pi/packages/ta-extensions/web/index.js +197 -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 +446 -3
- package/dist/pi/packages/ta-glance/lib/card.js +38 -12
- 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 +6 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +41 -7
- 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 +9 -1
- package/dist/pi/packages/ta-glance/package.json +1 -1
- package/dist/pi/packages/ta-glance/web/index.js +87 -19
- 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 +741 -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 +237 -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.js +109 -2
- package/dist/pi/packages/ta-manual/lib/topics.d.ts +4 -0
- package/dist/pi/packages/ta-manual/lib/topics.js +123 -11
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +45 -10
- package/dist/pi/packages/ta-manual/web/index.js +567 -12
- 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 +1787 -0
- package/dist/pi/packages/ta-moments/host/index.mjs +2415 -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 +2008 -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 +410 -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 +85 -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 +311 -134
- package/dist/pi/packages/ta-recall/host/index.mjs +472 -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/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 +31 -23
- 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 +414 -153
- package/dist/pi/packages/ta-rooms/README.en.md +6 -3
- package/dist/pi/packages/ta-rooms/README.md +6 -3
- package/dist/pi/packages/ta-rooms/extension/index.mjs +194 -9
- package/dist/pi/packages/ta-rooms/host/index.mjs +1023 -234
- 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 +43 -40
- package/dist/pi/packages/ta-rooms/lib/double-host.js +142 -311
- package/dist/pi/packages/ta-rooms/lib/double-i18n.d.ts +20 -0
- package/dist/pi/packages/ta-rooms/lib/double-i18n.js +40 -0
- package/dist/pi/packages/ta-rooms/lib/double-protocol.d.ts +96 -3
- package/dist/pi/packages/ta-rooms/lib/double-protocol.js +58 -3
- 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 +34 -2
- package/dist/pi/packages/ta-rooms/lib/double-util.js +60 -2
- package/dist/pi/packages/ta-rooms/lib/doubles-store.d.ts +4 -1
- package/dist/pi/packages/ta-rooms/lib/doubles-store.js +8 -2
- package/dist/pi/packages/ta-rooms/lib/doubles-view.js +7 -2
- package/dist/pi/packages/ta-rooms/lib/extension.d.ts +9 -0
- package/dist/pi/packages/ta-rooms/lib/extension.js +35 -8
- 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 +2 -1
- package/dist/pi/packages/ta-rooms/lib/host.js +9 -2
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +23 -2
- package/dist/pi/packages/ta-rooms/lib/i18n.js +60 -18
- package/dist/pi/packages/ta-rooms/lib/index.js +18 -1
- package/dist/pi/packages/ta-rooms/lib/members-view.js +12 -1
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +42 -4
- package/dist/pi/packages/ta-rooms/lib/page.js +108 -24
- package/dist/pi/packages/ta-rooms/lib/room-view.js +7 -3
- package/dist/pi/packages/ta-rooms/lib/rooms-page.js +6 -17
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-rooms/lib/style.js +31 -6
- 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 +11 -2
- package/dist/pi/packages/ta-rooms/web/index.js +1633 -751
- 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 +72 -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/style.d.ts +1 -1
- package/dist/pi/packages/ta-share/lib/style.js +4 -6
- package/dist/pi/packages/ta-share/package.json +10 -2
- package/dist/pi/packages/ta-share/web/index.js +12 -14
- 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 +285 -0
- package/dist/pi/packages/ta-team/host/index.mjs +2121 -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 +178 -0
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-BnqtcbpZ.js → abnfDiagram-S7VZAUFO-C30pzFN3.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-BzPq1Ioe.js → architecture-WOLXFQ4H-wfYFQl2u.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-BsquO3a7.js → architectureDiagram-YGSQEFNW-B05zgxyT.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-BQNYOEP4.js → blockDiagram-APKKGZFW-BhN8Bsu0.js} +1 -1
- package/dist/public/assets/{browser-DS711n7Y.js → browser-DteLjv_-.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-D6e79Ycq.js → c4Diagram-KJ2TOQU5-DvdF3qCV.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-B-sgaPoU.js → chunk-6MUBBAK2-DNavkrnr.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-D8pJKIg2.js → chunk-AXFCVDMN-DplVEqp_.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-86TL-vCz.js → chunk-BG4553SI-BazOaHvw.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-CfUVuGjc.js → chunk-DQASFODM-DmoQWa8b.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-Drm0FEYk.js → chunk-HFQBQIA3-Cj1m9ccz.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BVFRADlC.js → chunk-KQLB2F66-_jbilrLX.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-DfyALEmP.js → chunk-KS47KZWR-CWU16Lut.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-DtJVzk2c.js → chunk-LEVMRMFU-wsbxWEZE.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-DTy27PHQ.js → chunk-M57EVK23-BGvmwwTv.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-nSgn7jZg.js → chunk-OY52VR5R-Bp3hJ4kT.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-CkSxO_X6.js → chunk-QB3YPZ4I-C1rQVxsJ.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-Ck6iAjAL.js → chunk-R3KSYZAL-CEy0dKWn.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-DQPHdSTh.js → chunk-STOXU5M4-akqvafwH.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-Bc2AbV2Y.js → chunk-TU62E6Q5-CVXAS4DS.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-Cgpm0IXm.js → chunk-X4PVCEUW-DT_bEMvQ.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-CGE4eLpg.js → chunk-XXDRQBXY-Bgv_n5Qh.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-4eQuDPEo.js → classDiagram-v2-L25IHNXF-BtjQChpS.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-tDLCWq07.js → cose-bilkent-JH36ORCC-DSrOY8Uk.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-DYlwwGUb.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-ByqcZ8x9.js → cynefinDiagram-L36ESFBY-DTy7FNFS.js} +1 -1
- package/dist/public/assets/{d3-selection-Bgn1374-.js → d3-selection-ip6rDUzY.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-mCgr71mV.js → dagre-SPEB5RXH-CHrks7Jb.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-DpYSwpQ0.js → diagram-3B7GL73J-eUJ7STAr.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-DMozUQzi.js → diagram-DNEMPZML-B_fptNkg.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-Bk5Uf8PD.js → diagram-L3MUGCDN-C15owCSG.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-DFt5cPVK.js → diagram-LA4NIPWU-Bfa1qEgY.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BkZZcKqK.js → diagram-MHCOC4E2-Bwxsih_Q.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-HEY6kyyN.js → diagram-XPFHEONP-DKZ_lwah.js} +1 -1
- package/dist/public/assets/{dist-Bj2CrKn7.js → dist-VHGBaby6.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-D4JvYyVb.js → ebnfDiagram-UZSYDL2S-CCkttvYi.js} +1 -1
- package/dist/public/assets/{editor.api-BpJFzYbl.js → editor.api-a2gC0dVD.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CT6qLJkF.js → elk-XV6XMXQE-DcikW39e.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-BGng1goR.js → erDiagram-EYBAPDEH-BE3TV5lU.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-Tt8O-Q1Z.js → eventmodeling-K75KTNOO-C2s1kutf.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Bufgn1OL.js +1 -0
- package/dist/public/assets/{freemarker2-Dd5ksoRn.js → freemarker2-2e8pZojb.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-Jl8VO_g2.js → ganttDiagram-23REXITY-rGnJptii.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-D_tzR9z9.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-Be4qXALb.js → gitGraphDiagram-STJD7YCW-CNnsDjQA.js} +1 -1
- package/dist/public/assets/{handlebars-4xabgUi4.js → handlebars-CMKN6E37.js} +1 -1
- package/dist/public/assets/{html-Dk3kt2w_.js → html-0AjXQhkQ.js} +1 -1
- package/dist/public/assets/{index-Bx0c7eoh.js → index-TUtoc8CW.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-C5Pwv-6e.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-Coc0tdwb.js → infoDiagram-KBXO4MBG-DMKs8cuE.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-CE_1VQCg.js → ishikawaDiagram-M35NCXHK-Dg_IbA0G.js} +1 -1
- package/dist/public/assets/{javascript-DKLGqy6v.js → javascript-CqYOqPjw.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-CrolRZ_7.js → journeyDiagram-OPLOXDXO-ohAOfoEY.js} +1 -1
- package/dist/public/assets/{jsonMode-Chcs19_y.js → jsonMode-D-gI-S5H.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-CjJj47De.js → kanban-definition-BZKZHSQY-w-aKZS_U.js} +1 -1
- package/dist/public/assets/{liquid-jff3p-Ji.js → liquid-oBN7c8NZ.js} +1 -1
- package/dist/public/assets/{mdx-DW4uRDfJ.js → mdx-CnwhgGjX.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-XhQj6FvH.js → mermaid-parser.core-CfFkSR0t.js} +3 -3
- package/dist/public/assets/{mermaid.core-OD4Atimg.js → mermaid.core-apiVCSBY.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DpGelVY7.js → mindmap-definition-I2QAS2VK-E7vqVWB0.js} +1 -1
- package/dist/public/assets/module-C2jtFD0v.js +2365 -0
- package/dist/public/assets/module-xT4L5yYw.js +1 -0
- package/dist/public/assets/{monaco-BTVZP-tU.js → monaco-C0ByxW3l.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-xozI7a9T.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CqcBmPfB.js → pegDiagram-FD4XPPHP--RpwCE7x.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-BkHXIzDi.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-CRir3beB.js → pieDiagram-J4AKIIQI-DxSbPaRZ.js} +1 -1
- package/dist/public/assets/{python-BwW_0207.js → python-vNPe_Fao.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-DIY6gdcf.js → quadrantDiagram-XTYBLID2-CR_eeYXi.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-CaUh9zV3.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-DckPvlDe.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-XWNOzunl.js → railroad-abnf-LNEFI6M7-D6I2HxIC.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-CI0-j1Jz.js → railroad-ebnf-DWYD2UWJ-BuhDRGo3.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-BVB_IaIG.js → railroad-peg-JR7BVNR7-n15PB7Sb.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-CudwT6q2.js → railroadDiagram-MRQ6NCDL-Bbe5bNap.js} +1 -1
- package/dist/public/assets/{razor-DrjCyQqB.js → razor-CnKbF0Yz.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CvRMeRqj.js → requirementDiagram-Y7LWUY3S-Beuygh9j.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-adxYCJKr.js → sankeyDiagram-WGJFYUXA-jwWPgnrS.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-lCRsoLUp.js → sequenceDiagram-5NDRBG5M-CmU-HYQI.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-DNst1BLg.js → stateDiagram-v2-FJ4FJNEA-Bo7BEi-m.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-S_omrdvA.js → swimlanes-UMQ2AFYF-PSKyZN_b.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-z_0ABNQq.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-_pMGrTE-.js → timeline-definition-SEUHKTQE-BuRxLScZ.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-BN38Jg9j.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-CKdz7u7W.js +1 -0
- package/dist/public/assets/{typescript-0-z_OYCU.js → typescript-C00ztMLg.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-B2oJKi5Q.js → usecaseDiagram-AFA6YXN4-Dlvyos8r.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-inPs2Kkr.js → vennDiagram-NNMJR3RB-CuLZubJH.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-B0cvM1zV.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-DNhNHM7b.js → wardleyDiagram-S7YFUSEH-WOGGTs4y.js} +1 -1
- package/dist/public/assets/{xml-BXPxQzKF.js → xml-CHBFuf5n.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-DJc93dNT.js → xychartDiagram-GGNKY7IX-DwW9eifP.js} +1 -1
- package/dist/public/assets/{yaml-CGmD9Rya.js → yaml-C4qkqzcL.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +7738 -3839
- 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-Dd40W2Jh.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-uFzenfA3.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-D28I_jUc.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-5vIGEIq7.js +0 -1
- package/dist/public/assets/module-CrD0OHQp.js +0 -1
- package/dist/public/assets/module-DEBMgdtf.js +0 -2273
- package/dist/public/assets/packet-JDAUHWVQ-CBxQ5Mzy.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-DT5V3581.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-BAOovYEa.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-RZ2Rnwzh.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-By5lnz4u.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-Cyb9N8KY.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-BkMo57pG.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-CSt-uQ-Y.js +0 -1
|
@@ -0,0 +1,741 @@
|
|
|
1
|
+
// ../ta-protocol/esm/common/ta-extension-host.js
|
|
2
|
+
var TA_HOST_EVENT = "ta:host";
|
|
3
|
+
var TaHostUtil;
|
|
4
|
+
(function(TaHostUtil2) {
|
|
5
|
+
TaHostUtil2.WAIT_MS = 1000;
|
|
6
|
+
function reach(events, name, waitMs = TaHostUtil2.WAIT_MS) {
|
|
7
|
+
return new Promise((resolve) => {
|
|
8
|
+
let heard = false;
|
|
9
|
+
let answered = false;
|
|
10
|
+
const timer = setTimeout(() => resolve(undefined), waitMs);
|
|
11
|
+
const request = {
|
|
12
|
+
name,
|
|
13
|
+
heard: () => {
|
|
14
|
+
heard = true;
|
|
15
|
+
},
|
|
16
|
+
resolve: (answer) => {
|
|
17
|
+
answered = true;
|
|
18
|
+
clearTimeout(timer);
|
|
19
|
+
resolve(answer);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
events.emit(TA_HOST_EVENT, request);
|
|
23
|
+
if (!heard && !answered) {
|
|
24
|
+
clearTimeout(timer);
|
|
25
|
+
resolve(undefined);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
TaHostUtil2.reach = reach;
|
|
30
|
+
function marked(systemPrompt, mark) {
|
|
31
|
+
return role(systemPrompt).includes(mark);
|
|
32
|
+
}
|
|
33
|
+
TaHostUtil2.marked = marked;
|
|
34
|
+
function role(systemPrompt) {
|
|
35
|
+
if (!systemPrompt) {
|
|
36
|
+
return "";
|
|
37
|
+
}
|
|
38
|
+
const open = `<addendum>
|
|
39
|
+
`;
|
|
40
|
+
const start = systemPrompt.indexOf(open);
|
|
41
|
+
const context = systemPrompt.indexOf(`<project_context>
|
|
42
|
+
`);
|
|
43
|
+
if (start < 0 || context >= 0 && context < start) {
|
|
44
|
+
return "";
|
|
45
|
+
}
|
|
46
|
+
const end = systemPrompt.indexOf(`
|
|
47
|
+
</addendum>`, start);
|
|
48
|
+
return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
|
|
49
|
+
}
|
|
50
|
+
TaHostUtil2.role = role;
|
|
51
|
+
})(TaHostUtil || (TaHostUtil = {}));
|
|
52
|
+
var TA_WITH_OTHERS_MARK = "[ta:speaks-with-others]";
|
|
53
|
+
var TA_ASK_ENTRY = "ta-ask";
|
|
54
|
+
var TaAskUtil;
|
|
55
|
+
(function(TaAskUtil2) {
|
|
56
|
+
const LENGTH = 120;
|
|
57
|
+
function entry(question) {
|
|
58
|
+
const line = question.replace(/\s+/g, " ").trim();
|
|
59
|
+
return { question: line.length > LENGTH ? `${line.slice(0, LENGTH - 1)}…` : line };
|
|
60
|
+
}
|
|
61
|
+
TaAskUtil2.entry = entry;
|
|
62
|
+
function asking(entries) {
|
|
63
|
+
var _a;
|
|
64
|
+
for (let i = entries.length - 1;i >= 0; i--) {
|
|
65
|
+
const entry2 = entries[i];
|
|
66
|
+
if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY) {
|
|
70
|
+
return read(entry2);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
TaAskUtil2.asking = asking;
|
|
76
|
+
function next(asked, entry2) {
|
|
77
|
+
var _a;
|
|
78
|
+
if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
return entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY ? read(entry2) : asked;
|
|
82
|
+
}
|
|
83
|
+
TaAskUtil2.next = next;
|
|
84
|
+
function read(found) {
|
|
85
|
+
var _a;
|
|
86
|
+
const question = (_a = found.data) === null || _a === undefined ? undefined : _a.question;
|
|
87
|
+
if (typeof question !== "string" || !question.trim()) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const at = found.timestamp ? Date.parse(found.timestamp) : Number.NaN;
|
|
91
|
+
return { question: entry(question).question, at: Number.isNaN(at) ? 0 : at };
|
|
92
|
+
}
|
|
93
|
+
})(TaAskUtil || (TaAskUtil = {}));
|
|
94
|
+
|
|
95
|
+
// web-src/initiative-protocol.ts
|
|
96
|
+
var NAME = "@celljs/ta-initiative";
|
|
97
|
+
var CRON = "@celljs/ta-cron";
|
|
98
|
+
var RECALL = "@celljs/ta-recall";
|
|
99
|
+
var REVIEW_MARK = "[ta-evolve:review";
|
|
100
|
+
var SECTION = "ta-evolve";
|
|
101
|
+
var PACE_TOOL = "evolve_pace";
|
|
102
|
+
var PROFILE_TOOL = "evolve_profile";
|
|
103
|
+
var PROPOSE_TOOL = "propose";
|
|
104
|
+
var PROFILE_SECTION = "ta-user";
|
|
105
|
+
var CHAT_SECTION = "ta-initiative";
|
|
106
|
+
var CARD_TYPE = "ta-initiative";
|
|
107
|
+
var BLOCK = "ta-propose";
|
|
108
|
+
var TURN_PROPOSALS = 2;
|
|
109
|
+
var RESULT_ID = "$result.id";
|
|
110
|
+
var Keys;
|
|
111
|
+
((Keys) => {
|
|
112
|
+
Keys.SETTINGS = "settings";
|
|
113
|
+
Keys.FILE = "file";
|
|
114
|
+
Keys.LAST = "last";
|
|
115
|
+
Keys.NOTE = "note";
|
|
116
|
+
Keys.PROFILE = "profile";
|
|
117
|
+
Keys.MODE = "mode";
|
|
118
|
+
Keys.LOCKS = "locks";
|
|
119
|
+
Keys.PROPOSALS = "proposals";
|
|
120
|
+
Keys.SEEN = "seen";
|
|
121
|
+
Keys.QUIET = "quiet";
|
|
122
|
+
Keys.MIGRATED = "migrated";
|
|
123
|
+
})(Keys ||= {});
|
|
124
|
+
var Limits;
|
|
125
|
+
((Limits) => {
|
|
126
|
+
Limits.MIN_DAYS = 1;
|
|
127
|
+
Limits.MAX_DAYS = 30;
|
|
128
|
+
Limits.LOOK_BACK_DAYS = 7;
|
|
129
|
+
Limits.MATERIAL_CHARS = 48000;
|
|
130
|
+
Limits.RUNS = 5;
|
|
131
|
+
Limits.PROMPT_CHARS = 400;
|
|
132
|
+
Limits.SUMMARY_CHARS = 240;
|
|
133
|
+
Limits.NEW_TASKS = 3;
|
|
134
|
+
Limits.PROFILE_CHARS = 3000;
|
|
135
|
+
Limits.PROPOSALS_KEPT = 200;
|
|
136
|
+
Limits.OUTCOMES = 20;
|
|
137
|
+
Limits.UP_AFTER = 3;
|
|
138
|
+
Limits.DOWN_AFTER = 2;
|
|
139
|
+
Limits.EXPIRE_DAYS = 14;
|
|
140
|
+
Limits.UNDO_DAYS = 7;
|
|
141
|
+
Limits.BUDGET = { quiet: 1, balanced: 3, active: Number.POSITIVE_INFINITY };
|
|
142
|
+
Limits.NOTICE_MS = 2 * 60000;
|
|
143
|
+
})(Limits ||= {});
|
|
144
|
+
|
|
145
|
+
// web-src/chat-kinds.ts
|
|
146
|
+
var CHAT_KINDS = [
|
|
147
|
+
{
|
|
148
|
+
id: "chat.next-step",
|
|
149
|
+
owner: NAME,
|
|
150
|
+
title: { en: "Take the next step you usually want", zh: "接着做你通常要的下一步" },
|
|
151
|
+
reversible: true,
|
|
152
|
+
level: "ask"
|
|
153
|
+
},
|
|
154
|
+
{ id: "git.commit", owner: NAME, title: { en: "Commit the changes", zh: "提交改动" }, reversible: true, level: "ask" },
|
|
155
|
+
{ id: "git.push", owner: NAME, title: { en: "Push to the remote", zh: "推送到远端" }, reversible: false, level: "ask" }
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
// web-src/chat-proposals.ts
|
|
159
|
+
var MEANS = {
|
|
160
|
+
act: "act (do it now, in this turn, then say in a line that you did it; the user may undo it)",
|
|
161
|
+
ask: "ask (do not do it: a card asks the user after your turn; mention it in a few words at most)",
|
|
162
|
+
digest: "digest (do not do it nor mention it: it goes to the daily brief)",
|
|
163
|
+
off: "off (never propose it)"
|
|
164
|
+
};
|
|
165
|
+
var ChatProposals;
|
|
166
|
+
((ChatProposals) => {
|
|
167
|
+
function section(kinds) {
|
|
168
|
+
return [
|
|
169
|
+
`<${CHAT_SECTION}>`,
|
|
170
|
+
`When the user would likely want more done than they asked (the next step they usually take, as what Ta learned of them says; committing finished work; a request they keep repeating made a scheduled task), propose it, rather than asking in words or doing it unasked: the tool ${PROPOSE_TOOL}({ kind, title, why, prompt, undo? }), or without that tool a fenced \`\`\`${BLOCK} block holding that JSON. How far each kind goes is the user's, and grows as they accept:`,
|
|
171
|
+
...kinds.map(({ kind, level }) => `- ${kind.id} (${kind.title.en}): ${MEANS[level]}`),
|
|
172
|
+
`- cron.add takes task (as schedule_task adds one) instead of prompt.`,
|
|
173
|
+
`- Another kind of your own: <area>.<verb> with kindTitle; it asks, and is never done on its own.`,
|
|
174
|
+
`title: what, one line in the language of the user; why: one line; prompt: what you will do once accepted, as the user would ask it; undo: how to undo it. In a block, add "done": true when you did it (a kind at act).`,
|
|
175
|
+
`At most ${TURN_PROPOSALS} a turn, the most useful. Never what the user just asked for (do it), nor when you are unsure it helps them.`,
|
|
176
|
+
`</${CHAT_SECTION}>`
|
|
177
|
+
].join(`
|
|
178
|
+
`);
|
|
179
|
+
}
|
|
180
|
+
ChatProposals.section = section;
|
|
181
|
+
function blocks(text) {
|
|
182
|
+
const found = [];
|
|
183
|
+
const lines = text.split(/\r?\n/);
|
|
184
|
+
for (let index = 0;index < lines.length; index++) {
|
|
185
|
+
const open = /^\s*(`{3,})\s*([\w-]+)\s*$/.exec(lines[index]);
|
|
186
|
+
if (!open || open[2] !== BLOCK) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const close = new RegExp(`^\\s*${open[1]}\\s*$`);
|
|
190
|
+
const end = lines.findIndex((line, at) => at > index && close.test(line));
|
|
191
|
+
const body = lines.slice(index + 1, end < 0 ? lines.length : end).join(`
|
|
192
|
+
`);
|
|
193
|
+
index = end < 0 ? lines.length : end;
|
|
194
|
+
try {
|
|
195
|
+
const value = JSON.parse(body);
|
|
196
|
+
for (const one of Array.isArray(value) ? value : [value]) {
|
|
197
|
+
if (one && typeof one === "object" && typeof one.kind === "string") {
|
|
198
|
+
found.push(one);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
} catch {}
|
|
202
|
+
}
|
|
203
|
+
return found;
|
|
204
|
+
}
|
|
205
|
+
ChatProposals.blocks = blocks;
|
|
206
|
+
function build(params, sessionFile, cwd) {
|
|
207
|
+
if (typeof params.prompt !== "string" || !params.prompt.trim()) {
|
|
208
|
+
throw new Error(`${params.kind} needs prompt: what you will do once it is accepted.`);
|
|
209
|
+
}
|
|
210
|
+
const title = String(params.title ?? "").trim();
|
|
211
|
+
return {
|
|
212
|
+
kind: params.kind,
|
|
213
|
+
title,
|
|
214
|
+
why: String(params.why ?? ""),
|
|
215
|
+
...cwd ? { cwd } : {},
|
|
216
|
+
evidence: [sessionFile],
|
|
217
|
+
source: "turn",
|
|
218
|
+
key: `${params.kind}:${sessionFile}:${title}`,
|
|
219
|
+
...typeof params.kindTitle === "string" && params.kindTitle.trim() ? { kindTitle: params.kindTitle } : {},
|
|
220
|
+
action: { type: "session", sessionFile, prompt: params.prompt.trim() },
|
|
221
|
+
...typeof params.undo === "string" && params.undo.trim() ? { undo: { type: "session", sessionFile, prompt: params.undo.trim() } } : {},
|
|
222
|
+
...params.done === true ? { done: true } : {}
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
ChatProposals.build = build;
|
|
226
|
+
})(ChatProposals ||= {});
|
|
227
|
+
|
|
228
|
+
// web-src/cron-proposals.ts
|
|
229
|
+
var CRON_KINDS = [
|
|
230
|
+
{
|
|
231
|
+
id: "cron.add",
|
|
232
|
+
owner: NAME,
|
|
233
|
+
title: { en: "Schedule work you ask for again and again", zh: "把反复交代的事建成定时任务" },
|
|
234
|
+
reversible: true,
|
|
235
|
+
level: "ask"
|
|
236
|
+
},
|
|
237
|
+
{ id: "cron.update", owner: NAME, title: { en: "Fix a scheduled task gone out of date", zh: "修改过时的定时任务" }, reversible: true, level: "ask" },
|
|
238
|
+
{ id: "cron.disable", owner: NAME, title: { en: "Turn off a stale or failing task", zh: "停用过时或常失败的任务" }, reversible: true, level: "act" }
|
|
239
|
+
];
|
|
240
|
+
var FIELDS = ["name", "prompt", "schedule", "cwd", "model", "thinking", "notify", "timeout", "enabled"];
|
|
241
|
+
var CLEARED = { model: "", thinking: "", notify: "", timeout: "" };
|
|
242
|
+
var CronProposals;
|
|
243
|
+
((CronProposals) => {
|
|
244
|
+
function isCron(kind) {
|
|
245
|
+
return CRON_KINDS.some((one) => one.id === kind);
|
|
246
|
+
}
|
|
247
|
+
CronProposals.isCron = isCron;
|
|
248
|
+
function build(params, current) {
|
|
249
|
+
const base = {
|
|
250
|
+
kind: params.kind,
|
|
251
|
+
title: params.title,
|
|
252
|
+
why: params.why,
|
|
253
|
+
...Array.isArray(params.evidence) ? { evidence: params.evidence.filter((file) => typeof file === "string").slice(0, 10) } : {}
|
|
254
|
+
};
|
|
255
|
+
switch (params.kind) {
|
|
256
|
+
case "cron.add": {
|
|
257
|
+
const task = params.task;
|
|
258
|
+
if (!task || typeof task.prompt !== "string" || !task.schedule) {
|
|
259
|
+
throw new Error("cron.add needs task with at least prompt and schedule, as schedule_task adds one.");
|
|
260
|
+
}
|
|
261
|
+
const cwd = typeof task.cwd === "string" ? task.cwd : undefined;
|
|
262
|
+
return {
|
|
263
|
+
...base,
|
|
264
|
+
...cwd ? { cwd } : {},
|
|
265
|
+
key: `cron.add:${typeof task.name === "string" ? task.name : task.prompt.slice(0, 80)}`,
|
|
266
|
+
action: { type: "call", package: CRON, method: "add", params: [task] },
|
|
267
|
+
undo: { package: CRON, method: "remove", params: [RESULT_ID] }
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
case "cron.disable": {
|
|
271
|
+
const id = taskId(params);
|
|
272
|
+
return {
|
|
273
|
+
...base,
|
|
274
|
+
key: `cron.disable:${id}`,
|
|
275
|
+
action: { type: "call", package: CRON, method: "setEnabled", params: [id, false] },
|
|
276
|
+
undo: { package: CRON, method: "setEnabled", params: [id, true] }
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
case "cron.update": {
|
|
280
|
+
const id = taskId(params);
|
|
281
|
+
const patch = params.patch && typeof params.patch === "object" ? params.patch : undefined;
|
|
282
|
+
if (!patch || Object.keys(patch).length === 0) {
|
|
283
|
+
throw new Error("cron.update needs patch, the fields to change.");
|
|
284
|
+
}
|
|
285
|
+
if (!current) {
|
|
286
|
+
throw new Error(`No scheduled task ${id}.`);
|
|
287
|
+
}
|
|
288
|
+
const before = {};
|
|
289
|
+
for (const field of FIELDS) {
|
|
290
|
+
if (field in patch) {
|
|
291
|
+
before[field] = current[field] ?? CLEARED[field] ?? null;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
...base,
|
|
296
|
+
key: `cron.update:${current.id}`,
|
|
297
|
+
action: { type: "call", package: CRON, method: "update", params: [current.id, patch] },
|
|
298
|
+
undo: { package: CRON, method: "update", params: [current.id, before] }
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
default:
|
|
302
|
+
throw new Error(`A review proposes ${CRON_KINDS.map((one) => one.id).join(", ")}.`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
CronProposals.build = build;
|
|
306
|
+
function taskId(params) {
|
|
307
|
+
if (typeof params.id !== "string" || !params.id) {
|
|
308
|
+
throw new Error(`${params.kind} needs id, the task.`);
|
|
309
|
+
}
|
|
310
|
+
return params.id;
|
|
311
|
+
}
|
|
312
|
+
})(CronProposals ||= {});
|
|
313
|
+
|
|
314
|
+
// web-src/material-util.ts
|
|
315
|
+
var LEVEL_MEANS = {
|
|
316
|
+
act: "done at once, the user told and able to undo it",
|
|
317
|
+
ask: "asked of the user with a card",
|
|
318
|
+
digest: "only a line of the daily brief",
|
|
319
|
+
off: "dropped: the user wants none of these"
|
|
320
|
+
};
|
|
321
|
+
var MaterialUtil;
|
|
322
|
+
((MaterialUtil) => {
|
|
323
|
+
function message(since2, zh) {
|
|
324
|
+
const context = [
|
|
325
|
+
`${REVIEW_MARK} since=${since2}]`,
|
|
326
|
+
`Review the scheduled tasks of the user now, from the <${SECTION}> section of your system prompt. Nobody is watching: ask nothing, decide and report; the user reads it later and may answer here. Write the report in ${zh ? "Chinese" : "English"}.`
|
|
327
|
+
].join(`
|
|
328
|
+
`);
|
|
329
|
+
return `<context>
|
|
330
|
+
${context}
|
|
331
|
+
</context>
|
|
332
|
+
${zh ? "回顾一下最近的工作,整理定时任务" : "Look back at the recent work and tidy the scheduled tasks"}`;
|
|
333
|
+
}
|
|
334
|
+
MaterialUtil.message = message;
|
|
335
|
+
function since(prompt) {
|
|
336
|
+
const at = prompt.indexOf(REVIEW_MARK);
|
|
337
|
+
if (at < 0) {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
const match = /^ since=(\d+)\]/.exec(prompt.slice(at + REVIEW_MARK.length));
|
|
341
|
+
return match ? Number(match[1]) : undefined;
|
|
342
|
+
}
|
|
343
|
+
MaterialUtil.since = since;
|
|
344
|
+
function section(input) {
|
|
345
|
+
const lines = [
|
|
346
|
+
`<${SECTION}>`,
|
|
347
|
+
`You keep the scheduled tasks of the user (those of ta-cron) in step with their work, so that what they ask for again and again gets done without them asking, and what no longer matters stops. You change them only with ${PROPOSE_TOOL}, never with schedule_task: each kind goes as far as the user lets it, which grows as they accept what you propose.`,
|
|
348
|
+
"",
|
|
349
|
+
"How to review:",
|
|
350
|
+
`1. Find the work asked again and again in the requests below: the same kind of request on two days or more, or in two conversations or more, or the user saying "every day", "each week", "again". Group the requests by the work they ask for, not by their words.`,
|
|
351
|
+
"2. Schedule it when it repeats, can be done with nobody watching, has a way to check it (tests, a build, a benchmark, a log, a report) and fits the timeout of a run (30 minutes unless the task sets more, up to 4h). Do not schedule work that needs the user: their taste, a phone or a device in hand, a release they start, a one-off.",
|
|
352
|
+
`3. Propose it (${PROPOSE_TOOL}, kind cron.add), at most ${Limits.NEW_TASKS} in a review, the surest first, with \`why\` naming how often it was asked and \`evidence\` the session files of those conversations. The task: a short name; a prompt complete in itself (the run sees no conversation) that says what to do, from where (since its last run, the past week), how to check it, what it may change on its own and what it only lists for the user, and the report it ends with, written the way the user asks for such work; the directory (cwd) of the conversations it comes from; a schedule at a minute that is not 0 and not the time of another task; notify "error".`,
|
|
353
|
+
`4. Look at every task below: one that keeps failing or timing out, repeats another, is about something gone (a feature removed, a date passed, a module renamed), or was asked for once and is done, is stale: propose turning it off (kind cron.disable, its id) and say why; never delete one. A prompt or a schedule that went out of date (a fixed date, a file that moved, a run that needs more time) may be changed (kind cron.update, its id and the fields to change). A task that runs fine and still matches the work stays as it is.`,
|
|
354
|
+
"5. Earlier reviews and the answers of the user are above in this conversation: do not propose again what the user turned off, deleted, declined or undid, keep doing what they approved, and learn from what they said.",
|
|
355
|
+
...input.levels?.length ? [` What a proposal of each kind does now: ${input.levels.map(({ kind, level }) => `${kind} ${LEVEL_MEANS[level]}`).join("; ")}.`] : [],
|
|
356
|
+
...input.learn ? [
|
|
357
|
+
`5b. Learn the user, so that every conversation of Ta knows them: rewrite with ${PROFILE_TOOL} the whole of what you know of them (below), from the requests: who they are and what they work on; how they want things done (what they corrected, what they said "always", "never", "next time" about, what they approved that was not obvious); what they usually want next after a kind of work (test, commit, push, a screenshot, a report), so that Ta does it without being asked; and what Ta should do on its own and what it must ask first. Markdown, short lines under a few headings, at most ${Limits.PROFILE_CHARS} characters, in the language of the user; keep what still holds, drop what turned out wrong, never a secret (keys, tokens, passwords) or a private matter. Leave it as it is when you learned nothing new.`
|
|
358
|
+
] : [],
|
|
359
|
+
input.auto ? `6. Reviews come every ${input.every} days, and the user lets you choose: call ${PACE_TOOL} once with the days to the next review (1 to 30) and why: sooner while the work changes and you found much to do, later when nothing changed.` : `6. Reviews come every ${input.every} days, as the user set; do not change it.`,
|
|
360
|
+
`7. End with a short report: what was done on its own, what waits for the user in their suggestions (on the double's home), what went to the brief, each with why in a few words, as ${PROPOSE_TOOL} answered;${input.learn ? " what you newly learned of the user, in a line or two;" : ""} nothing more. On a card, the tasks go in a table or steps, not in changes (which are files). When nothing needed doing, say so in one line.`,
|
|
361
|
+
"Use the tools only for what you change and what you must check (a file, git log); the material is below.",
|
|
362
|
+
"",
|
|
363
|
+
`Requests of the user since ${day(input.since)} (by conversation, latest first):`
|
|
364
|
+
];
|
|
365
|
+
let size = lines.join(`
|
|
366
|
+
`).length;
|
|
367
|
+
if (!input.requests) {
|
|
368
|
+
lines.push(`- Not available: the package Recall is off. Read the user messages of the session files under ${input.agentDir ? `${input.agentDir}/sessions` : "the sessions directory of the agent"} with a script, not one by one.`);
|
|
369
|
+
} else if (input.requests.length === 0) {
|
|
370
|
+
lines.push("- None.");
|
|
371
|
+
}
|
|
372
|
+
const tasks = taskLines(input.tasks, input.now);
|
|
373
|
+
size += tasks.join(`
|
|
374
|
+
`).length;
|
|
375
|
+
let left = 0;
|
|
376
|
+
for (const conversation of input.requests ?? []) {
|
|
377
|
+
const block = [
|
|
378
|
+
`- [${conversation.title || "Untitled"}](${conversation.file}) · ${conversation.cwd}${conversation.group ? ` · of ${conversation.group}` : ""}`,
|
|
379
|
+
...conversation.asks.map((ask) => ` - ${day(ask.at)} ${clock(ask.at)}: ${ask.text}`)
|
|
380
|
+
];
|
|
381
|
+
const length = block.join(`
|
|
382
|
+
`).length + 1;
|
|
383
|
+
if (size + length > Limits.MATERIAL_CHARS) {
|
|
384
|
+
left++;
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
size += length;
|
|
388
|
+
lines.push(...block);
|
|
389
|
+
}
|
|
390
|
+
if (left > 0) {
|
|
391
|
+
lines.push(`- And ${left} more conversations, left out for length: search_conversations finds them.`);
|
|
392
|
+
}
|
|
393
|
+
lines.push("", ...tasks);
|
|
394
|
+
if (input.learn) {
|
|
395
|
+
lines.push("", input.profile ? `What you know of the user so far:
|
|
396
|
+
${input.profile}` : "What you know of the user so far: nothing yet.");
|
|
397
|
+
}
|
|
398
|
+
lines.push(`</${SECTION}>`);
|
|
399
|
+
return lines.join(`
|
|
400
|
+
`);
|
|
401
|
+
}
|
|
402
|
+
MaterialUtil.section = section;
|
|
403
|
+
function profileSection(profile) {
|
|
404
|
+
return [
|
|
405
|
+
`<${PROFILE_SECTION}>`,
|
|
406
|
+
"What Ta learned of the user over time from working with them (they see and edit it in Settings → Initiative). Work the way it says without being told again, and do on your own what it says they usually want next; what they say now comes first.",
|
|
407
|
+
"",
|
|
408
|
+
profile.trim(),
|
|
409
|
+
`</${PROFILE_SECTION}>`
|
|
410
|
+
].join(`
|
|
411
|
+
`);
|
|
412
|
+
}
|
|
413
|
+
MaterialUtil.profileSection = profileSection;
|
|
414
|
+
function taskLines(tasks, now) {
|
|
415
|
+
if (!tasks) {
|
|
416
|
+
return ["Scheduled tasks: not available, the package Scheduled tasks is off; add nothing, and say so."];
|
|
417
|
+
}
|
|
418
|
+
if (tasks.length === 0) {
|
|
419
|
+
return ["Scheduled tasks: none yet."];
|
|
420
|
+
}
|
|
421
|
+
const lines = [`Scheduled tasks (${tasks.length}), at ${day(now)} ${clock(now)}:`];
|
|
422
|
+
for (const { task, runs } of tasks) {
|
|
423
|
+
const stats = `runs ${task.runCount}, failed ${task.failCount}${task.timeout ? `, timeout ${task.timeout}` : ""}`;
|
|
424
|
+
lines.push(`- ${task.enabled ? "on" : "off"} · ${task.name} · id ${task.id} · ${schedule(task.schedule)} · ${task.cwd} · ${stats} · created ${day(Date.parse(task.createdAt))}`, ` prompt: ${flat(task.prompt, Limits.PROMPT_CHARS)}`);
|
|
425
|
+
if (runs.length > 0) {
|
|
426
|
+
lines.push(` last runs: ${runs.map((run) => runLine(run)).join("; ")}`);
|
|
427
|
+
const last = runs[0];
|
|
428
|
+
const said = last.summary ?? last.error;
|
|
429
|
+
if (said) {
|
|
430
|
+
lines.push(` last said: ${flat(said, Limits.SUMMARY_CHARS)}`);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
return lines;
|
|
435
|
+
}
|
|
436
|
+
function runLine(run) {
|
|
437
|
+
const took = run.endedAt ? Math.round((Date.parse(run.endedAt) - Date.parse(run.startedAt)) / 60000) : undefined;
|
|
438
|
+
return `${day(Date.parse(run.startedAt))} ${run.status}${run.reason ? ` (${run.reason})` : ""}${took !== undefined && Number.isFinite(took) ? ` ${took}m` : ""}`;
|
|
439
|
+
}
|
|
440
|
+
function schedule(value) {
|
|
441
|
+
return value.expression ?? (value.every ? `every ${value.every}` : value.at ? `once at ${value.at}` : value.kind);
|
|
442
|
+
}
|
|
443
|
+
function flat(text, chars) {
|
|
444
|
+
const line = text.replace(/\s+/g, " ").trim();
|
|
445
|
+
return line.length > chars ? `${line.slice(0, chars - 1)}…` : line;
|
|
446
|
+
}
|
|
447
|
+
function day(at) {
|
|
448
|
+
const date = new Date(at);
|
|
449
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
450
|
+
}
|
|
451
|
+
function clock(at) {
|
|
452
|
+
const date = new Date(at);
|
|
453
|
+
return `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
454
|
+
}
|
|
455
|
+
function pad(value) {
|
|
456
|
+
return String(value).padStart(2, "0");
|
|
457
|
+
}
|
|
458
|
+
})(MaterialUtil ||= {});
|
|
459
|
+
|
|
460
|
+
// web-src/tool.ts
|
|
461
|
+
var SCHEDULE_HINT = 'As schedule_task takes it: { "kind": "cron", "expression": "13 9 * * 1" }, { "kind": "interval", "every": "2h" } or { "kind": "once", "at": "2026-12-01T09:00" }, local time.';
|
|
462
|
+
var ProposeTool;
|
|
463
|
+
((ProposeTool) => {
|
|
464
|
+
ProposeTool.NAME = PROPOSE_TOOL;
|
|
465
|
+
ProposeTool.DEFINITION = {
|
|
466
|
+
name: ProposeTool.NAME,
|
|
467
|
+
label: "Propose",
|
|
468
|
+
description: "Proposes something to do for the user that they did not ask for. How far it goes is the user's: by the level of its kind it is done (the user told, able to undo it), asked with a card, kept for the daily brief, or dropped; the answer says which. Kinds of a conversation (git.commit, chat.next-step, …) take prompt; cron.add takes task, cron.update id and patch, cron.disable id.",
|
|
469
|
+
parameters: {
|
|
470
|
+
type: "object",
|
|
471
|
+
properties: {
|
|
472
|
+
kind: { type: "string", description: "<area>.<verb>: one the system prompt lists, or one of your own with kindTitle." },
|
|
473
|
+
title: { type: "string", description: "What it does, a short line in the language of the user, as a card shows it." },
|
|
474
|
+
why: { type: "string", description: "Why, a short line in the language of the user." },
|
|
475
|
+
prompt: { type: "string", description: "A kind of a conversation: what you will do once accepted, as the user would ask it." },
|
|
476
|
+
undo: { type: "string", description: "A kind of a conversation that can be undone: how to undo it, as the user would ask it." },
|
|
477
|
+
kindTitle: { type: "string", description: "A kind of your own: its name, a few words in the language of the user." },
|
|
478
|
+
evidence: { type: "array", items: { type: "string" }, description: "Session files of the conversations it comes from." },
|
|
479
|
+
task: {
|
|
480
|
+
type: "object",
|
|
481
|
+
description: `cron.add: the task. name, prompt (complete in itself), schedule (${SCHEDULE_HINT}), cwd, notify ("error"), timeout ("90m", 5m to 4h) as schedule_task takes them.`
|
|
482
|
+
},
|
|
483
|
+
id: { type: "string", description: "cron.update, cron.disable: the id of the task." },
|
|
484
|
+
patch: { type: "object", description: "cron.update: the fields to change (name, prompt, schedule, cwd, notify, timeout)." }
|
|
485
|
+
},
|
|
486
|
+
required: ["kind", "title", "why"]
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
function result(offered, inTurn = false) {
|
|
490
|
+
switch (offered.delivered) {
|
|
491
|
+
case "act":
|
|
492
|
+
if (offered.state === "failed") {
|
|
493
|
+
return `Tried to do it on its own, and it failed: ${offered.error ?? "no reason given"}. Say so.`;
|
|
494
|
+
}
|
|
495
|
+
return inTurn ? "The user lets you: do it now, in this turn, then say in one line that you did it (they may undo it from the card)." : "Done on its own: the user is told and may undo it.";
|
|
496
|
+
case "ask":
|
|
497
|
+
return "Not done: a card asks the user after your turn. Do not do it; mention it in a few words at most.";
|
|
498
|
+
case "digest":
|
|
499
|
+
return "Kept for the daily brief: do not do it, do not mention it.";
|
|
500
|
+
default:
|
|
501
|
+
return "The user turned this kind off: nothing was proposed. Do not offer the like again.";
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
ProposeTool.result = result;
|
|
505
|
+
})(ProposeTool ||= {});
|
|
506
|
+
var PaceTool;
|
|
507
|
+
((PaceTool) => {
|
|
508
|
+
PaceTool.NAME = PACE_TOOL;
|
|
509
|
+
PaceTool.DEFINITION = {
|
|
510
|
+
name: PaceTool.NAME,
|
|
511
|
+
label: "Set review pace",
|
|
512
|
+
description: `Sets in how many days the next review of the scheduled tasks comes, and every review after it, ${Limits.MIN_DAYS} to ${Limits.MAX_DAYS}: sooner while the work of the user changes and reviews find much to do, later while they find nothing. The user sees the reason in the settings.`,
|
|
513
|
+
parameters: {
|
|
514
|
+
type: "object",
|
|
515
|
+
properties: {
|
|
516
|
+
days: { type: "number", description: `Days between reviews, ${Limits.MIN_DAYS} to ${Limits.MAX_DAYS}.` },
|
|
517
|
+
reason: { type: "string", description: "Why, in a short sentence in the language of the user." }
|
|
518
|
+
},
|
|
519
|
+
required: ["days", "reason"]
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
function result(days) {
|
|
523
|
+
return `Reviews now come every ${days} day${days === 1 ? "" : "s"}.`;
|
|
524
|
+
}
|
|
525
|
+
PaceTool.result = result;
|
|
526
|
+
})(PaceTool ||= {});
|
|
527
|
+
var ProfileTool;
|
|
528
|
+
((ProfileTool) => {
|
|
529
|
+
ProfileTool.NAME = PROFILE_TOOL;
|
|
530
|
+
ProfileTool.DEFINITION = {
|
|
531
|
+
name: ProfileTool.NAME,
|
|
532
|
+
label: "Update what Ta knows of the user",
|
|
533
|
+
description: `Rewrites, whole, what Ta knows of the user: every conversation of Ta reads it in its system prompt, and the user sees and edits it in the settings. Markdown, at most ${Limits.PROFILE_CHARS} characters; keep what still holds.`,
|
|
534
|
+
parameters: {
|
|
535
|
+
type: "object",
|
|
536
|
+
properties: {
|
|
537
|
+
profile: { type: "string", description: "The whole of it, in the language of the user." }
|
|
538
|
+
},
|
|
539
|
+
required: ["profile"]
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
function result(profile) {
|
|
543
|
+
return `Kept (${profile.length} characters); every conversation reads it from now on.`;
|
|
544
|
+
}
|
|
545
|
+
ProfileTool.result = result;
|
|
546
|
+
})(ProfileTool ||= {});
|
|
547
|
+
|
|
548
|
+
// web-src/extension.ts
|
|
549
|
+
var CRON_RUN_MARK = "<ta-cron-run>";
|
|
550
|
+
function activate(pi) {
|
|
551
|
+
const reached = new Map;
|
|
552
|
+
const reach = (name) => {
|
|
553
|
+
let found = reached.get(name);
|
|
554
|
+
if (!found) {
|
|
555
|
+
found = TaHostUtil.reach(pi.events, name).then((answer) => answer && { service: answer.service, agentDir: answer.host.agentDir });
|
|
556
|
+
reached.set(name, found);
|
|
557
|
+
}
|
|
558
|
+
return found;
|
|
559
|
+
};
|
|
560
|
+
const initiative = async () => {
|
|
561
|
+
const service = (await reach(NAME))?.service;
|
|
562
|
+
if (!service) {
|
|
563
|
+
throw new Error("This needs the Ta service.");
|
|
564
|
+
}
|
|
565
|
+
return service;
|
|
566
|
+
};
|
|
567
|
+
let shown = [];
|
|
568
|
+
let proposed = 0;
|
|
569
|
+
let proposing = false;
|
|
570
|
+
let reviewing = false;
|
|
571
|
+
pi.on("session_start", () => {
|
|
572
|
+
reach(NAME);
|
|
573
|
+
});
|
|
574
|
+
pi.on("context", (event) => {
|
|
575
|
+
const messages = event.messages.filter((message) => !(message.role === "custom" && message.customType === CARD_TYPE));
|
|
576
|
+
return messages.length === event.messages.length ? undefined : { messages };
|
|
577
|
+
});
|
|
578
|
+
pi.on("before_agent_start", async (event, ctx) => {
|
|
579
|
+
try {
|
|
580
|
+
const found = await reach(NAME);
|
|
581
|
+
const status = await found?.service?.reviewStatus();
|
|
582
|
+
const file = ctx.sessionManager.getSessionFile();
|
|
583
|
+
const here = !!file && status?.file === file;
|
|
584
|
+
const role = TaHostUtil.role(ctx.getSystemPrompt?.());
|
|
585
|
+
shown = [];
|
|
586
|
+
proposed = 0;
|
|
587
|
+
reviewing = here;
|
|
588
|
+
proposing = !!found?.service && !!file && !role.includes(CRON_RUN_MARK) && !role.includes(TA_WITH_OTHERS_MARK);
|
|
589
|
+
tool(ProposeTool.NAME, here || proposing);
|
|
590
|
+
tool(PaceTool.NAME, here && !!status?.settings.auto);
|
|
591
|
+
tool(ProfileTool.NAME, here && !!status?.settings.learn);
|
|
592
|
+
const since = typeof event.prompt === "string" ? MaterialUtil.since(event.prompt) : undefined;
|
|
593
|
+
if (!status || !found?.service) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
const profile = status.settings.learn && since === undefined && status.profile && !TaHostUtil.marked(ctx.getSystemPrompt?.(), TA_WITH_OTHERS_MARK);
|
|
597
|
+
if (profile) {
|
|
598
|
+
event.systemPromptOptions.sections = {
|
|
599
|
+
...event.systemPromptOptions.sections,
|
|
600
|
+
[PROFILE_SECTION]: MaterialUtil.profileSection(status.profile)
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
const service = found.service;
|
|
604
|
+
if (since === undefined) {
|
|
605
|
+
if (proposing && !here) {
|
|
606
|
+
const kinds = await service.kinds();
|
|
607
|
+
const listed = [...CHAT_KINDS.map((kind) => kind.id), "cron.add"].flatMap((id) => kinds.filter((status2) => status2.kind.id === id));
|
|
608
|
+
event.systemPromptOptions.sections = { ...event.systemPromptOptions.sections, [CHAT_SECTION]: ChatProposals.section(listed) };
|
|
609
|
+
}
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
const [requests, tasks, levels] = await Promise.all([
|
|
613
|
+
requestsSince(since, file),
|
|
614
|
+
cronTasks(),
|
|
615
|
+
Promise.all(CRON_KINDS.map(async (kind) => ({ kind: kind.id, level: await service.level(kind.id) })))
|
|
616
|
+
]);
|
|
617
|
+
const section = MaterialUtil.section({
|
|
618
|
+
since,
|
|
619
|
+
now: Date.now(),
|
|
620
|
+
requests,
|
|
621
|
+
tasks,
|
|
622
|
+
every: status.settings.every,
|
|
623
|
+
auto: status.settings.auto,
|
|
624
|
+
learn: status.settings.learn,
|
|
625
|
+
profile: status.profile,
|
|
626
|
+
levels,
|
|
627
|
+
agentDir: found.agentDir
|
|
628
|
+
});
|
|
629
|
+
event.systemPromptOptions.sections = { ...event.systemPromptOptions.sections, [SECTION]: section };
|
|
630
|
+
return;
|
|
631
|
+
} catch (error) {
|
|
632
|
+
console.error("ta-initiative could not prepare the review:", error);
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
pi.registerTool({
|
|
637
|
+
...ProposeTool.DEFINITION,
|
|
638
|
+
execute: async (_id, params, _signal, _update, ctx) => {
|
|
639
|
+
const service = await initiative();
|
|
640
|
+
if (++proposed > TURN_PROPOSALS && !reviewing) {
|
|
641
|
+
throw new Error(`At most ${TURN_PROPOSALS} proposals a turn.`);
|
|
642
|
+
}
|
|
643
|
+
const input = await build(params ?? {}, ctx);
|
|
644
|
+
const offered = await service.offer({ ...input, inTurn: true });
|
|
645
|
+
keep(offered, input.title);
|
|
646
|
+
return { content: [{ type: "text", text: ProposeTool.result(offered, input.action?.type === "session") }], details: undefined };
|
|
647
|
+
}
|
|
648
|
+
});
|
|
649
|
+
pi.on("agent_end", async (event, ctx) => {
|
|
650
|
+
try {
|
|
651
|
+
const answer = [...event.messages ?? []].reverse().find((message) => message.role === "assistant");
|
|
652
|
+
if (proposing && answer && answer.stopReason !== "aborted") {
|
|
653
|
+
const service = await initiative();
|
|
654
|
+
for (const params of ChatProposals.blocks(textOf(answer.content)).slice(0, Math.max(0, TURN_PROPOSALS - proposed))) {
|
|
655
|
+
proposed++;
|
|
656
|
+
const input = await build(params, ctx);
|
|
657
|
+
keep(await service.offer(input), input.title);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
} catch (error) {
|
|
661
|
+
console.error("ta-initiative could not take what was proposed:", error);
|
|
662
|
+
}
|
|
663
|
+
if (shown.length > 0) {
|
|
664
|
+
const cards = shown;
|
|
665
|
+
shown = [];
|
|
666
|
+
pi.sendMessage({
|
|
667
|
+
customType: CARD_TYPE,
|
|
668
|
+
content: `Proposed: ${cards.map((card) => card.title).join("; ")}`,
|
|
669
|
+
display: true,
|
|
670
|
+
details: { ids: cards.map((card) => card.id) }
|
|
671
|
+
}, { triggerTurn: false });
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
async function build(params, ctx) {
|
|
675
|
+
const file = ctx.sessionManager.getSessionFile();
|
|
676
|
+
if (CronProposals.isCron(params.kind)) {
|
|
677
|
+
const cron = (await reach(CRON))?.service;
|
|
678
|
+
if (!cron) {
|
|
679
|
+
throw new Error("The scheduled tasks are turned off: propose nothing of them, and say so.");
|
|
680
|
+
}
|
|
681
|
+
const current = params.kind === "cron.update" && typeof params.id === "string" ? await cron.get(params.id) : undefined;
|
|
682
|
+
const input = CronProposals.build(params, current);
|
|
683
|
+
const evidence = [...new Set([...input.evidence ?? [], ...file ? [file] : []])];
|
|
684
|
+
return { ...input, ...evidence.length ? { evidence } : {}, ...params.done === true ? { done: true } : {} };
|
|
685
|
+
}
|
|
686
|
+
if (!file) {
|
|
687
|
+
throw new Error("This conversation is not saved: propose nothing here.");
|
|
688
|
+
}
|
|
689
|
+
return ChatProposals.build(params, file, ctx.cwd);
|
|
690
|
+
}
|
|
691
|
+
function keep(offered, title) {
|
|
692
|
+
if (offered.id && (offered.delivered === "ask" || offered.delivered === "act")) {
|
|
693
|
+
shown.push({ id: offered.id, title });
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function textOf(content) {
|
|
697
|
+
if (typeof content === "string") {
|
|
698
|
+
return content;
|
|
699
|
+
}
|
|
700
|
+
return Array.isArray(content) ? content.map((part) => part && typeof part === "object" && part.type === "text" && typeof part.text === "string" ? part.text : "").join(`
|
|
701
|
+
`) : "";
|
|
702
|
+
}
|
|
703
|
+
pi.registerTool({
|
|
704
|
+
...PaceTool.DEFINITION,
|
|
705
|
+
execute: async (_id, params) => {
|
|
706
|
+
const days = await (await initiative()).setPace(Number(params?.days), String(params?.reason ?? ""));
|
|
707
|
+
return { content: [{ type: "text", text: PaceTool.result(days) }], details: undefined };
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
pi.registerTool({
|
|
711
|
+
...ProfileTool.DEFINITION,
|
|
712
|
+
execute: async (_id, params) => {
|
|
713
|
+
const kept = await (await initiative()).setProfile(String(params?.profile ?? ""));
|
|
714
|
+
return { content: [{ type: "text", text: ProfileTool.result(kept) }], details: undefined };
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
function tool(name, on) {
|
|
718
|
+
const active = pi.getActiveTools();
|
|
719
|
+
const has = active.includes(name);
|
|
720
|
+
if (on && !has) {
|
|
721
|
+
pi.setActiveTools([...active, name]);
|
|
722
|
+
} else if (!on && has) {
|
|
723
|
+
pi.setActiveTools(active.filter((other) => other !== name));
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
async function requestsSince(since, file) {
|
|
727
|
+
const recall = (await reach(RECALL))?.service;
|
|
728
|
+
return recall?.requests ? recall.requests({ since, ...file ? { exclude: [file] } : {} }) : undefined;
|
|
729
|
+
}
|
|
730
|
+
async function cronTasks() {
|
|
731
|
+
const cron = (await reach(CRON))?.service;
|
|
732
|
+
if (!cron?.list) {
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
const tasks = await cron.list();
|
|
736
|
+
return Promise.all(tasks.map(async (task) => ({ task, runs: await cron.runs(task.id, Limits.RUNS).catch(() => []) })));
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
export {
|
|
740
|
+
activate as default
|
|
741
|
+
};
|