@celljs/ta 4.12.0 → 4.13.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 +2 -2
- package/README.md +2 -2
- package/dist/cli.mjs +1006 -164
- package/dist/gateway.mjs +161 -2
- package/dist/pi/CHANGELOG.md +11 -0
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/README.en.md +1 -1
- package/dist/pi/packages/ta-agents/README.md +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +75 -11
- package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +2 -2
- package/dist/pi/packages/ta-agents/lib/acp-protocol.js +5 -2
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +6 -4
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +7 -5
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.js +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +44 -3
- package/dist/pi/packages/ta-agents/lib/agent-turn.d.ts +12 -2
- package/dist/pi/packages/ta-agents/lib/agent-turn.js +29 -4
- package/dist/pi/packages/ta-agents/package.json +1 -1
- package/dist/pi/packages/ta-bots/extension/index.mjs +51 -0
- package/dist/pi/packages/ta-bots/host/index.mjs +157 -0
- package/dist/pi/packages/ta-bots/package.json +7 -2
- package/dist/pi/packages/ta-changes/extension/index.mjs +51 -0
- package/dist/pi/packages/ta-changes/package.json +8 -2
- package/dist/pi/packages/ta-channels/README.en.md +3 -1
- package/dist/pi/packages/ta-channels/README.md +3 -1
- package/dist/pi/packages/ta-channels/extension/index.mjs +55 -2
- package/dist/pi/packages/ta-channels/host/index.mjs +268 -8
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts +25 -0
- package/dist/pi/packages/ta-channels/lib/channels-util.js +8 -2
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-channels/lib/i18n.js +2 -0
- package/dist/pi/packages/ta-channels/lib/room.d.ts +0 -4
- package/dist/pi/packages/ta-channels/lib/room.js +31 -5
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +7 -13
- package/dist/pi/packages/ta-channels/lib/team-view.d.ts +19 -0
- package/dist/pi/packages/ta-channels/lib/team-view.js +45 -0
- package/dist/pi/packages/ta-channels/lib/team.d.ts +20 -4
- package/dist/pi/packages/ta-channels/lib/team.js +87 -6
- package/dist/pi/packages/ta-channels/package.json +26 -2
- package/dist/pi/packages/ta-channels/web/index.js +137 -27
- package/dist/pi/packages/ta-computer-use/package.json +1 -1
- package/dist/pi/packages/ta-cron/README.en.md +2 -2
- package/dist/pi/packages/ta-cron/README.md +2 -2
- package/dist/pi/packages/ta-cron/extension/index.mjs +91 -257
- package/dist/pi/packages/ta-cron/host/index.mjs +9 -0
- package/dist/pi/packages/ta-cron/lib/chat-task.d.ts +16 -15
- package/dist/pi/packages/ta-cron/lib/chat-task.js +45 -36
- package/dist/pi/packages/ta-cron/lib/extension.js +11 -7
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +5 -7
- package/dist/pi/packages/ta-cron/lib/i18n.js +10 -14
- package/dist/pi/packages/ta-cron/lib/index.js +0 -2
- package/dist/pi/packages/ta-cron/lib/page.d.ts +5 -0
- package/dist/pi/packages/ta-cron/lib/page.js +24 -0
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +8 -0
- package/dist/pi/packages/ta-cron/lib/task-change.d.ts +11 -0
- package/dist/pi/packages/ta-cron/lib/task-change.js +43 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +3 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.js +2 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +5 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +13 -0
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +26 -2
- package/dist/pi/packages/ta-cron/package.json +10 -2
- package/dist/pi/packages/ta-cron/web/index.js +607 -784
- package/dist/pi/packages/ta-extensions/README.en.md +1 -2
- package/dist/pi/packages/ta-extensions/README.md +1 -2
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +0 -4
- package/dist/pi/packages/ta-extensions/lib/i18n.js +2 -10
- package/dist/pi/packages/ta-extensions/lib/index.js +0 -2
- package/dist/pi/packages/ta-extensions/package.json +10 -2
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +15 -11
- package/dist/pi/packages/ta-extensions/web/index.js +176 -97
- package/dist/pi/packages/ta-games/package.json +8 -2
- package/dist/pi/packages/ta-glance/README.en.md +1 -0
- package/dist/pi/packages/ta-glance/README.md +1 -0
- package/dist/pi/packages/ta-glance/extension/index.mjs +425 -3
- package/dist/pi/packages/ta-glance/lib/card.js +38 -12
- package/dist/pi/packages/ta-glance/lib/extension.d.ts +3 -0
- package/dist/pi/packages/ta-glance/lib/extension.js +10 -0
- package/dist/pi/packages/ta-glance/lib/glance-ask.d.ts +15 -0
- package/dist/pi/packages/ta-glance/lib/glance-ask.js +97 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +3 -3
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-glance/lib/glance-protocol.js +3 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.d.ts +6 -1
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +41 -7
- package/dist/pi/packages/ta-glance/lib/i18n.d.ts +5 -0
- package/dist/pi/packages/ta-glance/lib/i18n.js +9 -0
- package/dist/pi/packages/ta-glance/lib/index.js +4 -1
- package/dist/pi/packages/ta-glance/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-glance/lib/style.js +9 -1
- package/dist/pi/packages/ta-glance/package.json +1 -1
- package/dist/pi/packages/ta-glance/web/index.js +87 -19
- package/dist/pi/packages/ta-initiative/README.en.md +66 -0
- package/dist/pi/packages/ta-initiative/README.md +66 -0
- package/dist/pi/packages/ta-initiative/extension/index.mjs +720 -0
- package/dist/pi/packages/ta-initiative/host/index.mjs +1169 -0
- package/dist/pi/packages/ta-initiative/lib/chat-kinds.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/chat-kinds.js +17 -0
- package/dist/pi/packages/ta-initiative/lib/chat-proposals.d.ts +28 -0
- package/dist/pi/packages/ta-initiative/lib/chat-proposals.js +79 -0
- package/dist/pi/packages/ta-initiative/lib/conversation.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/conversation.js +27 -0
- package/dist/pi/packages/ta-initiative/lib/cron-proposals.d.ts +23 -0
- package/dist/pi/packages/ta-initiative/lib/cron-proposals.js +94 -0
- package/dist/pi/packages/ta-initiative/lib/event-proposals.d.ts +13 -0
- package/dist/pi/packages/ta-initiative/lib/event-proposals.js +76 -0
- package/dist/pi/packages/ta-initiative/lib/extension.d.ts +30 -0
- package/dist/pi/packages/ta-initiative/lib/extension.js +238 -0
- package/dist/pi/packages/ta-initiative/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/host.js +11 -0
- package/dist/pi/packages/ta-initiative/lib/i18n.d.ts +79 -0
- package/dist/pi/packages/ta-initiative/lib/i18n.js +159 -0
- package/dist/pi/packages/ta-initiative/lib/inbox-util.d.ts +19 -0
- package/dist/pi/packages/ta-initiative/lib/inbox-util.js +45 -0
- package/dist/pi/packages/ta-initiative/lib/inbox.d.ts +23 -0
- package/dist/pi/packages/ta-initiative/lib/inbox.js +142 -0
- package/dist/pi/packages/ta-initiative/lib/index.d.ts +10 -0
- package/dist/pi/packages/ta-initiative/lib/index.js +121 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-protocol.d.ts +320 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-protocol.js +96 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-service.d.ts +37 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-service.js +104 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-store.d.ts +44 -0
- package/dist/pi/packages/ta-initiative/lib/initiative-store.js +112 -0
- package/dist/pi/packages/ta-initiative/lib/level-util.d.ts +22 -0
- package/dist/pi/packages/ta-initiative/lib/level-util.js +86 -0
- package/dist/pi/packages/ta-initiative/lib/material-util.d.ts +34 -0
- package/dist/pi/packages/ta-initiative/lib/material-util.js +155 -0
- package/dist/pi/packages/ta-initiative/lib/notices.d.ts +13 -0
- package/dist/pi/packages/ta-initiative/lib/notices.js +65 -0
- package/dist/pi/packages/ta-initiative/lib/notify-util.d.ts +25 -0
- package/dist/pi/packages/ta-initiative/lib/notify-util.js +60 -0
- package/dist/pi/packages/ta-initiative/lib/pace-util.d.ts +21 -0
- package/dist/pi/packages/ta-initiative/lib/pace-util.js +60 -0
- package/dist/pi/packages/ta-initiative/lib/page-initiative.d.ts +9 -0
- package/dist/pi/packages/ta-initiative/lib/page-initiative.js +40 -0
- package/dist/pi/packages/ta-initiative/lib/proposal-book.d.ts +61 -0
- package/dist/pi/packages/ta-initiative/lib/proposal-book.js +397 -0
- package/dist/pi/packages/ta-initiative/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-initiative/lib/react.js +16 -0
- package/dist/pi/packages/ta-initiative/lib/review-service.d.ts +32 -0
- package/dist/pi/packages/ta-initiative/lib/review-service.js +155 -0
- package/dist/pi/packages/ta-initiative/lib/server-texts.d.ts +7 -0
- package/dist/pi/packages/ta-initiative/lib/server-texts.js +17 -0
- package/dist/pi/packages/ta-initiative/lib/settings.d.ts +10 -0
- package/dist/pi/packages/ta-initiative/lib/settings.js +226 -0
- package/dist/pi/packages/ta-initiative/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-initiative/lib/style.js +56 -0
- package/dist/pi/packages/ta-initiative/lib/tool.d.ts +106 -0
- package/dist/pi/packages/ta-initiative/lib/tool.js +98 -0
- package/dist/pi/packages/ta-initiative/package.json +63 -0
- package/dist/pi/packages/ta-initiative/web/index.js +1226 -0
- package/dist/pi/packages/ta-launcher/README.en.md +2 -1
- package/dist/pi/packages/ta-launcher/README.md +2 -1
- package/dist/pi/packages/ta-launcher/lib/i18n.d.ts +2 -0
- package/dist/pi/packages/ta-launcher/lib/i18n.js +4 -0
- package/dist/pi/packages/ta-launcher/lib/launcher-view.js +32 -0
- package/dist/pi/packages/ta-launcher/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-launcher/lib/style.js +11 -0
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-launcher/web/index.js +58 -1
- package/dist/pi/packages/ta-manual/lib/pictures-b.js +29 -0
- package/dist/pi/packages/ta-manual/lib/pictures-c.js +109 -2
- package/dist/pi/packages/ta-manual/lib/topics.d.ts +4 -0
- package/dist/pi/packages/ta-manual/lib/topics.js +123 -11
- package/dist/pi/packages/ta-manual/package.json +1 -1
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +45 -10
- package/dist/pi/packages/ta-manual/web/index.js +567 -12
- package/dist/pi/packages/ta-moments/README.en.md +29 -0
- package/dist/pi/packages/ta-moments/README.md +29 -0
- package/dist/pi/packages/ta-moments/extension/index.mjs +1766 -0
- package/dist/pi/packages/ta-moments/host/index.mjs +2394 -0
- package/dist/pi/packages/ta-moments/lib/brief-util.d.ts +30 -0
- package/dist/pi/packages/ta-moments/lib/brief-util.js +92 -0
- package/dist/pi/packages/ta-moments/lib/context.d.ts +18 -0
- package/dist/pi/packages/ta-moments/lib/context.js +35 -0
- package/dist/pi/packages/ta-moments/lib/draft-card.d.ts +6 -0
- package/dist/pi/packages/ta-moments/lib/draft-card.js +60 -0
- package/dist/pi/packages/ta-moments/lib/editor.d.ts +16 -0
- package/dist/pi/packages/ta-moments/lib/editor.js +126 -0
- package/dist/pi/packages/ta-moments/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-moments/lib/extension.js +136 -0
- package/dist/pi/packages/ta-moments/lib/friends.d.ts +13 -0
- package/dist/pi/packages/ta-moments/lib/friends.js +27 -0
- package/dist/pi/packages/ta-moments/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-moments/lib/host.js +11 -0
- package/dist/pi/packages/ta-moments/lib/i18n.d.ts +92 -0
- package/dist/pi/packages/ta-moments/lib/i18n.js +201 -0
- package/dist/pi/packages/ta-moments/lib/image-util.d.ts +18 -0
- package/dist/pi/packages/ta-moments/lib/image-util.js +71 -0
- package/dist/pi/packages/ta-moments/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-moments/lib/index.js +50 -0
- package/dist/pi/packages/ta-moments/lib/moments-host.d.ts +133 -0
- package/dist/pi/packages/ta-moments/lib/moments-host.js +821 -0
- package/dist/pi/packages/ta-moments/lib/moments-protocol.d.ts +334 -0
- package/dist/pi/packages/ta-moments/lib/moments-protocol.js +99 -0
- package/dist/pi/packages/ta-moments/lib/page.d.ts +7 -0
- package/dist/pi/packages/ta-moments/lib/page.js +307 -0
- package/dist/pi/packages/ta-moments/lib/post-util.d.ts +31 -0
- package/dist/pi/packages/ta-moments/lib/post-util.js +205 -0
- package/dist/pi/packages/ta-moments/lib/server-texts.d.ts +29 -0
- package/dist/pi/packages/ta-moments/lib/server-texts.js +104 -0
- package/dist/pi/packages/ta-moments/lib/store.d.ts +33 -0
- package/dist/pi/packages/ta-moments/lib/store.js +108 -0
- package/dist/pi/packages/ta-moments/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-moments/lib/style.js +155 -0
- package/dist/pi/packages/ta-moments/lib/talk-host.d.ts +112 -0
- package/dist/pi/packages/ta-moments/lib/talk-host.js +582 -0
- package/dist/pi/packages/ta-moments/lib/talk-util.d.ts +26 -0
- package/dist/pi/packages/ta-moments/lib/talk-util.js +145 -0
- package/dist/pi/packages/ta-moments/lib/tool.d.ts +48 -0
- package/dist/pi/packages/ta-moments/lib/tool.js +56 -0
- package/dist/pi/packages/ta-moments/package.json +61 -0
- package/dist/pi/packages/ta-moments/web/index.js +1987 -0
- package/dist/pi/packages/ta-nearby/README.en.md +33 -0
- package/dist/pi/packages/ta-nearby/README.md +33 -0
- package/dist/pi/packages/ta-nearby/extension/index.mjs +389 -0
- package/dist/pi/packages/ta-nearby/host/index.mjs +1859 -0
- package/dist/pi/packages/ta-nearby/lib/extension.d.ts +27 -0
- package/dist/pi/packages/ta-nearby/lib/extension.js +190 -0
- package/dist/pi/packages/ta-nearby/lib/host.d.ts +7 -0
- package/dist/pi/packages/ta-nearby/lib/host.js +20 -0
- package/dist/pi/packages/ta-nearby/lib/i18n.d.ts +92 -0
- package/dist/pi/packages/ta-nearby/lib/i18n.js +183 -0
- package/dist/pi/packages/ta-nearby/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-nearby/lib/index.js +38 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-crypto.d.ts +31 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-crypto.js +59 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet.d.ts +35 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-meet.js +93 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-net.d.ts +59 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-net.js +253 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-protocol.d.ts +274 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-protocol.js +31 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service.d.ts +199 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-service.js +1012 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.d.ts +50 -0
- package/dist/pi/packages/ta-nearby/lib/nearby-spot.js +167 -0
- package/dist/pi/packages/ta-nearby/lib/page.d.ts +52 -0
- package/dist/pi/packages/ta-nearby/lib/page.js +588 -0
- package/dist/pi/packages/ta-nearby/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-nearby/lib/react.js +8 -0
- package/dist/pi/packages/ta-nearby/lib/server-texts.d.ts +45 -0
- package/dist/pi/packages/ta-nearby/lib/server-texts.js +148 -0
- package/dist/pi/packages/ta-nearby/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-nearby/lib/style.js +92 -0
- package/dist/pi/packages/ta-nearby/package.json +65 -0
- package/dist/pi/packages/ta-nearby/web/index.js +1055 -0
- package/dist/pi/packages/ta-notify/README.en.md +3 -1
- package/dist/pi/packages/ta-notify/README.md +3 -1
- package/dist/pi/packages/ta-notify/extension/index.mjs +64 -0
- package/dist/pi/packages/ta-notify/host/index.mjs +24 -1
- package/dist/pi/packages/ta-notify/lib/extension.d.ts +4 -1
- package/dist/pi/packages/ta-notify/lib/extension.js +20 -1
- package/dist/pi/packages/ta-notify/lib/notify-protocol.d.ts +23 -3
- package/dist/pi/packages/ta-notify/lib/notify-service.d.ts +4 -2
- package/dist/pi/packages/ta-notify/lib/notify-service.js +27 -2
- package/dist/pi/packages/ta-notify/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-notify/lib/style.js +1 -1
- package/dist/pi/packages/ta-notify/lib/watcher.js +2 -1
- package/dist/pi/packages/ta-notify/package.json +7 -2
- package/dist/pi/packages/ta-notify/web/index.js +3 -2
- package/dist/pi/packages/ta-recall/README.en.md +15 -6
- package/dist/pi/packages/ta-recall/README.md +15 -6
- package/dist/pi/packages/ta-recall/extension/index.mjs +289 -133
- package/dist/pi/packages/ta-recall/host/index.mjs +451 -116
- package/dist/pi/packages/ta-recall/lib/block-util.d.ts +11 -0
- package/dist/pi/packages/ta-recall/lib/block-util.js +43 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.d.ts +25 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.js +38 -1
- package/dist/pi/packages/ta-recall/lib/composer.d.ts +3 -2
- package/dist/pi/packages/ta-recall/lib/composer.js +9 -8
- package/dist/pi/packages/ta-recall/lib/extension-util.d.ts +21 -0
- package/dist/pi/packages/ta-recall/lib/extension-util.js +104 -0
- package/dist/pi/packages/ta-recall/lib/extension.d.ts +3 -3
- package/dist/pi/packages/ta-recall/lib/extension.js +30 -22
- package/dist/pi/packages/ta-recall/lib/i18n.d.ts +18 -10
- package/dist/pi/packages/ta-recall/lib/i18n.js +40 -24
- package/dist/pi/packages/ta-recall/lib/index.d.ts +2 -2
- package/dist/pi/packages/ta-recall/lib/index.js +5 -4
- package/dist/pi/packages/ta-recall/lib/keep-card.d.ts +10 -0
- package/dist/pi/packages/ta-recall/lib/keep-card.js +83 -0
- package/dist/pi/packages/ta-recall/lib/keep-util.d.ts +15 -0
- package/dist/pi/packages/ta-recall/lib/keep-util.js +55 -0
- package/dist/pi/packages/ta-recall/lib/recall-protocol.d.ts +92 -18
- package/dist/pi/packages/ta-recall/lib/recall-protocol.js +19 -9
- package/dist/pi/packages/ta-recall/lib/recall-service.d.ts +16 -6
- package/dist/pi/packages/ta-recall/lib/recall-service.js +101 -11
- package/dist/pi/packages/ta-recall/lib/requests-util.d.ts +6 -0
- package/dist/pi/packages/ta-recall/lib/requests-util.js +37 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.d.ts +2 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.js +5 -0
- package/dist/pi/packages/ta-recall/lib/settings.d.ts +1 -1
- package/dist/pi/packages/ta-recall/lib/settings.js +1 -1
- package/dist/pi/packages/ta-recall/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-recall/lib/style.js +2 -2
- package/dist/pi/packages/ta-recall/lib/tool-line.d.ts +2 -2
- package/dist/pi/packages/ta-recall/lib/tool-line.js +10 -5
- package/dist/pi/packages/ta-recall/lib/tool.d.ts +14 -5
- package/dist/pi/packages/ta-recall/lib/tool.js +29 -17
- package/dist/pi/packages/ta-recall/package.json +13 -5
- package/dist/pi/packages/ta-recall/web/index.js +393 -153
- package/dist/pi/packages/ta-rooms/README.en.md +6 -3
- package/dist/pi/packages/ta-rooms/README.md +6 -3
- package/dist/pi/packages/ta-rooms/extension/index.mjs +171 -7
- package/dist/pi/packages/ta-rooms/host/index.mjs +1002 -234
- package/dist/pi/packages/ta-rooms/lib/dialogs.js +5 -0
- package/dist/pi/packages/ta-rooms/lib/double-agents.d.ts +26 -0
- package/dist/pi/packages/ta-rooms/lib/double-agents.js +84 -0
- package/dist/pi/packages/ta-rooms/lib/double-grants.d.ts +22 -0
- package/dist/pi/packages/ta-rooms/lib/double-grants.js +140 -0
- package/dist/pi/packages/ta-rooms/lib/double-host.d.ts +43 -40
- package/dist/pi/packages/ta-rooms/lib/double-host.js +142 -311
- package/dist/pi/packages/ta-rooms/lib/double-i18n.d.ts +20 -0
- package/dist/pi/packages/ta-rooms/lib/double-i18n.js +40 -0
- package/dist/pi/packages/ta-rooms/lib/double-protocol.d.ts +96 -3
- package/dist/pi/packages/ta-rooms/lib/double-protocol.js +58 -3
- package/dist/pi/packages/ta-rooms/lib/double-tasks.d.ts +82 -0
- package/dist/pi/packages/ta-rooms/lib/double-tasks.js +527 -0
- package/dist/pi/packages/ta-rooms/lib/double-user.d.ts +19 -0
- package/dist/pi/packages/ta-rooms/lib/double-user.js +124 -0
- package/dist/pi/packages/ta-rooms/lib/double-util.d.ts +34 -2
- package/dist/pi/packages/ta-rooms/lib/double-util.js +60 -2
- package/dist/pi/packages/ta-rooms/lib/doubles-store.d.ts +4 -1
- package/dist/pi/packages/ta-rooms/lib/doubles-store.js +8 -2
- package/dist/pi/packages/ta-rooms/lib/doubles-view.js +7 -2
- package/dist/pi/packages/ta-rooms/lib/extension.d.ts +9 -0
- package/dist/pi/packages/ta-rooms/lib/extension.js +33 -6
- package/dist/pi/packages/ta-rooms/lib/friend-notices.d.ts +12 -0
- package/dist/pi/packages/ta-rooms/lib/friend-notices.js +47 -0
- package/dist/pi/packages/ta-rooms/lib/friends-view.d.ts +20 -0
- package/dist/pi/packages/ta-rooms/lib/friends-view.js +224 -0
- package/dist/pi/packages/ta-rooms/lib/host.d.ts +2 -1
- package/dist/pi/packages/ta-rooms/lib/host.js +9 -2
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +23 -2
- package/dist/pi/packages/ta-rooms/lib/i18n.js +60 -18
- package/dist/pi/packages/ta-rooms/lib/index.js +18 -1
- package/dist/pi/packages/ta-rooms/lib/members-view.js +12 -1
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +42 -4
- package/dist/pi/packages/ta-rooms/lib/page.js +108 -24
- package/dist/pi/packages/ta-rooms/lib/room-view.js +7 -3
- package/dist/pi/packages/ta-rooms/lib/rooms-page.js +6 -17
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-rooms/lib/style.js +31 -6
- package/dist/pi/packages/ta-rooms/lib/tasks-view.d.ts +41 -0
- package/dist/pi/packages/ta-rooms/lib/tasks-view.js +228 -0
- package/dist/pi/packages/ta-rooms/package.json +11 -2
- package/dist/pi/packages/ta-rooms/web/index.js +1633 -751
- package/dist/pi/packages/ta-share/README.en.md +1 -1
- package/dist/pi/packages/ta-share/README.md +1 -1
- package/dist/pi/packages/ta-share/extension/index.mjs +51 -0
- package/dist/pi/packages/ta-share/lib/i18n.js +6 -6
- package/dist/pi/packages/ta-share/lib/share-dialog.js +1 -1
- package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-share/lib/style.js +4 -6
- package/dist/pi/packages/ta-share/package.json +10 -2
- package/dist/pi/packages/ta-share/web/index.js +12 -14
- package/dist/pi/packages/ta-sync/README.en.md +55 -0
- package/dist/pi/packages/ta-sync/README.md +55 -0
- package/dist/pi/packages/ta-sync/host/index.mjs +3763 -0
- package/dist/pi/packages/ta-sync/lib/host.d.ts +10 -0
- package/dist/pi/packages/ta-sync/lib/host.js +94 -0
- package/dist/pi/packages/ta-sync/lib/i18n.d.ts +98 -0
- package/dist/pi/packages/ta-sync/lib/i18n.js +202 -0
- package/dist/pi/packages/ta-sync/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-sync/lib/index.js +115 -0
- package/dist/pi/packages/ta-sync/lib/migrate-archive.d.ts +88 -0
- package/dist/pi/packages/ta-sync/lib/migrate-archive.js +439 -0
- package/dist/pi/packages/ta-sync/lib/migrate-frames.d.ts +77 -0
- package/dist/pi/packages/ta-sync/lib/migrate-frames.js +210 -0
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.d.ts +99 -0
- package/dist/pi/packages/ta-sync/lib/migrate-i18n.js +210 -0
- package/dist/pi/packages/ta-sync/lib/migrate-net.d.ts +51 -0
- package/dist/pi/packages/ta-sync/lib/migrate-net.js +170 -0
- package/dist/pi/packages/ta-sync/lib/migrate-protocol.d.ts +126 -0
- package/dist/pi/packages/ta-sync/lib/migrate-protocol.js +43 -0
- package/dist/pi/packages/ta-sync/lib/migrate-service.d.ts +86 -0
- package/dist/pi/packages/ta-sync/lib/migrate-service.js +521 -0
- package/dist/pi/packages/ta-sync/lib/move-panel.d.ts +16 -0
- package/dist/pi/packages/ta-sync/lib/move-panel.js +320 -0
- package/dist/pi/packages/ta-sync/lib/move-store.d.ts +15 -0
- package/dist/pi/packages/ta-sync/lib/move-store.js +42 -0
- package/dist/pi/packages/ta-sync/lib/panel.d.ts +28 -0
- package/dist/pi/packages/ta-sync/lib/panel.js +305 -0
- package/dist/pi/packages/ta-sync/lib/pictures.d.ts +22 -0
- package/dist/pi/packages/ta-sync/lib/pictures.js +92 -0
- package/dist/pi/packages/ta-sync/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-sync/lib/react.js +16 -0
- package/dist/pi/packages/ta-sync/lib/server-texts.d.ts +29 -0
- package/dist/pi/packages/ta-sync/lib/server-texts.js +111 -0
- package/dist/pi/packages/ta-sync/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-sync/lib/style.js +108 -0
- package/dist/pi/packages/ta-sync/lib/sync-codec.d.ts +16 -0
- package/dist/pi/packages/ta-sync/lib/sync-codec.js +61 -0
- package/dist/pi/packages/ta-sync/lib/sync-engine.d.ts +57 -0
- package/dist/pi/packages/ta-sync/lib/sync-engine.js +203 -0
- package/dist/pi/packages/ta-sync/lib/sync-folder.d.ts +156 -0
- package/dist/pi/packages/ta-sync/lib/sync-folder.js +385 -0
- package/dist/pi/packages/ta-sync/lib/sync-identity.d.ts +60 -0
- package/dist/pi/packages/ta-sync/lib/sync-identity.js +201 -0
- package/dist/pi/packages/ta-sync/lib/sync-items.d.ts +104 -0
- package/dist/pi/packages/ta-sync/lib/sync-items.js +426 -0
- package/dist/pi/packages/ta-sync/lib/sync-merge.d.ts +42 -0
- package/dist/pi/packages/ta-sync/lib/sync-merge.js +109 -0
- package/dist/pi/packages/ta-sync/lib/sync-protocol.d.ts +134 -0
- package/dist/pi/packages/ta-sync/lib/sync-protocol.js +72 -0
- package/dist/pi/packages/ta-sync/lib/sync-service.d.ts +128 -0
- package/dist/pi/packages/ta-sync/lib/sync-service.js +679 -0
- package/dist/pi/packages/ta-sync/lib/sync-store.d.ts +15 -0
- package/dist/pi/packages/ta-sync/lib/sync-store.js +41 -0
- package/dist/pi/packages/ta-sync/package.json +57 -0
- package/dist/pi/packages/ta-sync/web/index.js +2018 -0
- package/dist/pi/packages/ta-sync-cloud/README.en.md +31 -0
- package/dist/pi/packages/ta-sync-cloud/README.md +31 -0
- package/dist/pi/packages/ta-sync-cloud/host/index.mjs +810 -0
- package/dist/pi/packages/ta-sync-cloud/lib/git-store.d.ts +90 -0
- package/dist/pi/packages/ta-sync-cloud/lib/git-store.js +393 -0
- package/dist/pi/packages/ta-sync-cloud/lib/host.d.ts +13 -0
- package/dist/pi/packages/ta-sync-cloud/lib/host.js +112 -0
- package/dist/pi/packages/ta-sync-cloud/lib/s3-store.d.ts +72 -0
- package/dist/pi/packages/ta-sync-cloud/lib/s3-store.js +206 -0
- package/dist/pi/packages/ta-sync-cloud/lib/store-util.d.ts +17 -0
- package/dist/pi/packages/ta-sync-cloud/lib/store-util.js +69 -0
- package/dist/pi/packages/ta-sync-cloud/lib/webdav-store.d.ts +40 -0
- package/dist/pi/packages/ta-sync-cloud/lib/webdav-store.js +144 -0
- package/dist/pi/packages/ta-sync-cloud/package.json +63 -0
- package/dist/pi/packages/ta-team/README.en.md +28 -0
- package/dist/pi/packages/ta-team/README.md +28 -0
- package/dist/pi/packages/ta-team/extension/index.mjs +264 -0
- package/dist/pi/packages/ta-team/host/index.mjs +2100 -0
- package/dist/pi/packages/ta-team/lib/dialogs.d.ts +13 -0
- package/dist/pi/packages/ta-team/lib/dialogs.js +335 -0
- package/dist/pi/packages/ta-team/lib/extension.d.ts +21 -0
- package/dist/pi/packages/ta-team/lib/extension.js +123 -0
- package/dist/pi/packages/ta-team/lib/host.d.ts +13 -0
- package/dist/pi/packages/ta-team/lib/host.js +45 -0
- package/dist/pi/packages/ta-team/lib/i18n.d.ts +200 -0
- package/dist/pi/packages/ta-team/lib/i18n.js +401 -0
- package/dist/pi/packages/ta-team/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/index.js +67 -0
- package/dist/pi/packages/ta-team/lib/join.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/join.js +48 -0
- package/dist/pi/packages/ta-team/lib/member-dialog.d.ts +2 -0
- package/dist/pi/packages/ta-team/lib/member-dialog.js +121 -0
- package/dist/pi/packages/ta-team/lib/members-tab.d.ts +11 -0
- package/dist/pi/packages/ta-team/lib/members-tab.js +133 -0
- package/dist/pi/packages/ta-team/lib/page.d.ts +42 -0
- package/dist/pi/packages/ta-team/lib/page.js +142 -0
- package/dist/pi/packages/ta-team/lib/parts.d.ts +39 -0
- package/dist/pi/packages/ta-team/lib/parts.js +47 -0
- package/dist/pi/packages/ta-team/lib/policy.d.ts +37 -0
- package/dist/pi/packages/ta-team/lib/policy.js +215 -0
- package/dist/pi/packages/ta-team/lib/protocol.d.ts +285 -0
- package/dist/pi/packages/ta-team/lib/protocol.js +119 -0
- package/dist/pi/packages/ta-team/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/react.js +8 -0
- package/dist/pi/packages/ta-team/lib/record-tab.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/record-tab.js +90 -0
- package/dist/pi/packages/ta-team/lib/remote.d.ts +31 -0
- package/dist/pi/packages/ta-team/lib/remote.js +128 -0
- package/dist/pi/packages/ta-team/lib/roles-tab.d.ts +9 -0
- package/dist/pi/packages/ta-team/lib/roles-tab.js +76 -0
- package/dist/pi/packages/ta-team/lib/seal.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/seal.js +75 -0
- package/dist/pi/packages/ta-team/lib/shared-home.d.ts +23 -0
- package/dist/pi/packages/ta-team/lib/shared-home.js +123 -0
- package/dist/pi/packages/ta-team/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-team/lib/style.js +99 -0
- package/dist/pi/packages/ta-team/lib/team-admin.d.ts +31 -0
- package/dist/pi/packages/ta-team/lib/team-admin.js +140 -0
- package/dist/pi/packages/ta-team/lib/team-audit.d.ts +35 -0
- package/dist/pi/packages/ta-team/lib/team-audit.js +152 -0
- package/dist/pi/packages/ta-team/lib/team-core.d.ts +58 -0
- package/dist/pi/packages/ta-team/lib/team-core.js +115 -0
- package/dist/pi/packages/ta-team/lib/team-error.d.ts +4 -0
- package/dist/pi/packages/ta-team/lib/team-error.js +8 -0
- package/dist/pi/packages/ta-team/lib/team-expiry.d.ts +15 -0
- package/dist/pi/packages/ta-team/lib/team-expiry.js +67 -0
- package/dist/pi/packages/ta-team/lib/team-files.d.ts +21 -0
- package/dist/pi/packages/ta-team/lib/team-files.js +119 -0
- package/dist/pi/packages/ta-team/lib/team-inbox.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/team-inbox.js +32 -0
- package/dist/pi/packages/ta-team/lib/team-invites.d.ts +46 -0
- package/dist/pi/packages/ta-team/lib/team-invites.js +204 -0
- package/dist/pi/packages/ta-team/lib/team-page.d.ts +6 -0
- package/dist/pi/packages/ta-team/lib/team-page.js +41 -0
- package/dist/pi/packages/ta-team/lib/team-paths.d.ts +15 -0
- package/dist/pi/packages/ta-team/lib/team-paths.js +70 -0
- package/dist/pi/packages/ta-team/lib/team-people.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/team-people.js +106 -0
- package/dist/pi/packages/ta-team/lib/team-requests.d.ts +24 -0
- package/dist/pi/packages/ta-team/lib/team-requests.js +126 -0
- package/dist/pi/packages/ta-team/lib/team-runs.d.ts +38 -0
- package/dist/pi/packages/ta-team/lib/team-runs.js +136 -0
- package/dist/pi/packages/ta-team/lib/team-service.d.ts +32 -0
- package/dist/pi/packages/ta-team/lib/team-service.js +58 -0
- package/dist/pi/packages/ta-team/lib/team-shares.d.ts +52 -0
- package/dist/pi/packages/ta-team/lib/team-shares.js +145 -0
- package/dist/pi/packages/ta-team/lib/team-waits.d.ts +8 -0
- package/dist/pi/packages/ta-team/lib/team-waits.js +42 -0
- package/dist/pi/packages/ta-team/lib/team-watch.d.ts +28 -0
- package/dist/pi/packages/ta-team/lib/team-watch.js +136 -0
- package/dist/pi/packages/ta-team/package.json +68 -0
- package/dist/pi/packages/ta-team/web/index.js +2741 -0
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +157 -0
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-BnqtcbpZ.js → abnfDiagram-S7VZAUFO-DJMZKA5d.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-BzPq1Ioe.js → architecture-WOLXFQ4H-DwZ8A2Bp.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-BsquO3a7.js → architectureDiagram-YGSQEFNW-DPezb7-w.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-BQNYOEP4.js → blockDiagram-APKKGZFW-SrFYBlSp.js} +1 -1
- package/dist/public/assets/{browser-DS711n7Y.js → browser-CljOqDFz.js} +1 -1
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-D6e79Ycq.js → c4Diagram-KJ2TOQU5-COCMkiJ6.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-B-sgaPoU.js → chunk-6MUBBAK2-CWRxZCiu.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-D8pJKIg2.js → chunk-AXFCVDMN-Dgn3RHlx.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-86TL-vCz.js → chunk-BG4553SI-BDnAChfb.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-CfUVuGjc.js → chunk-DQASFODM-DSgprMfc.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-Drm0FEYk.js → chunk-HFQBQIA3-ChtjyKjP.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BVFRADlC.js → chunk-KQLB2F66-B2o0ufJC.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-DfyALEmP.js → chunk-KS47KZWR-C4qJvDaX.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-DtJVzk2c.js → chunk-LEVMRMFU-2jTGUstS.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-DTy27PHQ.js → chunk-M57EVK23-CKAWW7fj.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-nSgn7jZg.js → chunk-OY52VR5R-B5TUKZAt.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-CkSxO_X6.js → chunk-QB3YPZ4I-CyQFTqwG.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-Ck6iAjAL.js → chunk-R3KSYZAL-C6git_yh.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-DQPHdSTh.js → chunk-STOXU5M4-AwEqcNnS.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-Bc2AbV2Y.js → chunk-TU62E6Q5-GKcRDmvw.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-Cgpm0IXm.js → chunk-X4PVCEUW-CMG5EfZ9.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-CGE4eLpg.js → chunk-XXDRQBXY-BHd-dKtZ.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-4eQuDPEo.js → classDiagram-v2-L25IHNXF-HaRsBCG9.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-tDLCWq07.js → cose-bilkent-JH36ORCC-BPBTCfj3.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-DyqqRII3.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-ByqcZ8x9.js → cynefinDiagram-L36ESFBY-dAmWDtva.js} +1 -1
- package/dist/public/assets/{d3-selection-Bgn1374-.js → d3-selection-BhemR5ul.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-mCgr71mV.js → dagre-SPEB5RXH-D93g6hNI.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-DpYSwpQ0.js → diagram-3B7GL73J-FJBKgG3X.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-DMozUQzi.js → diagram-DNEMPZML-BP22T976.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-Bk5Uf8PD.js → diagram-L3MUGCDN-DcrCJXRt.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-DFt5cPVK.js → diagram-LA4NIPWU-DUgd3PHQ.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BkZZcKqK.js → diagram-MHCOC4E2-ejTInqzQ.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-HEY6kyyN.js → diagram-XPFHEONP-BLjkgho1.js} +1 -1
- package/dist/public/assets/{dist-Bj2CrKn7.js → dist-C9xqTt0E.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-D4JvYyVb.js → ebnfDiagram-UZSYDL2S-CB1QQ4_T.js} +1 -1
- package/dist/public/assets/{editor.api-BpJFzYbl.js → editor.api-lz6I1oVk.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CT6qLJkF.js → elk-XV6XMXQE-CLBx1s2b.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-BGng1goR.js → erDiagram-EYBAPDEH-Dsj6RYi5.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-Tt8O-Q1Z.js → eventmodeling-K75KTNOO-smOORsSG.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-DFmQPJ7B.js +1 -0
- package/dist/public/assets/{freemarker2-Dd5ksoRn.js → freemarker2-DrLPw7Mc.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-Jl8VO_g2.js → ganttDiagram-23REXITY-BV9WK0rK.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-ybrJCK6u.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW-Be4qXALb.js → gitGraphDiagram-STJD7YCW-CsSpSQ0T.js} +1 -1
- package/dist/public/assets/{handlebars-4xabgUi4.js → handlebars-CLx5-csF.js} +1 -1
- package/dist/public/assets/{html-Dk3kt2w_.js → html-C9LmGm46.js} +1 -1
- package/dist/public/assets/{index-Bx0c7eoh.js → index-CLWW0mVu.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-n41_wZE4.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-Coc0tdwb.js → infoDiagram-KBXO4MBG-wm5AnXDz.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-CE_1VQCg.js → ishikawaDiagram-M35NCXHK-BLUBDeS3.js} +1 -1
- package/dist/public/assets/{javascript-DKLGqy6v.js → javascript-C4S1eQb7.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-CrolRZ_7.js → journeyDiagram-OPLOXDXO-DXc7-I_g.js} +1 -1
- package/dist/public/assets/{jsonMode-Chcs19_y.js → jsonMode-lLJKR2M6.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-CjJj47De.js → kanban-definition-BZKZHSQY-D5Ra4L_5.js} +1 -1
- package/dist/public/assets/{liquid-jff3p-Ji.js → liquid-DRlm-XZd.js} +1 -1
- package/dist/public/assets/{mdx-DW4uRDfJ.js → mdx-CzIqeqPy.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-XhQj6FvH.js → mermaid-parser.core-BIPB1BgS.js} +3 -3
- package/dist/public/assets/{mermaid.core-OD4Atimg.js → mermaid.core-DxBlQ6oF.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-DpGelVY7.js → mindmap-definition-I2QAS2VK-BdupvuYr.js} +1 -1
- package/dist/public/assets/module-BPxWyxwR.js +2362 -0
- package/dist/public/assets/module-C_MSCGQC.js +1 -0
- package/dist/public/assets/{monaco-BTVZP-tU.js → monaco-ChpJIYsY.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-BjrqMgis.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CqcBmPfB.js → pegDiagram-FD4XPPHP-C_GF7Fng.js} +1 -1
- package/dist/public/assets/pie-XZMESJXO-CJSA88kr.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-CRir3beB.js → pieDiagram-J4AKIIQI-WlpNP-IM.js} +1 -1
- package/dist/public/assets/{python-BwW_0207.js → python-BJgFCfc8.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2-DIY6gdcf.js → quadrantDiagram-XTYBLID2-CkCL5rJY.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-4nLUXAkG.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-BD2LqZSr.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-XWNOzunl.js → railroad-abnf-LNEFI6M7-DZZKUytl.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-CI0-j1Jz.js → railroad-ebnf-DWYD2UWJ-CS7KsJdb.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-BVB_IaIG.js → railroad-peg-JR7BVNR7-CiukTZVd.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-CudwT6q2.js → railroadDiagram-MRQ6NCDL-BS0R_H3-.js} +1 -1
- package/dist/public/assets/{razor-DrjCyQqB.js → razor-jcBIjr45.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CvRMeRqj.js → requirementDiagram-Y7LWUY3S-C0_T9jgl.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-adxYCJKr.js → sankeyDiagram-WGJFYUXA-DF15sUfS.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-lCRsoLUp.js → sequenceDiagram-5NDRBG5M-7AkTLleX.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-DNst1BLg.js → stateDiagram-v2-FJ4FJNEA-CU3i-U9q.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-S_omrdvA.js → swimlanes-UMQ2AFYF-CR-ieLeo.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-COK2pFDF.js +8 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-_pMGrTE-.js → timeline-definition-SEUHKTQE-DeM0Uekm.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-BL13z_2J.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-Lx2qjQpO.js +1 -0
- package/dist/public/assets/{typescript-0-z_OYCU.js → typescript-B7zp7QPf.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-B2oJKi5Q.js → usecaseDiagram-AFA6YXN4-D6rDIgdU.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-inPs2Kkr.js → vennDiagram-NNMJR3RB-CncVDcMl.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-B4j5rilS.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-DNhNHM7b.js → wardleyDiagram-S7YFUSEH-DKPAMfTE.js} +1 -1
- package/dist/public/assets/{xml-BXPxQzKF.js → xml-BJIgLD52.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-DJc93dNT.js → xychartDiagram-GGNKY7IX-DmmXGebm.js} +1 -1
- package/dist/public/assets/{yaml-CGmD9Rya.js → yaml-Dxb2gmP5.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/serve/index.mjs +7727 -3847
- package/package.json +37 -31
- package/dist/pi/packages/ta-cron/lib/composer.d.ts +0 -11
- package/dist/pi/packages/ta-cron/lib/composer.js +0 -58
- package/dist/pi/packages/ta-extensions/lib/composer.d.ts +0 -17
- package/dist/pi/packages/ta-extensions/lib/composer.js +0 -84
- package/dist/pi/packages/ta-recall/lib/skill-card.d.ts +0 -9
- package/dist/pi/packages/ta-recall/lib/skill-card.js +0 -51
- package/dist/pi/packages/ta-recall/lib/skill-util.d.ts +0 -19
- package/dist/pi/packages/ta-recall/lib/skill-util.js +0 -110
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dd40W2Jh.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-uFzenfA3.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-D28I_jUc.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-5vIGEIq7.js +0 -1
- package/dist/public/assets/module-CrD0OHQp.js +0 -1
- package/dist/public/assets/module-DEBMgdtf.js +0 -2273
- package/dist/public/assets/packet-JDAUHWVQ-CBxQ5Mzy.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-DT5V3581.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-BAOovYEa.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-RZ2Rnwzh.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-By5lnz4u.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-Cyb9N8KY.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-BkMo57pG.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-CSt-uQ-Y.js +0 -1
|
@@ -0,0 +1,679 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SyncService = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_os_1 = require("node:os");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
const relays_file_1 = require("@celljs/ta-relay/lib/node/relays-file");
|
|
8
|
+
const server_texts_1 = require("./server-texts");
|
|
9
|
+
const sync_engine_1 = require("./sync-engine");
|
|
10
|
+
const sync_folder_1 = require("./sync-folder");
|
|
11
|
+
const sync_identity_1 = require("./sync-identity");
|
|
12
|
+
const sync_merge_1 = require("./sync-merge");
|
|
13
|
+
const sync_protocol_1 = require("./sync-protocol");
|
|
14
|
+
/**
|
|
15
|
+
* The sync of this computer (docs/design/ta-sync.md): the room of the user's devices, made, joined or left on the
|
|
16
|
+
* user's word from the page; a round soon after this computer or another changed something, and now and then anyway.
|
|
17
|
+
* One round at a time; what asks for one meanwhile gets one after.
|
|
18
|
+
*/
|
|
19
|
+
class SyncService {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
var _a;
|
|
22
|
+
this.options = options;
|
|
23
|
+
this.again = false;
|
|
24
|
+
this.stopped = false;
|
|
25
|
+
this.signature = '';
|
|
26
|
+
this.lastFull = 0;
|
|
27
|
+
this.shown = '';
|
|
28
|
+
this.stops = [];
|
|
29
|
+
this.spaceSignature = '';
|
|
30
|
+
this.resourcesNow = { ...sync_protocol_1.DEFAULT_RESOURCES };
|
|
31
|
+
this.device = (_a = options.device) !== null && _a !== void 0 ? _a : SyncService.deviceName();
|
|
32
|
+
this.baseFile = (0, node_path_1.join)(options.agentDir, 'sync', 'base.json');
|
|
33
|
+
this.folderFile = (0, node_path_1.join)(options.agentDir, 'sync', 'folder.json');
|
|
34
|
+
}
|
|
35
|
+
static deviceName() {
|
|
36
|
+
return (0, node_os_1.hostname)().replace(/\.local$/, '') || (0, node_os_1.platform)();
|
|
37
|
+
}
|
|
38
|
+
start() {
|
|
39
|
+
var _a;
|
|
40
|
+
this.stops.push(this.options.rooms.onEvent(event => this.heard(event)));
|
|
41
|
+
this.look = setInterval(() => void this.lookAround(), (_a = this.options.lookMs) !== null && _a !== void 0 ? _a : 30000);
|
|
42
|
+
void this.options.storage.get(sync_protocol_1.SyncKeys.REPORT).then(report => {
|
|
43
|
+
var _a;
|
|
44
|
+
(_a = this.report) !== null && _a !== void 0 ? _a : (this.report = report);
|
|
45
|
+
});
|
|
46
|
+
this.schedule(2000);
|
|
47
|
+
}
|
|
48
|
+
dispose() {
|
|
49
|
+
var _a;
|
|
50
|
+
this.stopped = true;
|
|
51
|
+
clearTimeout(this.timer);
|
|
52
|
+
clearInterval(this.look);
|
|
53
|
+
(_a = this.space) === null || _a === void 0 ? void 0 : _a.stop();
|
|
54
|
+
for (const stop of this.stops) {
|
|
55
|
+
stop();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Called by a key of package data that changed, by a page or by this service. */
|
|
59
|
+
dataChanged(name, key) {
|
|
60
|
+
if (name === sync_protocol_1.SYNC_PACKAGE ? key === sync_protocol_1.SyncKeys.RESOURCES : this.options.place.tracks(name, key)) {
|
|
61
|
+
this.schedule();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async status() {
|
|
65
|
+
var _a;
|
|
66
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
67
|
+
const resources = await this.resources();
|
|
68
|
+
const replaced = { dir: this.options.place.replacedDir, count: await this.options.place.replacedCount() };
|
|
69
|
+
const common = { resources, syncing: !!this.running, last: this.report, replaced };
|
|
70
|
+
const folder = await this.folderRecord();
|
|
71
|
+
if (folder === null || folder === void 0 ? void 0 : folder.service) {
|
|
72
|
+
const opened = await this.openSpace(folder);
|
|
73
|
+
const problem = (_b = opened.problem) !== null && _b !== void 0 ? _b : (await this.problemOf(opened.space, folder));
|
|
74
|
+
const service = ((_c = (await ((_a = this.options.relays) === null || _a === void 0 ? void 0 : _a.list().catch(() => undefined)))) !== null && _c !== void 0 ? _c : []).find(each => each.id === folder.service);
|
|
75
|
+
return {
|
|
76
|
+
state: 'on',
|
|
77
|
+
where: 'store',
|
|
78
|
+
via: (_f = (_e = (_d = service === null || service === void 0 ? void 0 : service.name) !== null && _d !== void 0 ? _d : service === null || service === void 0 ? void 0 : service.where) !== null && _e !== void 0 ? _e : folder.type) !== null && _f !== void 0 ? _f : '',
|
|
79
|
+
store: { type: (_h = (_g = folder.type) !== null && _g !== void 0 ? _g : service === null || service === void 0 ? void 0 : service.type) !== null && _h !== void 0 ? _h : '', where: (_j = service === null || service === void 0 ? void 0 : service.where) !== null && _j !== void 0 ? _j : '', ...(problem ? { problem } : {}) },
|
|
80
|
+
owner: false,
|
|
81
|
+
connected: !problem,
|
|
82
|
+
devices: problem || !opened.space ? [] : await this.folderDevices(opened.space),
|
|
83
|
+
asks: [],
|
|
84
|
+
...common,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (folder) {
|
|
88
|
+
const opened = await this.openSpace(folder);
|
|
89
|
+
const space = opened.space;
|
|
90
|
+
const problem = (_k = opened.problem) !== null && _k !== void 0 ? _k : (await this.problemOf(space, folder));
|
|
91
|
+
const target = await this.target();
|
|
92
|
+
const named = target.type === 'folder' && target.path && relays_file_1.RelayServiceUtil.expand(target.path) === relays_file_1.RelayServiceUtil.expand(folder.path)
|
|
93
|
+
? target.name
|
|
94
|
+
: undefined;
|
|
95
|
+
return {
|
|
96
|
+
state: 'on',
|
|
97
|
+
where: 'folder',
|
|
98
|
+
via: named !== null && named !== void 0 ? named : SyncService.lastPart(folder.path),
|
|
99
|
+
folder: { path: relays_file_1.RelayServiceUtil.expand(folder.path), ...(problem ? { problem } : {}) },
|
|
100
|
+
owner: false,
|
|
101
|
+
connected: !problem,
|
|
102
|
+
devices: problem ? [] : await this.folderDevices(space),
|
|
103
|
+
asks: [],
|
|
104
|
+
...common,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
const room = await this.room();
|
|
108
|
+
if (!room) {
|
|
109
|
+
const target = await this.target();
|
|
110
|
+
return {
|
|
111
|
+
state: 'off',
|
|
112
|
+
where: target.type === 'ta-relay' ? 'relay' : target.type,
|
|
113
|
+
via: (_l = target.name) !== null && _l !== void 0 ? _l : (target.type === 'folder' ? SyncService.lastPart((_m = target.path) !== null && _m !== void 0 ? _m : '') : target.type === 'store' ? target.where : target.host),
|
|
114
|
+
...(target.type === 'folder' ? { folder: { path: relays_file_1.RelayServiceUtil.expand((_o = target.path) !== null && _o !== void 0 ? _o : '') } } : {}),
|
|
115
|
+
...(target.type === 'store' ? { store: { type: (_p = target.store) !== null && _p !== void 0 ? _p : '', where: (_q = target.where) !== null && _q !== void 0 ? _q : '' } } : {}),
|
|
116
|
+
owner: false,
|
|
117
|
+
connected: false,
|
|
118
|
+
devices: [],
|
|
119
|
+
asks: [],
|
|
120
|
+
...common,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const state = room.status === 'member' ? 'on' : room.status;
|
|
124
|
+
return {
|
|
125
|
+
state,
|
|
126
|
+
where: 'relay',
|
|
127
|
+
...(room.relay ? { via: await this.relayName(room.relay) } : {}),
|
|
128
|
+
owner: room.owner,
|
|
129
|
+
ownerName: room.ownerName,
|
|
130
|
+
connected: room.connected,
|
|
131
|
+
devices: state === 'on' ? await this.devices(room) : [],
|
|
132
|
+
asks: room.owner
|
|
133
|
+
? (await this.options.rooms.listRequests().catch(() => []))
|
|
134
|
+
.filter(request => request.room === room.id && !request.guest)
|
|
135
|
+
.map(({ ask, name, at }) => ({ ask, name, at }))
|
|
136
|
+
: [],
|
|
137
|
+
...common,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/** Turns sync on: where relays.json says for `sync`, a folder or a room of a relay (this computer its owner). */
|
|
141
|
+
async enable() {
|
|
142
|
+
var _a, _b;
|
|
143
|
+
const target = await this.target();
|
|
144
|
+
if ((target.type === 'folder' && target.path) || (target.type === 'store' && target.id)) {
|
|
145
|
+
// From a room to a folder or a store: the room is left, this computer syncs in one place.
|
|
146
|
+
const before = await this.room();
|
|
147
|
+
if (before) {
|
|
148
|
+
await this.options.rooms.leave(before.id);
|
|
149
|
+
}
|
|
150
|
+
const current = await this.folderRecord();
|
|
151
|
+
const same = !!current &&
|
|
152
|
+
(target.type === 'store'
|
|
153
|
+
? current.service === target.id
|
|
154
|
+
: !current.service && relays_file_1.RelayServiceUtil.expand(current.path) === relays_file_1.RelayServiceUtil.expand((_a = target.path) !== null && _a !== void 0 ? _a : ''));
|
|
155
|
+
if (!same) {
|
|
156
|
+
const record = {
|
|
157
|
+
id: sync_folder_1.FolderSyncUtil.randomId(),
|
|
158
|
+
key: sync_folder_1.FolderSyncUtil.randomKey(),
|
|
159
|
+
path: target.type === 'folder' ? ((_b = target.path) !== null && _b !== void 0 ? _b : '') : '',
|
|
160
|
+
...(target.type === 'store' ? { service: target.id, type: target.store } : {}),
|
|
161
|
+
device: sync_folder_1.FolderSyncUtil.randomId(),
|
|
162
|
+
at: Date.now(),
|
|
163
|
+
};
|
|
164
|
+
const problem = target.type === 'folder' ? relays_file_1.RelayServiceUtil.checkFolder(record.path) : undefined;
|
|
165
|
+
if (problem) {
|
|
166
|
+
throw new Error(problem);
|
|
167
|
+
}
|
|
168
|
+
const opened = await this.openSpace(record);
|
|
169
|
+
if (!opened.space) {
|
|
170
|
+
throw new Error(opened.problem);
|
|
171
|
+
}
|
|
172
|
+
await opened.space.create();
|
|
173
|
+
await this.saveFolder(record);
|
|
174
|
+
}
|
|
175
|
+
await this.publish();
|
|
176
|
+
this.schedule(0);
|
|
177
|
+
return this.status();
|
|
178
|
+
}
|
|
179
|
+
const room = await this.room();
|
|
180
|
+
if ((room === null || room === void 0 ? void 0 : room.status) !== 'member') {
|
|
181
|
+
if (room) {
|
|
182
|
+
await this.options.rooms.leave(room.id);
|
|
183
|
+
}
|
|
184
|
+
await this.options.rooms.createRoom({ kind: sync_protocol_1.SYNC_KIND, title: server_texts_1.SyncServerTexts.title(), view: sync_protocol_1.SYNC_VIEW, unlisted: true, use: 'sync' });
|
|
185
|
+
}
|
|
186
|
+
this.schedule(0);
|
|
187
|
+
return this.status();
|
|
188
|
+
}
|
|
189
|
+
/** The link another computer joins by (the owner only). */
|
|
190
|
+
async invite(renew = false) {
|
|
191
|
+
var _a;
|
|
192
|
+
var _b;
|
|
193
|
+
const folder = await this.folderRecord();
|
|
194
|
+
if (folder === null || folder === void 0 ? void 0 : folder.service) {
|
|
195
|
+
// The key and the sign-in of the store are for good: shown only to the user's own computers.
|
|
196
|
+
const config = await ((_a = this.options.relays) === null || _a === void 0 ? void 0 : _a.storeConfig(folder.service));
|
|
197
|
+
if (!config) {
|
|
198
|
+
throw new Error(server_texts_1.SyncServerTexts.storeUnavailable((_b = folder.type) !== null && _b !== void 0 ? _b : ''));
|
|
199
|
+
}
|
|
200
|
+
return { link: sync_folder_1.FolderSyncUtil.storeLink(folder, config, this.device), expiresAt: 0 };
|
|
201
|
+
}
|
|
202
|
+
if (folder) {
|
|
203
|
+
// The key of the folder is for good: whoever has it syncs, so it is shown only to the user's own computers.
|
|
204
|
+
return { link: sync_folder_1.FolderSyncUtil.link(folder, this.device), expiresAt: 0 };
|
|
205
|
+
}
|
|
206
|
+
const room = await this.room();
|
|
207
|
+
if ((room === null || room === void 0 ? void 0 : room.status) !== 'member') {
|
|
208
|
+
throw new Error(server_texts_1.SyncServerTexts.notOn());
|
|
209
|
+
}
|
|
210
|
+
if (!room.owner) {
|
|
211
|
+
throw new Error(server_texts_1.SyncServerTexts.notOwner(room.ownerName));
|
|
212
|
+
}
|
|
213
|
+
return this.options.rooms.invite(room.id, { renew });
|
|
214
|
+
}
|
|
215
|
+
/** Asks to join the room of a link: synced once the owner let it in. */
|
|
216
|
+
async join(link) {
|
|
217
|
+
const room = await this.room();
|
|
218
|
+
if ((room === null || room === void 0 ? void 0 : room.status) === 'member' || (await this.folderRecord())) {
|
|
219
|
+
throw new Error(server_texts_1.SyncServerTexts.alreadyOn());
|
|
220
|
+
}
|
|
221
|
+
if (sync_folder_1.FolderSyncUtil.is(link)) {
|
|
222
|
+
return this.joinFolder(link);
|
|
223
|
+
}
|
|
224
|
+
if (sync_folder_1.FolderSyncUtil.isStore(link)) {
|
|
225
|
+
return this.joinStore(link);
|
|
226
|
+
}
|
|
227
|
+
if (room) {
|
|
228
|
+
await this.options.rooms.leave(room.id);
|
|
229
|
+
}
|
|
230
|
+
// The kind of a room is known once let in: till then, the room asked is noted.
|
|
231
|
+
const joined = await this.options.rooms.join(link);
|
|
232
|
+
await this.options.storage.set(sync_protocol_1.SyncKeys.JOINING, joined.id);
|
|
233
|
+
await this.publish();
|
|
234
|
+
return this.status();
|
|
235
|
+
}
|
|
236
|
+
/** This computer stops syncing; the owner's leaving ends it for every computer. What is here stays. */
|
|
237
|
+
async leave() {
|
|
238
|
+
var _a;
|
|
239
|
+
const folder = await this.folderRecord();
|
|
240
|
+
if (folder) {
|
|
241
|
+
// This computer stops writing there; what it wrote stays for the others, as it was.
|
|
242
|
+
(_a = this.space) === null || _a === void 0 ? void 0 : _a.stop();
|
|
243
|
+
this.space = undefined;
|
|
244
|
+
await (0, promises_1.rm)(this.folderFile, { force: true });
|
|
245
|
+
}
|
|
246
|
+
const room = await this.room();
|
|
247
|
+
if (room) {
|
|
248
|
+
await this.options.rooms.leave(room.id);
|
|
249
|
+
}
|
|
250
|
+
await this.options.storage.set(sync_protocol_1.SyncKeys.JOINING, null);
|
|
251
|
+
await this.saveBase({ room: '', items: {} });
|
|
252
|
+
await this.publish();
|
|
253
|
+
return this.status();
|
|
254
|
+
}
|
|
255
|
+
/** The user's answer to a computer asking to join. */
|
|
256
|
+
async answer(ask, accept) {
|
|
257
|
+
const room = await this.room();
|
|
258
|
+
if (room === null || room === void 0 ? void 0 : room.owner) {
|
|
259
|
+
await this.options.rooms.answer(room.id, ask, accept);
|
|
260
|
+
}
|
|
261
|
+
await this.publish();
|
|
262
|
+
return this.status();
|
|
263
|
+
}
|
|
264
|
+
async removeDevice(member) {
|
|
265
|
+
const room = await this.room();
|
|
266
|
+
if (room === null || room === void 0 ? void 0 : room.owner) {
|
|
267
|
+
await this.options.rooms.removeMember(room.id, member);
|
|
268
|
+
await this.options.rooms.setState(room.id, sync_protocol_1.SyncStateKeys.device(member), null).catch(() => undefined);
|
|
269
|
+
}
|
|
270
|
+
return this.status();
|
|
271
|
+
}
|
|
272
|
+
async setResources(change) {
|
|
273
|
+
const resources = { ...(await this.resources()) };
|
|
274
|
+
for (const resource of sync_protocol_1.SYNC_RESOURCES) {
|
|
275
|
+
if (typeof (change === null || change === void 0 ? void 0 : change[resource]) === 'boolean') {
|
|
276
|
+
resources[resource] = change[resource];
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
await this.options.storage.set(sync_protocol_1.SyncKeys.RESOURCES, resources);
|
|
280
|
+
this.schedule(0);
|
|
281
|
+
return this.status();
|
|
282
|
+
}
|
|
283
|
+
/** A round now, answered once done. */
|
|
284
|
+
async syncNow() {
|
|
285
|
+
clearTimeout(this.timer);
|
|
286
|
+
await this.run();
|
|
287
|
+
return this.status();
|
|
288
|
+
}
|
|
289
|
+
heard(event) {
|
|
290
|
+
if (event.type === 'rooms' || event.type === 'request') {
|
|
291
|
+
void this.publish();
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (event.type === 'state' &&
|
|
295
|
+
(event.key.startsWith(sync_protocol_1.SyncStateKeys.ITEM) || event.key.startsWith(sync_protocol_1.SyncStateKeys.BLOB) || event.key.startsWith(sync_identity_1.SyncIdentityKeys.PREFIX))) {
|
|
296
|
+
void this.room().then(room => {
|
|
297
|
+
var _a;
|
|
298
|
+
const self = (_a = room === null || room === void 0 ? void 0 : room.members.find(member => member.self)) === null || _a === void 0 ? void 0 : _a.member;
|
|
299
|
+
if ((room === null || room === void 0 ? void 0 : room.id) === event.room && event.by !== self) {
|
|
300
|
+
this.schedule();
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
schedule(delay) {
|
|
306
|
+
var _a;
|
|
307
|
+
if (delay === void 0) { delay = (_a = this.options.delayMs) !== null && _a !== void 0 ? _a : 1500; }
|
|
308
|
+
if (this.stopped) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
clearTimeout(this.timer);
|
|
312
|
+
this.timer = setTimeout(() => void this.run(), delay);
|
|
313
|
+
}
|
|
314
|
+
run() {
|
|
315
|
+
if (this.running) {
|
|
316
|
+
this.again = true;
|
|
317
|
+
return this.running;
|
|
318
|
+
}
|
|
319
|
+
this.running = this.round()
|
|
320
|
+
.catch(error => {
|
|
321
|
+
this.report = { at: Date.now(), sent: 0, received: 0, skipped: [], error: error instanceof Error ? error.message : String(error) };
|
|
322
|
+
})
|
|
323
|
+
.finally(async () => {
|
|
324
|
+
this.running = undefined;
|
|
325
|
+
await this.options.storage.set(sync_protocol_1.SyncKeys.REPORT, this.report).catch(() => undefined);
|
|
326
|
+
await this.publish();
|
|
327
|
+
if (this.again && !this.stopped) {
|
|
328
|
+
this.again = false;
|
|
329
|
+
this.schedule(0);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
void this.publish();
|
|
333
|
+
return this.running;
|
|
334
|
+
}
|
|
335
|
+
async round() {
|
|
336
|
+
var _a;
|
|
337
|
+
var _b, _c;
|
|
338
|
+
const folder = await this.folderRecord();
|
|
339
|
+
const room = folder ? undefined : await this.room();
|
|
340
|
+
if (!folder && (room === null || room === void 0 ? void 0 : room.status) !== 'member') {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
let target;
|
|
344
|
+
if (folder) {
|
|
345
|
+
const opened = await this.openSpace(folder);
|
|
346
|
+
const problem = (_b = opened.problem) !== null && _b !== void 0 ? _b : (await this.problemOf(opened.space, folder));
|
|
347
|
+
if (problem || !opened.space) {
|
|
348
|
+
throw new Error(problem);
|
|
349
|
+
}
|
|
350
|
+
target = { id: `folder:${folder.id}`, room: opened.space, self: folder.device };
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
const joined = room;
|
|
354
|
+
target = { id: joined.id, room: this.roomOf(joined.id), self: (_a = joined.members.find(member => member.self)) === null || _a === void 0 ? void 0 : _a.member };
|
|
355
|
+
}
|
|
356
|
+
const now = await this.resources();
|
|
357
|
+
const resources = new Set(sync_protocol_1.SYNC_RESOURCES.filter(resource => now[resource]));
|
|
358
|
+
const loaded = await this.loadBase();
|
|
359
|
+
// Another room or folder (sync turned off and on, or joined again): every item meets it as for the first time.
|
|
360
|
+
const base = loaded.room === target.id ? loaded : { room: target.id, items: {} };
|
|
361
|
+
this.options.place.begin();
|
|
362
|
+
const engine = new sync_engine_1.SyncEngine(target.room, this.options.place, this.device);
|
|
363
|
+
const report = await engine.round(base, resources);
|
|
364
|
+
const identity = this.options.identity;
|
|
365
|
+
if (identity && resources.has('identity')) {
|
|
366
|
+
// The room of the sync is each computer's own: never shared, never taken.
|
|
367
|
+
(_c = base.identity) !== null && _c !== void 0 ? _c : (base.identity = { rooms: [], friends: [] });
|
|
368
|
+
const shared = await new sync_identity_1.SyncIdentity(target.room, identity, record => record.kind === sync_protocol_1.SYNC_KIND).round(base.identity);
|
|
369
|
+
report.sent += shared.sent;
|
|
370
|
+
report.received += shared.received;
|
|
371
|
+
}
|
|
372
|
+
await this.saveBase(base);
|
|
373
|
+
if (target.self) {
|
|
374
|
+
const entry = { name: this.device, platform: (0, node_os_1.platform)(), at: report.at };
|
|
375
|
+
await target.room.setState(sync_protocol_1.SyncStateKeys.device(target.self), entry).catch(() => undefined);
|
|
376
|
+
}
|
|
377
|
+
if (folder && this.space) {
|
|
378
|
+
this.spaceSignature = await this.space.space.signature().catch(() => this.spaceSignature);
|
|
379
|
+
}
|
|
380
|
+
this.signature = await this.options.place.signature(resources);
|
|
381
|
+
this.lastFull = Date.now();
|
|
382
|
+
// A round that changed nothing does not push out the one before, which says when something last moved.
|
|
383
|
+
if (report.sent || report.received || report.skipped.length || !this.report) {
|
|
384
|
+
this.report = report;
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
this.report = { ...this.report, at: report.at, error: undefined };
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
/** Between rounds: a sync when the files of this computer changed, and every while anyway. */
|
|
391
|
+
async lookAround() {
|
|
392
|
+
var _a;
|
|
393
|
+
if (this.running || this.stopped) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const resources = new Set(sync_protocol_1.SYNC_RESOURCES.filter(resource => this.resourcesNow[resource]));
|
|
397
|
+
const signature = await this.options.place.signature(resources).catch(() => this.signature);
|
|
398
|
+
// In a folder nothing tells of the other computers' writes but the files: a change there is a round too.
|
|
399
|
+
const space = this.space ? await this.space.space.signature().catch(() => this.spaceSignature) : this.spaceSignature;
|
|
400
|
+
const every = (_a = this.options.everyMs) !== null && _a !== void 0 ? _a : 10 * 60000;
|
|
401
|
+
if (signature !== this.signature || space !== this.spaceSignature || Date.now() - this.lastFull > every) {
|
|
402
|
+
this.schedule(0);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
/** Where turning sync on would go: the service relays.json gives `sync`. */
|
|
406
|
+
async target() {
|
|
407
|
+
var _a;
|
|
408
|
+
var _b, _c;
|
|
409
|
+
const service = await ((_a = this.options.relays) === null || _a === void 0 ? void 0 : _a.serviceFor('sync').catch(() => undefined));
|
|
410
|
+
const name = (service === null || service === void 0 ? void 0 : service.builtin) ? undefined : service === null || service === void 0 ? void 0 : service.name;
|
|
411
|
+
if ((service === null || service === void 0 ? void 0 : service.type) === 'folder') {
|
|
412
|
+
return { type: 'folder', path: service.path, id: service.id, ...(name ? { name } : {}) };
|
|
413
|
+
}
|
|
414
|
+
if (service && service.type !== 'ta-relay') {
|
|
415
|
+
return { type: 'store', id: service.id, store: service.type, where: (_b = service.where) !== null && _b !== void 0 ? _b : service.type, ...(name ? { name } : {}) };
|
|
416
|
+
}
|
|
417
|
+
return {
|
|
418
|
+
type: 'ta-relay',
|
|
419
|
+
name: (service === null || service === void 0 ? void 0 : service.builtin) || !service ? server_texts_1.SyncServerTexts.official() : name,
|
|
420
|
+
host: SyncService.host((_c = service === null || service === void 0 ? void 0 : service.url) !== null && _c !== void 0 ? _c : 'https://relay.cellbang.com'),
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
/** What the user calls the relay of a room: its name in relays.json, the official one so, else its host. */
|
|
424
|
+
async relayName(url) {
|
|
425
|
+
var _a, _b;
|
|
426
|
+
var _c, _d;
|
|
427
|
+
const relays = (_c = (await ((_b = (_a = this.options.relays) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b.call(_a).catch(() => undefined)))) !== null && _c !== void 0 ? _c : [];
|
|
428
|
+
const named = relays.find(relay => relay.url === url);
|
|
429
|
+
return (named === null || named === void 0 ? void 0 : named.builtin) ? server_texts_1.SyncServerTexts.official() : ((_d = named === null || named === void 0 ? void 0 : named.name) !== null && _d !== void 0 ? _d : SyncService.host(url));
|
|
430
|
+
}
|
|
431
|
+
static host(url) {
|
|
432
|
+
try {
|
|
433
|
+
return new URL(url).host;
|
|
434
|
+
}
|
|
435
|
+
catch (_a) {
|
|
436
|
+
return url;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
static lastPart(path) {
|
|
440
|
+
var _a;
|
|
441
|
+
return (_a = path.split('/').filter(Boolean).pop()) !== null && _a !== void 0 ? _a : path;
|
|
442
|
+
}
|
|
443
|
+
/** Joins the sync in a folder of a link of another computer: the folder added to relays.json when this computer lacks it. */
|
|
444
|
+
async joinFolder(link) {
|
|
445
|
+
var _a;
|
|
446
|
+
const given = sync_folder_1.FolderSyncUtil.parse(link);
|
|
447
|
+
const relays = this.options.relays;
|
|
448
|
+
const target = await this.target();
|
|
449
|
+
// The same folder as the other computer's, or the one this computer chose for sync: a drive may sit elsewhere here.
|
|
450
|
+
const path = target.type === 'folder' && target.path ? target.path : given.path;
|
|
451
|
+
const record = { id: given.id, key: given.key, path, device: sync_folder_1.FolderSyncUtil.randomId(), at: Date.now() };
|
|
452
|
+
const space = new sync_folder_1.FolderSpace(relays_file_1.RelayServiceUtil.expand(path), record);
|
|
453
|
+
const problem = (_a = relays_file_1.RelayServiceUtil.checkFolder(path)) !== null && _a !== void 0 ? _a : (await this.problemOf(space, record));
|
|
454
|
+
if (problem) {
|
|
455
|
+
throw new Error(problem);
|
|
456
|
+
}
|
|
457
|
+
if (relays && target.type !== 'folder') {
|
|
458
|
+
await relays.choose('sync', await relays.addFolder(path));
|
|
459
|
+
}
|
|
460
|
+
await this.saveFolder(record);
|
|
461
|
+
await this.publish();
|
|
462
|
+
this.schedule(0);
|
|
463
|
+
return this.status();
|
|
464
|
+
}
|
|
465
|
+
/** Joins the sync in a store of a link of another computer: the store added to relays.json (or the same one of before), sync there. */
|
|
466
|
+
async joinStore(link) {
|
|
467
|
+
var _a;
|
|
468
|
+
const given = sync_folder_1.FolderSyncUtil.parseStore(link);
|
|
469
|
+
const relays = this.options.relays;
|
|
470
|
+
if (!relays) {
|
|
471
|
+
throw new Error(server_texts_1.SyncServerTexts.storeUnavailable(given.type));
|
|
472
|
+
}
|
|
473
|
+
const service = await relays.addStore(given.type, given.options, given.service || undefined).catch(error => {
|
|
474
|
+
throw new Error(/no type/i.test(String(error === null || error === void 0 ? void 0 : error.message)) ? server_texts_1.SyncServerTexts.storeUnavailable(given.type) : error instanceof Error ? error.message : String(error));
|
|
475
|
+
});
|
|
476
|
+
const record = {
|
|
477
|
+
id: given.id,
|
|
478
|
+
key: given.key,
|
|
479
|
+
path: '',
|
|
480
|
+
service,
|
|
481
|
+
type: given.type,
|
|
482
|
+
device: sync_folder_1.FolderSyncUtil.randomId(),
|
|
483
|
+
at: Date.now(),
|
|
484
|
+
};
|
|
485
|
+
const opened = await this.openSpace(record);
|
|
486
|
+
const problem = (_a = opened.problem) !== null && _a !== void 0 ? _a : (await this.problemOf(opened.space, record));
|
|
487
|
+
if (problem) {
|
|
488
|
+
throw new Error(problem);
|
|
489
|
+
}
|
|
490
|
+
await relays.choose('sync', service);
|
|
491
|
+
await this.saveFolder(record);
|
|
492
|
+
await this.publish();
|
|
493
|
+
this.schedule(0);
|
|
494
|
+
return this.status();
|
|
495
|
+
}
|
|
496
|
+
async folderRecord() {
|
|
497
|
+
try {
|
|
498
|
+
const record = JSON.parse(await (0, promises_1.readFile)(this.folderFile, 'utf8'));
|
|
499
|
+
return record &&
|
|
500
|
+
typeof record.id === 'string' &&
|
|
501
|
+
typeof record.key === 'string' &&
|
|
502
|
+
typeof record.path === 'string' &&
|
|
503
|
+
typeof record.device === 'string'
|
|
504
|
+
? record
|
|
505
|
+
: undefined;
|
|
506
|
+
}
|
|
507
|
+
catch (_a) {
|
|
508
|
+
return undefined;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
/** Kept where the user alone reads it: it holds the key of the sync. */
|
|
512
|
+
async saveFolder(record) {
|
|
513
|
+
await (0, promises_1.mkdir)((0, node_path_1.join)(this.options.agentDir, 'sync'), { recursive: true });
|
|
514
|
+
await (0, promises_1.writeFile)(`${this.folderFile}.tmp`, JSON.stringify(record), { mode: 0o600 });
|
|
515
|
+
await (0, promises_1.rename)(`${this.folderFile}.tmp`, this.folderFile);
|
|
516
|
+
}
|
|
517
|
+
/** The space of the folder or the store, watched while sync is on there; why it cannot be opened, else (a package off). */
|
|
518
|
+
async openSpace(record) {
|
|
519
|
+
var _a, _b;
|
|
520
|
+
var _c;
|
|
521
|
+
const where = record.service ? `store:${record.service}` : `folder:${record.path}`;
|
|
522
|
+
if (((_a = this.space) === null || _a === void 0 ? void 0 : _a.record.id) === record.id && this.space.where === where) {
|
|
523
|
+
return { space: this.space.space };
|
|
524
|
+
}
|
|
525
|
+
let space;
|
|
526
|
+
if (record.service) {
|
|
527
|
+
try {
|
|
528
|
+
const relays = this.options.relays;
|
|
529
|
+
if (!relays) {
|
|
530
|
+
throw new Error('No relays.json.');
|
|
531
|
+
}
|
|
532
|
+
space = new sync_folder_1.StoreSpace(await relays.openStore(record.service), record);
|
|
533
|
+
}
|
|
534
|
+
catch (_d) {
|
|
535
|
+
return { problem: server_texts_1.SyncServerTexts.storeUnavailable((_c = record.type) !== null && _c !== void 0 ? _c : '') };
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
space = new sync_folder_1.FolderSpace(relays_file_1.RelayServiceUtil.expand(record.path), record);
|
|
540
|
+
}
|
|
541
|
+
(_b = this.space) === null || _b === void 0 ? void 0 : _b.stop();
|
|
542
|
+
let timer;
|
|
543
|
+
const stop = space.watch(() => {
|
|
544
|
+
// A drive writes a file in several steps: once it settled.
|
|
545
|
+
clearTimeout(timer);
|
|
546
|
+
timer = setTimeout(() => this.schedule(), 2000);
|
|
547
|
+
});
|
|
548
|
+
this.space = {
|
|
549
|
+
record,
|
|
550
|
+
where,
|
|
551
|
+
space,
|
|
552
|
+
stop: () => {
|
|
553
|
+
clearTimeout(timer);
|
|
554
|
+
stop();
|
|
555
|
+
},
|
|
556
|
+
};
|
|
557
|
+
return { space };
|
|
558
|
+
}
|
|
559
|
+
/** Why the folder or the store cannot be synced now, in words for the user; undefined when it can. */
|
|
560
|
+
async problemOf(space, record) {
|
|
561
|
+
const folder = record.service ? undefined : relays_file_1.RelayServiceUtil.checkFolder(record.path);
|
|
562
|
+
if (folder) {
|
|
563
|
+
return folder;
|
|
564
|
+
}
|
|
565
|
+
let check;
|
|
566
|
+
try {
|
|
567
|
+
check = await space.check();
|
|
568
|
+
}
|
|
569
|
+
catch (error) {
|
|
570
|
+
return server_texts_1.SyncServerTexts.storeFailed(error instanceof Error ? error.message : String(error));
|
|
571
|
+
}
|
|
572
|
+
return check === 'missing'
|
|
573
|
+
? record.service
|
|
574
|
+
? server_texts_1.SyncServerTexts.storeMissing()
|
|
575
|
+
: server_texts_1.SyncServerTexts.folderMissing(relays_file_1.RelayServiceUtil.expand(record.path))
|
|
576
|
+
: check === 'key'
|
|
577
|
+
? server_texts_1.SyncServerTexts.folderKey()
|
|
578
|
+
: check === 'newer'
|
|
579
|
+
? server_texts_1.SyncServerTexts.folderNewer()
|
|
580
|
+
: undefined;
|
|
581
|
+
}
|
|
582
|
+
async folderDevices(space) {
|
|
583
|
+
var _a;
|
|
584
|
+
const self = (_a = this.space) === null || _a === void 0 ? void 0 : _a.record.device;
|
|
585
|
+
const devices = await space.devices();
|
|
586
|
+
const shown = devices.map(device => ({
|
|
587
|
+
member: device.device,
|
|
588
|
+
name: device.device === self ? this.device : device.name,
|
|
589
|
+
platform: device.platform,
|
|
590
|
+
// A folder has no presence: a computer is shown by when it last synced.
|
|
591
|
+
online: device.device === self,
|
|
592
|
+
self: device.device === self,
|
|
593
|
+
owner: false,
|
|
594
|
+
at: device.at,
|
|
595
|
+
}));
|
|
596
|
+
if (self && !shown.some(device => device.self)) {
|
|
597
|
+
shown.push({ member: self, name: this.device, platform: (0, node_os_1.platform)(), online: true, self: true, owner: false });
|
|
598
|
+
}
|
|
599
|
+
return shown.sort((a, b) => { var _a, _b; return Number(b.self) - Number(a.self) || ((_a = b.at) !== null && _a !== void 0 ? _a : 0) - ((_b = a.at) !== null && _b !== void 0 ? _b : 0); });
|
|
600
|
+
}
|
|
601
|
+
roomOf(id) {
|
|
602
|
+
const rooms = this.options.rooms;
|
|
603
|
+
return {
|
|
604
|
+
getState: prefix => rooms.getState(id, prefix),
|
|
605
|
+
setState: (key, value, version) => rooms.setState(id, key, value, version),
|
|
606
|
+
};
|
|
607
|
+
}
|
|
608
|
+
/** The room of the user's devices: the one this computer is in, else the latest asked or ended, for the page to say. */
|
|
609
|
+
async room() {
|
|
610
|
+
const joining = await this.options.storage.get(sync_protocol_1.SyncKeys.JOINING).catch(() => undefined);
|
|
611
|
+
const rooms = (await this.options.rooms.listRooms().catch(() => [])).filter(room => room.kind === sync_protocol_1.SYNC_KIND || (room.id === joining && room.kind === ''));
|
|
612
|
+
const latest = (room) => { var _a; return (_a = room.joinedAt) !== null && _a !== void 0 ? _a : room.createdAt; };
|
|
613
|
+
rooms.sort((a, b) => Number(b.status === 'member') - Number(a.status === 'member') || latest(b) - latest(a));
|
|
614
|
+
return rooms[0];
|
|
615
|
+
}
|
|
616
|
+
async devices(room) {
|
|
617
|
+
const state = await this.options.rooms.getState(room.id, sync_protocol_1.SyncStateKeys.DEVICE).catch(() => ({}));
|
|
618
|
+
return room.members
|
|
619
|
+
.filter(member => !member.guest)
|
|
620
|
+
.map(member => {
|
|
621
|
+
var _a;
|
|
622
|
+
var _b;
|
|
623
|
+
const entry = (_a = state[sync_protocol_1.SyncStateKeys.device(member.member)]) === null || _a === void 0 ? void 0 : _a.value;
|
|
624
|
+
return {
|
|
625
|
+
member: member.member,
|
|
626
|
+
name: member.self ? this.device : ((_b = entry === null || entry === void 0 ? void 0 : entry.name) !== null && _b !== void 0 ? _b : member.name),
|
|
627
|
+
platform: member.self ? (0, node_os_1.platform)() : entry === null || entry === void 0 ? void 0 : entry.platform,
|
|
628
|
+
online: member.online || member.self,
|
|
629
|
+
self: member.self,
|
|
630
|
+
owner: member.owner,
|
|
631
|
+
...((entry === null || entry === void 0 ? void 0 : entry.at) ? { at: entry.at } : {}),
|
|
632
|
+
};
|
|
633
|
+
})
|
|
634
|
+
.sort((a, b) => Number(b.self) - Number(a.self) || Number(b.owner) - Number(a.owner) || a.name.localeCompare(b.name));
|
|
635
|
+
}
|
|
636
|
+
async resources() {
|
|
637
|
+
const saved = await this.options.storage.get(sync_protocol_1.SyncKeys.RESOURCES).catch(() => undefined);
|
|
638
|
+
const resources = { ...sync_protocol_1.DEFAULT_RESOURCES };
|
|
639
|
+
if (sync_merge_1.SyncMerge.isObject(saved)) {
|
|
640
|
+
for (const resource of sync_protocol_1.SYNC_RESOURCES) {
|
|
641
|
+
if (typeof saved[resource] === 'boolean') {
|
|
642
|
+
resources[resource] = saved[resource];
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
this.resourcesNow = resources;
|
|
647
|
+
return resources;
|
|
648
|
+
}
|
|
649
|
+
/** The status for the pages, in the data of the package: they hear it change, and read it when they open. */
|
|
650
|
+
async publish() {
|
|
651
|
+
const status = await this.status().catch(() => undefined);
|
|
652
|
+
const text = status ? sync_merge_1.SyncMerge.canonical(status) : '';
|
|
653
|
+
if (status && text !== this.shown) {
|
|
654
|
+
// Let in just now (or the room made): the first round.
|
|
655
|
+
if (status.state === 'on' && this.state !== 'on') {
|
|
656
|
+
this.schedule(0);
|
|
657
|
+
}
|
|
658
|
+
this.state = status.state;
|
|
659
|
+
this.shown = text;
|
|
660
|
+
await this.options.storage.set(sync_protocol_1.SyncKeys.STATUS, status).catch(() => undefined);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
async loadBase() {
|
|
664
|
+
try {
|
|
665
|
+
const data = JSON.parse(await (0, promises_1.readFile)(this.baseFile, 'utf8'));
|
|
666
|
+
return sync_merge_1.SyncMerge.isObject(data) && typeof data.room === 'string' && sync_merge_1.SyncMerge.isObject(data.items) ? data : { room: '', items: {} };
|
|
667
|
+
}
|
|
668
|
+
catch (_a) {
|
|
669
|
+
return { room: '', items: {} };
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
async saveBase(base) {
|
|
673
|
+
await (0, promises_1.mkdir)((0, node_path_1.join)(this.options.agentDir, 'sync'), { recursive: true });
|
|
674
|
+
await (0, promises_1.writeFile)(`${this.baseFile}.tmp`, JSON.stringify(base));
|
|
675
|
+
await (0, promises_1.rename)(`${this.baseFile}.tmp`, this.baseFile);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
exports.SyncService = SyncService;
|
|
679
|
+
//# sourceMappingURL=sync-service.js.map
|