@celljs/ta 4.15.2 → 4.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -0
- package/README.md +1 -0
- package/dist/cli.mjs +2227 -203
- package/dist/gateway.mjs +2391 -291
- package/dist/pi/CHANGELOG.md +19 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-3d/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-3d/package.json +2 -1
- package/dist/pi/packages/ta-agents/README.en.md +14 -2
- package/dist/pi/packages/ta-agents/README.md +14 -2
- package/dist/pi/packages/ta-agents/extension/index.mjs +286 -111
- package/dist/pi/packages/ta-agents/host/index.mjs +662 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +5 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +36 -2
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js +76 -6
- package/dist/pi/packages/ta-agents/lib/agent-installer.d.ts +55 -0
- package/dist/pi/packages/ta-agents/lib/agent-installer.js +140 -0
- package/dist/pi/packages/ta-agents/lib/agent-installs.d.ts +25 -0
- package/dist/pi/packages/ta-agents/lib/agent-installs.js +64 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +6 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +9 -0
- package/dist/pi/packages/ta-agents/lib/agent-refresh.d.ts +11 -0
- package/dist/pi/packages/ta-agents/lib/agent-refresh.js +37 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +0 -2
- package/dist/pi/packages/ta-agents/lib/agent-session.js +3 -6
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +7 -2
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +8 -4
- package/dist/pi/packages/ta-agents/lib/agents-protocol.d.ts +26 -0
- package/dist/pi/packages/ta-agents/lib/agents-protocol.js +11 -0
- package/dist/pi/packages/ta-agents/lib/agents-settings.d.ts +10 -0
- package/dist/pi/packages/ta-agents/lib/agents-settings.js +165 -0
- package/dist/pi/packages/ta-agents/lib/extension.d.ts +3 -1
- package/dist/pi/packages/ta-agents/lib/extension.js +17 -4
- package/dist/pi/packages/ta-agents/lib/host.d.ts +35 -0
- package/dist/pi/packages/ta-agents/lib/host.js +96 -0
- package/dist/pi/packages/ta-agents/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-agents/lib/react.js +8 -0
- package/dist/pi/packages/ta-agents/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/style.js +30 -0
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +18 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +18 -0
- package/dist/pi/packages/ta-agents/lib/web-words.d.ts +30 -0
- package/dist/pi/packages/ta-agents/lib/web-words.js +98 -0
- package/dist/pi/packages/ta-agents/lib/web.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/web.js +14 -0
- package/dist/pi/packages/ta-agents/package.json +21 -5
- package/dist/pi/packages/ta-agents/web/index.js +385 -0
- package/dist/pi/packages/ta-app-use/README.en.md +28 -0
- package/dist/pi/packages/ta-app-use/README.md +28 -0
- package/dist/pi/packages/ta-app-use/extension/index.mjs +534 -0
- package/dist/pi/packages/ta-app-use/host/index.mjs +136 -0
- package/dist/pi/packages/ta-app-use/lib/app-host.d.ts +32 -0
- package/dist/pi/packages/ta-app-use/lib/app-host.js +79 -0
- package/dist/pi/packages/ta-app-use/lib/app-protocol.d.ts +23 -0
- package/dist/pi/packages/ta-app-use/lib/app-protocol.js +9 -0
- package/dist/pi/packages/ta-app-use/lib/app-util.d.ts +18 -0
- package/dist/pi/packages/ta-app-use/lib/app-util.js +71 -0
- package/dist/pi/packages/ta-app-use/lib/extension.d.ts +80 -0
- package/dist/pi/packages/ta-app-use/lib/extension.js +125 -0
- package/dist/pi/packages/ta-app-use/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-app-use/lib/host.js +16 -0
- package/dist/pi/packages/ta-app-use/lib/i18n.d.ts +38 -0
- package/dist/pi/packages/ta-app-use/lib/i18n.js +130 -0
- package/dist/pi/packages/ta-app-use/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-app-use/lib/index.js +93 -0
- package/dist/pi/packages/ta-app-use/lib/screen-cursor.d.ts +33 -0
- package/dist/pi/packages/ta-app-use/lib/screen-cursor.js +134 -0
- package/dist/pi/packages/ta-app-use/lib/screen-dom.d.ts +19 -0
- package/dist/pi/packages/ta-app-use/lib/screen-dom.js +184 -0
- package/dist/pi/packages/ta-app-use/lib/screen-driver.d.ts +46 -0
- package/dist/pi/packages/ta-app-use/lib/screen-driver.js +174 -0
- package/dist/pi/packages/ta-app-use/lib/screen-protocol.d.ts +67 -0
- package/dist/pi/packages/ta-app-use/lib/screen-protocol.js +8 -0
- package/dist/pi/packages/ta-app-use/lib/screen-text.d.ts +13 -0
- package/dist/pi/packages/ta-app-use/lib/screen-text.js +69 -0
- package/dist/pi/packages/ta-app-use/lib/screen-window.d.ts +68 -0
- package/dist/pi/packages/ta-app-use/lib/screen-window.js +376 -0
- package/dist/pi/packages/ta-app-use/lib/tool-line.d.ts +11 -0
- package/dist/pi/packages/ta-app-use/lib/tool-line.js +69 -0
- package/dist/pi/packages/ta-app-use/package.json +63 -0
- package/dist/pi/packages/ta-app-use/web/index.js +1520 -0
- package/dist/pi/packages/ta-bots/README.en.md +1 -0
- package/dist/pi/packages/ta-bots/README.md +1 -0
- package/dist/pi/packages/ta-bots/extension/index.mjs +25 -22
- package/dist/pi/packages/ta-bots/host/index.mjs +726 -151
- package/dist/pi/packages/ta-bots/lib/bot-service.d.ts +9 -1
- package/dist/pi/packages/ta-bots/lib/bot-service.js +49 -8
- package/dist/pi/packages/ta-bots/lib/channel-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-bots/lib/extension.d.ts +2 -2
- package/dist/pi/packages/ta-bots/lib/extension.js +28 -24
- package/dist/pi/packages/ta-bots/lib/index.js +4 -0
- package/dist/pi/packages/ta-bots/lib/page.d.ts +7 -1
- package/dist/pi/packages/ta-bots/lib/page.js +17 -0
- package/dist/pi/packages/ta-bots/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-bots/lib/style.js +1 -1
- package/dist/pi/packages/ta-bots/lib/wecom-channel.js +1 -1
- package/dist/pi/packages/ta-bots/lib/weixin-api.d.ts +1 -0
- package/dist/pi/packages/ta-bots/lib/weixin-channel.js +2 -1
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-bots/web/index.js +13 -2
- package/dist/pi/packages/ta-call/README.en.md +9 -0
- package/dist/pi/packages/ta-call/README.md +9 -0
- package/dist/pi/packages/ta-call/extension/index.mjs +474 -0
- package/dist/pi/packages/ta-call/host/index.mjs +899 -0
- package/dist/pi/packages/ta-call/lib/call-host.d.ts +127 -0
- package/dist/pi/packages/ta-call/lib/call-host.js +377 -0
- package/dist/pi/packages/ta-call/lib/call-protocol.d.ts +33 -0
- package/dist/pi/packages/ta-call/lib/call-protocol.js +10 -0
- package/dist/pi/packages/ta-call/lib/call-util.d.ts +50 -0
- package/dist/pi/packages/ta-call/lib/call-util.js +250 -0
- package/dist/pi/packages/ta-call/lib/extension.d.ts +20 -0
- package/dist/pi/packages/ta-call/lib/extension.js +114 -0
- package/dist/pi/packages/ta-call/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-call/lib/host.js +20 -0
- package/dist/pi/packages/ta-call/lib/i18n.d.ts +16 -0
- package/dist/pi/packages/ta-call/lib/i18n.js +38 -0
- package/dist/pi/packages/ta-call/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-call/lib/index.js +60 -0
- package/dist/pi/packages/ta-call/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-call/lib/react.js +8 -0
- package/dist/pi/packages/ta-call/package.json +64 -0
- package/dist/pi/packages/ta-call/web/index.js +552 -0
- package/dist/pi/packages/ta-changes/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-changes/lib/card.js +4 -1
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-changes/web/index.js +2 -0
- package/dist/pi/packages/ta-channels/extension/index.mjs +155 -194
- package/dist/pi/packages/ta-channels/host/index.mjs +2039 -1503
- package/dist/pi/packages/ta-channels/lib/agent-menu.js +2 -1
- package/dist/pi/packages/ta-channels/lib/channel-menu.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/channel-menu.js +2 -2
- package/dist/pi/packages/ta-channels/lib/channels-text.d.ts +38 -0
- package/dist/pi/packages/ta-channels/lib/channels-text.js +173 -0
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts +0 -48
- package/dist/pi/packages/ta-channels/lib/channels-util.js +1 -223
- package/dist/pi/packages/ta-channels/lib/create.js +5 -1
- package/dist/pi/packages/ta-channels/lib/i18n-ja.d.ts +3 -0
- package/dist/pi/packages/ta-channels/lib/i18n-ja.js +182 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh-tw.d.ts +3 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh-tw.js +182 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh.d.ts +3 -0
- package/dist/pi/packages/ta-channels/lib/i18n-zh.js +182 -0
- package/dist/pi/packages/ta-channels/lib/i18n.js +4 -535
- package/dist/pi/packages/ta-channels/lib/index.js +2 -1
- package/dist/pi/packages/ta-channels/lib/notice-util.d.ts +15 -0
- package/dist/pi/packages/ta-channels/lib/notice-util.js +61 -0
- package/dist/pi/packages/ta-channels/lib/notice.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/notice.js +5 -4
- package/dist/pi/packages/ta-channels/lib/room.js +4 -3
- package/dist/pi/packages/ta-channels/lib/sidebar-head.d.ts +6 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-head.js +67 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-hooks.d.ts +51 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-hooks.js +230 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-rows.d.ts +71 -0
- package/dist/pi/packages/ta-channels/lib/sidebar-rows.js +105 -0
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts +0 -4
- package/dist/pi/packages/ta-channels/lib/sidebar.js +35 -396
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +0 -1
- package/dist/pi/packages/ta-channels/lib/tasks.js +2 -1
- package/dist/pi/packages/ta-channels/lib/team-store.d.ts +78 -0
- package/dist/pi/packages/ta-channels/lib/team-store.js +261 -0
- package/dist/pi/packages/ta-channels/lib/team-tools.js +3 -2
- package/dist/pi/packages/ta-channels/lib/team.d.ts +3 -76
- package/dist/pi/packages/ta-channels/lib/team.js +5 -254
- package/dist/pi/packages/ta-channels/package.json +1 -1
- package/dist/pi/packages/ta-channels/web/index.js +889 -809
- package/dist/pi/packages/ta-computer-use/package.json +1 -1
- package/dist/pi/packages/ta-cron/README.en.md +19 -3
- package/dist/pi/packages/ta-cron/README.md +19 -3
- package/dist/pi/packages/ta-cron/extension/index.mjs +396 -111
- package/dist/pi/packages/ta-cron/host/index.mjs +633 -49
- package/dist/pi/packages/ta-cron/lib/chat-task.d.ts +5 -3
- package/dist/pi/packages/ta-cron/lib/chat-task.js +15 -10
- package/dist/pi/packages/ta-cron/lib/commands.d.ts +7 -4
- package/dist/pi/packages/ta-cron/lib/commands.js +26 -47
- package/dist/pi/packages/ta-cron/lib/cron-expression.d.ts +8 -0
- package/dist/pi/packages/ta-cron/lib/cron-expression.js +43 -1
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts +54 -7
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js +16 -2
- package/dist/pi/packages/ta-cron/lib/editor.d.ts +3 -0
- package/dist/pi/packages/ta-cron/lib/editor.js +106 -36
- package/dist/pi/packages/ta-cron/lib/extension.js +1 -1
- package/dist/pi/packages/ta-cron/lib/form-util.d.ts +16 -6
- package/dist/pi/packages/ta-cron/lib/form-util.js +40 -28
- package/dist/pi/packages/ta-cron/lib/host.js +17 -1
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +39 -5
- package/dist/pi/packages/ta-cron/lib/i18n.js +160 -24
- package/dist/pi/packages/ta-cron/lib/index.js +4 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +3 -2
- package/dist/pi/packages/ta-cron/lib/page.js +13 -2
- package/dist/pi/packages/ta-cron/lib/schedule-util.d.ts +4 -0
- package/dist/pi/packages/ta-cron/lib/schedule-util.js +52 -4
- package/dist/pi/packages/ta-cron/lib/scheduler.d.ts +56 -6
- package/dist/pi/packages/ta-cron/lib/scheduler.js +209 -27
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +50 -21
- package/dist/pi/packages/ta-cron/lib/task-list.d.ts +23 -0
- package/dist/pi/packages/ta-cron/lib/task-list.js +70 -0
- package/dist/pi/packages/ta-cron/lib/task-row.d.ts +19 -0
- package/dist/pi/packages/ta-cron/lib/task-row.js +246 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +10 -6
- package/dist/pi/packages/ta-cron/lib/task-util.js +53 -19
- package/dist/pi/packages/ta-cron/lib/task-watchers.d.ts +30 -0
- package/dist/pi/packages/ta-cron/lib/task-watchers.js +90 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +3 -2
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +48 -193
- package/dist/pi/packages/ta-cron/lib/tool-line.js +4 -0
- package/dist/pi/packages/ta-cron/lib/tool.d.ts +7 -0
- package/dist/pi/packages/ta-cron/lib/tool.js +18 -8
- package/dist/pi/packages/ta-cron/lib/when.d.ts +39 -0
- package/dist/pi/packages/ta-cron/lib/when.js +231 -0
- package/dist/pi/packages/ta-cron/package.json +2 -1
- package/dist/pi/packages/ta-cron/web/index.js +1091 -340
- package/dist/pi/packages/ta-extensions/lib/market-detail.js +9 -5
- package/dist/pi/packages/ta-extensions/lib/page.js +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +1 -1
- package/dist/pi/packages/ta-extensions/package.json +1 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +9 -7
- package/dist/pi/packages/ta-extensions/web/index.js +777 -237
- package/dist/pi/packages/ta-feedback/README.en.md +10 -0
- package/dist/pi/packages/ta-feedback/README.md +10 -0
- package/dist/pi/packages/ta-feedback/extension/index.mjs +451 -0
- package/dist/pi/packages/ta-feedback/host/index.mjs +1187 -0
- package/dist/pi/packages/ta-feedback/lib/extension.d.ts +31 -0
- package/dist/pi/packages/ta-feedback/lib/extension.js +160 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-git.d.ts +25 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-git.js +44 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-host.d.ts +133 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-host.js +668 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-protocol.d.ts +127 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-protocol.js +41 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-util.d.ts +79 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-util.js +252 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-view.d.ts +11 -0
- package/dist/pi/packages/ta-feedback/lib/feedback-view.js +244 -0
- package/dist/pi/packages/ta-feedback/lib/host.d.ts +8 -0
- package/dist/pi/packages/ta-feedback/lib/host.js +19 -0
- package/dist/pi/packages/ta-feedback/lib/i18n.d.ts +69 -0
- package/dist/pi/packages/ta-feedback/lib/i18n.js +250 -0
- package/dist/pi/packages/ta-feedback/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-feedback/lib/index.js +88 -0
- package/dist/pi/packages/ta-feedback/lib/page.d.ts +35 -0
- package/dist/pi/packages/ta-feedback/lib/page.js +135 -0
- package/dist/pi/packages/ta-feedback/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-feedback/lib/react.js +8 -0
- package/dist/pi/packages/ta-feedback/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-feedback/lib/style.js +71 -0
- package/dist/pi/packages/ta-feedback/package.json +65 -0
- package/dist/pi/packages/ta-feedback/web/index.js +939 -0
- package/dist/pi/packages/ta-games/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-games/lib/style.js +1 -1
- package/dist/pi/packages/ta-games/package.json +1 -1
- package/dist/pi/packages/ta-games/web/index.js +1 -1
- package/dist/pi/packages/ta-glance/README.en.md +2 -0
- package/dist/pi/packages/ta-glance/README.md +2 -0
- package/dist/pi/packages/ta-glance/extension/index.mjs +135 -27
- package/dist/pi/packages/ta-glance/lib/card.js +155 -35
- package/dist/pi/packages/ta-glance/lib/glance-json.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-json.js +8 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +9 -6
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +43 -4
- package/dist/pi/packages/ta-glance/lib/glance-protocol.js +39 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +125 -23
- package/dist/pi/packages/ta-glance/lib/glance-speech.d.ts +13 -0
- package/dist/pi/packages/ta-glance/lib/glance-speech.js +45 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.d.ts +13 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.js +28 -0
- package/dist/pi/packages/ta-glance/lib/i18n.d.ts +5 -0
- package/dist/pi/packages/ta-glance/lib/i18n.js +20 -0
- package/dist/pi/packages/ta-glance/lib/index.js +11 -1
- package/dist/pi/packages/ta-glance/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/style.js +82 -5
- package/dist/pi/packages/ta-glance/package.json +2 -1
- package/dist/pi/packages/ta-glance/web/index.js +508 -62
- package/dist/pi/packages/ta-initiative/extension/index.mjs +3 -2
- package/dist/pi/packages/ta-initiative/host/index.mjs +1 -1
- package/dist/pi/packages/ta-initiative/lib/chat-proposals.js +1 -1
- package/dist/pi/packages/ta-initiative/lib/index.js +1 -0
- package/dist/pi/packages/ta-initiative/lib/material-util.js +1 -1
- package/dist/pi/packages/ta-initiative/lib/settings.js +2 -1
- package/dist/pi/packages/ta-initiative/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-initiative/lib/style.js +1 -1
- package/dist/pi/packages/ta-initiative/package.json +1 -1
- package/dist/pi/packages/ta-initiative/web/index.js +5 -3
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-manual/lib/manual-util.d.ts +1 -1
- package/dist/pi/packages/ta-manual/lib/pictures-c.js +15 -0
- package/dist/pi/packages/ta-manual/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-manual/lib/style.js +1 -1
- package/dist/pi/packages/ta-manual/lib/topics-a.d.ts +3 -0
- package/dist/pi/packages/ta-manual/lib/topics-a.js +295 -0
- package/dist/pi/packages/ta-manual/lib/topics-model.d.ts +46 -0
- package/dist/pi/packages/ta-manual/lib/topics-model.js +21 -0
- package/dist/pi/packages/ta-manual/lib/topics.d.ts +1 -44
- package/dist/pi/packages/ta-manual/lib/topics.js +28 -318
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +12 -10
- package/dist/pi/packages/ta-manual/web/index.js +97 -24
- package/dist/pi/packages/ta-moments/extension/index.mjs +740 -194
- package/dist/pi/packages/ta-moments/host/index.mjs +1393 -834
- package/dist/pi/packages/ta-moments/lib/index.js +3 -1
- package/dist/pi/packages/ta-moments/lib/moments-host-base.d.ts +96 -0
- package/dist/pi/packages/ta-moments/lib/moments-host-base.js +276 -0
- package/dist/pi/packages/ta-moments/lib/moments-host-pictures.d.ts +22 -0
- package/dist/pi/packages/ta-moments/lib/moments-host-pictures.js +167 -0
- package/dist/pi/packages/ta-moments/lib/moments-host.d.ts +4 -84
- package/dist/pi/packages/ta-moments/lib/moments-host.js +13 -426
- package/dist/pi/packages/ta-moments/lib/page.js +3 -3
- package/dist/pi/packages/ta-moments/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-moments/lib/style.js +1 -1
- package/dist/pi/packages/ta-moments/lib/talk-host-base.d.ts +71 -0
- package/dist/pi/packages/ta-moments/lib/talk-host-base.js +171 -0
- package/dist/pi/packages/ta-moments/lib/talk-host.d.ts +3 -62
- package/dist/pi/packages/ta-moments/lib/talk-host.js +14 -169
- package/dist/pi/packages/ta-moments/package.json +1 -1
- package/dist/pi/packages/ta-moments/web/index.js +686 -147
- package/dist/pi/packages/ta-nearby/extension/index.mjs +9 -0
- package/dist/pi/packages/ta-nearby/host/index.mjs +1073 -1018
- package/dist/pi/packages/ta-nearby/lib/index.js +8 -5
- package/dist/pi/packages/ta-nearby/lib/nearby-home.d.ts +13 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-home.js +91 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet-view.d.ts +12 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet-view.js +113 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-page.d.ts +6 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-page.js +157 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-base.d.ts +161 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-base.js +343 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-meet.d.ts +41 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service-meet.js +297 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service.d.ts +6 -167
- package/dist/pi/packages/ta-nearby/lib/nearby-service.js +38 -638
- package/dist/pi/packages/ta-nearby/lib/nearby-show-view.d.ts +6 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-show-view.js +88 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.d.ts +6 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.js +25 -3
- package/dist/pi/packages/ta-nearby/lib/page.d.ts +27 -20
- package/dist/pi/packages/ta-nearby/lib/page.js +15 -417
- package/dist/pi/packages/ta-nearby/lib/server-texts.d.ts +1 -1
- package/dist/pi/packages/ta-nearby/lib/server-texts.js +9 -1
- package/dist/pi/packages/ta-nearby/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-nearby/lib/style.js +1 -1
- package/dist/pi/packages/ta-nearby/package.json +1 -1
- package/dist/pi/packages/ta-nearby/web/index.js +370 -362
- package/dist/pi/packages/ta-notify/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-notify/lib/settings.js +1 -0
- package/dist/pi/packages/ta-notify/package.json +1 -1
- package/dist/pi/packages/ta-notify/web/index.js +1 -0
- package/dist/pi/packages/ta-plot/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-plot/package.json +2 -1
- package/dist/pi/packages/ta-recall/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-recall/host/index.mjs +1 -0
- package/dist/pi/packages/ta-recall/lib/settings.js +1 -0
- package/dist/pi/packages/ta-recall/package.json +1 -1
- package/dist/pi/packages/ta-recall/web/index.js +2 -0
- package/dist/pi/packages/ta-rooms/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-rooms/host/index.mjs +497 -492
- package/dist/pi/packages/ta-rooms/lib/double-agents.js +6 -6
- package/dist/pi/packages/ta-rooms/lib/double-grants.js +10 -10
- package/dist/pi/packages/ta-rooms/lib/double-host.js +6 -5
- package/dist/pi/packages/ta-rooms/lib/double-tasks-base.d.ts +55 -0
- package/dist/pi/packages/ta-rooms/lib/double-tasks-base.js +279 -0
- package/dist/pi/packages/ta-rooms/lib/double-tasks.d.ts +3 -45
- package/dist/pi/packages/ta-rooms/lib/double-tasks.js +14 -282
- package/dist/pi/packages/ta-rooms/lib/double-user.js +2 -2
- package/dist/pi/packages/ta-rooms/lib/friend-notices.js +2 -2
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.js +8 -4
- package/dist/pi/packages/ta-rooms/lib/index.js +18 -2
- package/dist/pi/packages/ta-rooms/lib/members-view.js +37 -3
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +36 -1
- package/dist/pi/packages/ta-rooms/lib/page.js +76 -1
- package/dist/pi/packages/ta-rooms/lib/room-view.js +22 -17
- package/dist/pi/packages/ta-rooms/lib/rooms-home.js +1 -0
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-rooms/lib/style.js +32 -6
- package/dist/pi/packages/ta-rooms/package.json +1 -1
- package/dist/pi/packages/ta-rooms/web/index.js +223 -38
- package/dist/pi/packages/ta-secrets/README.en.md +22 -0
- package/dist/pi/packages/ta-secrets/README.md +22 -0
- package/dist/pi/packages/ta-secrets/extension/index.mjs +462 -0
- package/dist/pi/packages/ta-secrets/host/index.mjs +1341 -0
- package/dist/pi/packages/ta-secrets/lib/command-prelude.d.ts +36 -0
- package/dist/pi/packages/ta-secrets/lib/command-prelude.js +66 -0
- package/dist/pi/packages/ta-secrets/lib/extension.d.ts +28 -0
- package/dist/pi/packages/ta-secrets/lib/extension.js +156 -0
- package/dist/pi/packages/ta-secrets/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-secrets/lib/host.js +15 -0
- package/dist/pi/packages/ta-secrets/lib/i18n.d.ts +47 -0
- package/dist/pi/packages/ta-secrets/lib/i18n.js +166 -0
- package/dist/pi/packages/ta-secrets/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-secrets/lib/index.js +28 -0
- package/dist/pi/packages/ta-secrets/lib/personal-info.d.ts +26 -0
- package/dist/pi/packages/ta-secrets/lib/personal-info.js +108 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-certs.d.ts +40 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-certs.js +200 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-scenario.d.ts +6 -0
- package/dist/pi/packages/ta-secrets/lib/proxy-scenario.js +91 -0
- package/dist/pi/packages/ta-secrets/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-secrets/lib/react.js +8 -0
- package/dist/pi/packages/ta-secrets/lib/scrubber.d.ts +20 -0
- package/dist/pi/packages/ta-secrets/lib/scrubber.js +70 -0
- package/dist/pi/packages/ta-secrets/lib/secrets-protocol.d.ts +106 -0
- package/dist/pi/packages/ta-secrets/lib/secrets-protocol.js +134 -0
- package/dist/pi/packages/ta-secrets/lib/server-texts.d.ts +14 -0
- package/dist/pi/packages/ta-secrets/lib/server-texts.js +62 -0
- package/dist/pi/packages/ta-secrets/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-secrets/lib/settings.js +179 -0
- package/dist/pi/packages/ta-secrets/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-secrets/lib/style.js +32 -0
- package/dist/pi/packages/ta-secrets/lib/vault-fixture.d.ts +8 -0
- package/dist/pi/packages/ta-secrets/lib/vault-fixture.js +22 -0
- package/dist/pi/packages/ta-secrets/lib/vault-proxy.d.ts +94 -0
- package/dist/pi/packages/ta-secrets/lib/vault-proxy.js +357 -0
- package/dist/pi/packages/ta-secrets/lib/vault-service.d.ts +111 -0
- package/dist/pi/packages/ta-secrets/lib/vault-service.js +429 -0
- package/dist/pi/packages/ta-secrets/lib/vault-store.d.ts +48 -0
- package/dist/pi/packages/ta-secrets/lib/vault-store.js +107 -0
- package/dist/pi/packages/ta-secrets/package.json +67 -0
- package/dist/pi/packages/ta-secrets/web/index.js +579 -0
- package/dist/pi/packages/ta-share/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-share/host/index.mjs +172 -21
- package/dist/pi/packages/ta-share/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-share/lib/i18n.js +4 -0
- package/dist/pi/packages/ta-share/lib/index.js +1 -1
- package/dist/pi/packages/ta-share/lib/share-dialog.js +1 -0
- package/dist/pi/packages/ta-share/lib/share-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-share/lib/share-service.d.ts +11 -1
- package/dist/pi/packages/ta-share/lib/share-service.js +62 -4
- package/dist/pi/packages/ta-share/lib/snapshot.d.ts +8 -2
- package/dist/pi/packages/ta-share/lib/snapshot.js +93 -7
- package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-share/lib/style.js +1 -1
- package/dist/pi/packages/ta-share/package.json +1 -1
- package/dist/pi/packages/ta-share/web/index.js +7 -2
- package/dist/pi/packages/ta-sync/host/index.mjs +1154 -755
- package/dist/pi/packages/ta-sync/lib/host.js +3 -0
- package/dist/pi/packages/ta-sync/lib/index.js +6 -2
- package/dist/pi/packages/ta-sync/lib/migrate-archive.d.ts +8 -6
- package/dist/pi/packages/ta-sync/lib/migrate-archive.js +24 -28
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.d.ts +10 -0
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.js +40 -0
- package/dist/pi/packages/ta-sync/lib/migrate-paths.d.ts +24 -0
- package/dist/pi/packages/ta-sync/lib/migrate-paths.js +230 -0
- package/dist/pi/packages/ta-sync/lib/migrate-protocol.d.ts +18 -0
- package/dist/pi/packages/ta-sync/lib/migrate-service.d.ts +11 -1
- package/dist/pi/packages/ta-sync/lib/migrate-service.js +28 -1
- package/dist/pi/packages/ta-sync/lib/move-panel.d.ts +9 -1
- package/dist/pi/packages/ta-sync/lib/move-panel.js +69 -5
- package/dist/pi/packages/ta-sync/lib/server-texts.d.ts +1 -0
- package/dist/pi/packages/ta-sync/lib/server-texts.js +9 -0
- package/dist/pi/packages/ta-sync/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-sync/lib/style.js +8 -1
- package/dist/pi/packages/ta-sync/lib/sync-service-base.d.ts +78 -0
- package/dist/pi/packages/ta-sync/lib/sync-service-base.js +224 -0
- package/dist/pi/packages/ta-sync/lib/sync-service-space.d.ts +36 -0
- package/dist/pi/packages/ta-sync/lib/sync-service-space.js +210 -0
- package/dist/pi/packages/ta-sync/lib/sync-service.d.ts +3 -99
- package/dist/pi/packages/ta-sync/lib/sync-service.js +2 -412
- package/dist/pi/packages/ta-sync/package.json +1 -1
- package/dist/pi/packages/ta-sync/web/index.js +138 -5
- package/dist/pi/packages/ta-sync-cloud/package.json +1 -1
- package/dist/pi/packages/ta-team/extension/index.mjs +1 -0
- package/dist/pi/packages/ta-team/host/index.mjs +1 -0
- package/dist/pi/packages/ta-team/lib/dialogs.d.ts +0 -2
- package/dist/pi/packages/ta-team/lib/dialogs.js +0 -227
- package/dist/pi/packages/ta-team/lib/i18n-ja.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/i18n-ja.js +211 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh-tw.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh-tw.js +211 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/i18n-zh.js +211 -0
- package/dist/pi/packages/ta-team/lib/i18n.d.ts +1 -2
- package/dist/pi/packages/ta-team/lib/i18n.js +6 -624
- package/dist/pi/packages/ta-team/lib/index.js +3 -1
- package/dist/pi/packages/ta-team/lib/join-dialog.d.ts +3 -0
- package/dist/pi/packages/ta-team/lib/join-dialog.js +234 -0
- package/dist/pi/packages/ta-team/lib/members-tab.js +2 -1
- package/dist/pi/packages/ta-team/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-team/lib/style.js +1 -1
- package/dist/pi/packages/ta-team/package.json +1 -1
- package/dist/pi/packages/ta-team/web/index.js +2095 -2086
- package/dist/pi/packages/ta-usage/README.en.md +6 -0
- package/dist/pi/packages/ta-usage/README.md +6 -0
- package/dist/pi/packages/ta-usage/host/index.mjs +220 -0
- package/dist/pi/packages/ta-usage/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-usage/lib/host.js +9 -0
- package/dist/pi/packages/ta-usage/lib/i18n.d.ts +30 -0
- package/dist/pi/packages/ta-usage/lib/i18n.js +98 -0
- package/dist/pi/packages/ta-usage/lib/index.d.ts +4 -0
- package/dist/pi/packages/ta-usage/lib/index.js +20 -0
- package/dist/pi/packages/ta-usage/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-usage/lib/react.js +8 -0
- package/dist/pi/packages/ta-usage/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-usage/lib/style.js +53 -0
- package/dist/pi/packages/ta-usage/lib/usage-host.d.ts +25 -0
- package/dist/pi/packages/ta-usage/lib/usage-host.js +70 -0
- package/dist/pi/packages/ta-usage/lib/usage-protocol.d.ts +55 -0
- package/dist/pi/packages/ta-usage/lib/usage-protocol.js +7 -0
- package/dist/pi/packages/ta-usage/lib/usage-util.d.ts +18 -0
- package/dist/pi/packages/ta-usage/lib/usage-util.js +159 -0
- package/dist/pi/packages/ta-usage/lib/usage-view.d.ts +9 -0
- package/dist/pi/packages/ta-usage/lib/usage-view.js +91 -0
- package/dist/pi/packages/ta-usage/package.json +61 -0
- package/dist/pi/packages/ta-usage/web/index.js +471 -0
- package/dist/pi/packages/ta-voice/README.en.md +8 -0
- package/dist/pi/packages/ta-voice/README.md +8 -0
- package/dist/pi/packages/ta-voice/host/index.mjs +662 -0
- package/dist/pi/packages/ta-voice/lib/doubao-frames.d.ts +44 -0
- package/dist/pi/packages/ta-voice/lib/doubao-frames.js +116 -0
- package/dist/pi/packages/ta-voice/lib/doubao-realtime.d.ts +35 -0
- package/dist/pi/packages/ta-voice/lib/doubao-realtime.js +172 -0
- package/dist/pi/packages/ta-voice/lib/host.d.ts +20 -0
- package/dist/pi/packages/ta-voice/lib/host.js +120 -0
- package/dist/pi/packages/ta-voice/lib/openai-realtime.d.ts +73 -0
- package/dist/pi/packages/ta-voice/lib/openai-realtime.js +257 -0
- package/dist/pi/packages/ta-voice/lib/realtime-socket.d.ts +23 -0
- package/dist/pi/packages/ta-voice/lib/realtime-socket.js +80 -0
- package/dist/pi/packages/ta-voice/package.json +67 -0
- package/dist/pi/packages/ta-workspace/README.md +1 -1
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +1 -1
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts +4 -0
- package/dist/pi/packages/ta-workspace/lib/browser-common.js +1 -0
- package/dist/pi/packages/ta-workspace/lib/browser-pick.d.ts +49 -0
- package/dist/pi/packages/ta-workspace/lib/browser-pick.js +166 -0
- package/dist/pi/packages/ta-workspace/lib/browser-webview.js +16 -1
- package/dist/pi/packages/ta-workspace/lib/i18n-en.d.ts +3 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-en.js +215 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-ja.d.ts +3 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-ja.js +215 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-zh-tw.d.ts +3 -0
- package/dist/pi/packages/ta-workspace/lib/i18n-zh-tw.js +215 -0
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +7 -3
- package/dist/pi/packages/ta-workspace/lib/i18n.js +11 -621
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +1504 -770
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-Dd51Bqbx.js → abnfDiagram-S7VZAUFO-w8qXXVn-.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-BbG3_x7_.js → architecture-WOLXFQ4H-B-FHaYwY.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-DbJO4t8I.js → architectureDiagram-YGSQEFNW-DTnoGaaX.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-BwtrHF1f.js → blockDiagram-APKKGZFW-CyeBzv-v.js} +1 -1
- package/dist/public/assets/{browser-D2BcOPKG.js → browser-Cb38iiEE.js} +1 -1
- package/dist/public/assets/{browser-CTbeNBsA.js → browser-DXexCqIh.js} +2 -2
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-CfBe5A0H.js → c4Diagram-KJ2TOQU5-CJJqDqyQ.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-C7R0mhrg.js → chunk-6MUBBAK2-DbvUMdNm.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-VQgQruZT.js → chunk-AXFCVDMN-D4hlZGtj.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-CkUi_vD5.js → chunk-BG4553SI-VNa9Q9On.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-BAQq7ktk.js → chunk-DQASFODM-BtlEbc_V.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-B1oF8lB7.js → chunk-HFQBQIA3-CAYSo4CJ.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-DE5amcgT.js → chunk-KQLB2F66-CyKdg6hW.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-ev9S_csp.js → chunk-KS47KZWR-BMogCB2r.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-ziqnRvTG.js → chunk-LEVMRMFU-Y9wr-8qB.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-DaqPdEKA.js → chunk-M57EVK23-DL3IAQKR.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-DFOG8j6z.js → chunk-OY52VR5R-CJBFHdg6.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-eg35JLLN.js → chunk-QB3YPZ4I-CyuWKZZv.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-J73nie-R.js → chunk-R3KSYZAL-DxvGhfpm.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-B8EvDZvB.js → chunk-STOXU5M4-Cpdl6bfz.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-DyCM007V.js → chunk-TU62E6Q5-CIxOg6QF.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BBGeCNmA.js → chunk-X4PVCEUW-DCFSCRBh.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-CAtJ2Wph.js → chunk-XXDRQBXY-B2R8Cxf7.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-DhQM6yHy.js → classDiagram-v2-L25IHNXF-B7W9HSbj.js} +1 -1
- package/dist/public/assets/{client-C8gi9Fk2.js → client-D75LfyFa.js} +1 -1
- package/dist/public/assets/{common-DrZR0tgm.js → common-CjqTomRQ.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-AqIcHabu.js → cose-bilkent-JH36ORCC-CXSLFyCH.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-BIcbDns7.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-7SyXzhRd.js → cynefinDiagram-L36ESFBY-DTv0Kn1r.js} +1 -1
- package/dist/public/assets/{d3-selection-DsahLieG.js → d3-selection-g4Hl3_NH.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-DalaGtMS.js → dagre-SPEB5RXH-BujVqk5R.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-BcY-qB9G.js → diagram-3B7GL73J-Ds-VnLzP.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-NV7fbe0h.js → diagram-DNEMPZML-BBoIIK-a.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-BPx4GHoj.js → diagram-L3MUGCDN-Glgd5N_n.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-BeUxqmw1.js → diagram-LA4NIPWU-B4EODdUU.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-Dlg1S5na.js → diagram-MHCOC4E2-pzDDXO2J.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-DQhRoMkK.js → diagram-XPFHEONP-l--gwSuK.js} +1 -1
- package/dist/public/assets/{dist-CQU8zJh_.js → dist-C0u3lAFR.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-gVEs3Um2.js → ebnfDiagram-UZSYDL2S-BVfPeaVX.js} +1 -1
- package/dist/public/assets/{editor.api-SQ1snuat.js → editor.api-BMcewI3C.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CHtlrPwu.js → elk-XV6XMXQE-BFJtUnG9.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-B0xok726.js → erDiagram-EYBAPDEH-BWxMtfIc.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-CFwphA0e.js → eventmodeling-K75KTNOO-YwYgBgCX.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Dah4--NW.js +1 -0
- package/dist/public/assets/{freemarker2-DJKO-X2B.js → freemarker2-B8HquI7K.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-B5wVGN1A.js → ganttDiagram-23REXITY-CBqv7wbi.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BwDfrSZS.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-DEjNU1R_.js → gitGraphDiagram-STJD7YCW-BLSf23f_.js} +1 -1
- package/dist/public/assets/{handlebars-ChVN7JPd.js → handlebars-P1qmNq4N.js} +1 -1
- package/dist/public/assets/{html-CQ0znKSa.js → html-Ceswbytr.js} +1 -1
- package/dist/public/assets/{index-CLlacdXR.js → index-10isUUN4.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-Ch8aMV1p.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-CJtrS72M.js → infoDiagram-KBXO4MBG-LvOtgUlm.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-qYI1QBsK.js → ishikawaDiagram-M35NCXHK-CwUZOvcm.js} +1 -1
- package/dist/public/assets/{javascript-B-DHbkyI.js → javascript-B3FXC8qR.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-BOQ2y2ZZ.js → journeyDiagram-OPLOXDXO-5j1KtwTt.js} +1 -1
- package/dist/public/assets/{jsonMode-XuGC5N_z.js → jsonMode-CrCyxNQI.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-BJ64tKdP.js → kanban-definition-BZKZHSQY-BKAB5id1.js} +1 -1
- package/dist/public/assets/{liquid-B0Ujylzc.js → liquid-CXZRIgp2.js} +1 -1
- package/dist/public/assets/{mdx-B19-V510.js → mdx-Dm3uNczM.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-Scb01iBq.js → mermaid-parser.core-C755A-rX.js} +3 -3
- package/dist/public/assets/{mermaid.core-BMuvs7us.js → mermaid.core-CQrYmFAR.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-BYfOS3XN.js → mindmap-definition-I2QAS2VK-DNJQKYbK.js} +1 -1
- package/dist/public/assets/module-9otB6_kX.js +1 -0
- package/dist/public/assets/{module-Cm_mLwAQ.js → module-C3jC5acf.js} +1 -1
- package/dist/public/assets/module-C_MyFORb.js +1 -0
- package/dist/public/assets/module-Cjpl4gva.js +1 -0
- package/dist/public/assets/{module-DUYj4E8T.js → module-D8yH9xCl.js} +1 -1
- package/dist/public/assets/module-DlHjBjOg.js +1 -0
- package/dist/public/assets/module-QsLiJaR6.js +1 -0
- package/dist/public/assets/module-aaW5Ri2L.js +2771 -0
- package/dist/public/assets/module-gSy9fKBo.js +1 -0
- package/dist/public/assets/{monaco-Bbe2os7m.js → monaco-BS7JBNW4.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-LqMrrc60.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-D-Vlq9Gm.js → pegDiagram-FD4XPPHP-BzbBCWht.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-BWzABXQU.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-_-94-aMD.js → pieDiagram-J4AKIIQI-Bf_LDukL.js} +1 -1
- package/dist/public/assets/{python-CWnMIOYq.js → python-jgOUhB-F.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-BhFUbUYz.js → quadrantDiagram-XTYBLID2-CdMHWnKX.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-CR4kNiUj.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-BAkWtkGC.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-yUa9GGCQ.js → railroad-abnf-LNEFI6M7-DQGYaRbc.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-xY4YiL8M.js → railroad-ebnf-DWYD2UWJ-D6Ljza0U.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-BYFYCUAQ.js → railroad-peg-JR7BVNR7-Du9hL1Gf.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-C9FVhj0k.js → railroadDiagram-MRQ6NCDL-CS_JnlGN.js} +1 -1
- package/dist/public/assets/{razor-bDtpN6EJ.js → razor-BWj90God.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-DLmAg-6C.js → requirementDiagram-Y7LWUY3S-Cq8rRz2y.js} +1 -1
- package/dist/public/assets/{resolver-0zC31mg5.js → resolver-BPuspqws.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-Bl5IpDk4.js → sankeyDiagram-WGJFYUXA-aK7jRBVK.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-Z-N0OiT_.js → sequenceDiagram-5NDRBG5M-BxcIyc38.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-ctKQz8Mo.js → stateDiagram-v2-FJ4FJNEA-Ctletlj4.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-CWLKnALg.js → swimlanes-UMQ2AFYF-DaD55xd2.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CytCT4x3.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-DP8Ph_d6.js → timeline-definition-SEUHKTQE-Ce19CDiJ.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-DvzNkX4G.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-BuUeBmMd.js +1 -0
- package/dist/public/assets/{typescript-CGpNlLbn.js → typescript-RgyfxmPQ.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-DvFjNj3J.js → usecaseDiagram-AFA6YXN4-CAVEBKQS.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-3m2F2H-I.js → vennDiagram-NNMJR3RB-DHyJxlHv.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-DSfdKACG.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-CsMntu16.js → wardleyDiagram-S7YFUSEH-C-FCHxR7.js} +1 -1
- package/dist/public/assets/{xml-ByiLoakX.js → xml-DiA1T3iN.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-C80rxvM0.js → xychartDiagram-GGNKY7IX-BlnHU6Gz.js} +1 -1
- package/dist/public/assets/{yaml-Cz2Af5Rj.js → yaml-dnCcfJBR.js} +1 -1
- package/dist/public/ext/index.json +1 -0
- package/dist/public/ext/ta-3d.js +660 -0
- package/dist/public/ext/ta-glance.js +1611 -0
- package/dist/public/ext/ta-plot.js +1320 -0
- package/dist/public/index.html +2 -2
- package/dist/serve/index.mjs +17829 -14233
- package/package.json +45 -39
- package/dist/public/assets/cynefin-EF2NZ3EQ-yFytgtiy.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-Cwye_DsX.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-BYzb--zb.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-na0qX3JP.js +0 -1
- package/dist/public/assets/module-B3SKdB70.js +0 -1
- package/dist/public/assets/module-DDH-aU6z.js +0 -1
- package/dist/public/assets/module-DOrYVZ7B.js +0 -2615
- package/dist/public/assets/module-DRofmFJn.js +0 -1
- package/dist/public/assets/module-MaD4hvv4.js +0 -1
- package/dist/public/assets/module-ZDJutm0b.js +0 -1
- package/dist/public/assets/module-qoBVcE5h.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-jhCd70vR.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-DV0NJFsI.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Co-Hlf34.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DKMPEjDD.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CU76xJSu.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-JMMnu_MW.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-CPlAD3X1.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-Dhc8wpLp.js +0 -1
|
@@ -24,7 +24,9 @@ function activate(pi) {
|
|
|
24
24
|
head: page_1.MomentsHead,
|
|
25
25
|
mark: page_1.MomentsMark,
|
|
26
26
|
discover: true,
|
|
27
|
-
|
|
27
|
+
group: 'people',
|
|
28
|
+
// First of its group, as Moments in WeChat.
|
|
29
|
+
order: 78,
|
|
28
30
|
});
|
|
29
31
|
pi.registerMessageRenderer(moments_protocol_1.DRAFT_TYPE, draft_card_1.DraftMessage);
|
|
30
32
|
// A post the daily brief linked.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { TaExtensionHost, TaRoomInfo, TaRooms, TaRoomValue } from '@celljs/ta-protocol';
|
|
2
|
+
import { type DraftDecision } from './moments-protocol';
|
|
3
|
+
import { MomentsTalk } from './talk-host';
|
|
4
|
+
export declare const NOTIFY = "@celljs/ta-notify";
|
|
5
|
+
export declare const INITIATIVE = "@celljs/ta-initiative";
|
|
6
|
+
/** Offering to post what the user made is a kind of initiative; a post others saw cannot be taken back, so it only asks. */
|
|
7
|
+
export declare const KIND_OF_POST: {
|
|
8
|
+
id: string;
|
|
9
|
+
owner: string;
|
|
10
|
+
title: {
|
|
11
|
+
en: string;
|
|
12
|
+
zh: string;
|
|
13
|
+
};
|
|
14
|
+
reversible: boolean;
|
|
15
|
+
level: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const DAY_MS = 86400000;
|
|
18
|
+
export declare const SWEEP_MS: number;
|
|
19
|
+
export declare const SETTLE_MS = 400;
|
|
20
|
+
export declare const DRAFT_DAYS = 7;
|
|
21
|
+
/** What the relay generates for a room: the name of a directory of its pictures here. */
|
|
22
|
+
export declare const ROOM_ID: RegExp;
|
|
23
|
+
/** Parts of a picture coming that stopped coming are let go of. */
|
|
24
|
+
export declare const INCOMING_MS: number;
|
|
25
|
+
/** What of the rooms Moments uses. */
|
|
26
|
+
export type MomentsRooms = Pick<TaRooms, 'getIdentity' | 'listRooms' | 'listFriends' | 'listFriendRequests' | 'friendRoom' | 'getState' | 'setState' | 'send' | 'onEvent'>;
|
|
27
|
+
export type Host = {
|
|
28
|
+
rooms: MomentsRooms;
|
|
29
|
+
} & Pick<TaExtensionHost, 'agentDir' | 'shares' | 'listPackages' | 'getExtensionData' | 'setExtensionData' | 'callPackageHost' | 'openSession' | 'setSessionName' | 'prompt' | 'getServerInfo' | 'listSessions' | 'getState' | 'getLastAssistantText' | 'abort'>;
|
|
30
|
+
/** Packs a directory as a .tgz, its directory at the top, without what is installed or of Git. */
|
|
31
|
+
export declare function pack(root: string): Promise<Uint8Array>;
|
|
32
|
+
export declare function record<T>(value: unknown): Record<string, T>;
|
|
33
|
+
export declare function strings(value: unknown): string[];
|
|
34
|
+
/** A source to take a package from without this computer: a registry or a repository. */
|
|
35
|
+
export declare function published(source: string): boolean;
|
|
36
|
+
export declare abstract class MomentsHostBase {
|
|
37
|
+
protected readonly host: Host;
|
|
38
|
+
protected readonly now: () => number;
|
|
39
|
+
protected queue: Promise<unknown>;
|
|
40
|
+
protected timers: ReturnType<typeof setTimeout>[];
|
|
41
|
+
protected settle?: ReturnType<typeof setTimeout>;
|
|
42
|
+
protected bump?: ReturnType<typeof setTimeout>;
|
|
43
|
+
protected stopEvents?: () => void;
|
|
44
|
+
protected defined: boolean;
|
|
45
|
+
/** Pictures asked of their author, by `room:post:index`: when. */
|
|
46
|
+
protected readonly asked: Map<string, number>;
|
|
47
|
+
/** Parts of pictures coming from their author, by `room:post:index`. */
|
|
48
|
+
protected readonly incoming: Map<string, {
|
|
49
|
+
parts: string[];
|
|
50
|
+
at: number;
|
|
51
|
+
}>;
|
|
52
|
+
/** Pictures sent to friends, one after another, paced for the relay. */
|
|
53
|
+
protected serving: Promise<unknown>;
|
|
54
|
+
/** Between the parts sent: the relay takes 40 messages a second of a connection. */
|
|
55
|
+
protected pace: number;
|
|
56
|
+
protected fetching?: ReturnType<typeof setTimeout>;
|
|
57
|
+
protected telling?: ReturnType<typeof setTimeout>;
|
|
58
|
+
/** What was last given to the brief, not written again while it is the same. */
|
|
59
|
+
protected briefed?: string;
|
|
60
|
+
/** The words on posts: comments, replies, questions the double answers. */
|
|
61
|
+
readonly talk: MomentsTalk;
|
|
62
|
+
constructor(host: Host, now?: () => number);
|
|
63
|
+
protected abstract writeBrief(): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Takes away what went: the user's posts past their time (their pictures here too), the pictures kept of friends'
|
|
66
|
+
* posts that went or of friends no longer followed, the oldest of those past Limits.CACHE_BYTES, old drafts.
|
|
67
|
+
*/
|
|
68
|
+
protected sweep(): Promise<void>;
|
|
69
|
+
/** Pictures of friends' posts: only of rooms followed, only of posts still there, the newest within Limits.CACHE_BYTES. */
|
|
70
|
+
protected sweepCache(rooms: TaRoomInfo[]): Promise<void>;
|
|
71
|
+
protected sweepDrafts(): Promise<void>;
|
|
72
|
+
/** Keeps at most Limits.POSTS posts. */
|
|
73
|
+
protected trim(room: string): Promise<void>;
|
|
74
|
+
/** Writes into the room; when it is full, the oldest posts go first, one by one. */
|
|
75
|
+
protected room(room: string, write: () => Promise<void>): Promise<void>;
|
|
76
|
+
protected drop(room: string, post: string): Promise<void>;
|
|
77
|
+
protected mark(room: string, post: string, prefix: string, on: boolean): Promise<void>;
|
|
78
|
+
protected postsRoot(): string;
|
|
79
|
+
protected postDir(post: string): string;
|
|
80
|
+
protected cacheRoot(): string;
|
|
81
|
+
protected cacheDir(room: string, post: string): string;
|
|
82
|
+
protected readPicture(dir: string, index: number): Promise<string>;
|
|
83
|
+
protected writePicture(dir: string, index: number, data: string): Promise<void>;
|
|
84
|
+
protected mine(rooms: TaRoomInfo[]): TaRoomInfo | undefined;
|
|
85
|
+
protected posts(room: string): Promise<Record<string, TaRoomValue>>;
|
|
86
|
+
protected draftDir(key: string): string | undefined;
|
|
87
|
+
protected decide(key: string, decision: DraftDecision): Promise<void>;
|
|
88
|
+
/** Pages read the state again, once the changes of a moment are done. */
|
|
89
|
+
protected changed(): void;
|
|
90
|
+
protected read(key: string): Promise<unknown>;
|
|
91
|
+
protected write(key: string, value: unknown): Promise<void>;
|
|
92
|
+
/** A call of the host of ta-initiative, which defines the kind first; undefined when it is not there. */
|
|
93
|
+
protected initiative(method: string, ...params: unknown[]): Promise<unknown>;
|
|
94
|
+
protected serial<T>(work: () => Promise<T>): Promise<T>;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=moments-host-base.d.ts.map
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MomentsHostBase = exports.INCOMING_MS = exports.ROOM_ID = exports.DRAFT_DAYS = exports.SETTLE_MS = exports.SWEEP_MS = exports.DAY_MS = exports.KIND_OF_POST = exports.INITIATIVE = exports.NOTIFY = void 0;
|
|
4
|
+
exports.pack = pack;
|
|
5
|
+
exports.record = record;
|
|
6
|
+
exports.strings = strings;
|
|
7
|
+
exports.published = published;
|
|
8
|
+
const node_child_process_1 = require("node:child_process");
|
|
9
|
+
const promises_1 = require("node:fs/promises");
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
|
+
const moments_protocol_1 = require("./moments-protocol");
|
|
12
|
+
const post_util_1 = require("./post-util");
|
|
13
|
+
const server_texts_1 = require("./server-texts");
|
|
14
|
+
const talk_host_1 = require("./talk-host");
|
|
15
|
+
exports.NOTIFY = '@celljs/ta-notify';
|
|
16
|
+
exports.INITIATIVE = '@celljs/ta-initiative';
|
|
17
|
+
/** Offering to post what the user made is a kind of initiative; a post others saw cannot be taken back, so it only asks. */
|
|
18
|
+
exports.KIND_OF_POST = {
|
|
19
|
+
id: moments_protocol_1.POST_KIND,
|
|
20
|
+
owner: moments_protocol_1.NAME,
|
|
21
|
+
title: { en: 'Offer to post what you made to Moments', zh: '提议把做出来的东西发到动态' },
|
|
22
|
+
reversible: false,
|
|
23
|
+
level: 'ask',
|
|
24
|
+
};
|
|
25
|
+
exports.DAY_MS = 86400000;
|
|
26
|
+
exports.SWEEP_MS = 60 * 60 * 1000;
|
|
27
|
+
exports.SETTLE_MS = 400;
|
|
28
|
+
exports.DRAFT_DAYS = 7;
|
|
29
|
+
/** What the relay generates for a room: the name of a directory of its pictures here. */
|
|
30
|
+
exports.ROOM_ID = /^[A-Za-z0-9_-]{1,64}$/;
|
|
31
|
+
/** Parts of a picture coming that stopped coming are let go of. */
|
|
32
|
+
exports.INCOMING_MS = 5 * 60000;
|
|
33
|
+
/** Packs a directory as a .tgz, its directory at the top, without what is installed or of Git. */
|
|
34
|
+
function pack(root) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
(0, node_child_process_1.execFile)('tar', ['-czf', '-', '--exclude=node_modules', '--exclude=.git', '-C', (0, node_path_1.dirname)(root), (0, node_path_1.basename)(root)], { encoding: 'buffer', maxBuffer: 16 * 1024 * 1024 }, (error, stdout) => (error ? reject(error) : resolve(new Uint8Array(stdout))));
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function record(value) {
|
|
40
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
41
|
+
}
|
|
42
|
+
function strings(value) {
|
|
43
|
+
return Array.isArray(value) ? value.filter((item) => typeof item === 'string') : [];
|
|
44
|
+
}
|
|
45
|
+
/** A source to take a package from without this computer: a registry or a repository. */
|
|
46
|
+
function published(source) {
|
|
47
|
+
return /^(npm:|git:|git\+|https?:\/\/|github:)/.test(source);
|
|
48
|
+
}
|
|
49
|
+
class MomentsHostBase {
|
|
50
|
+
constructor(host, now = Date.now) {
|
|
51
|
+
this.host = host;
|
|
52
|
+
this.now = now;
|
|
53
|
+
this.queue = Promise.resolve();
|
|
54
|
+
this.timers = [];
|
|
55
|
+
this.defined = false;
|
|
56
|
+
/** Pictures asked of their author, by `room:post:index`: when. */
|
|
57
|
+
this.asked = new Map();
|
|
58
|
+
/** Parts of pictures coming from their author, by `room:post:index`. */
|
|
59
|
+
this.incoming = new Map();
|
|
60
|
+
/** Pictures sent to friends, one after another, paced for the relay. */
|
|
61
|
+
this.serving = Promise.resolve();
|
|
62
|
+
/** Between the parts sent: the relay takes 40 messages a second of a connection. */
|
|
63
|
+
this.pace = 60;
|
|
64
|
+
this.talk = new talk_host_1.MomentsTalk(host, { post: id => this.postDir(id), cache: (room, id) => this.cacheDir(room, id) }, () => this.changed(), now);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Takes away what went: the user's posts past their time (their pictures here too), the pictures kept of friends'
|
|
68
|
+
* posts that went or of friends no longer followed, the oldest of those past Limits.CACHE_BYTES, old drafts.
|
|
69
|
+
*/
|
|
70
|
+
sweep() {
|
|
71
|
+
return this.serial(async () => {
|
|
72
|
+
const rooms = await this.host.rooms.listRooms();
|
|
73
|
+
const room = this.mine(rooms);
|
|
74
|
+
const now = this.now();
|
|
75
|
+
if (room === null || room === void 0 ? void 0 : room.connected) {
|
|
76
|
+
const state = await this.host.rooms.getState(room.id, moments_protocol_1.StateKeys.POST);
|
|
77
|
+
for (const [key, value] of Object.entries(state)) {
|
|
78
|
+
const post = post_util_1.PostUtil.check(value.value);
|
|
79
|
+
if (!post || (post.until !== undefined && post.until <= now)) {
|
|
80
|
+
await this.drop(room.id, key.slice(moments_protocol_1.StateKeys.POST.length));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Pictures kept on the relay before.
|
|
84
|
+
for (const key of Object.keys(await this.host.rooms.getState(room.id, moments_protocol_1.StateKeys.IMG))) {
|
|
85
|
+
await this.host.rooms.setState(room.id, key, null).catch(() => undefined);
|
|
86
|
+
}
|
|
87
|
+
const kept = new Set(Object.keys(await this.host.rooms.getState(room.id, moments_protocol_1.StateKeys.POST)).map(key => key.slice(moments_protocol_1.StateKeys.POST.length)));
|
|
88
|
+
for (const post of await (0, promises_1.readdir)(this.postsRoot()).catch(() => [])) {
|
|
89
|
+
if (!kept.has(post)) {
|
|
90
|
+
await (0, promises_1.rm)((0, node_path_1.join)(this.postsRoot(), post), { recursive: true, force: true });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
await this.sweepCache(rooms);
|
|
95
|
+
await this.sweepDrafts();
|
|
96
|
+
if (room === null || room === void 0 ? void 0 : room.connected) {
|
|
97
|
+
const kept = new Set(Object.keys(await this.host.rooms.getState(room.id, moments_protocol_1.StateKeys.POST)).map(key => key.slice(moments_protocol_1.StateKeys.POST.length)));
|
|
98
|
+
await this.talk.sweep(kept, new Set(rooms.filter(item => !item.owner && item.status !== 'gone' && item.status !== 'refused').map(item => item.id)));
|
|
99
|
+
}
|
|
100
|
+
this.changed();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** Pictures of friends' posts: only of rooms followed, only of posts still there, the newest within Limits.CACHE_BYTES. */
|
|
104
|
+
async sweepCache(rooms) {
|
|
105
|
+
var _a, _b;
|
|
106
|
+
const root = this.cacheRoot();
|
|
107
|
+
const now = this.now();
|
|
108
|
+
const followed = new Map(rooms.filter(room => !room.owner && room.status === 'member').map(room => [room.id, room]));
|
|
109
|
+
const kept = [];
|
|
110
|
+
for (const id of await (0, promises_1.readdir)(root).catch(() => [])) {
|
|
111
|
+
const room = followed.get(id);
|
|
112
|
+
if (!room) {
|
|
113
|
+
await (0, promises_1.rm)((0, node_path_1.join)(root, id), { recursive: true, force: true });
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
// Only once the room said what it holds: a room not connected yet would seem empty.
|
|
117
|
+
const there = room.connected
|
|
118
|
+
? new Set(post_util_1.PostUtil.feed({ room, state: await this.host.rooms.getState(id, moments_protocol_1.StateKeys.POST), me: '', friends: new Set(), now }).map(post => post.id))
|
|
119
|
+
: undefined;
|
|
120
|
+
for (const post of await (0, promises_1.readdir)((0, node_path_1.join)(root, id)).catch(() => [])) {
|
|
121
|
+
const dir = (0, node_path_1.join)(root, id, post);
|
|
122
|
+
if (there && !there.has(post)) {
|
|
123
|
+
await (0, promises_1.rm)(dir, { recursive: true, force: true });
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
let size = 0;
|
|
127
|
+
let at = 0;
|
|
128
|
+
for (const file of await (0, promises_1.readdir)(dir).catch(() => [])) {
|
|
129
|
+
const info = await (0, promises_1.stat)((0, node_path_1.join)(dir, file)).catch(() => undefined);
|
|
130
|
+
size += (_a = info === null || info === void 0 ? void 0 : info.size) !== null && _a !== void 0 ? _a : 0;
|
|
131
|
+
at = Math.max(at, (_b = info === null || info === void 0 ? void 0 : info.mtimeMs) !== null && _b !== void 0 ? _b : 0);
|
|
132
|
+
}
|
|
133
|
+
kept.push({ dir, at, size });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
let total = kept.reduce((sum, item) => sum + item.size, 0);
|
|
137
|
+
for (const item of kept.sort((x, y) => x.at - y.at)) {
|
|
138
|
+
if (total <= moments_protocol_1.Limits.CACHE_BYTES) {
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
await (0, promises_1.rm)(item.dir, { recursive: true, force: true });
|
|
142
|
+
total -= item.size;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
async sweepDrafts() {
|
|
146
|
+
const dir = (0, node_path_1.join)(this.host.agentDir, 'ta-moments', 'drafts');
|
|
147
|
+
for (const name of await (0, promises_1.readdir)(dir).catch(() => [])) {
|
|
148
|
+
const info = await (0, promises_1.stat)((0, node_path_1.join)(dir, name)).catch(() => undefined);
|
|
149
|
+
if (info && this.now() - info.mtimeMs > exports.DRAFT_DAYS * exports.DAY_MS) {
|
|
150
|
+
await (0, promises_1.rm)((0, node_path_1.join)(dir, name), { recursive: true, force: true });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** Keeps at most Limits.POSTS posts. */
|
|
155
|
+
async trim(room) {
|
|
156
|
+
const posts = Object.entries(await this.host.rooms.getState(room, moments_protocol_1.StateKeys.POST))
|
|
157
|
+
.map(([key, value]) => { var _a; var _b; return ({ id: key.slice(moments_protocol_1.StateKeys.POST.length), at: (_b = (_a = post_util_1.PostUtil.check(value.value)) === null || _a === void 0 ? void 0 : _a.at) !== null && _b !== void 0 ? _b : 0 }); })
|
|
158
|
+
.sort((a, b) => b.at - a.at);
|
|
159
|
+
for (const post of posts.slice(moments_protocol_1.Limits.POSTS)) {
|
|
160
|
+
await this.drop(room, post.id);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/** Writes into the room; when it is full, the oldest posts go first, one by one. */
|
|
164
|
+
async room(room, write) {
|
|
165
|
+
for (let attempt = 0;; attempt++) {
|
|
166
|
+
try {
|
|
167
|
+
await write();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
const full = error instanceof Error && /full/.test(error.message);
|
|
172
|
+
const posts = Object.entries(await this.host.rooms.getState(room, moments_protocol_1.StateKeys.POST)).sort((a, b) => { var _a, _b; var _c, _d; return ((_c = (_a = post_util_1.PostUtil.check(a[1].value)) === null || _a === void 0 ? void 0 : _a.at) !== null && _c !== void 0 ? _c : 0) - ((_d = (_b = post_util_1.PostUtil.check(b[1].value)) === null || _b === void 0 ? void 0 : _b.at) !== null && _d !== void 0 ? _d : 0); });
|
|
173
|
+
if (!full || attempt >= 10 || !posts.length) {
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
await this.drop(room, posts[0][0].slice(moments_protocol_1.StateKeys.POST.length));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
async drop(room, post) {
|
|
181
|
+
const keys = post_util_1.PostUtil.keysOf(post, Object.keys(await this.host.rooms.getState(room)));
|
|
182
|
+
for (const key of keys) {
|
|
183
|
+
await this.host.rooms.setState(room, key, null).catch(() => undefined);
|
|
184
|
+
}
|
|
185
|
+
if (post_util_1.PostUtil.isId(post)) {
|
|
186
|
+
await (0, promises_1.rm)(this.postDir(post), { recursive: true, force: true });
|
|
187
|
+
}
|
|
188
|
+
const shares = record(await this.read(moments_protocol_1.Keys.SHARES));
|
|
189
|
+
if (shares[post]) {
|
|
190
|
+
await this.host.shares.remove(shares[post]).catch(() => undefined);
|
|
191
|
+
delete shares[post];
|
|
192
|
+
await this.write(moments_protocol_1.Keys.SHARES, shares);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async mark(room, post, prefix, on) {
|
|
196
|
+
const info = (await this.host.rooms.listRooms()).find(item => item.id === room && item.status === 'member');
|
|
197
|
+
const self = info === null || info === void 0 ? void 0 : info.members.find(member => member.self);
|
|
198
|
+
if (!info || !self || !post_util_1.PostUtil.isId(post)) {
|
|
199
|
+
throw new Error(server_texts_1.MomentsServerTexts.notFound());
|
|
200
|
+
}
|
|
201
|
+
await this.host.rooms.setState(room, `${prefix}${post}:${self.member}`, on ? 1 : null);
|
|
202
|
+
this.changed();
|
|
203
|
+
}
|
|
204
|
+
postsRoot() {
|
|
205
|
+
return (0, node_path_1.join)(this.host.agentDir, 'ta-moments', 'posts');
|
|
206
|
+
}
|
|
207
|
+
postDir(post) {
|
|
208
|
+
return (0, node_path_1.join)(this.postsRoot(), post);
|
|
209
|
+
}
|
|
210
|
+
cacheRoot() {
|
|
211
|
+
return (0, node_path_1.join)(this.host.agentDir, 'ta-moments', 'cache');
|
|
212
|
+
}
|
|
213
|
+
cacheDir(room, post) {
|
|
214
|
+
return (0, node_path_1.join)(this.cacheRoot(), room, post);
|
|
215
|
+
}
|
|
216
|
+
async readPicture(dir, index) {
|
|
217
|
+
const data = await (0, promises_1.readFile)((0, node_path_1.join)(dir, `${index}.txt`), 'utf8').catch(() => '');
|
|
218
|
+
return post_util_1.PostUtil.isPicture(data) ? data : '';
|
|
219
|
+
}
|
|
220
|
+
async writePicture(dir, index, data) {
|
|
221
|
+
await (0, promises_1.mkdir)(dir, { recursive: true });
|
|
222
|
+
await (0, promises_1.writeFile)((0, node_path_1.join)(dir, `${index}.txt`), data);
|
|
223
|
+
}
|
|
224
|
+
mine(rooms) {
|
|
225
|
+
return rooms.find(room => room.kind === moments_protocol_1.KIND && room.owner && room.status === 'member');
|
|
226
|
+
}
|
|
227
|
+
async posts(room) {
|
|
228
|
+
const [posts, likes, took] = await Promise.all([moments_protocol_1.StateKeys.POST, moments_protocol_1.StateKeys.LIKE, moments_protocol_1.StateKeys.TOOK].map(prefix => this.host.rooms.getState(room, prefix).catch(() => ({}))));
|
|
229
|
+
return { ...posts, ...likes, ...took };
|
|
230
|
+
}
|
|
231
|
+
draftDir(key) {
|
|
232
|
+
return typeof key === 'string' && /^[A-Za-z0-9-]{1,80}$/.test(key) ? (0, node_path_1.join)(this.host.agentDir, 'ta-moments', 'drafts', key) : undefined;
|
|
233
|
+
}
|
|
234
|
+
async decide(key, decision) {
|
|
235
|
+
const decided = record(await this.read(moments_protocol_1.Keys.DECIDED));
|
|
236
|
+
decided[key] = decision;
|
|
237
|
+
// The latest 200: a card of before shows what was decided.
|
|
238
|
+
await this.write(moments_protocol_1.Keys.DECIDED, Object.fromEntries(Object.entries(decided).slice(-200)));
|
|
239
|
+
}
|
|
240
|
+
/** Pages read the state again, once the changes of a moment are done. */
|
|
241
|
+
changed() {
|
|
242
|
+
var _a, _b;
|
|
243
|
+
clearTimeout(this.bump);
|
|
244
|
+
this.bump = setTimeout(() => {
|
|
245
|
+
void this.write(moments_protocol_1.Keys.REV, this.now()).catch(() => undefined);
|
|
246
|
+
void this.writeBrief().catch(error => console.error('ta-moments could not tell the brief:', error));
|
|
247
|
+
}, exports.SETTLE_MS);
|
|
248
|
+
(_b = (_a = this.bump).unref) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
249
|
+
}
|
|
250
|
+
read(key) {
|
|
251
|
+
return this.host.getExtensionData(moments_protocol_1.NAME, key);
|
|
252
|
+
}
|
|
253
|
+
write(key, value) {
|
|
254
|
+
return this.host.setExtensionData(moments_protocol_1.NAME, key, value);
|
|
255
|
+
}
|
|
256
|
+
/** A call of the host of ta-initiative, which defines the kind first; undefined when it is not there. */
|
|
257
|
+
async initiative(method, ...params) {
|
|
258
|
+
try {
|
|
259
|
+
if (!this.defined) {
|
|
260
|
+
await this.host.callPackageHost(exports.INITIATIVE, 'defineKind', [exports.KIND_OF_POST]);
|
|
261
|
+
this.defined = true;
|
|
262
|
+
}
|
|
263
|
+
return await this.host.callPackageHost(exports.INITIATIVE, method, params);
|
|
264
|
+
}
|
|
265
|
+
catch (_a) {
|
|
266
|
+
return undefined;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
serial(work) {
|
|
270
|
+
const next = this.queue.then(work, work);
|
|
271
|
+
this.queue = next.catch(() => undefined);
|
|
272
|
+
return next;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
exports.MomentsHostBase = MomentsHostBase;
|
|
276
|
+
//# sourceMappingURL=moments-host-base.js.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TaRoomEvent, TaRoomInfo } from '@celljs/ta-protocol';
|
|
2
|
+
import { MomentsHostBase } from './moments-host-base';
|
|
3
|
+
export declare abstract class MomentsHostPictures extends MomentsHostBase {
|
|
4
|
+
/** A post of a friend changed: gone, its pictures here go; new, they are asked of its author. */
|
|
5
|
+
protected postChanged(room: string, post: string, value: unknown): Promise<void>;
|
|
6
|
+
/** Asks the authors online for the pictures of their posts this computer has not got, once things settle. */
|
|
7
|
+
protected fetchSoon(): void;
|
|
8
|
+
fetchMissing(): Promise<void>;
|
|
9
|
+
/** Asks the author of a post for pictures, to this computer alone, unless asked a moment ago or it is offline. */
|
|
10
|
+
protected want(room: TaRoomInfo, post: string, indexes: number[]): Promise<void>;
|
|
11
|
+
/** A message of a room of posts: a friend asking for a picture of the user's, or a picture of a friend's coming. */
|
|
12
|
+
protected heard(event: Extract<TaRoomEvent, {
|
|
13
|
+
type: 'message';
|
|
14
|
+
}>): Promise<void>;
|
|
15
|
+
/** Sends a picture of the user's post to the friend who asked, in parts, one after another. */
|
|
16
|
+
protected serve(room: string, to: string, post: string, index: number): void;
|
|
17
|
+
/** The pictures of friends' posts of a room this computer no longer follows. */
|
|
18
|
+
/** What was kept of the posts of one no longer a friend: the room of theirs is gone (left, or let go of). */
|
|
19
|
+
protected forgetGone(): Promise<void>;
|
|
20
|
+
protected forget(room: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=moments-host-pictures.d.ts.map
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MomentsHostPictures = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
|
+
const moments_host_base_1 = require("./moments-host-base");
|
|
7
|
+
const moments_protocol_1 = require("./moments-protocol");
|
|
8
|
+
const post_util_1 = require("./post-util");
|
|
9
|
+
const talk_util_1 = require("./talk-util");
|
|
10
|
+
class MomentsHostPictures extends moments_host_base_1.MomentsHostBase {
|
|
11
|
+
/** A post of a friend changed: gone, its pictures here go; new, they are asked of its author. */
|
|
12
|
+
async postChanged(room, post, value) {
|
|
13
|
+
const info = (await this.host.rooms.listRooms()).find(item => item.id === room);
|
|
14
|
+
if (!info || info.owner || !post_util_1.PostUtil.isId(post) || !moments_host_base_1.ROOM_ID.test(room)) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (value === null) {
|
|
18
|
+
await (0, promises_1.rm)(this.cacheDir(room, post), { recursive: true, force: true });
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this.fetchSoon();
|
|
22
|
+
}
|
|
23
|
+
/** Asks the authors online for the pictures of their posts this computer has not got, once things settle. */
|
|
24
|
+
fetchSoon() {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
clearTimeout(this.fetching);
|
|
27
|
+
this.fetching = setTimeout(() => {
|
|
28
|
+
void this.forgetGone().catch(error => console.error('ta-moments:', error));
|
|
29
|
+
void this.fetchMissing().catch(error => console.error('ta-moments:', error));
|
|
30
|
+
void this.host.rooms
|
|
31
|
+
.listRooms()
|
|
32
|
+
.then(rooms => this.talk.sync(rooms))
|
|
33
|
+
.catch(error => console.error('ta-moments:', error));
|
|
34
|
+
}, 1000);
|
|
35
|
+
(_b = (_a = this.fetching).unref) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
36
|
+
}
|
|
37
|
+
async fetchMissing() {
|
|
38
|
+
const now = this.now();
|
|
39
|
+
for (const room of (await this.host.rooms.listRooms()).filter(item => !item.owner && item.status === 'member' && item.connected)) {
|
|
40
|
+
const owner = room.members.find(member => member.owner);
|
|
41
|
+
if (!(owner === null || owner === void 0 ? void 0 : owner.online) || !moments_host_base_1.ROOM_ID.test(room.id)) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
for (const post of post_util_1.PostUtil.feed({ room, state: await this.host.rooms.getState(room.id, moments_protocol_1.StateKeys.POST), me: '', friends: new Set(), now })) {
|
|
45
|
+
const dir = this.cacheDir(room.id, post.id);
|
|
46
|
+
const missing = [];
|
|
47
|
+
for (const index of post.images.keys()) {
|
|
48
|
+
if (!(await this.readPicture(dir, index))) {
|
|
49
|
+
missing.push(index);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
await this.want(room, post.id, missing);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** Asks the author of a post for pictures, to this computer alone, unless asked a moment ago or it is offline. */
|
|
57
|
+
async want(room, post, indexes) {
|
|
58
|
+
var _a;
|
|
59
|
+
const owner = room.members.find(member => member.owner);
|
|
60
|
+
if (!(owner === null || owner === void 0 ? void 0 : owner.online) || room.status !== 'member') {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const now = this.now();
|
|
64
|
+
for (const index of indexes) {
|
|
65
|
+
const key = `${room.id}:${post}:${index}`;
|
|
66
|
+
if (now - ((_a = this.asked.get(key)) !== null && _a !== void 0 ? _a : 0) < moments_protocol_1.Limits.ASK_AGAIN_MS) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
this.asked.set(key, now);
|
|
70
|
+
await this.host.rooms.send(room.id, { t: 'ta-moments:want', post, index }, owner.member).catch(() => undefined);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/** A message of a room of posts: a friend asking for a picture of the user's, or a picture of a friend's coming. */
|
|
74
|
+
async heard(event) {
|
|
75
|
+
var _a;
|
|
76
|
+
var _b, _c;
|
|
77
|
+
const words = talk_util_1.TalkUtil.message(event.data);
|
|
78
|
+
const message = words ? undefined : post_util_1.PostUtil.message(event.data);
|
|
79
|
+
if (!message && !words) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const room = (await this.host.rooms.listRooms()).find(item => item.id === event.room && item.status === 'member' && item.kind === moments_protocol_1.KIND);
|
|
83
|
+
const sender = room === null || room === void 0 ? void 0 : room.members.find(member => member.member === event.from);
|
|
84
|
+
if (!room || !sender || sender.self || sender.guest) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (words) {
|
|
88
|
+
await this.talk.heard(room, sender, words);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (!message) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (message.t === 'ta-moments:want') {
|
|
95
|
+
if (room.owner) {
|
|
96
|
+
this.serve(room.id, event.from, message.post, message.index);
|
|
97
|
+
}
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
// Only from the author, into the directory of a post that is there.
|
|
101
|
+
if (room.owner || !sender.owner || !moments_host_base_1.ROOM_ID.test(room.id)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const key = `${room.id}:${message.post}:${message.index}`;
|
|
105
|
+
const now = this.now();
|
|
106
|
+
for (const [other, coming] of this.incoming) {
|
|
107
|
+
if (now - coming.at > moments_host_base_1.INCOMING_MS) {
|
|
108
|
+
this.incoming.delete(other);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const coming = (_b = this.incoming.get(key)) !== null && _b !== void 0 ? _b : { parts: [], at: now };
|
|
112
|
+
if (coming.parts.length !== message.parts) {
|
|
113
|
+
coming.parts = new Array(message.parts).fill('');
|
|
114
|
+
}
|
|
115
|
+
coming.parts[message.part] = message.d;
|
|
116
|
+
coming.at = now;
|
|
117
|
+
this.incoming.set(key, coming);
|
|
118
|
+
if (coming.parts.some(part => !part)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.incoming.delete(key);
|
|
122
|
+
const data = coming.parts.join('');
|
|
123
|
+
const value = (await this.host.rooms.getState(room.id, `${moments_protocol_1.StateKeys.POST}${message.post}`))[`${moments_protocol_1.StateKeys.POST}${message.post}`];
|
|
124
|
+
const post = (value === null || value === void 0 ? void 0 : value.by) === sender.member ? post_util_1.PostUtil.check(value.value) : undefined;
|
|
125
|
+
if (!post_util_1.PostUtil.isPicture(data) || !post || message.index >= ((_c = (_a = post.images) === null || _a === void 0 ? void 0 : _a.length) !== null && _c !== void 0 ? _c : 0)) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
await this.writePicture(this.cacheDir(room.id, message.post), message.index, data);
|
|
129
|
+
this.asked.delete(key);
|
|
130
|
+
this.changed();
|
|
131
|
+
}
|
|
132
|
+
/** Sends a picture of the user's post to the friend who asked, in parts, one after another. */
|
|
133
|
+
serve(room, to, post, index) {
|
|
134
|
+
this.serving = this.serving
|
|
135
|
+
.then(async () => {
|
|
136
|
+
const data = await this.readPicture(this.postDir(post), index);
|
|
137
|
+
if (!data) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const parts = post_util_1.PostUtil.parts(data);
|
|
141
|
+
for (const [part, d] of parts.entries()) {
|
|
142
|
+
await this.host.rooms.send(room, { t: 'ta-moments:img', post, index, part, parts: parts.length, d }, to);
|
|
143
|
+
if (this.pace) {
|
|
144
|
+
await new Promise(resolve => setTimeout(resolve, this.pace));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
})
|
|
148
|
+
.catch(error => console.error('ta-moments could not send a picture:', error));
|
|
149
|
+
}
|
|
150
|
+
/** The pictures of friends' posts of a room this computer no longer follows. */
|
|
151
|
+
/** What was kept of the posts of one no longer a friend: the room of theirs is gone (left, or let go of). */
|
|
152
|
+
async forgetGone() {
|
|
153
|
+
const followed = new Set((await this.host.rooms.listRooms()).filter(room => !room.owner && room.status === 'member').map(room => room.id));
|
|
154
|
+
for (const id of await (0, promises_1.readdir)(this.cacheRoot()).catch(() => [])) {
|
|
155
|
+
if (!followed.has(id)) {
|
|
156
|
+
await this.forget(id);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async forget(room) {
|
|
161
|
+
if (moments_host_base_1.ROOM_ID.test(room)) {
|
|
162
|
+
await (0, promises_1.rm)((0, node_path_1.join)(this.cacheRoot(), room), { recursive: true, force: true });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
exports.MomentsHostPictures = MomentsHostPictures;
|
|
167
|
+
//# sourceMappingURL=moments-host-pictures.js.map
|