lody 0.114.1 → 0.115.1
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.md +2 -0
- package/dist/{session-access-DBWXcozo.js → access-Sut1_1-c.js} +263 -130
- package/dist/{acp-http-proxy-CEqdfPIb.js → acp-http-proxy-BeNRWwOZ.js} +2 -2
- package/dist/{acp-interaction-owner-C9DnwDek.js → acp-interaction-owner-C9StwzDm.js} +14 -13
- package/dist/{agent-execution-KNblr7op.js → agent-execution-D1-dEIN6.js} +5 -5
- package/dist/{analytics-events-DgubpwYf.js → analytics-events-DGIORHJT.js} +2 -2
- package/dist/{app-DO6nxrTQ.js → app-DybCBRpG.js} +15 -14
- package/dist/{auth-BzBqWcHJ.js → auth-CxHKHxDT.js} +2 -2
- package/dist/{automation-CaVyvwqU.js → automation-BbL6PGrs.js} +15 -14
- package/dist/chunks/{vendor-loro-repo-KiPOxZ47.js → vendor-loro-repo-B1zdQ8Qd.js} +3 -2
- package/dist/chunks/{vendor-undici-D9lUGEXQ.js → vendor-undici-Cm00wA7x.js} +3 -2
- package/dist/chunks/{vendor-undici-Dkj-EYtJ.js → vendor-undici-aSjjVk9-.js} +4 -3
- package/dist/claude-acp.js +3 -2
- package/dist/{cli-presence-application-BPo9zPWo.js → cli-presence-application-CY-gZ1oV.js} +7 -6
- package/dist/{client-CG7iYu4O.js → client-CwiNAaqh.js} +14 -13
- package/dist/codex-acp.js +3 -2
- package/dist/{command-runtime-CU9xs2mb.js → command-runtime-DPLzRrVX.js} +283 -153
- package/dist/{control-IZGSPxqh.js → control-CjCKRghv.js} +18 -17
- package/dist/{fs-atomic-sI-5rfuh.js → cross-workspace-2kVoqI7D.js} +67 -7
- package/dist/{daemon-ChBsVK29.js → daemon-CmTF75AJ.js} +11 -10
- package/dist/{daemon-runner-Czhapxd-.js → daemon-runner-BdNyXd7w.js} +9 -8
- package/dist/{daemon-session-tools-BkNAXJte.js → daemon-session-tools-DDJ0ZkgG.js} +25 -24
- package/dist/{daemon-shared-lCH0JHQD.js → daemon-shared-NcwWGSEj.js} +2 -2
- package/dist/{device-preview-rocdCptj.js → device-preview-BjqAbZ9g.js} +50 -25
- package/dist/devin-acp.js +3 -2
- package/dist/{discovery-query-hcHHutEn.js → discovery-query-C_7lyBI8.js} +2 -2
- package/dist/{dsh-BBMJN1_w.js → dsh-DCn2Ulq7.js} +5 -5
- package/dist/{dsh-plugins-DyDJ4nyX.js → dsh-plugins--w3O3Cm-.js} +5 -4
- package/dist/{e2ee-Rp-kqqRV.js → e2ee-DqyknB-N.js} +2 -2
- package/dist/{e2ee-execution-intent-kcGw6188.js → e2ee-execution-intent-DYBEG410.js} +4 -4
- package/dist/{export-CW3tgEh5.js → export-B0A0f1n5.js} +19 -18
- package/dist/{feedback-wAp0AIne.js → feedback-Bf4WcwtG.js} +2 -2
- package/dist/{feedback-DXHiE_SV.js → feedback-CTLrPxfa.js} +15 -14
- package/dist/{github-Ds3oR20B.js → github-BoJLPXg6.js} +14 -13
- package/dist/grok-acp.js +3 -2
- package/dist/{http-transport-DDAJ_zUL.js → http-transport-BooHDDeW.js} +3 -3
- package/dist/{index-Z-zMjsvr.js → index-37XwBsdD.js} +629 -731
- package/dist/{index-BR78_63y.js → index-BTgKuz44.js} +7 -7
- package/dist/{index-DNfm72S8.js → index-Cv0X-m7e.js} +20 -19
- package/dist/{index-cUL6BMen.js → index-HbTq3Nar.js} +15 -14
- package/dist/{index-vrW0djgm.js → index-_zr02om2.js} +29 -28
- package/dist/index.js +7 -6
- package/dist/{internal-BlRJVTRc.js → internal-iqLidMef.js} +25 -24
- package/dist/{local-ipc-BQZPuSjl.js → local-ipc-B8vySppK.js} +12 -3
- package/dist/{local-project-control-client-vC7RtUIF.js → local-project-control-client-DCRW0hsE.js} +3 -3
- package/dist/{lody-mcp-http-protocol-d_6zEbk9.js → lody-mcp-http-protocol-DBLKn7SZ.js} +4 -4
- package/dist/{lody-mcp-server-DOkbYw6c.js → lody-mcp-server-BkbuBj2a.js} +22 -19
- package/dist/{login-Nwpcfzb7.js → login-DN7qq61J.js} +7 -6
- package/dist/{login-shell-env-DiOZ-bog.js → login-shell-env-BUnglQb8.js} +2 -2
- package/dist/{logout-C13Nc5pT.js → logout-BVCa6yvW.js} +7 -6
- package/dist/{machine-DJ0Pn0js.js → machine-BuRCztBz.js} +23 -22
- package/dist/{machine-protocol-capabilities-LN7bzFSN.js → machine-protocol-capabilities-DEhAj9SH.js} +80 -77
- package/dist/{mcp-z0JBqqIQ.js → mcp-DDTy-1He.js} +20 -19
- package/dist/{migrate-DxEEhXQ9.js → migrate-CeZ3FAo1.js} +231 -73
- package/dist/{operation-CuFKC3x2.js → operation-c5nZQaoi.js} +16 -15
- package/dist/{operation-store-D1TdJgBc.js → operation-store-rllAX2mr.js} +3 -3
- package/dist/{presence-BGW-7JQJ.js → presence-CZco7UQH.js} +4 -4
- package/dist/{presence-legacy-BI0h0kBA.js → presence-legacy-1c8FbspQ.js} +3 -3
- package/dist/{project-BPuPcKZT.js → project-AnFPgvxa.js} +21 -20
- package/dist/{register-hqq68K_S.js → register-CzsBj61f.js} +26 -26
- package/dist/{remote-pairing-BixLRGZN.js → remote-pairing-902c7Lc2.js} +19 -18
- package/dist/{reset-identity-Arhv456z.js → reset-identity-H49O09ak.js} +19 -18
- package/dist/{review-DDMytOEX.js → review-DMhUT4ss.js} +2 -2
- package/dist/{review-viewer-CkjhHGL8.js → review-viewer-CtbOWnpA.js} +3 -3
- package/dist/{schedule-C2ooWjeY.js → schedule-DUydtd6X.js} +20 -19
- package/dist/{schedule-command-client-Dp2K-GDf.js → schedule-command-client-BAM4vGB1.js} +19 -18
- package/dist/{schedule-command-service-D7OwaAhZ.js → schedule-command-service-Dbm7dPmk.js} +20 -19
- package/dist/{schedule-documents-7GqM7IcI.js → schedule-documents-tN5e545R.js} +3 -3
- package/dist/{schedule-recurrence-CGZIb0Pu.js → schedule-recurrence-BVxMRfp4.js} +3 -3
- package/dist/{schedule-repository-D8Ui2jvb.js → schedule-repository-dz9iwR0x.js} +3 -3
- package/dist/{schedule-run-preparation-BEKS3RjW.js → schedule-run-preparation-Ov7uQi4c.js} +5 -5
- package/dist/{schedule-types-DTul4K9c.js → schedule-types-BquxGfza.js} +537 -391
- package/dist/{service-CTj21Cv2.js → service-BU6NY-d_.js} +4 -58
- package/dist/{session-p5D9mnGA.js → session-C59Ymj52.js} +170 -39
- package/dist/{session-file-blob-store-bjZk_Pby.js → session-file-blob-store-CBHDgf4e.js} +2 -2
- package/dist/{session-image-download-Bz47jmHy.js → session-image-download-DUwc2Fb4.js} +3 -3
- package/dist/{session-input-Bm4DZ_ah.js → session-input-MeZheBJ0.js} +2 -2
- package/dist/{session-link-CZ1z8J8d.js → session-link-demCF_Y_.js} +2 -2
- package/dist/{session-link-export-CF0aLI3O.js → session-link-export-BM1zZQRs.js} +3 -3
- package/dist/{session-operation-targets-yk7bQTAn.js → session-operation-targets-lq3rsTnV.js} +3 -3
- package/dist/{setting-CO0xphaD.js → setting-C2ZA33mw.js} +8 -6
- package/dist/{start-DjcjoPvR.js → start-DSTSWWdZ.js} +391 -142
- package/dist/{sync-CUa0QP_M.js → sync-wxZ8lAMt.js} +15 -14
- package/dist/{workspace-DA-wPD10.js → workspace-B7Ta4ZRU.js} +17 -16
- package/dist/{workspace-legacy-UCwDS1Zb.js → workspace-legacy-BDeOVRwz.js} +184 -66
- package/package.json +1 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { C as Command } from "./chunks/vendor-commander-BkZcYyor.js";
|
|
2
|
-
import { d as discoveryListCommand, s as syncMcpCatalog, l as listWorkspaceMcpCatalog, u as upsertWorkspaceMcpCatalogEntry, b as deleteWorkspaceMcpCatalogEntry, p as parseEnvAssignments } from "./session-
|
|
2
|
+
import { d as discoveryListCommand, s as syncMcpCatalog, l as listWorkspaceMcpCatalog, u as upsertWorkspaceMcpCatalogEntry, b as deleteWorkspaceMcpCatalogEntry, p as parseEnvAssignments } from "./session-C59Ymj52.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
|
-
import { a6 as runOneShotCommand, a9 as getAuthContextOrThrow, ab as resolveWorkspaceOrThrow, ac as withWorkspaceManager, af as normalizeCliValue, a7 as printJson } from "./command-runtime-
|
|
4
|
+
import { a6 as runOneShotCommand, a9 as getAuthContextOrThrow, ab as resolveWorkspaceOrThrow, ac as withWorkspaceManager, af as normalizeCliValue, a7 as printJson } from "./command-runtime-DPLzRrVX.js";
|
|
5
5
|
import { f as formatErrorMessage } from "./logger-C-G7jpWR.js";
|
|
6
|
-
import { c as captureCli } from "./login-shell-env-
|
|
6
|
+
import { c as captureCli } from "./login-shell-env-BUnglQb8.js";
|
|
7
7
|
import { v as v4 } from "./chunks/vendor-uuid-ZvTlSCzA.js";
|
|
8
8
|
import { g as getServerNow } from "./time-sync-D63wG9u-.js";
|
|
9
|
-
import { E as ENV_VAR_NAME_PATTERN } from "./schedule-types-
|
|
9
|
+
import { E as ENV_VAR_NAME_PATTERN } from "./schedule-types-BquxGfza.js";
|
|
10
10
|
import "node:events";
|
|
11
11
|
import "node:child_process";
|
|
12
12
|
import "node:path";
|
|
13
13
|
import "node:fs";
|
|
14
14
|
import "node:process";
|
|
15
15
|
import "./chunks/commonjs-helpers-CCIqAdii.js";
|
|
16
|
-
import "./
|
|
17
|
-
import "./local-ipc-
|
|
16
|
+
import "./access-Sut1_1-c.js";
|
|
17
|
+
import "./local-ipc-B8vySppK.js";
|
|
18
18
|
import "./chunks/vendor-zod-DAcQjQuC.js";
|
|
19
19
|
import "node:crypto";
|
|
20
20
|
import "./rpc-secret-CPdan_XW.js";
|
|
@@ -29,22 +29,22 @@ import "./chunks/vendor-effect-CNM-5PoN.js";
|
|
|
29
29
|
import "./magpie-import-IrqfCF6i.js";
|
|
30
30
|
import "./capabilities-CNX3VCPQ.js";
|
|
31
31
|
import "./chunks/vendor-immer-F2vkwr8n.js";
|
|
32
|
-
import "./chunks/vendor-loro-repo-
|
|
32
|
+
import "./chunks/vendor-loro-repo-B1zdQ8Qd.js";
|
|
33
33
|
import "./chunks/vendor-@loro-dev-flock-wasm-BH1ts_Xn.js";
|
|
34
34
|
import "./chunks/vendor-loro-crdt-2CFvB1HS.js";
|
|
35
35
|
import "better-sqlite3";
|
|
36
36
|
import "./chunks/vendor-@loro-dev-streams-crdt-BOuVa3yO.js";
|
|
37
37
|
import "./chunks/vendor-@loro-dev-streams-client-DPTfaXHE.js";
|
|
38
38
|
import "node:fs/promises";
|
|
39
|
-
import "./session-file-blob-store-
|
|
39
|
+
import "./session-file-blob-store-CBHDgf4e.js";
|
|
40
40
|
import "os";
|
|
41
41
|
import "fs";
|
|
42
42
|
import "path";
|
|
43
|
-
import "./discovery-query-
|
|
44
|
-
import "./presence-
|
|
43
|
+
import "./discovery-query-C_7lyBI8.js";
|
|
44
|
+
import "./presence-CZco7UQH.js";
|
|
45
45
|
import "./chunks/vendor-croner-B5ClZHUj.js";
|
|
46
|
-
import "./auth-
|
|
47
|
-
import "./http-transport-
|
|
46
|
+
import "./auth-CxHKHxDT.js";
|
|
47
|
+
import "./http-transport-BooHDDeW.js";
|
|
48
48
|
import "./process-DrX1wZZk.js";
|
|
49
49
|
import "node:url";
|
|
50
50
|
import "./chunks/vendor-cross-spawn-DYIHnyej.js";
|
|
@@ -73,12 +73,13 @@ import "util";
|
|
|
73
73
|
import "node:zlib";
|
|
74
74
|
import "node:readline";
|
|
75
75
|
import "node:diagnostics_channel";
|
|
76
|
-
import "./chunks/vendor-undici-
|
|
76
|
+
import "./chunks/vendor-undici-Cm00wA7x.js";
|
|
77
77
|
import "node:assert";
|
|
78
78
|
import "node:querystring";
|
|
79
79
|
import "node:perf_hooks";
|
|
80
80
|
import "node:util/types";
|
|
81
81
|
import "node:worker_threads";
|
|
82
|
+
import "node:http2";
|
|
82
83
|
import "node:async_hooks";
|
|
83
84
|
import "node:console";
|
|
84
85
|
import "node:dns";
|
|
@@ -127,15 +128,15 @@ import "./chunks/vendor-@colors-colors-7IEFuFeu.js";
|
|
|
127
128
|
import "./cli-platform-Cfc6A61f.js";
|
|
128
129
|
import "fs/promises";
|
|
129
130
|
import "./capabilities-Btwk4R--.js";
|
|
130
|
-
import "./machine-protocol-capabilities-
|
|
131
|
-
import "./analytics-events-
|
|
132
|
-
import "./session-input-
|
|
133
|
-
import "./session-operation-targets-
|
|
131
|
+
import "./machine-protocol-capabilities-DEhAj9SH.js";
|
|
132
|
+
import "./analytics-events-DGIORHJT.js";
|
|
133
|
+
import "./session-input-MeZheBJ0.js";
|
|
134
|
+
import "./session-operation-targets-lq3rsTnV.js";
|
|
134
135
|
import "./bounded-concurrency-JZXr8Xjv.js";
|
|
135
136
|
import "./chunks/vendor-loro-mirror-kwb2EtZx.js";
|
|
136
137
|
import "perf_hooks";
|
|
137
138
|
import "./chunks/vendor-ws-D1QOrWHI.js";
|
|
138
|
-
import "./presence-legacy-
|
|
139
|
+
import "./presence-legacy-1c8FbspQ.js";
|
|
139
140
|
import "./daemon-update-qOLnkZcv.js";
|
|
140
141
|
import "./chunks/vendor-convex-wRAQitRr.js";
|
|
141
142
|
import "module";
|
|
@@ -406,4 +407,4 @@ const mcpCommand = new Command("mcp").description("Manage workspace MCP servers"
|
|
|
406
407
|
export {
|
|
407
408
|
mcpCommand
|
|
408
409
|
};
|
|
409
|
-
//# sourceMappingURL=mcp-
|
|
410
|
+
//# sourceMappingURL=mcp-DDTy-1He.js.map
|
|
@@ -7,23 +7,23 @@ import inquirer from "./chunks/vendor-inquirer-CDSL6r3k.js";
|
|
|
7
7
|
import { a as getInstallationProfile, g as getLodyDataDir } from "./installation-profile-BgCqPyUj.js";
|
|
8
8
|
import { a as acquireLocalCliHostLease, g as getLocalCliHostEndpoint } from "./local-cli-host-lease-Chm4-jV0.js";
|
|
9
9
|
import { g as getCliPlatformKind, f as fileLocksLegacy } from "./cli-platform-Cfc6A61f.js";
|
|
10
|
-
import { A as AuthClient, c as performLogin } from "./auth-
|
|
11
|
-
import { c6 as
|
|
10
|
+
import { A as AuthClient, c as performLogin } from "./auth-CxHKHxDT.js";
|
|
11
|
+
import { c6 as requirePlaintextWorkspaceStreamsContent, c7 as prepareCliStreamsGatewayBaseUrl, c8 as encryptedWorkspaceNamespace, c9 as streamsSnapshotCodec, a6 as runOneShotCommand, a9 as getAuthContextOrThrow, aa as listWorkspacesForToken, ca as selectWorkspaceSummary, cb as assertRetainedE2eeModeAllowsOpen, cc as registerMachineAccessForCliToken, cd as createCloudE2eePort, ce as describeEncryptedCommandFailure, cf as createCloudStreamsTokenPort, cg as SessionAttachmentTransfer } from "./command-runtime-DPLzRrVX.js";
|
|
12
12
|
import { g as getLogger } from "./logger-C-G7jpWR.js";
|
|
13
13
|
import { L as LODY_AUTH_URL, d as LODY_SERVER_URL, a as LODY_AUTH_SITE_URL } from "./const-LYLptZ7f.js";
|
|
14
14
|
import { L as LoroDoc } from "./chunks/vendor-loro-crdt-2CFvB1HS.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { s as sessionImportFence, a as scheduleImportFence, c as createSessionMirror, b as atomicJson } from "./cross-workspace-2kVoqI7D.js";
|
|
16
|
+
import { c as string, r as record, B as json, o as object, e as array, a as literal, u as union, n as number, f as _enum, d as boolean } from "./chunks/vendor-zod-DAcQjQuC.js";
|
|
17
|
+
import { D as isSessionDocRoomId, m as getMachineRoomId, E as parseTodayDocId, F as getTodayDocId, z as buildScheduleRegistryRow, f as LORO_STREAMS_BUCKET_ID, G as getLoroStreamsShardUrls, H as getLoroStreamIdForDocId, h as getLoroMetaStreamId, d as createLoroStreamUrl, x as createLoroStreamsTokenProviderLegacy } from "./presence-CZco7UQH.js";
|
|
17
18
|
import { constants } from "node:fs";
|
|
18
19
|
import Database from "better-sqlite3";
|
|
19
|
-
import { S as SqliteRepoStore, L as LoroRepo } from "./chunks/vendor-loro-repo-
|
|
20
|
-
import { c as createSessionMirror, a as atomicJson } from "./fs-atomic-sI-5rfuh.js";
|
|
20
|
+
import { S as SqliteRepoStore, L as LoroRepo, e as encodeStreamsRoomAdditionalData } from "./chunks/vendor-loro-repo-B1zdQ8Qd.js";
|
|
21
21
|
import { a as SESSION_FILE_MAX_SIZE_BYTES } from "./magpie-import-IrqfCF6i.js";
|
|
22
|
-
import { I as ScheduleDefinitionSchema } from "./schedule-types-
|
|
22
|
+
import { n as assertEncryptedAttachmentReference, I as ScheduleDefinitionSchema } from "./schedule-types-BquxGfza.js";
|
|
23
|
+
import { F as Flock } from "./chunks/vendor-@loro-dev-flock-wasm-BH1ts_Xn.js";
|
|
23
24
|
import { c as createLoroDocAdapter, a as createFlockAdapter, S as StreamsCrdt } from "./chunks/vendor-@loro-dev-streams-crdt-BOuVa3yO.js";
|
|
24
25
|
import { S as StreamsClient } from "./chunks/vendor-@loro-dev-streams-client-DPTfaXHE.js";
|
|
25
|
-
import {
|
|
26
|
-
import { av as TaggedError, aw as Service, cW as fn, c as callback, s as succeed, j as fail, aG as promise, d2 as timeout, E as orDie, C as acquireRelease, b as flatMap, a_ as provideService, cl as scoped, cd as runPromiseExit, ad as isFailure, bM as squash, a2 as gen, d as sync, de as Effect } from "./chunks/vendor-effect-CNM-5PoN.js";
|
|
26
|
+
import { av as TaggedError, aw as Service, cW as fn, c as callback, s as succeed, j as fail, aG as promise, d2 as timeout, E as orDie, a2 as gen, C as acquireRelease, b as flatMap, a_ as provideService, cl as scoped, cd as runPromiseExit, ad as isFailure, bM as squash, d as sync, de as Effect } from "./chunks/vendor-effect-CNM-5PoN.js";
|
|
27
27
|
import "node:events";
|
|
28
28
|
import "node:child_process";
|
|
29
29
|
import "node:process";
|
|
@@ -100,9 +100,9 @@ import "node:zlib";
|
|
|
100
100
|
import "fs/promises";
|
|
101
101
|
import "./capabilities-Btwk4R--.js";
|
|
102
102
|
import "./time-sync-D63wG9u-.js";
|
|
103
|
-
import "./http-transport-
|
|
103
|
+
import "./http-transport-BooHDDeW.js";
|
|
104
104
|
import "node:diagnostics_channel";
|
|
105
|
-
import "./chunks/vendor-undici-
|
|
105
|
+
import "./chunks/vendor-undici-Cm00wA7x.js";
|
|
106
106
|
import "node:assert";
|
|
107
107
|
import "node:http";
|
|
108
108
|
import "node:util";
|
|
@@ -110,6 +110,7 @@ import "node:querystring";
|
|
|
110
110
|
import "node:perf_hooks";
|
|
111
111
|
import "node:util/types";
|
|
112
112
|
import "node:worker_threads";
|
|
113
|
+
import "node:http2";
|
|
113
114
|
import "node:console";
|
|
114
115
|
import "node:dns";
|
|
115
116
|
import "./chunks/vendor-https-proxy-agent-BQxHfk42.js";
|
|
@@ -141,27 +142,27 @@ import "./chunks/vendor-@better-fetch-fetch-Cuh8CnyA.js";
|
|
|
141
142
|
import "./chunks/vendor-@better-auth-api-key-D0bKvhcn.js";
|
|
142
143
|
import "./chunks/vendor-@convex-dev-better-auth-DvFvwHmk.js";
|
|
143
144
|
import "./convex-site-url-Ca_MfzFd.js";
|
|
144
|
-
import "./login-shell-env-
|
|
145
|
+
import "./login-shell-env-BUnglQb8.js";
|
|
145
146
|
import "./chunks/vendor-posthog-node-CwZyUQxO.js";
|
|
146
147
|
import "./chunks/vendor-@posthog-core-BB1ZGy3x.js";
|
|
147
|
-
import "./local-ipc-
|
|
148
|
+
import "./local-ipc-B8vySppK.js";
|
|
148
149
|
import "./rpc-secret-CPdan_XW.js";
|
|
149
150
|
import "node:string_decoder";
|
|
150
151
|
import "./code-collab-Cgso3Ix3.js";
|
|
151
152
|
import "./project-path-CAQE9bes.js";
|
|
152
153
|
import "./ios-simulator-BduF_qia.js";
|
|
153
|
-
import "./
|
|
154
|
+
import "./access-Sut1_1-c.js";
|
|
154
155
|
import "./chunks/vendor-immer-F2vkwr8n.js";
|
|
155
156
|
import "./chunks/vendor-loro-mirror-kwb2EtZx.js";
|
|
156
157
|
import "perf_hooks";
|
|
157
158
|
import "./chunks/vendor-ws-D1QOrWHI.js";
|
|
158
|
-
import "./presence-legacy-
|
|
159
|
+
import "./presence-legacy-1c8FbspQ.js";
|
|
159
160
|
import "./chunks/vendor-uuid-ZvTlSCzA.js";
|
|
160
161
|
import "./chunks/vendor-convex-wRAQitRr.js";
|
|
161
162
|
import "module";
|
|
162
163
|
import "./runtime-artifacts-CjowfwNS.js";
|
|
163
164
|
import "./github-credential-runtime-Vuv6HxRs.js";
|
|
164
|
-
import "./machine-protocol-capabilities-
|
|
165
|
+
import "./machine-protocol-capabilities-DEhAj9SH.js";
|
|
165
166
|
import "./chunks/vendor-winston-LrGS-jQo.js";
|
|
166
167
|
import "./chunks/vendor-logform-BH1Pfpxu.js";
|
|
167
168
|
import "./chunks/vendor-@colors-colors-7IEFuFeu.js";
|
|
@@ -214,6 +215,8 @@ const manifestSchema = object({
|
|
|
214
215
|
sourceUserId: string().startsWith("local:"),
|
|
215
216
|
sourceName: string(),
|
|
216
217
|
targetWorkspaceId: safeId,
|
|
218
|
+
targetContentMode: _enum(["plaintext", "protected"]).default("plaintext"),
|
|
219
|
+
targetGenesisHash: string().regex(/^[0-9a-f]{64}$/).optional(),
|
|
217
220
|
targetMachineId: safeId,
|
|
218
221
|
targetUserId: string(),
|
|
219
222
|
deployment: string(),
|
|
@@ -222,6 +225,13 @@ const manifestSchema = object({
|
|
|
222
225
|
flocks: array(object({ id: string(), rows: array(rowSchema) })),
|
|
223
226
|
machineMeta: jsonObject,
|
|
224
227
|
createdAt: string()
|
|
228
|
+
}).superRefine((manifest, context) => {
|
|
229
|
+
if (manifest.targetContentMode === "protected" && !manifest.targetGenesisHash)
|
|
230
|
+
context.addIssue({
|
|
231
|
+
code: "custom",
|
|
232
|
+
path: ["targetGenesisHash"],
|
|
233
|
+
message: "Encrypted migration requires the pinned target genesis"
|
|
234
|
+
});
|
|
225
235
|
});
|
|
226
236
|
const journalSchema = object({
|
|
227
237
|
version: literal(2),
|
|
@@ -265,6 +275,15 @@ function prepareDocument(bytes, entry, manifest) {
|
|
|
265
275
|
const doc = new LoroDoc();
|
|
266
276
|
doc.import(bytes);
|
|
267
277
|
if (doc.isShallow()) throw new Error(`Cannot migrate shallow history: ${entry.id}`);
|
|
278
|
+
if (manifest.targetContentMode === "protected") {
|
|
279
|
+
const fence = isSessionDocRoomId(entry.id) ? sessionImportFence(
|
|
280
|
+
doc,
|
|
281
|
+
(field) => entry.meta[field],
|
|
282
|
+
manifest.targetWorkspaceId,
|
|
283
|
+
manifest.targetUserId
|
|
284
|
+
) : entry.id.startsWith("schedule-") ? scheduleImportFence(doc, manifest.targetWorkspaceId) : void 0;
|
|
285
|
+
if (fence) doc.getMap(receiptRoot).set("importFence", fence);
|
|
286
|
+
}
|
|
268
287
|
if (isSessionDocRoomId(entry.id)) {
|
|
269
288
|
if (entry.meta.historyBackend && entry.meta.historyBackend !== "loro")
|
|
270
289
|
throw new Error(
|
|
@@ -455,6 +474,8 @@ async function validateAttachments(doc, sessionId, directory, sourceMachineId) {
|
|
|
455
474
|
);
|
|
456
475
|
}
|
|
457
476
|
async function migrateAttachments(doc, sessionId, directory, manifest, journal, transfer, signal) {
|
|
477
|
+
if (manifest.targetContentMode === "protected" && transfer.contentMode !== "protected")
|
|
478
|
+
throw new Error("E2EE migration requires a protected attachment transfer before upload");
|
|
458
479
|
const mirror = createSessionMirror({ doc, initialState: {} });
|
|
459
480
|
try {
|
|
460
481
|
const history = mirror.historyWriter.readStored();
|
|
@@ -466,6 +487,8 @@ async function migrateAttachments(doc, sessionId, directory, manifest, journal,
|
|
|
466
487
|
if (receipt) {
|
|
467
488
|
if (receipt.sha256 !== file.sha256 || receipt.sizeBytes !== file.sizeBytes)
|
|
468
489
|
throw new Error("Attachment receipt does not match frozen history");
|
|
490
|
+
if (manifest.targetContentMode === "protected")
|
|
491
|
+
assertEncryptedAttachmentReference("file", String(receipt.fileId), receipt.encryption);
|
|
469
492
|
continue;
|
|
470
493
|
}
|
|
471
494
|
const absolutePath = path__default.join(directory, "blobs", key);
|
|
@@ -486,7 +509,10 @@ async function migrateAttachments(doc, sessionId, directory, manifest, journal,
|
|
|
486
509
|
if (uploaded.sha256 !== file.sha256 || uploaded.sizeBytes !== file.sizeBytes) {
|
|
487
510
|
throw new Error("Uploaded attachment integrity metadata does not match the frozen source");
|
|
488
511
|
}
|
|
512
|
+
if (manifest.targetContentMode === "protected")
|
|
513
|
+
assertEncryptedAttachmentReference("file", uploaded.fileId, uploaded.encryption);
|
|
489
514
|
journal.attachments[key] = {
|
|
515
|
+
...uploaded.encryption ? { encryption: uploaded.encryption } : {},
|
|
490
516
|
fileId: uploaded.fileId,
|
|
491
517
|
sha256: file.sha256,
|
|
492
518
|
sizeBytes: file.sizeBytes
|
|
@@ -506,6 +532,7 @@ async function migrateAttachments(doc, sessionId, directory, manifest, journal,
|
|
|
506
532
|
...original,
|
|
507
533
|
fileId: receipt.fileId,
|
|
508
534
|
transport: "r2",
|
|
535
|
+
...receipt.encryption ? { encryption: receipt.encryption } : {},
|
|
509
536
|
storageSessionId: file.storageSessionId ?? sessionId
|
|
510
537
|
}
|
|
511
538
|
});
|
|
@@ -516,7 +543,13 @@ async function migrateAttachments(doc, sessionId, directory, manifest, journal,
|
|
|
516
543
|
const uploaded = journal.attachments[attachmentKey(file, sessionId)];
|
|
517
544
|
if (!uploaded || typeof uploaded.fileId !== "string")
|
|
518
545
|
throw new Error("Missing uploaded attachment receipt");
|
|
519
|
-
const result = {
|
|
546
|
+
const result = {
|
|
547
|
+
...item,
|
|
548
|
+
fileId: uploaded.fileId,
|
|
549
|
+
transport: "r2",
|
|
550
|
+
machineId: void 0,
|
|
551
|
+
...uploaded.encryption ? { encryption: uploaded.encryption } : {}
|
|
552
|
+
};
|
|
520
553
|
delete result.machineId;
|
|
521
554
|
return result;
|
|
522
555
|
};
|
|
@@ -755,14 +788,91 @@ function checkMeta(meta, entry, manifest) {
|
|
|
755
788
|
if (existence !== void 0 && owner !== manifest.migrationId)
|
|
756
789
|
throw new Error(`Document ID collision: ${entry.id}. Existing cloud data is unchanged.`);
|
|
757
790
|
}
|
|
758
|
-
async function openMigrationTarget(provider, workspaceId, content) {
|
|
759
|
-
if (content
|
|
760
|
-
|
|
761
|
-
|
|
791
|
+
async function openMigrationTarget(provider, workspaceId, content, protectedTarget) {
|
|
792
|
+
if (content.mode === "protected") {
|
|
793
|
+
if (!protectedTarget)
|
|
794
|
+
throw new Error("E2EE migration requires an approved paired CLI machine.");
|
|
795
|
+
await protectedTarget.authorize();
|
|
796
|
+
} else requirePlaintextWorkspaceStreamsContent(content);
|
|
762
797
|
const baseUrl = await prepareCliStreamsGatewayBaseUrl(provider);
|
|
798
|
+
const bucketId = content.mode === "protected" ? protectedTarget?.bucketId() : LORO_STREAMS_BUCKET_ID;
|
|
799
|
+
if (!bucketId || content.mode === "protected" && bucketId === LORO_STREAMS_BUCKET_ID)
|
|
800
|
+
throw new Error("E2EE content bucket is unavailable");
|
|
763
801
|
const lifetime = new AbortController();
|
|
764
802
|
const streams = /* @__PURE__ */ new Set();
|
|
765
|
-
const urlFor = (id) => createLoroStreamUrl({ baseUrl, bucketId
|
|
803
|
+
const urlFor = (id) => createLoroStreamUrl({ baseUrl, bucketId, streamId: id });
|
|
804
|
+
const rooms = /* @__PURE__ */ new Map([
|
|
805
|
+
[getLoroMetaStreamId(workspaceId), { kind: "meta" }]
|
|
806
|
+
]);
|
|
807
|
+
const documentStreamId = (entry) => {
|
|
808
|
+
const id = getLoroStreamIdForDocId(workspaceId, entry.id);
|
|
809
|
+
rooms.set(id, { kind: "doc", docId: entry.id });
|
|
810
|
+
return id;
|
|
811
|
+
};
|
|
812
|
+
const protectionFor = (id) => {
|
|
813
|
+
if (content.mode !== "protected") return void 0;
|
|
814
|
+
const room = rooms.get(id) ?? { kind: "flock", flockDocId: id };
|
|
815
|
+
const selected = content.resolve(room);
|
|
816
|
+
if (selected.mode !== "protected") throw new Error("E2EE migration room must be protected");
|
|
817
|
+
const provider2 = selected.config.provider;
|
|
818
|
+
return {
|
|
819
|
+
readPolicy: "encrypted-only",
|
|
820
|
+
writePolicy: "encrypt",
|
|
821
|
+
provider: {
|
|
822
|
+
maxSealOverheadBytes: provider2.maxSealOverheadBytes,
|
|
823
|
+
seal: (input) => provider2.seal({
|
|
824
|
+
...input,
|
|
825
|
+
additionalData: (header) => encodeStreamsRoomAdditionalData(
|
|
826
|
+
content.namespace,
|
|
827
|
+
room,
|
|
828
|
+
input.additionalData(header)
|
|
829
|
+
)
|
|
830
|
+
}),
|
|
831
|
+
open: (input) => provider2.open({
|
|
832
|
+
...input,
|
|
833
|
+
additionalData: encodeStreamsRoomAdditionalData(
|
|
834
|
+
content.namespace,
|
|
835
|
+
room,
|
|
836
|
+
input.additionalData
|
|
837
|
+
)
|
|
838
|
+
})
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
};
|
|
842
|
+
const writePart = async (id, updates) => {
|
|
843
|
+
if (content.mode !== "protected") return part(updates);
|
|
844
|
+
await protectedTarget?.authorize();
|
|
845
|
+
const provider2 = protectionFor(id)?.provider;
|
|
846
|
+
if (!provider2) throw new Error("E2EE migration protection unavailable");
|
|
847
|
+
let authenticated;
|
|
848
|
+
const sealed = await provider2.seal({
|
|
849
|
+
plaintext: part(updates).body,
|
|
850
|
+
context: {
|
|
851
|
+
protocol: "loro-streams-crdt-payload-protection",
|
|
852
|
+
version: 2,
|
|
853
|
+
kind: "update_batch"
|
|
854
|
+
},
|
|
855
|
+
additionalData: (header) => {
|
|
856
|
+
if (authenticated || !header.length || header.length > 512)
|
|
857
|
+
throw new Error("Invalid protected migration header");
|
|
858
|
+
authenticated = new Uint8Array(10 + header.length);
|
|
859
|
+
authenticated.set([76, 83, 67, 69, 2, 1]);
|
|
860
|
+
new DataView(authenticated.buffer).setUint16(6, header.length, false);
|
|
861
|
+
authenticated.set(header, 10);
|
|
862
|
+
const domain = new TextEncoder().encode("loro-streams-crdt-payload-protection/v2\0");
|
|
863
|
+
const aad = new Uint8Array(domain.length + authenticated.length);
|
|
864
|
+
aad.set(domain);
|
|
865
|
+
aad.set(authenticated, domain.length);
|
|
866
|
+
return aad;
|
|
867
|
+
}
|
|
868
|
+
});
|
|
869
|
+
if (!authenticated || sealed.header.length !== authenticated.length - 10 || !sealed.header.every((byte, index) => authenticated?.[10 + index] === byte) || !sealed.sealed.length || sealed.header.length + sealed.sealed.length - part(updates).body.length > provider2.maxSealOverheadBytes)
|
|
870
|
+
throw new Error("Invalid protected migration envelope");
|
|
871
|
+
const envelope = new Uint8Array(authenticated.length + sealed.sealed.length);
|
|
872
|
+
envelope.set(authenticated);
|
|
873
|
+
envelope.set(sealed.sealed, authenticated.length);
|
|
874
|
+
return part([envelope]);
|
|
875
|
+
};
|
|
766
876
|
const fetchFor = (signal) => (input, init) => fetch(input, {
|
|
767
877
|
...init,
|
|
768
878
|
signal: AbortSignal.any([
|
|
@@ -784,7 +894,10 @@ async function openMigrationTarget(provider, workspaceId, content) {
|
|
|
784
894
|
adapter,
|
|
785
895
|
auth: provider.createAuthCallback(),
|
|
786
896
|
fetch: fetchFor(signal),
|
|
787
|
-
snapshotCodec: streamsSnapshotCodec,
|
|
897
|
+
snapshotCodec: content.mode === "protected" ? content.snapshotCodec ?? streamsSnapshotCodec : streamsSnapshotCodec,
|
|
898
|
+
snapshotUpload: content.mode === "protected" ? content.snapshotUpload : void 0,
|
|
899
|
+
e2ee: protectionFor(id),
|
|
900
|
+
payloadProtectionRequired: content.mode === "protected",
|
|
788
901
|
shardUrls: getLoroStreamsShardUrls(baseUrl, provider.getShardHostSuffix())
|
|
789
902
|
});
|
|
790
903
|
streams.add(stream);
|
|
@@ -815,11 +928,7 @@ async function openMigrationTarget(provider, workspaceId, content) {
|
|
|
815
928
|
};
|
|
816
929
|
const readDoc = async (entry, signal) => {
|
|
817
930
|
const doc = new LoroDoc();
|
|
818
|
-
const cursor = await read(
|
|
819
|
-
getLoroStreamIdForDocId(workspaceId, entry.id),
|
|
820
|
-
createLoroDocAdapter(doc),
|
|
821
|
-
signal
|
|
822
|
-
);
|
|
931
|
+
const cursor = await read(documentStreamId(entry), createLoroDocAdapter(doc), signal);
|
|
823
932
|
return { doc, exists: cursor !== null };
|
|
824
933
|
};
|
|
825
934
|
const transact = async (id, mutate, signal) => {
|
|
@@ -835,12 +944,13 @@ async function openMigrationTarget(provider, workspaceId, content) {
|
|
|
835
944
|
);
|
|
836
945
|
if (!batch?.updates.length) return;
|
|
837
946
|
if (!cursor) {
|
|
838
|
-
if (unwrap(await client(id, signal).create({ part:
|
|
947
|
+
if (unwrap(await client(id, signal).create({ part: await writePart(id, batch.updates) })).created)
|
|
948
|
+
return;
|
|
839
949
|
} else {
|
|
840
950
|
const result = unwrap(
|
|
841
951
|
await client(id, signal).appendCas({
|
|
842
952
|
expectedOffset: cursor.nextOffset,
|
|
843
|
-
part:
|
|
953
|
+
part: await writePart(id, batch.updates)
|
|
844
954
|
})
|
|
845
955
|
);
|
|
846
956
|
if (result.kind === "ok") return;
|
|
@@ -850,6 +960,19 @@ async function openMigrationTarget(provider, workspaceId, content) {
|
|
|
850
960
|
};
|
|
851
961
|
return {
|
|
852
962
|
async preflight(manifest, _reserved, signal) {
|
|
963
|
+
if (manifest.targetContentMode !== content.mode)
|
|
964
|
+
throw new Error("Migration target mode changed");
|
|
965
|
+
if (content.mode === "protected") {
|
|
966
|
+
if (!manifest.targetGenesisHash || content.namespace !== encryptedWorkspaceNamespace(manifest.targetGenesisHash))
|
|
967
|
+
throw new Error("Migration target encrypted identity changed");
|
|
968
|
+
await protectedTarget?.authorize();
|
|
969
|
+
for (const entry of manifest.documents) {
|
|
970
|
+
if (entry.id.startsWith("task-") || entry.meta.historyBackend && entry.meta.historyBackend !== "loro")
|
|
971
|
+
throw new Error("E2EE migration does not support legacy task or Roost history");
|
|
972
|
+
protectionFor(documentStreamId(entry));
|
|
973
|
+
}
|
|
974
|
+
for (const index of manifest.flocks) protectionFor(index.id);
|
|
975
|
+
}
|
|
853
976
|
if (!unwrap(
|
|
854
977
|
await client(getLoroMetaStreamId(workspaceId), signal).bucketSupportsAppendCas({ signal })
|
|
855
978
|
))
|
|
@@ -880,23 +1003,20 @@ async function openMigrationTarget(provider, workspaceId, content) {
|
|
|
880
1003
|
doc.getMap(receiptRoot).set("sourceSha256", entry.sha256);
|
|
881
1004
|
doc.commit();
|
|
882
1005
|
const created = unwrap(
|
|
883
|
-
await client(
|
|
884
|
-
part:
|
|
1006
|
+
await client(documentStreamId(entry), signal).create({
|
|
1007
|
+
part: await writePart(documentStreamId(entry), [doc.export({ mode: "update" })])
|
|
885
1008
|
})
|
|
886
1009
|
);
|
|
887
1010
|
if (!created.created)
|
|
888
1011
|
assertOwnedDocument((await readDoc(entry, signal)).doc, entry, manifest.migrationId);
|
|
889
1012
|
},
|
|
890
1013
|
async upload(entry, manifest, bytes, signal) {
|
|
1014
|
+
if (content.mode === "protected") await protectedTarget?.authorize();
|
|
891
1015
|
const remote = await readDoc(entry, signal);
|
|
892
1016
|
if (!remote.exists) throw new Error(`Migration reservation disappeared: ${entry.id}`);
|
|
893
1017
|
assertOwnedDocument(remote.doc, entry, manifest.migrationId);
|
|
894
1018
|
remote.doc.import(bytes);
|
|
895
|
-
const stream = make(
|
|
896
|
-
getLoroStreamIdForDocId(workspaceId, entry.id),
|
|
897
|
-
createLoroDocAdapter(remote.doc),
|
|
898
|
-
signal
|
|
899
|
-
);
|
|
1019
|
+
const stream = make(documentStreamId(entry), createLoroDocAdapter(remote.doc), signal);
|
|
900
1020
|
try {
|
|
901
1021
|
const result = await stream.sync();
|
|
902
1022
|
if (!result.ok)
|
|
@@ -956,12 +1076,16 @@ async function openMigrationTarget(provider, workspaceId, content) {
|
|
|
956
1076
|
);
|
|
957
1077
|
},
|
|
958
1078
|
async publish(entry, manifest, signal) {
|
|
1079
|
+
const fence = content.mode === "protected" ? (await readDoc(entry, signal)).doc.getMap(receiptRoot).get("importFence") : void 0;
|
|
1080
|
+
if (content.mode === "protected" && isSessionDocRoomId(entry.id) && (!fence || typeof fence !== "object" || !("workspaceId" in fence) || fence.workspaceId !== workspaceId))
|
|
1081
|
+
throw new Error("Missing E2EE session import fence");
|
|
959
1082
|
await transact(
|
|
960
1083
|
getLoroMetaStreamId(workspaceId),
|
|
961
1084
|
(meta) => {
|
|
962
1085
|
checkMeta(meta, entry, manifest);
|
|
963
1086
|
if (meta.get(["m", entry.id, "ossMigrationId"]) === manifest.migrationId) return;
|
|
964
1087
|
const values = isSessionDocRoomId(entry.id) ? migratedMetadata(entry.meta, manifest) : { ...entry.meta, ossMigrationId: manifest.migrationId };
|
|
1088
|
+
if (fence) values.importFence = jsonObject.parse(fence);
|
|
965
1089
|
meta.set(["e", entry.id], true);
|
|
966
1090
|
for (const [key, value] of Object.entries(values)) meta.set(["m", entry.id, key], value);
|
|
967
1091
|
},
|
|
@@ -1153,8 +1277,8 @@ const migrateCommand = new Command("migrate").description("Import a frozen OSS s
|
|
|
1153
1277
|
}
|
|
1154
1278
|
])).workspace;
|
|
1155
1279
|
const workspace = selectWorkspaceSummary(candidates, selector);
|
|
1156
|
-
|
|
1157
|
-
|
|
1280
|
+
assertRetainedE2eeModeAllowsOpen(auth.userId, workspace);
|
|
1281
|
+
const encrypted = workspace.contentMode === "e2ee";
|
|
1158
1282
|
const sourcePath = await fs__default.realpath(
|
|
1159
1283
|
options.source ?? path__default.join(os__default.homedir(), getInstallationProfile("local").dataDirectoryName)
|
|
1160
1284
|
);
|
|
@@ -1174,6 +1298,8 @@ const migrateCommand = new Command("migrate").description("Import a frozen OSS s
|
|
|
1174
1298
|
sourceUserId: catalog.identity.userId,
|
|
1175
1299
|
sourceName: sourceWorkspace.name,
|
|
1176
1300
|
targetWorkspaceId: workspace.id,
|
|
1301
|
+
targetContentMode: encrypted ? "protected" : "plaintext",
|
|
1302
|
+
...encrypted ? { targetGenesisHash: workspace.genesisHash } : {},
|
|
1177
1303
|
targetMachineId: auth.machineId,
|
|
1178
1304
|
targetUserId: auth.userId,
|
|
1179
1305
|
deployment: authBaseUrl,
|
|
@@ -1231,43 +1357,75 @@ Documents: ${manifest.documents.length}`
|
|
|
1231
1357
|
}
|
|
1232
1358
|
}
|
|
1233
1359
|
const journal = await loadJournal(directory, migrationId);
|
|
1234
|
-
const tokenProvider = createCloudStreamsTokenPort({
|
|
1235
|
-
token: auth.token,
|
|
1236
|
-
authBaseUrl,
|
|
1237
|
-
authSiteUrl: LODY_AUTH_SITE_URL,
|
|
1238
|
-
logger
|
|
1239
|
-
}).createTokenProvider({ workspaceId: workspace.id });
|
|
1240
1360
|
if (!manifest.documents.length) {
|
|
1241
1361
|
console.log("No records to migrate.");
|
|
1242
1362
|
return;
|
|
1243
1363
|
}
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
migrationStep(
|
|
1253
|
-
() =>
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1364
|
+
if (!encrypted)
|
|
1365
|
+
await registerMachineAccessForCliToken({
|
|
1366
|
+
token: auth.token,
|
|
1367
|
+
workspaceId: workspace.id,
|
|
1368
|
+
machineId: auth.machineId
|
|
1369
|
+
});
|
|
1370
|
+
const program = gen(function* () {
|
|
1371
|
+
const e2ee = encrypted ? yield* acquireRelease(
|
|
1372
|
+
migrationStep(async () => {
|
|
1373
|
+
const { openCliE2eeWorkspaceLegacy } = await import("./workspace-legacy-BDeOVRwz.js").then((n) => n.b_);
|
|
1374
|
+
return openCliE2eeWorkspaceLegacy({
|
|
1375
|
+
accountId: auth.userId,
|
|
1376
|
+
workspaceId: workspace.id,
|
|
1377
|
+
machineId: auth.machineId,
|
|
1378
|
+
genesisHash: workspace.genesisHash ?? "",
|
|
1379
|
+
cloud: createCloudE2eePort({ token: auth.token, authBaseUrl, logger }),
|
|
1380
|
+
onUnavailable: () => logger.debug("e2ee_migration_unavailable")
|
|
1381
|
+
}).catch((error) => {
|
|
1382
|
+
throw describeEncryptedCommandFailure(workspace.id, error);
|
|
1383
|
+
});
|
|
1384
|
+
}),
|
|
1385
|
+
(owner) => migrationStep(() => owner.close()).pipe(orDie)
|
|
1386
|
+
) : void 0;
|
|
1387
|
+
if (e2ee) yield* migrationStep(() => e2ee.authorizeImport());
|
|
1388
|
+
const tokenProvider = (e2ee?.tokens ?? createCloudStreamsTokenPort({
|
|
1389
|
+
token: auth.token,
|
|
1390
|
+
authBaseUrl,
|
|
1391
|
+
authSiteUrl: LODY_AUTH_SITE_URL,
|
|
1392
|
+
logger
|
|
1393
|
+
})).createTokenProvider({ workspaceId: workspace.id });
|
|
1394
|
+
yield* withMigrationTokens(
|
|
1395
|
+
tokenProvider,
|
|
1396
|
+
(tokens) => acquireRelease(
|
|
1397
|
+
migrationStep(
|
|
1398
|
+
() => openMigrationTarget(
|
|
1399
|
+
tokens,
|
|
1400
|
+
workspace.id,
|
|
1401
|
+
e2ee?.content ?? { mode: "plaintext" },
|
|
1402
|
+
e2ee ? { authorize: e2ee.authorizeImport, bucketId: e2ee.bucketId } : void 0
|
|
1403
|
+
)
|
|
1404
|
+
),
|
|
1405
|
+
(target) => migrationStep(() => target.close()).pipe(orDie)
|
|
1406
|
+
).pipe(
|
|
1407
|
+
flatMap(
|
|
1408
|
+
(target) => migrateSnapshot(manifest, journal, directory).pipe(
|
|
1409
|
+
provideService(MigrationRuntime, {
|
|
1410
|
+
target,
|
|
1411
|
+
transfer: new SessionAttachmentTransfer(
|
|
1412
|
+
auth.token,
|
|
1413
|
+
serverBaseUrl,
|
|
1414
|
+
e2ee ? {
|
|
1415
|
+
token: async () => {
|
|
1416
|
+
await e2ee.authorizeImport();
|
|
1417
|
+
return e2ee.attachmentToken();
|
|
1418
|
+
}
|
|
1419
|
+
} : void 0
|
|
1420
|
+
),
|
|
1421
|
+
progress: console.log
|
|
1422
|
+
})
|
|
1423
|
+
)
|
|
1424
|
+
),
|
|
1425
|
+
scoped
|
|
1426
|
+
)
|
|
1427
|
+
);
|
|
1428
|
+
}).pipe(scoped);
|
|
1271
1429
|
const exit = await runPromiseExit(program, { signal });
|
|
1272
1430
|
if (isFailure(exit)) throw squash(exit.cause);
|
|
1273
1431
|
console.log(`Migration backup and resume journal: ${directory}`);
|
|
@@ -1279,4 +1437,4 @@ export {
|
|
|
1279
1437
|
withMigrationLock,
|
|
1280
1438
|
withMigrationTokens
|
|
1281
1439
|
};
|
|
1282
|
-
//# sourceMappingURL=migrate-
|
|
1440
|
+
//# sourceMappingURL=migrate-CeZ3FAo1.js.map
|