@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
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NearbyServiceBase = exports.ROOMS_KIND = exports.MET_MS = exports.MEET_A_DAY = exports.GREET_KIND = exports.MEET_KIND = exports.ROOM_KIND = exports.NOTIFY = exports.INITIATIVE = exports.IDENTITY_MS = exports.TICK_MS = exports.SKEW_MS = exports.PROPOSE_GAP_MS = exports.GATHER_MS = exports.INVITE_MS = exports.GONE_MS = void 0;
|
|
4
|
+
const relay_faces_1 = require("@celljs/ta-relay/lib/common/relay-faces");
|
|
5
|
+
const nearby_crypto_1 = require("./nearby-crypto");
|
|
6
|
+
const nearby_net_1 = require("./nearby-net");
|
|
7
|
+
const nearby_protocol_1 = require("./nearby-protocol");
|
|
8
|
+
/** Not heard for this long: gone. */
|
|
9
|
+
exports.GONE_MS = 10000;
|
|
10
|
+
/** An invitation waits this long for the user. */
|
|
11
|
+
exports.INVITE_MS = 10 * 60000;
|
|
12
|
+
/** Together this long: a meeting, worth a room. */
|
|
13
|
+
exports.GATHER_MS = 5 * 60000;
|
|
14
|
+
/** No proposal of a room sooner after the last one, or after a room was made. */
|
|
15
|
+
exports.PROPOSE_GAP_MS = 2 * 60 * 60000;
|
|
16
|
+
/** Messages older or newer than this are dropped. */
|
|
17
|
+
exports.SKEW_MS = 5 * 60000;
|
|
18
|
+
exports.TICK_MS = 2000;
|
|
19
|
+
/** How often the identity is read again while visible: its name or look may change. */
|
|
20
|
+
exports.IDENTITY_MS = 10000;
|
|
21
|
+
exports.INITIATIVE = '@celljs/ta-initiative';
|
|
22
|
+
exports.NOTIFY = '@celljs/ta-notify';
|
|
23
|
+
exports.ROOM_KIND = 'nearby.room';
|
|
24
|
+
exports.MEET_KIND = 'nearby.meet';
|
|
25
|
+
exports.GREET_KIND = 'nearby.greet';
|
|
26
|
+
/** Proposals to meet a day at most. */
|
|
27
|
+
exports.MEET_A_DAY = 3;
|
|
28
|
+
/** One proposed to meet is not again for this long. */
|
|
29
|
+
exports.MET_MS = 30 * 24 * 60 * 60000;
|
|
30
|
+
/** The plain rooms of ta-rooms: a group chat. */
|
|
31
|
+
exports.ROOMS_KIND = 'ta-rooms';
|
|
32
|
+
class NearbyServiceBase {
|
|
33
|
+
constructor(host, options = {}) {
|
|
34
|
+
var _a;
|
|
35
|
+
this.host = host;
|
|
36
|
+
this.options = options;
|
|
37
|
+
this.settings = {};
|
|
38
|
+
this.heard = new Map();
|
|
39
|
+
this.sent = new Map();
|
|
40
|
+
this.received = new Map();
|
|
41
|
+
/** When the identity was last read. */
|
|
42
|
+
this.identityAt = 0;
|
|
43
|
+
this.friends = [];
|
|
44
|
+
this.friendsAt = 0;
|
|
45
|
+
this.published = '';
|
|
46
|
+
this.proposedAt = 0;
|
|
47
|
+
this.madeAt = 0;
|
|
48
|
+
this.defined = false;
|
|
49
|
+
this.cards = {};
|
|
50
|
+
this.met = {};
|
|
51
|
+
this.greets = new Map();
|
|
52
|
+
/** Hellos this one said, by their greeting: to whom, and why for this one. */
|
|
53
|
+
this.hellos = new Map();
|
|
54
|
+
/** Greetings the user said yes to: the room that comes of them is joined at once. */
|
|
55
|
+
this.greeted = new Map();
|
|
56
|
+
this.kinds = new Set();
|
|
57
|
+
this.now = (_a = options.now) !== null && _a !== void 0 ? _a : Date.now;
|
|
58
|
+
}
|
|
59
|
+
// Visibility.
|
|
60
|
+
async setVisible(on, minutes) {
|
|
61
|
+
if (!on) {
|
|
62
|
+
this.close();
|
|
63
|
+
await this.host.setExtensionData(nearby_protocol_1.NAME, nearby_protocol_1.NearbyKeys.VISIBLE, null);
|
|
64
|
+
return this.publish(true);
|
|
65
|
+
}
|
|
66
|
+
const now = this.now();
|
|
67
|
+
const visible = { since: now, ...(typeof minutes === 'number' && minutes > 0 ? { until: now + Math.round(minutes) * 60000 } : {}) };
|
|
68
|
+
await this.host.setExtensionData(nearby_protocol_1.NAME, nearby_protocol_1.NearbyKeys.VISIBLE, visible);
|
|
69
|
+
this.close();
|
|
70
|
+
await this.open(visible);
|
|
71
|
+
return this.status();
|
|
72
|
+
}
|
|
73
|
+
async open(visible) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
this.visible = visible;
|
|
76
|
+
this.error = undefined;
|
|
77
|
+
await this.loadIdentity();
|
|
78
|
+
this.keys = new nearby_crypto_1.NearbyKeys(this.now());
|
|
79
|
+
const channel = new nearby_net_1.NearbyChannel(frame => this.receive(frame));
|
|
80
|
+
const port = Number(process.env.TA_NEARBY_PORT) || this.options.port || nearby_protocol_1.NEARBY_PORT;
|
|
81
|
+
const beacon = new nearby_net_1.NearbyBeacon({ port, targets: this.options.targets, intervalMs: this.options.intervalMs }, (data, address) => this.hear(data, address));
|
|
82
|
+
try {
|
|
83
|
+
await channel.start();
|
|
84
|
+
await beacon.start(() => this.beaconData(channel.port));
|
|
85
|
+
this.channel = channel;
|
|
86
|
+
this.beacon = beacon;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
channel.stop();
|
|
90
|
+
beacon.stop();
|
|
91
|
+
this.error = error instanceof Error ? error.message : String(error);
|
|
92
|
+
}
|
|
93
|
+
clearInterval(this.timer);
|
|
94
|
+
this.timer = setInterval(() => void this.tick(), exports.TICK_MS);
|
|
95
|
+
(_b = (_a = this.timer).unref) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
96
|
+
await this.publish(true);
|
|
97
|
+
}
|
|
98
|
+
close() {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
this.leaveSpot();
|
|
101
|
+
clearInterval(this.timer);
|
|
102
|
+
this.timer = undefined;
|
|
103
|
+
(_a = this.beacon) === null || _a === void 0 ? void 0 : _a.stop();
|
|
104
|
+
(_b = this.channel) === null || _b === void 0 ? void 0 : _b.stop();
|
|
105
|
+
this.beacon = undefined;
|
|
106
|
+
this.channel = undefined;
|
|
107
|
+
this.visible = undefined;
|
|
108
|
+
this.keys = undefined;
|
|
109
|
+
this.previous = undefined;
|
|
110
|
+
this.heard.clear();
|
|
111
|
+
}
|
|
112
|
+
beaconData(port) {
|
|
113
|
+
var _a, _b;
|
|
114
|
+
var _c;
|
|
115
|
+
const keys = this.keys;
|
|
116
|
+
return {
|
|
117
|
+
t: 'ta-near',
|
|
118
|
+
v: 1,
|
|
119
|
+
e: keys.e,
|
|
120
|
+
n: this.selfName(),
|
|
121
|
+
f: this.identity ? relay_faces_1.FaceUtil.of(this.identity.id) : 0,
|
|
122
|
+
...(((_a = this.identity) === null || _a === void 0 ? void 0 : _a.look) ? { l: this.identity.look } : {}),
|
|
123
|
+
p: port,
|
|
124
|
+
a: nearby_net_1.NearbyNetUtil.addresses(),
|
|
125
|
+
x: keys.x,
|
|
126
|
+
h: nearby_crypto_1.NearbyCrypto.mark((_c = (_b = this.identity) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : '', nearby_crypto_1.NearbyCrypto.slot(this.now())),
|
|
127
|
+
...(this.offers().length ? { o: this.offers() } : {}),
|
|
128
|
+
...(this.meets() ? { m: 1 } : {}),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/** What this Ta offers those nearby, as the user set it. */
|
|
132
|
+
offers() {
|
|
133
|
+
return [...(this.settings.show !== 'off' ? ['show'] : []), ...(this.settings.work ? ['work'] : [])];
|
|
134
|
+
}
|
|
135
|
+
/** Open to meet, with a card to show. */
|
|
136
|
+
meets() {
|
|
137
|
+
return this.settings.meet === true && !!this.cards.card;
|
|
138
|
+
}
|
|
139
|
+
selfName() {
|
|
140
|
+
var _a;
|
|
141
|
+
var _b;
|
|
142
|
+
return this.settings.hideName ? '' : ((_b = (_a = this.identity) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : '').slice(0, 40);
|
|
143
|
+
}
|
|
144
|
+
async loadIdentity() {
|
|
145
|
+
this.identityAt = this.now();
|
|
146
|
+
try {
|
|
147
|
+
const identity = await this.host.rooms.getIdentity();
|
|
148
|
+
this.identity = { id: identity.id, name: identity.name, ...(identity.look ? { look: identity.look } : {}) };
|
|
149
|
+
}
|
|
150
|
+
catch (_a) {
|
|
151
|
+
// Rooms are off: no mark of its own.
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async tick() {
|
|
155
|
+
var _a;
|
|
156
|
+
const now = this.now();
|
|
157
|
+
if (((_a = this.visible) === null || _a === void 0 ? void 0 : _a.until) !== undefined && this.visible.until <= now) {
|
|
158
|
+
this.close();
|
|
159
|
+
await this.host.setExtensionData(nearby_protocol_1.NAME, nearby_protocol_1.NearbyKeys.VISIBLE, null).catch(() => undefined);
|
|
160
|
+
await this.publish(true);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
// The double's look may have changed: the next beacon says it.
|
|
164
|
+
if (this.keys && now - this.identityAt >= exports.IDENTITY_MS) {
|
|
165
|
+
await this.loadIdentity();
|
|
166
|
+
}
|
|
167
|
+
if (this.keys && now - this.keys.createdAt >= nearby_crypto_1.SLOT_MS) {
|
|
168
|
+
this.previous = this.keys;
|
|
169
|
+
this.keys = new nearby_crypto_1.NearbyKeys(now);
|
|
170
|
+
}
|
|
171
|
+
// What was sealed for the id of before still opens for a minute.
|
|
172
|
+
if (this.previous && this.keys && now - this.keys.createdAt > 60000) {
|
|
173
|
+
this.previous = undefined;
|
|
174
|
+
}
|
|
175
|
+
for (const [e, heard] of this.heard) {
|
|
176
|
+
if (now - heard.seen > exports.GONE_MS) {
|
|
177
|
+
this.heard.delete(e);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
for (const [k, invite] of this.received) {
|
|
181
|
+
if (now - invite.at >= exports.INVITE_MS) {
|
|
182
|
+
this.received.delete(k);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (const [k, greet] of this.greets) {
|
|
186
|
+
if (now - greet.at >= exports.INVITE_MS) {
|
|
187
|
+
this.greets.delete(k);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
for (const [k, hello] of this.hellos) {
|
|
191
|
+
if (now - hello.at >= 24 * 60 * 60000) {
|
|
192
|
+
this.hellos.delete(k);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
for (const [k, at] of this.greeted) {
|
|
196
|
+
if (now - at >= exports.INVITE_MS) {
|
|
197
|
+
this.greeted.delete(k);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
for (const [k, sent] of this.sent) {
|
|
201
|
+
if (now - sent.at >= 24 * 60 * 60000) {
|
|
202
|
+
this.sent.delete(k);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// A card that did not go (the other had not heard us yet) goes again.
|
|
206
|
+
for (const heard of this.heard.values()) {
|
|
207
|
+
void this.exchangeCard(heard);
|
|
208
|
+
}
|
|
209
|
+
await this.publish();
|
|
210
|
+
await this.propose().catch(() => undefined);
|
|
211
|
+
}
|
|
212
|
+
// The others.
|
|
213
|
+
hear(data, address, via) {
|
|
214
|
+
var _a, _b, _c;
|
|
215
|
+
if (!this.keys || data.e === this.keys.e || data.e === ((_a = this.previous) === null || _a === void 0 ? void 0 : _a.e)) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const before = this.heard.get(data.e);
|
|
219
|
+
// Heard on the network too: straight is better than through the relay.
|
|
220
|
+
if (before && via && !before.via) {
|
|
221
|
+
before.seen = this.now();
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
const now = this.now();
|
|
225
|
+
// This Ta on another computer of the user's (an identity shared): not someone around.
|
|
226
|
+
if (this.identity && nearby_crypto_1.NearbyCrypto.marks(this.identity.id, data.h, now)) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const known = this.heard.get(data.e);
|
|
230
|
+
if (known && known.data.x !== data.x) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const heard = known ? { ...known, data, address, seen: now, via } : { data, address, since: now, seen: now, ...(via ? { via } : {}) };
|
|
234
|
+
if (!via) {
|
|
235
|
+
delete heard.via;
|
|
236
|
+
}
|
|
237
|
+
// One that changed its temporary id is the same one: it stays as long as it stayed.
|
|
238
|
+
if (!known) {
|
|
239
|
+
const friend = this.recognize(data.h, now);
|
|
240
|
+
if (friend) {
|
|
241
|
+
heard.friend = friend;
|
|
242
|
+
for (const [e, other] of this.heard) {
|
|
243
|
+
if (((_b = other.friend) === null || _b === void 0 ? void 0 : _b.id) === friend.id) {
|
|
244
|
+
heard.since = Math.min(heard.since, other.since);
|
|
245
|
+
this.heard.delete(e);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
this.heard.set(data.e, heard);
|
|
251
|
+
if (!known) {
|
|
252
|
+
void this.exchangeCard(heard);
|
|
253
|
+
// It heard us first, maybe, and may say something at once: let it hear us now too.
|
|
254
|
+
if (via) {
|
|
255
|
+
this.announceSpot(via);
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
(_c = this.beacon) === null || _c === void 0 ? void 0 : _c.sendNow();
|
|
259
|
+
}
|
|
260
|
+
void this.refreshFriends();
|
|
261
|
+
void this.publish();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
recognize(mark, now) {
|
|
265
|
+
const friend = this.friends.find(one => nearby_crypto_1.NearbyCrypto.marks(one.id, mark, now));
|
|
266
|
+
return friend ? { id: friend.id, name: friend.name } : undefined;
|
|
267
|
+
}
|
|
268
|
+
async refreshFriends() {
|
|
269
|
+
if (this.now() - this.friendsAt < 60000) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
this.friendsAt = this.now();
|
|
273
|
+
this.friends = await this.host.rooms.listFriends().catch(() => this.friends);
|
|
274
|
+
let changed = false;
|
|
275
|
+
for (const heard of this.heard.values()) {
|
|
276
|
+
if (!heard.friend) {
|
|
277
|
+
heard.friend = this.recognize(heard.data.h, this.now());
|
|
278
|
+
changed || (changed = !!heard.friend);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (changed) {
|
|
282
|
+
await this.publish();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/** A sealed message to one around; its sealed answer. */
|
|
286
|
+
async send(e, message) {
|
|
287
|
+
const heard = this.heard.get(e);
|
|
288
|
+
const keys = this.keys;
|
|
289
|
+
if (!heard || !keys) {
|
|
290
|
+
throw new Error('No longer nearby.');
|
|
291
|
+
}
|
|
292
|
+
const key = keys.keyWith(heard.data.e, heard.data.x);
|
|
293
|
+
const frame = { v: 1, e: keys.e, x: keys.x, to: heard.data.e, ...nearby_crypto_1.NearbyCrypto.seal(key, message) };
|
|
294
|
+
const answer = heard.via
|
|
295
|
+
? NearbyServiceBase.frame(await heard.via.request(heard.data.e, frame))
|
|
296
|
+
: await nearby_net_1.NearbyNetUtil.send([...new Set([heard.address, ...heard.data.a])], heard.data.p, frame);
|
|
297
|
+
if (!answer) {
|
|
298
|
+
throw new Error('No answer.');
|
|
299
|
+
}
|
|
300
|
+
return nearby_crypto_1.NearbyCrypto.open(key, answer);
|
|
301
|
+
}
|
|
302
|
+
async receive(frame) {
|
|
303
|
+
var _a, _b;
|
|
304
|
+
const keys = frame.to === ((_a = this.keys) === null || _a === void 0 ? void 0 : _a.e) ? this.keys : frame.to === ((_b = this.previous) === null || _b === void 0 ? void 0 : _b.e) ? this.previous : undefined;
|
|
305
|
+
const heard = this.heard.get(frame.e);
|
|
306
|
+
// Only from one heard around, with the key it said.
|
|
307
|
+
if (!keys || !heard || heard.data.x !== frame.x) {
|
|
308
|
+
return undefined;
|
|
309
|
+
}
|
|
310
|
+
const key = keys.keyWith(frame.e, frame.x);
|
|
311
|
+
const message = nearby_crypto_1.NearbyCrypto.open(key, frame);
|
|
312
|
+
if (!message || typeof message !== 'object' || typeof message.at !== 'number' || Math.abs(this.now() - message.at) > exports.SKEW_MS) {
|
|
313
|
+
return undefined;
|
|
314
|
+
}
|
|
315
|
+
const answer = await this.handle(message, heard);
|
|
316
|
+
return { v: 1, e: keys.e, x: keys.x, to: frame.e, ...nearby_crypto_1.NearbyCrypto.seal(key, answer) };
|
|
317
|
+
}
|
|
318
|
+
/** A frame of the channel as a spot passed it, checked. */
|
|
319
|
+
static frame(value) {
|
|
320
|
+
const frame = value;
|
|
321
|
+
return frame &&
|
|
322
|
+
frame.v === 1 &&
|
|
323
|
+
[frame.e, frame.x, frame.to, frame.i, frame.c].every(part => typeof part === 'string' && part.length > 0 && part.length < 2000000)
|
|
324
|
+
? frame
|
|
325
|
+
: undefined;
|
|
326
|
+
}
|
|
327
|
+
// Data.
|
|
328
|
+
async read(key) {
|
|
329
|
+
return this.host.getExtensionData(nearby_protocol_1.NAME, key).catch(() => undefined);
|
|
330
|
+
}
|
|
331
|
+
/** The status for the pages, when it changed (or `force`). */
|
|
332
|
+
async publish(force = false) {
|
|
333
|
+
const status = this.status();
|
|
334
|
+
const text = JSON.stringify(status);
|
|
335
|
+
if (force || text !== this.published) {
|
|
336
|
+
this.published = text;
|
|
337
|
+
await this.host.setExtensionData(nearby_protocol_1.NAME, nearby_protocol_1.NearbyKeys.STATUS, status).catch(() => undefined);
|
|
338
|
+
}
|
|
339
|
+
return status;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
exports.NearbyServiceBase = NearbyServiceBase;
|
|
343
|
+
//# sourceMappingURL=nearby-service-base.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { TaLanguage } from '@celljs/ta-protocol/lib/common/language';
|
|
2
|
+
import { type NearbyReason } from './nearby-meet';
|
|
3
|
+
import { type NearbyMessage, type NearbyRequest, type NearbySettings, type NearbyShowAnswer, type NearbyShowContent, type NearbyShowKind, type NearbyShown, type NearbyStatus } from './nearby-protocol';
|
|
4
|
+
import { type Heard, NearbyServiceBase } from './nearby-service-base';
|
|
5
|
+
export declare abstract class NearbyServiceMeet extends NearbyServiceBase {
|
|
6
|
+
/** Shows something on the screen of one nearby: how it took it. */
|
|
7
|
+
show(e: string, title: string, kind: NearbyShowKind, data: string): Promise<NearbyShowAnswer>;
|
|
8
|
+
protected takeShow(k: string, message: Extract<NearbyMessage, {
|
|
9
|
+
t: 'show';
|
|
10
|
+
}>, heard: Heard): Promise<NearbyShowAnswer>;
|
|
11
|
+
protected shownContent(k: string): NearbyShowContent;
|
|
12
|
+
protected answerShow(k: string, action: 'accept' | 'close'): Promise<NearbyStatus>;
|
|
13
|
+
static withoutData(shown: NearbyShown & {
|
|
14
|
+
data?: string;
|
|
15
|
+
}): NearbyShown;
|
|
16
|
+
static settingsOf(value: unknown): NearbySettings;
|
|
17
|
+
protected setCards(request: Extract<NearbyRequest, {
|
|
18
|
+
kind: 'cards';
|
|
19
|
+
}>): Promise<NearbyStatus>;
|
|
20
|
+
/** Ta drafts the card in a conversation of its own, saving it with nearby_card; the user looks at it before it is used. */
|
|
21
|
+
protected draftCard(): Promise<{
|
|
22
|
+
sessionId: string;
|
|
23
|
+
}>;
|
|
24
|
+
/** Cards go both ways in one round trip, once for each temporary id, between two open to meet. */
|
|
25
|
+
protected exchangeCard(heard: Heard): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* A reason to meet one: proposed to the user (ta-initiative), never acted on alone. One proposes of two: the one who
|
|
28
|
+
* looks for what the other offers, or, of two with topics in common, the one of the smaller id.
|
|
29
|
+
*/
|
|
30
|
+
protected considerMeet(heard: Heard): Promise<void>;
|
|
31
|
+
/** The reason as it goes, for the other to read: its words for the other side. */
|
|
32
|
+
static reasonFor(reason: NearbyReason): string;
|
|
33
|
+
protected hello(e: string, why: string | undefined): Promise<NearbyStatus>;
|
|
34
|
+
protected takeHello(k: string, message: Extract<NearbyMessage, {
|
|
35
|
+
t: 'hello';
|
|
36
|
+
}>, heard: Heard): Promise<boolean>;
|
|
37
|
+
/** Yes: the other's Ta makes a room of the two, joined at once. No: nothing is said; they see no answer. */
|
|
38
|
+
protected greet(k: string, accept: boolean): Promise<NearbyStatus>;
|
|
39
|
+
protected defineKind(id: string, words: Record<TaLanguage, string>): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=nearby-service-meet.d.ts.map
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NearbyServiceMeet = void 0;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const nearby_meet_1 = require("./nearby-meet");
|
|
6
|
+
const nearby_protocol_1 = require("./nearby-protocol");
|
|
7
|
+
const nearby_service_base_1 = require("./nearby-service-base");
|
|
8
|
+
const server_texts_1 = require("./server-texts");
|
|
9
|
+
class NearbyServiceMeet extends nearby_service_base_1.NearbyServiceBase {
|
|
10
|
+
// Showing (docs/design/ta-nearby.md 4.2).
|
|
11
|
+
/** Shows something on the screen of one nearby: how it took it. */
|
|
12
|
+
async show(e, title, kind, data) {
|
|
13
|
+
var _a;
|
|
14
|
+
const heard = this.heard.get(e);
|
|
15
|
+
if (!heard) {
|
|
16
|
+
throw new Error('No longer nearby.');
|
|
17
|
+
}
|
|
18
|
+
if (!((_a = heard.data.o) !== null && _a !== void 0 ? _a : []).includes('show')) {
|
|
19
|
+
return 'refused';
|
|
20
|
+
}
|
|
21
|
+
if (data.length > nearby_protocol_1.SHOW_MAX) {
|
|
22
|
+
throw new Error(`Too large to show: ${Math.round(nearby_protocol_1.SHOW_MAX / 1024)} KB at most.`);
|
|
23
|
+
}
|
|
24
|
+
const k = (0, node_crypto_1.randomBytes)(12).toString('base64url');
|
|
25
|
+
const answer = (await this.send(e, { t: 'show', at: this.now(), k, title: title.slice(0, 120), kind, data }));
|
|
26
|
+
return (answer === null || answer === void 0 ? void 0 : answer.answer) === 'shown' || (answer === null || answer === void 0 ? void 0 : answer.answer) === 'asked' ? answer.answer : 'refused';
|
|
27
|
+
}
|
|
28
|
+
async takeShow(k, message, heard) {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const mode = (_a = this.settings.show) !== null && _a !== void 0 ? _a : 'ask';
|
|
31
|
+
const kinds = ['html', 'markdown', 'image', 'text'];
|
|
32
|
+
if (mode === 'off' || !kinds.includes(message.kind) || typeof message.data !== 'string' || message.data.length > nearby_protocol_1.SHOW_MAX) {
|
|
33
|
+
return 'refused';
|
|
34
|
+
}
|
|
35
|
+
if (message.kind === 'image' && !/^data:image\/(png|jpeg|gif|webp);base64,/.test(message.data)) {
|
|
36
|
+
return 'refused';
|
|
37
|
+
}
|
|
38
|
+
this.shown = {
|
|
39
|
+
k,
|
|
40
|
+
title: String((_b = message.title) !== null && _b !== void 0 ? _b : '').slice(0, 120) || server_texts_1.NearbyTexts.nearby(),
|
|
41
|
+
kind: message.kind,
|
|
42
|
+
name: heard.data.n,
|
|
43
|
+
face: heard.data.f,
|
|
44
|
+
...(heard.data.l ? { look: heard.data.l } : {}),
|
|
45
|
+
...(heard.friend ? { friend: heard.friend } : {}),
|
|
46
|
+
ask: mode === 'ask',
|
|
47
|
+
at: this.now(),
|
|
48
|
+
data: message.data,
|
|
49
|
+
};
|
|
50
|
+
await this.publish(true);
|
|
51
|
+
if (mode === 'ask') {
|
|
52
|
+
await this.host
|
|
53
|
+
.callPackageHost(nearby_service_base_1.NOTIFY, 'notify', [
|
|
54
|
+
{
|
|
55
|
+
from: nearby_protocol_1.NAME,
|
|
56
|
+
id: `show:${k}`,
|
|
57
|
+
level: 'ask',
|
|
58
|
+
title: server_texts_1.NearbyTexts.nearby(),
|
|
59
|
+
text: server_texts_1.NearbyTexts.wantsToShow(server_texts_1.NearbyTexts.who({ name: heard.data.n, friend: heard.friend }), this.shown.title),
|
|
60
|
+
view: nearby_protocol_1.NEARBY_VIEW,
|
|
61
|
+
},
|
|
62
|
+
])
|
|
63
|
+
.catch(() => undefined);
|
|
64
|
+
return 'asked';
|
|
65
|
+
}
|
|
66
|
+
return 'shown';
|
|
67
|
+
}
|
|
68
|
+
shownContent(k) {
|
|
69
|
+
const shown = this.shown;
|
|
70
|
+
if (!shown || shown.k !== k || shown.ask) {
|
|
71
|
+
throw new Error('Nothing to show.');
|
|
72
|
+
}
|
|
73
|
+
return { k, title: shown.title, kind: shown.kind, data: shown.data };
|
|
74
|
+
}
|
|
75
|
+
async answerShow(k, action) {
|
|
76
|
+
var _a;
|
|
77
|
+
if (((_a = this.shown) === null || _a === void 0 ? void 0 : _a.k) === k) {
|
|
78
|
+
if (action === 'accept') {
|
|
79
|
+
this.shown = { ...this.shown, ask: false };
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
this.shown = undefined;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return this.publish(true);
|
|
86
|
+
}
|
|
87
|
+
static withoutData(shown) {
|
|
88
|
+
const { data: _, ...rest } = shown;
|
|
89
|
+
return rest;
|
|
90
|
+
}
|
|
91
|
+
static settingsOf(value) {
|
|
92
|
+
const settings = value && typeof value === 'object' ? value : {};
|
|
93
|
+
return {
|
|
94
|
+
...(settings.hideName === true ? { hideName: true } : {}),
|
|
95
|
+
show: settings.show === 'off' || settings.show === 'auto' ? settings.show : 'ask',
|
|
96
|
+
...(settings.work === true ? { work: true } : {}),
|
|
97
|
+
...(settings.meet === true ? { meet: true } : {}),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// Meeting (docs/design/ta-nearby.md 5).
|
|
101
|
+
async setCards(request) {
|
|
102
|
+
const next = { ...this.cards };
|
|
103
|
+
if (request.draft !== undefined) {
|
|
104
|
+
const draft = nearby_meet_1.NearbyMeetUtil.card(request.draft);
|
|
105
|
+
if (!draft) {
|
|
106
|
+
throw new Error('The card says nothing.');
|
|
107
|
+
}
|
|
108
|
+
next.draft = draft;
|
|
109
|
+
}
|
|
110
|
+
if (request.card === null) {
|
|
111
|
+
delete next.card;
|
|
112
|
+
}
|
|
113
|
+
else if (request.card !== undefined) {
|
|
114
|
+
const card = nearby_meet_1.NearbyMeetUtil.card(request.card);
|
|
115
|
+
if (!card) {
|
|
116
|
+
throw new Error('The card says nothing.');
|
|
117
|
+
}
|
|
118
|
+
next.card = card;
|
|
119
|
+
delete next.draft;
|
|
120
|
+
}
|
|
121
|
+
this.cards = next;
|
|
122
|
+
await this.host.setExtensionData(nearby_protocol_1.NAME, nearby_protocol_1.NearbyKeys.CARDS, next);
|
|
123
|
+
for (const heard of this.heard.values()) {
|
|
124
|
+
heard.carded = false;
|
|
125
|
+
void this.exchangeCard(heard);
|
|
126
|
+
}
|
|
127
|
+
return this.publish(true);
|
|
128
|
+
}
|
|
129
|
+
/** Ta drafts the card in a conversation of its own, saving it with nearby_card; the user looks at it before it is used. */
|
|
130
|
+
async draftCard() {
|
|
131
|
+
const { getServerInfo, openSession, prompt, setSessionName } = this.host;
|
|
132
|
+
if (!getServerInfo || !openSession || !prompt) {
|
|
133
|
+
throw new Error('Drafting needs the Ta service.');
|
|
134
|
+
}
|
|
135
|
+
const info = await getServerInfo.call(this.host);
|
|
136
|
+
const session = await openSession.call(this.host, { cwd: info.cwd });
|
|
137
|
+
await (setSessionName === null || setSessionName === void 0 ? void 0 : setSessionName.call(this.host, session.sessionId, server_texts_1.NearbyTexts.draftTitle()).catch(() => undefined));
|
|
138
|
+
await prompt.call(this.host, session.sessionId, {
|
|
139
|
+
message: server_texts_1.NearbyTexts.draftPrompt(),
|
|
140
|
+
clientMessageId: `nearby-card-${(0, node_crypto_1.randomBytes)(6).toString('base64url')}`,
|
|
141
|
+
});
|
|
142
|
+
return { sessionId: session.sessionId };
|
|
143
|
+
}
|
|
144
|
+
/** Cards go both ways in one round trip, once for each temporary id, between two open to meet. */
|
|
145
|
+
async exchangeCard(heard) {
|
|
146
|
+
if (heard.carded || !this.meets() || heard.data.m !== 1 || !this.cards.card) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
heard.carded = true;
|
|
150
|
+
try {
|
|
151
|
+
const answer = (await this.send(heard.data.e, { t: 'card', at: this.now(), k: (0, node_crypto_1.randomBytes)(9).toString('base64url'), card: this.cards.card }));
|
|
152
|
+
const card = (answer === null || answer === void 0 ? void 0 : answer.ok) ? nearby_meet_1.NearbyMeetUtil.card(answer.card) : undefined;
|
|
153
|
+
if (card) {
|
|
154
|
+
heard.card = card;
|
|
155
|
+
await this.considerMeet(heard);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
catch (_a) {
|
|
159
|
+
heard.carded = false;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A reason to meet one: proposed to the user (ta-initiative), never acted on alone. One proposes of two: the one who
|
|
164
|
+
* looks for what the other offers, or, of two with topics in common, the one of the smaller id.
|
|
165
|
+
*/
|
|
166
|
+
async considerMeet(heard) {
|
|
167
|
+
var _a, _b;
|
|
168
|
+
var _c;
|
|
169
|
+
const mine = this.cards.card;
|
|
170
|
+
const theirs = heard.card;
|
|
171
|
+
if (!mine || !theirs || !this.meets()) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const reason = nearby_meet_1.NearbyMeetUtil.reason(mine, theirs);
|
|
175
|
+
if (!reason) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (reason.kind === 'topics' && ((_a = nearby_meet_1.NearbyMeetUtil.reason(theirs, mine)) === null || _a === void 0 ? void 0 : _a.kind) !== 'helps' && ((_c = (_b = this.keys) === null || _b === void 0 ? void 0 : _b.e) !== null && _c !== void 0 ? _c : '') > heard.data.e) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
const key = nearby_meet_1.NearbyMeetUtil.key(theirs);
|
|
182
|
+
const now = this.now();
|
|
183
|
+
const day = Object.values(this.met).filter(at => now - at < 24 * 60 * 60000).length;
|
|
184
|
+
if ((this.met[key] && now - this.met[key] < nearby_service_base_1.MET_MS) || day >= nearby_service_base_1.MEET_A_DAY) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
this.met = Object.fromEntries([...Object.entries(this.met).filter(([, at]) => now - at < nearby_service_base_1.MET_MS), [key, now]]);
|
|
188
|
+
await this.host.setExtensionData(nearby_protocol_1.NAME, nearby_protocol_1.NearbyKeys.MET, this.met);
|
|
189
|
+
await this.defineKind(nearby_service_base_1.MEET_KIND, server_texts_1.NearbyTexts.meetKind());
|
|
190
|
+
await this.host.callPackageHost(nearby_service_base_1.INITIATIVE, 'offer', [
|
|
191
|
+
{
|
|
192
|
+
kind: nearby_service_base_1.MEET_KIND,
|
|
193
|
+
title: server_texts_1.NearbyTexts.meetTitle(reason),
|
|
194
|
+
why: server_texts_1.NearbyTexts.meetWhy(reason),
|
|
195
|
+
key: `${nearby_service_base_1.MEET_KIND}:${key}`,
|
|
196
|
+
action: {
|
|
197
|
+
type: 'call',
|
|
198
|
+
package: nearby_protocol_1.NAME,
|
|
199
|
+
method: 'nearby',
|
|
200
|
+
params: [{ kind: 'hello', e: heard.data.e, why: NearbyServiceMeet.reasonFor(reason) }],
|
|
201
|
+
},
|
|
202
|
+
expiresAt: now + nearby_service_base_1.INVITE_MS,
|
|
203
|
+
},
|
|
204
|
+
]);
|
|
205
|
+
}
|
|
206
|
+
/** The reason as it goes, for the other to read: its words for the other side. */
|
|
207
|
+
static reasonFor(reason) {
|
|
208
|
+
return JSON.stringify(reason);
|
|
209
|
+
}
|
|
210
|
+
async hello(e, why) {
|
|
211
|
+
var _a;
|
|
212
|
+
var _b;
|
|
213
|
+
const heard = this.heard.get(e);
|
|
214
|
+
if (!heard) {
|
|
215
|
+
throw new Error('No longer nearby.');
|
|
216
|
+
}
|
|
217
|
+
let reason;
|
|
218
|
+
try {
|
|
219
|
+
reason = why ? JSON.parse(why) : undefined;
|
|
220
|
+
}
|
|
221
|
+
catch (_c) {
|
|
222
|
+
reason = undefined;
|
|
223
|
+
}
|
|
224
|
+
reason !== null && reason !== void 0 ? reason : (reason = this.cards.card && heard.card ? nearby_meet_1.NearbyMeetUtil.reason(this.cards.card, heard.card) : undefined);
|
|
225
|
+
const k = (0, node_crypto_1.randomBytes)(12).toString('base64url');
|
|
226
|
+
this.hellos.set(k, { e, why: reason ? server_texts_1.NearbyTexts.meetWhy(reason) : '', at: this.now() });
|
|
227
|
+
await this.send(e, {
|
|
228
|
+
t: 'hello',
|
|
229
|
+
at: this.now(),
|
|
230
|
+
k,
|
|
231
|
+
line: (_b = (_a = this.cards.card) === null || _a === void 0 ? void 0 : _a.line) !== null && _b !== void 0 ? _b : '',
|
|
232
|
+
why: reason ? server_texts_1.NearbyTexts.greetWhy(reason) : '',
|
|
233
|
+
});
|
|
234
|
+
return this.status();
|
|
235
|
+
}
|
|
236
|
+
async takeHello(k, message, heard) {
|
|
237
|
+
var _a, _b;
|
|
238
|
+
if (!this.meets() || this.greets.size >= 10) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
const name = server_texts_1.NearbyTexts.who({ name: heard.data.n, friend: heard.friend });
|
|
242
|
+
const greet = {
|
|
243
|
+
k,
|
|
244
|
+
e: heard.data.e,
|
|
245
|
+
name: heard.data.n,
|
|
246
|
+
face: heard.data.f,
|
|
247
|
+
...(heard.data.l ? { look: heard.data.l } : {}),
|
|
248
|
+
...(heard.friend ? { friend: heard.friend } : {}),
|
|
249
|
+
line: String((_a = message.line) !== null && _a !== void 0 ? _a : '').slice(0, 200),
|
|
250
|
+
why: String((_b = message.why) !== null && _b !== void 0 ? _b : '').slice(0, 300),
|
|
251
|
+
at: this.now(),
|
|
252
|
+
};
|
|
253
|
+
this.greets.set(k, greet);
|
|
254
|
+
await this.publish(true);
|
|
255
|
+
await this.defineKind(nearby_service_base_1.GREET_KIND, server_texts_1.NearbyTexts.greetKind()).catch(() => undefined);
|
|
256
|
+
await this.host
|
|
257
|
+
.callPackageHost(nearby_service_base_1.INITIATIVE, 'offer', [
|
|
258
|
+
{
|
|
259
|
+
kind: nearby_service_base_1.GREET_KIND,
|
|
260
|
+
title: server_texts_1.NearbyTexts.greetTitle(name),
|
|
261
|
+
why: [greet.line, greet.why].filter(Boolean).join(' '),
|
|
262
|
+
key: `${nearby_service_base_1.GREET_KIND}:${k}`,
|
|
263
|
+
action: { type: 'call', package: nearby_protocol_1.NAME, method: 'nearby', params: [{ kind: 'greet', k, accept: true }] },
|
|
264
|
+
expiresAt: this.now() + nearby_service_base_1.INVITE_MS,
|
|
265
|
+
},
|
|
266
|
+
])
|
|
267
|
+
.catch(() => undefined);
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
/** Yes: the other's Ta makes a room of the two, joined at once. No: nothing is said; they see no answer. */
|
|
271
|
+
async greet(k, accept) {
|
|
272
|
+
const greet = this.greets.get(k);
|
|
273
|
+
if (!greet) {
|
|
274
|
+
throw new Error('It is gone.');
|
|
275
|
+
}
|
|
276
|
+
this.greets.delete(k);
|
|
277
|
+
if (accept) {
|
|
278
|
+
await this.loadIdentity();
|
|
279
|
+
if (!this.identity) {
|
|
280
|
+
throw new Error('Rooms are off.');
|
|
281
|
+
}
|
|
282
|
+
this.greeted.set(k, this.now());
|
|
283
|
+
await this.send(greet.e, { t: 'hello-ok', at: this.now(), k, id: this.identity.id, name: this.identity.name });
|
|
284
|
+
}
|
|
285
|
+
return this.publish(true);
|
|
286
|
+
}
|
|
287
|
+
async defineKind(id, words) {
|
|
288
|
+
if (this.kinds.has(id)) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const title = { en: words['en-US'], zh: words['zh-CN'], tw: words['zh-TW'], ja: words['ja-JP'] };
|
|
292
|
+
await this.host.callPackageHost(nearby_service_base_1.INITIATIVE, 'defineKind', [{ id, owner: nearby_protocol_1.NAME, title, reversible: false, level: 'ask' }]);
|
|
293
|
+
this.kinds.add(id);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
exports.NearbyServiceMeet = NearbyServiceMeet;
|
|
297
|
+
//# sourceMappingURL=nearby-service-meet.js.map
|