@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,810 @@
|
|
|
1
|
+
// src/host.ts
|
|
2
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
3
|
+
import { join as join2 } from "node:path";
|
|
4
|
+
|
|
5
|
+
// src/git-store.ts
|
|
6
|
+
import { execFile } from "node:child_process";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { mkdir, readdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
|
|
11
|
+
// src/store-util.ts
|
|
12
|
+
var StoreUtil;
|
|
13
|
+
((StoreUtil) => {
|
|
14
|
+
function elements(xml, name) {
|
|
15
|
+
const found = [];
|
|
16
|
+
const pattern = new RegExp(`<(?:[\\w.-]+:)?${name}(?:\\s[^>]*)?>([\\s\\S]*?)</(?:[\\w.-]+:)?${name}>`, "g");
|
|
17
|
+
for (let match = pattern.exec(xml);match; match = pattern.exec(xml)) {
|
|
18
|
+
found.push(match[1]);
|
|
19
|
+
}
|
|
20
|
+
return found;
|
|
21
|
+
}
|
|
22
|
+
StoreUtil.elements = elements;
|
|
23
|
+
function element(xml, name) {
|
|
24
|
+
const [first] = elements(xml, name);
|
|
25
|
+
return first === undefined ? undefined : decode(first.trim());
|
|
26
|
+
}
|
|
27
|
+
StoreUtil.element = element;
|
|
28
|
+
function has(xml, name) {
|
|
29
|
+
return new RegExp(`<(?:[\\w.-]+:)?${name}(?:\\s[^>]*)?/?>`).test(xml);
|
|
30
|
+
}
|
|
31
|
+
StoreUtil.has = has;
|
|
32
|
+
function decode(text2) {
|
|
33
|
+
return text2.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"').replace(/'/g, "'").replace(/&#(\d+);/g, (_match, code) => String.fromCodePoint(Number(code))).replace(/&#x([0-9a-f]+);/gi, (_match, code) => String.fromCodePoint(Number.parseInt(code, 16))).replace(/&/g, "&");
|
|
34
|
+
}
|
|
35
|
+
StoreUtil.decode = decode;
|
|
36
|
+
function encode(text2) {
|
|
37
|
+
return encodeURIComponent(text2).replace(/[!'()*]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
38
|
+
}
|
|
39
|
+
StoreUtil.encode = encode;
|
|
40
|
+
function encodePath(path) {
|
|
41
|
+
return path.split("/").map((part) => encode(part)).join("/");
|
|
42
|
+
}
|
|
43
|
+
StoreUtil.encodePath = encodePath;
|
|
44
|
+
async function failure(response, what) {
|
|
45
|
+
const text2 = await response.text().catch(() => "");
|
|
46
|
+
const said = element(text2, "Message") ?? element(text2, "message") ?? "";
|
|
47
|
+
const status = response.status === 401 || response.status === 403 ? "the user, the password or the keys are not right" : response.status === 404 ? "it is not there" : `HTTP ${response.status}`;
|
|
48
|
+
return new Error(`${what}: ${status}${said ? ` (${said.slice(0, 160)})` : ""}.`);
|
|
49
|
+
}
|
|
50
|
+
StoreUtil.failure = failure;
|
|
51
|
+
function text(value) {
|
|
52
|
+
return typeof value === "string" ? value.trim() : value === undefined || value === null ? "" : String(value).trim();
|
|
53
|
+
}
|
|
54
|
+
StoreUtil.text = text;
|
|
55
|
+
})(StoreUtil ||= {});
|
|
56
|
+
|
|
57
|
+
// src/git-store.ts
|
|
58
|
+
var GitUtil;
|
|
59
|
+
((GitUtil) => {
|
|
60
|
+
function url(value) {
|
|
61
|
+
const text = StoreUtil.text(value);
|
|
62
|
+
if (text.startsWith("-")) {
|
|
63
|
+
throw new Error(`${text} is not the address of a git repository.`);
|
|
64
|
+
}
|
|
65
|
+
if (/^[\w.-]+@[\w.-]+:\S+$/.test(text) || /^(ssh|git|file):\/\/\S+$/i.test(text)) {
|
|
66
|
+
return text;
|
|
67
|
+
}
|
|
68
|
+
let parsed;
|
|
69
|
+
try {
|
|
70
|
+
parsed = new URL(text);
|
|
71
|
+
} catch {
|
|
72
|
+
throw new Error(`${text || "Nothing"} is not the address of a git repository.`);
|
|
73
|
+
}
|
|
74
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
|
|
75
|
+
throw new Error(`${text} is not the address of a git repository.`);
|
|
76
|
+
}
|
|
77
|
+
parsed.username = "";
|
|
78
|
+
parsed.password = "";
|
|
79
|
+
parsed.hash = "";
|
|
80
|
+
return parsed.toString().replace(/\/+$/, "");
|
|
81
|
+
}
|
|
82
|
+
GitUtil.url = url;
|
|
83
|
+
function signIn(options) {
|
|
84
|
+
let user = StoreUtil.text(options.user);
|
|
85
|
+
let token = StoreUtil.text(options.token);
|
|
86
|
+
try {
|
|
87
|
+
const parsed = new URL(StoreUtil.text(options.url));
|
|
88
|
+
if (parsed.protocol === "https:" || parsed.protocol === "http:") {
|
|
89
|
+
user ||= decodeURIComponent(parsed.username);
|
|
90
|
+
token ||= decodeURIComponent(parsed.password);
|
|
91
|
+
}
|
|
92
|
+
} catch {}
|
|
93
|
+
return { user, token };
|
|
94
|
+
}
|
|
95
|
+
GitUtil.signIn = signIn;
|
|
96
|
+
function branch(options) {
|
|
97
|
+
const branch2 = StoreUtil.text(options.branch) || "main";
|
|
98
|
+
if (!/^[\w./-]+$/.test(branch2) || branch2.includes("..") || branch2.startsWith("-")) {
|
|
99
|
+
throw new Error(`${branch2} is not the name of a branch.`);
|
|
100
|
+
}
|
|
101
|
+
return branch2;
|
|
102
|
+
}
|
|
103
|
+
GitUtil.branch = branch;
|
|
104
|
+
function folder(options) {
|
|
105
|
+
return StoreUtil.text(options.folder).split("/").filter((part) => part && part !== "." && part !== "..").join("/");
|
|
106
|
+
}
|
|
107
|
+
GitUtil.folder = folder;
|
|
108
|
+
function where(options) {
|
|
109
|
+
const text = url(options.url);
|
|
110
|
+
const ssh = /^[\w.-]+@([\w.-]+):(.+)$/.exec(text);
|
|
111
|
+
const shown = ssh ? `${ssh[1]}/${ssh[2]}` : text.replace(/^[a-z]+:\/\//i, "");
|
|
112
|
+
const at = folder(options);
|
|
113
|
+
return `${shown.replace(/\.git$/, "")}${at ? `/${at}` : ""} · ${branch(options)}`;
|
|
114
|
+
}
|
|
115
|
+
GitUtil.where = where;
|
|
116
|
+
})(GitUtil ||= {});
|
|
117
|
+
|
|
118
|
+
class GitFailure extends Error {
|
|
119
|
+
args;
|
|
120
|
+
said;
|
|
121
|
+
constructor(args, said) {
|
|
122
|
+
super(said);
|
|
123
|
+
this.args = args;
|
|
124
|
+
this.said = said;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
class GitStore {
|
|
129
|
+
dir;
|
|
130
|
+
static queues = new Map;
|
|
131
|
+
static written = new Map;
|
|
132
|
+
flushDelayMs = 1500;
|
|
133
|
+
fetchEveryMs = 15000;
|
|
134
|
+
url;
|
|
135
|
+
branch;
|
|
136
|
+
folder;
|
|
137
|
+
env;
|
|
138
|
+
ready;
|
|
139
|
+
remote = false;
|
|
140
|
+
fetchedAt = 0;
|
|
141
|
+
timer;
|
|
142
|
+
failure;
|
|
143
|
+
constructor(options, dir) {
|
|
144
|
+
this.dir = dir;
|
|
145
|
+
const given = options;
|
|
146
|
+
this.url = GitUtil.url(options.url);
|
|
147
|
+
this.branch = GitUtil.branch(given);
|
|
148
|
+
this.folder = GitUtil.folder(given);
|
|
149
|
+
const { user, token } = GitUtil.signIn(given);
|
|
150
|
+
this.env = {
|
|
151
|
+
GIT_TERMINAL_PROMPT: "0",
|
|
152
|
+
GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND ?? "ssh -o BatchMode=yes",
|
|
153
|
+
GIT_AUTHOR_NAME: "Ta",
|
|
154
|
+
GIT_AUTHOR_EMAIL: "ta@localhost",
|
|
155
|
+
GIT_COMMITTER_NAME: "Ta",
|
|
156
|
+
GIT_COMMITTER_EMAIL: "ta@localhost",
|
|
157
|
+
LC_ALL: "C"
|
|
158
|
+
};
|
|
159
|
+
if (token && /^https?:/i.test(this.url)) {
|
|
160
|
+
this.env.GIT_CONFIG_COUNT = "1";
|
|
161
|
+
this.env.GIT_CONFIG_KEY_0 = "http.extraHeader";
|
|
162
|
+
this.env.GIT_CONFIG_VALUE_0 = `Authorization: Basic ${Buffer.from(`${user || "x-access-token"}:${token}`).toString("base64")}`;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
get dirty() {
|
|
166
|
+
let dirty = GitStore.written.get(this.dir);
|
|
167
|
+
if (!dirty) {
|
|
168
|
+
dirty = new Set;
|
|
169
|
+
GitStore.written.set(this.dir, dirty);
|
|
170
|
+
}
|
|
171
|
+
return dirty;
|
|
172
|
+
}
|
|
173
|
+
async list(dir) {
|
|
174
|
+
await this.open();
|
|
175
|
+
if (this.failure) {
|
|
176
|
+
const failure = this.failure;
|
|
177
|
+
this.failure = undefined;
|
|
178
|
+
throw failure;
|
|
179
|
+
}
|
|
180
|
+
if (this.dirty.size > 0 || Date.now() - this.fetchedAt >= this.fetchEveryMs) {
|
|
181
|
+
await this.sync();
|
|
182
|
+
}
|
|
183
|
+
return this.locked(async () => {
|
|
184
|
+
const found = [];
|
|
185
|
+
const at = this.path(dir);
|
|
186
|
+
for (const entry of await readdir(at, { withFileTypes: true }).catch(() => [])) {
|
|
187
|
+
if (entry.name.startsWith(".")) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (entry.isDirectory()) {
|
|
191
|
+
found.push({ name: entry.name, tag: "", dir: true });
|
|
192
|
+
} else if (entry.isFile()) {
|
|
193
|
+
const info = await stat(join(at, entry.name)).catch(() => {
|
|
194
|
+
return;
|
|
195
|
+
});
|
|
196
|
+
if (info) {
|
|
197
|
+
found.push({ name: entry.name, tag: `${info.mtimeMs}:${info.size}` });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return found.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
async read(path) {
|
|
205
|
+
await this.open();
|
|
206
|
+
return this.locked(async () => {
|
|
207
|
+
try {
|
|
208
|
+
return new Uint8Array(await readFile(this.path(path)));
|
|
209
|
+
} catch {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
async write(path, data) {
|
|
215
|
+
await this.open();
|
|
216
|
+
await this.locked(async () => {
|
|
217
|
+
const file = this.path(path);
|
|
218
|
+
await mkdir(join(file, ".."), { recursive: true });
|
|
219
|
+
const temporary = `${file}.${process.pid}.tmp`;
|
|
220
|
+
await writeFile(temporary, data);
|
|
221
|
+
await rename(temporary, file);
|
|
222
|
+
this.dirty.add(this.inRepository(path));
|
|
223
|
+
});
|
|
224
|
+
this.later();
|
|
225
|
+
}
|
|
226
|
+
async remove(path) {
|
|
227
|
+
await this.open();
|
|
228
|
+
await this.locked(async () => {
|
|
229
|
+
await rm(this.path(path), { force: true });
|
|
230
|
+
this.dirty.add(this.inRepository(path));
|
|
231
|
+
});
|
|
232
|
+
this.later();
|
|
233
|
+
}
|
|
234
|
+
async sync() {
|
|
235
|
+
clearTimeout(this.timer);
|
|
236
|
+
this.timer = undefined;
|
|
237
|
+
await this.open();
|
|
238
|
+
await this.locked(async () => {
|
|
239
|
+
for (let attempt = 0;; attempt++) {
|
|
240
|
+
await this.fetch();
|
|
241
|
+
const written = new Map;
|
|
242
|
+
for (const path of this.dirty) {
|
|
243
|
+
written.set(path, await readFile(join(this.dir, path)).catch(() => {
|
|
244
|
+
return;
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
247
|
+
if (this.remote) {
|
|
248
|
+
await this.git(["reset", "-q", "--hard", `origin/${this.branch}`]);
|
|
249
|
+
await this.git(["clean", "-q", "-f", "-d"]);
|
|
250
|
+
}
|
|
251
|
+
for (const [path, data] of written) {
|
|
252
|
+
const file = join(this.dir, path);
|
|
253
|
+
if (data) {
|
|
254
|
+
await mkdir(join(file, ".."), { recursive: true });
|
|
255
|
+
await writeFile(file, data);
|
|
256
|
+
} else {
|
|
257
|
+
await rm(file, { force: true });
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
if (written.size === 0) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
await this.git(["add", "-A", "--", "."]);
|
|
264
|
+
const changed = await this.git(["diff", "--cached", "--quiet"]).then(() => false, () => true);
|
|
265
|
+
if (changed) {
|
|
266
|
+
await this.git(["commit", "-q", "--no-verify", "--no-gpg-sign", "-m", `Ta sync: ${written.size} ${written.size === 1 ? "file" : "files"}`]);
|
|
267
|
+
try {
|
|
268
|
+
await this.push();
|
|
269
|
+
} catch (error) {
|
|
270
|
+
if (attempt < 4 && error instanceof GitFailure && GitStore.refused(error)) {
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
throw error;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
for (const path of written.keys()) {
|
|
277
|
+
this.dirty.delete(path);
|
|
278
|
+
}
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
open() {
|
|
284
|
+
this.ready ??= this.locked(async () => {
|
|
285
|
+
await mkdir(this.dir, { recursive: true });
|
|
286
|
+
if (!existsSync(join(this.dir, ".git"))) {
|
|
287
|
+
await this.git(["init", "-q"]);
|
|
288
|
+
await this.git(["remote", "add", "origin", this.url]);
|
|
289
|
+
} else {
|
|
290
|
+
await this.git(["remote", "set-url", "origin", this.url]);
|
|
291
|
+
await rm(join(this.dir, ".git", "index.lock"), { force: true });
|
|
292
|
+
}
|
|
293
|
+
await this.git(["config", "core.autocrlf", "false"]);
|
|
294
|
+
await this.git(["config", "core.quotepath", "false"]);
|
|
295
|
+
await this.fetch();
|
|
296
|
+
const head = await this.git(["rev-parse", "--verify", "-q", "HEAD"]).then(() => true, () => false);
|
|
297
|
+
if (head) {
|
|
298
|
+
for (const line of (await this.git(["status", "--porcelain", "-z", "--untracked-files=all"])).split("\x00")) {
|
|
299
|
+
const path = line.slice(3);
|
|
300
|
+
if (path) {
|
|
301
|
+
this.dirty.add(path);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
} else if (this.remote) {
|
|
305
|
+
await this.git(["reset", "-q", "--hard", `origin/${this.branch}`]);
|
|
306
|
+
}
|
|
307
|
+
if (!this.remote) {
|
|
308
|
+
if (!head) {
|
|
309
|
+
await this.git(["commit", "-q", "--allow-empty", "--no-verify", "--no-gpg-sign", "-m", "Ta sync"]);
|
|
310
|
+
}
|
|
311
|
+
await this.push();
|
|
312
|
+
this.remote = true;
|
|
313
|
+
} else {
|
|
314
|
+
await this.git(["push", "-q", "--dry-run", "--no-verify", "origin", `HEAD:refs/heads/${this.branch}`]).catch((error) => {
|
|
315
|
+
if (error instanceof GitFailure && GitStore.refused(error)) {
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
throw error;
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}).catch((error) => {
|
|
322
|
+
this.ready = undefined;
|
|
323
|
+
throw this.explain(error);
|
|
324
|
+
});
|
|
325
|
+
return this.ready;
|
|
326
|
+
}
|
|
327
|
+
async fetch() {
|
|
328
|
+
try {
|
|
329
|
+
await this.git(["fetch", "-q", "--depth", "1", "--no-tags", "origin", `+refs/heads/${this.branch}:refs/remotes/origin/${this.branch}`]);
|
|
330
|
+
this.remote = true;
|
|
331
|
+
} catch (error) {
|
|
332
|
+
if (error instanceof GitFailure && /couldn't find remote ref|not our ref|no such ref/i.test(error.said)) {
|
|
333
|
+
this.remote = false;
|
|
334
|
+
} else {
|
|
335
|
+
throw error;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
this.fetchedAt = Date.now();
|
|
339
|
+
}
|
|
340
|
+
async push() {
|
|
341
|
+
await this.git(["push", "-q", "--no-verify", "origin", `HEAD:refs/heads/${this.branch}`]);
|
|
342
|
+
}
|
|
343
|
+
static refused(error) {
|
|
344
|
+
return /rejected|fetch first|non-fast-forward|stale info|cannot lock ref/i.test(error.said);
|
|
345
|
+
}
|
|
346
|
+
later() {
|
|
347
|
+
clearTimeout(this.timer);
|
|
348
|
+
this.timer = setTimeout(() => {
|
|
349
|
+
this.timer = undefined;
|
|
350
|
+
this.sync().catch((error) => {
|
|
351
|
+
this.failure = this.explain(error);
|
|
352
|
+
});
|
|
353
|
+
}, this.flushDelayMs);
|
|
354
|
+
this.timer.unref?.();
|
|
355
|
+
}
|
|
356
|
+
locked(work) {
|
|
357
|
+
const before = GitStore.queues.get(this.dir) ?? Promise.resolve();
|
|
358
|
+
const run = before.then(work, work);
|
|
359
|
+
const tail = run.catch(() => {
|
|
360
|
+
return;
|
|
361
|
+
});
|
|
362
|
+
GitStore.queues.set(this.dir, tail);
|
|
363
|
+
tail.then(() => {
|
|
364
|
+
if (GitStore.queues.get(this.dir) === tail) {
|
|
365
|
+
GitStore.queues.delete(this.dir);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
return run;
|
|
369
|
+
}
|
|
370
|
+
git(args) {
|
|
371
|
+
return new Promise((resolve, reject) => {
|
|
372
|
+
execFile("git", ["-c", "core.hooksPath=/dev/null", ...args], { cwd: this.dir, env: { ...process.env, ...this.env }, timeout: 120000, maxBuffer: 16 * 1024 * 1024 }, (error, stdout, stderr) => {
|
|
373
|
+
if (!error) {
|
|
374
|
+
resolve(String(stdout));
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
if (error.code === "ENOENT") {
|
|
378
|
+
reject(new GitFailure(args, "git is not installed on this computer."));
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
reject(new GitFailure(args, String(stderr || error.message).trim()));
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
explain(error) {
|
|
386
|
+
if (!(error instanceof GitFailure)) {
|
|
387
|
+
return error instanceof Error ? error : new Error(String(error));
|
|
388
|
+
}
|
|
389
|
+
const said = error.said.split(`
|
|
390
|
+
`).filter((line) => line.trim() && !/^hint:/.test(line)).slice(0, 3).join(" ").replace(/Authorization: Basic \S+/gi, "Authorization: …");
|
|
391
|
+
if (/Authentication failed|could not read Username|terminal prompts disabled|\b40[13]\b|Permission denied|access denied|not authorized/i.test(said)) {
|
|
392
|
+
return new Error(`git cannot sign in to ${this.url}: the user, the token or the keys are not right, or may not push (${said.slice(0, 200)}).`);
|
|
393
|
+
}
|
|
394
|
+
return new Error(`git ${error.args[0]} of ${this.url} failed: ${said.slice(0, 300)}`);
|
|
395
|
+
}
|
|
396
|
+
inRepository(path) {
|
|
397
|
+
return [this.folder, ...path.split("/").filter(Boolean)].filter(Boolean).join("/");
|
|
398
|
+
}
|
|
399
|
+
path(path) {
|
|
400
|
+
return join(this.dir, ...this.inRepository(path).split("/").filter(Boolean));
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
// src/s3-store.ts
|
|
405
|
+
import { createHash, createHmac } from "node:crypto";
|
|
406
|
+
var EMPTY = createHash("sha256").update("").digest("hex");
|
|
407
|
+
var VIRTUAL = /(^|\.)(amazonaws\.com|aliyuncs\.com|myqcloud\.com)$/i;
|
|
408
|
+
var sha256 = (data) => createHash("sha256").update(data).digest("hex");
|
|
409
|
+
var hmac = (key, text) => createHmac("sha256", key).update(text).digest();
|
|
410
|
+
var S3Signer;
|
|
411
|
+
((S3Signer) => {
|
|
412
|
+
function amzDate(date) {
|
|
413
|
+
return date.toISOString().replace(/[-:]/g, "").replace(/\.\d{3}/, "");
|
|
414
|
+
}
|
|
415
|
+
S3Signer.amzDate = amzDate;
|
|
416
|
+
function sign(request, credentials, region, date = new Date) {
|
|
417
|
+
const url = new URL(request.url);
|
|
418
|
+
const stamp = amzDate(date);
|
|
419
|
+
const day = stamp.slice(0, 8);
|
|
420
|
+
const payload = request.payloadHash ?? EMPTY;
|
|
421
|
+
const headers = {};
|
|
422
|
+
for (const [name, value] of Object.entries(request.headers ?? {})) {
|
|
423
|
+
headers[name.toLowerCase()] = String(value).trim().replace(/\s+/g, " ");
|
|
424
|
+
}
|
|
425
|
+
headers.host = url.host;
|
|
426
|
+
headers["x-amz-content-sha256"] = payload;
|
|
427
|
+
headers["x-amz-date"] = stamp;
|
|
428
|
+
const names = Object.keys(headers).sort();
|
|
429
|
+
const query = [...url.searchParams].map(([key2, value]) => [StoreUtil.encode(key2), StoreUtil.encode(value)]).sort(([a, x], [b, y]) => a < b ? -1 : a > b ? 1 : x < y ? -1 : x > y ? 1 : 0).map(([key2, value]) => `${key2}=${value}`).join("&");
|
|
430
|
+
const canonical = [
|
|
431
|
+
request.method,
|
|
432
|
+
(url.pathname || "/").split("/").map((part) => StoreUtil.encode(decodeURIComponent(part))).join("/"),
|
|
433
|
+
query,
|
|
434
|
+
names.map((name) => `${name}:${headers[name]}
|
|
435
|
+
`).join(""),
|
|
436
|
+
names.join(";"),
|
|
437
|
+
payload
|
|
438
|
+
].join(`
|
|
439
|
+
`);
|
|
440
|
+
const scope = `${day}/${region}/s3/aws4_request`;
|
|
441
|
+
const toSign = ["AWS4-HMAC-SHA256", stamp, scope, sha256(canonical)].join(`
|
|
442
|
+
`);
|
|
443
|
+
const key = hmac(hmac(hmac(hmac(`AWS4${credentials.secretAccessKey}`, day), region), "s3"), "aws4_request");
|
|
444
|
+
const signature = createHmac("sha256", key).update(toSign).digest("hex");
|
|
445
|
+
return {
|
|
446
|
+
...headers,
|
|
447
|
+
authorization: `AWS4-HMAC-SHA256 Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${names.join(";")}, Signature=${signature}`
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
S3Signer.sign = sign;
|
|
451
|
+
})(S3Signer ||= {});
|
|
452
|
+
var S3Util;
|
|
453
|
+
((S3Util) => {
|
|
454
|
+
function bucketUrl(options) {
|
|
455
|
+
const bucket = StoreUtil.text(options.bucket);
|
|
456
|
+
if (!/^[a-z0-9][a-z0-9.-]{1,62}$/i.test(bucket)) {
|
|
457
|
+
throw new Error(`${bucket || "Nothing"} is not the name of a bucket.`);
|
|
458
|
+
}
|
|
459
|
+
const endpoint = StoreUtil.text(options.endpoint);
|
|
460
|
+
if (!endpoint) {
|
|
461
|
+
return `https://${bucket}.s3.${region(options)}.amazonaws.com/`;
|
|
462
|
+
}
|
|
463
|
+
let url;
|
|
464
|
+
try {
|
|
465
|
+
url = new URL(/^https?:\/\//i.test(endpoint) ? endpoint : `https://${endpoint}`);
|
|
466
|
+
} catch {
|
|
467
|
+
throw new Error(`${endpoint} is not the address of a storage of S3.`);
|
|
468
|
+
}
|
|
469
|
+
const path = url.pathname.replace(/\/+$/, "");
|
|
470
|
+
if (url.hostname.toLowerCase().startsWith(`${bucket.toLowerCase()}.`)) {
|
|
471
|
+
return `${url.origin}${path}/`;
|
|
472
|
+
}
|
|
473
|
+
if (VIRTUAL.test(url.hostname)) {
|
|
474
|
+
return `${url.protocol}//${bucket}.${url.host}${path}/`;
|
|
475
|
+
}
|
|
476
|
+
return `${url.origin}${path}/${bucket}/`;
|
|
477
|
+
}
|
|
478
|
+
S3Util.bucketUrl = bucketUrl;
|
|
479
|
+
function region(options) {
|
|
480
|
+
const given = StoreUtil.text(options.region);
|
|
481
|
+
if (given) {
|
|
482
|
+
return given;
|
|
483
|
+
}
|
|
484
|
+
return /r2\.cloudflarestorage\.com/i.test(StoreUtil.text(options.endpoint)) ? "auto" : "us-east-1";
|
|
485
|
+
}
|
|
486
|
+
S3Util.region = region;
|
|
487
|
+
function prefix(options) {
|
|
488
|
+
return StoreUtil.text(options.prefix).replace(/^\/+|\/+$/g, "");
|
|
489
|
+
}
|
|
490
|
+
S3Util.prefix = prefix;
|
|
491
|
+
function listing(xml, prefix2) {
|
|
492
|
+
const entries = [];
|
|
493
|
+
for (const contents of StoreUtil.elements(xml, "Contents")) {
|
|
494
|
+
const key = StoreUtil.element(contents, "Key") ?? "";
|
|
495
|
+
const name = key.slice(prefix2.length);
|
|
496
|
+
if (!key.startsWith(prefix2) || !name || name.includes("/")) {
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
499
|
+
const tag = [StoreUtil.element(contents, "ETag"), StoreUtil.element(contents, "LastModified"), StoreUtil.element(contents, "Size")].filter(Boolean).join(":");
|
|
500
|
+
entries.push({ name, tag });
|
|
501
|
+
}
|
|
502
|
+
for (const common of StoreUtil.elements(xml, "CommonPrefixes")) {
|
|
503
|
+
const key = StoreUtil.element(common, "Prefix") ?? "";
|
|
504
|
+
const name = key.slice(prefix2.length).replace(/\/$/, "");
|
|
505
|
+
if (key.startsWith(prefix2) && name && !name.includes("/")) {
|
|
506
|
+
entries.push({ name, tag: "", dir: true });
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
const truncated = StoreUtil.element(xml, "IsTruncated") === "true";
|
|
510
|
+
const next = truncated ? StoreUtil.element(xml, "NextContinuationToken") : undefined;
|
|
511
|
+
return { entries, ...next ? { next } : {} };
|
|
512
|
+
}
|
|
513
|
+
S3Util.listing = listing;
|
|
514
|
+
})(S3Util ||= {});
|
|
515
|
+
|
|
516
|
+
class S3Store {
|
|
517
|
+
now;
|
|
518
|
+
bucket;
|
|
519
|
+
root;
|
|
520
|
+
region;
|
|
521
|
+
credentials;
|
|
522
|
+
constructor(options, now = () => new Date) {
|
|
523
|
+
this.now = now;
|
|
524
|
+
this.bucket = S3Util.bucketUrl(options);
|
|
525
|
+
this.region = S3Util.region(options);
|
|
526
|
+
const prefix = S3Util.prefix(options);
|
|
527
|
+
this.root = prefix ? `${prefix}/` : "";
|
|
528
|
+
this.credentials = { accessKeyId: StoreUtil.text(options.accessKeyId), secretAccessKey: StoreUtil.text(options.secretAccessKey) };
|
|
529
|
+
if (!this.credentials.accessKeyId || !this.credentials.secretAccessKey) {
|
|
530
|
+
throw new Error("A storage of S3 needs its access key and secret.");
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
async list(dir) {
|
|
534
|
+
const prefix = this.root + (dir ? `${dir}/` : "");
|
|
535
|
+
const entries = [];
|
|
536
|
+
let token;
|
|
537
|
+
do {
|
|
538
|
+
const url = new URL(this.bucket);
|
|
539
|
+
url.searchParams.set("list-type", "2");
|
|
540
|
+
url.searchParams.set("delimiter", "/");
|
|
541
|
+
url.searchParams.set("prefix", prefix);
|
|
542
|
+
if (token) {
|
|
543
|
+
url.searchParams.set("continuation-token", token);
|
|
544
|
+
}
|
|
545
|
+
const response = await this.send("GET", url.toString());
|
|
546
|
+
if (!response.ok) {
|
|
547
|
+
throw await StoreUtil.failure(response, `S3 cannot list ${dir || "the bucket"}`);
|
|
548
|
+
}
|
|
549
|
+
const page = S3Util.listing(await response.text(), prefix);
|
|
550
|
+
entries.push(...page.entries);
|
|
551
|
+
token = page.next;
|
|
552
|
+
} while (token);
|
|
553
|
+
return entries.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
554
|
+
}
|
|
555
|
+
async read(path) {
|
|
556
|
+
const response = await this.send("GET", this.url(path));
|
|
557
|
+
if (response.status === 404) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
if (!response.ok) {
|
|
561
|
+
throw await StoreUtil.failure(response, `S3 cannot read ${path}`);
|
|
562
|
+
}
|
|
563
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
564
|
+
}
|
|
565
|
+
async write(path, data) {
|
|
566
|
+
const response = await this.send("PUT", this.url(path), data);
|
|
567
|
+
if (!response.ok) {
|
|
568
|
+
throw await StoreUtil.failure(response, `S3 cannot write ${path}`);
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
async remove(path) {
|
|
572
|
+
const response = await this.send("DELETE", this.url(path));
|
|
573
|
+
if (!response.ok && response.status !== 404) {
|
|
574
|
+
throw await StoreUtil.failure(response, `S3 cannot remove ${path}`);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
url(path) {
|
|
578
|
+
return this.bucket + StoreUtil.encodePath(this.root + path);
|
|
579
|
+
}
|
|
580
|
+
send(method, url, body) {
|
|
581
|
+
const headers = S3Signer.sign({ method, url, payloadHash: body ? sha256(body) : EMPTY }, this.credentials, this.region, this.now());
|
|
582
|
+
delete headers.host;
|
|
583
|
+
return fetch(url, { method, headers, ...body ? { body } : {} });
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// src/webdav-store.ts
|
|
588
|
+
var PROPFIND = `<?xml version="1.0" encoding="utf-8"?><d:propfind xmlns:d="DAV:"><d:prop><d:resourcetype/><d:getetag/><d:getlastmodified/><d:getcontentlength/></d:prop></d:propfind>`;
|
|
589
|
+
var WebDavUtil;
|
|
590
|
+
((WebDavUtil) => {
|
|
591
|
+
function base(url) {
|
|
592
|
+
const text = StoreUtil.text(url);
|
|
593
|
+
let parsed;
|
|
594
|
+
try {
|
|
595
|
+
parsed = new URL(text);
|
|
596
|
+
} catch {
|
|
597
|
+
throw new Error(`${text || "Nothing"} is not the address of a WebDAV folder.`);
|
|
598
|
+
}
|
|
599
|
+
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") {
|
|
600
|
+
throw new Error(`${text} is not the address of a WebDAV folder.`);
|
|
601
|
+
}
|
|
602
|
+
parsed.hash = "";
|
|
603
|
+
parsed.search = "";
|
|
604
|
+
return parsed.toString().replace(/\/*$/, "/");
|
|
605
|
+
}
|
|
606
|
+
WebDavUtil.base = base;
|
|
607
|
+
function entries(xml, dir) {
|
|
608
|
+
const found = [];
|
|
609
|
+
const within = decodeURIComponent(dir).replace(/\/+$/, "");
|
|
610
|
+
for (const response of StoreUtil.elements(xml, "response")) {
|
|
611
|
+
const href = StoreUtil.element(response, "href");
|
|
612
|
+
if (!href) {
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
let path;
|
|
616
|
+
try {
|
|
617
|
+
path = decodeURIComponent(new URL(href, "http://dav.invalid").pathname).replace(/\/+$/, "");
|
|
618
|
+
} catch {
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
if (path === within || !path.startsWith(`${within}/`)) {
|
|
622
|
+
continue;
|
|
623
|
+
}
|
|
624
|
+
const name = path.slice(within.length + 1);
|
|
625
|
+
if (!name || name.includes("/") || name.startsWith(".")) {
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
const collection = StoreUtil.has(response, "collection");
|
|
629
|
+
const tag = [
|
|
630
|
+
StoreUtil.element(response, "getetag"),
|
|
631
|
+
StoreUtil.element(response, "getlastmodified"),
|
|
632
|
+
StoreUtil.element(response, "getcontentlength")
|
|
633
|
+
].filter(Boolean).join(":");
|
|
634
|
+
found.push(collection ? { name, tag: "", dir: true } : { name, tag });
|
|
635
|
+
}
|
|
636
|
+
return found.sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
637
|
+
}
|
|
638
|
+
WebDavUtil.entries = entries;
|
|
639
|
+
})(WebDavUtil ||= {});
|
|
640
|
+
|
|
641
|
+
class WebDavStore {
|
|
642
|
+
base;
|
|
643
|
+
headers;
|
|
644
|
+
made = new Set;
|
|
645
|
+
constructor(options) {
|
|
646
|
+
this.base = WebDavUtil.base(options.url);
|
|
647
|
+
const user = StoreUtil.text(options.user);
|
|
648
|
+
const password = StoreUtil.text(options.password);
|
|
649
|
+
this.headers = user || password ? { authorization: `Basic ${Buffer.from(`${user}:${password}`).toString("base64")}` } : {};
|
|
650
|
+
}
|
|
651
|
+
async list(dir) {
|
|
652
|
+
const url = this.url(dir ? `${dir}/` : "");
|
|
653
|
+
const response = await fetch(url, {
|
|
654
|
+
method: "PROPFIND",
|
|
655
|
+
headers: { ...this.headers, depth: "1", "content-type": "application/xml; charset=utf-8" },
|
|
656
|
+
body: PROPFIND
|
|
657
|
+
});
|
|
658
|
+
if (response.status === 404) {
|
|
659
|
+
return [];
|
|
660
|
+
}
|
|
661
|
+
if (response.status !== 207 && !response.ok) {
|
|
662
|
+
throw await StoreUtil.failure(response, `WebDAV cannot list ${dir || "its folder"}`);
|
|
663
|
+
}
|
|
664
|
+
return WebDavUtil.entries(await response.text(), new URL(url).pathname);
|
|
665
|
+
}
|
|
666
|
+
async read(path) {
|
|
667
|
+
const response = await fetch(this.url(path), { headers: this.headers });
|
|
668
|
+
if (response.status === 404) {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
if (!response.ok) {
|
|
672
|
+
throw await StoreUtil.failure(response, `WebDAV cannot read ${path}`);
|
|
673
|
+
}
|
|
674
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
675
|
+
}
|
|
676
|
+
async write(path, data) {
|
|
677
|
+
const put = () => fetch(this.url(path), { method: "PUT", headers: { ...this.headers, "content-type": "application/octet-stream" }, body: data });
|
|
678
|
+
const folder = path.split("/").slice(0, -1).join("/");
|
|
679
|
+
if (folder && !this.made.has(folder)) {
|
|
680
|
+
await this.makeFolders(folder);
|
|
681
|
+
}
|
|
682
|
+
let response = await put();
|
|
683
|
+
if (response.status === 409 || response.status === 404) {
|
|
684
|
+
this.made.clear();
|
|
685
|
+
await this.makeFolders(folder);
|
|
686
|
+
response = await put();
|
|
687
|
+
}
|
|
688
|
+
if (!response.ok) {
|
|
689
|
+
throw await StoreUtil.failure(response, `WebDAV cannot write ${path}`);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
async remove(path) {
|
|
693
|
+
const response = await fetch(this.url(path), { method: "DELETE", headers: this.headers });
|
|
694
|
+
if (!response.ok && response.status !== 404) {
|
|
695
|
+
throw await StoreUtil.failure(response, `WebDAV cannot remove ${path}`);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
async makeFolders(folder) {
|
|
699
|
+
const parts = folder.split("/").filter(Boolean);
|
|
700
|
+
for (let end = 1;end <= parts.length; end++) {
|
|
701
|
+
const path = parts.slice(0, end).join("/");
|
|
702
|
+
if (this.made.has(path)) {
|
|
703
|
+
continue;
|
|
704
|
+
}
|
|
705
|
+
const response = await fetch(this.url(`${path}/`), { method: "MKCOL", headers: this.headers });
|
|
706
|
+
if (!response.ok && response.status !== 405 && response.status !== 301 && response.status !== 302) {
|
|
707
|
+
throw await StoreUtil.failure(response, `WebDAV cannot make the folder ${path}`);
|
|
708
|
+
}
|
|
709
|
+
this.made.add(path);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
url(path) {
|
|
713
|
+
return this.base + StoreUtil.encodePath(path);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// src/host.ts
|
|
718
|
+
var WEBDAV = {
|
|
719
|
+
title: { en: "WebDAV", "zh-CN": "WebDAV" },
|
|
720
|
+
hint: {
|
|
721
|
+
en: "Jianguoyun, Nextcloud, a NAS of Synology or QNAP: the address of a folder of yours, and an app password.",
|
|
722
|
+
"zh-CN": "坚果云、Nextcloud、群晖或威联通的 NAS:填你的一个文件夹的地址,以及应用密码。"
|
|
723
|
+
},
|
|
724
|
+
icon: "Cloud",
|
|
725
|
+
options: [
|
|
726
|
+
{ key: "url", label: { en: "Address of a folder", "zh-CN": "文件夹地址" }, placeholder: "https://dav.jianguoyun.com/dav/Ta" },
|
|
727
|
+
{ key: "user", label: { en: "User", "zh-CN": "用户名" }, optional: true },
|
|
728
|
+
{ key: "password", label: { en: "Password", "zh-CN": "密码" }, secret: true, optional: true }
|
|
729
|
+
],
|
|
730
|
+
key: (options) => `${WebDavUtil.base(options.url)}|${StoreUtil.text(options.user)}`,
|
|
731
|
+
where: (options) => {
|
|
732
|
+
try {
|
|
733
|
+
const url = new URL(WebDavUtil.base(options.url));
|
|
734
|
+
return `${url.host}${decodeURIComponent(url.pathname).replace(/\/$/, "")}`;
|
|
735
|
+
} catch {
|
|
736
|
+
return StoreUtil.text(options.url);
|
|
737
|
+
}
|
|
738
|
+
},
|
|
739
|
+
create: (options) => new WebDavStore(options)
|
|
740
|
+
};
|
|
741
|
+
var S3 = {
|
|
742
|
+
title: { en: "S3", "zh-CN": "S3" },
|
|
743
|
+
hint: {
|
|
744
|
+
en: "AWS, Cloudflare R2, MinIO, Tencent COS, Alibaba OSS: a bucket, and keys that may read and write it. Leave the address empty for AWS.",
|
|
745
|
+
"zh-CN": "AWS、Cloudflare R2、MinIO、腾讯云 COS、阿里云 OSS:一个存储桶,以及能读写它的密钥。用 AWS 时地址留空。"
|
|
746
|
+
},
|
|
747
|
+
icon: "Database",
|
|
748
|
+
options: [
|
|
749
|
+
{ key: "endpoint", label: { en: "Address", "zh-CN": "服务地址" }, placeholder: "https://<account>.r2.cloudflarestorage.com", optional: true },
|
|
750
|
+
{ key: "bucket", label: { en: "Bucket", "zh-CN": "存储桶" }, placeholder: "my-ta" },
|
|
751
|
+
{ key: "prefix", label: { en: "Folder in it", "zh-CN": "桶内文件夹" }, placeholder: "ta", optional: true },
|
|
752
|
+
{ key: "region", label: { en: "Region", "zh-CN": "地域" }, placeholder: "us-east-1", optional: true },
|
|
753
|
+
{ key: "accessKeyId", label: { en: "Access key", "zh-CN": "访问密钥 ID" } },
|
|
754
|
+
{ key: "secretAccessKey", label: { en: "Secret", "zh-CN": "访问密钥" }, secret: true }
|
|
755
|
+
],
|
|
756
|
+
key: (options) => `${S3Util.bucketUrl(options)}|${S3Util.prefix(options)}`,
|
|
757
|
+
where: (options) => {
|
|
758
|
+
const bucket = StoreUtil.text(options.bucket);
|
|
759
|
+
const prefix = S3Util.prefix(options);
|
|
760
|
+
const endpoint = StoreUtil.text(options.endpoint).replace(/^https?:\/\//i, "").replace(/\/.*$/, "");
|
|
761
|
+
return `${bucket}${prefix ? `/${prefix}` : ""} · ${endpoint || "AWS"}`;
|
|
762
|
+
},
|
|
763
|
+
create: (options) => new S3Store(options)
|
|
764
|
+
};
|
|
765
|
+
function gitType(agentDir) {
|
|
766
|
+
const key = (options) => `${GitUtil.url(options.url)}#${GitUtil.branch(options)}|${GitUtil.folder(options)}`;
|
|
767
|
+
return {
|
|
768
|
+
title: { en: "Git", "zh-CN": "Git" },
|
|
769
|
+
hint: {
|
|
770
|
+
en: "GitHub, GitLab, Gitee, Gitea: a private repository of yours, and a token that may push to it; an SSH address needs no token, it uses the keys of this computer. Needs git installed.",
|
|
771
|
+
"zh-CN": "GitHub、GitLab、Gitee、Gitea:你的一个私有仓库,以及能推送到它的令牌;用 SSH 地址时不用令牌,用本机的密钥。需要本机装有 git。"
|
|
772
|
+
},
|
|
773
|
+
icon: "GitBranch",
|
|
774
|
+
options: [
|
|
775
|
+
{ key: "url", label: { en: "Repository", "zh-CN": "仓库地址" }, placeholder: "https://github.com/you/ta-sync.git" },
|
|
776
|
+
{ key: "branch", label: { en: "Branch", "zh-CN": "分支" }, placeholder: "main", optional: true },
|
|
777
|
+
{ key: "folder", label: { en: "Folder in it", "zh-CN": "仓库内文件夹" }, placeholder: "ta", optional: true },
|
|
778
|
+
{ key: "user", label: { en: "User", "zh-CN": "用户名" }, optional: true },
|
|
779
|
+
{ key: "token", label: { en: "Token", "zh-CN": "访问令牌" }, secret: true, optional: true }
|
|
780
|
+
],
|
|
781
|
+
key,
|
|
782
|
+
where: (options) => {
|
|
783
|
+
try {
|
|
784
|
+
return GitUtil.where(options);
|
|
785
|
+
} catch {
|
|
786
|
+
return StoreUtil.text(options.url);
|
|
787
|
+
}
|
|
788
|
+
},
|
|
789
|
+
create: (options) => new GitStore(options, join2(agentDir, "sync", "git", createHash2("sha256").update(key(options)).digest("hex").slice(0, 16)))
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
function activate(host) {
|
|
793
|
+
if (typeof host.relays?.registerType !== "function") {
|
|
794
|
+
return {};
|
|
795
|
+
}
|
|
796
|
+
const stops = [host.relays.registerType("webdav", WEBDAV), host.relays.registerType("s3", S3), host.relays.registerType("git", gitType(host.agentDir))];
|
|
797
|
+
return {
|
|
798
|
+
dispose: () => {
|
|
799
|
+
for (const stop of stops) {
|
|
800
|
+
stop();
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
export {
|
|
806
|
+
gitType,
|
|
807
|
+
activate as default,
|
|
808
|
+
WEBDAV,
|
|
809
|
+
S3
|
|
810
|
+
};
|