@celljs/ta 4.12.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 +11 -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 +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/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 +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 +15 -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 +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 +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.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 +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 +289 -133
- 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/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 +30 -22
- 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 +393 -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 +171 -7
- package/dist/pi/packages/ta-rooms/host/index.mjs +1002 -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 +33 -6
- 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 +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/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 +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-BnqtcbpZ.js → abnfDiagram-S7VZAUFO-DJMZKA5d.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-BzPq1Ioe.js → architecture-WOLXFQ4H-DwZ8A2Bp.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-BsquO3a7.js → architectureDiagram-YGSQEFNW-DPezb7-w.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-BQNYOEP4.js → blockDiagram-APKKGZFW-SrFYBlSp.js} +1 -1
- package/dist/public/assets/{browser-DS711n7Y.js → browser-CljOqDFz.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-D6e79Ycq.js → c4Diagram-KJ2TOQU5-COCMkiJ6.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-B-sgaPoU.js → chunk-6MUBBAK2-CWRxZCiu.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-D8pJKIg2.js → chunk-AXFCVDMN-Dgn3RHlx.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-86TL-vCz.js → chunk-BG4553SI-BDnAChfb.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-CfUVuGjc.js → chunk-DQASFODM-DSgprMfc.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-Drm0FEYk.js → chunk-HFQBQIA3-ChtjyKjP.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BVFRADlC.js → chunk-KQLB2F66-B2o0ufJC.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-DfyALEmP.js → chunk-KS47KZWR-C4qJvDaX.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-DtJVzk2c.js → chunk-LEVMRMFU-2jTGUstS.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-DTy27PHQ.js → chunk-M57EVK23-CKAWW7fj.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-nSgn7jZg.js → chunk-OY52VR5R-B5TUKZAt.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-CkSxO_X6.js → chunk-QB3YPZ4I-CyQFTqwG.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-Ck6iAjAL.js → chunk-R3KSYZAL-C6git_yh.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-DQPHdSTh.js → chunk-STOXU5M4-AwEqcNnS.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-Bc2AbV2Y.js → chunk-TU62E6Q5-GKcRDmvw.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-Cgpm0IXm.js → chunk-X4PVCEUW-CMG5EfZ9.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-CGE4eLpg.js → chunk-XXDRQBXY-BHd-dKtZ.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-4eQuDPEo.js → classDiagram-v2-L25IHNXF-HaRsBCG9.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-tDLCWq07.js → cose-bilkent-JH36ORCC-BPBTCfj3.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-DyqqRII3.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-ByqcZ8x9.js → cynefinDiagram-L36ESFBY-dAmWDtva.js} +1 -1
- package/dist/public/assets/{d3-selection-Bgn1374-.js → d3-selection-BhemR5ul.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-mCgr71mV.js → dagre-SPEB5RXH-D93g6hNI.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-DpYSwpQ0.js → diagram-3B7GL73J-FJBKgG3X.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-DMozUQzi.js → diagram-DNEMPZML-BP22T976.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-Bk5Uf8PD.js → diagram-L3MUGCDN-DcrCJXRt.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-DFt5cPVK.js → diagram-LA4NIPWU-DUgd3PHQ.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BkZZcKqK.js → diagram-MHCOC4E2-ejTInqzQ.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-HEY6kyyN.js → diagram-XPFHEONP-BLjkgho1.js} +1 -1
- package/dist/public/assets/{dist-Bj2CrKn7.js → dist-C9xqTt0E.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-D4JvYyVb.js → ebnfDiagram-UZSYDL2S-CB1QQ4_T.js} +1 -1
- package/dist/public/assets/{editor.api-BpJFzYbl.js → editor.api-lz6I1oVk.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CT6qLJkF.js → elk-XV6XMXQE-CLBx1s2b.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-BGng1goR.js → erDiagram-EYBAPDEH-Dsj6RYi5.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-Tt8O-Q1Z.js → eventmodeling-K75KTNOO-smOORsSG.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-DFmQPJ7B.js +1 -0
- package/dist/public/assets/{freemarker2-Dd5ksoRn.js → freemarker2-DrLPw7Mc.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-Jl8VO_g2.js → ganttDiagram-23REXITY-BV9WK0rK.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-ybrJCK6u.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-Be4qXALb.js → gitGraphDiagram-STJD7YCW-CsSpSQ0T.js} +1 -1
- package/dist/public/assets/{handlebars-4xabgUi4.js → handlebars-CLx5-csF.js} +1 -1
- package/dist/public/assets/{html-Dk3kt2w_.js → html-C9LmGm46.js} +1 -1
- package/dist/public/assets/{index-Bx0c7eoh.js → index-CLWW0mVu.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-n41_wZE4.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-Coc0tdwb.js → infoDiagram-KBXO4MBG-wm5AnXDz.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-CE_1VQCg.js → ishikawaDiagram-M35NCXHK-BLUBDeS3.js} +1 -1
- package/dist/public/assets/{javascript-DKLGqy6v.js → javascript-C4S1eQb7.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-CrolRZ_7.js → journeyDiagram-OPLOXDXO-DXc7-I_g.js} +1 -1
- package/dist/public/assets/{jsonMode-Chcs19_y.js → jsonMode-lLJKR2M6.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-CjJj47De.js → kanban-definition-BZKZHSQY-D5Ra4L_5.js} +1 -1
- package/dist/public/assets/{liquid-jff3p-Ji.js → liquid-DRlm-XZd.js} +1 -1
- package/dist/public/assets/{mdx-DW4uRDfJ.js → mdx-CzIqeqPy.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-XhQj6FvH.js → mermaid-parser.core-BIPB1BgS.js} +3 -3
- package/dist/public/assets/{mermaid.core-OD4Atimg.js → mermaid.core-DxBlQ6oF.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DpGelVY7.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-BTVZP-tU.js → monaco-ChpJIYsY.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-BjrqMgis.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CqcBmPfB.js → pegDiagram-FD4XPPHP-C_GF7Fng.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-CJSA88kr.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-CRir3beB.js → pieDiagram-J4AKIIQI-WlpNP-IM.js} +1 -1
- package/dist/public/assets/{python-BwW_0207.js → python-BJgFCfc8.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-DIY6gdcf.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-XWNOzunl.js → railroad-abnf-LNEFI6M7-DZZKUytl.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-CI0-j1Jz.js → railroad-ebnf-DWYD2UWJ-CS7KsJdb.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-BVB_IaIG.js → railroad-peg-JR7BVNR7-CiukTZVd.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-CudwT6q2.js → railroadDiagram-MRQ6NCDL-BS0R_H3-.js} +1 -1
- package/dist/public/assets/{razor-DrjCyQqB.js → razor-jcBIjr45.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CvRMeRqj.js → requirementDiagram-Y7LWUY3S-C0_T9jgl.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-adxYCJKr.js → sankeyDiagram-WGJFYUXA-DF15sUfS.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-lCRsoLUp.js → sequenceDiagram-5NDRBG5M-7AkTLleX.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-DNst1BLg.js → stateDiagram-v2-FJ4FJNEA-CU3i-U9q.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-S_omrdvA.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-_pMGrTE-.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-0-z_OYCU.js → typescript-B7zp7QPf.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-B2oJKi5Q.js → usecaseDiagram-AFA6YXN4-D6rDIgdU.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-inPs2Kkr.js → vennDiagram-NNMJR3RB-CncVDcMl.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-B4j5rilS.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-DNhNHM7b.js → wardleyDiagram-S7YFUSEH-DKPAMfTE.js} +1 -1
- package/dist/public/assets/{xml-BXPxQzKF.js → xml-BJIgLD52.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-DJc93dNT.js → xychartDiagram-GGNKY7IX-DmmXGebm.js} +1 -1
- package/dist/public/assets/{yaml-CGmD9Rya.js → yaml-Dxb2gmP5.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +7727 -3847
- 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,1226 @@
|
|
|
1
|
+
// web-src/i18n.ts
|
|
2
|
+
var en = {
|
|
3
|
+
settingsTitle: "Initiative",
|
|
4
|
+
modeLabel: "How much Ta does on its own",
|
|
5
|
+
modeHint: "Where each kind of thing starts, whether Ta may come to do it on its own as you accept it, and how often a day it may tell you at once: Quiet once, Balanced 3 times, Active no limit.",
|
|
6
|
+
quietLabel: "Quiet hours",
|
|
7
|
+
quietHint: "Ta tells you of nothing at once in these hours: it waits in Suggestions and the brief.",
|
|
8
|
+
quietFrom: "From",
|
|
9
|
+
quietTo: "to",
|
|
10
|
+
modeQuiet: "Quiet",
|
|
11
|
+
modeBalanced: "Balanced",
|
|
12
|
+
modeActive: "Active",
|
|
13
|
+
kindsLabel: "What Ta may do",
|
|
14
|
+
kindsHint: "Each goes up a level as you accept it and down as you decline or undo it; pick a level to keep it there.",
|
|
15
|
+
levelAuto: "Auto · {level}",
|
|
16
|
+
levelAutoPlain: "Auto",
|
|
17
|
+
levelOff: "Never",
|
|
18
|
+
levelDigest: "In the brief",
|
|
19
|
+
levelAsk: "Ask me",
|
|
20
|
+
levelAct: "Do it, tell me",
|
|
21
|
+
reasonStart: "Where it starts",
|
|
22
|
+
reasonUp: "Up on {date}: you accepted it 3 times in a row",
|
|
23
|
+
reasonDown: "Down on {date}: declined or undone",
|
|
24
|
+
reasonLocked: "You chose it",
|
|
25
|
+
inboxTitle: "Suggestions",
|
|
26
|
+
inboxWaiting: "Waiting for you",
|
|
27
|
+
inboxDone: "Done on its own",
|
|
28
|
+
inboxEmpty: "Nothing waits. When Ta finds work you ask for again and again, it suggests it here.",
|
|
29
|
+
accept: "OK",
|
|
30
|
+
decline: "No",
|
|
31
|
+
always: "Always do it",
|
|
32
|
+
neverAgain: "Never suggest this",
|
|
33
|
+
undo: "Undo",
|
|
34
|
+
undoneState: "Undone",
|
|
35
|
+
failedState: "Failed: {error}",
|
|
36
|
+
inBrief: "From the brief",
|
|
37
|
+
evidence: "From {count} conversations",
|
|
38
|
+
homeDetail: "{waiting} waiting · {done} done on its own",
|
|
39
|
+
homeWaiting: "{waiting} waiting for you",
|
|
40
|
+
homeDone: "{done} done on its own",
|
|
41
|
+
toolPropose: "Propose",
|
|
42
|
+
acceptedLine: "Accepted",
|
|
43
|
+
declinedLine: "Declined",
|
|
44
|
+
expiredLine: "No longer waits",
|
|
45
|
+
enabledLabel: "Review the scheduled tasks",
|
|
46
|
+
enabledHint: "Ta looks back at what you asked since the last review: work you asked for again and again becomes a scheduled task, tasks that keep failing or no longer matter are turned off. Each change goes as far as you let its kind (above): done, or asked in Suggestions. It reports in the conversation Evolve, where you can answer; it remembers what you said.",
|
|
47
|
+
everyLabel: "How often",
|
|
48
|
+
everyDays: "Every {days} days",
|
|
49
|
+
every1: "Every day",
|
|
50
|
+
every7: "Every week",
|
|
51
|
+
every14: "Every two weeks",
|
|
52
|
+
every30: "Every month",
|
|
53
|
+
timeLabel: "At",
|
|
54
|
+
autoLabel: "Let Ta choose how often",
|
|
55
|
+
autoHint: "After each review Ta sets the next: sooner while your work changes, later while nothing does.",
|
|
56
|
+
autoNote: "Ta: {note}",
|
|
57
|
+
nowLabel: "Review now",
|
|
58
|
+
nowButton: "Review",
|
|
59
|
+
lastNext: "Last {last} · next {next}",
|
|
60
|
+
nextOnly: "First review {next}",
|
|
61
|
+
never: "never",
|
|
62
|
+
conversation: "Evolve",
|
|
63
|
+
failed: "Could not do it: {message}",
|
|
64
|
+
toolPace: "Set review pace",
|
|
65
|
+
toolProfile: "Update what Ta knows of you",
|
|
66
|
+
learnLabel: "Learn about me",
|
|
67
|
+
learnHint: "At each review Ta writes down how you work and what you usually want next; every conversation reads it, so Ta needs telling less and does more on its own.",
|
|
68
|
+
profileLabel: "What Ta knows of you",
|
|
69
|
+
profileHint: "Edit it freely: Ta keeps your changes and builds on them.",
|
|
70
|
+
profileEmpty: "Nothing yet: Ta writes it at the next review.",
|
|
71
|
+
profileSave: "Save",
|
|
72
|
+
profileSaved: "Saved"
|
|
73
|
+
};
|
|
74
|
+
var zh = {
|
|
75
|
+
settingsTitle: "主动",
|
|
76
|
+
modeLabel: "主动程度",
|
|
77
|
+
modeHint: "决定每类事从哪一档开始、你接受得多了 Ta 能不能自己直接做,以及一天最多即时提醒几次:安静 1 次、适中 3 次、积极不限。",
|
|
78
|
+
quietLabel: "安静时段",
|
|
79
|
+
quietHint: "这段时间里 Ta 不即时提醒你,建议都留在“Ta 的建议”和简报里。",
|
|
80
|
+
quietFrom: "从",
|
|
81
|
+
quietTo: "到",
|
|
82
|
+
modeQuiet: "安静",
|
|
83
|
+
modeBalanced: "适中",
|
|
84
|
+
modeActive: "积极",
|
|
85
|
+
kindsLabel: "Ta 可以做的事",
|
|
86
|
+
kindsHint: "每类事你接受得多就升一档,拒绝或撤销就降一档;手动选了档位就不再自动变。",
|
|
87
|
+
levelAuto: "自动 · {level}",
|
|
88
|
+
levelAutoPlain: "自动",
|
|
89
|
+
levelOff: "不提",
|
|
90
|
+
levelDigest: "只进简报",
|
|
91
|
+
levelAsk: "先问我",
|
|
92
|
+
levelAct: "先做后报",
|
|
93
|
+
reasonStart: "初始档位",
|
|
94
|
+
reasonUp: "{date} 升档:连续接受 3 次",
|
|
95
|
+
reasonDown: "{date} 降档:被拒绝或撤销",
|
|
96
|
+
reasonLocked: "你选定的",
|
|
97
|
+
inboxTitle: "Ta 的建议",
|
|
98
|
+
inboxWaiting: "等你决定",
|
|
99
|
+
inboxDone: "已替你做",
|
|
100
|
+
inboxEmpty: "暂时没有建议。Ta 发现你反复交代的事,会在这里提出。",
|
|
101
|
+
accept: "好",
|
|
102
|
+
decline: "不用",
|
|
103
|
+
always: "以后直接做",
|
|
104
|
+
neverAgain: "别再提这类",
|
|
105
|
+
undo: "撤销",
|
|
106
|
+
undoneState: "已撤销",
|
|
107
|
+
failedState: "失败:{error}",
|
|
108
|
+
inBrief: "来自简报",
|
|
109
|
+
evidence: "依据 {count} 个对话",
|
|
110
|
+
homeDetail: "等你决定 {waiting} · 已替你做 {done}",
|
|
111
|
+
homeWaiting: "等你决定 {waiting}",
|
|
112
|
+
homeDone: "已替你做 {done}",
|
|
113
|
+
toolPropose: "提议",
|
|
114
|
+
acceptedLine: "已同意",
|
|
115
|
+
declinedLine: "已拒绝",
|
|
116
|
+
expiredLine: "已失效",
|
|
117
|
+
enabledLabel: "定期整理定时任务",
|
|
118
|
+
enabledHint: "Ta 回顾上次以来你交代过的事:反复做的工作建成定时任务,总是失败或已经过时的任务停用;每项改动按上面的档位直接做,或放进“Ta 的建议”等你点头。结果写进“自我进化”对话,你可以在里面回复,Ta 会记住你的意见。",
|
|
119
|
+
everyLabel: "多久一次",
|
|
120
|
+
everyDays: "每 {days} 天",
|
|
121
|
+
every1: "每天",
|
|
122
|
+
every7: "每周",
|
|
123
|
+
every14: "每两周",
|
|
124
|
+
every30: "每月",
|
|
125
|
+
timeLabel: "时间",
|
|
126
|
+
autoLabel: "让 Ta 决定节奏",
|
|
127
|
+
autoHint: "每次整理后由 Ta 定下一次:工作变化多就勤一点,没什么变化就久一点。",
|
|
128
|
+
autoNote: "Ta:{note}",
|
|
129
|
+
nowLabel: "现在整理一次",
|
|
130
|
+
nowButton: "整理",
|
|
131
|
+
lastNext: "上次 {last} · 下次 {next}",
|
|
132
|
+
nextOnly: "首次 {next}",
|
|
133
|
+
never: "无",
|
|
134
|
+
conversation: "自我进化",
|
|
135
|
+
failed: "没有成功:{message}",
|
|
136
|
+
toolPace: "调整整理节奏",
|
|
137
|
+
toolProfile: "更新对你的了解",
|
|
138
|
+
learnLabel: "了解我",
|
|
139
|
+
learnHint: "每次整理时,Ta 记下你的做事方式和你通常接下来想做什么;所有对话都会参考,你要交代的越来越少,Ta 主动做的越来越多。",
|
|
140
|
+
profileLabel: "Ta 对你的了解",
|
|
141
|
+
profileHint: "可以直接修改,Ta 会保留你的改动并在此基础上补充。",
|
|
142
|
+
profileEmpty: "还没有内容,下次整理时 Ta 会写。",
|
|
143
|
+
profileSave: "保存",
|
|
144
|
+
profileSaved: "已保存"
|
|
145
|
+
};
|
|
146
|
+
var InitiativeWords;
|
|
147
|
+
((InitiativeWords) => {
|
|
148
|
+
function of(language) {
|
|
149
|
+
return /^zh/i.test(language) ? zh : en;
|
|
150
|
+
}
|
|
151
|
+
InitiativeWords.of = of;
|
|
152
|
+
function format(text, values) {
|
|
153
|
+
return text.replace(/\{(\w+)\}/g, (match, key) => values[key] ?? match);
|
|
154
|
+
}
|
|
155
|
+
InitiativeWords.format = format;
|
|
156
|
+
})(InitiativeWords ||= {});
|
|
157
|
+
|
|
158
|
+
// web-src/conversation.ts
|
|
159
|
+
async function openConversation(pi, file) {
|
|
160
|
+
const opened = await pi.openChat?.(file);
|
|
161
|
+
if (opened !== undefined) {
|
|
162
|
+
return opened;
|
|
163
|
+
}
|
|
164
|
+
const open = (await pi.server.listSessions()).find((session) => session.sessionFile === file);
|
|
165
|
+
if (open) {
|
|
166
|
+
await pi.switchSession(open.sessionId);
|
|
167
|
+
pi.ui.showView("");
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
const saved = (await pi.server.listSavedSessions()).find((session) => session.sessionFile === file);
|
|
171
|
+
if (!saved) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
const sessionId = pi.server.openSession({ cwd: saved.cwd, sessionFile: file }).then((session) => session.sessionId);
|
|
175
|
+
await pi.switchSession(sessionId, { title: saved.sessionName || saved.firstMessage, cwd: saved.cwd, sessionFile: file });
|
|
176
|
+
pi.ui.showView("");
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// web-src/initiative-protocol.ts
|
|
181
|
+
var NAME = "@celljs/ta-initiative";
|
|
182
|
+
var PACE_TOOL = "evolve_pace";
|
|
183
|
+
var PROFILE_TOOL = "evolve_profile";
|
|
184
|
+
var PROPOSE_TOOL = "propose";
|
|
185
|
+
var CARD_TYPE = "ta-initiative";
|
|
186
|
+
var BLOCK = "ta-propose";
|
|
187
|
+
var LEVELS = ["off", "digest", "ask", "act"];
|
|
188
|
+
var MODES = ["quiet", "balanced", "active"];
|
|
189
|
+
var Keys;
|
|
190
|
+
((Keys) => {
|
|
191
|
+
Keys.SETTINGS = "settings";
|
|
192
|
+
Keys.FILE = "file";
|
|
193
|
+
Keys.LAST = "last";
|
|
194
|
+
Keys.NOTE = "note";
|
|
195
|
+
Keys.PROFILE = "profile";
|
|
196
|
+
Keys.MODE = "mode";
|
|
197
|
+
Keys.LOCKS = "locks";
|
|
198
|
+
Keys.PROPOSALS = "proposals";
|
|
199
|
+
Keys.SEEN = "seen";
|
|
200
|
+
Keys.QUIET = "quiet";
|
|
201
|
+
Keys.MIGRATED = "migrated";
|
|
202
|
+
})(Keys ||= {});
|
|
203
|
+
var Limits;
|
|
204
|
+
((Limits) => {
|
|
205
|
+
Limits.MIN_DAYS = 1;
|
|
206
|
+
Limits.MAX_DAYS = 30;
|
|
207
|
+
Limits.LOOK_BACK_DAYS = 7;
|
|
208
|
+
Limits.MATERIAL_CHARS = 48000;
|
|
209
|
+
Limits.RUNS = 5;
|
|
210
|
+
Limits.PROMPT_CHARS = 400;
|
|
211
|
+
Limits.SUMMARY_CHARS = 240;
|
|
212
|
+
Limits.NEW_TASKS = 3;
|
|
213
|
+
Limits.PROFILE_CHARS = 3000;
|
|
214
|
+
Limits.PROPOSALS_KEPT = 200;
|
|
215
|
+
Limits.OUTCOMES = 20;
|
|
216
|
+
Limits.UP_AFTER = 3;
|
|
217
|
+
Limits.DOWN_AFTER = 2;
|
|
218
|
+
Limits.EXPIRE_DAYS = 14;
|
|
219
|
+
Limits.UNDO_DAYS = 7;
|
|
220
|
+
Limits.BUDGET = { quiet: 1, balanced: 3, active: Number.POSITIVE_INFINITY };
|
|
221
|
+
Limits.NOTICE_MS = 2 * 60000;
|
|
222
|
+
})(Limits ||= {});
|
|
223
|
+
|
|
224
|
+
// web-src/inbox-util.ts
|
|
225
|
+
var DAY_MS = 24 * 60 * 60000;
|
|
226
|
+
function waits(proposal) {
|
|
227
|
+
return proposal.state === "pending" || proposal.state === "digest";
|
|
228
|
+
}
|
|
229
|
+
var InboxUtil;
|
|
230
|
+
((InboxUtil) => {
|
|
231
|
+
function waiting(proposals) {
|
|
232
|
+
return proposals.filter(waits).sort((a, b) => a.state === b.state ? b.at - a.at : a.state === "pending" ? -1 : 1);
|
|
233
|
+
}
|
|
234
|
+
InboxUtil.waiting = waiting;
|
|
235
|
+
function done(proposals, now) {
|
|
236
|
+
return proposals.filter((proposal) => proposal.auto && ["done", "undone", "failed"].includes(proposal.state) && now - (proposal.decidedAt ?? proposal.at) <= Limits.UNDO_DAYS * DAY_MS).sort((a, b) => (b.decidedAt ?? b.at) - (a.decidedAt ?? a.at));
|
|
237
|
+
}
|
|
238
|
+
InboxUtil.done = done;
|
|
239
|
+
function canUndo(proposal, now) {
|
|
240
|
+
return proposal.state === "done" && !!proposal.undo && now - (proposal.decidedAt ?? proposal.at) <= Limits.UNDO_DAYS * DAY_MS;
|
|
241
|
+
}
|
|
242
|
+
InboxUtil.canUndo = canUndo;
|
|
243
|
+
function home(proposals, seen, now) {
|
|
244
|
+
const open = waiting(proposals);
|
|
245
|
+
const did = done(proposals, now).filter((proposal) => proposal.state === "done");
|
|
246
|
+
if (open.length === 0 && did.length === 0) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const at = Math.max(...[...open, ...did].map((proposal) => Math.max(proposal.at, proposal.decidedAt ?? 0)));
|
|
250
|
+
return { waiting: open.length, done: did.length, at, unseen: at > seen };
|
|
251
|
+
}
|
|
252
|
+
InboxUtil.home = home;
|
|
253
|
+
})(InboxUtil ||= {});
|
|
254
|
+
|
|
255
|
+
// web-src/notify-util.ts
|
|
256
|
+
var NotifyUtil;
|
|
257
|
+
((NotifyUtil) => {
|
|
258
|
+
NotifyUtil.QUIET = { enabled: true, start: "22:00", end: "08:00" };
|
|
259
|
+
function quiet(value) {
|
|
260
|
+
const stored = value && typeof value === "object" ? value : {};
|
|
261
|
+
return {
|
|
262
|
+
enabled: typeof stored.enabled === "boolean" ? stored.enabled : NotifyUtil.QUIET.enabled,
|
|
263
|
+
start: typeof stored.start === "string" && minutes(stored.start) !== undefined ? stored.start : NotifyUtil.QUIET.start,
|
|
264
|
+
end: typeof stored.end === "string" && minutes(stored.end) !== undefined ? stored.end : NotifyUtil.QUIET.end
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
NotifyUtil.quiet = quiet;
|
|
268
|
+
function minutes(text) {
|
|
269
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(text.trim());
|
|
270
|
+
const hours = Number(match?.[1]);
|
|
271
|
+
const mins = Number(match?.[2]);
|
|
272
|
+
return match && hours < 24 && mins < 60 ? hours * 60 + mins : undefined;
|
|
273
|
+
}
|
|
274
|
+
NotifyUtil.minutes = minutes;
|
|
275
|
+
function isQuiet(hours, now) {
|
|
276
|
+
const start = minutes(hours.start);
|
|
277
|
+
const end = minutes(hours.end);
|
|
278
|
+
if (!hours.enabled || start === undefined || end === undefined || start === end) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
const date = new Date(now);
|
|
282
|
+
const at = date.getHours() * 60 + date.getMinutes();
|
|
283
|
+
return start < end ? at >= start && at < end : at >= start || at < end;
|
|
284
|
+
}
|
|
285
|
+
NotifyUtil.isQuiet = isQuiet;
|
|
286
|
+
function toldToday(proposals, now) {
|
|
287
|
+
const day = new Date(now).toDateString();
|
|
288
|
+
return proposals.filter((proposal) => proposal.notifiedAt && new Date(proposal.notifiedAt).toDateString() === day).length;
|
|
289
|
+
}
|
|
290
|
+
NotifyUtil.toldToday = toldToday;
|
|
291
|
+
function tell(input) {
|
|
292
|
+
const { proposal } = input;
|
|
293
|
+
return proposal.state === "pending" && proposal.level === "ask" && proposal.urgency === "now" && proposal.source !== "turn" && input.pages > 0 && !isQuiet(input.quiet, input.now) && input.told < Limits.BUDGET[input.mode];
|
|
294
|
+
}
|
|
295
|
+
NotifyUtil.tell = tell;
|
|
296
|
+
})(NotifyUtil ||= {});
|
|
297
|
+
|
|
298
|
+
// web-src/pace-util.ts
|
|
299
|
+
var DAY_MS2 = 24 * 60 * 60000;
|
|
300
|
+
var PaceUtil;
|
|
301
|
+
((PaceUtil) => {
|
|
302
|
+
PaceUtil.DEFAULT = { enabled: true, every: 7, time: "20:00", auto: false, learn: true };
|
|
303
|
+
PaceUtil.CHOICES = [1, 7, 14, 30];
|
|
304
|
+
function settings(value) {
|
|
305
|
+
const stored = value && typeof value === "object" ? value : {};
|
|
306
|
+
return {
|
|
307
|
+
enabled: typeof stored.enabled === "boolean" ? stored.enabled : PaceUtil.DEFAULT.enabled,
|
|
308
|
+
every: typeof stored.every === "number" && Number.isFinite(stored.every) ? days(stored.every) : PaceUtil.DEFAULT.every,
|
|
309
|
+
time: typeof stored.time === "string" && parseTime(stored.time) ? stored.time : PaceUtil.DEFAULT.time,
|
|
310
|
+
auto: typeof stored.auto === "boolean" ? stored.auto : PaceUtil.DEFAULT.auto,
|
|
311
|
+
learn: typeof stored.learn === "boolean" ? stored.learn : PaceUtil.DEFAULT.learn
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
PaceUtil.settings = settings;
|
|
315
|
+
function days(value) {
|
|
316
|
+
return Math.min(Limits.MAX_DAYS, Math.max(Limits.MIN_DAYS, Math.round(value)));
|
|
317
|
+
}
|
|
318
|
+
PaceUtil.days = days;
|
|
319
|
+
function parseTime(text) {
|
|
320
|
+
const match = /^(\d{1,2}):(\d{2})$/.exec(text.trim());
|
|
321
|
+
if (!match) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const hours = Number(match[1]);
|
|
325
|
+
const minutes = Number(match[2]);
|
|
326
|
+
return hours < 24 && minutes < 60 ? { hours, minutes } : undefined;
|
|
327
|
+
}
|
|
328
|
+
PaceUtil.parseTime = parseTime;
|
|
329
|
+
function next(settings2, last) {
|
|
330
|
+
const { hours, minutes } = parseTime(settings2.time) ?? { hours: 20, minutes: 0 };
|
|
331
|
+
const day = new Date(last + settings2.every * DAY_MS2);
|
|
332
|
+
day.setHours(hours, minutes, 0, 0);
|
|
333
|
+
return day.getTime();
|
|
334
|
+
}
|
|
335
|
+
PaceUtil.next = next;
|
|
336
|
+
function due(settings2, last, now) {
|
|
337
|
+
return settings2.enabled && last !== undefined && now >= next(settings2, last);
|
|
338
|
+
}
|
|
339
|
+
PaceUtil.due = due;
|
|
340
|
+
function since(last, now) {
|
|
341
|
+
const earliest = now - Limits.MAX_DAYS * DAY_MS2;
|
|
342
|
+
const latest = now - Limits.LOOK_BACK_DAYS * DAY_MS2;
|
|
343
|
+
return Math.max(earliest, Math.min(latest, last ?? latest));
|
|
344
|
+
}
|
|
345
|
+
PaceUtil.since = since;
|
|
346
|
+
})(PaceUtil ||= {});
|
|
347
|
+
|
|
348
|
+
// web-src/initiative-store.ts
|
|
349
|
+
var KEYS = [Keys.SETTINGS, Keys.LAST, Keys.FILE, Keys.NOTE, Keys.PROFILE, Keys.MODE, Keys.LOCKS, Keys.PROPOSALS, Keys.SEEN, Keys.QUIET];
|
|
350
|
+
|
|
351
|
+
class InitiativeStore {
|
|
352
|
+
pi;
|
|
353
|
+
current = {
|
|
354
|
+
review: { settings: PaceUtil.DEFAULT },
|
|
355
|
+
kinds: [],
|
|
356
|
+
proposals: [],
|
|
357
|
+
mode: "balanced",
|
|
358
|
+
seen: 0,
|
|
359
|
+
quiet: NotifyUtil.QUIET,
|
|
360
|
+
loaded: false
|
|
361
|
+
};
|
|
362
|
+
listeners = new Set;
|
|
363
|
+
constructor(pi) {
|
|
364
|
+
this.pi = pi;
|
|
365
|
+
this.read();
|
|
366
|
+
pi.storage.onChange((keys) => keys.some((key) => KEYS.includes(key)) && this.read());
|
|
367
|
+
}
|
|
368
|
+
get state() {
|
|
369
|
+
return this.current;
|
|
370
|
+
}
|
|
371
|
+
get status() {
|
|
372
|
+
return this.current.review;
|
|
373
|
+
}
|
|
374
|
+
subscribe(listener) {
|
|
375
|
+
this.listeners.add(listener);
|
|
376
|
+
return () => this.listeners.delete(listener);
|
|
377
|
+
}
|
|
378
|
+
async change(patch) {
|
|
379
|
+
const settings = PaceUtil.settings({ ...this.current.review.settings, ...patch });
|
|
380
|
+
this.set({ ...this.current, review: { ...this.current.review, settings } });
|
|
381
|
+
await this.pi.storage.set(Keys.SETTINGS, settings);
|
|
382
|
+
}
|
|
383
|
+
async saveProfile(profile) {
|
|
384
|
+
const kept = await this.pi.callHost("setProfile", profile);
|
|
385
|
+
this.set({ ...this.current, review: { ...this.current.review, profile: kept || undefined } });
|
|
386
|
+
}
|
|
387
|
+
async decide(id, decision) {
|
|
388
|
+
await this.pi.callHost("decide", id, decision);
|
|
389
|
+
this.read();
|
|
390
|
+
}
|
|
391
|
+
async undo(id) {
|
|
392
|
+
await this.pi.callHost("undo", id);
|
|
393
|
+
this.read();
|
|
394
|
+
}
|
|
395
|
+
async setLevel(kind, level) {
|
|
396
|
+
await this.pi.callHost("setLevel", kind, level);
|
|
397
|
+
this.read();
|
|
398
|
+
}
|
|
399
|
+
async setMode(mode) {
|
|
400
|
+
this.set({ ...this.current, mode });
|
|
401
|
+
await this.pi.callHost("setMode", mode);
|
|
402
|
+
this.read();
|
|
403
|
+
}
|
|
404
|
+
async setQuiet(patch) {
|
|
405
|
+
const quiet = NotifyUtil.quiet({ ...this.current.quiet, ...patch });
|
|
406
|
+
this.set({ ...this.current, quiet });
|
|
407
|
+
await this.pi.storage.set(Keys.QUIET, quiet);
|
|
408
|
+
}
|
|
409
|
+
see() {
|
|
410
|
+
const newest = this.current.proposals.reduce((at, proposal) => Math.max(at, proposal.at, proposal.decidedAt ?? 0), 0);
|
|
411
|
+
if (newest > this.current.seen) {
|
|
412
|
+
this.set({ ...this.current, seen: newest });
|
|
413
|
+
this.pi.storage.set(Keys.SEEN, newest).catch(() => {
|
|
414
|
+
return;
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
read() {
|
|
419
|
+
Promise.all([
|
|
420
|
+
this.pi.callHost("reviewStatus").catch(() => {
|
|
421
|
+
return;
|
|
422
|
+
}),
|
|
423
|
+
this.pi.callHost("kinds").catch(() => {
|
|
424
|
+
return;
|
|
425
|
+
}),
|
|
426
|
+
this.pi.storage.get(Keys.PROPOSALS).catch(() => {
|
|
427
|
+
return;
|
|
428
|
+
}),
|
|
429
|
+
this.pi.storage.get(Keys.MODE).catch(() => {
|
|
430
|
+
return;
|
|
431
|
+
}),
|
|
432
|
+
this.pi.storage.get(Keys.SEEN).catch(() => {
|
|
433
|
+
return;
|
|
434
|
+
}),
|
|
435
|
+
this.pi.storage.get(Keys.QUIET).catch(() => {
|
|
436
|
+
return;
|
|
437
|
+
})
|
|
438
|
+
]).then(([review, kinds, proposals, mode, seen, quiet]) => this.set({
|
|
439
|
+
review: review ? { ...review, settings: PaceUtil.settings(review.settings) } : this.current.review,
|
|
440
|
+
kinds: Array.isArray(kinds) ? kinds : this.current.kinds,
|
|
441
|
+
proposals: Array.isArray(proposals) ? proposals : [],
|
|
442
|
+
mode: MODES.includes(mode) ? mode : "balanced",
|
|
443
|
+
seen: typeof seen === "number" ? seen : 0,
|
|
444
|
+
quiet: NotifyUtil.quiet(quiet),
|
|
445
|
+
loaded: true
|
|
446
|
+
}));
|
|
447
|
+
}
|
|
448
|
+
set(state) {
|
|
449
|
+
this.current = state;
|
|
450
|
+
for (const listener of this.listeners) {
|
|
451
|
+
listener();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function useInitiative(react, store) {
|
|
456
|
+
return react.useSyncExternalStore((listener) => store.subscribe(listener), () => store.state);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// web-src/notices.ts
|
|
460
|
+
function proposalFile(proposal) {
|
|
461
|
+
return proposal.action?.type === "session" ? proposal.action.sessionFile : proposal.evidence?.[0];
|
|
462
|
+
}
|
|
463
|
+
function watchNotices(pi, store) {
|
|
464
|
+
const told = new Set;
|
|
465
|
+
const look = () => {
|
|
466
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
467
|
+
const now = Date.now();
|
|
468
|
+
for (const proposal of store.state.proposals) {
|
|
469
|
+
if (!proposal.notifiedAt || proposal.state !== "pending" || now - proposal.notifiedAt > Limits.NOTICE_MS || told.has(proposal.id)) {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
told.add(proposal.id);
|
|
473
|
+
const file = proposalFile(proposal);
|
|
474
|
+
const action = proposal.action;
|
|
475
|
+
pi.ui.notifySession?.({
|
|
476
|
+
key: `ta-initiative:${proposal.id}`,
|
|
477
|
+
title: words.inboxTitle,
|
|
478
|
+
...file ? {} : { view: `${NAME}/inbox` },
|
|
479
|
+
...file ? { sessionFile: file } : {},
|
|
480
|
+
...proposal.cwd ? { cwd: proposal.cwd } : {},
|
|
481
|
+
level: "ask",
|
|
482
|
+
text: proposal.why ? `${proposal.title}
|
|
483
|
+
${proposal.why}` : proposal.title,
|
|
484
|
+
actions: [
|
|
485
|
+
{
|
|
486
|
+
label: words.accept,
|
|
487
|
+
run: () => void store.decide(proposal.id, "accept").then(() => action?.type === "session" ? openConversation(pi, action.sessionFile) : undefined).catch(() => {
|
|
488
|
+
return;
|
|
489
|
+
})
|
|
490
|
+
},
|
|
491
|
+
{ label: words.decline, run: () => void store.decide(proposal.id, "decline").catch(() => {
|
|
492
|
+
return;
|
|
493
|
+
}) }
|
|
494
|
+
]
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
};
|
|
498
|
+
look();
|
|
499
|
+
return store.subscribe(look);
|
|
500
|
+
}
|
|
501
|
+
function conversationProposals(proposals, sessionFile) {
|
|
502
|
+
return sessionFile ? proposals.filter((proposal) => proposal.state === "pending" && proposal.source === "host" && proposal.action?.type === "session" && proposal.action.sessionFile === sessionFile) : [];
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// web-src/react.ts
|
|
506
|
+
var React;
|
|
507
|
+
function bind(react) {
|
|
508
|
+
React = react;
|
|
509
|
+
}
|
|
510
|
+
var idle = () => [false, async (action) => await action()];
|
|
511
|
+
function useBusy(ui) {
|
|
512
|
+
return (ui.useBusy ?? idle)();
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// web-src/inbox.tsx
|
|
516
|
+
function message(error) {
|
|
517
|
+
return error instanceof Error ? error.message : String(error);
|
|
518
|
+
}
|
|
519
|
+
function clock(at) {
|
|
520
|
+
const date = new Date(at);
|
|
521
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
522
|
+
return `${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
523
|
+
}
|
|
524
|
+
function kindTitle(kinds, id, language) {
|
|
525
|
+
const kind = kinds.find((one) => one.kind.id === id)?.kind;
|
|
526
|
+
return kind ? /^zh/i.test(language) ? kind.title.zh : kind.title.en : id;
|
|
527
|
+
}
|
|
528
|
+
function Act({ pi, label, primary, onClick }) {
|
|
529
|
+
const [busy, run] = useBusy(pi.ui);
|
|
530
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
531
|
+
const act = async () => {
|
|
532
|
+
try {
|
|
533
|
+
await onClick();
|
|
534
|
+
} catch (error) {
|
|
535
|
+
pi.ui.notify(InitiativeWords.format(words.failed, { message: message(error) }), "error");
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
return /* @__PURE__ */ React.createElement("button", {
|
|
539
|
+
type: "button",
|
|
540
|
+
className: `ta-button${primary ? " ta-primary" : ""}${busy ? " ta-busy" : ""}`,
|
|
541
|
+
disabled: busy,
|
|
542
|
+
onClick: () => void run(act)
|
|
543
|
+
}, busy && /* @__PURE__ */ React.createElement("span", {
|
|
544
|
+
className: "ta-spinner ta-busy-mark"
|
|
545
|
+
}), /* @__PURE__ */ React.createElement("span", null, label));
|
|
546
|
+
}
|
|
547
|
+
function Evidence({ pi, proposal, words }) {
|
|
548
|
+
const files = proposal.evidence ?? [];
|
|
549
|
+
if (files.length === 0) {
|
|
550
|
+
return null;
|
|
551
|
+
}
|
|
552
|
+
return /* @__PURE__ */ React.createElement("button", {
|
|
553
|
+
type: "button",
|
|
554
|
+
className: "tin-link",
|
|
555
|
+
onClick: () => void openConversation(pi, files[0])
|
|
556
|
+
}, InitiativeWords.format(words.evidence, { count: String(files.length) }));
|
|
557
|
+
}
|
|
558
|
+
function Waiting({
|
|
559
|
+
pi,
|
|
560
|
+
store,
|
|
561
|
+
proposal,
|
|
562
|
+
kinds,
|
|
563
|
+
away
|
|
564
|
+
}) {
|
|
565
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
566
|
+
const decide = (decision) => async () => {
|
|
567
|
+
await store.decide(proposal.id, decision);
|
|
568
|
+
const action = proposal.action;
|
|
569
|
+
if (away && action?.type === "session" && (decision === "accept" || decision === "always")) {
|
|
570
|
+
await openConversation(pi, action.sessionFile);
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
const reversible = kinds.find((one) => one.kind.id === proposal.kind)?.kind.reversible ?? false;
|
|
574
|
+
return /* @__PURE__ */ React.createElement("li", {
|
|
575
|
+
className: "tin-card"
|
|
576
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
577
|
+
className: "tin-kind"
|
|
578
|
+
}, /* @__PURE__ */ React.createElement("span", null, kindTitle(kinds, proposal.kind, pi.ui.language)), proposal.state === "digest" && /* @__PURE__ */ React.createElement("span", {
|
|
579
|
+
className: "tin-tag"
|
|
580
|
+
}, words.inBrief), /* @__PURE__ */ React.createElement("span", {
|
|
581
|
+
className: "tin-time"
|
|
582
|
+
}, clock(proposal.at))), /* @__PURE__ */ React.createElement("div", {
|
|
583
|
+
className: "tin-title"
|
|
584
|
+
}, proposal.title), proposal.why && /* @__PURE__ */ React.createElement("div", {
|
|
585
|
+
className: "tin-why"
|
|
586
|
+
}, proposal.why), /* @__PURE__ */ React.createElement(Evidence, {
|
|
587
|
+
pi,
|
|
588
|
+
proposal,
|
|
589
|
+
words
|
|
590
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
591
|
+
className: "tin-actions"
|
|
592
|
+
}, /* @__PURE__ */ React.createElement(Act, {
|
|
593
|
+
pi,
|
|
594
|
+
label: words.accept,
|
|
595
|
+
primary: true,
|
|
596
|
+
onClick: decide("accept")
|
|
597
|
+
}), /* @__PURE__ */ React.createElement(Act, {
|
|
598
|
+
pi,
|
|
599
|
+
label: words.decline,
|
|
600
|
+
onClick: decide("decline")
|
|
601
|
+
})), /* @__PURE__ */ React.createElement("div", {
|
|
602
|
+
className: "tin-more"
|
|
603
|
+
}, reversible && /* @__PURE__ */ React.createElement("button", {
|
|
604
|
+
type: "button",
|
|
605
|
+
className: "tin-link",
|
|
606
|
+
onClick: () => void decide("always")().catch(() => {
|
|
607
|
+
return;
|
|
608
|
+
})
|
|
609
|
+
}, words.always), /* @__PURE__ */ React.createElement("button", {
|
|
610
|
+
type: "button",
|
|
611
|
+
className: "tin-link",
|
|
612
|
+
onClick: () => void decide("never")().catch(() => {
|
|
613
|
+
return;
|
|
614
|
+
})
|
|
615
|
+
}, words.neverAgain)));
|
|
616
|
+
}
|
|
617
|
+
function Done({
|
|
618
|
+
pi,
|
|
619
|
+
store,
|
|
620
|
+
proposal,
|
|
621
|
+
kinds,
|
|
622
|
+
now
|
|
623
|
+
}) {
|
|
624
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
625
|
+
const state = proposal.state === "undone" ? words.undoneState : proposal.state === "failed" ? InitiativeWords.format(words.failedState, { error: proposal.error ?? "" }) : "";
|
|
626
|
+
return /* @__PURE__ */ React.createElement("li", {
|
|
627
|
+
className: "tin-card tin-done",
|
|
628
|
+
"data-state": proposal.state
|
|
629
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
630
|
+
className: "tin-kind"
|
|
631
|
+
}, /* @__PURE__ */ React.createElement("span", null, kindTitle(kinds, proposal.kind, pi.ui.language)), /* @__PURE__ */ React.createElement("span", {
|
|
632
|
+
className: "tin-time"
|
|
633
|
+
}, clock(proposal.decidedAt ?? proposal.at))), /* @__PURE__ */ React.createElement("div", {
|
|
634
|
+
className: "tin-title"
|
|
635
|
+
}, proposal.title), proposal.why && /* @__PURE__ */ React.createElement("div", {
|
|
636
|
+
className: "tin-why"
|
|
637
|
+
}, proposal.why), state && /* @__PURE__ */ React.createElement("div", {
|
|
638
|
+
className: "tin-state"
|
|
639
|
+
}, state), InboxUtil.canUndo(proposal, now) && /* @__PURE__ */ React.createElement("div", {
|
|
640
|
+
className: "tin-actions"
|
|
641
|
+
}, /* @__PURE__ */ React.createElement(Act, {
|
|
642
|
+
pi,
|
|
643
|
+
label: words.undo,
|
|
644
|
+
onClick: () => store.undo(proposal.id)
|
|
645
|
+
})));
|
|
646
|
+
}
|
|
647
|
+
function Inbox({ pi, store }) {
|
|
648
|
+
const state = useInitiative(React, store);
|
|
649
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
650
|
+
const now = Date.now();
|
|
651
|
+
const waiting = InboxUtil.waiting(state.proposals);
|
|
652
|
+
const done = InboxUtil.done(state.proposals, now);
|
|
653
|
+
React.useEffect(() => {
|
|
654
|
+
if (state.loaded) {
|
|
655
|
+
store.see();
|
|
656
|
+
}
|
|
657
|
+
}, [store, state.loaded, state.proposals]);
|
|
658
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
659
|
+
className: "tin-inbox"
|
|
660
|
+
}, waiting.length === 0 && done.length === 0 && state.loaded && /* @__PURE__ */ React.createElement("div", {
|
|
661
|
+
className: "tin-empty"
|
|
662
|
+
}, words.inboxEmpty), waiting.length > 0 && /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("h3", {
|
|
663
|
+
className: "tin-head"
|
|
664
|
+
}, words.inboxWaiting), /* @__PURE__ */ React.createElement("ul", {
|
|
665
|
+
className: "tin-list"
|
|
666
|
+
}, waiting.map((proposal) => /* @__PURE__ */ React.createElement(Waiting, {
|
|
667
|
+
key: proposal.id,
|
|
668
|
+
pi,
|
|
669
|
+
store,
|
|
670
|
+
proposal,
|
|
671
|
+
kinds: state.kinds,
|
|
672
|
+
away: true
|
|
673
|
+
})))), done.length > 0 && /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("h3", {
|
|
674
|
+
className: "tin-head"
|
|
675
|
+
}, words.inboxDone), /* @__PURE__ */ React.createElement("ul", {
|
|
676
|
+
className: "tin-list"
|
|
677
|
+
}, done.map((proposal) => /* @__PURE__ */ React.createElement(Done, {
|
|
678
|
+
key: proposal.id,
|
|
679
|
+
pi,
|
|
680
|
+
store,
|
|
681
|
+
proposal,
|
|
682
|
+
kinds: state.kinds,
|
|
683
|
+
now
|
|
684
|
+
})))));
|
|
685
|
+
}
|
|
686
|
+
function AboveComposer({ pi, store, sessionFile }) {
|
|
687
|
+
const state = useInitiative(React, store);
|
|
688
|
+
const proposals = conversationProposals(state.proposals, sessionFile);
|
|
689
|
+
if (proposals.length === 0) {
|
|
690
|
+
return null;
|
|
691
|
+
}
|
|
692
|
+
return /* @__PURE__ */ React.createElement("ul", {
|
|
693
|
+
className: "tin-list tin-above"
|
|
694
|
+
}, proposals.map((proposal) => /* @__PURE__ */ React.createElement(Waiting, {
|
|
695
|
+
key: proposal.id,
|
|
696
|
+
pi,
|
|
697
|
+
store,
|
|
698
|
+
proposal,
|
|
699
|
+
kinds: state.kinds
|
|
700
|
+
})));
|
|
701
|
+
}
|
|
702
|
+
function ProposalCards({ pi, store, ids }) {
|
|
703
|
+
const state = useInitiative(React, store);
|
|
704
|
+
const now = Date.now();
|
|
705
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
706
|
+
const proposals = ids.flatMap((id) => state.proposals.filter((proposal) => proposal.id === id));
|
|
707
|
+
if (proposals.length === 0) {
|
|
708
|
+
return null;
|
|
709
|
+
}
|
|
710
|
+
return /* @__PURE__ */ React.createElement("ul", {
|
|
711
|
+
className: "tin-list tin-in-chat"
|
|
712
|
+
}, proposals.map((proposal) => waits(proposal) ? /* @__PURE__ */ React.createElement(Waiting, {
|
|
713
|
+
key: proposal.id,
|
|
714
|
+
pi,
|
|
715
|
+
store,
|
|
716
|
+
proposal,
|
|
717
|
+
kinds: state.kinds
|
|
718
|
+
}) : proposal.auto ? /* @__PURE__ */ React.createElement(Done, {
|
|
719
|
+
key: proposal.id,
|
|
720
|
+
pi,
|
|
721
|
+
store,
|
|
722
|
+
proposal,
|
|
723
|
+
kinds: state.kinds,
|
|
724
|
+
now
|
|
725
|
+
}) : /* @__PURE__ */ React.createElement("li", {
|
|
726
|
+
key: proposal.id,
|
|
727
|
+
className: "tin-decided"
|
|
728
|
+
}, proposal.state === "done" ? words.acceptedLine : proposal.state === "declined" ? words.declinedLine : words.expiredLine, " · ", proposal.title)));
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
// web-src/page-initiative.ts
|
|
732
|
+
var PAGE = "@celljs/ta-web";
|
|
733
|
+
function pageInitiative(pi, store) {
|
|
734
|
+
const define = (kind) => pi.callHost("defineKind", { ...kind, owner: PAGE });
|
|
735
|
+
const levels = () => JSON.stringify(store.state.kinds.map((status) => [status.kind.id, status.level, status.locked ?? ""]));
|
|
736
|
+
return {
|
|
737
|
+
level: async (kind) => {
|
|
738
|
+
await define(kind);
|
|
739
|
+
return pi.callHost("level", kind.id);
|
|
740
|
+
},
|
|
741
|
+
setLevel: async (kind, level) => {
|
|
742
|
+
await define(kind);
|
|
743
|
+
await store.setLevel(kind.id, level);
|
|
744
|
+
},
|
|
745
|
+
record: async (kind, outcome, title) => {
|
|
746
|
+
await define(kind);
|
|
747
|
+
await pi.callHost("record", { kind: kind.id, title, why: "", outcome });
|
|
748
|
+
},
|
|
749
|
+
subscribe: (listener) => {
|
|
750
|
+
let last = levels();
|
|
751
|
+
return store.subscribe(() => {
|
|
752
|
+
const now = levels();
|
|
753
|
+
if (now !== last) {
|
|
754
|
+
last = now;
|
|
755
|
+
listener();
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
};
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// web-src/settings.tsx
|
|
763
|
+
function message2(error) {
|
|
764
|
+
return error instanceof Error ? error.message : String(error);
|
|
765
|
+
}
|
|
766
|
+
function notifyFailure(pi, error) {
|
|
767
|
+
pi.ui.notify(InitiativeWords.format(InitiativeWords.of(pi.ui.language).failed, { message: message2(error) }), "error");
|
|
768
|
+
}
|
|
769
|
+
function useStatus(store) {
|
|
770
|
+
const [status, setStatus] = React.useState(store.status);
|
|
771
|
+
React.useEffect(() => {
|
|
772
|
+
setStatus(store.status);
|
|
773
|
+
return store.subscribe(() => setStatus(store.status));
|
|
774
|
+
}, [store]);
|
|
775
|
+
return status;
|
|
776
|
+
}
|
|
777
|
+
function Toggle({ pi, checked, label, onChange }) {
|
|
778
|
+
const Switch = pi.ui.Switch;
|
|
779
|
+
if (Switch) {
|
|
780
|
+
return /* @__PURE__ */ React.createElement(Switch, {
|
|
781
|
+
checked,
|
|
782
|
+
label,
|
|
783
|
+
onChange: (on) => onChange(on).catch((error) => notifyFailure(pi, error))
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
return /* @__PURE__ */ React.createElement("input", {
|
|
787
|
+
type: "checkbox",
|
|
788
|
+
role: "switch",
|
|
789
|
+
className: "ta-switch",
|
|
790
|
+
checked,
|
|
791
|
+
"aria-checked": checked,
|
|
792
|
+
"aria-label": label,
|
|
793
|
+
onChange: (event) => void onChange(event.target.checked).catch((error) => notifyFailure(pi, error))
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
function SettingSwitch({ pi, store, field, label }) {
|
|
797
|
+
const { settings } = useStatus(store);
|
|
798
|
+
return /* @__PURE__ */ React.createElement(Toggle, {
|
|
799
|
+
pi,
|
|
800
|
+
checked: settings[field],
|
|
801
|
+
label,
|
|
802
|
+
onChange: (on) => store.change({ [field]: on })
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
function everyLabel(words, days) {
|
|
806
|
+
const named = { 1: words.every1, 7: words.every7, 14: words.every14, 30: words.every30 };
|
|
807
|
+
return named[days] ?? InitiativeWords.format(words.everyDays, { days: String(days) });
|
|
808
|
+
}
|
|
809
|
+
function Every({ pi, store }) {
|
|
810
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
811
|
+
const { settings } = useStatus(store);
|
|
812
|
+
const choices = PaceUtil.CHOICES.includes(settings.every) ? PaceUtil.CHOICES : [...PaceUtil.CHOICES, settings.every].sort((a, b) => a - b);
|
|
813
|
+
return /* @__PURE__ */ React.createElement("select", {
|
|
814
|
+
className: "tev-field",
|
|
815
|
+
"aria-label": words.everyLabel,
|
|
816
|
+
value: settings.every,
|
|
817
|
+
disabled: !settings.enabled,
|
|
818
|
+
onChange: (event) => void store.change({ every: Number(event.target.value) }).catch((error) => notifyFailure(pi, error))
|
|
819
|
+
}, choices.map((days) => /* @__PURE__ */ React.createElement("option", {
|
|
820
|
+
key: days,
|
|
821
|
+
value: days
|
|
822
|
+
}, everyLabel(words, days))));
|
|
823
|
+
}
|
|
824
|
+
function Time({ pi, store }) {
|
|
825
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
826
|
+
const { settings } = useStatus(store);
|
|
827
|
+
return /* @__PURE__ */ React.createElement("input", {
|
|
828
|
+
type: "time",
|
|
829
|
+
className: "tev-field",
|
|
830
|
+
"aria-label": words.timeLabel,
|
|
831
|
+
value: settings.time,
|
|
832
|
+
disabled: !settings.enabled,
|
|
833
|
+
onChange: (event) => PaceUtil.parseTime(event.target.value) && void store.change({ time: event.target.value }).catch((error) => notifyFailure(pi, error))
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
function when(at, words) {
|
|
837
|
+
if (at === undefined) {
|
|
838
|
+
return words.never;
|
|
839
|
+
}
|
|
840
|
+
const date = new Date(at);
|
|
841
|
+
const pad = (value) => String(value).padStart(2, "0");
|
|
842
|
+
return `${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
843
|
+
}
|
|
844
|
+
function Now({ pi, store }) {
|
|
845
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
846
|
+
const status = useStatus(store);
|
|
847
|
+
const [busy, run] = useBusy(pi.ui);
|
|
848
|
+
const review = async () => {
|
|
849
|
+
try {
|
|
850
|
+
const file = await pi.callHost("reviewNow");
|
|
851
|
+
if (file) {
|
|
852
|
+
await openConversation(pi, file);
|
|
853
|
+
}
|
|
854
|
+
} catch (error) {
|
|
855
|
+
notifyFailure(pi, error);
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
const line = status.file ? InitiativeWords.format(words.lastNext, { last: when(status.last, words), next: when(status.next, words) }) : status.next !== undefined ? InitiativeWords.format(words.nextOnly, { next: when(status.next, words) }) : "";
|
|
859
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
860
|
+
className: "tev-now"
|
|
861
|
+
}, line && /* @__PURE__ */ React.createElement("span", {
|
|
862
|
+
className: "tev-when"
|
|
863
|
+
}, line), /* @__PURE__ */ React.createElement("button", {
|
|
864
|
+
type: "button",
|
|
865
|
+
className: `ta-button${busy ? " ta-busy" : ""}`,
|
|
866
|
+
disabled: busy,
|
|
867
|
+
onClick: () => void run(review)
|
|
868
|
+
}, busy && /* @__PURE__ */ React.createElement("span", {
|
|
869
|
+
className: "ta-spinner ta-busy-mark"
|
|
870
|
+
}), /* @__PURE__ */ React.createElement("span", null, words.nowButton)));
|
|
871
|
+
}
|
|
872
|
+
function Profile({ pi, store }) {
|
|
873
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
874
|
+
const status = useStatus(store);
|
|
875
|
+
const stored = status.profile ?? "";
|
|
876
|
+
const [text, setText] = React.useState(stored);
|
|
877
|
+
const [edited, setEdited] = React.useState(false);
|
|
878
|
+
const [busy, run] = useBusy(pi.ui);
|
|
879
|
+
React.useEffect(() => {
|
|
880
|
+
if (!edited) {
|
|
881
|
+
setText(stored);
|
|
882
|
+
}
|
|
883
|
+
}, [stored, edited]);
|
|
884
|
+
const save = async () => {
|
|
885
|
+
try {
|
|
886
|
+
await store.saveProfile(text);
|
|
887
|
+
setEdited(false);
|
|
888
|
+
pi.ui.notify(words.profileSaved, "info");
|
|
889
|
+
} catch (error) {
|
|
890
|
+
notifyFailure(pi, error);
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
894
|
+
className: "tev-profile"
|
|
895
|
+
}, /* @__PURE__ */ React.createElement("textarea", {
|
|
896
|
+
className: "tev-field tev-profile-text",
|
|
897
|
+
"aria-label": words.profileLabel,
|
|
898
|
+
placeholder: words.profileEmpty,
|
|
899
|
+
value: text,
|
|
900
|
+
disabled: !status.settings.learn,
|
|
901
|
+
onChange: (event) => {
|
|
902
|
+
setText(event.target.value);
|
|
903
|
+
setEdited(true);
|
|
904
|
+
}
|
|
905
|
+
}), edited && /* @__PURE__ */ React.createElement("button", {
|
|
906
|
+
type: "button",
|
|
907
|
+
className: `ta-button${busy ? " ta-busy" : ""}`,
|
|
908
|
+
disabled: busy,
|
|
909
|
+
onClick: () => void run(save)
|
|
910
|
+
}, busy && /* @__PURE__ */ React.createElement("span", {
|
|
911
|
+
className: "ta-spinner ta-busy-mark"
|
|
912
|
+
}), /* @__PURE__ */ React.createElement("span", null, words.profileSave)));
|
|
913
|
+
}
|
|
914
|
+
function levelLabel(words, level) {
|
|
915
|
+
return { off: words.levelOff, digest: words.levelDigest, ask: words.levelAsk, act: words.levelAct }[level];
|
|
916
|
+
}
|
|
917
|
+
var MODE_WORDS = { quiet: "modeQuiet", balanced: "modeBalanced", active: "modeActive" };
|
|
918
|
+
function ModeSelect({ pi, store }) {
|
|
919
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
920
|
+
const { mode } = useInitiative(React, store);
|
|
921
|
+
return /* @__PURE__ */ React.createElement("select", {
|
|
922
|
+
className: "tev-field",
|
|
923
|
+
"aria-label": words.modeLabel,
|
|
924
|
+
value: mode,
|
|
925
|
+
onChange: (event) => void store.setMode(event.target.value).catch((error) => notifyFailure(pi, error))
|
|
926
|
+
}, MODES.map((one) => /* @__PURE__ */ React.createElement("option", {
|
|
927
|
+
key: one,
|
|
928
|
+
value: one
|
|
929
|
+
}, words[MODE_WORDS[one]])));
|
|
930
|
+
}
|
|
931
|
+
function reasonText(words, status) {
|
|
932
|
+
const date = status.reason.at ? new Date(status.reason.at).toLocaleDateString() : "";
|
|
933
|
+
switch (status.reason.cause) {
|
|
934
|
+
case "up":
|
|
935
|
+
return InitiativeWords.format(words.reasonUp, { date });
|
|
936
|
+
case "down":
|
|
937
|
+
return InitiativeWords.format(words.reasonDown, { date });
|
|
938
|
+
case "locked":
|
|
939
|
+
return words.reasonLocked;
|
|
940
|
+
default:
|
|
941
|
+
return words.reasonStart;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
function Quiet({ pi, store }) {
|
|
945
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
946
|
+
const { quiet } = useInitiative(React, store);
|
|
947
|
+
const time = (field, label) => /* @__PURE__ */ React.createElement("input", {
|
|
948
|
+
type: "time",
|
|
949
|
+
className: "tev-field",
|
|
950
|
+
"aria-label": label,
|
|
951
|
+
value: quiet[field],
|
|
952
|
+
disabled: !quiet.enabled,
|
|
953
|
+
onChange: (event) => void store.setQuiet({ [field]: event.target.value }).catch((error) => notifyFailure(pi, error))
|
|
954
|
+
});
|
|
955
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
956
|
+
className: "tin-quiet"
|
|
957
|
+
}, time("start", words.quietFrom), /* @__PURE__ */ React.createElement("span", {
|
|
958
|
+
className: "tev-when"
|
|
959
|
+
}, words.quietTo), time("end", words.quietTo), /* @__PURE__ */ React.createElement(Toggle, {
|
|
960
|
+
pi,
|
|
961
|
+
checked: quiet.enabled,
|
|
962
|
+
label: words.quietLabel,
|
|
963
|
+
onChange: (enabled) => store.setQuiet({ enabled })
|
|
964
|
+
}));
|
|
965
|
+
}
|
|
966
|
+
function Kinds({ pi, store }) {
|
|
967
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
968
|
+
const { kinds } = useInitiative(React, store);
|
|
969
|
+
const zh2 = /^zh/i.test(pi.ui.language);
|
|
970
|
+
return /* @__PURE__ */ React.createElement("ul", {
|
|
971
|
+
className: "tin-kinds"
|
|
972
|
+
}, kinds.map((status) => /* @__PURE__ */ React.createElement("li", {
|
|
973
|
+
key: status.kind.id,
|
|
974
|
+
className: "tin-kind-row"
|
|
975
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
976
|
+
className: "tin-kind-text"
|
|
977
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
978
|
+
className: "tin-kind-name"
|
|
979
|
+
}, zh2 ? status.kind.title.zh : status.kind.title.en), /* @__PURE__ */ React.createElement("div", {
|
|
980
|
+
className: "tin-kind-reason"
|
|
981
|
+
}, reasonText(words, status))), /* @__PURE__ */ React.createElement("select", {
|
|
982
|
+
className: "tev-field",
|
|
983
|
+
"aria-label": zh2 ? status.kind.title.zh : status.kind.title.en,
|
|
984
|
+
value: status.locked ?? "auto",
|
|
985
|
+
onChange: (event) => {
|
|
986
|
+
const value = event.target.value;
|
|
987
|
+
store.setLevel(status.kind.id, value === "auto" ? null : value).catch((error) => notifyFailure(pi, error));
|
|
988
|
+
}
|
|
989
|
+
}, /* @__PURE__ */ React.createElement("option", {
|
|
990
|
+
value: "auto"
|
|
991
|
+
}, status.locked ? words.levelAutoPlain : InitiativeWords.format(words.levelAuto, { level: levelLabel(words, status.level) })), LEVELS.filter((level) => level !== "act" || status.kind.reversible).map((level) => /* @__PURE__ */ React.createElement("option", {
|
|
992
|
+
key: level,
|
|
993
|
+
value: level
|
|
994
|
+
}, levelLabel(words, level)))))));
|
|
995
|
+
}
|
|
996
|
+
function initiativeSettings(pi, store) {
|
|
997
|
+
const words = () => InitiativeWords.of(pi.ui.language);
|
|
998
|
+
const autoHint = () => {
|
|
999
|
+
const { note, settings } = store.status;
|
|
1000
|
+
return settings.auto && note ? `${words().autoHint} ${InitiativeWords.format(words().autoNote, { note })}` : words().autoHint;
|
|
1001
|
+
};
|
|
1002
|
+
return {
|
|
1003
|
+
title: () => words().settingsTitle,
|
|
1004
|
+
icon: pi.ui.icons.Sparkles,
|
|
1005
|
+
rows: [
|
|
1006
|
+
{ key: "mode", label: () => words().modeLabel, description: () => words().modeHint, render: () => /* @__PURE__ */ React.createElement(ModeSelect, {
|
|
1007
|
+
pi,
|
|
1008
|
+
store
|
|
1009
|
+
}) },
|
|
1010
|
+
{ key: "quiet", label: () => words().quietLabel, description: () => words().quietHint, render: () => /* @__PURE__ */ React.createElement(Quiet, {
|
|
1011
|
+
pi,
|
|
1012
|
+
store
|
|
1013
|
+
}) },
|
|
1014
|
+
{
|
|
1015
|
+
key: "kinds",
|
|
1016
|
+
label: () => words().kindsLabel,
|
|
1017
|
+
description: () => words().kindsHint,
|
|
1018
|
+
render: () => /* @__PURE__ */ React.createElement(Kinds, {
|
|
1019
|
+
pi,
|
|
1020
|
+
store
|
|
1021
|
+
}),
|
|
1022
|
+
stacked: true
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
key: "enabled",
|
|
1026
|
+
label: () => words().enabledLabel,
|
|
1027
|
+
description: () => words().enabledHint,
|
|
1028
|
+
render: () => /* @__PURE__ */ React.createElement(SettingSwitch, {
|
|
1029
|
+
pi,
|
|
1030
|
+
store,
|
|
1031
|
+
field: "enabled",
|
|
1032
|
+
label: words().enabledLabel
|
|
1033
|
+
})
|
|
1034
|
+
},
|
|
1035
|
+
{ key: "every", label: () => words().everyLabel, render: () => /* @__PURE__ */ React.createElement(Every, {
|
|
1036
|
+
pi,
|
|
1037
|
+
store
|
|
1038
|
+
}) },
|
|
1039
|
+
{ key: "time", label: () => words().timeLabel, render: () => /* @__PURE__ */ React.createElement(Time, {
|
|
1040
|
+
pi,
|
|
1041
|
+
store
|
|
1042
|
+
}) },
|
|
1043
|
+
{
|
|
1044
|
+
key: "auto",
|
|
1045
|
+
label: () => words().autoLabel,
|
|
1046
|
+
description: autoHint,
|
|
1047
|
+
render: () => /* @__PURE__ */ React.createElement(SettingSwitch, {
|
|
1048
|
+
pi,
|
|
1049
|
+
store,
|
|
1050
|
+
field: "auto",
|
|
1051
|
+
label: words().autoLabel
|
|
1052
|
+
})
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
key: "learn",
|
|
1056
|
+
label: () => words().learnLabel,
|
|
1057
|
+
description: () => words().learnHint,
|
|
1058
|
+
render: () => /* @__PURE__ */ React.createElement(SettingSwitch, {
|
|
1059
|
+
pi,
|
|
1060
|
+
store,
|
|
1061
|
+
field: "learn",
|
|
1062
|
+
label: words().learnLabel
|
|
1063
|
+
})
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
key: "profile",
|
|
1067
|
+
label: () => words().profileLabel,
|
|
1068
|
+
description: () => words().profileHint,
|
|
1069
|
+
render: () => /* @__PURE__ */ React.createElement(Profile, {
|
|
1070
|
+
pi,
|
|
1071
|
+
store
|
|
1072
|
+
}),
|
|
1073
|
+
stacked: true
|
|
1074
|
+
},
|
|
1075
|
+
{ key: "now", label: () => words().nowLabel, render: () => /* @__PURE__ */ React.createElement(Now, {
|
|
1076
|
+
pi,
|
|
1077
|
+
store
|
|
1078
|
+
}), stacked: true }
|
|
1079
|
+
]
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// web-src/style.ts
|
|
1084
|
+
var STYLE = `
|
|
1085
|
+
.tev-field { height: 32px; padding: 0 8px; border: 1px solid var(--ta-border-field); border-radius: 8px; background: transparent; color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); }
|
|
1086
|
+
.tev-field:disabled { opacity: 0.5; }
|
|
1087
|
+
.tev-now { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
|
|
1088
|
+
.tev-profile { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; width: 100%; }
|
|
1089
|
+
.tev-profile-text { width: 100%; height: auto; min-height: 160px; padding: 8px; box-sizing: border-box; line-height: 1.55; resize: vertical; font-size: calc(13px * var(--ta-font-scale)); }
|
|
1090
|
+
[data-touch] .tev-profile-text { font-size: 16px; }
|
|
1091
|
+
/* The suggestions: a card each, its kind, what and why, the answers */
|
|
1092
|
+
.tin-inbox { max-width: 680px; margin: 0 auto; padding: 12px 16px 32px; }
|
|
1093
|
+
.tin-head { margin: 16px 2px 8px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); font-weight: 500; }
|
|
1094
|
+
.tin-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
|
|
1095
|
+
.tin-card { padding: 12px 14px; border: 1px solid var(--ta-border-muted); border-radius: 12px; background: var(--ta-card); }
|
|
1096
|
+
.tin-kind { display: flex; align-items: center; gap: 8px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
1097
|
+
.tin-kind > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
1098
|
+
.tin-tag { flex: none; padding: 0 6px; border-radius: 6px; background: var(--ta-hover); }
|
|
1099
|
+
.tin-time { flex: none; font-variant-numeric: tabular-nums; }
|
|
1100
|
+
.tin-title { margin-top: 6px; color: var(--ta-text); font-size: calc(15px * var(--ta-font-scale)); font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
|
|
1101
|
+
.tin-why { margin-top: 4px; color: var(--ta-text); font-size: calc(13.5px * var(--ta-font-scale)); line-height: 1.55; opacity: 0.85; overflow-wrap: anywhere; }
|
|
1102
|
+
.tin-state { margin-top: 6px; color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); }
|
|
1103
|
+
.tin-card[data-state='failed'] .tin-state { color: var(--ta-red, #d33); }
|
|
1104
|
+
.tin-done .tin-title { font-weight: 500; }
|
|
1105
|
+
.tin-actions { display: flex; gap: 8px; margin-top: 10px; }
|
|
1106
|
+
.tin-actions .ta-button { min-width: 64px; justify-content: center; }
|
|
1107
|
+
[data-touch] .tin-actions .ta-button { min-height: 38px; flex: 1; }
|
|
1108
|
+
.tin-more { display: flex; gap: 14px; margin-top: 8px; }
|
|
1109
|
+
.tin-link { padding: 0; border: 0; background: none; color: var(--ta-muted); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; text-align: left; }
|
|
1110
|
+
.tin-link:hover { color: var(--ta-text); }
|
|
1111
|
+
.tin-card > .tin-link { margin-top: 6px; display: block; }
|
|
1112
|
+
.tin-above { margin: 0 0 8px; }
|
|
1113
|
+
.tin-above .tin-card { padding: 10px 12px; }
|
|
1114
|
+
.tin-in-chat { margin: 4px 0; max-width: 620px; }
|
|
1115
|
+
.tin-decided { color: var(--ta-muted); font-size: calc(12.5px * var(--ta-font-scale)); overflow-wrap: anywhere; }
|
|
1116
|
+
.tin-empty { padding: 48px 12px; color: var(--ta-muted); text-align: center; font-size: calc(13.5px * var(--ta-font-scale)); line-height: 1.6; }
|
|
1117
|
+
.tin-quiet { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
|
|
1118
|
+
/* The kinds, in the settings */
|
|
1119
|
+
.tin-kinds { margin: 0; padding: 0; list-style: none; width: 100%; }
|
|
1120
|
+
.tin-kind-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--ta-border-muted); }
|
|
1121
|
+
.tin-kind-row:first-child { border-top: 0; }
|
|
1122
|
+
.tin-kind-text { flex: 1; min-width: 0; }
|
|
1123
|
+
.tin-kind-name { color: var(--ta-text); font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
1124
|
+
.tin-kind-reason { margin-top: 2px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
1125
|
+
.tev-when { color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); font-variant-numeric: tabular-nums; }
|
|
1126
|
+
`;
|
|
1127
|
+
function injectStyle() {
|
|
1128
|
+
const element = document.createElement("style");
|
|
1129
|
+
element.dataset.taPackage = "ta-initiative";
|
|
1130
|
+
element.textContent = STYLE;
|
|
1131
|
+
document.head.appendChild(element);
|
|
1132
|
+
return () => element.remove();
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
// web-src/index.tsx
|
|
1136
|
+
var INBOX_VIEW = `${NAME}/inbox`;
|
|
1137
|
+
function chatIcons(pi, store) {
|
|
1138
|
+
return {
|
|
1139
|
+
icon: (chat) => chat.sessionFile && chat.sessionFile === store.status.file && pi.ui.icons.Sparkles ? { icon: pi.ui.icons.Sparkles, tint: "evolve" } : undefined,
|
|
1140
|
+
subscribe: (listener) => store.subscribe(listener)
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1143
|
+
function inboxHome(pi, store) {
|
|
1144
|
+
let built;
|
|
1145
|
+
let items = [];
|
|
1146
|
+
return {
|
|
1147
|
+
items: () => {
|
|
1148
|
+
if (store.state !== built) {
|
|
1149
|
+
built = store.state;
|
|
1150
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
1151
|
+
const home = InboxUtil.home(built.proposals, built.seen, Date.now());
|
|
1152
|
+
const icon = pi.ui.icons.ListChecks ?? pi.ui.icons.Sparkles;
|
|
1153
|
+
const detail = home ? home.waiting && home.done ? InitiativeWords.format(words.homeDetail, { waiting: String(home.waiting), done: String(home.done) }) : home.waiting ? InitiativeWords.format(words.homeWaiting, { waiting: String(home.waiting) }) : InitiativeWords.format(words.homeDone, { done: String(home.done) }) : "";
|
|
1154
|
+
items = home && icon ? [
|
|
1155
|
+
{
|
|
1156
|
+
id: "inbox",
|
|
1157
|
+
title: words.inboxTitle,
|
|
1158
|
+
detail,
|
|
1159
|
+
icon,
|
|
1160
|
+
tint: "initiative",
|
|
1161
|
+
at: home.at,
|
|
1162
|
+
unseen: home.unseen,
|
|
1163
|
+
open: () => pi.ui.showView(INBOX_VIEW)
|
|
1164
|
+
}
|
|
1165
|
+
] : [];
|
|
1166
|
+
}
|
|
1167
|
+
return items;
|
|
1168
|
+
},
|
|
1169
|
+
subscribe: (listener) => store.subscribe(listener)
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
function activate(pi) {
|
|
1173
|
+
bind(pi.React);
|
|
1174
|
+
const removeStyle = injectStyle();
|
|
1175
|
+
const store = new InitiativeStore(pi);
|
|
1176
|
+
pi.registerSettings(initiativeSettings(pi, store));
|
|
1177
|
+
pi.registerView("inbox", {
|
|
1178
|
+
title: () => InitiativeWords.of(pi.ui.language).inboxTitle,
|
|
1179
|
+
icon: pi.ui.icons.ListChecks ?? pi.ui.icons.Sparkles,
|
|
1180
|
+
render: () => /* @__PURE__ */ React.createElement(Inbox, {
|
|
1181
|
+
pi,
|
|
1182
|
+
store
|
|
1183
|
+
}),
|
|
1184
|
+
order: 75,
|
|
1185
|
+
discover: true
|
|
1186
|
+
});
|
|
1187
|
+
pi.registerMessageRenderer(CARD_TYPE, ({ message: message3 }) => {
|
|
1188
|
+
const ids = message3.details?.ids;
|
|
1189
|
+
return Array.isArray(ids) ? /* @__PURE__ */ React.createElement(ProposalCards, {
|
|
1190
|
+
pi,
|
|
1191
|
+
store,
|
|
1192
|
+
ids: ids.filter((id) => typeof id === "string")
|
|
1193
|
+
}) : null;
|
|
1194
|
+
});
|
|
1195
|
+
pi.registerCodeRenderer?.(BLOCK, () => null);
|
|
1196
|
+
pi.registerComposerAddon({ above: ({ conversation }) => /* @__PURE__ */ React.createElement(AboveComposer, {
|
|
1197
|
+
pi,
|
|
1198
|
+
store,
|
|
1199
|
+
sessionFile: conversation.sessionFile
|
|
1200
|
+
}) });
|
|
1201
|
+
pi.registerInitiative?.(pageInitiative(pi, store));
|
|
1202
|
+
const stopNotices = watchNotices(pi, store);
|
|
1203
|
+
pi.registerHomeItems?.(inboxHome(pi, store));
|
|
1204
|
+
pi.registerChatIcon?.(chatIcons(pi, store));
|
|
1205
|
+
pi.registerToolRenderer?.((name, next) => {
|
|
1206
|
+
const words = InitiativeWords.of(pi.ui.language);
|
|
1207
|
+
switch (name) {
|
|
1208
|
+
case PACE_TOOL:
|
|
1209
|
+
return { renderCall: (args) => ({ verb: words.toolPace, target: typeof args.days === "number" ? String(args.days) : "" }) };
|
|
1210
|
+
case PROFILE_TOOL:
|
|
1211
|
+
return { renderCall: () => ({ verb: words.toolProfile, target: "" }) };
|
|
1212
|
+
case PROPOSE_TOOL:
|
|
1213
|
+
return { renderCall: (args) => ({ verb: words.toolPropose, target: typeof args.title === "string" ? args.title : "" }) };
|
|
1214
|
+
default:
|
|
1215
|
+
return next();
|
|
1216
|
+
}
|
|
1217
|
+
});
|
|
1218
|
+
return () => {
|
|
1219
|
+
stopNotices();
|
|
1220
|
+
removeStyle();
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
export {
|
|
1224
|
+
activate as default,
|
|
1225
|
+
INBOX_VIEW
|
|
1226
|
+
};
|