@celljs/ta 4.16.0 → 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 +2224 -203
- package/dist/gateway.mjs +2011 -528
- package/dist/pi/CHANGELOG.md +12 -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 +278 -105
- package/dist/pi/packages/ta-agents/host/index.mjs +662 -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.js +2 -1
- 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 +688 -148
- 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 +2035 -1534
- 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 +739 -234
- 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/extension/index.mjs +27 -8
- package/dist/pi/packages/ta-glance/lib/card.js +67 -27
- 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.js +3 -3
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +9 -2
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +33 -5
- 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/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 +17 -3
- package/dist/pi/packages/ta-glance/package.json +2 -1
- package/dist/pi/packages/ta-glance/web/index.js +180 -30
- 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 +702 -191
- package/dist/pi/packages/ta-moments/host/index.mjs +1361 -837
- 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 +648 -144
- 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 +1464 -765
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-FSEuUCgT.js → abnfDiagram-S7VZAUFO-w8qXXVn-.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-Do_DyWCg.js → architecture-WOLXFQ4H-B-FHaYwY.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-D-N2qDs4.js → architectureDiagram-YGSQEFNW-DTnoGaaX.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-Ds6DzHNZ.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-KlrZxPbE.js → browser-DXexCqIh.js} +2 -2
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-D5ZdqxrP.js → c4Diagram-KJ2TOQU5-CJJqDqyQ.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-CWOwhB3b.js → chunk-6MUBBAK2-DbvUMdNm.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-Dr6p2RGg.js → chunk-AXFCVDMN-D4hlZGtj.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-DUCV_pmW.js → chunk-BG4553SI-VNa9Q9On.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-Yxd3jIXM.js → chunk-DQASFODM-BtlEbc_V.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-C24I15MF.js → chunk-HFQBQIA3-CAYSo4CJ.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-Dxk-aejD.js → chunk-KQLB2F66-CyKdg6hW.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-DPyr7gb8.js → chunk-KS47KZWR-BMogCB2r.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-D_mEFJGR.js → chunk-LEVMRMFU-Y9wr-8qB.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-DfMFxQib.js → chunk-M57EVK23-DL3IAQKR.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-O9W83Laa.js → chunk-OY52VR5R-CJBFHdg6.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-IdikGcw1.js → chunk-QB3YPZ4I-CyuWKZZv.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-DLpaFCvz.js → chunk-R3KSYZAL-DxvGhfpm.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-Lx-CZ4Ql.js → chunk-STOXU5M4-Cpdl6bfz.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-DCnr5NsA.js → chunk-TU62E6Q5-CIxOg6QF.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-Ct7aUJFY.js → chunk-X4PVCEUW-DCFSCRBh.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-CQhxfoYw.js → chunk-XXDRQBXY-B2R8Cxf7.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-DPSu5qYq.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-CFimsFsN.js → cose-bilkent-JH36ORCC-CXSLFyCH.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-BIcbDns7.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-CiAWhkVp.js → cynefinDiagram-L36ESFBY-DTv0Kn1r.js} +1 -1
- package/dist/public/assets/{d3-selection-C8RIDfkO.js → d3-selection-g4Hl3_NH.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-l1nRD1Fx.js → dagre-SPEB5RXH-BujVqk5R.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-ipqtnhoX.js → diagram-3B7GL73J-Ds-VnLzP.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-VpIcHRUP.js → diagram-DNEMPZML-BBoIIK-a.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-8VdVmcS6.js → diagram-L3MUGCDN-Glgd5N_n.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-Bej-aiF0.js → diagram-LA4NIPWU-B4EODdUU.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-D8gW4bVQ.js → diagram-MHCOC4E2-pzDDXO2J.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-BMevAJ1M.js → diagram-XPFHEONP-l--gwSuK.js} +1 -1
- package/dist/public/assets/{dist-DBKJcjvW.js → dist-C0u3lAFR.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-C3HDTOzn.js → ebnfDiagram-UZSYDL2S-BVfPeaVX.js} +1 -1
- package/dist/public/assets/{editor.api-BMWdjwhK.js → editor.api-BMcewI3C.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-XOOPrVin.js → elk-XV6XMXQE-BFJtUnG9.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-Cr-vwx1l.js → erDiagram-EYBAPDEH-BWxMtfIc.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-DbPhpfxn.js → eventmodeling-K75KTNOO-YwYgBgCX.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Dah4--NW.js +1 -0
- package/dist/public/assets/{freemarker2-6h_1-8qB.js → freemarker2-B8HquI7K.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-C7kNPXx3.js → ganttDiagram-23REXITY-CBqv7wbi.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BwDfrSZS.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-CVnEJEZr.js → gitGraphDiagram-STJD7YCW-BLSf23f_.js} +1 -1
- package/dist/public/assets/{handlebars-F4lp3oLr.js → handlebars-P1qmNq4N.js} +1 -1
- package/dist/public/assets/{html-Dj6f8B_g.js → html-Ceswbytr.js} +1 -1
- package/dist/public/assets/{index-DnNrrk68.js → index-10isUUN4.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-Ch8aMV1p.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-DcttQWdp.js → infoDiagram-KBXO4MBG-LvOtgUlm.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-BSUYTZf6.js → ishikawaDiagram-M35NCXHK-CwUZOvcm.js} +1 -1
- package/dist/public/assets/{javascript-b_BkOE5Y.js → javascript-B3FXC8qR.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-BCfd5-6n.js → journeyDiagram-OPLOXDXO-5j1KtwTt.js} +1 -1
- package/dist/public/assets/{jsonMode-Cq5QJbVZ.js → jsonMode-CrCyxNQI.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-B3nenaw_.js → kanban-definition-BZKZHSQY-BKAB5id1.js} +1 -1
- package/dist/public/assets/{liquid-CGuZI_Aa.js → liquid-CXZRIgp2.js} +1 -1
- package/dist/public/assets/{mdx-Dt9yTqnf.js → mdx-Dm3uNczM.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-CquzROwT.js → mermaid-parser.core-C755A-rX.js} +3 -3
- package/dist/public/assets/{mermaid.core-Bx-e_Scq.js → mermaid.core-CQrYmFAR.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DyeewbnH.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-nvIdDTWu.js → monaco-BS7JBNW4.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-LqMrrc60.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-B884_KoR.js → pegDiagram-FD4XPPHP-BzbBCWht.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-BWzABXQU.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-I40wRwyy.js → pieDiagram-J4AKIIQI-Bf_LDukL.js} +1 -1
- package/dist/public/assets/{python-Djw4wvG9.js → python-jgOUhB-F.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-DyNOImfk.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-3G0zWzgf.js → railroad-abnf-LNEFI6M7-DQGYaRbc.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-B5XRDRWS.js → railroad-ebnf-DWYD2UWJ-D6Ljza0U.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-rcIioIyH.js → railroad-peg-JR7BVNR7-Du9hL1Gf.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-CDM2ahQM.js → railroadDiagram-MRQ6NCDL-CS_JnlGN.js} +1 -1
- package/dist/public/assets/{razor-CStezNUn.js → razor-BWj90God.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-hbb6WtfM.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-DLV3Aoae.js → sankeyDiagram-WGJFYUXA-aK7jRBVK.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-BWxOV5U9.js → sequenceDiagram-5NDRBG5M-BxcIyc38.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-C-TaUPaQ.js → stateDiagram-v2-FJ4FJNEA-Ctletlj4.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-CJY0BFmc.js → swimlanes-UMQ2AFYF-DaD55xd2.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CytCT4x3.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-CUfQb8Gv.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-B7kmi8MF.js → typescript-RgyfxmPQ.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-BKTVAp-G.js → usecaseDiagram-AFA6YXN4-CAVEBKQS.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-CN1RxNTS.js → vennDiagram-NNMJR3RB-DHyJxlHv.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-DSfdKACG.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-JJ6qcpu1.js → wardleyDiagram-S7YFUSEH-C-FCHxR7.js} +1 -1
- package/dist/public/assets/{xml-DVamlHEU.js → xml-DiA1T3iN.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-BNakYgUZ.js → xychartDiagram-GGNKY7IX-BlnHU6Gz.js} +1 -1
- package/dist/public/assets/{yaml-BihGeFrM.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 +10558 -7361
- package/package.json +45 -39
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dcc0sCHf.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-CDXqnHAQ.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-KPsoB6Z1.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-CtM6s0SQ.js +0 -1
- package/dist/public/assets/module-C-ofp7U4.js +0 -1
- package/dist/public/assets/module-DDH-aU6z.js +0 -1
- 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-dnDlIzeV.js +0 -2616
- package/dist/public/assets/module-qoBVcE5h.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-XKjiwdar.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-MuCMavHL.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Cq12GHJS.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-CfeMswZU.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-DdFDl6aK.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-BQ4uUy4s.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-BFTTkjF9.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-BbyzsA8S.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,6 +243,328 @@ 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) {
|
|
@@ -262,19 +626,19 @@ var TaLocation;
|
|
|
262
626
|
TaLocation2.isHost = isHost;
|
|
263
627
|
const FLAGS = /^-[46AaCfGgKkMNnqsTtVvXxYy]+$/;
|
|
264
628
|
function readHost(input) {
|
|
265
|
-
const
|
|
266
|
-
if (
|
|
267
|
-
|
|
629
|
+
const words2 = input.trim().split(/\s+/).filter(Boolean);
|
|
630
|
+
if (words2[0] === "ssh") {
|
|
631
|
+
words2.shift();
|
|
268
632
|
}
|
|
269
633
|
let destination;
|
|
270
634
|
let port;
|
|
271
635
|
let user;
|
|
272
636
|
const options = [];
|
|
273
|
-
for (let i = 0;i <
|
|
274
|
-
const word =
|
|
637
|
+
for (let i = 0;i < words2.length; i++) {
|
|
638
|
+
const word = words2[i];
|
|
275
639
|
const glued = /^-([pl])(.+)$/.exec(word);
|
|
276
640
|
if (word === "-p" || word === "-l" || glued) {
|
|
277
|
-
const value = glued ? glued[2] :
|
|
641
|
+
const value = glued ? glued[2] : words2[++i];
|
|
278
642
|
if (value === undefined) {
|
|
279
643
|
return { error: "invalid" };
|
|
280
644
|
}
|
|
@@ -284,7 +648,7 @@ var TaLocation;
|
|
|
284
648
|
user = value;
|
|
285
649
|
}
|
|
286
650
|
} else if (word === "-o" || word.startsWith("-o")) {
|
|
287
|
-
const value = word === "-o" ?
|
|
651
|
+
const value = word === "-o" ? words2[++i] : word.slice(2);
|
|
288
652
|
const option = /^(port|user)\s*=?\s*(.+)$/i.exec(value !== null && value !== undefined ? value : "");
|
|
289
653
|
if (!option) {
|
|
290
654
|
options.push(`-o ${value !== null && value !== undefined ? value : ""}`.trim());
|
|
@@ -294,7 +658,7 @@ var TaLocation;
|
|
|
294
658
|
user = option[2];
|
|
295
659
|
}
|
|
296
660
|
} else if (FLAGS.test(word)) {} else if (word.startsWith("-")) {
|
|
297
|
-
options.push(/^-[bBcDeEFiIJLmOQRSwW]$/.test(word) &&
|
|
661
|
+
options.push(/^-[bBcDeEFiIJLmOQRSwW]$/.test(word) && words2[i + 1] !== undefined ? `${word} ${words2[++i]}` : word);
|
|
298
662
|
} else if (destination === undefined) {
|
|
299
663
|
destination = word;
|
|
300
664
|
} else {
|
|
@@ -400,44 +764,7 @@ var TaLocation;
|
|
|
400
764
|
return squeezed.length > 1 ? squeezed.replace(/\/$/, "") : squeezed;
|
|
401
765
|
}
|
|
402
766
|
})(TaLocation || (TaLocation = {}));
|
|
403
|
-
// ../ta-protocol/esm/common/
|
|
404
|
-
var TaPackageServer = Symbol("TaPackageServer");
|
|
405
|
-
var TaPackageTextUtil;
|
|
406
|
-
(function(TaPackageTextUtil2) {
|
|
407
|
-
function pick(text, language) {
|
|
408
|
-
var _a, _b, _c, _d, _e;
|
|
409
|
-
if (text === undefined || typeof text === "string") {
|
|
410
|
-
return text;
|
|
411
|
-
}
|
|
412
|
-
const base = language.split("-")[0];
|
|
413
|
-
const kin = Object.keys(text).find((key) => key.split("-")[0] === base);
|
|
414
|
-
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];
|
|
415
|
-
}
|
|
416
|
-
TaPackageTextUtil2.pick = pick;
|
|
417
|
-
})(TaPackageTextUtil || (TaPackageTextUtil = {}));
|
|
418
|
-
// ../ta-protocol/esm/common/ta-protocol.js
|
|
419
|
-
var TaServer = Symbol("TaServer");
|
|
420
|
-
var TaClient = Symbol("TaClient");
|
|
421
|
-
var TaErrorUtil;
|
|
422
|
-
(function(TaErrorUtil2) {
|
|
423
|
-
function code(error) {
|
|
424
|
-
var _a;
|
|
425
|
-
var _b;
|
|
426
|
-
const failure = error;
|
|
427
|
-
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;
|
|
428
|
-
return typeof code2 === "string" ? code2 : undefined;
|
|
429
|
-
}
|
|
430
|
-
TaErrorUtil2.code = code;
|
|
431
|
-
})(TaErrorUtil || (TaErrorUtil = {}));
|
|
432
|
-
var TaSlashCommandUtil;
|
|
433
|
-
(function(TaSlashCommandUtil2) {
|
|
434
|
-
function description(command, language) {
|
|
435
|
-
var _a, _b;
|
|
436
|
-
const { descriptions } = command;
|
|
437
|
-
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;
|
|
438
|
-
}
|
|
439
|
-
TaSlashCommandUtil2.description = description;
|
|
440
|
-
})(TaSlashCommandUtil || (TaSlashCommandUtil = {}));
|
|
767
|
+
// ../ta-protocol/esm/common/message-protocol.js
|
|
441
768
|
var TaMessageContext;
|
|
442
769
|
(function(TaMessageContext2) {
|
|
443
770
|
const BLOCK = /^<context>\n?[\s\S]*?\n?<\/context>\n?/;
|
|
@@ -600,7 +927,168 @@ var TaSkillUse;
|
|
|
600
927
|
}
|
|
601
928
|
TaSkillUse2.command = command;
|
|
602
929
|
})(TaSkillUse || (TaSkillUse = {}));
|
|
603
|
-
|
|
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 = {}));
|
|
604
1092
|
// ../ta-protocol/esm/common/presence-protocol.js
|
|
605
1093
|
var TaPresenceServer = Symbol("TaPresenceServer");
|
|
606
1094
|
var TaMessageAuthor;
|
|
@@ -679,6 +1167,18 @@ var TaRoomWatchUtil;
|
|
|
679
1167
|
})(TaRoomWatchUtil || (TaRoomWatchUtil = {}));
|
|
680
1168
|
// ../ta-protocol/esm/common/settings-protocol.js
|
|
681
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 = {}));
|
|
682
1182
|
// ../ta-protocol/esm/common/team-protocol.js
|
|
683
1183
|
var TA_UNDECLARED = "extensions.install";
|
|
684
1184
|
var TaPermissionUtil;
|
|
@@ -770,6 +1270,8 @@ var TaActionUtil;
|
|
|
770
1270
|
})(TaActionUtil || (TaActionUtil = {}));
|
|
771
1271
|
// ../ta-protocol/esm/common/usage-protocol.js
|
|
772
1272
|
var TaUsageServer = Symbol("TaUsageServer");
|
|
1273
|
+
// ../ta-protocol/esm/common/voice-protocol.js
|
|
1274
|
+
var TaVoiceServer = Symbol("TaVoiceServer");
|
|
773
1275
|
// ../ta-protocol/esm/common/workspace-protocol.js
|
|
774
1276
|
var TaWorkspaceServer = Symbol("TaWorkspaceServer");
|
|
775
1277
|
var TaTerminalServer = Symbol("TaTerminalServer");
|
|
@@ -837,8 +1339,8 @@ var Limits;
|
|
|
837
1339
|
})(Limits ||= {});
|
|
838
1340
|
|
|
839
1341
|
// web-src/talk-host.ts
|
|
840
|
-
import { mkdir, readFile
|
|
841
|
-
import {
|
|
1342
|
+
import { mkdir as mkdir2, readFile as readFile2 } from "node:fs/promises";
|
|
1343
|
+
import { join as join2 } from "node:path";
|
|
842
1344
|
|
|
843
1345
|
// web-src/post-util.ts
|
|
844
1346
|
var ID = /^[0-9a-f]{8}$/;
|
|
@@ -1177,10 +1679,14 @@ var MomentsServerTexts;
|
|
|
1177
1679
|
MomentsServerTexts.take = take;
|
|
1178
1680
|
})(MomentsServerTexts ||= {});
|
|
1179
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
|
+
|
|
1180
1686
|
// web-src/talk-util.ts
|
|
1181
1687
|
var ID2 = /^[0-9a-f]{8}$/;
|
|
1182
1688
|
var PERSON = /^[A-Za-z0-9_-]{1,64}$/;
|
|
1183
|
-
function
|
|
1689
|
+
function words2(value, max) {
|
|
1184
1690
|
const text2 = typeof value === "string" ? value.trim().slice(0, max) : "";
|
|
1185
1691
|
return text2 || undefined;
|
|
1186
1692
|
}
|
|
@@ -1199,7 +1705,7 @@ var TalkUtil;
|
|
|
1199
1705
|
return;
|
|
1200
1706
|
}
|
|
1201
1707
|
const raw = value;
|
|
1202
|
-
const text2 =
|
|
1708
|
+
const text2 = words2(raw.text, raw.double ? Limits.ANSWER_TEXT : Limits.TALK_TEXT);
|
|
1203
1709
|
if (!isId(raw.id) || typeof raw.by !== "string" || !PERSON.test(raw.by) || typeof raw.at !== "number" || !text2) {
|
|
1204
1710
|
return;
|
|
1205
1711
|
}
|
|
@@ -1207,10 +1713,10 @@ var TalkUtil;
|
|
|
1207
1713
|
return {
|
|
1208
1714
|
id: raw.id,
|
|
1209
1715
|
by: raw.by,
|
|
1210
|
-
name:
|
|
1716
|
+
name: words2(raw.name, 60) ?? "",
|
|
1211
1717
|
at: raw.at,
|
|
1212
1718
|
text: text2,
|
|
1213
|
-
...to ? { to, toName:
|
|
1719
|
+
...to ? { to, toName: words2(raw.toName, 60) ?? "" } : {},
|
|
1214
1720
|
...raw.ask === true ? { ask: true } : {},
|
|
1215
1721
|
...raw.double === true ? { double: true } : {},
|
|
1216
1722
|
...isId(raw.re) ? { re: raw.re } : {}
|
|
@@ -1253,7 +1759,7 @@ var TalkUtil;
|
|
|
1253
1759
|
if (raw.t === "ta-moments:unsay" || raw.t === "ta-moments:heard") {
|
|
1254
1760
|
return { t: raw.t, post: raw.post, id: raw.id };
|
|
1255
1761
|
}
|
|
1256
|
-
const text2 =
|
|
1762
|
+
const text2 = words2(raw.text, Limits.TALK_TEXT);
|
|
1257
1763
|
if (raw.t !== "ta-moments:say" || !text2) {
|
|
1258
1764
|
return;
|
|
1259
1765
|
}
|
|
@@ -1302,17 +1808,16 @@ var TalkUtil;
|
|
|
1302
1808
|
TalkUtil.without = without;
|
|
1303
1809
|
})(TalkUtil ||= {});
|
|
1304
1810
|
|
|
1305
|
-
// web-src/talk-host.ts
|
|
1811
|
+
// web-src/talk-host-base.ts
|
|
1306
1812
|
var NOTIFY = "@celljs/ta-notify";
|
|
1307
1813
|
var DAY_MS = 86400000;
|
|
1308
1814
|
var INCOMING_MS = 5 * 60000;
|
|
1309
1815
|
var ANSWER_MS = 3 * 60000;
|
|
1310
|
-
var ANSWER_MARK = "[ta-moments:answers]";
|
|
1311
1816
|
function record(value) {
|
|
1312
1817
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
1313
1818
|
}
|
|
1314
1819
|
|
|
1315
|
-
class
|
|
1820
|
+
class MomentsTalkBase {
|
|
1316
1821
|
host;
|
|
1317
1822
|
paths;
|
|
1318
1823
|
changed;
|
|
@@ -1330,6 +1835,134 @@ class MomentsTalk {
|
|
|
1330
1835
|
this.changed = changed;
|
|
1331
1836
|
this.now = now;
|
|
1332
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 {
|
|
1333
1966
|
async views(room, post, me) {
|
|
1334
1967
|
const owner = room.members.find((member) => member.owner);
|
|
1335
1968
|
const entries = await this.read(room.owner ? this.file(post) : this.cacheFile(room.id, post));
|
|
@@ -1364,11 +1997,11 @@ class MomentsTalk {
|
|
|
1364
1997
|
return shown;
|
|
1365
1998
|
}
|
|
1366
1999
|
async say(room, post, text2, options = {}) {
|
|
1367
|
-
const
|
|
2000
|
+
const words3 = typeof text2 === "string" ? text2.trim().slice(0, Limits.TALK_TEXT) : "";
|
|
1368
2001
|
const value = await this.postOf(room, post);
|
|
1369
|
-
if (!
|
|
2002
|
+
if (!words3 || !value) {
|
|
1370
2003
|
const language2 = TaLanguageUtil.server();
|
|
1371
|
-
throw new Error(
|
|
2004
|
+
throw new Error(words3 ? MomentsServerTexts.notFound(language2) : TaLanguageUtil.pick(language2, {
|
|
1372
2005
|
"zh-CN": "写点什么再发",
|
|
1373
2006
|
"zh-TW": "寫點什麼再發",
|
|
1374
2007
|
"en-US": "Write something first",
|
|
@@ -1381,7 +2014,7 @@ class MomentsTalk {
|
|
|
1381
2014
|
const toName2 = to ? await this.nameOf(room, post, to) : undefined;
|
|
1382
2015
|
await this.edit(this.file(post), (entries) => entries.length >= Limits.TALK ? entries : [
|
|
1383
2016
|
...entries,
|
|
1384
|
-
{ 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 ?? "" } : {} }
|
|
1385
2018
|
]);
|
|
1386
2019
|
await this.push(room, post);
|
|
1387
2020
|
this.changed();
|
|
@@ -1401,7 +2034,7 @@ class MomentsTalk {
|
|
|
1401
2034
|
op: "say",
|
|
1402
2035
|
post,
|
|
1403
2036
|
id: TalkUtil.newId(),
|
|
1404
|
-
text:
|
|
2037
|
+
text: words3,
|
|
1405
2038
|
...to ? { to, toName: toName ?? "" } : {},
|
|
1406
2039
|
...options.ask ? { ask: true } : {},
|
|
1407
2040
|
at: this.now()
|
|
@@ -1597,7 +2230,7 @@ class MomentsTalk {
|
|
|
1597
2230
|
const sessionId = await this.session(key, me.name, question);
|
|
1598
2231
|
const before = await this.host.getState(sessionId);
|
|
1599
2232
|
const earlier = (await this.read(this.file(post))).filter((each) => each.id !== question.id && (each.by === question.by || each.to === question.by));
|
|
1600
|
-
const notes = await
|
|
2233
|
+
const notes = await readFile2(join2(this.paths.post(post), "notes.txt"), "utf8").catch(() => "");
|
|
1601
2234
|
await this.host.prompt(sessionId, {
|
|
1602
2235
|
clientMessageId: `ta-moments:ask:${question.id}`,
|
|
1603
2236
|
message: MomentsTalk.prompt(me.name, value, notes, earlier, question)
|
|
@@ -1635,8 +2268,8 @@ class MomentsTalk {
|
|
|
1635
2268
|
return open.sessionId;
|
|
1636
2269
|
}
|
|
1637
2270
|
}
|
|
1638
|
-
const cwd =
|
|
1639
|
-
await
|
|
2271
|
+
const cwd = join2(this.host.agentDir, "ta-moments", "answers");
|
|
2272
|
+
await mkdir2(cwd, { recursive: true });
|
|
1640
2273
|
const role = MomentsTalk.role(me);
|
|
1641
2274
|
const opened = file ? await this.host.openSession({ cwd, sessionFile: file, appendSystemPrompt: role, group: NAME }).catch(() => {
|
|
1642
2275
|
return;
|
|
@@ -1680,128 +2313,6 @@ class MomentsTalk {
|
|
|
1680
2313
|
this.asks.set(id, [...times, now]);
|
|
1681
2314
|
return true;
|
|
1682
2315
|
}
|
|
1683
|
-
async push(room, post) {
|
|
1684
|
-
const entries = await this.read(this.file(post));
|
|
1685
|
-
const pals = await this.pals();
|
|
1686
|
-
const author = room.members.find((member) => member.owner)?.id ?? "";
|
|
1687
|
-
for (const member of room.members.filter((each) => !each.owner && !each.guest && each.online)) {
|
|
1688
|
-
await this.send(room.id, member.member, post, TalkUtil.visible(entries, member.id, author, pals));
|
|
1689
|
-
}
|
|
1690
|
-
}
|
|
1691
|
-
async send(room, to, post, entries) {
|
|
1692
|
-
const pages = TalkUtil.pages(entries);
|
|
1693
|
-
for (const [part, page] of pages.entries()) {
|
|
1694
|
-
await this.host.rooms.send(room, { t: "ta-moments:talk", post, part, parts: pages.length, entries: page }, to).catch(() => {
|
|
1695
|
-
return;
|
|
1696
|
-
});
|
|
1697
|
-
if (pages.length > 1 && this.pace) {
|
|
1698
|
-
await new Promise((resolve) => setTimeout(resolve, this.pace));
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
async flush(room) {
|
|
1703
|
-
const owner = room.members.find((member) => member.owner);
|
|
1704
|
-
if (!owner?.online) {
|
|
1705
|
-
return;
|
|
1706
|
-
}
|
|
1707
|
-
for (const item of record(await this.read_(Keys.OUTBOX))[room.id] ?? []) {
|
|
1708
|
-
const message = item.op === "say" ? {
|
|
1709
|
-
t: "ta-moments:say",
|
|
1710
|
-
post: item.post,
|
|
1711
|
-
id: item.id,
|
|
1712
|
-
text: item.text,
|
|
1713
|
-
...item.to ? { to: item.to } : {},
|
|
1714
|
-
...item.ask ? { ask: true } : {}
|
|
1715
|
-
} : { t: "ta-moments:unsay", post: item.post, id: item.id };
|
|
1716
|
-
await this.host.rooms.send(room.id, message, owner.member).catch(() => {
|
|
1717
|
-
return;
|
|
1718
|
-
});
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
async queue(room, item) {
|
|
1722
|
-
const outbox = record(await this.read_(Keys.OUTBOX));
|
|
1723
|
-
if (Object.values(outbox).flat().length >= Limits.OUTBOX) {
|
|
1724
|
-
const language2 = TaLanguageUtil.server();
|
|
1725
|
-
throw new Error(TaLanguageUtil.pick(language2, {
|
|
1726
|
-
"zh-CN": "还有太多话没送到,等对方上线后再说",
|
|
1727
|
-
"zh-TW": "還有太多話沒送到,等對方上線後再說",
|
|
1728
|
-
"en-US": "Too much is waiting for its authors: try once they are online",
|
|
1729
|
-
"ja-JP": "多くの内容が送信されるのを待っています。対方がオンラインになったら試してください"
|
|
1730
|
-
}));
|
|
1731
|
-
}
|
|
1732
|
-
outbox[room] = [...outbox[room] ?? [], item];
|
|
1733
|
-
await this.write_(Keys.OUTBOX, outbox);
|
|
1734
|
-
}
|
|
1735
|
-
async pals() {
|
|
1736
|
-
const pals = record(await this.read_(Keys.PALS));
|
|
1737
|
-
return (a, b) => !!pals[a]?.includes(b) && !!pals[b]?.includes(a);
|
|
1738
|
-
}
|
|
1739
|
-
async postOf(room, post) {
|
|
1740
|
-
const owner = room.members.find((member) => member.owner);
|
|
1741
|
-
if (!owner || !PostUtil.isId(post) || room.status !== "member") {
|
|
1742
|
-
return;
|
|
1743
|
-
}
|
|
1744
|
-
const value = (await this.host.rooms.getState(room.id, `${StateKeys.POST}${post}`))[`${StateKeys.POST}${post}`];
|
|
1745
|
-
const checked = value?.by === owner.member ? PostUtil.check(value.value) : undefined;
|
|
1746
|
-
return checked && (checked.until === undefined || checked.until > this.now()) ? checked : undefined;
|
|
1747
|
-
}
|
|
1748
|
-
async nameOf(room, post, id) {
|
|
1749
|
-
const member = room.members.find((each) => each.id === id);
|
|
1750
|
-
if (member) {
|
|
1751
|
-
return member.name;
|
|
1752
|
-
}
|
|
1753
|
-
const entries = await this.read(room.owner ? this.file(post) : this.cacheFile(room.id, post));
|
|
1754
|
-
return entries.find((each) => each.by === id)?.name;
|
|
1755
|
-
}
|
|
1756
|
-
async notify(id, text2) {
|
|
1757
|
-
await this.host.callPackageHost(NOTIFY, "notify", [{ from: NAME, id, level: "done", title: MomentsServerTexts.roomTitle(TaLanguageUtil.server()), text: text2, view: VIEW }]).catch(() => {
|
|
1758
|
-
return;
|
|
1759
|
-
});
|
|
1760
|
-
}
|
|
1761
|
-
file(post) {
|
|
1762
|
-
return join(this.paths.post(post), "talk.json");
|
|
1763
|
-
}
|
|
1764
|
-
cacheFile(room, post) {
|
|
1765
|
-
return join(this.paths.cache(room, post), "talk.json");
|
|
1766
|
-
}
|
|
1767
|
-
async read(file) {
|
|
1768
|
-
await this.files.get(file);
|
|
1769
|
-
try {
|
|
1770
|
-
return TalkUtil.entries(JSON.parse(await readFile(file, "utf8")));
|
|
1771
|
-
} catch {
|
|
1772
|
-
return [];
|
|
1773
|
-
}
|
|
1774
|
-
}
|
|
1775
|
-
edit(file, change) {
|
|
1776
|
-
const next = (this.files.get(file) ?? Promise.resolve()).then(async () => {
|
|
1777
|
-
let entries = [];
|
|
1778
|
-
try {
|
|
1779
|
-
entries = TalkUtil.entries(JSON.parse(await readFile(file, "utf8")));
|
|
1780
|
-
} catch {}
|
|
1781
|
-
const changed = change(entries);
|
|
1782
|
-
if (changed === entries) {
|
|
1783
|
-
return;
|
|
1784
|
-
}
|
|
1785
|
-
if (!changed.length) {
|
|
1786
|
-
await rm(file, { force: true });
|
|
1787
|
-
return;
|
|
1788
|
-
}
|
|
1789
|
-
await mkdir(dirname(file), { recursive: true });
|
|
1790
|
-
await writeFile(file, JSON.stringify(changed));
|
|
1791
|
-
});
|
|
1792
|
-
const settled = next.catch(() => {
|
|
1793
|
-
return;
|
|
1794
|
-
});
|
|
1795
|
-
this.files.set(file, settled);
|
|
1796
|
-
settled.then(() => this.files.get(file) === settled && this.files.delete(file));
|
|
1797
|
-
return next;
|
|
1798
|
-
}
|
|
1799
|
-
read_(key) {
|
|
1800
|
-
return this.host.getExtensionData(NAME, key);
|
|
1801
|
-
}
|
|
1802
|
-
write_(key, value) {
|
|
1803
|
-
return this.host.setExtensionData(NAME, key, value);
|
|
1804
|
-
}
|
|
1805
2316
|
}
|
|
1806
2317
|
((MomentsTalk) => {
|
|
1807
2318
|
function role(me) {
|