@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// ../ta-protocol/esm/common/ta-extension-host.js
|
|
2
|
+
var TA_WEBHOOK_MAX_BYTES = 256 * 1024;
|
|
2
3
|
var TA_HOST_EVENT = "ta:host";
|
|
3
4
|
var TaHostUtil;
|
|
4
5
|
(function(TaHostUtil2) {
|
|
@@ -159,10 +160,51 @@ var MomentsBrief;
|
|
|
159
160
|
|
|
160
161
|
// ../ta-protocol/esm/common/access-protocol.js
|
|
161
162
|
var TaAccessServer = Symbol("TaAccessServer");
|
|
162
|
-
// ../ta-protocol/esm/common/
|
|
163
|
-
var
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
// ../ta-protocol/esm/common/delegate-protocol.js
|
|
164
|
+
var TaDelegateUtil;
|
|
165
|
+
(function(TaDelegateUtil2) {
|
|
166
|
+
TaDelegateUtil2.LEVELS = ["less", "balanced", "more"];
|
|
167
|
+
TaDelegateUtil2.DEFAULT = "balanced";
|
|
168
|
+
TaDelegateUtil2.WORK_TOOLS = ["read", "bash", "powershell", "edit", "write", "grep", "find", "ls"];
|
|
169
|
+
TaDelegateUtil2.CHANGE_TOOLS = ["edit", "write"];
|
|
170
|
+
const LIMITS = {
|
|
171
|
+
less: { noChanges: false },
|
|
172
|
+
balanced: { noChanges: true, steps: 6 },
|
|
173
|
+
more: { noChanges: true, steps: 2 }
|
|
174
|
+
};
|
|
175
|
+
function parse(value) {
|
|
176
|
+
return TaDelegateUtil2.LEVELS.includes(value) ? value : TaDelegateUtil2.DEFAULT;
|
|
177
|
+
}
|
|
178
|
+
TaDelegateUtil2.parse = parse;
|
|
179
|
+
function mark(level) {
|
|
180
|
+
return `(delegate=${level})`;
|
|
181
|
+
}
|
|
182
|
+
TaDelegateUtil2.mark = mark;
|
|
183
|
+
function levelOf(systemPrompt) {
|
|
184
|
+
const role = TaHostUtil.role(systemPrompt);
|
|
185
|
+
return TaDelegateUtil2.LEVELS.find((level) => role.includes(mark(level)));
|
|
186
|
+
}
|
|
187
|
+
TaDelegateUtil2.levelOf = levelOf;
|
|
188
|
+
function limits(level) {
|
|
189
|
+
return LIMITS[level];
|
|
190
|
+
}
|
|
191
|
+
TaDelegateUtil2.limits = limits;
|
|
192
|
+
function refusal(level, tool, steps) {
|
|
193
|
+
if (!TaDelegateUtil2.WORK_TOOLS.includes(tool)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const limit = LIMITS[level];
|
|
197
|
+
if (limit.noChanges && TaDelegateUtil2.CHANGE_TOOLS.includes(tool)) {
|
|
198
|
+
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.";
|
|
199
|
+
}
|
|
200
|
+
if (limit.steps !== undefined && steps >= limit.steps) {
|
|
201
|
+
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.";
|
|
202
|
+
}
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
TaDelegateUtil2.refusal = refusal;
|
|
206
|
+
})(TaDelegateUtil || (TaDelegateUtil = {}));
|
|
207
|
+
|
|
166
208
|
// ../ta-protocol/esm/common/language.js
|
|
167
209
|
var TaLanguageUtil;
|
|
168
210
|
(function(TaLanguageUtil2) {
|
|
@@ -201,19 +243,373 @@ var TaLanguageUtil;
|
|
|
201
243
|
}
|
|
202
244
|
TaLanguageUtil2.list = list;
|
|
203
245
|
})(TaLanguageUtil || (TaLanguageUtil = {}));
|
|
246
|
+
|
|
247
|
+
// ../ta-protocol/esm/common/app-protocol.js
|
|
248
|
+
var FONT_SIZES = ["small", "standard", "large", "xlarge"];
|
|
249
|
+
var words = (en, zh, tw, ja) => ({ "en-US": en, "zh-CN": zh, "zh-TW": tw, "ja-JP": ja });
|
|
250
|
+
var SYSTEM = words("as the system", "跟随系统", "跟隨系統", "システムに合わせる");
|
|
251
|
+
var FONT_SHOWN = {
|
|
252
|
+
small: words("small", "小", "小", "小"),
|
|
253
|
+
standard: words("standard", "标准", "標準", "標準"),
|
|
254
|
+
large: words("large", "大", "大", "大"),
|
|
255
|
+
xlarge: words("extra large", "特大", "特大", "特大")
|
|
256
|
+
};
|
|
257
|
+
var TA_WEB_SETTINGS = [
|
|
258
|
+
{
|
|
259
|
+
key: "theme",
|
|
260
|
+
type: "enum",
|
|
261
|
+
values: ["system", "light", "dark"],
|
|
262
|
+
default: "system",
|
|
263
|
+
what: "Light or dark look; system follows the device.",
|
|
264
|
+
title: words("Theme", "外观", "外觀", "外観"),
|
|
265
|
+
shown: { system: SYSTEM, light: words("light", "浅色", "淺色", "ライト"), dark: words("dark", "深色", "深色", "ダーク") }
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
key: "language",
|
|
269
|
+
type: "enum",
|
|
270
|
+
values: ["system", ...TaLanguageUtil.ALL],
|
|
271
|
+
default: "system",
|
|
272
|
+
what: "The language of Ta's pages and of what Ta says; system follows the device.",
|
|
273
|
+
title: words("Language", "语言", "語言", "言語"),
|
|
274
|
+
shown: {
|
|
275
|
+
system: SYSTEM,
|
|
276
|
+
...Object.fromEntries(TaLanguageUtil.ALL.map((language) => [
|
|
277
|
+
language,
|
|
278
|
+
words(TaLanguageUtil.NAMES[language], TaLanguageUtil.NAMES[language], TaLanguageUtil.NAMES[language], TaLanguageUtil.NAMES[language])
|
|
279
|
+
]))
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
key: "fontSize",
|
|
284
|
+
type: "enum",
|
|
285
|
+
values: FONT_SIZES,
|
|
286
|
+
default: "standard",
|
|
287
|
+
what: "The size of the text of the whole page.",
|
|
288
|
+
title: words("Text size", "字体大小", "字型大小", "文字サイズ"),
|
|
289
|
+
shown: FONT_SHOWN
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
key: "chatFontSize",
|
|
293
|
+
type: "enum",
|
|
294
|
+
values: FONT_SIZES,
|
|
295
|
+
default: "standard",
|
|
296
|
+
what: "The size of the text of conversations, on top of fontSize.",
|
|
297
|
+
title: words("Text size of conversations", "对话字体大小", "對話字型大小", "会話の文字サイズ"),
|
|
298
|
+
shown: FONT_SHOWN
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
key: "speak",
|
|
302
|
+
type: "boolean",
|
|
303
|
+
default: false,
|
|
304
|
+
what: "Read every reply aloud.",
|
|
305
|
+
title: words("Read replies aloud", "朗读回复", "朗讀回覆", "返信を読み上げ")
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
key: "speakTalk",
|
|
309
|
+
type: "boolean",
|
|
310
|
+
default: false,
|
|
311
|
+
what: "Read the reply aloud when the user spoke to the double by voice.",
|
|
312
|
+
title: words("Read aloud what was asked by voice", "语音提问时朗读回复", "語音提問時朗讀回覆", "音声で聞いたら読み上げ")
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
key: "callCaptions",
|
|
316
|
+
type: "boolean",
|
|
317
|
+
default: false,
|
|
318
|
+
what: "Show captions in a call: what the user says and what Ta reads.",
|
|
319
|
+
title: words("Call captions", "通话字幕", "通話字幕", "通話の字幕")
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
key: "voice",
|
|
323
|
+
type: "string",
|
|
324
|
+
default: "",
|
|
325
|
+
what: "The voice replies are read with (a voiceURI of the device's voices); empty for the most natural one.",
|
|
326
|
+
title: words("Voice", "朗读声音", "朗讀聲音", "読み上げの声")
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
key: "confirmTasks",
|
|
330
|
+
type: "boolean",
|
|
331
|
+
default: false,
|
|
332
|
+
what: "The double asks before it hands out work.",
|
|
333
|
+
title: words("Ask before handing out work", "派任务前先问我", "派任務前先問我", "作業を割り当てる前に確認")
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
key: "maxTasks",
|
|
337
|
+
type: "number",
|
|
338
|
+
values: [0, 2, 4, 8],
|
|
339
|
+
default: 0,
|
|
340
|
+
what: "How many of the double's tasks run at once; 0 for as many as it starts.",
|
|
341
|
+
title: words("Tasks at once", "同时运行的任务", "同時執行的任務", "同時に実行するタスク")
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
key: "delegate",
|
|
345
|
+
type: "enum",
|
|
346
|
+
values: TaDelegateUtil.LEVELS,
|
|
347
|
+
default: TaDelegateUtil.DEFAULT,
|
|
348
|
+
what: "How much of the work the double hands out to tasks rather than doing it itself.",
|
|
349
|
+
title: words("Hand out work", "派活多少", "派活多少", "作業の割り当て"),
|
|
350
|
+
shown: { less: words("less", "少", "少", "少なめ"), balanced: words("balanced", "适中", "適中", "ふつう"), more: words("more", "多", "多", "多め") }
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
key: "assistantModel",
|
|
354
|
+
type: "model",
|
|
355
|
+
default: "",
|
|
356
|
+
what: "The model of the double, <provider>/<model id>; empty for the default model.",
|
|
357
|
+
title: words("Model of the double", "分身的模型", "分身的模型", "分身のモデル")
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
key: "taskModel",
|
|
361
|
+
type: "model",
|
|
362
|
+
default: "",
|
|
363
|
+
what: "The model of the tasks the double starts; empty for the default model.",
|
|
364
|
+
title: words("Model of tasks", "任务的模型", "任務的模型", "タスクのモデル")
|
|
365
|
+
},
|
|
366
|
+
{ key: "reduceMotion", type: "boolean", default: false, what: "Fewer animations.", title: words("Reduce motion", "减少动画", "減少動畫", "動きを減らす") },
|
|
367
|
+
{
|
|
368
|
+
key: "keepAliveMinutes",
|
|
369
|
+
type: "number",
|
|
370
|
+
values: [1, 5, 15, 30],
|
|
371
|
+
default: 5,
|
|
372
|
+
what: "How long an extension started on open keeps running once left, in minutes.",
|
|
373
|
+
title: words("Keep extensions running", "扩展离开后保留", "擴充功能離開後保留", "拡張機能を保持")
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
key: "chatFoldDays",
|
|
377
|
+
type: "number",
|
|
378
|
+
values: [3, 7, 30, 0],
|
|
379
|
+
default: 7,
|
|
380
|
+
what: "Conversations not updated for these days fold at the end of the list; 0 for none.",
|
|
381
|
+
title: words("Fold old conversations", "折叠旧对话", "摺疊舊對話", "古い会話を折りたたむ")
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
key: "chatArchiveDays",
|
|
385
|
+
type: "number",
|
|
386
|
+
values: [30, 90, 365, 0],
|
|
387
|
+
default: 30,
|
|
388
|
+
what: "Conversations not updated for these days are archived (out of the list, found by search); 0 for none.",
|
|
389
|
+
title: words("Archive old conversations", "归档旧对话", "歸檔舊對話", "古い会話をアーカイブ")
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
key: "recentShots",
|
|
393
|
+
type: "boolean",
|
|
394
|
+
default: true,
|
|
395
|
+
what: "The screenshot just taken is offered above the message box, once.",
|
|
396
|
+
title: words("Offer recent screenshots", "提示刚截的图", "提示剛截的圖", "撮ったばかりのスクリーンショットを提案")
|
|
397
|
+
}
|
|
398
|
+
];
|
|
399
|
+
var TaAppUtil;
|
|
400
|
+
(function(TaAppUtil2) {
|
|
401
|
+
function check(spec, value) {
|
|
402
|
+
var _a, _b;
|
|
403
|
+
switch (spec.type) {
|
|
404
|
+
case "boolean":
|
|
405
|
+
return typeof value === "boolean" ? undefined : "true or false";
|
|
406
|
+
case "string":
|
|
407
|
+
return typeof value === "string" ? undefined : "a string";
|
|
408
|
+
case "model":
|
|
409
|
+
return value === "" || typeof value === "string" && /^[^/\s]+\/\S+$/.test(value) ? undefined : "<provider>/<model id>, or empty";
|
|
410
|
+
default:
|
|
411
|
+
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(", ")}`;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
TaAppUtil2.check = check;
|
|
415
|
+
function shown(value, language, spec) {
|
|
416
|
+
var _a;
|
|
417
|
+
const named = (_a = spec === null || spec === undefined ? undefined : spec.shown) === null || _a === undefined ? undefined : _a[String(value)];
|
|
418
|
+
if (named) {
|
|
419
|
+
return TaLanguageUtil.pick(language, named);
|
|
420
|
+
}
|
|
421
|
+
if (typeof value === "boolean") {
|
|
422
|
+
return TaLanguageUtil.pick(language, value ? words("on", "开", "開", "オン") : words("off", "关", "關", "オフ"));
|
|
423
|
+
}
|
|
424
|
+
if (value === "" || value === undefined || value === null) {
|
|
425
|
+
return TaLanguageUtil.pick(language, words("default", "默认", "預設", "デフォルト"));
|
|
426
|
+
}
|
|
427
|
+
return String(value);
|
|
428
|
+
}
|
|
429
|
+
TaAppUtil2.shown = shown;
|
|
430
|
+
})(TaAppUtil || (TaAppUtil = {}));
|
|
431
|
+
// ../ta-protocol/esm/common/auth-protocol.js
|
|
432
|
+
var TaAuthServer = Symbol("TaAuthServer");
|
|
433
|
+
// ../ta-protocol/esm/common/deployment-protocol.js
|
|
434
|
+
var TA_WELL_KNOWN_PATH = "/.well-known/ta";
|
|
435
|
+
|
|
436
|
+
class TaDeploymentError extends Error {
|
|
437
|
+
}
|
|
438
|
+
var TaDeploymentUtil;
|
|
439
|
+
(function(TaDeploymentUtil2) {
|
|
440
|
+
TaDeploymentUtil2.DISTRIBUTION_FILE = "distribution.json";
|
|
441
|
+
function url(value) {
|
|
442
|
+
if (typeof value !== "string" || !value.trim()) {
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
try {
|
|
446
|
+
const parsed = new URL(value.trim());
|
|
447
|
+
if (!/^https?:$/.test(parsed.protocol) || parsed.search || parsed.hash || parsed.username || parsed.password) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
return `${parsed.origin}${parsed.pathname}`.replace(/\/+$/, "");
|
|
451
|
+
} catch (_a) {
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
TaDeploymentUtil2.url = url;
|
|
456
|
+
function name(value) {
|
|
457
|
+
return typeof value === "string" && value.trim() ? value.trim().slice(0, 80) : undefined;
|
|
458
|
+
}
|
|
459
|
+
function describe(env, own, version) {
|
|
460
|
+
var _a, _b;
|
|
461
|
+
const gateway = (_a = url(own.gateway)) !== null && _a !== undefined ? _a : url(env.TA_GATEWAY_URL);
|
|
462
|
+
const relay = (_b = url(own.relay)) !== null && _b !== undefined ? _b : url(env.TA_RELAY_URL);
|
|
463
|
+
const called = name(env.TA_DEPLOYMENT_NAME);
|
|
464
|
+
return { v: 1, ...called ? { name: called } : {}, ...gateway ? { gateway } : {}, ...relay ? { relay } : {}, ...version ? { version } : {} };
|
|
465
|
+
}
|
|
466
|
+
TaDeploymentUtil2.describe = describe;
|
|
467
|
+
TaDeploymentUtil2.HEADERS = {
|
|
468
|
+
"content-type": "application/json",
|
|
469
|
+
"access-control-allow-origin": "*",
|
|
470
|
+
"cache-control": "no-store"
|
|
471
|
+
};
|
|
472
|
+
function parse(value) {
|
|
473
|
+
const given = value;
|
|
474
|
+
if (!given || typeof given !== "object" || given.v !== 1) {
|
|
475
|
+
return;
|
|
476
|
+
}
|
|
477
|
+
const deployment = describe({ TA_DEPLOYMENT_NAME: given.name, TA_GATEWAY_URL: given.gateway, TA_RELAY_URL: given.relay }, {});
|
|
478
|
+
const version = name(given.version);
|
|
479
|
+
return version ? { ...deployment, version } : deployment;
|
|
480
|
+
}
|
|
481
|
+
TaDeploymentUtil2.parse = parse;
|
|
482
|
+
async function discover(address, timeoutMs = 6000) {
|
|
483
|
+
const base = url(address);
|
|
484
|
+
if (!base) {
|
|
485
|
+
throw new TaDeploymentError(`${address} is not an address of http or https.`);
|
|
486
|
+
}
|
|
487
|
+
const controller = new AbortController;
|
|
488
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
489
|
+
try {
|
|
490
|
+
const response = await fetch(`${base}${TA_WELL_KNOWN_PATH}`, { signal: controller.signal, redirect: "follow" });
|
|
491
|
+
if (!response.ok) {
|
|
492
|
+
throw new TaDeploymentError(`${base} is not a deployment of Ta (${response.status}).`);
|
|
493
|
+
}
|
|
494
|
+
const deployment = parse(await response.json().catch(() => {
|
|
495
|
+
return;
|
|
496
|
+
}));
|
|
497
|
+
if (!deployment || !deployment.gateway && !deployment.relay) {
|
|
498
|
+
throw new TaDeploymentError(`${base} is not a deployment of Ta.`);
|
|
499
|
+
}
|
|
500
|
+
return deployment;
|
|
501
|
+
} catch (error) {
|
|
502
|
+
if ((error === null || error === undefined ? undefined : error.name) === "AbortError") {
|
|
503
|
+
throw new TaDeploymentError(`${base} did not answer in time.`);
|
|
504
|
+
}
|
|
505
|
+
throw error;
|
|
506
|
+
} finally {
|
|
507
|
+
clearTimeout(timer);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
TaDeploymentUtil2.discover = discover;
|
|
511
|
+
function distribution(value) {
|
|
512
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
513
|
+
throw new TaDeploymentError(`${TaDeploymentUtil2.DISTRIBUTION_FILE} holds a JSON object.`);
|
|
514
|
+
}
|
|
515
|
+
const given = value;
|
|
516
|
+
const result = {};
|
|
517
|
+
if (given.name !== undefined) {
|
|
518
|
+
result.name = name(given.name);
|
|
519
|
+
}
|
|
520
|
+
for (const key of ["relay", "gateway"]) {
|
|
521
|
+
if (given[key] !== undefined) {
|
|
522
|
+
const address = url(given[key]);
|
|
523
|
+
if (!address) {
|
|
524
|
+
throw new TaDeploymentError(`"${key}" of ${TaDeploymentUtil2.DISTRIBUTION_FILE} is not an address of http or https.`);
|
|
525
|
+
}
|
|
526
|
+
result[key] = address;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
if (given.updates !== undefined) {
|
|
530
|
+
const updates = given.updates;
|
|
531
|
+
const base = url(updates === null || updates === undefined ? undefined : updates.base);
|
|
532
|
+
if (!base && (updates === null || updates === undefined ? undefined : updates.base) !== undefined) {
|
|
533
|
+
throw new TaDeploymentError(`"updates.base" of ${TaDeploymentUtil2.DISTRIBUTION_FILE} is not an address of http or https.`);
|
|
534
|
+
}
|
|
535
|
+
const key = typeof (updates === null || updates === undefined ? undefined : updates.key) === "string" && updates.key.includes("PUBLIC KEY") ? updates.key : undefined;
|
|
536
|
+
if ((updates === null || updates === undefined ? undefined : updates.key) !== undefined && !key) {
|
|
537
|
+
throw new TaDeploymentError(`"updates.key" of ${TaDeploymentUtil2.DISTRIBUTION_FILE} is a public key in PEM.`);
|
|
538
|
+
}
|
|
539
|
+
result.updates = { ...base ? { base } : {}, ...key ? { key } : {} };
|
|
540
|
+
}
|
|
541
|
+
return result;
|
|
542
|
+
}
|
|
543
|
+
TaDeploymentUtil2.distribution = distribution;
|
|
544
|
+
function apply(distribution2, env) {
|
|
545
|
+
const defaults = { TA_DEPLOYMENT_NAME: distribution2.name, TA_RELAY_URL: distribution2.relay, TA_GATEWAY_URL: distribution2.gateway };
|
|
546
|
+
for (const [key, value] of Object.entries(defaults)) {
|
|
547
|
+
if (value && !env[key]) {
|
|
548
|
+
env[key] = value;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
TaDeploymentUtil2.apply = apply;
|
|
553
|
+
})(TaDeploymentUtil || (TaDeploymentUtil = {}));
|
|
554
|
+
// ../ta-protocol/esm/common/error-protocol.js
|
|
555
|
+
var TaErrorUtil;
|
|
556
|
+
(function(TaErrorUtil2) {
|
|
557
|
+
function code(error) {
|
|
558
|
+
var _a;
|
|
559
|
+
var _b;
|
|
560
|
+
const failure = error;
|
|
561
|
+
const code2 = (_b = failure === null || failure === undefined ? undefined : failure.code) !== null && _b !== undefined ? _b : (_a = failure === null || failure === undefined ? undefined : failure.data) === null || _a === undefined ? undefined : _a.code;
|
|
562
|
+
return typeof code2 === "string" ? code2 : undefined;
|
|
563
|
+
}
|
|
564
|
+
TaErrorUtil2.code = code;
|
|
565
|
+
})(TaErrorUtil || (TaErrorUtil = {}));
|
|
566
|
+
// ../ta-protocol/esm/common/gateway-protocol.js
|
|
567
|
+
var TaGatewayServer = Symbol("TaGatewayServer");
|
|
204
568
|
// ../ta-protocol/esm/common/location.js
|
|
205
569
|
var TaLocation;
|
|
206
570
|
(function(TaLocation2) {
|
|
207
571
|
TaLocation2.SSH = "ssh://";
|
|
572
|
+
TaLocation2.CLOUD = "ta://";
|
|
573
|
+
const CLOUD_NAME = /^[a-z0-9][a-z0-9-]{0,39}$/;
|
|
208
574
|
const HOST = /^(?!-)[\w.@:%+[\]-]+$/;
|
|
209
575
|
function isRemote(location) {
|
|
210
|
-
return location.startsWith(TaLocation2.SSH);
|
|
576
|
+
return location.startsWith(TaLocation2.SSH) || location.startsWith(TaLocation2.CLOUD);
|
|
211
577
|
}
|
|
212
578
|
TaLocation2.isRemote = isRemote;
|
|
579
|
+
function isCloud(host2) {
|
|
580
|
+
return !!host2 && host2.startsWith(TaLocation2.CLOUD);
|
|
581
|
+
}
|
|
582
|
+
TaLocation2.isCloud = isCloud;
|
|
583
|
+
function isCloudName(name) {
|
|
584
|
+
return CLOUD_NAME.test(name);
|
|
585
|
+
}
|
|
586
|
+
TaLocation2.isCloudName = isCloudName;
|
|
587
|
+
function cloud(name, path2 = "") {
|
|
588
|
+
return `${TaLocation2.CLOUD}${name}${path2 ? normalize(path2) : ""}`;
|
|
589
|
+
}
|
|
590
|
+
TaLocation2.cloud = cloud;
|
|
591
|
+
function cloudName(hostOrLocation) {
|
|
592
|
+
if (!hostOrLocation.startsWith(TaLocation2.CLOUD)) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
const rest = hostOrLocation.slice(TaLocation2.CLOUD.length);
|
|
596
|
+
const slash = rest.indexOf("/");
|
|
597
|
+
return slash < 0 ? rest : rest.slice(0, slash);
|
|
598
|
+
}
|
|
599
|
+
TaLocation2.cloudName = cloudName;
|
|
213
600
|
function parse(location) {
|
|
601
|
+
var _a;
|
|
214
602
|
if (!isRemote(location)) {
|
|
215
603
|
return;
|
|
216
604
|
}
|
|
605
|
+
if (location.startsWith(TaLocation2.CLOUD)) {
|
|
606
|
+
const name = (_a = cloudName(location)) !== null && _a !== undefined ? _a : "";
|
|
607
|
+
if (!isCloudName(name)) {
|
|
608
|
+
throw new Error(`${JSON.stringify(location)} names no cloud workspace: write ta://<name>/<path>.`);
|
|
609
|
+
}
|
|
610
|
+
const path3 = location.slice(TaLocation2.CLOUD.length + name.length);
|
|
611
|
+
return { host: `${TaLocation2.CLOUD}${name}`, path: path3 ? normalize(path3) : "" };
|
|
612
|
+
}
|
|
217
613
|
const rest = location.slice(TaLocation2.SSH.length);
|
|
218
614
|
const slash = rest.indexOf("/");
|
|
219
615
|
const host2 = slash < 0 ? rest : rest.slice(0, slash);
|
|
@@ -225,24 +621,24 @@ var TaLocation;
|
|
|
225
621
|
}
|
|
226
622
|
TaLocation2.parse = parse;
|
|
227
623
|
function isHost(host2) {
|
|
228
|
-
return HOST.test(host2);
|
|
624
|
+
return isCloud(host2) ? isCloudName(host2.slice(TaLocation2.CLOUD.length)) : HOST.test(host2);
|
|
229
625
|
}
|
|
230
626
|
TaLocation2.isHost = isHost;
|
|
231
627
|
const FLAGS = /^-[46AaCfGgKkMNnqsTtVvXxYy]+$/;
|
|
232
628
|
function readHost(input) {
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
235
|
-
|
|
629
|
+
const words2 = input.trim().split(/\s+/).filter(Boolean);
|
|
630
|
+
if (words2[0] === "ssh") {
|
|
631
|
+
words2.shift();
|
|
236
632
|
}
|
|
237
633
|
let destination;
|
|
238
634
|
let port;
|
|
239
635
|
let user;
|
|
240
636
|
const options = [];
|
|
241
|
-
for (let i = 0;i <
|
|
242
|
-
const word =
|
|
637
|
+
for (let i = 0;i < words2.length; i++) {
|
|
638
|
+
const word = words2[i];
|
|
243
639
|
const glued = /^-([pl])(.+)$/.exec(word);
|
|
244
640
|
if (word === "-p" || word === "-l" || glued) {
|
|
245
|
-
const value = glued ? glued[2] :
|
|
641
|
+
const value = glued ? glued[2] : words2[++i];
|
|
246
642
|
if (value === undefined) {
|
|
247
643
|
return { error: "invalid" };
|
|
248
644
|
}
|
|
@@ -252,7 +648,7 @@ var TaLocation;
|
|
|
252
648
|
user = value;
|
|
253
649
|
}
|
|
254
650
|
} else if (word === "-o" || word.startsWith("-o")) {
|
|
255
|
-
const value = word === "-o" ?
|
|
651
|
+
const value = word === "-o" ? words2[++i] : word.slice(2);
|
|
256
652
|
const option = /^(port|user)\s*=?\s*(.+)$/i.exec(value !== null && value !== undefined ? value : "");
|
|
257
653
|
if (!option) {
|
|
258
654
|
options.push(`-o ${value !== null && value !== undefined ? value : ""}`.trim());
|
|
@@ -262,7 +658,7 @@ var TaLocation;
|
|
|
262
658
|
user = option[2];
|
|
263
659
|
}
|
|
264
660
|
} else if (FLAGS.test(word)) {} else if (word.startsWith("-")) {
|
|
265
|
-
options.push(/^-[bBcDeEFiIJLmOQRSwW]$/.test(word) &&
|
|
661
|
+
options.push(/^-[bBcDeEFiIJLmOQRSwW]$/.test(word) && words2[i + 1] !== undefined ? `${word} ${words2[++i]}` : word);
|
|
266
662
|
} else if (destination === undefined) {
|
|
267
663
|
destination = word;
|
|
268
664
|
} else {
|
|
@@ -289,10 +685,13 @@ var TaLocation;
|
|
|
289
685
|
}
|
|
290
686
|
TaLocation2.readHost = readHost;
|
|
291
687
|
function ssh(host2, path2 = "") {
|
|
292
|
-
return `${TaLocation2.SSH}${host2}${path2 ? normalize(path2) : ""}`;
|
|
688
|
+
return isCloud(host2) ? `${host2}${path2 ? normalize(path2) : ""}` : `${TaLocation2.SSH}${host2}${path2 ? normalize(path2) : ""}`;
|
|
293
689
|
}
|
|
294
690
|
TaLocation2.ssh = ssh;
|
|
295
691
|
function hostLabel(host2) {
|
|
692
|
+
if (isCloud(host2)) {
|
|
693
|
+
return host2.slice(TaLocation2.CLOUD.length);
|
|
694
|
+
}
|
|
296
695
|
const name = host2.replace(/^[^@]*@/, "").replace(/^\[(.*)\](?::\d+)?$/, "$1").replace(/^([^:]*):\d+$/, "$1");
|
|
297
696
|
return /^[\d.]+$/.test(name) || name.includes(":") ? name : name.split(".")[0] || name;
|
|
298
697
|
}
|
|
@@ -365,44 +764,7 @@ var TaLocation;
|
|
|
365
764
|
return squeezed.length > 1 ? squeezed.replace(/\/$/, "") : squeezed;
|
|
366
765
|
}
|
|
367
766
|
})(TaLocation || (TaLocation = {}));
|
|
368
|
-
// ../ta-protocol/esm/common/
|
|
369
|
-
var TaPackageServer = Symbol("TaPackageServer");
|
|
370
|
-
var TaPackageTextUtil;
|
|
371
|
-
(function(TaPackageTextUtil2) {
|
|
372
|
-
function pick(text, language) {
|
|
373
|
-
var _a, _b, _c, _d, _e;
|
|
374
|
-
if (text === undefined || typeof text === "string") {
|
|
375
|
-
return text;
|
|
376
|
-
}
|
|
377
|
-
const base = language.split("-")[0];
|
|
378
|
-
const kin = Object.keys(text).find((key) => key.split("-")[0] === base);
|
|
379
|
-
return (_e = (_d = (_c = (_b = (_a = text[language]) !== null && _a !== undefined ? _a : text[base]) !== null && _b !== undefined ? _b : kin === undefined ? undefined : text[kin]) !== null && _c !== undefined ? _c : text.en) !== null && _d !== undefined ? _d : text["en-US"]) !== null && _e !== undefined ? _e : Object.values(text)[0];
|
|
380
|
-
}
|
|
381
|
-
TaPackageTextUtil2.pick = pick;
|
|
382
|
-
})(TaPackageTextUtil || (TaPackageTextUtil = {}));
|
|
383
|
-
// ../ta-protocol/esm/common/ta-protocol.js
|
|
384
|
-
var TaServer = Symbol("TaServer");
|
|
385
|
-
var TaClient = Symbol("TaClient");
|
|
386
|
-
var TaErrorUtil;
|
|
387
|
-
(function(TaErrorUtil2) {
|
|
388
|
-
function code(error) {
|
|
389
|
-
var _a;
|
|
390
|
-
var _b;
|
|
391
|
-
const failure = error;
|
|
392
|
-
const code2 = (_b = failure === null || failure === undefined ? undefined : failure.code) !== null && _b !== undefined ? _b : (_a = failure === null || failure === undefined ? undefined : failure.data) === null || _a === undefined ? undefined : _a.code;
|
|
393
|
-
return typeof code2 === "string" ? code2 : undefined;
|
|
394
|
-
}
|
|
395
|
-
TaErrorUtil2.code = code;
|
|
396
|
-
})(TaErrorUtil || (TaErrorUtil = {}));
|
|
397
|
-
var TaSlashCommandUtil;
|
|
398
|
-
(function(TaSlashCommandUtil2) {
|
|
399
|
-
function description(command, language) {
|
|
400
|
-
var _a, _b;
|
|
401
|
-
const { descriptions } = command;
|
|
402
|
-
return (_b = (_a = descriptions === null || descriptions === undefined ? undefined : descriptions[language]) !== null && _a !== undefined ? _a : descriptions === null || descriptions === undefined ? undefined : descriptions[language.split("-")[0]]) !== null && _b !== undefined ? _b : command.description;
|
|
403
|
-
}
|
|
404
|
-
TaSlashCommandUtil2.description = description;
|
|
405
|
-
})(TaSlashCommandUtil || (TaSlashCommandUtil = {}));
|
|
767
|
+
// ../ta-protocol/esm/common/message-protocol.js
|
|
406
768
|
var TaMessageContext;
|
|
407
769
|
(function(TaMessageContext2) {
|
|
408
770
|
const BLOCK = /^<context>\n?[\s\S]*?\n?<\/context>\n?/;
|
|
@@ -565,7 +927,168 @@ var TaSkillUse;
|
|
|
565
927
|
}
|
|
566
928
|
TaSkillUse2.command = command;
|
|
567
929
|
})(TaSkillUse || (TaSkillUse = {}));
|
|
568
|
-
|
|
930
|
+
var TaTaskNote;
|
|
931
|
+
(function(TaTaskNote2) {
|
|
932
|
+
const NOTE = /^<task_(update|adopted|renamed) ((?:[^>"\n]|"[^"]*")*)>\n?([\s\S]*?)\n?<\/task_\1>$/;
|
|
933
|
+
const ATTRIBUTE = /(\w+)="([^"]*)"/g;
|
|
934
|
+
function write(note) {
|
|
935
|
+
const attributes = [`id="${quote(note.id)}"`];
|
|
936
|
+
if (note.was !== undefined) {
|
|
937
|
+
attributes.push(`was="${quote(note.was)}"`);
|
|
938
|
+
}
|
|
939
|
+
attributes.push(`title="${quote(note.title)}"`);
|
|
940
|
+
if (note.status !== undefined) {
|
|
941
|
+
attributes.push(`status="${quote(note.status)}"`);
|
|
942
|
+
}
|
|
943
|
+
return `<task_${note.kind} ${attributes.join(" ")}>
|
|
944
|
+
${note.body}
|
|
945
|
+
</task_${note.kind}>`;
|
|
946
|
+
}
|
|
947
|
+
TaTaskNote2.write = write;
|
|
948
|
+
function parse(text) {
|
|
949
|
+
const match = NOTE.exec(text.trim());
|
|
950
|
+
if (!match) {
|
|
951
|
+
return;
|
|
952
|
+
}
|
|
953
|
+
const attributes = {};
|
|
954
|
+
for (const [, name, value] of match[2].matchAll(ATTRIBUTE)) {
|
|
955
|
+
attributes[name] = unquote(value);
|
|
956
|
+
}
|
|
957
|
+
if (!attributes.id || attributes.title === undefined) {
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
const { id, title, status, was } = attributes;
|
|
961
|
+
return { kind: match[1], id, title, ...status ? { status } : {}, ...was ? { was } : {}, body: match[3] };
|
|
962
|
+
}
|
|
963
|
+
TaTaskNote2.parse = parse;
|
|
964
|
+
function quote(text) {
|
|
965
|
+
return text.replace(/&/g, "&").replace(/"/g, """).replace(/\n/g, " ");
|
|
966
|
+
}
|
|
967
|
+
function unquote(text) {
|
|
968
|
+
return text.replace(/"/g, '"').replace(/&/g, "&");
|
|
969
|
+
}
|
|
970
|
+
})(TaTaskNote || (TaTaskNote = {}));
|
|
971
|
+
// ../ta-protocol/esm/common/package-protocol.js
|
|
972
|
+
var TaPackageServer = Symbol("TaPackageServer");
|
|
973
|
+
var TaPackageTextUtil;
|
|
974
|
+
(function(TaPackageTextUtil2) {
|
|
975
|
+
function pick(text, language) {
|
|
976
|
+
var _a, _b, _c, _d, _e;
|
|
977
|
+
if (text === undefined || typeof text === "string") {
|
|
978
|
+
return text;
|
|
979
|
+
}
|
|
980
|
+
const base = language.split("-")[0];
|
|
981
|
+
const kin = Object.keys(text).find((key) => key.split("-")[0] === base);
|
|
982
|
+
return (_e = (_d = (_c = (_b = (_a = text[language]) !== null && _a !== undefined ? _a : text[base]) !== null && _b !== undefined ? _b : kin === undefined ? undefined : text[kin]) !== null && _c !== undefined ? _c : text.en) !== null && _d !== undefined ? _d : text["en-US"]) !== null && _e !== undefined ? _e : Object.values(text)[0];
|
|
983
|
+
}
|
|
984
|
+
TaPackageTextUtil2.pick = pick;
|
|
985
|
+
})(TaPackageTextUtil || (TaPackageTextUtil = {}));
|
|
986
|
+
// ../ta-protocol/esm/common/page-protocol.js
|
|
987
|
+
var TaPageServer = Symbol("TaPageServer");
|
|
988
|
+
// ../ta-protocol/esm/common/path-map.js
|
|
989
|
+
var TaPathMap;
|
|
990
|
+
(function(TaPathMap2) {
|
|
991
|
+
function isWindows(path2) {
|
|
992
|
+
return /^[a-zA-Z]:([\\/]|$)/.test(path2) || /^\\\\[^\\]/.test(path2);
|
|
993
|
+
}
|
|
994
|
+
TaPathMap2.isWindows = isWindows;
|
|
995
|
+
function rest(path2, base) {
|
|
996
|
+
const windows = isWindows(base);
|
|
997
|
+
if (windows ? !isWindows(path2) : !base.startsWith("/") || !path2.startsWith("/")) {
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
const within = parts(base, windows);
|
|
1001
|
+
const all = parts(path2, windows);
|
|
1002
|
+
if (!within.length || all.length < within.length) {
|
|
1003
|
+
return;
|
|
1004
|
+
}
|
|
1005
|
+
const same = (a, b) => windows ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
1006
|
+
return within.every((part, i) => same(part, all[i])) ? all.slice(within.length) : undefined;
|
|
1007
|
+
}
|
|
1008
|
+
TaPathMap2.rest = rest;
|
|
1009
|
+
function under(path2, base) {
|
|
1010
|
+
return rest(path2, base) !== undefined;
|
|
1011
|
+
}
|
|
1012
|
+
TaPathMap2.under = under;
|
|
1013
|
+
function join(base, parts2) {
|
|
1014
|
+
if (!parts2.length) {
|
|
1015
|
+
return base;
|
|
1016
|
+
}
|
|
1017
|
+
const sep = isWindows(base) ? "\\" : "/";
|
|
1018
|
+
return `${base.replace(/[\\/]+$/, "")}${sep}${parts2.join(sep)}`;
|
|
1019
|
+
}
|
|
1020
|
+
TaPathMap2.join = join;
|
|
1021
|
+
function basename(path2) {
|
|
1022
|
+
var _a;
|
|
1023
|
+
return (_a = path2.split(/[\\/]+/).filter(Boolean).pop()) !== null && _a !== undefined ? _a : "";
|
|
1024
|
+
}
|
|
1025
|
+
TaPathMap2.basename = basename;
|
|
1026
|
+
function path(value, pairs) {
|
|
1027
|
+
for (const [from, to] of deepest(pairs)) {
|
|
1028
|
+
const found = rest(value, from);
|
|
1029
|
+
if (found) {
|
|
1030
|
+
return join(to, found);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
return value;
|
|
1034
|
+
}
|
|
1035
|
+
TaPathMap2.path = path;
|
|
1036
|
+
function text(value, pairs) {
|
|
1037
|
+
const order = deepest(pairs);
|
|
1038
|
+
if (!order.length) {
|
|
1039
|
+
return value;
|
|
1040
|
+
}
|
|
1041
|
+
const end = String.raw`\s"'<>|*?:;,`;
|
|
1042
|
+
const pattern = new RegExp(String.raw`(^|[^\w.~-])(?:${order.map(([from]) => `(${source(from)})`).join("|")})((?:[\\/][^\\/${end}]*)*)(?=$|[\\/${end})\]}])`, "g");
|
|
1043
|
+
return value.replace(pattern, (...match) => {
|
|
1044
|
+
var _a;
|
|
1045
|
+
const before = match[1];
|
|
1046
|
+
const found = order.findIndex((_, i) => match[i + 2] !== undefined);
|
|
1047
|
+
const tail = (_a = match[order.length + 2]) !== null && _a !== undefined ? _a : "";
|
|
1048
|
+
return `${before}${join(order[found][1], tail.split(/[\\/]+/).filter(Boolean))}`;
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
TaPathMap2.text = text;
|
|
1052
|
+
function json(value, pairs) {
|
|
1053
|
+
const order = deepest(pairs);
|
|
1054
|
+
if (!order.length) {
|
|
1055
|
+
return value;
|
|
1056
|
+
}
|
|
1057
|
+
const one = (each) => {
|
|
1058
|
+
const whole = path(each, order);
|
|
1059
|
+
return whole !== each ? whole : text(each, order);
|
|
1060
|
+
};
|
|
1061
|
+
const walk = (each) => {
|
|
1062
|
+
if (typeof each === "string") {
|
|
1063
|
+
return one(each);
|
|
1064
|
+
}
|
|
1065
|
+
if (Array.isArray(each)) {
|
|
1066
|
+
return each.map(walk);
|
|
1067
|
+
}
|
|
1068
|
+
if (each && typeof each === "object") {
|
|
1069
|
+
return Object.fromEntries(Object.entries(each).map(([key, inner]) => [one(key), walk(inner)]));
|
|
1070
|
+
}
|
|
1071
|
+
return each;
|
|
1072
|
+
};
|
|
1073
|
+
return walk(value);
|
|
1074
|
+
}
|
|
1075
|
+
TaPathMap2.json = json;
|
|
1076
|
+
function parts(path2, windows) {
|
|
1077
|
+
return path2.split(windows ? /[\\/]+/ : /\/+/).filter(Boolean);
|
|
1078
|
+
}
|
|
1079
|
+
function deepest(pairs) {
|
|
1080
|
+
return pairs.filter(([from, to]) => from && to && from !== to && parts(from, isWindows(from)).length > 0).sort(([a], [b]) => parts(b, isWindows(b)).length - parts(a, isWindows(a)).length);
|
|
1081
|
+
}
|
|
1082
|
+
function source(base) {
|
|
1083
|
+
const windows = isWindows(base);
|
|
1084
|
+
const quote = (part) => [...part].map((char) => windows && char.toLowerCase() !== char.toUpperCase() ? `[${char.toLowerCase()}${char.toUpperCase()}]` : char.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("");
|
|
1085
|
+
const each = parts(base, windows).map(quote);
|
|
1086
|
+
if (!windows) {
|
|
1087
|
+
return `/${each.join("/+")}`;
|
|
1088
|
+
}
|
|
1089
|
+
return `${base.startsWith("\\\\") ? String.raw`\\\\` : ""}${each.join(String.raw`[\\/]+`)}`;
|
|
1090
|
+
}
|
|
1091
|
+
})(TaPathMap || (TaPathMap = {}));
|
|
569
1092
|
// ../ta-protocol/esm/common/presence-protocol.js
|
|
570
1093
|
var TaPresenceServer = Symbol("TaPresenceServer");
|
|
571
1094
|
var TaMessageAuthor;
|
|
@@ -644,6 +1167,18 @@ var TaRoomWatchUtil;
|
|
|
644
1167
|
})(TaRoomWatchUtil || (TaRoomWatchUtil = {}));
|
|
645
1168
|
// ../ta-protocol/esm/common/settings-protocol.js
|
|
646
1169
|
var TaSettingsServer = Symbol("TaSettingsServer");
|
|
1170
|
+
// ../ta-protocol/esm/common/ta-protocol.js
|
|
1171
|
+
var TaServer = Symbol("TaServer");
|
|
1172
|
+
var TaClient = Symbol("TaClient");
|
|
1173
|
+
var TaSlashCommandUtil;
|
|
1174
|
+
(function(TaSlashCommandUtil2) {
|
|
1175
|
+
function description(command, language) {
|
|
1176
|
+
var _a, _b;
|
|
1177
|
+
const { descriptions } = command;
|
|
1178
|
+
return (_b = (_a = descriptions === null || descriptions === undefined ? undefined : descriptions[language]) !== null && _a !== undefined ? _a : descriptions === null || descriptions === undefined ? undefined : descriptions[language.split("-")[0]]) !== null && _b !== undefined ? _b : command.description;
|
|
1179
|
+
}
|
|
1180
|
+
TaSlashCommandUtil2.description = description;
|
|
1181
|
+
})(TaSlashCommandUtil || (TaSlashCommandUtil = {}));
|
|
647
1182
|
// ../ta-protocol/esm/common/team-protocol.js
|
|
648
1183
|
var TA_UNDECLARED = "extensions.install";
|
|
649
1184
|
var TaPermissionUtil;
|
|
@@ -735,6 +1270,8 @@ var TaActionUtil;
|
|
|
735
1270
|
})(TaActionUtil || (TaActionUtil = {}));
|
|
736
1271
|
// ../ta-protocol/esm/common/usage-protocol.js
|
|
737
1272
|
var TaUsageServer = Symbol("TaUsageServer");
|
|
1273
|
+
// ../ta-protocol/esm/common/voice-protocol.js
|
|
1274
|
+
var TaVoiceServer = Symbol("TaVoiceServer");
|
|
738
1275
|
// ../ta-protocol/esm/common/workspace-protocol.js
|
|
739
1276
|
var TaWorkspaceServer = Symbol("TaWorkspaceServer");
|
|
740
1277
|
var TaTerminalServer = Symbol("TaTerminalServer");
|
|
@@ -802,8 +1339,8 @@ var Limits;
|
|
|
802
1339
|
})(Limits ||= {});
|
|
803
1340
|
|
|
804
1341
|
// web-src/talk-host.ts
|
|
805
|
-
import { mkdir, readFile
|
|
806
|
-
import {
|
|
1342
|
+
import { mkdir as mkdir2, readFile as readFile2 } from "node:fs/promises";
|
|
1343
|
+
import { join as join2 } from "node:path";
|
|
807
1344
|
|
|
808
1345
|
// web-src/post-util.ts
|
|
809
1346
|
var ID = /^[0-9a-f]{8}$/;
|
|
@@ -1142,10 +1679,14 @@ var MomentsServerTexts;
|
|
|
1142
1679
|
MomentsServerTexts.take = take;
|
|
1143
1680
|
})(MomentsServerTexts ||= {});
|
|
1144
1681
|
|
|
1682
|
+
// web-src/talk-host-base.ts
|
|
1683
|
+
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
1684
|
+
import { dirname, join } from "node:path";
|
|
1685
|
+
|
|
1145
1686
|
// web-src/talk-util.ts
|
|
1146
1687
|
var ID2 = /^[0-9a-f]{8}$/;
|
|
1147
1688
|
var PERSON = /^[A-Za-z0-9_-]{1,64}$/;
|
|
1148
|
-
function
|
|
1689
|
+
function words2(value, max) {
|
|
1149
1690
|
const text2 = typeof value === "string" ? value.trim().slice(0, max) : "";
|
|
1150
1691
|
return text2 || undefined;
|
|
1151
1692
|
}
|
|
@@ -1164,7 +1705,7 @@ var TalkUtil;
|
|
|
1164
1705
|
return;
|
|
1165
1706
|
}
|
|
1166
1707
|
const raw = value;
|
|
1167
|
-
const text2 =
|
|
1708
|
+
const text2 = words2(raw.text, raw.double ? Limits.ANSWER_TEXT : Limits.TALK_TEXT);
|
|
1168
1709
|
if (!isId(raw.id) || typeof raw.by !== "string" || !PERSON.test(raw.by) || typeof raw.at !== "number" || !text2) {
|
|
1169
1710
|
return;
|
|
1170
1711
|
}
|
|
@@ -1172,10 +1713,10 @@ var TalkUtil;
|
|
|
1172
1713
|
return {
|
|
1173
1714
|
id: raw.id,
|
|
1174
1715
|
by: raw.by,
|
|
1175
|
-
name:
|
|
1716
|
+
name: words2(raw.name, 60) ?? "",
|
|
1176
1717
|
at: raw.at,
|
|
1177
1718
|
text: text2,
|
|
1178
|
-
...to ? { to, toName:
|
|
1719
|
+
...to ? { to, toName: words2(raw.toName, 60) ?? "" } : {},
|
|
1179
1720
|
...raw.ask === true ? { ask: true } : {},
|
|
1180
1721
|
...raw.double === true ? { double: true } : {},
|
|
1181
1722
|
...isId(raw.re) ? { re: raw.re } : {}
|
|
@@ -1218,7 +1759,7 @@ var TalkUtil;
|
|
|
1218
1759
|
if (raw.t === "ta-moments:unsay" || raw.t === "ta-moments:heard") {
|
|
1219
1760
|
return { t: raw.t, post: raw.post, id: raw.id };
|
|
1220
1761
|
}
|
|
1221
|
-
const text2 =
|
|
1762
|
+
const text2 = words2(raw.text, Limits.TALK_TEXT);
|
|
1222
1763
|
if (raw.t !== "ta-moments:say" || !text2) {
|
|
1223
1764
|
return;
|
|
1224
1765
|
}
|
|
@@ -1267,17 +1808,16 @@ var TalkUtil;
|
|
|
1267
1808
|
TalkUtil.without = without;
|
|
1268
1809
|
})(TalkUtil ||= {});
|
|
1269
1810
|
|
|
1270
|
-
// web-src/talk-host.ts
|
|
1811
|
+
// web-src/talk-host-base.ts
|
|
1271
1812
|
var NOTIFY = "@celljs/ta-notify";
|
|
1272
1813
|
var DAY_MS = 86400000;
|
|
1273
1814
|
var INCOMING_MS = 5 * 60000;
|
|
1274
1815
|
var ANSWER_MS = 3 * 60000;
|
|
1275
|
-
var ANSWER_MARK = "[ta-moments:answers]";
|
|
1276
1816
|
function record(value) {
|
|
1277
1817
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
1278
1818
|
}
|
|
1279
1819
|
|
|
1280
|
-
class
|
|
1820
|
+
class MomentsTalkBase {
|
|
1281
1821
|
host;
|
|
1282
1822
|
paths;
|
|
1283
1823
|
changed;
|
|
@@ -1295,6 +1835,134 @@ class MomentsTalk {
|
|
|
1295
1835
|
this.changed = changed;
|
|
1296
1836
|
this.now = now;
|
|
1297
1837
|
}
|
|
1838
|
+
async push(room, post) {
|
|
1839
|
+
const entries = await this.read(this.file(post));
|
|
1840
|
+
const pals = await this.pals();
|
|
1841
|
+
const author = room.members.find((member) => member.owner)?.id ?? "";
|
|
1842
|
+
for (const member of room.members.filter((each) => !each.owner && !each.guest && each.online)) {
|
|
1843
|
+
await this.send(room.id, member.member, post, TalkUtil.visible(entries, member.id, author, pals));
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
async send(room, to, post, entries) {
|
|
1847
|
+
const pages = TalkUtil.pages(entries);
|
|
1848
|
+
for (const [part, page] of pages.entries()) {
|
|
1849
|
+
await this.host.rooms.send(room, { t: "ta-moments:talk", post, part, parts: pages.length, entries: page }, to).catch(() => {
|
|
1850
|
+
return;
|
|
1851
|
+
});
|
|
1852
|
+
if (pages.length > 1 && this.pace) {
|
|
1853
|
+
await new Promise((resolve) => setTimeout(resolve, this.pace));
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
async flush(room) {
|
|
1858
|
+
const owner = room.members.find((member) => member.owner);
|
|
1859
|
+
if (!owner?.online) {
|
|
1860
|
+
return;
|
|
1861
|
+
}
|
|
1862
|
+
for (const item of record(await this.read_(Keys.OUTBOX))[room.id] ?? []) {
|
|
1863
|
+
const message = item.op === "say" ? {
|
|
1864
|
+
t: "ta-moments:say",
|
|
1865
|
+
post: item.post,
|
|
1866
|
+
id: item.id,
|
|
1867
|
+
text: item.text,
|
|
1868
|
+
...item.to ? { to: item.to } : {},
|
|
1869
|
+
...item.ask ? { ask: true } : {}
|
|
1870
|
+
} : { t: "ta-moments:unsay", post: item.post, id: item.id };
|
|
1871
|
+
await this.host.rooms.send(room.id, message, owner.member).catch(() => {
|
|
1872
|
+
return;
|
|
1873
|
+
});
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
async queue(room, item) {
|
|
1877
|
+
const outbox = record(await this.read_(Keys.OUTBOX));
|
|
1878
|
+
if (Object.values(outbox).flat().length >= Limits.OUTBOX) {
|
|
1879
|
+
const language2 = TaLanguageUtil.server();
|
|
1880
|
+
throw new Error(TaLanguageUtil.pick(language2, {
|
|
1881
|
+
"zh-CN": "还有太多话没送到,等对方上线后再说",
|
|
1882
|
+
"zh-TW": "還有太多話沒送到,等對方上線後再說",
|
|
1883
|
+
"en-US": "Too much is waiting for its authors: try once they are online",
|
|
1884
|
+
"ja-JP": "多くの内容が送信されるのを待っています。対方がオンラインになったら試してください"
|
|
1885
|
+
}));
|
|
1886
|
+
}
|
|
1887
|
+
outbox[room] = [...outbox[room] ?? [], item];
|
|
1888
|
+
await this.write_(Keys.OUTBOX, outbox);
|
|
1889
|
+
}
|
|
1890
|
+
async pals() {
|
|
1891
|
+
const pals = record(await this.read_(Keys.PALS));
|
|
1892
|
+
return (a, b) => !!pals[a]?.includes(b) && !!pals[b]?.includes(a);
|
|
1893
|
+
}
|
|
1894
|
+
async postOf(room, post) {
|
|
1895
|
+
const owner = room.members.find((member) => member.owner);
|
|
1896
|
+
if (!owner || !PostUtil.isId(post) || room.status !== "member") {
|
|
1897
|
+
return;
|
|
1898
|
+
}
|
|
1899
|
+
const value = (await this.host.rooms.getState(room.id, `${StateKeys.POST}${post}`))[`${StateKeys.POST}${post}`];
|
|
1900
|
+
const checked = value?.by === owner.member ? PostUtil.check(value.value) : undefined;
|
|
1901
|
+
return checked && (checked.until === undefined || checked.until > this.now()) ? checked : undefined;
|
|
1902
|
+
}
|
|
1903
|
+
async nameOf(room, post, id) {
|
|
1904
|
+
const member = room.members.find((each) => each.id === id);
|
|
1905
|
+
if (member) {
|
|
1906
|
+
return member.name;
|
|
1907
|
+
}
|
|
1908
|
+
const entries = await this.read(room.owner ? this.file(post) : this.cacheFile(room.id, post));
|
|
1909
|
+
return entries.find((each) => each.by === id)?.name;
|
|
1910
|
+
}
|
|
1911
|
+
async notify(id, text2) {
|
|
1912
|
+
await this.host.callPackageHost(NOTIFY, "notify", [{ from: NAME, id, level: "done", title: MomentsServerTexts.roomTitle(TaLanguageUtil.server()), text: text2, view: VIEW }]).catch(() => {
|
|
1913
|
+
return;
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
file(post) {
|
|
1917
|
+
return join(this.paths.post(post), "talk.json");
|
|
1918
|
+
}
|
|
1919
|
+
cacheFile(room, post) {
|
|
1920
|
+
return join(this.paths.cache(room, post), "talk.json");
|
|
1921
|
+
}
|
|
1922
|
+
async read(file) {
|
|
1923
|
+
await this.files.get(file);
|
|
1924
|
+
try {
|
|
1925
|
+
return TalkUtil.entries(JSON.parse(await readFile(file, "utf8")));
|
|
1926
|
+
} catch {
|
|
1927
|
+
return [];
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
edit(file, change) {
|
|
1931
|
+
const next = (this.files.get(file) ?? Promise.resolve()).then(async () => {
|
|
1932
|
+
let entries = [];
|
|
1933
|
+
try {
|
|
1934
|
+
entries = TalkUtil.entries(JSON.parse(await readFile(file, "utf8")));
|
|
1935
|
+
} catch {}
|
|
1936
|
+
const changed = change(entries);
|
|
1937
|
+
if (changed === entries) {
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
if (!changed.length) {
|
|
1941
|
+
await rm(file, { force: true });
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1944
|
+
await mkdir(dirname(file), { recursive: true });
|
|
1945
|
+
await writeFile(file, JSON.stringify(changed));
|
|
1946
|
+
});
|
|
1947
|
+
const settled = next.catch(() => {
|
|
1948
|
+
return;
|
|
1949
|
+
});
|
|
1950
|
+
this.files.set(file, settled);
|
|
1951
|
+
settled.then(() => this.files.get(file) === settled && this.files.delete(file));
|
|
1952
|
+
return next;
|
|
1953
|
+
}
|
|
1954
|
+
read_(key) {
|
|
1955
|
+
return this.host.getExtensionData(NAME, key);
|
|
1956
|
+
}
|
|
1957
|
+
write_(key, value) {
|
|
1958
|
+
return this.host.setExtensionData(NAME, key, value);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
// web-src/talk-host.ts
|
|
1963
|
+
var ANSWER_MARK = "[ta-moments:answers]";
|
|
1964
|
+
|
|
1965
|
+
class MomentsTalk extends MomentsTalkBase {
|
|
1298
1966
|
async views(room, post, me) {
|
|
1299
1967
|
const owner = room.members.find((member) => member.owner);
|
|
1300
1968
|
const entries = await this.read(room.owner ? this.file(post) : this.cacheFile(room.id, post));
|
|
@@ -1329,11 +1997,11 @@ class MomentsTalk {
|
|
|
1329
1997
|
return shown;
|
|
1330
1998
|
}
|
|
1331
1999
|
async say(room, post, text2, options = {}) {
|
|
1332
|
-
const
|
|
2000
|
+
const words3 = typeof text2 === "string" ? text2.trim().slice(0, Limits.TALK_TEXT) : "";
|
|
1333
2001
|
const value = await this.postOf(room, post);
|
|
1334
|
-
if (!
|
|
2002
|
+
if (!words3 || !value) {
|
|
1335
2003
|
const language2 = TaLanguageUtil.server();
|
|
1336
|
-
throw new Error(
|
|
2004
|
+
throw new Error(words3 ? MomentsServerTexts.notFound(language2) : TaLanguageUtil.pick(language2, {
|
|
1337
2005
|
"zh-CN": "写点什么再发",
|
|
1338
2006
|
"zh-TW": "寫點什麼再發",
|
|
1339
2007
|
"en-US": "Write something first",
|
|
@@ -1346,7 +2014,7 @@ class MomentsTalk {
|
|
|
1346
2014
|
const toName2 = to ? await this.nameOf(room, post, to) : undefined;
|
|
1347
2015
|
await this.edit(this.file(post), (entries) => entries.length >= Limits.TALK ? entries : [
|
|
1348
2016
|
...entries,
|
|
1349
|
-
{ id: TalkUtil.newId(), by: me.id, name: me.name, at: this.now(), text:
|
|
2017
|
+
{ id: TalkUtil.newId(), by: me.id, name: me.name, at: this.now(), text: words3, ...to ? { to, toName: toName2 ?? "" } : {} }
|
|
1350
2018
|
]);
|
|
1351
2019
|
await this.push(room, post);
|
|
1352
2020
|
this.changed();
|
|
@@ -1366,7 +2034,7 @@ class MomentsTalk {
|
|
|
1366
2034
|
op: "say",
|
|
1367
2035
|
post,
|
|
1368
2036
|
id: TalkUtil.newId(),
|
|
1369
|
-
text:
|
|
2037
|
+
text: words3,
|
|
1370
2038
|
...to ? { to, toName: toName ?? "" } : {},
|
|
1371
2039
|
...options.ask ? { ask: true } : {},
|
|
1372
2040
|
at: this.now()
|
|
@@ -1562,7 +2230,7 @@ class MomentsTalk {
|
|
|
1562
2230
|
const sessionId = await this.session(key, me.name, question);
|
|
1563
2231
|
const before = await this.host.getState(sessionId);
|
|
1564
2232
|
const earlier = (await this.read(this.file(post))).filter((each) => each.id !== question.id && (each.by === question.by || each.to === question.by));
|
|
1565
|
-
const notes = await
|
|
2233
|
+
const notes = await readFile2(join2(this.paths.post(post), "notes.txt"), "utf8").catch(() => "");
|
|
1566
2234
|
await this.host.prompt(sessionId, {
|
|
1567
2235
|
clientMessageId: `ta-moments:ask:${question.id}`,
|
|
1568
2236
|
message: MomentsTalk.prompt(me.name, value, notes, earlier, question)
|
|
@@ -1600,8 +2268,8 @@ class MomentsTalk {
|
|
|
1600
2268
|
return open.sessionId;
|
|
1601
2269
|
}
|
|
1602
2270
|
}
|
|
1603
|
-
const cwd =
|
|
1604
|
-
await
|
|
2271
|
+
const cwd = join2(this.host.agentDir, "ta-moments", "answers");
|
|
2272
|
+
await mkdir2(cwd, { recursive: true });
|
|
1605
2273
|
const role = MomentsTalk.role(me);
|
|
1606
2274
|
const opened = file ? await this.host.openSession({ cwd, sessionFile: file, appendSystemPrompt: role, group: NAME }).catch(() => {
|
|
1607
2275
|
return;
|
|
@@ -1645,128 +2313,6 @@ class MomentsTalk {
|
|
|
1645
2313
|
this.asks.set(id, [...times, now]);
|
|
1646
2314
|
return true;
|
|
1647
2315
|
}
|
|
1648
|
-
async push(room, post) {
|
|
1649
|
-
const entries = await this.read(this.file(post));
|
|
1650
|
-
const pals = await this.pals();
|
|
1651
|
-
const author = room.members.find((member) => member.owner)?.id ?? "";
|
|
1652
|
-
for (const member of room.members.filter((each) => !each.owner && !each.guest && each.online)) {
|
|
1653
|
-
await this.send(room.id, member.member, post, TalkUtil.visible(entries, member.id, author, pals));
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
async send(room, to, post, entries) {
|
|
1657
|
-
const pages = TalkUtil.pages(entries);
|
|
1658
|
-
for (const [part, page] of pages.entries()) {
|
|
1659
|
-
await this.host.rooms.send(room, { t: "ta-moments:talk", post, part, parts: pages.length, entries: page }, to).catch(() => {
|
|
1660
|
-
return;
|
|
1661
|
-
});
|
|
1662
|
-
if (pages.length > 1 && this.pace) {
|
|
1663
|
-
await new Promise((resolve) => setTimeout(resolve, this.pace));
|
|
1664
|
-
}
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
|
-
async flush(room) {
|
|
1668
|
-
const owner = room.members.find((member) => member.owner);
|
|
1669
|
-
if (!owner?.online) {
|
|
1670
|
-
return;
|
|
1671
|
-
}
|
|
1672
|
-
for (const item of record(await this.read_(Keys.OUTBOX))[room.id] ?? []) {
|
|
1673
|
-
const message = item.op === "say" ? {
|
|
1674
|
-
t: "ta-moments:say",
|
|
1675
|
-
post: item.post,
|
|
1676
|
-
id: item.id,
|
|
1677
|
-
text: item.text,
|
|
1678
|
-
...item.to ? { to: item.to } : {},
|
|
1679
|
-
...item.ask ? { ask: true } : {}
|
|
1680
|
-
} : { t: "ta-moments:unsay", post: item.post, id: item.id };
|
|
1681
|
-
await this.host.rooms.send(room.id, message, owner.member).catch(() => {
|
|
1682
|
-
return;
|
|
1683
|
-
});
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
async queue(room, item) {
|
|
1687
|
-
const outbox = record(await this.read_(Keys.OUTBOX));
|
|
1688
|
-
if (Object.values(outbox).flat().length >= Limits.OUTBOX) {
|
|
1689
|
-
const language2 = TaLanguageUtil.server();
|
|
1690
|
-
throw new Error(TaLanguageUtil.pick(language2, {
|
|
1691
|
-
"zh-CN": "还有太多话没送到,等对方上线后再说",
|
|
1692
|
-
"zh-TW": "還有太多話沒送到,等對方上線後再說",
|
|
1693
|
-
"en-US": "Too much is waiting for its authors: try once they are online",
|
|
1694
|
-
"ja-JP": "多くの内容が送信されるのを待っています。対方がオンラインになったら試してください"
|
|
1695
|
-
}));
|
|
1696
|
-
}
|
|
1697
|
-
outbox[room] = [...outbox[room] ?? [], item];
|
|
1698
|
-
await this.write_(Keys.OUTBOX, outbox);
|
|
1699
|
-
}
|
|
1700
|
-
async pals() {
|
|
1701
|
-
const pals = record(await this.read_(Keys.PALS));
|
|
1702
|
-
return (a, b) => !!pals[a]?.includes(b) && !!pals[b]?.includes(a);
|
|
1703
|
-
}
|
|
1704
|
-
async postOf(room, post) {
|
|
1705
|
-
const owner = room.members.find((member) => member.owner);
|
|
1706
|
-
if (!owner || !PostUtil.isId(post) || room.status !== "member") {
|
|
1707
|
-
return;
|
|
1708
|
-
}
|
|
1709
|
-
const value = (await this.host.rooms.getState(room.id, `${StateKeys.POST}${post}`))[`${StateKeys.POST}${post}`];
|
|
1710
|
-
const checked = value?.by === owner.member ? PostUtil.check(value.value) : undefined;
|
|
1711
|
-
return checked && (checked.until === undefined || checked.until > this.now()) ? checked : undefined;
|
|
1712
|
-
}
|
|
1713
|
-
async nameOf(room, post, id) {
|
|
1714
|
-
const member = room.members.find((each) => each.id === id);
|
|
1715
|
-
if (member) {
|
|
1716
|
-
return member.name;
|
|
1717
|
-
}
|
|
1718
|
-
const entries = await this.read(room.owner ? this.file(post) : this.cacheFile(room.id, post));
|
|
1719
|
-
return entries.find((each) => each.by === id)?.name;
|
|
1720
|
-
}
|
|
1721
|
-
async notify(id, text2) {
|
|
1722
|
-
await this.host.callPackageHost(NOTIFY, "notify", [{ from: NAME, id, level: "done", title: MomentsServerTexts.roomTitle(TaLanguageUtil.server()), text: text2, view: VIEW }]).catch(() => {
|
|
1723
|
-
return;
|
|
1724
|
-
});
|
|
1725
|
-
}
|
|
1726
|
-
file(post) {
|
|
1727
|
-
return join(this.paths.post(post), "talk.json");
|
|
1728
|
-
}
|
|
1729
|
-
cacheFile(room, post) {
|
|
1730
|
-
return join(this.paths.cache(room, post), "talk.json");
|
|
1731
|
-
}
|
|
1732
|
-
async read(file) {
|
|
1733
|
-
await this.files.get(file);
|
|
1734
|
-
try {
|
|
1735
|
-
return TalkUtil.entries(JSON.parse(await readFile(file, "utf8")));
|
|
1736
|
-
} catch {
|
|
1737
|
-
return [];
|
|
1738
|
-
}
|
|
1739
|
-
}
|
|
1740
|
-
edit(file, change) {
|
|
1741
|
-
const next = (this.files.get(file) ?? Promise.resolve()).then(async () => {
|
|
1742
|
-
let entries = [];
|
|
1743
|
-
try {
|
|
1744
|
-
entries = TalkUtil.entries(JSON.parse(await readFile(file, "utf8")));
|
|
1745
|
-
} catch {}
|
|
1746
|
-
const changed = change(entries);
|
|
1747
|
-
if (changed === entries) {
|
|
1748
|
-
return;
|
|
1749
|
-
}
|
|
1750
|
-
if (!changed.length) {
|
|
1751
|
-
await rm(file, { force: true });
|
|
1752
|
-
return;
|
|
1753
|
-
}
|
|
1754
|
-
await mkdir(dirname(file), { recursive: true });
|
|
1755
|
-
await writeFile(file, JSON.stringify(changed));
|
|
1756
|
-
});
|
|
1757
|
-
const settled = next.catch(() => {
|
|
1758
|
-
return;
|
|
1759
|
-
});
|
|
1760
|
-
this.files.set(file, settled);
|
|
1761
|
-
settled.then(() => this.files.get(file) === settled && this.files.delete(file));
|
|
1762
|
-
return next;
|
|
1763
|
-
}
|
|
1764
|
-
read_(key) {
|
|
1765
|
-
return this.host.getExtensionData(NAME, key);
|
|
1766
|
-
}
|
|
1767
|
-
write_(key, value) {
|
|
1768
|
-
return this.host.setExtensionData(NAME, key, value);
|
|
1769
|
-
}
|
|
1770
2316
|
}
|
|
1771
2317
|
((MomentsTalk) => {
|
|
1772
2318
|
function role(me) {
|