@celljs/ta 4.15.2 → 4.17.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 +1 -0
- package/README.md +1 -0
- package/dist/cli.mjs +2227 -203
- package/dist/gateway.mjs +2391 -291
- package/dist/pi/CHANGELOG.md +19 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-3d/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-3d/package.json +2 -1
- package/dist/pi/packages/ta-agents/README.en.md +14 -2
- package/dist/pi/packages/ta-agents/README.md +14 -2
- package/dist/pi/packages/ta-agents/extension/index.mjs +286 -111
- package/dist/pi/packages/ta-agents/host/index.mjs +662 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +5 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +36 -2
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js +76 -6
- package/dist/pi/packages/ta-agents/lib/agent-installer.d.ts +55 -0
- package/dist/pi/packages/ta-agents/lib/agent-installer.js +140 -0
- package/dist/pi/packages/ta-agents/lib/agent-installs.d.ts +25 -0
- package/dist/pi/packages/ta-agents/lib/agent-installs.js +64 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +6 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +9 -0
- package/dist/pi/packages/ta-agents/lib/agent-refresh.d.ts +11 -0
- package/dist/pi/packages/ta-agents/lib/agent-refresh.js +37 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +0 -2
- package/dist/pi/packages/ta-agents/lib/agent-session.js +3 -6
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +7 -2
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +8 -4
- package/dist/pi/packages/ta-agents/lib/agents-protocol.d.ts +26 -0
- package/dist/pi/packages/ta-agents/lib/agents-protocol.js +11 -0
- package/dist/pi/packages/ta-agents/lib/agents-settings.d.ts +10 -0
- package/dist/pi/packages/ta-agents/lib/agents-settings.js +165 -0
- package/dist/pi/packages/ta-agents/lib/extension.d.ts +3 -1
- package/dist/pi/packages/ta-agents/lib/extension.js +17 -4
- package/dist/pi/packages/ta-agents/lib/host.d.ts +35 -0
- package/dist/pi/packages/ta-agents/lib/host.js +96 -0
- package/dist/pi/packages/ta-agents/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-agents/lib/react.js +8 -0
- package/dist/pi/packages/ta-agents/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/style.js +30 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +18 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +18 -0
- package/dist/pi/packages/ta-agents/lib/web-words.d.ts +30 -0
- package/dist/pi/packages/ta-agents/lib/web-words.js +98 -0
- package/dist/pi/packages/ta-agents/lib/web.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/web.js +14 -0
- package/dist/pi/packages/ta-agents/package.json +21 -5
- package/dist/pi/packages/ta-agents/web/index.js +385 -0
- package/dist/pi/packages/ta-app-use/README.en.md +28 -0
- package/dist/pi/packages/ta-app-use/README.md +28 -0
- package/dist/pi/packages/ta-app-use/extension/index.mjs +534 -0
- package/dist/pi/packages/ta-app-use/host/index.mjs +136 -0
- package/dist/pi/packages/ta-app-use/lib/app-host.d.ts +32 -0
- package/dist/pi/packages/ta-app-use/lib/app-host.js +79 -0
- package/dist/pi/packages/ta-app-use/lib/app-protocol.d.ts +23 -0
- package/dist/pi/packages/ta-app-use/lib/app-protocol.js +9 -0
- package/dist/pi/packages/ta-app-use/lib/app-util.d.ts +18 -0
- package/dist/pi/packages/ta-app-use/lib/app-util.js +71 -0
- package/dist/pi/packages/ta-app-use/lib/extension.d.ts +80 -0
- package/dist/pi/packages/ta-app-use/lib/extension.js +125 -0
- package/dist/pi/packages/ta-app-use/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-app-use/lib/host.js +16 -0
- package/dist/pi/packages/ta-app-use/lib/i18n.d.ts +38 -0
- package/dist/pi/packages/ta-app-use/lib/i18n.js +130 -0
- package/dist/pi/packages/ta-app-use/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-app-use/lib/index.js +93 -0
- package/dist/pi/packages/ta-app-use/lib/screen-cursor.d.ts +33 -0
- package/dist/pi/packages/ta-app-use/lib/screen-cursor.js +134 -0
- package/dist/pi/packages/ta-app-use/lib/screen-dom.d.ts +19 -0
- package/dist/pi/packages/ta-app-use/lib/screen-dom.js +184 -0
- package/dist/pi/packages/ta-app-use/lib/screen-driver.d.ts +46 -0
- package/dist/pi/packages/ta-app-use/lib/screen-driver.js +174 -0
- package/dist/pi/packages/ta-app-use/lib/screen-protocol.d.ts +67 -0
- package/dist/pi/packages/ta-app-use/lib/screen-protocol.js +8 -0
- package/dist/pi/packages/ta-app-use/lib/screen-text.d.ts +13 -0
- package/dist/pi/packages/ta-app-use/lib/screen-text.js +69 -0
- package/dist/pi/packages/ta-app-use/lib/screen-window.d.ts +68 -0
- package/dist/pi/packages/ta-app-use/lib/screen-window.js +376 -0
- package/dist/pi/packages/ta-app-use/lib/tool-line.d.ts +11 -0
- package/dist/pi/packages/ta-app-use/lib/tool-line.js +69 -0
- package/dist/pi/packages/ta-app-use/package.json +63 -0
- package/dist/pi/packages/ta-app-use/web/index.js +1520 -0
- package/dist/pi/packages/ta-bots/README.en.md +1 -0
- package/dist/pi/packages/ta-bots/README.md +1 -0
- package/dist/pi/packages/ta-bots/extension/index.mjs +25 -22
- package/dist/pi/packages/ta-bots/host/index.mjs +726 -151
- package/dist/pi/packages/ta-bots/lib/bot-service.d.ts +9 -1
- package/dist/pi/packages/ta-bots/lib/bot-service.js +49 -8
- package/dist/pi/packages/ta-bots/lib/channel-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-bots/lib/extension.d.ts +2 -2
- package/dist/pi/packages/ta-bots/lib/extension.js +28 -24
- package/dist/pi/packages/ta-bots/lib/index.js +4 -0
- package/dist/pi/packages/ta-bots/lib/page.d.ts +7 -1
- package/dist/pi/packages/ta-bots/lib/page.js +17 -0
- package/dist/pi/packages/ta-bots/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-bots/lib/style.js +1 -1
- package/dist/pi/packages/ta-bots/lib/wecom-channel.js +1 -1
- package/dist/pi/packages/ta-bots/lib/weixin-api.d.ts +1 -0
- package/dist/pi/packages/ta-bots/lib/weixin-channel.js +2 -1
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-bots/web/index.js +13 -2
- package/dist/pi/packages/ta-call/README.en.md +9 -0
- package/dist/pi/packages/ta-call/README.md +9 -0
- package/dist/pi/packages/ta-call/extension/index.mjs +474 -0
- package/dist/pi/packages/ta-call/host/index.mjs +899 -0
- package/dist/pi/packages/ta-call/lib/call-host.d.ts +127 -0
- package/dist/pi/packages/ta-call/lib/call-host.js +377 -0
- package/dist/pi/packages/ta-call/lib/call-protocol.d.ts +33 -0
- package/dist/pi/packages/ta-call/lib/call-protocol.js +10 -0
- package/dist/pi/packages/ta-call/lib/call-util.d.ts +50 -0
- package/dist/pi/packages/ta-call/lib/call-util.js +250 -0
- package/dist/pi/packages/ta-call/lib/extension.d.ts +20 -0
- package/dist/pi/packages/ta-call/lib/extension.js +114 -0
- package/dist/pi/packages/ta-call/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-call/lib/host.js +20 -0
- package/dist/pi/packages/ta-call/lib/i18n.d.ts +16 -0
- package/dist/pi/packages/ta-call/lib/i18n.js +38 -0
- package/dist/pi/packages/ta-call/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-call/lib/index.js +60 -0
- package/dist/pi/packages/ta-call/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-call/lib/react.js +8 -0
- package/dist/pi/packages/ta-call/package.json +64 -0
- package/dist/pi/packages/ta-call/web/index.js +552 -0
- package/dist/pi/packages/ta-changes/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-changes/lib/card.js +4 -1
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-changes/web/index.js +2 -0
- package/dist/pi/packages/ta-channels/extension/index.mjs +155 -194
- package/dist/pi/packages/ta-channels/host/index.mjs +2039 -1503
- package/dist/pi/packages/ta-channels/lib/agent-menu.js +2 -1
- package/dist/pi/packages/ta-channels/lib/channel-menu.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/channel-menu.js +2 -2
- package/dist/pi/packages/ta-channels/lib/channels-text.d.ts +38 -0
- package/dist/pi/packages/ta-channels/lib/channels-text.js +173 -0
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts +0 -48
- package/dist/pi/packages/ta-channels/lib/channels-util.js +1 -223
- package/dist/pi/packages/ta-channels/lib/create.js +5 -1
- package/dist/pi/packages/ta-channels/lib/i18n-ja.d.ts +3 -0
- package/dist/pi/packages/ta-channels/lib/i18n-ja.js +182 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh-tw.d.ts +3 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh-tw.js +182 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh.d.ts +3 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh.js +182 -0
- package/dist/pi/packages/ta-channels/lib/i18n.js +4 -535
- package/dist/pi/packages/ta-channels/lib/index.js +2 -1
- package/dist/pi/packages/ta-channels/lib/notice-util.d.ts +15 -0
- package/dist/pi/packages/ta-channels/lib/notice-util.js +61 -0
- package/dist/pi/packages/ta-channels/lib/notice.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/notice.js +5 -4
- package/dist/pi/packages/ta-channels/lib/room.js +4 -3
- package/dist/pi/packages/ta-channels/lib/sidebar-head.d.ts +6 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-head.js +67 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-hooks.d.ts +51 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-hooks.js +230 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-rows.d.ts +71 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-rows.js +105 -0
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts +0 -4
- package/dist/pi/packages/ta-channels/lib/sidebar.js +35 -396
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +0 -1
- package/dist/pi/packages/ta-channels/lib/tasks.js +2 -1
- package/dist/pi/packages/ta-channels/lib/team-store.d.ts +78 -0
- package/dist/pi/packages/ta-channels/lib/team-store.js +261 -0
- package/dist/pi/packages/ta-channels/lib/team-tools.js +3 -2
- package/dist/pi/packages/ta-channels/lib/team.d.ts +3 -76
- package/dist/pi/packages/ta-channels/lib/team.js +5 -254
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-channels/web/index.js +889 -809
- package/dist/pi/packages/ta-computer-use/package.json +1 -1
- package/dist/pi/packages/ta-cron/README.en.md +19 -3
- package/dist/pi/packages/ta-cron/README.md +19 -3
- package/dist/pi/packages/ta-cron/extension/index.mjs +396 -111
- package/dist/pi/packages/ta-cron/host/index.mjs +633 -49
- package/dist/pi/packages/ta-cron/lib/chat-task.d.ts +5 -3
- package/dist/pi/packages/ta-cron/lib/chat-task.js +15 -10
- package/dist/pi/packages/ta-cron/lib/commands.d.ts +7 -4
- package/dist/pi/packages/ta-cron/lib/commands.js +26 -47
- package/dist/pi/packages/ta-cron/lib/cron-expression.d.ts +8 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.js +43 -1
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts +54 -7
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js +16 -2
- package/dist/pi/packages/ta-cron/lib/editor.d.ts +3 -0
- package/dist/pi/packages/ta-cron/lib/editor.js +106 -36
- package/dist/pi/packages/ta-cron/lib/extension.js +1 -1
- package/dist/pi/packages/ta-cron/lib/form-util.d.ts +16 -6
- package/dist/pi/packages/ta-cron/lib/form-util.js +40 -28
- package/dist/pi/packages/ta-cron/lib/host.js +17 -1
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +39 -5
- package/dist/pi/packages/ta-cron/lib/i18n.js +160 -24
- package/dist/pi/packages/ta-cron/lib/index.js +4 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +3 -2
- package/dist/pi/packages/ta-cron/lib/page.js +13 -2
- package/dist/pi/packages/ta-cron/lib/schedule-util.d.ts +4 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.js +52 -4
- package/dist/pi/packages/ta-cron/lib/scheduler.d.ts +56 -6
- package/dist/pi/packages/ta-cron/lib/scheduler.js +209 -27
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +50 -21
- package/dist/pi/packages/ta-cron/lib/task-list.d.ts +23 -0
- package/dist/pi/packages/ta-cron/lib/task-list.js +70 -0
- package/dist/pi/packages/ta-cron/lib/task-row.d.ts +19 -0
- package/dist/pi/packages/ta-cron/lib/task-row.js +246 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +10 -6
- package/dist/pi/packages/ta-cron/lib/task-util.js +53 -19
- package/dist/pi/packages/ta-cron/lib/task-watchers.d.ts +30 -0
- package/dist/pi/packages/ta-cron/lib/task-watchers.js +90 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +3 -2
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +48 -193
- package/dist/pi/packages/ta-cron/lib/tool-line.js +4 -0
- package/dist/pi/packages/ta-cron/lib/tool.d.ts +7 -0
- package/dist/pi/packages/ta-cron/lib/tool.js +18 -8
- package/dist/pi/packages/ta-cron/lib/when.d.ts +39 -0
- package/dist/pi/packages/ta-cron/lib/when.js +231 -0
- package/dist/pi/packages/ta-cron/package.json +2 -1
- package/dist/pi/packages/ta-cron/web/index.js +1091 -340
- package/dist/pi/packages/ta-extensions/lib/market-detail.js +9 -5
- package/dist/pi/packages/ta-extensions/lib/page.js +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +1 -1
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +9 -7
- package/dist/pi/packages/ta-extensions/web/index.js +777 -237
- package/dist/pi/packages/ta-feedback/README.en.md +10 -0
- package/dist/pi/packages/ta-feedback/README.md +10 -0
- package/dist/pi/packages/ta-feedback/extension/index.mjs +451 -0
- package/dist/pi/packages/ta-feedback/host/index.mjs +1187 -0
- package/dist/pi/packages/ta-feedback/lib/extension.d.ts +31 -0
- package/dist/pi/packages/ta-feedback/lib/extension.js +160 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-git.d.ts +25 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-git.js +44 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-host.d.ts +133 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-host.js +668 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-protocol.d.ts +127 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-protocol.js +41 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-util.d.ts +79 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-util.js +252 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-view.d.ts +11 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-view.js +244 -0
- package/dist/pi/packages/ta-feedback/lib/host.d.ts +8 -0
- package/dist/pi/packages/ta-feedback/lib/host.js +19 -0
- package/dist/pi/packages/ta-feedback/lib/i18n.d.ts +69 -0
- package/dist/pi/packages/ta-feedback/lib/i18n.js +250 -0
- package/dist/pi/packages/ta-feedback/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-feedback/lib/index.js +88 -0
- package/dist/pi/packages/ta-feedback/lib/page.d.ts +35 -0
- package/dist/pi/packages/ta-feedback/lib/page.js +135 -0
- package/dist/pi/packages/ta-feedback/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-feedback/lib/react.js +8 -0
- package/dist/pi/packages/ta-feedback/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-feedback/lib/style.js +71 -0
- package/dist/pi/packages/ta-feedback/package.json +65 -0
- package/dist/pi/packages/ta-feedback/web/index.js +939 -0
- package/dist/pi/packages/ta-games/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-games/lib/style.js +1 -1
- package/dist/pi/packages/ta-games/package.json +1 -1
- package/dist/pi/packages/ta-games/web/index.js +1 -1
- package/dist/pi/packages/ta-glance/README.en.md +2 -0
- package/dist/pi/packages/ta-glance/README.md +2 -0
- package/dist/pi/packages/ta-glance/extension/index.mjs +135 -27
- package/dist/pi/packages/ta-glance/lib/card.js +155 -35
- package/dist/pi/packages/ta-glance/lib/glance-json.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-json.js +8 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +9 -6
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +43 -4
- package/dist/pi/packages/ta-glance/lib/glance-protocol.js +39 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +125 -23
- package/dist/pi/packages/ta-glance/lib/glance-speech.d.ts +13 -0
- package/dist/pi/packages/ta-glance/lib/glance-speech.js +45 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.d.ts +13 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.js +28 -0
- package/dist/pi/packages/ta-glance/lib/i18n.d.ts +5 -0
- package/dist/pi/packages/ta-glance/lib/i18n.js +20 -0
- package/dist/pi/packages/ta-glance/lib/index.js +11 -1
- package/dist/pi/packages/ta-glance/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/style.js +82 -5
- package/dist/pi/packages/ta-glance/package.json +2 -1
- package/dist/pi/packages/ta-glance/web/index.js +508 -62
- package/dist/pi/packages/ta-initiative/extension/index.mjs +3 -2
- package/dist/pi/packages/ta-initiative/host/index.mjs +1 -1
- package/dist/pi/packages/ta-initiative/lib/chat-proposals.js +1 -1
- package/dist/pi/packages/ta-initiative/lib/index.js +1 -0
- package/dist/pi/packages/ta-initiative/lib/material-util.js +1 -1
- package/dist/pi/packages/ta-initiative/lib/settings.js +2 -1
- package/dist/pi/packages/ta-initiative/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-initiative/lib/style.js +1 -1
- package/dist/pi/packages/ta-initiative/package.json +1 -1
- package/dist/pi/packages/ta-initiative/web/index.js +5 -3
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-manual/lib/manual-util.d.ts +1 -1
- package/dist/pi/packages/ta-manual/lib/pictures-c.js +15 -0
- package/dist/pi/packages/ta-manual/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-manual/lib/style.js +1 -1
- package/dist/pi/packages/ta-manual/lib/topics-a.d.ts +3 -0
- package/dist/pi/packages/ta-manual/lib/topics-a.js +295 -0
- package/dist/pi/packages/ta-manual/lib/topics-model.d.ts +46 -0
- package/dist/pi/packages/ta-manual/lib/topics-model.js +21 -0
- package/dist/pi/packages/ta-manual/lib/topics.d.ts +1 -44
- package/dist/pi/packages/ta-manual/lib/topics.js +28 -318
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +12 -10
- package/dist/pi/packages/ta-manual/web/index.js +97 -24
- package/dist/pi/packages/ta-moments/extension/index.mjs +740 -194
- package/dist/pi/packages/ta-moments/host/index.mjs +1393 -834
- package/dist/pi/packages/ta-moments/lib/index.js +3 -1
- package/dist/pi/packages/ta-moments/lib/moments-host-base.d.ts +96 -0
- package/dist/pi/packages/ta-moments/lib/moments-host-base.js +276 -0
- package/dist/pi/packages/ta-moments/lib/moments-host-pictures.d.ts +22 -0
- package/dist/pi/packages/ta-moments/lib/moments-host-pictures.js +167 -0
- package/dist/pi/packages/ta-moments/lib/moments-host.d.ts +4 -84
- package/dist/pi/packages/ta-moments/lib/moments-host.js +13 -426
- package/dist/pi/packages/ta-moments/lib/page.js +3 -3
- package/dist/pi/packages/ta-moments/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-moments/lib/style.js +1 -1
- package/dist/pi/packages/ta-moments/lib/talk-host-base.d.ts +71 -0
- package/dist/pi/packages/ta-moments/lib/talk-host-base.js +171 -0
- package/dist/pi/packages/ta-moments/lib/talk-host.d.ts +3 -62
- package/dist/pi/packages/ta-moments/lib/talk-host.js +14 -169
- package/dist/pi/packages/ta-moments/package.json +1 -1
- package/dist/pi/packages/ta-moments/web/index.js +686 -147
- package/dist/pi/packages/ta-nearby/extension/index.mjs +9 -0
- package/dist/pi/packages/ta-nearby/host/index.mjs +1073 -1018
- package/dist/pi/packages/ta-nearby/lib/index.js +8 -5
- package/dist/pi/packages/ta-nearby/lib/nearby-home.d.ts +13 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-home.js +91 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet-view.d.ts +12 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet-view.js +113 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-page.d.ts +6 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-page.js +157 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-base.d.ts +161 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-base.js +343 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-meet.d.ts +41 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-meet.js +297 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service.d.ts +6 -167
- package/dist/pi/packages/ta-nearby/lib/nearby-service.js +38 -638
- package/dist/pi/packages/ta-nearby/lib/nearby-show-view.d.ts +6 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-show-view.js +88 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.d.ts +6 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.js +25 -3
- package/dist/pi/packages/ta-nearby/lib/page.d.ts +27 -20
- package/dist/pi/packages/ta-nearby/lib/page.js +15 -417
- package/dist/pi/packages/ta-nearby/lib/server-texts.d.ts +1 -1
- package/dist/pi/packages/ta-nearby/lib/server-texts.js +9 -1
- package/dist/pi/packages/ta-nearby/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-nearby/lib/style.js +1 -1
- package/dist/pi/packages/ta-nearby/package.json +1 -1
- package/dist/pi/packages/ta-nearby/web/index.js +370 -362
- package/dist/pi/packages/ta-notify/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-notify/lib/settings.js +1 -0
- package/dist/pi/packages/ta-notify/package.json +1 -1
- package/dist/pi/packages/ta-notify/web/index.js +1 -0
- package/dist/pi/packages/ta-plot/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-plot/package.json +2 -1
- package/dist/pi/packages/ta-recall/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-recall/host/index.mjs +1 -0
- package/dist/pi/packages/ta-recall/lib/settings.js +1 -0
- package/dist/pi/packages/ta-recall/package.json +1 -1
- package/dist/pi/packages/ta-recall/web/index.js +2 -0
- package/dist/pi/packages/ta-rooms/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-rooms/host/index.mjs +497 -492
- package/dist/pi/packages/ta-rooms/lib/double-agents.js +6 -6
- package/dist/pi/packages/ta-rooms/lib/double-grants.js +10 -10
- package/dist/pi/packages/ta-rooms/lib/double-host.js +6 -5
- package/dist/pi/packages/ta-rooms/lib/double-tasks-base.d.ts +55 -0
- package/dist/pi/packages/ta-rooms/lib/double-tasks-base.js +279 -0
- package/dist/pi/packages/ta-rooms/lib/double-tasks.d.ts +3 -45
- package/dist/pi/packages/ta-rooms/lib/double-tasks.js +14 -282
- package/dist/pi/packages/ta-rooms/lib/double-user.js +2 -2
- package/dist/pi/packages/ta-rooms/lib/friend-notices.js +2 -2
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.js +8 -4
- package/dist/pi/packages/ta-rooms/lib/index.js +18 -2
- package/dist/pi/packages/ta-rooms/lib/members-view.js +37 -3
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +36 -1
- package/dist/pi/packages/ta-rooms/lib/page.js +76 -1
- package/dist/pi/packages/ta-rooms/lib/room-view.js +22 -17
- package/dist/pi/packages/ta-rooms/lib/rooms-home.js +1 -0
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-rooms/lib/style.js +32 -6
- package/dist/pi/packages/ta-rooms/package.json +1 -1
- package/dist/pi/packages/ta-rooms/web/index.js +223 -38
- package/dist/pi/packages/ta-secrets/README.en.md +22 -0
- package/dist/pi/packages/ta-secrets/README.md +22 -0
- package/dist/pi/packages/ta-secrets/extension/index.mjs +462 -0
- package/dist/pi/packages/ta-secrets/host/index.mjs +1341 -0
- package/dist/pi/packages/ta-secrets/lib/command-prelude.d.ts +36 -0
- package/dist/pi/packages/ta-secrets/lib/command-prelude.js +66 -0
- package/dist/pi/packages/ta-secrets/lib/extension.d.ts +28 -0
- package/dist/pi/packages/ta-secrets/lib/extension.js +156 -0
- package/dist/pi/packages/ta-secrets/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-secrets/lib/host.js +15 -0
- package/dist/pi/packages/ta-secrets/lib/i18n.d.ts +47 -0
- package/dist/pi/packages/ta-secrets/lib/i18n.js +166 -0
- package/dist/pi/packages/ta-secrets/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-secrets/lib/index.js +28 -0
- package/dist/pi/packages/ta-secrets/lib/personal-info.d.ts +26 -0
- package/dist/pi/packages/ta-secrets/lib/personal-info.js +108 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-certs.d.ts +40 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-certs.js +200 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-scenario.d.ts +6 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-scenario.js +91 -0
- package/dist/pi/packages/ta-secrets/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-secrets/lib/react.js +8 -0
- package/dist/pi/packages/ta-secrets/lib/scrubber.d.ts +20 -0
- package/dist/pi/packages/ta-secrets/lib/scrubber.js +70 -0
- package/dist/pi/packages/ta-secrets/lib/secrets-protocol.d.ts +106 -0
- package/dist/pi/packages/ta-secrets/lib/secrets-protocol.js +134 -0
- package/dist/pi/packages/ta-secrets/lib/server-texts.d.ts +14 -0
- package/dist/pi/packages/ta-secrets/lib/server-texts.js +62 -0
- package/dist/pi/packages/ta-secrets/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-secrets/lib/settings.js +179 -0
- package/dist/pi/packages/ta-secrets/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-secrets/lib/style.js +32 -0
- package/dist/pi/packages/ta-secrets/lib/vault-fixture.d.ts +8 -0
- package/dist/pi/packages/ta-secrets/lib/vault-fixture.js +22 -0
- package/dist/pi/packages/ta-secrets/lib/vault-proxy.d.ts +94 -0
- package/dist/pi/packages/ta-secrets/lib/vault-proxy.js +357 -0
- package/dist/pi/packages/ta-secrets/lib/vault-service.d.ts +111 -0
- package/dist/pi/packages/ta-secrets/lib/vault-service.js +429 -0
- package/dist/pi/packages/ta-secrets/lib/vault-store.d.ts +48 -0
- package/dist/pi/packages/ta-secrets/lib/vault-store.js +107 -0
- package/dist/pi/packages/ta-secrets/package.json +67 -0
- package/dist/pi/packages/ta-secrets/web/index.js +579 -0
- package/dist/pi/packages/ta-share/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-share/host/index.mjs +172 -21
- package/dist/pi/packages/ta-share/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-share/lib/i18n.js +4 -0
- package/dist/pi/packages/ta-share/lib/index.js +1 -1
- package/dist/pi/packages/ta-share/lib/share-dialog.js +1 -0
- package/dist/pi/packages/ta-share/lib/share-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-share/lib/share-service.d.ts +11 -1
- package/dist/pi/packages/ta-share/lib/share-service.js +62 -4
- package/dist/pi/packages/ta-share/lib/snapshot.d.ts +8 -2
- package/dist/pi/packages/ta-share/lib/snapshot.js +93 -7
- package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-share/lib/style.js +1 -1
- package/dist/pi/packages/ta-share/package.json +1 -1
- package/dist/pi/packages/ta-share/web/index.js +7 -2
- package/dist/pi/packages/ta-sync/host/index.mjs +1154 -755
- package/dist/pi/packages/ta-sync/lib/host.js +3 -0
- package/dist/pi/packages/ta-sync/lib/index.js +6 -2
- package/dist/pi/packages/ta-sync/lib/migrate-archive.d.ts +8 -6
- package/dist/pi/packages/ta-sync/lib/migrate-archive.js +24 -28
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.d.ts +10 -0
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.js +40 -0
- package/dist/pi/packages/ta-sync/lib/migrate-paths.d.ts +24 -0
- package/dist/pi/packages/ta-sync/lib/migrate-paths.js +230 -0
- package/dist/pi/packages/ta-sync/lib/migrate-protocol.d.ts +18 -0
- package/dist/pi/packages/ta-sync/lib/migrate-service.d.ts +11 -1
- package/dist/pi/packages/ta-sync/lib/migrate-service.js +28 -1
- package/dist/pi/packages/ta-sync/lib/move-panel.d.ts +9 -1
- package/dist/pi/packages/ta-sync/lib/move-panel.js +69 -5
- package/dist/pi/packages/ta-sync/lib/server-texts.d.ts +1 -0
- package/dist/pi/packages/ta-sync/lib/server-texts.js +9 -0
- package/dist/pi/packages/ta-sync/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-sync/lib/style.js +8 -1
- package/dist/pi/packages/ta-sync/lib/sync-service-base.d.ts +78 -0
- package/dist/pi/packages/ta-sync/lib/sync-service-base.js +224 -0
- package/dist/pi/packages/ta-sync/lib/sync-service-space.d.ts +36 -0
- package/dist/pi/packages/ta-sync/lib/sync-service-space.js +210 -0
- package/dist/pi/packages/ta-sync/lib/sync-service.d.ts +3 -99
- package/dist/pi/packages/ta-sync/lib/sync-service.js +2 -412
- package/dist/pi/packages/ta-sync/package.json +1 -1
- package/dist/pi/packages/ta-sync/web/index.js +138 -5
- package/dist/pi/packages/ta-sync-cloud/package.json +1 -1
- package/dist/pi/packages/ta-team/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-team/host/index.mjs +1 -0
- package/dist/pi/packages/ta-team/lib/dialogs.d.ts +0 -2
- package/dist/pi/packages/ta-team/lib/dialogs.js +0 -227
- package/dist/pi/packages/ta-team/lib/i18n-ja.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/i18n-ja.js +211 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh-tw.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh-tw.js +211 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh.js +211 -0
- package/dist/pi/packages/ta-team/lib/i18n.d.ts +1 -2
- package/dist/pi/packages/ta-team/lib/i18n.js +6 -624
- package/dist/pi/packages/ta-team/lib/index.js +3 -1
- package/dist/pi/packages/ta-team/lib/join-dialog.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/join-dialog.js +234 -0
- package/dist/pi/packages/ta-team/lib/members-tab.js +2 -1
- package/dist/pi/packages/ta-team/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-team/lib/style.js +1 -1
- package/dist/pi/packages/ta-team/package.json +1 -1
- package/dist/pi/packages/ta-team/web/index.js +2095 -2086
- package/dist/pi/packages/ta-usage/README.en.md +6 -0
- package/dist/pi/packages/ta-usage/README.md +6 -0
- package/dist/pi/packages/ta-usage/host/index.mjs +220 -0
- package/dist/pi/packages/ta-usage/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-usage/lib/host.js +9 -0
- package/dist/pi/packages/ta-usage/lib/i18n.d.ts +30 -0
- package/dist/pi/packages/ta-usage/lib/i18n.js +98 -0
- package/dist/pi/packages/ta-usage/lib/index.d.ts +4 -0
- package/dist/pi/packages/ta-usage/lib/index.js +20 -0
- package/dist/pi/packages/ta-usage/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-usage/lib/react.js +8 -0
- package/dist/pi/packages/ta-usage/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-usage/lib/style.js +53 -0
- package/dist/pi/packages/ta-usage/lib/usage-host.d.ts +25 -0
- package/dist/pi/packages/ta-usage/lib/usage-host.js +70 -0
- package/dist/pi/packages/ta-usage/lib/usage-protocol.d.ts +55 -0
- package/dist/pi/packages/ta-usage/lib/usage-protocol.js +7 -0
- package/dist/pi/packages/ta-usage/lib/usage-util.d.ts +18 -0
- package/dist/pi/packages/ta-usage/lib/usage-util.js +159 -0
- package/dist/pi/packages/ta-usage/lib/usage-view.d.ts +9 -0
- package/dist/pi/packages/ta-usage/lib/usage-view.js +91 -0
- package/dist/pi/packages/ta-usage/package.json +61 -0
- package/dist/pi/packages/ta-usage/web/index.js +471 -0
- package/dist/pi/packages/ta-voice/README.en.md +8 -0
- package/dist/pi/packages/ta-voice/README.md +8 -0
- package/dist/pi/packages/ta-voice/host/index.mjs +662 -0
- package/dist/pi/packages/ta-voice/lib/doubao-frames.d.ts +44 -0
- package/dist/pi/packages/ta-voice/lib/doubao-frames.js +116 -0
- package/dist/pi/packages/ta-voice/lib/doubao-realtime.d.ts +35 -0
- package/dist/pi/packages/ta-voice/lib/doubao-realtime.js +172 -0
- package/dist/pi/packages/ta-voice/lib/host.d.ts +20 -0
- package/dist/pi/packages/ta-voice/lib/host.js +120 -0
- package/dist/pi/packages/ta-voice/lib/openai-realtime.d.ts +73 -0
- package/dist/pi/packages/ta-voice/lib/openai-realtime.js +257 -0
- package/dist/pi/packages/ta-voice/lib/realtime-socket.d.ts +23 -0
- package/dist/pi/packages/ta-voice/lib/realtime-socket.js +80 -0
- package/dist/pi/packages/ta-voice/package.json +67 -0
- package/dist/pi/packages/ta-workspace/README.md +1 -1
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +1 -1
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts +4 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.js +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-pick.d.ts +49 -0
- package/dist/pi/packages/ta-workspace/lib/browser-pick.js +166 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.js +16 -1
- package/dist/pi/packages/ta-workspace/lib/i18n-en.d.ts +3 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-en.js +215 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-ja.d.ts +3 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-ja.js +215 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-zh-tw.d.ts +3 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-zh-tw.js +215 -0
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +7 -3
- package/dist/pi/packages/ta-workspace/lib/i18n.js +11 -621
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +1504 -770
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-Dd51Bqbx.js → abnfDiagram-S7VZAUFO-w8qXXVn-.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-BbG3_x7_.js → architecture-WOLXFQ4H-B-FHaYwY.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-DbJO4t8I.js → architectureDiagram-YGSQEFNW-DTnoGaaX.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-BwtrHF1f.js → blockDiagram-APKKGZFW-CyeBzv-v.js} +1 -1
- package/dist/public/assets/{browser-D2BcOPKG.js → browser-Cb38iiEE.js} +1 -1
- package/dist/public/assets/{browser-CTbeNBsA.js → browser-DXexCqIh.js} +2 -2
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CfBe5A0H.js → c4Diagram-KJ2TOQU5-CJJqDqyQ.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-C7R0mhrg.js → chunk-6MUBBAK2-DbvUMdNm.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-VQgQruZT.js → chunk-AXFCVDMN-D4hlZGtj.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-CkUi_vD5.js → chunk-BG4553SI-VNa9Q9On.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-BAQq7ktk.js → chunk-DQASFODM-BtlEbc_V.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-B1oF8lB7.js → chunk-HFQBQIA3-CAYSo4CJ.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-DE5amcgT.js → chunk-KQLB2F66-CyKdg6hW.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-ev9S_csp.js → chunk-KS47KZWR-BMogCB2r.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-ziqnRvTG.js → chunk-LEVMRMFU-Y9wr-8qB.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-DaqPdEKA.js → chunk-M57EVK23-DL3IAQKR.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-DFOG8j6z.js → chunk-OY52VR5R-CJBFHdg6.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-eg35JLLN.js → chunk-QB3YPZ4I-CyuWKZZv.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-J73nie-R.js → chunk-R3KSYZAL-DxvGhfpm.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-B8EvDZvB.js → chunk-STOXU5M4-Cpdl6bfz.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-DyCM007V.js → chunk-TU62E6Q5-CIxOg6QF.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BBGeCNmA.js → chunk-X4PVCEUW-DCFSCRBh.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-CAtJ2Wph.js → chunk-XXDRQBXY-B2R8Cxf7.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-DhQM6yHy.js → classDiagram-v2-L25IHNXF-B7W9HSbj.js} +1 -1
- package/dist/public/assets/{client-C8gi9Fk2.js → client-D75LfyFa.js} +1 -1
- package/dist/public/assets/{common-DrZR0tgm.js → common-CjqTomRQ.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-AqIcHabu.js → cose-bilkent-JH36ORCC-CXSLFyCH.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-BIcbDns7.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-7SyXzhRd.js → cynefinDiagram-L36ESFBY-DTv0Kn1r.js} +1 -1
- package/dist/public/assets/{d3-selection-DsahLieG.js → d3-selection-g4Hl3_NH.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-DalaGtMS.js → dagre-SPEB5RXH-BujVqk5R.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-BcY-qB9G.js → diagram-3B7GL73J-Ds-VnLzP.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-NV7fbe0h.js → diagram-DNEMPZML-BBoIIK-a.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-BPx4GHoj.js → diagram-L3MUGCDN-Glgd5N_n.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-BeUxqmw1.js → diagram-LA4NIPWU-B4EODdUU.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-Dlg1S5na.js → diagram-MHCOC4E2-pzDDXO2J.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-DQhRoMkK.js → diagram-XPFHEONP-l--gwSuK.js} +1 -1
- package/dist/public/assets/{dist-CQU8zJh_.js → dist-C0u3lAFR.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-gVEs3Um2.js → ebnfDiagram-UZSYDL2S-BVfPeaVX.js} +1 -1
- package/dist/public/assets/{editor.api-SQ1snuat.js → editor.api-BMcewI3C.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CHtlrPwu.js → elk-XV6XMXQE-BFJtUnG9.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-B0xok726.js → erDiagram-EYBAPDEH-BWxMtfIc.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-CFwphA0e.js → eventmodeling-K75KTNOO-YwYgBgCX.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Dah4--NW.js +1 -0
- package/dist/public/assets/{freemarker2-DJKO-X2B.js → freemarker2-B8HquI7K.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-B5wVGN1A.js → ganttDiagram-23REXITY-CBqv7wbi.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BwDfrSZS.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-DEjNU1R_.js → gitGraphDiagram-STJD7YCW-BLSf23f_.js} +1 -1
- package/dist/public/assets/{handlebars-ChVN7JPd.js → handlebars-P1qmNq4N.js} +1 -1
- package/dist/public/assets/{html-CQ0znKSa.js → html-Ceswbytr.js} +1 -1
- package/dist/public/assets/{index-CLlacdXR.js → index-10isUUN4.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-Ch8aMV1p.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-CJtrS72M.js → infoDiagram-KBXO4MBG-LvOtgUlm.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-qYI1QBsK.js → ishikawaDiagram-M35NCXHK-CwUZOvcm.js} +1 -1
- package/dist/public/assets/{javascript-B-DHbkyI.js → javascript-B3FXC8qR.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-BOQ2y2ZZ.js → journeyDiagram-OPLOXDXO-5j1KtwTt.js} +1 -1
- package/dist/public/assets/{jsonMode-XuGC5N_z.js → jsonMode-CrCyxNQI.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-BJ64tKdP.js → kanban-definition-BZKZHSQY-BKAB5id1.js} +1 -1
- package/dist/public/assets/{liquid-B0Ujylzc.js → liquid-CXZRIgp2.js} +1 -1
- package/dist/public/assets/{mdx-B19-V510.js → mdx-Dm3uNczM.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-Scb01iBq.js → mermaid-parser.core-C755A-rX.js} +3 -3
- package/dist/public/assets/{mermaid.core-BMuvs7us.js → mermaid.core-CQrYmFAR.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-BYfOS3XN.js → mindmap-definition-I2QAS2VK-DNJQKYbK.js} +1 -1
- package/dist/public/assets/module-9otB6_kX.js +1 -0
- package/dist/public/assets/{module-Cm_mLwAQ.js → module-C3jC5acf.js} +1 -1
- package/dist/public/assets/module-C_MyFORb.js +1 -0
- package/dist/public/assets/module-Cjpl4gva.js +1 -0
- package/dist/public/assets/{module-DUYj4E8T.js → module-D8yH9xCl.js} +1 -1
- package/dist/public/assets/module-DlHjBjOg.js +1 -0
- package/dist/public/assets/module-QsLiJaR6.js +1 -0
- package/dist/public/assets/module-aaW5Ri2L.js +2771 -0
- package/dist/public/assets/module-gSy9fKBo.js +1 -0
- package/dist/public/assets/{monaco-Bbe2os7m.js → monaco-BS7JBNW4.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-LqMrrc60.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-D-Vlq9Gm.js → pegDiagram-FD4XPPHP-BzbBCWht.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-BWzABXQU.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-_-94-aMD.js → pieDiagram-J4AKIIQI-Bf_LDukL.js} +1 -1
- package/dist/public/assets/{python-CWnMIOYq.js → python-jgOUhB-F.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-BhFUbUYz.js → quadrantDiagram-XTYBLID2-CdMHWnKX.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-CR4kNiUj.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-BAkWtkGC.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-yUa9GGCQ.js → railroad-abnf-LNEFI6M7-DQGYaRbc.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-xY4YiL8M.js → railroad-ebnf-DWYD2UWJ-D6Ljza0U.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-BYFYCUAQ.js → railroad-peg-JR7BVNR7-Du9hL1Gf.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-C9FVhj0k.js → railroadDiagram-MRQ6NCDL-CS_JnlGN.js} +1 -1
- package/dist/public/assets/{razor-bDtpN6EJ.js → razor-BWj90God.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-DLmAg-6C.js → requirementDiagram-Y7LWUY3S-Cq8rRz2y.js} +1 -1
- package/dist/public/assets/{resolver-0zC31mg5.js → resolver-BPuspqws.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-Bl5IpDk4.js → sankeyDiagram-WGJFYUXA-aK7jRBVK.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-Z-N0OiT_.js → sequenceDiagram-5NDRBG5M-BxcIyc38.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-ctKQz8Mo.js → stateDiagram-v2-FJ4FJNEA-Ctletlj4.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-CWLKnALg.js → swimlanes-UMQ2AFYF-DaD55xd2.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CytCT4x3.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-DP8Ph_d6.js → timeline-definition-SEUHKTQE-Ce19CDiJ.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-DvzNkX4G.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-BuUeBmMd.js +1 -0
- package/dist/public/assets/{typescript-CGpNlLbn.js → typescript-RgyfxmPQ.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-DvFjNj3J.js → usecaseDiagram-AFA6YXN4-CAVEBKQS.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-3m2F2H-I.js → vennDiagram-NNMJR3RB-DHyJxlHv.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-DSfdKACG.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-CsMntu16.js → wardleyDiagram-S7YFUSEH-C-FCHxR7.js} +1 -1
- package/dist/public/assets/{xml-ByiLoakX.js → xml-DiA1T3iN.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-C80rxvM0.js → xychartDiagram-GGNKY7IX-BlnHU6Gz.js} +1 -1
- package/dist/public/assets/{yaml-Cz2Af5Rj.js → yaml-dnCcfJBR.js} +1 -1
- package/dist/public/ext/index.json +1 -0
- package/dist/public/ext/ta-3d.js +660 -0
- package/dist/public/ext/ta-glance.js +1611 -0
- package/dist/public/ext/ta-plot.js +1320 -0
- package/dist/public/index.html +2 -2
- package/dist/serve/index.mjs +17829 -14233
- package/package.json +45 -39
- package/dist/public/assets/cynefin-EF2NZ3EQ-yFytgtiy.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Cwye_DsX.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BYzb--zb.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-na0qX3JP.js +0 -1
- package/dist/public/assets/module-B3SKdB70.js +0 -1
- package/dist/public/assets/module-DDH-aU6z.js +0 -1
- package/dist/public/assets/module-DOrYVZ7B.js +0 -2615
- package/dist/public/assets/module-DRofmFJn.js +0 -1
- package/dist/public/assets/module-MaD4hvv4.js +0 -1
- package/dist/public/assets/module-ZDJutm0b.js +0 -1
- package/dist/public/assets/module-qoBVcE5h.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-jhCd70vR.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-DV0NJFsI.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Co-Hlf34.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DKMPEjDD.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CU76xJSu.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-JMMnu_MW.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-CPlAD3X1.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-Dhc8wpLp.js +0 -1
|
@@ -0,0 +1,1520 @@
|
|
|
1
|
+
// ../ta-protocol/esm/common/ta-extension-host.js
|
|
2
|
+
var TA_WEBHOOK_MAX_BYTES = 256 * 1024;
|
|
3
|
+
var TA_HOST_EVENT = "ta:host";
|
|
4
|
+
var TaHostUtil;
|
|
5
|
+
(function(TaHostUtil2) {
|
|
6
|
+
TaHostUtil2.WAIT_MS = 1000;
|
|
7
|
+
function reach(events, name, waitMs = TaHostUtil2.WAIT_MS) {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
let heard = false;
|
|
10
|
+
let answered = false;
|
|
11
|
+
const timer = setTimeout(() => resolve(undefined), waitMs);
|
|
12
|
+
const request = {
|
|
13
|
+
name,
|
|
14
|
+
heard: () => {
|
|
15
|
+
heard = true;
|
|
16
|
+
},
|
|
17
|
+
resolve: (answer) => {
|
|
18
|
+
answered = true;
|
|
19
|
+
clearTimeout(timer);
|
|
20
|
+
resolve(answer);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
events.emit(TA_HOST_EVENT, request);
|
|
24
|
+
if (!heard && !answered) {
|
|
25
|
+
clearTimeout(timer);
|
|
26
|
+
resolve(undefined);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
TaHostUtil2.reach = reach;
|
|
31
|
+
function marked(systemPrompt, mark) {
|
|
32
|
+
return role(systemPrompt).includes(mark);
|
|
33
|
+
}
|
|
34
|
+
TaHostUtil2.marked = marked;
|
|
35
|
+
function role(systemPrompt) {
|
|
36
|
+
if (!systemPrompt) {
|
|
37
|
+
return "";
|
|
38
|
+
}
|
|
39
|
+
const open = `<addendum>
|
|
40
|
+
`;
|
|
41
|
+
const start = systemPrompt.indexOf(open);
|
|
42
|
+
const context = systemPrompt.indexOf(`<project_context>
|
|
43
|
+
`);
|
|
44
|
+
if (start < 0 || context >= 0 && context < start) {
|
|
45
|
+
return "";
|
|
46
|
+
}
|
|
47
|
+
const end = systemPrompt.indexOf(`
|
|
48
|
+
</addendum>`, start);
|
|
49
|
+
return systemPrompt.slice(start + open.length, end < 0 ? undefined : end);
|
|
50
|
+
}
|
|
51
|
+
TaHostUtil2.role = role;
|
|
52
|
+
})(TaHostUtil || (TaHostUtil = {}));
|
|
53
|
+
var TA_ASK_ENTRY = "ta-ask";
|
|
54
|
+
var TaAskUtil;
|
|
55
|
+
(function(TaAskUtil2) {
|
|
56
|
+
const LENGTH = 120;
|
|
57
|
+
function entry(question) {
|
|
58
|
+
const line = question.replace(/\s+/g, " ").trim();
|
|
59
|
+
return { question: line.length > LENGTH ? `${line.slice(0, LENGTH - 1)}…` : line };
|
|
60
|
+
}
|
|
61
|
+
TaAskUtil2.entry = entry;
|
|
62
|
+
function asking(entries) {
|
|
63
|
+
var _a;
|
|
64
|
+
for (let i = entries.length - 1;i >= 0; i--) {
|
|
65
|
+
const entry2 = entries[i];
|
|
66
|
+
if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY) {
|
|
70
|
+
return read(entry2);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
TaAskUtil2.asking = asking;
|
|
76
|
+
function next(asked, entry2) {
|
|
77
|
+
var _a;
|
|
78
|
+
if (entry2.type === "message" && ((_a = entry2.message) === null || _a === undefined ? undefined : _a.role) === "user") {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
return entry2.type === "custom" && entry2.customType === TA_ASK_ENTRY ? read(entry2) : asked;
|
|
82
|
+
}
|
|
83
|
+
TaAskUtil2.next = next;
|
|
84
|
+
function read(found) {
|
|
85
|
+
var _a;
|
|
86
|
+
const question = (_a = found.data) === null || _a === undefined ? undefined : _a.question;
|
|
87
|
+
if (typeof question !== "string" || !question.trim()) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const at = found.timestamp ? Date.parse(found.timestamp) : Number.NaN;
|
|
91
|
+
return { question: entry(question).question, at: Number.isNaN(at) ? 0 : at };
|
|
92
|
+
}
|
|
93
|
+
})(TaAskUtil || (TaAskUtil = {}));
|
|
94
|
+
|
|
95
|
+
// ../ta-protocol/esm/common/delegate-protocol.js
|
|
96
|
+
var TaDelegateUtil;
|
|
97
|
+
(function(TaDelegateUtil2) {
|
|
98
|
+
TaDelegateUtil2.LEVELS = ["less", "balanced", "more"];
|
|
99
|
+
TaDelegateUtil2.DEFAULT = "balanced";
|
|
100
|
+
TaDelegateUtil2.WORK_TOOLS = ["read", "bash", "powershell", "edit", "write", "grep", "find", "ls"];
|
|
101
|
+
TaDelegateUtil2.CHANGE_TOOLS = ["edit", "write"];
|
|
102
|
+
const LIMITS = {
|
|
103
|
+
less: { noChanges: false },
|
|
104
|
+
balanced: { noChanges: true, steps: 6 },
|
|
105
|
+
more: { noChanges: true, steps: 2 }
|
|
106
|
+
};
|
|
107
|
+
function parse(value) {
|
|
108
|
+
return TaDelegateUtil2.LEVELS.includes(value) ? value : TaDelegateUtil2.DEFAULT;
|
|
109
|
+
}
|
|
110
|
+
TaDelegateUtil2.parse = parse;
|
|
111
|
+
function mark(level) {
|
|
112
|
+
return `(delegate=${level})`;
|
|
113
|
+
}
|
|
114
|
+
TaDelegateUtil2.mark = mark;
|
|
115
|
+
function levelOf(systemPrompt) {
|
|
116
|
+
const role = TaHostUtil.role(systemPrompt);
|
|
117
|
+
return TaDelegateUtil2.LEVELS.find((level) => role.includes(mark(level)));
|
|
118
|
+
}
|
|
119
|
+
TaDelegateUtil2.levelOf = levelOf;
|
|
120
|
+
function limits(level) {
|
|
121
|
+
return LIMITS[level];
|
|
122
|
+
}
|
|
123
|
+
TaDelegateUtil2.limits = limits;
|
|
124
|
+
function refusal(level, tool, steps) {
|
|
125
|
+
if (!TaDelegateUtil2.WORK_TOOLS.includes(tool)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
const limit = LIMITS[level];
|
|
129
|
+
if (limit.noChanges && TaDelegateUtil2.CHANGE_TOOLS.includes(tool)) {
|
|
130
|
+
return "You do not change files yourself: hand this to a task with start_task, with instructions complete enough to do it. The user set how much you hand out in the settings of the double.";
|
|
131
|
+
}
|
|
132
|
+
if (limit.steps !== undefined && steps >= limit.steps) {
|
|
133
|
+
return "You have looked enough for this: hand the work to a task with start_task now, with what you found in its instructions, and tell the user what you started.";
|
|
134
|
+
}
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
TaDelegateUtil2.refusal = refusal;
|
|
138
|
+
})(TaDelegateUtil || (TaDelegateUtil = {}));
|
|
139
|
+
|
|
140
|
+
// ../ta-protocol/esm/common/language.js
|
|
141
|
+
var TaLanguageUtil;
|
|
142
|
+
(function(TaLanguageUtil2) {
|
|
143
|
+
TaLanguageUtil2.ALL = ["zh-CN", "zh-TW", "en-US", "ja-JP"];
|
|
144
|
+
TaLanguageUtil2.NAMES = { "zh-CN": "简体中文", "zh-TW": "繁體中文", "en-US": "English", "ja-JP": "日本語" };
|
|
145
|
+
function of(tag) {
|
|
146
|
+
const said = (tag !== null && tag !== undefined ? tag : "").toLowerCase().replace(/_/g, "-");
|
|
147
|
+
if (/^zh(\b|-)/.test(said)) {
|
|
148
|
+
return /-hant\b/.test(said) || !/-hans\b/.test(said) && /-(tw|hk|mo)\b/.test(said) ? "zh-TW" : "zh-CN";
|
|
149
|
+
}
|
|
150
|
+
return /^ja(\b|-)/.test(said) ? "ja-JP" : "en-US";
|
|
151
|
+
}
|
|
152
|
+
TaLanguageUtil2.of = of;
|
|
153
|
+
function server(env = typeof process === "undefined" ? {} : process.env) {
|
|
154
|
+
return of(env.TA_LANGUAGE || env.LC_ALL || env.LC_MESSAGES || env.LANG);
|
|
155
|
+
}
|
|
156
|
+
TaLanguageUtil2.server = server;
|
|
157
|
+
function pick(language, words) {
|
|
158
|
+
return words[of(language)];
|
|
159
|
+
}
|
|
160
|
+
TaLanguageUtil2.pick = pick;
|
|
161
|
+
function say(words) {
|
|
162
|
+
return words[server()];
|
|
163
|
+
}
|
|
164
|
+
TaLanguageUtil2.say = say;
|
|
165
|
+
function chinese(language) {
|
|
166
|
+
return of(language).startsWith("zh");
|
|
167
|
+
}
|
|
168
|
+
TaLanguageUtil2.chinese = chinese;
|
|
169
|
+
function cjk(language) {
|
|
170
|
+
return of(language) !== "en-US";
|
|
171
|
+
}
|
|
172
|
+
TaLanguageUtil2.cjk = cjk;
|
|
173
|
+
function list(language, items) {
|
|
174
|
+
return items.join(cjk(language) ? "、" : ", ");
|
|
175
|
+
}
|
|
176
|
+
TaLanguageUtil2.list = list;
|
|
177
|
+
})(TaLanguageUtil || (TaLanguageUtil = {}));
|
|
178
|
+
|
|
179
|
+
// ../ta-protocol/esm/common/app-protocol.js
|
|
180
|
+
var TA_APP_TOOLS = ["app_commands", "app_run", "app_look", "app_go", "app_do"];
|
|
181
|
+
var FONT_SIZES = ["small", "standard", "large", "xlarge"];
|
|
182
|
+
var words = (en, zh, tw, ja) => ({ "en-US": en, "zh-CN": zh, "zh-TW": tw, "ja-JP": ja });
|
|
183
|
+
var SYSTEM = words("as the system", "跟随系统", "跟隨系統", "システムに合わせる");
|
|
184
|
+
var FONT_SHOWN = {
|
|
185
|
+
small: words("small", "小", "小", "小"),
|
|
186
|
+
standard: words("standard", "标准", "標準", "標準"),
|
|
187
|
+
large: words("large", "大", "大", "大"),
|
|
188
|
+
xlarge: words("extra large", "特大", "特大", "特大")
|
|
189
|
+
};
|
|
190
|
+
var TA_WEB_SETTINGS = [
|
|
191
|
+
{
|
|
192
|
+
key: "theme",
|
|
193
|
+
type: "enum",
|
|
194
|
+
values: ["system", "light", "dark"],
|
|
195
|
+
default: "system",
|
|
196
|
+
what: "Light or dark look; system follows the device.",
|
|
197
|
+
title: words("Theme", "外观", "外觀", "外観"),
|
|
198
|
+
shown: { system: SYSTEM, light: words("light", "浅色", "淺色", "ライト"), dark: words("dark", "深色", "深色", "ダーク") }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
key: "language",
|
|
202
|
+
type: "enum",
|
|
203
|
+
values: ["system", ...TaLanguageUtil.ALL],
|
|
204
|
+
default: "system",
|
|
205
|
+
what: "The language of Ta's pages and of what Ta says; system follows the device.",
|
|
206
|
+
title: words("Language", "语言", "語言", "言語"),
|
|
207
|
+
shown: {
|
|
208
|
+
system: SYSTEM,
|
|
209
|
+
...Object.fromEntries(TaLanguageUtil.ALL.map((language) => [
|
|
210
|
+
language,
|
|
211
|
+
words(TaLanguageUtil.NAMES[language], TaLanguageUtil.NAMES[language], TaLanguageUtil.NAMES[language], TaLanguageUtil.NAMES[language])
|
|
212
|
+
]))
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
key: "fontSize",
|
|
217
|
+
type: "enum",
|
|
218
|
+
values: FONT_SIZES,
|
|
219
|
+
default: "standard",
|
|
220
|
+
what: "The size of the text of the whole page.",
|
|
221
|
+
title: words("Text size", "字体大小", "字型大小", "文字サイズ"),
|
|
222
|
+
shown: FONT_SHOWN
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
key: "chatFontSize",
|
|
226
|
+
type: "enum",
|
|
227
|
+
values: FONT_SIZES,
|
|
228
|
+
default: "standard",
|
|
229
|
+
what: "The size of the text of conversations, on top of fontSize.",
|
|
230
|
+
title: words("Text size of conversations", "对话字体大小", "對話字型大小", "会話の文字サイズ"),
|
|
231
|
+
shown: FONT_SHOWN
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
key: "speak",
|
|
235
|
+
type: "boolean",
|
|
236
|
+
default: false,
|
|
237
|
+
what: "Read every reply aloud.",
|
|
238
|
+
title: words("Read replies aloud", "朗读回复", "朗讀回覆", "返信を読み上げ")
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
key: "speakTalk",
|
|
242
|
+
type: "boolean",
|
|
243
|
+
default: false,
|
|
244
|
+
what: "Read the reply aloud when the user spoke to the double by voice.",
|
|
245
|
+
title: words("Read aloud what was asked by voice", "语音提问时朗读回复", "語音提問時朗讀回覆", "音声で聞いたら読み上げ")
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
key: "callCaptions",
|
|
249
|
+
type: "boolean",
|
|
250
|
+
default: false,
|
|
251
|
+
what: "Show captions in a call: what the user says and what Ta reads.",
|
|
252
|
+
title: words("Call captions", "通话字幕", "通話字幕", "通話の字幕")
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
key: "voice",
|
|
256
|
+
type: "string",
|
|
257
|
+
default: "",
|
|
258
|
+
what: "The voice replies are read with (a voiceURI of the device's voices); empty for the most natural one.",
|
|
259
|
+
title: words("Voice", "朗读声音", "朗讀聲音", "読み上げの声")
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
key: "confirmTasks",
|
|
263
|
+
type: "boolean",
|
|
264
|
+
default: false,
|
|
265
|
+
what: "The double asks before it hands out work.",
|
|
266
|
+
title: words("Ask before handing out work", "派任务前先问我", "派任務前先問我", "作業を割り当てる前に確認")
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
key: "maxTasks",
|
|
270
|
+
type: "number",
|
|
271
|
+
values: [0, 2, 4, 8],
|
|
272
|
+
default: 0,
|
|
273
|
+
what: "How many of the double's tasks run at once; 0 for as many as it starts.",
|
|
274
|
+
title: words("Tasks at once", "同时运行的任务", "同時執行的任務", "同時に実行するタスク")
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
key: "delegate",
|
|
278
|
+
type: "enum",
|
|
279
|
+
values: TaDelegateUtil.LEVELS,
|
|
280
|
+
default: TaDelegateUtil.DEFAULT,
|
|
281
|
+
what: "How much of the work the double hands out to tasks rather than doing it itself.",
|
|
282
|
+
title: words("Hand out work", "派活多少", "派活多少", "作業の割り当て"),
|
|
283
|
+
shown: { less: words("less", "少", "少", "少なめ"), balanced: words("balanced", "适中", "適中", "ふつう"), more: words("more", "多", "多", "多め") }
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
key: "assistantModel",
|
|
287
|
+
type: "model",
|
|
288
|
+
default: "",
|
|
289
|
+
what: "The model of the double, <provider>/<model id>; empty for the default model.",
|
|
290
|
+
title: words("Model of the double", "分身的模型", "分身的模型", "分身のモデル")
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
key: "taskModel",
|
|
294
|
+
type: "model",
|
|
295
|
+
default: "",
|
|
296
|
+
what: "The model of the tasks the double starts; empty for the default model.",
|
|
297
|
+
title: words("Model of tasks", "任务的模型", "任務的模型", "タスクのモデル")
|
|
298
|
+
},
|
|
299
|
+
{ key: "reduceMotion", type: "boolean", default: false, what: "Fewer animations.", title: words("Reduce motion", "减少动画", "減少動畫", "動きを減らす") },
|
|
300
|
+
{
|
|
301
|
+
key: "keepAliveMinutes",
|
|
302
|
+
type: "number",
|
|
303
|
+
values: [1, 5, 15, 30],
|
|
304
|
+
default: 5,
|
|
305
|
+
what: "How long an extension started on open keeps running once left, in minutes.",
|
|
306
|
+
title: words("Keep extensions running", "扩展离开后保留", "擴充功能離開後保留", "拡張機能を保持")
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
key: "chatFoldDays",
|
|
310
|
+
type: "number",
|
|
311
|
+
values: [3, 7, 30, 0],
|
|
312
|
+
default: 7,
|
|
313
|
+
what: "Conversations not updated for these days fold at the end of the list; 0 for none.",
|
|
314
|
+
title: words("Fold old conversations", "折叠旧对话", "摺疊舊對話", "古い会話を折りたたむ")
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
key: "chatArchiveDays",
|
|
318
|
+
type: "number",
|
|
319
|
+
values: [30, 90, 365, 0],
|
|
320
|
+
default: 30,
|
|
321
|
+
what: "Conversations not updated for these days are archived (out of the list, found by search); 0 for none.",
|
|
322
|
+
title: words("Archive old conversations", "归档旧对话", "歸檔舊對話", "古い会話をアーカイブ")
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
key: "recentShots",
|
|
326
|
+
type: "boolean",
|
|
327
|
+
default: true,
|
|
328
|
+
what: "The screenshot just taken is offered above the message box, once.",
|
|
329
|
+
title: words("Offer recent screenshots", "提示刚截的图", "提示剛截的圖", "撮ったばかりのスクリーンショットを提案")
|
|
330
|
+
}
|
|
331
|
+
];
|
|
332
|
+
var TaAppUtil;
|
|
333
|
+
(function(TaAppUtil2) {
|
|
334
|
+
function check(spec, value) {
|
|
335
|
+
var _a, _b;
|
|
336
|
+
switch (spec.type) {
|
|
337
|
+
case "boolean":
|
|
338
|
+
return typeof value === "boolean" ? undefined : "true or false";
|
|
339
|
+
case "string":
|
|
340
|
+
return typeof value === "string" ? undefined : "a string";
|
|
341
|
+
case "model":
|
|
342
|
+
return value === "" || typeof value === "string" && /^[^/\s]+\/\S+$/.test(value) ? undefined : "<provider>/<model id>, or empty";
|
|
343
|
+
default:
|
|
344
|
+
return ((_a = spec.values) === null || _a === undefined ? undefined : _a.includes(value)) ? undefined : `one of ${(_b = spec.values) === null || _b === undefined ? undefined : _b.map((one) => JSON.stringify(one)).join(", ")}`;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
TaAppUtil2.check = check;
|
|
348
|
+
function shown(value, language, spec) {
|
|
349
|
+
var _a;
|
|
350
|
+
const named = (_a = spec === null || spec === undefined ? undefined : spec.shown) === null || _a === undefined ? undefined : _a[String(value)];
|
|
351
|
+
if (named) {
|
|
352
|
+
return TaLanguageUtil.pick(language, named);
|
|
353
|
+
}
|
|
354
|
+
if (typeof value === "boolean") {
|
|
355
|
+
return TaLanguageUtil.pick(language, value ? words("on", "开", "開", "オン") : words("off", "关", "關", "オフ"));
|
|
356
|
+
}
|
|
357
|
+
if (value === "" || value === undefined || value === null) {
|
|
358
|
+
return TaLanguageUtil.pick(language, words("default", "默认", "預設", "デフォルト"));
|
|
359
|
+
}
|
|
360
|
+
return String(value);
|
|
361
|
+
}
|
|
362
|
+
TaAppUtil2.shown = shown;
|
|
363
|
+
})(TaAppUtil || (TaAppUtil = {}));
|
|
364
|
+
|
|
365
|
+
// web-src/app-protocol.ts
|
|
366
|
+
var DONE_KEY = "done";
|
|
367
|
+
var DONE_MAX = 20;
|
|
368
|
+
|
|
369
|
+
// web-src/app-util.ts
|
|
370
|
+
var DATA_CHARS = 8000;
|
|
371
|
+
var AppUseUtil;
|
|
372
|
+
((AppUseUtil) => {
|
|
373
|
+
function find(commands, query) {
|
|
374
|
+
const words2 = (query ?? "").toLowerCase().split(/\s+/).filter(Boolean);
|
|
375
|
+
if (!words2.length) {
|
|
376
|
+
return [...commands];
|
|
377
|
+
}
|
|
378
|
+
return commands.filter((command) => {
|
|
379
|
+
const text = `${command.id} ${command.description}`.toLowerCase();
|
|
380
|
+
return words2.some((word) => text.includes(word));
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
AppUseUtil.find = find;
|
|
384
|
+
function listText(commands) {
|
|
385
|
+
if (!commands.length) {
|
|
386
|
+
return "No action matches; app_commands without a query lists them all.";
|
|
387
|
+
}
|
|
388
|
+
return commands.map((command) => {
|
|
389
|
+
const properties = command.input?.properties;
|
|
390
|
+
const required = command.input?.required;
|
|
391
|
+
const input = properties ? ` Input: ${JSON.stringify(properties)}${Array.isArray(required) && required.length ? `, required ${required.join(", ")}` : ""}.` : " No input.";
|
|
392
|
+
return `- ${command.id} (${command.risk}${command.owner ? `, of ${command.owner}` : ""}): ${command.description}${input}`;
|
|
393
|
+
}).join(`
|
|
394
|
+
`);
|
|
395
|
+
}
|
|
396
|
+
AppUseUtil.listText = listText;
|
|
397
|
+
function resultText(result) {
|
|
398
|
+
const lines = [result.text];
|
|
399
|
+
if (result.data !== undefined) {
|
|
400
|
+
const data = JSON.stringify(result.data);
|
|
401
|
+
lines.push(data.length > DATA_CHARS ? `${data.slice(0, DATA_CHARS)}… (cut; narrow it down)` : data);
|
|
402
|
+
}
|
|
403
|
+
if (result.notice) {
|
|
404
|
+
lines.push(`The user's pages show it already, and a notice with Undo.`);
|
|
405
|
+
}
|
|
406
|
+
return lines.join(`
|
|
407
|
+
`);
|
|
408
|
+
}
|
|
409
|
+
AppUseUtil.resultText = resultText;
|
|
410
|
+
function add(done, entry) {
|
|
411
|
+
return [...entries(done), entry].slice(-DONE_MAX);
|
|
412
|
+
}
|
|
413
|
+
AppUseUtil.add = add;
|
|
414
|
+
function entries(done) {
|
|
415
|
+
return Array.isArray(done) ? done.filter((one) => !!one && typeof one === "object" && typeof one.id === "string" && typeof one.notice === "string" && typeof one.at === "number") : [];
|
|
416
|
+
}
|
|
417
|
+
AppUseUtil.entries = entries;
|
|
418
|
+
function fresh(done, since) {
|
|
419
|
+
return entries(done).filter((entry) => entry.at > since && !entry.undone);
|
|
420
|
+
}
|
|
421
|
+
AppUseUtil.fresh = fresh;
|
|
422
|
+
})(AppUseUtil ||= {});
|
|
423
|
+
|
|
424
|
+
// web-src/i18n.ts
|
|
425
|
+
var EN = {
|
|
426
|
+
undo: "Undo",
|
|
427
|
+
commands: "Look up what Ta can do",
|
|
428
|
+
run: "Do in Ta",
|
|
429
|
+
"settings.get": "Read settings",
|
|
430
|
+
"settings.set": "Change settings",
|
|
431
|
+
"chats.list": "Read conversations",
|
|
432
|
+
"chats.pin": "Pin conversation",
|
|
433
|
+
unpin: "Unpin conversation",
|
|
434
|
+
"chats.stop": "Stop conversation",
|
|
435
|
+
"extensions.list": "Read extensions",
|
|
436
|
+
"extensions.set": "Turn extension on or off",
|
|
437
|
+
"asks.list": "Read what waits for you",
|
|
438
|
+
"asks.answer": "Answer for you",
|
|
439
|
+
look: "Look at the screen",
|
|
440
|
+
go: "Go to",
|
|
441
|
+
do: "Do on the screen",
|
|
442
|
+
screen: "Ta's screen",
|
|
443
|
+
operating: "Ta is at work",
|
|
444
|
+
watch: "Watch",
|
|
445
|
+
stop: "Stop",
|
|
446
|
+
bigger: "Larger",
|
|
447
|
+
smaller: "Smaller",
|
|
448
|
+
hide: "Hide",
|
|
449
|
+
settings: "Settings",
|
|
450
|
+
discover: "Discover",
|
|
451
|
+
on: "Turn on",
|
|
452
|
+
off: "Turn off"
|
|
453
|
+
};
|
|
454
|
+
var ZH = {
|
|
455
|
+
undo: "撤销",
|
|
456
|
+
commands: "查看 Ta 能做什么",
|
|
457
|
+
run: "在 Ta 里操作",
|
|
458
|
+
"settings.get": "查看设置",
|
|
459
|
+
"settings.set": "修改设置",
|
|
460
|
+
"chats.list": "查看对话",
|
|
461
|
+
"chats.pin": "置顶对话",
|
|
462
|
+
unpin: "取消置顶",
|
|
463
|
+
"chats.stop": "停止对话",
|
|
464
|
+
"extensions.list": "查看扩展",
|
|
465
|
+
"extensions.set": "开关扩展",
|
|
466
|
+
"asks.list": "查看待你决定",
|
|
467
|
+
"asks.answer": "替你回答",
|
|
468
|
+
look: "看看屏幕",
|
|
469
|
+
go: "打开",
|
|
470
|
+
do: "在屏幕上操作",
|
|
471
|
+
screen: "Ta 的屏幕",
|
|
472
|
+
operating: "Ta 正在操作",
|
|
473
|
+
watch: "看看",
|
|
474
|
+
stop: "停止",
|
|
475
|
+
bigger: "放大",
|
|
476
|
+
smaller: "缩小",
|
|
477
|
+
hide: "收起",
|
|
478
|
+
settings: "设置",
|
|
479
|
+
discover: "发现",
|
|
480
|
+
on: "打开",
|
|
481
|
+
off: "关掉"
|
|
482
|
+
};
|
|
483
|
+
var ZH_TW = {
|
|
484
|
+
undo: "復原",
|
|
485
|
+
commands: "查看 Ta 能做什麼",
|
|
486
|
+
run: "在 Ta 裡操作",
|
|
487
|
+
"settings.get": "查看設定",
|
|
488
|
+
"settings.set": "修改設定",
|
|
489
|
+
"chats.list": "查看對話",
|
|
490
|
+
"chats.pin": "置頂對話",
|
|
491
|
+
unpin: "取消置頂",
|
|
492
|
+
"chats.stop": "停止對話",
|
|
493
|
+
"extensions.list": "查看擴充功能",
|
|
494
|
+
"extensions.set": "開關擴充功能",
|
|
495
|
+
"asks.list": "查看待你決定",
|
|
496
|
+
"asks.answer": "替你回答",
|
|
497
|
+
look: "看看螢幕",
|
|
498
|
+
go: "打開",
|
|
499
|
+
do: "在螢幕上操作",
|
|
500
|
+
screen: "Ta 的螢幕",
|
|
501
|
+
operating: "Ta 正在操作",
|
|
502
|
+
watch: "看看",
|
|
503
|
+
stop: "停止",
|
|
504
|
+
bigger: "放大",
|
|
505
|
+
smaller: "縮小",
|
|
506
|
+
hide: "收起",
|
|
507
|
+
settings: "設定",
|
|
508
|
+
discover: "發現",
|
|
509
|
+
on: "開啟",
|
|
510
|
+
off: "關閉"
|
|
511
|
+
};
|
|
512
|
+
var JA = {
|
|
513
|
+
undo: "元に戻す",
|
|
514
|
+
commands: "Ta にできることを確認",
|
|
515
|
+
run: "Ta で操作",
|
|
516
|
+
"settings.get": "設定を確認",
|
|
517
|
+
"settings.set": "設定を変更",
|
|
518
|
+
"chats.list": "会話を確認",
|
|
519
|
+
"chats.pin": "会話をピン留め",
|
|
520
|
+
unpin: "ピン留めを外す",
|
|
521
|
+
"chats.stop": "会話を停止",
|
|
522
|
+
"extensions.list": "拡張機能を確認",
|
|
523
|
+
"extensions.set": "拡張機能をオン・オフ",
|
|
524
|
+
"asks.list": "あなたの判断待ちを確認",
|
|
525
|
+
"asks.answer": "代わりに回答",
|
|
526
|
+
look: "画面を見る",
|
|
527
|
+
go: "開く",
|
|
528
|
+
do: "画面で操作",
|
|
529
|
+
screen: "Ta の画面",
|
|
530
|
+
operating: "Ta が操作中",
|
|
531
|
+
watch: "見る",
|
|
532
|
+
stop: "停止",
|
|
533
|
+
bigger: "拡大",
|
|
534
|
+
smaller: "縮小",
|
|
535
|
+
hide: "しまう",
|
|
536
|
+
settings: "設定",
|
|
537
|
+
discover: "見つける",
|
|
538
|
+
on: "オンにする",
|
|
539
|
+
off: "オフにする"
|
|
540
|
+
};
|
|
541
|
+
var WORDS = { "zh-CN": ZH, "zh-TW": ZH_TW, "en-US": EN, "ja-JP": JA };
|
|
542
|
+
var AppUseWords;
|
|
543
|
+
((AppUseWords) => {
|
|
544
|
+
function of(language) {
|
|
545
|
+
return TaLanguageUtil.pick(language, WORDS);
|
|
546
|
+
}
|
|
547
|
+
AppUseWords.of = of;
|
|
548
|
+
})(AppUseWords ||= {});
|
|
549
|
+
|
|
550
|
+
// web-src/screen-cursor.ts
|
|
551
|
+
var STYLE = `
|
|
552
|
+
.ta-agent-layer { position: fixed; inset: 0; pointer-events: none; z-index: 2147483646; }
|
|
553
|
+
.ta-agent-cursor { position: absolute; left: 0; top: 0; transform: translate3d(-40px, -40px, 0); transition: transform 300ms cubic-bezier(.2,.8,.2,1), opacity 200ms; opacity: 0; will-change: transform; }
|
|
554
|
+
.ta-agent-cursor[data-shown] { opacity: 1; }
|
|
555
|
+
.ta-agent-cursor svg { display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25)); transition: transform 120ms; transform-origin: 3px 3px; }
|
|
556
|
+
.ta-agent-cursor[data-press] svg { transform: scale(.86); }
|
|
557
|
+
.ta-agent-caption { position: absolute; left: 22px; top: 20px; max-width: 260px; padding: 4px 9px; border-radius: 9px; background: var(--ta-accent, #07c160); color: #fff; font: 500 12px/1.4 var(--ta-sans, system-ui, sans-serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
|
|
558
|
+
.ta-agent-caption:empty { display: none; }
|
|
559
|
+
.ta-agent-ring { position: absolute; border-radius: 10px; box-shadow: 0 0 0 2px var(--ta-accent, #07c160), 0 0 0 6px color-mix(in srgb, var(--ta-accent, #07c160) 22%, transparent); opacity: 0; transition: opacity 160ms, left 300ms cubic-bezier(.2,.8,.2,1), top 300ms cubic-bezier(.2,.8,.2,1), width 300ms, height 300ms; }
|
|
560
|
+
.ta-agent-ring[data-shown] { opacity: 1; }
|
|
561
|
+
.ta-agent-ripple { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: color-mix(in srgb, var(--ta-accent, #07c160) 35%, transparent); animation: ta-agent-ripple 420ms ease-out forwards; }
|
|
562
|
+
@keyframes ta-agent-ripple { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
|
|
563
|
+
@media (prefers-reduced-motion: reduce) { .ta-agent-cursor, .ta-agent-ring { transition: none; } .ta-agent-ripple { animation-duration: 1ms; } }
|
|
564
|
+
`;
|
|
565
|
+
var ARROW = '<svg width="22" height="22" viewBox="0 0 22 22"><path d="M3 2.5 L18 11 L11 12.6 L7.6 19.5 Z" fill="var(--ta-accent, #07c160)" stroke="#fff" stroke-width="1.6" stroke-linejoin="round"/></svg>';
|
|
566
|
+
var wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
567
|
+
|
|
568
|
+
class ScreenCursor {
|
|
569
|
+
document;
|
|
570
|
+
layer;
|
|
571
|
+
pointer;
|
|
572
|
+
caption;
|
|
573
|
+
ring;
|
|
574
|
+
hideTimer;
|
|
575
|
+
at = { x: -40, y: -40 };
|
|
576
|
+
constructor(document2) {
|
|
577
|
+
this.document = document2;
|
|
578
|
+
}
|
|
579
|
+
async point(element, says) {
|
|
580
|
+
this.mount();
|
|
581
|
+
clearTimeout(this.hideTimer);
|
|
582
|
+
const view = this.document.defaultView;
|
|
583
|
+
let rect = element.getBoundingClientRect();
|
|
584
|
+
if (view && (rect.top < 0 || rect.bottom > view.innerHeight || rect.left < 0 || rect.right > view.innerWidth)) {
|
|
585
|
+
element.scrollIntoView({ block: "center", inline: "nearest", behavior: "smooth" });
|
|
586
|
+
await wait(320);
|
|
587
|
+
rect = element.getBoundingClientRect();
|
|
588
|
+
}
|
|
589
|
+
const x = rect.left + Math.min(rect.width / 2, 40);
|
|
590
|
+
const y = rect.top + rect.height / 2;
|
|
591
|
+
const { pointer, caption, ring } = this.parts();
|
|
592
|
+
caption.textContent = says;
|
|
593
|
+
if (this.at.x < 0) {
|
|
594
|
+
pointer.style.transition = "none";
|
|
595
|
+
pointer.style.transform = `translate3d(${x + 60}px, ${y + 50}px, 0)`;
|
|
596
|
+
pointer.getBoundingClientRect();
|
|
597
|
+
pointer.style.transition = "";
|
|
598
|
+
}
|
|
599
|
+
pointer.dataset.shown = "";
|
|
600
|
+
pointer.style.transform = `translate3d(${x}px, ${y}px, 0)`;
|
|
601
|
+
Object.assign(ring.style, { left: `${rect.left - 3}px`, top: `${rect.top - 3}px`, width: `${rect.width + 6}px`, height: `${rect.height + 6}px` });
|
|
602
|
+
ring.dataset.shown = "";
|
|
603
|
+
this.at = { x, y };
|
|
604
|
+
await wait(320);
|
|
605
|
+
}
|
|
606
|
+
async press() {
|
|
607
|
+
const { pointer } = this.parts();
|
|
608
|
+
pointer.dataset.press = "";
|
|
609
|
+
const ripple = this.document.createElement("div");
|
|
610
|
+
ripple.className = "ta-agent-ripple";
|
|
611
|
+
Object.assign(ripple.style, { left: `${this.at.x}px`, top: `${this.at.y}px` });
|
|
612
|
+
this.layer?.appendChild(ripple);
|
|
613
|
+
await wait(140);
|
|
614
|
+
delete pointer.dataset.press;
|
|
615
|
+
setTimeout(() => ripple.remove(), 500);
|
|
616
|
+
}
|
|
617
|
+
async type(text, set) {
|
|
618
|
+
const slow = Math.min(text.length, 32);
|
|
619
|
+
for (let index = 1;index <= slow; index++) {
|
|
620
|
+
set(text.slice(0, index));
|
|
621
|
+
await wait(18);
|
|
622
|
+
}
|
|
623
|
+
if (text.length > slow) {
|
|
624
|
+
set(text);
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
rest() {
|
|
628
|
+
clearTimeout(this.hideTimer);
|
|
629
|
+
this.hideTimer = setTimeout(() => {
|
|
630
|
+
if (this.pointer) {
|
|
631
|
+
delete this.pointer.dataset.shown;
|
|
632
|
+
}
|
|
633
|
+
if (this.ring) {
|
|
634
|
+
delete this.ring.dataset.shown;
|
|
635
|
+
}
|
|
636
|
+
this.at = { x: -40, y: -40 };
|
|
637
|
+
}, 1600);
|
|
638
|
+
}
|
|
639
|
+
dispose() {
|
|
640
|
+
clearTimeout(this.hideTimer);
|
|
641
|
+
this.layer?.remove();
|
|
642
|
+
this.layer = undefined;
|
|
643
|
+
}
|
|
644
|
+
parts() {
|
|
645
|
+
this.mount();
|
|
646
|
+
return { pointer: this.pointer, caption: this.caption, ring: this.ring };
|
|
647
|
+
}
|
|
648
|
+
mount() {
|
|
649
|
+
if (this.layer?.isConnected) {
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
const document2 = this.document;
|
|
653
|
+
if (!document2.getElementById("ta-agent-style")) {
|
|
654
|
+
const style = document2.createElement("style");
|
|
655
|
+
style.id = "ta-agent-style";
|
|
656
|
+
style.textContent = STYLE;
|
|
657
|
+
document2.head.appendChild(style);
|
|
658
|
+
}
|
|
659
|
+
const layer = document2.createElement("div");
|
|
660
|
+
layer.className = "ta-agent-layer";
|
|
661
|
+
layer.setAttribute("aria-hidden", "true");
|
|
662
|
+
const ring = document2.createElement("div");
|
|
663
|
+
ring.className = "ta-agent-ring";
|
|
664
|
+
const pointer = document2.createElement("div");
|
|
665
|
+
pointer.className = "ta-agent-cursor";
|
|
666
|
+
pointer.innerHTML = ARROW;
|
|
667
|
+
const caption = document2.createElement("div");
|
|
668
|
+
caption.className = "ta-agent-caption";
|
|
669
|
+
pointer.appendChild(caption);
|
|
670
|
+
layer.append(ring, pointer);
|
|
671
|
+
document2.body.appendChild(layer);
|
|
672
|
+
Object.assign(this, { layer, pointer, caption, ring });
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// web-src/screen-dom.ts
|
|
677
|
+
var CONTROLS = [
|
|
678
|
+
"button",
|
|
679
|
+
"a[href]",
|
|
680
|
+
"input:not([type=hidden])",
|
|
681
|
+
"textarea",
|
|
682
|
+
"select",
|
|
683
|
+
'[contenteditable="true"]',
|
|
684
|
+
"[role=button]",
|
|
685
|
+
"[role=link]",
|
|
686
|
+
"[role=switch]",
|
|
687
|
+
"[role=checkbox]",
|
|
688
|
+
"[role=tab]",
|
|
689
|
+
"[role=menuitem]",
|
|
690
|
+
"[role=option]",
|
|
691
|
+
"[role=textbox]"
|
|
692
|
+
].join(",");
|
|
693
|
+
var DIALOGS = "[role=dialog], [role=alertdialog], dialog[open]";
|
|
694
|
+
var ScreenDom;
|
|
695
|
+
((ScreenDom) => {
|
|
696
|
+
function visible(element) {
|
|
697
|
+
const html = element;
|
|
698
|
+
if (typeof html.checkVisibility === "function" && !html.checkVisibility({ opacityProperty: true, visibilityProperty: true })) {
|
|
699
|
+
return false;
|
|
700
|
+
}
|
|
701
|
+
const rect = html.getBoundingClientRect();
|
|
702
|
+
const view = html.ownerDocument.defaultView;
|
|
703
|
+
return rect.width > 0 && rect.height > 0 && rect.bottom > 0 && rect.right > 0 && rect.top < (view?.innerHeight ?? 0) && rect.left < (view?.innerWidth ?? 0);
|
|
704
|
+
}
|
|
705
|
+
ScreenDom.visible = visible;
|
|
706
|
+
function controls(document2) {
|
|
707
|
+
const dialogs = [...document2.querySelectorAll(DIALOGS)].filter(visible);
|
|
708
|
+
const dialog = dialogs[dialogs.length - 1];
|
|
709
|
+
const root = dialog ?? document2;
|
|
710
|
+
const title = dialog ? labelOf(dialog) || headingOf(dialog) || "" : undefined;
|
|
711
|
+
const controls2 = [];
|
|
712
|
+
const elements = [];
|
|
713
|
+
for (const element of root.querySelectorAll(CONTROLS)) {
|
|
714
|
+
if (element.closest("[data-ta-item], [data-ta-action], .ta-agent-layer, .ta-rail-item") || element.closest('[aria-hidden="true"], [inert]') || !visible(element)) {
|
|
715
|
+
continue;
|
|
716
|
+
}
|
|
717
|
+
const control = read(element);
|
|
718
|
+
if (!control) {
|
|
719
|
+
continue;
|
|
720
|
+
}
|
|
721
|
+
if (title !== undefined) {
|
|
722
|
+
control.dialog = title;
|
|
723
|
+
}
|
|
724
|
+
controls2.push(control);
|
|
725
|
+
elements.push(element);
|
|
726
|
+
}
|
|
727
|
+
return { controls: controls2, elements };
|
|
728
|
+
}
|
|
729
|
+
ScreenDom.controls = controls;
|
|
730
|
+
function headings(document2) {
|
|
731
|
+
const found = [];
|
|
732
|
+
for (const heading of document2.querySelectorAll("h1, h2, [role=heading], .ta-main-head .ta-title, .ta-page-title")) {
|
|
733
|
+
const text = heading.textContent?.replace(/\s+/g, " ").trim();
|
|
734
|
+
if (text && visible(heading) && !found.includes(text)) {
|
|
735
|
+
found.push(text);
|
|
736
|
+
}
|
|
737
|
+
if (found.length >= 8) {
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
return found;
|
|
742
|
+
}
|
|
743
|
+
ScreenDom.headings = headings;
|
|
744
|
+
function read(element) {
|
|
745
|
+
const role = element.getAttribute("role");
|
|
746
|
+
const tag = element.tagName.toLowerCase();
|
|
747
|
+
const type = (element.getAttribute("type") ?? "").toLowerCase();
|
|
748
|
+
const kind = role === "switch" || tag === "input" && type === "checkbox" && element.closest(".ta-switch") ? "switch" : role === "checkbox" || tag === "input" && (type === "checkbox" || type === "radio") ? "checkbox" : tag === "select" ? "select" : tag === "textarea" || tag === "input" && !["button", "submit", "reset", "image", "range", "color", "file"].includes(type) || role === "textbox" || element.isContentEditable ? "textbox" : role === "tab" ? "tab" : role === "menuitem" ? "menuitem" : role === "option" ? "option" : tag === "a" || role === "link" ? "link" : tag === "button" || role === "button" || tag === "input" && ["button", "submit", "reset"].includes(type) ? "button" : undefined;
|
|
749
|
+
if (!kind) {
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
const label = labelOf(element) || (kind === "textbox" ? element.getAttribute("placeholder") || "" : "");
|
|
753
|
+
if (!label) {
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
const control = { kind, label };
|
|
757
|
+
if (kind === "switch" || kind === "checkbox") {
|
|
758
|
+
const aria = element.getAttribute("aria-checked");
|
|
759
|
+
control.checked = aria !== null ? aria === "true" : element.checked === true;
|
|
760
|
+
} else if (kind === "textbox") {
|
|
761
|
+
control.value = element.isContentEditable ? element.textContent ?? "" : element.value ?? "";
|
|
762
|
+
} else if (kind === "select") {
|
|
763
|
+
const select = element;
|
|
764
|
+
control.value = select.selectedOptions[0]?.textContent?.trim() ?? select.value;
|
|
765
|
+
}
|
|
766
|
+
if (element.matches(".ta-danger, .ta-danger *, [data-danger]") || /\bdanger\b/.test(element.className)) {
|
|
767
|
+
control.danger = true;
|
|
768
|
+
}
|
|
769
|
+
return control;
|
|
770
|
+
}
|
|
771
|
+
function labelOf(element) {
|
|
772
|
+
const aria = element.getAttribute("aria-label");
|
|
773
|
+
if (aria?.trim()) {
|
|
774
|
+
return clean(aria);
|
|
775
|
+
}
|
|
776
|
+
const by = element.getAttribute("aria-labelledby");
|
|
777
|
+
if (by) {
|
|
778
|
+
const text = by.split(/\s+/).map((id2) => element.ownerDocument.getElementById(id2)?.textContent ?? "").join(" ");
|
|
779
|
+
if (text.trim()) {
|
|
780
|
+
return clean(text);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
const id = element.getAttribute("id");
|
|
784
|
+
const forLabel = id ? element.ownerDocument.querySelector(`label[for="${CSS.escape(id)}"]`) : null;
|
|
785
|
+
const label = forLabel ?? element.closest("label");
|
|
786
|
+
if (label && label !== element && label.textContent?.trim()) {
|
|
787
|
+
return clean(label.textContent);
|
|
788
|
+
}
|
|
789
|
+
const tag = element.tagName.toLowerCase();
|
|
790
|
+
if (tag !== "input" && tag !== "textarea" && tag !== "select") {
|
|
791
|
+
const words2 = clean(element.textContent ?? "");
|
|
792
|
+
if (words2) {
|
|
793
|
+
return words2;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
const row = element.closest(".ta-setting-row, .ta-list-row, [data-setting]");
|
|
797
|
+
const rowLabel = row?.querySelector(".ta-setting-label, .ta-list-label, label");
|
|
798
|
+
if (rowLabel?.textContent?.trim()) {
|
|
799
|
+
return clean(rowLabel.textContent);
|
|
800
|
+
}
|
|
801
|
+
return clean(element.getAttribute("title") ?? element.querySelector("img")?.getAttribute("alt") ?? "");
|
|
802
|
+
}
|
|
803
|
+
ScreenDom.labelOf = labelOf;
|
|
804
|
+
function headingOf(element) {
|
|
805
|
+
return clean(element.querySelector("h1, h2, h3, [role=heading], .ta-dialog-title")?.textContent ?? "");
|
|
806
|
+
}
|
|
807
|
+
function clean(text) {
|
|
808
|
+
const one = text.replace(/\s+/g, " ").trim();
|
|
809
|
+
return one.length > 80 ? `${one.slice(0, 79)}…` : one;
|
|
810
|
+
}
|
|
811
|
+
})(ScreenDom ||= {});
|
|
812
|
+
|
|
813
|
+
// web-src/screen-protocol.ts
|
|
814
|
+
var LOOK_MAX = 3000;
|
|
815
|
+
var CONTROLS_MAX = 50;
|
|
816
|
+
|
|
817
|
+
// web-src/screen-text.ts
|
|
818
|
+
var ScreenText;
|
|
819
|
+
((ScreenText) => {
|
|
820
|
+
const cut = (text, length) => text.length > length ? `${text.slice(0, length - 1)}…` : text;
|
|
821
|
+
function look(sight, only) {
|
|
822
|
+
const targets = new Map;
|
|
823
|
+
const lines = [];
|
|
824
|
+
if (!only) {
|
|
825
|
+
lines.push(`${sight.whose === "user" ? "The user's screen" : "Ta's screen"} (${sight.device}): ${sight.where || "starting"}`);
|
|
826
|
+
if (sight.places.length) {
|
|
827
|
+
lines.push(`Places (app_go to): ${sight.places.map((place) => `${place.id} “${place.title}”`).join(" · ")} · chat:<name> a conversation`);
|
|
828
|
+
}
|
|
829
|
+
if (sight.headings.length) {
|
|
830
|
+
lines.push(`Headings: ${sight.headings.map((heading) => cut(heading, 60)).join(" · ")}`);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
sight.parts.forEach((part, index) => {
|
|
834
|
+
const id = `p${index + 1}`;
|
|
835
|
+
targets.set(id, { part: part.id });
|
|
836
|
+
if (only && only !== part.id && only !== id) {
|
|
837
|
+
return;
|
|
838
|
+
}
|
|
839
|
+
lines.push("", `[${id}] ${part.title}${part.state ? ` — ${part.state}` : ""}`);
|
|
840
|
+
part.items.forEach((item, itemIndex) => {
|
|
841
|
+
const itemId = `${id}.${itemIndex + 1}`;
|
|
842
|
+
targets.set(itemId, { part: part.id, item: item.id });
|
|
843
|
+
lines.push(` [${itemId}] ${cut(item.text, 200)}${item.marks?.length ? ` · ${item.marks.map((mark) => cut(mark, 80)).join(" · ")}` : ""}`);
|
|
844
|
+
});
|
|
845
|
+
if (part.actions.length) {
|
|
846
|
+
const actions = part.actions.map((action) => `${action.name}${action.label.toLowerCase() !== action.name ? ` “${action.label}”` : ""}${action.each ? " [a row]" : ""}${action.takes ? ` (${action.takes})` : ""}${action.command ? ` = app_run ${action.command}` : ""}${action.danger ? " !danger" : ""}`);
|
|
847
|
+
lines.push(` does: ${actions.join(" · ")}`);
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
const controls = sight.controls.slice(0, CONTROLS_MAX);
|
|
851
|
+
controls.forEach((_control, index) => {
|
|
852
|
+
targets.set(`e${index + 1}`, { control: index });
|
|
853
|
+
});
|
|
854
|
+
if (!only && controls.length) {
|
|
855
|
+
lines.push("", "Also on the screen:");
|
|
856
|
+
let dialog;
|
|
857
|
+
controls.forEach((control, index) => {
|
|
858
|
+
if (control.dialog !== dialog) {
|
|
859
|
+
dialog = control.dialog;
|
|
860
|
+
if (dialog !== undefined) {
|
|
861
|
+
lines.push(` Dialog “${cut(dialog, 80)}”:`);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
const state = control.checked !== undefined ? control.checked ? " on" : " off" : control.value !== undefined ? ` = “${cut(control.value, 80)}”` : "";
|
|
865
|
+
lines.push(` ${control.dialog !== undefined ? " " : ""}[e${index + 1}] ${control.kind} “${cut(control.label, 80)}”${state}${control.danger ? " !danger" : ""}`);
|
|
866
|
+
});
|
|
867
|
+
if (sight.controls.length > controls.length) {
|
|
868
|
+
lines.push(` … ${sight.controls.length - controls.length} more: look at a part, or go elsewhere.`);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
const all = lines.join(`
|
|
872
|
+
`).trim();
|
|
873
|
+
return { text: all.length > LOOK_MAX ? `${all.slice(0, LOOK_MAX - 40)}
|
|
874
|
+
… (more: app_look a part)` : all, targets };
|
|
875
|
+
}
|
|
876
|
+
ScreenText.look = look;
|
|
877
|
+
})(ScreenText ||= {});
|
|
878
|
+
|
|
879
|
+
// web-src/screen-driver.ts
|
|
880
|
+
var wait2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
881
|
+
|
|
882
|
+
class ScreenDriver {
|
|
883
|
+
window;
|
|
884
|
+
host;
|
|
885
|
+
targets = new Map;
|
|
886
|
+
elements = [];
|
|
887
|
+
cursor;
|
|
888
|
+
constructor(window2, host) {
|
|
889
|
+
this.window = window2;
|
|
890
|
+
this.host = host;
|
|
891
|
+
this.cursor = new ScreenCursor(window2.document);
|
|
892
|
+
}
|
|
893
|
+
async ready(timeoutMs = 20000) {
|
|
894
|
+
const until = Date.now() + timeoutMs;
|
|
895
|
+
while (!this.host.screen.where() && Date.now() < until) {
|
|
896
|
+
await wait2(150);
|
|
897
|
+
}
|
|
898
|
+
await wait2(200);
|
|
899
|
+
}
|
|
900
|
+
look(part) {
|
|
901
|
+
const { controls, elements } = ScreenDom.controls(this.window.document);
|
|
902
|
+
const sight = {
|
|
903
|
+
whose: this.host.user ? "user" : "ta",
|
|
904
|
+
device: this.host.device(),
|
|
905
|
+
where: this.host.screen.where(),
|
|
906
|
+
places: this.host.screen.places(),
|
|
907
|
+
parts: this.host.screen.parts(),
|
|
908
|
+
controls,
|
|
909
|
+
headings: ScreenDom.headings(this.window.document)
|
|
910
|
+
};
|
|
911
|
+
const { text, targets } = ScreenText.look(sight, part);
|
|
912
|
+
this.targets = targets;
|
|
913
|
+
this.elements = elements;
|
|
914
|
+
return text;
|
|
915
|
+
}
|
|
916
|
+
async go(to) {
|
|
917
|
+
const word = to.trim().toLowerCase();
|
|
918
|
+
const place = this.host.screen.places().find((one) => one.id.toLowerCase() === word || one.title.toLowerCase() === word);
|
|
919
|
+
const button = place && this.window.document.querySelector(`[data-ta-place="${CSS.escape(place.id)}"]`);
|
|
920
|
+
if (button && ScreenDom.visible(button) && this.host.watched()) {
|
|
921
|
+
await this.cursor.point(button, place.title);
|
|
922
|
+
await this.cursor.press();
|
|
923
|
+
}
|
|
924
|
+
if (!await this.host.screen.go(to)) {
|
|
925
|
+
throw new Error(`There is no place ${JSON.stringify(to)}: see the places of app_look.`);
|
|
926
|
+
}
|
|
927
|
+
await wait2(450);
|
|
928
|
+
this.cursor.rest();
|
|
929
|
+
return this.look();
|
|
930
|
+
}
|
|
931
|
+
async do(id, action, input = {}, options = {}) {
|
|
932
|
+
if (!this.targets.size) {
|
|
933
|
+
this.look();
|
|
934
|
+
}
|
|
935
|
+
const target = this.targets.get(id.replace(/^\[|\]$/g, ""));
|
|
936
|
+
if (!target) {
|
|
937
|
+
throw new Error(`Nothing on the screen is [${id}] now: app_look again.`);
|
|
938
|
+
}
|
|
939
|
+
const answer = "part" in target ? await this.part(target, action, input, options) : await this.control(target.control, action, input, options);
|
|
940
|
+
this.cursor.rest();
|
|
941
|
+
return answer;
|
|
942
|
+
}
|
|
943
|
+
dispose() {
|
|
944
|
+
this.cursor.dispose();
|
|
945
|
+
}
|
|
946
|
+
async part(target, name, input, options) {
|
|
947
|
+
const part = this.host.screen.parts().find((one) => one.id === target.part);
|
|
948
|
+
const action = part?.actions.find((one) => one.name === name) ?? (target.item ? part?.actions.find((one) => one.name === "open") : undefined);
|
|
949
|
+
if (!part || !action) {
|
|
950
|
+
throw new Error(part ? `Say what to do to it: ${part.actions.map((one) => one.name).join(", ")}.` : "That part is gone: app_look again.");
|
|
951
|
+
}
|
|
952
|
+
const item = target.item ? part.items.find((one) => one.id === target.item) : undefined;
|
|
953
|
+
const says = `${action.label}${item ? ` “${item.text.slice(0, 30)}”` : ""}`;
|
|
954
|
+
if (action.danger && !await this.agree(says, options)) {
|
|
955
|
+
return { text: "The user did not agree: it was not done." };
|
|
956
|
+
}
|
|
957
|
+
const show = options.show === true || !action.command;
|
|
958
|
+
if (show && this.host.watched()) {
|
|
959
|
+
const element = this.host.screen.element(target.part, target.item, action.name);
|
|
960
|
+
if (element) {
|
|
961
|
+
await this.cursor.point(element, says);
|
|
962
|
+
await this.cursor.press();
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
const done = await this.host.screen.act(target.part, action.name, target.item, input, show);
|
|
966
|
+
if ("command" in done) {
|
|
967
|
+
return { text: says, command: done.command, input: done.input };
|
|
968
|
+
}
|
|
969
|
+
await wait2(350);
|
|
970
|
+
return { text: `${done.text ?? "Done."}
|
|
971
|
+
|
|
972
|
+
${this.look(target.part)}` };
|
|
973
|
+
}
|
|
974
|
+
async control(index, action, input, options) {
|
|
975
|
+
const element = this.elements[index];
|
|
976
|
+
if (!element?.isConnected || !ScreenDom.visible(element)) {
|
|
977
|
+
throw new Error("It is not on the screen any more: app_look again.");
|
|
978
|
+
}
|
|
979
|
+
const label = ScreenDom.labelOf(element);
|
|
980
|
+
const text = typeof input.text === "string" ? input.text : typeof input.value === "string" ? input.value : undefined;
|
|
981
|
+
const typing = element.matches('input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]), textarea, [contenteditable="true"], [role=textbox]');
|
|
982
|
+
const choosing = element.tagName.toLowerCase() === "select";
|
|
983
|
+
if ((typing || choosing) && text === undefined) {
|
|
984
|
+
throw new Error(`Say what to ${choosing ? "choose" : "type"}: input.text.`);
|
|
985
|
+
}
|
|
986
|
+
const danger = element.matches(".ta-danger, .ta-danger *, [data-danger]") || /\bdanger\b/.test(element.className);
|
|
987
|
+
if (danger && !await this.agree(label, options)) {
|
|
988
|
+
return { text: "The user did not agree: it was not done." };
|
|
989
|
+
}
|
|
990
|
+
const watched = this.host.watched();
|
|
991
|
+
if (watched) {
|
|
992
|
+
await this.cursor.point(element, typing ? label : choosing ? `${label}: ${text}` : label);
|
|
993
|
+
await this.cursor.press();
|
|
994
|
+
}
|
|
995
|
+
if (typing) {
|
|
996
|
+
const set = (value) => this.setValue(element, value);
|
|
997
|
+
if (watched) {
|
|
998
|
+
await this.cursor.type(text ?? "", set);
|
|
999
|
+
} else {
|
|
1000
|
+
set(text ?? "");
|
|
1001
|
+
}
|
|
1002
|
+
if (input.submit === true || action === "submit") {
|
|
1003
|
+
for (const type of ["keydown", "keyup"]) {
|
|
1004
|
+
element.dispatchEvent(new KeyboardEvent(type, { key: "Enter", code: "Enter", bubbles: true, cancelable: true }));
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
} else if (choosing) {
|
|
1008
|
+
const select = element;
|
|
1009
|
+
const option = [...select.options].find((one) => one.value === text || one.textContent?.trim() === text);
|
|
1010
|
+
if (!option) {
|
|
1011
|
+
throw new Error(`It has no choice ${JSON.stringify(text)}: ${[...select.options].map((one) => one.textContent?.trim()).join(", ")}.`);
|
|
1012
|
+
}
|
|
1013
|
+
this.setValue(element, option.value);
|
|
1014
|
+
} else {
|
|
1015
|
+
element.click();
|
|
1016
|
+
}
|
|
1017
|
+
await wait2(380);
|
|
1018
|
+
return { text: `Done.
|
|
1019
|
+
|
|
1020
|
+
${this.look()}` };
|
|
1021
|
+
}
|
|
1022
|
+
async agree(what, options) {
|
|
1023
|
+
return options.confirm ? options.confirm(what) : false;
|
|
1024
|
+
}
|
|
1025
|
+
setValue(element, value) {
|
|
1026
|
+
const window2 = this.window;
|
|
1027
|
+
if (element.isContentEditable) {
|
|
1028
|
+
element.textContent = value;
|
|
1029
|
+
element.dispatchEvent(new window2.InputEvent("input", { bubbles: true }));
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
const proto = element instanceof window2.HTMLTextAreaElement ? window2.HTMLTextAreaElement.prototype : element instanceof window2.HTMLSelectElement ? window2.HTMLSelectElement.prototype : window2.HTMLInputElement.prototype;
|
|
1033
|
+
Object.getOwnPropertyDescriptor(proto, "value")?.set?.call(element, value);
|
|
1034
|
+
element.dispatchEvent(new window2.Event(element instanceof window2.HTMLSelectElement ? "change" : "input", { bubbles: true }));
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
// web-src/screen-window.ts
|
|
1039
|
+
var SCREEN_IDLE_MS = 2 * 60000;
|
|
1040
|
+
var STYLE2 = `
|
|
1041
|
+
.ta-screen-box { position: fixed; z-index: 2147483000; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; border: 1px solid var(--ta-border, rgba(0,0,0,.12)); background: var(--ta-side, #fff); color: var(--ta-text, #111); box-shadow: var(--ta-shadow-pop, 0 12px 32px rgba(0,0,0,.18)); font: 13px/1.4 var(--ta-sans, system-ui, sans-serif); transition: transform 260ms cubic-bezier(.2,.8,.2,1), opacity 200ms; }
|
|
1042
|
+
.ta-screen-box[data-hidden] { transform: translate3d(0, 24px, 0); opacity: 0; pointer-events: none; }
|
|
1043
|
+
.ta-screen-box[data-away] { left: -300vw !important; top: 0 !important; transition: none; }
|
|
1044
|
+
.ta-screen-head { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px; border-bottom: 1px solid var(--ta-border-muted, rgba(0,0,0,.08)); cursor: grab; user-select: none; touch-action: none; }
|
|
1045
|
+
.ta-screen-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ta-muted, #aaa); flex: none; }
|
|
1046
|
+
.ta-screen-box[data-busy] .ta-screen-dot, .ta-screen-pill .ta-screen-dot { background: var(--ta-accent, #07c160); animation: ta-screen-pulse 1.2s ease-in-out infinite; }
|
|
1047
|
+
@keyframes ta-screen-pulse { 50% { opacity: .35; } }
|
|
1048
|
+
.ta-screen-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
1049
|
+
.ta-screen-title small { margin-left: 6px; font-weight: 400; color: var(--ta-secondary, #666); }
|
|
1050
|
+
.ta-screen-button { flex: none; white-space: nowrap; height: 26px; padding: 0 9px; border: none; border-radius: 7px; background: transparent; color: var(--ta-secondary, #555); font: inherit; font-size: 12px; cursor: pointer; }
|
|
1051
|
+
.ta-screen-button:hover { background: var(--ta-hover, rgba(0,0,0,.06)); color: var(--ta-text, #111); }
|
|
1052
|
+
.ta-screen-button.ta-screen-stop { color: var(--ta-red, #e5484d); }
|
|
1053
|
+
.ta-screen-view { position: relative; flex: 1; overflow: hidden; background: var(--ta-body, #f2f2f2); }
|
|
1054
|
+
.ta-screen-view iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: var(--ta-main, #fff); }
|
|
1055
|
+
.ta-screen-pill { position: fixed; z-index: 2147483001; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 60px); transform: translate3d(-50%, 0, 0); display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px 0 12px; border-radius: 17px; background: var(--ta-side, #fff); color: var(--ta-text, #111); border: 1px solid var(--ta-border, rgba(0,0,0,.12)); box-shadow: var(--ta-shadow-pop, 0 8px 24px rgba(0,0,0,.16)); font: 13px/1 var(--ta-sans, system-ui, sans-serif); transition: opacity 200ms, transform 260ms cubic-bezier(.2,.8,.2,1); }
|
|
1056
|
+
.ta-screen-pill[data-hidden] { opacity: 0; transform: translate3d(-50%, -12px, 0); pointer-events: none; }
|
|
1057
|
+
.ta-screen-pill span { margin: 0 4px 0 2px; font-weight: 600; white-space: nowrap; }
|
|
1058
|
+
@media (prefers-reduced-motion: reduce) { .ta-screen-box, .ta-screen-pill { transition: none; } .ta-screen-dot { animation: none !important; } }
|
|
1059
|
+
`;
|
|
1060
|
+
var wait3 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
1061
|
+
|
|
1062
|
+
class ScreenWindow {
|
|
1063
|
+
pi;
|
|
1064
|
+
words;
|
|
1065
|
+
box;
|
|
1066
|
+
frame;
|
|
1067
|
+
pill;
|
|
1068
|
+
title;
|
|
1069
|
+
sizeButton;
|
|
1070
|
+
size = { width: 1280, height: 800 };
|
|
1071
|
+
big = false;
|
|
1072
|
+
awayFor;
|
|
1073
|
+
shownOnPhone = false;
|
|
1074
|
+
busy = 0;
|
|
1075
|
+
from;
|
|
1076
|
+
idleTimer;
|
|
1077
|
+
restTimer;
|
|
1078
|
+
own;
|
|
1079
|
+
position;
|
|
1080
|
+
constructor(pi, words2) {
|
|
1081
|
+
this.pi = pi;
|
|
1082
|
+
this.words = words2;
|
|
1083
|
+
}
|
|
1084
|
+
async run(ask) {
|
|
1085
|
+
if (ask.here) {
|
|
1086
|
+
return this.runHere(ask);
|
|
1087
|
+
}
|
|
1088
|
+
clearTimeout(this.idleTimer);
|
|
1089
|
+
this.begin(ask.from);
|
|
1090
|
+
const outer = document.activeElement;
|
|
1091
|
+
try {
|
|
1092
|
+
const driver = await this.driver();
|
|
1093
|
+
if (ask.kind === "look") {
|
|
1094
|
+
return { text: driver.look(ask.part) };
|
|
1095
|
+
}
|
|
1096
|
+
if (ask.kind === "go") {
|
|
1097
|
+
return { text: await driver.go(String(ask.to ?? "")) };
|
|
1098
|
+
}
|
|
1099
|
+
return await driver.do(String(ask.id ?? ""), ask.action, ask.input, { show: ask.show === true, confirm: (what) => this.confirm(what, ask) });
|
|
1100
|
+
} finally {
|
|
1101
|
+
if (document.activeElement === this.frame && outer instanceof HTMLElement) {
|
|
1102
|
+
outer.focus({ preventScroll: true });
|
|
1103
|
+
}
|
|
1104
|
+
this.end();
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
dispose() {
|
|
1108
|
+
this.close();
|
|
1109
|
+
this.own?.dispose();
|
|
1110
|
+
}
|
|
1111
|
+
async runHere(ask) {
|
|
1112
|
+
const screen = this.pi.ui.screen;
|
|
1113
|
+
this.own ??= new ScreenDriver(window, { screen, watched: () => document.visibilityState === "visible", device: () => this.device(), user: true });
|
|
1114
|
+
if (ask.kind === "look") {
|
|
1115
|
+
return { text: this.own.look(ask.part) };
|
|
1116
|
+
}
|
|
1117
|
+
if (ask.kind === "go") {
|
|
1118
|
+
return { text: await this.own.go(String(ask.to ?? "")) };
|
|
1119
|
+
}
|
|
1120
|
+
return this.own.do(String(ask.id ?? ""), ask.action, ask.input, { show: true, confirm: (what) => this.confirm(what, ask) });
|
|
1121
|
+
}
|
|
1122
|
+
confirm(what, ask) {
|
|
1123
|
+
return this.pi.ui.confirm(`${ask.from?.name ?? "Ta"}: ${what}`, undefined, { danger: true });
|
|
1124
|
+
}
|
|
1125
|
+
device() {
|
|
1126
|
+
return window.innerWidth < 640 ? "phone" : "computer";
|
|
1127
|
+
}
|
|
1128
|
+
async driver() {
|
|
1129
|
+
if (!this.frame?.isConnected) {
|
|
1130
|
+
this.open();
|
|
1131
|
+
}
|
|
1132
|
+
const frame = this.frame;
|
|
1133
|
+
const until = Date.now() + 25000;
|
|
1134
|
+
const found = () => frame.contentWindow?.taScreen;
|
|
1135
|
+
while (!found() && Date.now() < until) {
|
|
1136
|
+
await wait3(150);
|
|
1137
|
+
}
|
|
1138
|
+
const driver = found();
|
|
1139
|
+
if (!driver) {
|
|
1140
|
+
this.close();
|
|
1141
|
+
throw new Error("Ta's screen did not open in time: try again, or do it with app_run.");
|
|
1142
|
+
}
|
|
1143
|
+
frame.contentWindow.taScreenWatched = () => this.watched();
|
|
1144
|
+
await driver.ready();
|
|
1145
|
+
return driver;
|
|
1146
|
+
}
|
|
1147
|
+
watched() {
|
|
1148
|
+
return !!this.box && !this.box.hasAttribute("data-hidden") && !this.box.hasAttribute("data-away") && document.visibilityState === "visible";
|
|
1149
|
+
}
|
|
1150
|
+
open() {
|
|
1151
|
+
this.style();
|
|
1152
|
+
const phone = this.device() === "phone";
|
|
1153
|
+
this.size = phone ? { width: window.innerWidth, height: window.innerHeight } : { width: Math.min(1440, Math.max(1024, window.innerWidth)), height: Math.min(900, Math.max(680, window.innerHeight)) };
|
|
1154
|
+
const box = document.createElement("div");
|
|
1155
|
+
box.className = "ta-screen-box";
|
|
1156
|
+
box.setAttribute("role", "region");
|
|
1157
|
+
box.dataset.hidden = "";
|
|
1158
|
+
const head = document.createElement("div");
|
|
1159
|
+
head.className = "ta-screen-head";
|
|
1160
|
+
const dot = document.createElement("span");
|
|
1161
|
+
dot.className = "ta-screen-dot";
|
|
1162
|
+
const title = document.createElement("div");
|
|
1163
|
+
title.className = "ta-screen-title";
|
|
1164
|
+
const sizeButton = this.button(this.words().bigger, () => this.resize(!this.big));
|
|
1165
|
+
const stop = this.button(this.words().stop, () => this.stop());
|
|
1166
|
+
stop.classList.add("ta-screen-stop");
|
|
1167
|
+
const hide = this.button(this.words().hide, () => this.putAway());
|
|
1168
|
+
head.append(dot, title, ...phone ? [] : [sizeButton], stop, hide);
|
|
1169
|
+
const view = document.createElement("div");
|
|
1170
|
+
view.className = "ta-screen-view";
|
|
1171
|
+
const frame = document.createElement("iframe");
|
|
1172
|
+
frame.title = this.words().screen;
|
|
1173
|
+
frame.tabIndex = -1;
|
|
1174
|
+
frame.setAttribute("aria-hidden", "true");
|
|
1175
|
+
frame.src = `${location.pathname}?ta-screen`;
|
|
1176
|
+
Object.assign(frame.style, { width: `${this.size.width}px`, height: `${this.size.height}px` });
|
|
1177
|
+
view.appendChild(frame);
|
|
1178
|
+
box.append(head, view);
|
|
1179
|
+
box.setAttribute("aria-label", this.words().screen);
|
|
1180
|
+
this.drag(head, box);
|
|
1181
|
+
document.body.appendChild(box);
|
|
1182
|
+
Object.assign(this, { box, frame, title, sizeButton });
|
|
1183
|
+
this.layout();
|
|
1184
|
+
this.away(true);
|
|
1185
|
+
}
|
|
1186
|
+
button(label, run) {
|
|
1187
|
+
const button = document.createElement("button");
|
|
1188
|
+
button.type = "button";
|
|
1189
|
+
button.className = "ta-screen-button";
|
|
1190
|
+
button.textContent = label;
|
|
1191
|
+
button.addEventListener("click", (event) => {
|
|
1192
|
+
event.stopPropagation();
|
|
1193
|
+
run();
|
|
1194
|
+
});
|
|
1195
|
+
button.addEventListener("pointerdown", (event) => event.stopPropagation());
|
|
1196
|
+
return button;
|
|
1197
|
+
}
|
|
1198
|
+
layout() {
|
|
1199
|
+
const box = this.box;
|
|
1200
|
+
const frame = this.frame;
|
|
1201
|
+
if (!box || !frame) {
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
if (this.device() === "phone") {
|
|
1205
|
+
const height = Math.round(window.innerHeight * 0.74);
|
|
1206
|
+
const scale2 = Math.min(1, (height - 36) / this.size.height, window.innerWidth / this.size.width);
|
|
1207
|
+
Object.assign(box.style, {
|
|
1208
|
+
left: "0px",
|
|
1209
|
+
right: "0px",
|
|
1210
|
+
bottom: "0px",
|
|
1211
|
+
top: "auto",
|
|
1212
|
+
width: "auto",
|
|
1213
|
+
height: `${height}px`,
|
|
1214
|
+
borderRadius: "16px 16px 0 0"
|
|
1215
|
+
});
|
|
1216
|
+
Object.assign(frame.style, { transform: `scale(${scale2})`, left: `${Math.max(0, (window.innerWidth - this.size.width * scale2) / 2)}px` });
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1219
|
+
const width = this.big ? Math.min(720, window.innerWidth - 48) : 340;
|
|
1220
|
+
const scale = width / this.size.width;
|
|
1221
|
+
const position = this.position ?? { right: 20, bottom: 20 };
|
|
1222
|
+
Object.assign(box.style, {
|
|
1223
|
+
width: `${width}px`,
|
|
1224
|
+
height: `${Math.round(this.size.height * scale) + 37}px`,
|
|
1225
|
+
right: `${position.right}px`,
|
|
1226
|
+
bottom: `${position.bottom}px`,
|
|
1227
|
+
left: "auto",
|
|
1228
|
+
top: "auto"
|
|
1229
|
+
});
|
|
1230
|
+
frame.style.transform = `scale(${scale})`;
|
|
1231
|
+
}
|
|
1232
|
+
resize(big) {
|
|
1233
|
+
this.big = big;
|
|
1234
|
+
if (this.sizeButton) {
|
|
1235
|
+
this.sizeButton.textContent = big ? this.words().smaller : this.words().bigger;
|
|
1236
|
+
}
|
|
1237
|
+
this.layout();
|
|
1238
|
+
}
|
|
1239
|
+
drag(head, box) {
|
|
1240
|
+
head.addEventListener("pointerdown", (event) => {
|
|
1241
|
+
if (this.device() === "phone") {
|
|
1242
|
+
return;
|
|
1243
|
+
}
|
|
1244
|
+
const start = { x: event.clientX, y: event.clientY, ...this.position ?? { right: 20, bottom: 20 } };
|
|
1245
|
+
head.setPointerCapture(event.pointerId);
|
|
1246
|
+
const move = (moved) => {
|
|
1247
|
+
const right = Math.min(window.innerWidth - 80, Math.max(0, start.right - (moved.clientX - start.x)));
|
|
1248
|
+
const bottom = Math.min(window.innerHeight - 40, Math.max(0, start.bottom - (moved.clientY - start.y)));
|
|
1249
|
+
this.position = { right, bottom };
|
|
1250
|
+
Object.assign(box.style, { right: `${right}px`, bottom: `${bottom}px` });
|
|
1251
|
+
};
|
|
1252
|
+
const up = () => {
|
|
1253
|
+
head.removeEventListener("pointermove", move);
|
|
1254
|
+
head.removeEventListener("pointerup", up);
|
|
1255
|
+
};
|
|
1256
|
+
head.addEventListener("pointermove", move);
|
|
1257
|
+
head.addEventListener("pointerup", up);
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
away(away) {
|
|
1261
|
+
if (!this.box) {
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
if (away) {
|
|
1265
|
+
this.box.dataset.hidden = "";
|
|
1266
|
+
setTimeout(() => this.box?.hasAttribute("data-hidden") && this.box.setAttribute("data-away", ""), 240);
|
|
1267
|
+
} else {
|
|
1268
|
+
this.box.removeAttribute("data-away");
|
|
1269
|
+
this.layout();
|
|
1270
|
+
this.box.getBoundingClientRect();
|
|
1271
|
+
this.box.removeAttribute("data-hidden");
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
begin(from) {
|
|
1275
|
+
clearTimeout(this.restTimer);
|
|
1276
|
+
this.busy++;
|
|
1277
|
+
if (from?.sessionId !== this.from?.sessionId) {
|
|
1278
|
+
this.awayFor = undefined;
|
|
1279
|
+
}
|
|
1280
|
+
this.from = from;
|
|
1281
|
+
if (!this.frame?.isConnected) {
|
|
1282
|
+
this.open();
|
|
1283
|
+
}
|
|
1284
|
+
this.box?.setAttribute("data-busy", "");
|
|
1285
|
+
this.heading();
|
|
1286
|
+
if (this.device() === "phone") {
|
|
1287
|
+
this.showPill(true);
|
|
1288
|
+
} else if (this.awayFor !== (from?.sessionId ?? "")) {
|
|
1289
|
+
this.away(false);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
end() {
|
|
1293
|
+
this.busy = Math.max(0, this.busy - 1);
|
|
1294
|
+
clearTimeout(this.restTimer);
|
|
1295
|
+
this.restTimer = setTimeout(() => {
|
|
1296
|
+
if (this.busy === 0) {
|
|
1297
|
+
this.box?.removeAttribute("data-busy");
|
|
1298
|
+
this.heading();
|
|
1299
|
+
this.showPill(false);
|
|
1300
|
+
}
|
|
1301
|
+
}, 4000);
|
|
1302
|
+
clearTimeout(this.idleTimer);
|
|
1303
|
+
this.idleTimer = setTimeout(() => this.busy === 0 && this.close(), SCREEN_IDLE_MS);
|
|
1304
|
+
}
|
|
1305
|
+
heading() {
|
|
1306
|
+
if (!this.title) {
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
const busy = this.busy > 0 || this.box?.hasAttribute("data-busy");
|
|
1310
|
+
this.title.textContent = busy ? this.words().operating : this.words().screen;
|
|
1311
|
+
if (busy && this.from?.name) {
|
|
1312
|
+
const small = document.createElement("small");
|
|
1313
|
+
small.textContent = this.from.name;
|
|
1314
|
+
this.title.appendChild(small);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
putAway() {
|
|
1318
|
+
this.awayFor = this.from?.sessionId ?? "";
|
|
1319
|
+
this.shownOnPhone = false;
|
|
1320
|
+
this.away(true);
|
|
1321
|
+
if (this.device() === "phone" && this.busy > 0) {
|
|
1322
|
+
this.showPill(true);
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
showPill(show) {
|
|
1326
|
+
if (show && !this.pill) {
|
|
1327
|
+
const pill = document.createElement("div");
|
|
1328
|
+
pill.className = "ta-screen-pill";
|
|
1329
|
+
pill.dataset.hidden = "";
|
|
1330
|
+
const dot = document.createElement("span");
|
|
1331
|
+
dot.className = "ta-screen-dot";
|
|
1332
|
+
const words2 = document.createElement("span");
|
|
1333
|
+
words2.textContent = this.words().operating;
|
|
1334
|
+
const watch = this.button(this.words().watch, () => {
|
|
1335
|
+
this.shownOnPhone = true;
|
|
1336
|
+
this.showPill(false);
|
|
1337
|
+
this.away(false);
|
|
1338
|
+
});
|
|
1339
|
+
const stop = this.button(this.words().stop, () => this.stop());
|
|
1340
|
+
stop.classList.add("ta-screen-stop");
|
|
1341
|
+
pill.append(dot, words2, watch, stop);
|
|
1342
|
+
document.body.appendChild(pill);
|
|
1343
|
+
this.pill = pill;
|
|
1344
|
+
}
|
|
1345
|
+
if (!this.pill) {
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
if (show && !this.shownOnPhone) {
|
|
1349
|
+
this.pill.getBoundingClientRect();
|
|
1350
|
+
this.pill.removeAttribute("data-hidden");
|
|
1351
|
+
} else {
|
|
1352
|
+
this.pill.dataset.hidden = "";
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
stop() {
|
|
1356
|
+
const sessionId = this.from?.sessionId;
|
|
1357
|
+
if (sessionId) {
|
|
1358
|
+
this.pi.server.abort(sessionId).catch(() => {
|
|
1359
|
+
return;
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
this.busy = 0;
|
|
1363
|
+
this.box?.removeAttribute("data-busy");
|
|
1364
|
+
this.heading();
|
|
1365
|
+
this.putAway();
|
|
1366
|
+
this.showPill(false);
|
|
1367
|
+
}
|
|
1368
|
+
close() {
|
|
1369
|
+
clearTimeout(this.idleTimer);
|
|
1370
|
+
clearTimeout(this.restTimer);
|
|
1371
|
+
this.box?.remove();
|
|
1372
|
+
this.pill?.remove();
|
|
1373
|
+
this.box = undefined;
|
|
1374
|
+
this.frame = undefined;
|
|
1375
|
+
this.pill = undefined;
|
|
1376
|
+
this.busy = 0;
|
|
1377
|
+
this.shownOnPhone = false;
|
|
1378
|
+
}
|
|
1379
|
+
style() {
|
|
1380
|
+
if (!document.getElementById("ta-screen-style")) {
|
|
1381
|
+
const style = document.createElement("style");
|
|
1382
|
+
style.id = "ta-screen-style";
|
|
1383
|
+
style.textContent = STYLE2;
|
|
1384
|
+
document.head.appendChild(style);
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// web-src/tool-line.ts
|
|
1390
|
+
function text(value) {
|
|
1391
|
+
return typeof value === "string" ? value.trim() : "";
|
|
1392
|
+
}
|
|
1393
|
+
var AppToolLine;
|
|
1394
|
+
((AppToolLine) => {
|
|
1395
|
+
function of(tool, args, words2, language) {
|
|
1396
|
+
if (tool === "app_commands") {
|
|
1397
|
+
return { verb: words2.commands, target: text(args.query) };
|
|
1398
|
+
}
|
|
1399
|
+
if (tool === "app_look") {
|
|
1400
|
+
return { verb: words2.look, target: "" };
|
|
1401
|
+
}
|
|
1402
|
+
if (tool === "app_go") {
|
|
1403
|
+
const to = text(args.to);
|
|
1404
|
+
const [kind, rest = ""] = to.split(/:(.*)/s);
|
|
1405
|
+
const target = kind === "settings" ? rest ? `${words2.settings} · ${rest}` : words2.settings : kind === "discover" ? words2.discover : /^(chat|page|list)$/.test(kind) ? rest.replace(/^.*\//, "") : to;
|
|
1406
|
+
return { verb: words2.go, target };
|
|
1407
|
+
}
|
|
1408
|
+
if (tool === "app_do") {
|
|
1409
|
+
const input2 = args.input && typeof args.input === "object" ? args.input : {};
|
|
1410
|
+
return { verb: words2.do, target: text(input2.text).slice(0, 40) };
|
|
1411
|
+
}
|
|
1412
|
+
if (tool !== "app_run") {
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
const command = text(args.command);
|
|
1416
|
+
const input = args.input && typeof args.input === "object" ? args.input : {};
|
|
1417
|
+
switch (command) {
|
|
1418
|
+
case "settings.set": {
|
|
1419
|
+
const changes = input.changes && typeof input.changes === "object" ? Object.keys(input.changes) : [];
|
|
1420
|
+
const names = changes.map((key) => {
|
|
1421
|
+
const spec = TA_WEB_SETTINGS.find((one) => one.key === key);
|
|
1422
|
+
return spec ? TaLanguageUtil.pick(language, spec.title) : key;
|
|
1423
|
+
});
|
|
1424
|
+
return { verb: words2["settings.set"], target: names.join(TaLanguageUtil.cjk(language) ? "、" : ", ") };
|
|
1425
|
+
}
|
|
1426
|
+
case "chats.pin":
|
|
1427
|
+
return { verb: input.pinned === false ? words2.unpin : words2["chats.pin"], target: "" };
|
|
1428
|
+
case "extensions.set":
|
|
1429
|
+
return { verb: input.enabled === false ? words2.off : input.enabled === true ? words2.on : words2["extensions.set"], target: text(input.name) };
|
|
1430
|
+
case "asks.list":
|
|
1431
|
+
case "asks.answer":
|
|
1432
|
+
return { verb: words2[command], target: "" };
|
|
1433
|
+
case "settings.get":
|
|
1434
|
+
case "chats.list":
|
|
1435
|
+
case "chats.stop":
|
|
1436
|
+
case "extensions.list":
|
|
1437
|
+
return { verb: words2[command], target: text(input.query) };
|
|
1438
|
+
default:
|
|
1439
|
+
return { verb: words2.run, target: command };
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
AppToolLine.of = of;
|
|
1443
|
+
})(AppToolLine ||= {});
|
|
1444
|
+
|
|
1445
|
+
// web-src/index.ts
|
|
1446
|
+
function activate(pi) {
|
|
1447
|
+
let since = Number.POSITIVE_INFINITY;
|
|
1448
|
+
let stopped = false;
|
|
1449
|
+
const words2 = () => AppUseWords.of(pi.ui.language);
|
|
1450
|
+
pi.registerToolRenderer?.((name, next) => {
|
|
1451
|
+
if (!TA_APP_TOOLS.includes(name)) {
|
|
1452
|
+
return next();
|
|
1453
|
+
}
|
|
1454
|
+
return { renderCall: (args) => AppToolLine.of(name, args, words2(), pi.ui.language) ?? { verb: name, target: "" } };
|
|
1455
|
+
});
|
|
1456
|
+
if (pi.ui.screen?.agent) {
|
|
1457
|
+
const frame = window;
|
|
1458
|
+
const driver = new ScreenDriver(window, {
|
|
1459
|
+
screen: pi.ui.screen,
|
|
1460
|
+
watched: () => frame.taScreenWatched?.() ?? false,
|
|
1461
|
+
device: () => window.innerWidth < 640 ? "phone" : "computer"
|
|
1462
|
+
});
|
|
1463
|
+
frame.taScreen = driver;
|
|
1464
|
+
return () => {
|
|
1465
|
+
if (frame.taScreen === driver) {
|
|
1466
|
+
frame.taScreen = undefined;
|
|
1467
|
+
}
|
|
1468
|
+
driver.dispose();
|
|
1469
|
+
};
|
|
1470
|
+
}
|
|
1471
|
+
const screens = new ScreenWindow(pi, words2);
|
|
1472
|
+
const stopAnswering = pi.ui.answer?.("screen", (payload) => screens.run(payload));
|
|
1473
|
+
const show = (entry) => {
|
|
1474
|
+
const undo = entry.undo ? {
|
|
1475
|
+
label: words2().undo,
|
|
1476
|
+
run: () => {
|
|
1477
|
+
pi.callHost("undo", entry.id).then(() => entry.command.startsWith("extensions.") ? pi.reloadExtensions() : undefined).catch((error) => pi.ui.notify(error instanceof Error ? error.message : String(error), "error"));
|
|
1478
|
+
}
|
|
1479
|
+
} : undefined;
|
|
1480
|
+
pi.ui.notify(entry.notice, "info", {
|
|
1481
|
+
key: `ta-app-use:${entry.id}`,
|
|
1482
|
+
ta: true,
|
|
1483
|
+
...entry.changes ? { changes: entry.changes } : {},
|
|
1484
|
+
...undo ? { action: undo } : {}
|
|
1485
|
+
});
|
|
1486
|
+
};
|
|
1487
|
+
const read = async (tell) => {
|
|
1488
|
+
const done = AppUseUtil.entries(await pi.storage.get(DONE_KEY).catch(() => {
|
|
1489
|
+
return;
|
|
1490
|
+
}));
|
|
1491
|
+
const latest = done.reduce((most, entry) => Math.max(most, entry.at), 0);
|
|
1492
|
+
if (tell && !stopped) {
|
|
1493
|
+
const fresh = AppUseUtil.fresh(done, since);
|
|
1494
|
+
for (const entry of fresh) {
|
|
1495
|
+
show(entry);
|
|
1496
|
+
}
|
|
1497
|
+
if (fresh.some((entry) => entry.command.startsWith("extensions."))) {
|
|
1498
|
+
pi.reloadExtensions().catch(() => {
|
|
1499
|
+
return;
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
since = Math.max(Number.isFinite(since) ? since : 0, latest);
|
|
1504
|
+
};
|
|
1505
|
+
const first = read(false);
|
|
1506
|
+
const off = pi.storage.onChange((keys) => {
|
|
1507
|
+
if (keys.includes(DONE_KEY)) {
|
|
1508
|
+
first.then(() => read(true));
|
|
1509
|
+
}
|
|
1510
|
+
});
|
|
1511
|
+
return () => {
|
|
1512
|
+
stopped = true;
|
|
1513
|
+
off();
|
|
1514
|
+
stopAnswering?.();
|
|
1515
|
+
screens.dispose();
|
|
1516
|
+
};
|
|
1517
|
+
}
|
|
1518
|
+
export {
|
|
1519
|
+
activate as default
|
|
1520
|
+
};
|