@narumitw/pi-sync-daemon 0.7.0 → 0.8.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/CHANGELOG.md +11 -0
- package/README.md +16 -2
- package/dist/consent.js +21 -6
- package/dist/engine/backends/git/git-backend.d.ts +1 -1
- package/dist/engine/backends/git/git-backend.js +17 -2
- package/dist/engine/backends/git/git-storage.d.ts +1 -1
- package/dist/engine/backends/git/git-storage.js +30 -9
- package/dist/engine/backends/s3/s3-backend.js +8 -0
- package/dist/engine/backends/sync-backend.d.ts +1 -0
- package/dist/engine/backends/webdav/webdav-backend.js +8 -0
- package/dist/engine/ignore/effective-ignore-policy.d.ts +10 -0
- package/dist/engine/ignore/effective-ignore-policy.js +33 -0
- package/dist/engine/ignore/ignore-edit.d.ts +13 -0
- package/dist/engine/ignore/ignore-edit.js +102 -0
- package/dist/engine/ignore/ignore-initialization.d.ts +6 -0
- package/dist/engine/ignore/ignore-initialization.js +186 -0
- package/dist/engine/ignore/ignore-migration-prompt.d.ts +7 -0
- package/dist/engine/ignore/ignore-migration-prompt.js +139 -0
- package/dist/engine/ignore/ignore-settings.d.ts +15 -0
- package/dist/engine/ignore/ignore-settings.js +322 -0
- package/dist/engine/ignore/ignore-source.d.ts +27 -0
- package/dist/engine/ignore/ignore-source.js +250 -0
- package/dist/engine/settings/config-file.d.ts +9 -2
- package/dist/engine/settings/config-file.js +124 -28
- package/dist/engine/settings/config.d.ts +3 -0
- package/dist/engine/settings/config.js +93 -7
- package/dist/engine/settings/settings-management.d.ts +2 -2
- package/dist/engine/settings/settings-management.js +16 -8
- package/dist/engine/settings/settings-types.d.ts +23 -2
- package/dist/engine/settings/settings-validation.js +23 -5
- package/dist/engine/snapshot/session-paths.d.ts +1 -1
- package/dist/engine/snapshot/session-paths.js +36 -13
- package/dist/engine/snapshot/snapshot-apply.d.ts +3 -3
- package/dist/engine/snapshot/snapshot-apply.js +23 -4
- package/dist/engine/snapshot/snapshot-codec.d.ts +1 -1
- package/dist/engine/snapshot/snapshot-codec.js +14 -5
- package/dist/engine/snapshot/snapshot-exclude-safety.d.ts +4 -2
- package/dist/engine/snapshot/snapshot-exclude-safety.js +76 -19
- package/dist/engine/snapshot/snapshot-transaction-images.d.ts +3 -1
- package/dist/engine/snapshot/snapshot-transaction-images.js +33 -3
- package/dist/engine/snapshot/snapshot-transaction-policy.d.ts +24 -1
- package/dist/engine/snapshot/snapshot-transaction-policy.js +106 -2
- package/dist/engine/snapshot/snapshot-transaction-verification.d.ts +7 -0
- package/dist/engine/snapshot/snapshot-transaction-verification.js +78 -0
- package/dist/engine/snapshot/snapshot-transaction.d.ts +1 -12
- package/dist/engine/snapshot/snapshot-transaction.js +86 -108
- package/dist/engine/snapshot/snapshot-types.d.ts +23 -1
- package/dist/engine/snapshot/snapshot-types.js +9 -1
- package/dist/engine/snapshot/snapshot.d.ts +6 -4
- package/dist/engine/snapshot/snapshot.js +91 -34
- package/dist/engine/state/state-types.d.ts +1 -0
- package/dist/engine/sync/continuous-sync.js +18 -3
- package/dist/engine/sync/continuous-watch.js +4 -1
- package/dist/engine/sync/initialization.js +3 -2
- package/dist/engine/sync/local-fields.d.ts +3 -1
- package/dist/engine/sync/local-fields.js +62 -1
- package/dist/engine/sync/merge-apply.js +35 -7
- package/dist/engine/sync/merge-journal.d.ts +18 -4
- package/dist/engine/sync/merge-journal.js +115 -8
- package/dist/engine/sync/merged-sync.d.ts +1 -1
- package/dist/engine/sync/merged-sync.js +103 -50
- package/dist/engine/sync/remote-snapshot.d.ts +9 -2
- package/dist/engine/sync/remote-snapshot.js +56 -17
- package/dist/engine/sync/sync-inspection.js +7 -5
- package/dist/engine/sync/sync-mutations.d.ts +2 -1
- package/dist/engine/sync/sync-mutations.js +110 -47
- package/dist/engine/sync/sync-policy.d.ts +24 -8
- package/dist/engine/sync/sync-policy.js +127 -16
- package/dist/engine/sync/sync-queries.js +8 -1
- package/dist/engine/sync/sync-state.d.ts +2 -2
- package/dist/engine/sync/sync-state.js +20 -2
- package/dist/engine-service.js +24 -2
- package/docs/architecture.md +22 -0
- package/package.json +2 -1
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import type { RemoteHead } from "../backends/sync-backend.js";
|
|
1
|
+
import type { RemoteHead, SyncBackend } from "../backends/sync-backend.js";
|
|
2
|
+
import type { CommandOptions } from "../commands/command-types.js";
|
|
3
|
+
import type { EngineContext } from "../host.js";
|
|
2
4
|
import type { AnySyncConfig } from "../settings/settings-types.js";
|
|
3
|
-
import type
|
|
5
|
+
import { type TransactionJournalPolicy } from "../snapshot/snapshot-transaction-policy.js";
|
|
6
|
+
import { type Snapshot } from "../snapshot/snapshot-types.js";
|
|
4
7
|
import type { PartialProgress } from "./partial-progress.js";
|
|
5
|
-
|
|
8
|
+
type MergeJournalPolicy = {
|
|
6
9
|
version: 1;
|
|
10
|
+
ignoreSource?: never;
|
|
11
|
+
} | {
|
|
12
|
+
version: 2;
|
|
13
|
+
ignoreSource: NonNullable<TransactionJournalPolicy["ignoreSource"]>;
|
|
14
|
+
};
|
|
15
|
+
export type MergeJournal = MergeJournalPolicy & {
|
|
7
16
|
identity: string;
|
|
8
17
|
before: Snapshot;
|
|
9
18
|
after: Snapshot;
|
|
@@ -19,13 +28,18 @@ export interface MergeJournal {
|
|
|
19
28
|
/** Effective collection/apply root; absent legacy evidence cannot authorize session recovery. */
|
|
20
29
|
sessionRoot?: string;
|
|
21
30
|
warnings?: string[];
|
|
22
|
-
}
|
|
31
|
+
};
|
|
32
|
+
export declare function mergeJournalPolicy(config: AnySyncConfig): MergeJournalPolicy;
|
|
33
|
+
export declare function assertMergeJournalPolicy(journal: MergeJournal, config: AnySyncConfig): void;
|
|
23
34
|
export declare function mergeJournalIdentity(config: AnySyncConfig, backendIdentity: string): string;
|
|
24
35
|
export declare function mergeJournalPath(config: AnySyncConfig): string;
|
|
25
36
|
export declare function readMergeJournal(config: AnySyncConfig): Promise<MergeJournal | undefined>;
|
|
26
37
|
export declare function writeMergeJournal(config: AnySyncConfig, journal: MergeJournal): Promise<void>;
|
|
27
38
|
export declare function clearMergeJournal(config: AnySyncConfig): Promise<void>;
|
|
28
39
|
export declare function retireMergeJournal(config: AnySyncConfig): Promise<void>;
|
|
40
|
+
export declare function reviewInactiveIgnoreMerge(ctx: EngineContext, config: AnySyncConfig, backend: SyncBackend, journal: MergeJournal, head: RemoteHead, options: CommandOptions, validateFresh: () => Promise<void>, isCurrent?: () => boolean): Promise<"archived" | "cancelled">;
|
|
41
|
+
export declare function sameMergeRecoveryHead(backend: SyncBackend, left: RemoteHead | undefined, right: RemoteHead | undefined): boolean;
|
|
29
42
|
export declare function requireNoMergeJournal(config: AnySyncConfig, options?: {
|
|
30
43
|
force?: boolean;
|
|
31
44
|
}): Promise<void>;
|
|
45
|
+
export {};
|
|
@@ -1,13 +1,54 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import fs from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { assertRecoveryPolicy, IGNORE_POLICY_JOURNAL_VERSION, ignorePolicyValidator, ignoreSourceBinding, validateJournalPolicy, } from "../snapshot/snapshot-transaction-policy.js";
|
|
5
|
+
import { IGNORE_SNAPSHOT_VERSION } from "../snapshot/snapshot-types.js";
|
|
4
6
|
import { readJsonIfExists, syncDirectory, writeJson } from "../state/json-file.js";
|
|
5
|
-
import { statePathForConfig, syncStateFingerprint } from "../state/sync-state-store.js";
|
|
7
|
+
import { readStateForConfig, statePathForConfig, syncStateFingerprint } from "../state/sync-state-store.js";
|
|
8
|
+
import { confirmMergeReview } from "../ui/merge-review.js";
|
|
9
|
+
import { safeTerminalText } from "../ui/terminal-text.js";
|
|
6
10
|
import { normalizeSyncExclude } from "./exclude-policy.js";
|
|
7
11
|
import { planFileMerge } from "./file-merge-planner.js";
|
|
8
12
|
import { portableSnapshot, sameLocalFields, validatePortableSnapshot, validateSnapshotFieldPolicy, } from "./local-fields.js";
|
|
9
|
-
import { configuredSnapshotPathMatcher, syncDirectoryPolicyKey, validateSnapshotSelection } from "./sync-policy.js";
|
|
13
|
+
import { configuredSnapshotPathMatcher, sameSnapshotSelection, syncDirectoryPolicyKey, validateSnapshotSelection, } from "./sync-policy.js";
|
|
10
14
|
import { fileHashMap, sameHashes } from "./sync-state.js";
|
|
15
|
+
export function mergeJournalPolicy(config) {
|
|
16
|
+
return config.ignorePolicy ? { version: 2, ignoreSource: ignoreSourceBinding(config.ignorePolicy) } : { version: 1 };
|
|
17
|
+
}
|
|
18
|
+
function ignoreRecoveryPolicy(journal) {
|
|
19
|
+
return {
|
|
20
|
+
version: IGNORE_POLICY_JOURNAL_VERSION,
|
|
21
|
+
ignoreSource: journal.ignoreSource,
|
|
22
|
+
selection: journal.upload.selection,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export function assertMergeJournalPolicy(journal, config) {
|
|
26
|
+
if (journal.version === 1 && !config.ignorePolicy && config.pathPolicy !== "ignore-file")
|
|
27
|
+
return;
|
|
28
|
+
if (journal.version !== 2)
|
|
29
|
+
throw new Error("Pending merge lacks ignore-file policy evidence; preserve its journal for reviewed recovery.");
|
|
30
|
+
assertRecoveryPolicy(ignoreRecoveryPolicy(journal), config);
|
|
31
|
+
try {
|
|
32
|
+
const identity = JSON.parse(journal.identity);
|
|
33
|
+
if (!Array.isArray(identity) ||
|
|
34
|
+
typeof identity[1] !== "string" ||
|
|
35
|
+
journal.identity !== mergeJournalIdentity(config, identity[1]))
|
|
36
|
+
throw new Error("Inconsistent merge identity.");
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
throw new Error("Pending merge belongs to a different setup or local policy; preserve its journal.");
|
|
40
|
+
}
|
|
41
|
+
const configured = configuredSnapshotPathMatcher(config);
|
|
42
|
+
for (const snapshot of [
|
|
43
|
+
journal.before,
|
|
44
|
+
journal.after,
|
|
45
|
+
journal.accepted,
|
|
46
|
+
journal.applyOnly ? undefined : journal.upload,
|
|
47
|
+
]) {
|
|
48
|
+
if (snapshot?.files.some((file) => !configured(file.path)))
|
|
49
|
+
throw new Error("Pending merge contains paths outside the current ignore-file policy; preserve its journal.");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
11
52
|
export function mergeJournalIdentity(config, backendIdentity) {
|
|
12
53
|
return JSON.stringify([
|
|
13
54
|
config.setupName,
|
|
@@ -38,9 +79,11 @@ export async function readMergeJournal(config) {
|
|
|
38
79
|
// A JSON parser error may quote sensitive journal contents; do not retain it in a public error.
|
|
39
80
|
throw new Error("Cannot read the private merge journal; preserve it and review recovery.");
|
|
40
81
|
}
|
|
41
|
-
if (
|
|
82
|
+
if (journal === undefined)
|
|
42
83
|
return;
|
|
43
|
-
if (journal
|
|
84
|
+
if (!journal ||
|
|
85
|
+
(journal.version !== 1 && journal.version !== 2) ||
|
|
86
|
+
(journal.version === 1 && journal.ignoreSource !== undefined) ||
|
|
44
87
|
typeof journal.identity !== "string" ||
|
|
45
88
|
typeof journal.backup !== "string" ||
|
|
46
89
|
typeof journal.stateIdentity !== "string" ||
|
|
@@ -69,6 +112,11 @@ export async function readMergeJournal(config) {
|
|
|
69
112
|
throw new Error("Unsupported or damaged merge journal; preserve it and review recovery before syncing.");
|
|
70
113
|
// Verify every path and byte, including the unmanaged remote files retained for publication.
|
|
71
114
|
try {
|
|
115
|
+
if (journal.version === 2) {
|
|
116
|
+
validateJournalPolicy(ignoreRecoveryPolicy(journal));
|
|
117
|
+
if ([journal.expectedHead.selection, journal.committedHead?.selection].some((selection) => selection !== undefined && !sameSnapshotSelection(selection, journal.upload.selection)))
|
|
118
|
+
throw new Error("Inconsistent merge head policy.");
|
|
119
|
+
}
|
|
72
120
|
const pinnedPaths = new Set(journal.progress?.groups.flatMap((group) => group.paths) ?? []);
|
|
73
121
|
for (const snapshot of [
|
|
74
122
|
journal.before,
|
|
@@ -78,7 +126,10 @@ export async function readMergeJournal(config) {
|
|
|
78
126
|
]) {
|
|
79
127
|
validateSnapshotFieldPolicy(snapshot);
|
|
80
128
|
validateSnapshotSelection(snapshot);
|
|
81
|
-
if (
|
|
129
|
+
if ((journal.version === 2
|
|
130
|
+
? snapshot.version !== IGNORE_SNAPSHOT_VERSION ||
|
|
131
|
+
!sameSnapshotSelection(snapshot.selection, journal.upload.selection)
|
|
132
|
+
: ![1, 2, 3, 4, 5].includes(snapshot.version)) ||
|
|
82
133
|
typeof snapshot.id !== "string" ||
|
|
83
134
|
typeof snapshot.profile !== "string" ||
|
|
84
135
|
snapshot.files.length > 16_384 ||
|
|
@@ -172,17 +223,73 @@ export async function clearMergeJournal(config) {
|
|
|
172
223
|
await syncDirectory(path.dirname(mergeJournalPath(config)));
|
|
173
224
|
}
|
|
174
225
|
export async function retireMergeJournal(config) {
|
|
175
|
-
|
|
226
|
+
const journal = await readMergeJournal(config);
|
|
227
|
+
if (!journal)
|
|
176
228
|
return;
|
|
229
|
+
assertMergeJournalPolicy(journal, config);
|
|
230
|
+
const validateIgnore = ignorePolicyValidator(config);
|
|
231
|
+
if (validateIgnore)
|
|
232
|
+
await validateIgnore();
|
|
233
|
+
if (journal.version === 2)
|
|
234
|
+
throw new Error(ignoreMergeRecoveryGuidance);
|
|
235
|
+
await archiveMergeJournal(config);
|
|
236
|
+
}
|
|
237
|
+
async function archiveMergeJournal(config) {
|
|
177
238
|
const file = mergeJournalPath(config);
|
|
178
239
|
await fs.rename(file, `${file}.${randomUUID()}.resolved`);
|
|
179
240
|
await syncDirectory(path.dirname(file));
|
|
180
241
|
}
|
|
242
|
+
export async function reviewInactiveIgnoreMerge(ctx, config, backend, journal, head, options, validateFresh, isCurrent) {
|
|
243
|
+
if (!isCurrent ||
|
|
244
|
+
options.auto ||
|
|
245
|
+
options.background ||
|
|
246
|
+
options.agentAcceptance ||
|
|
247
|
+
options.yes ||
|
|
248
|
+
!ctx.hasUI ||
|
|
249
|
+
(ctx.mode !== "tui" && ctx.mode !== "rpc")) {
|
|
250
|
+
throw new Error(ignoreMergeRecoveryGuidance);
|
|
251
|
+
}
|
|
252
|
+
await validateFresh();
|
|
253
|
+
if (!(await confirmMergeReview(ctx, "Archive the inactive merge journal?", [
|
|
254
|
+
`Setup: ${safeTerminalText(config.setupName)}`,
|
|
255
|
+
"The original remote head and accepted baseline still match the journal, but local files changed.",
|
|
256
|
+
"Archive only the journal. Keep its backup and all current local and remote files. Do not change the baseline.",
|
|
257
|
+
"Run Sync now again to review a fresh plan.",
|
|
258
|
+
].join("\n"), options.signal, isCurrent, "archive journal only")))
|
|
259
|
+
return "cancelled";
|
|
260
|
+
const state = await readStateForConfig(config);
|
|
261
|
+
await validateFresh();
|
|
262
|
+
const latest = await backend.readHead(options.signal);
|
|
263
|
+
if (!isCurrent())
|
|
264
|
+
return "cancelled";
|
|
265
|
+
if (!sameMergeRecoveryHead(backend, head, latest) || syncStateFingerprint(state) !== journal.stateIdentity) {
|
|
266
|
+
throw new Error("Remote head or sync baseline changed during recovery review; journal and backup retained.");
|
|
267
|
+
}
|
|
268
|
+
await archiveMergeJournal(config);
|
|
269
|
+
if (!options.silent && isCurrent())
|
|
270
|
+
ctx.ui.notify("Archived the inactive merge journal. Local files, remote files, baseline and backup were kept. Run Sync now again for a fresh plan.", "info");
|
|
271
|
+
return "archived";
|
|
272
|
+
}
|
|
273
|
+
export function sameMergeRecoveryHead(backend, left, right) {
|
|
274
|
+
if (!left || !right)
|
|
275
|
+
return left === right;
|
|
276
|
+
return (backend.sameRevision(left.revision, right.revision) &&
|
|
277
|
+
left.snapshotId === right.snapshotId &&
|
|
278
|
+
left.snapshotRef === right.snapshotRef &&
|
|
279
|
+
sameSnapshotSelection(left.selection, right.selection));
|
|
280
|
+
}
|
|
281
|
+
const ignoreMergeRecoveryGuidance = "An ignore-file merged transfer needs recovery; directional --force cannot bypass it. Inactive journal archiving requires foreground review where supported; --yes does not approve it. Preserve the journal, backup and current files if recovery is unavailable. Do not downgrade or restore old bytes blindly.";
|
|
181
282
|
export async function requireNoMergeJournal(config, options = {}) {
|
|
182
283
|
const journal = await readMergeJournal(config);
|
|
183
|
-
if (
|
|
284
|
+
if (!journal)
|
|
184
285
|
return;
|
|
185
|
-
|
|
286
|
+
assertMergeJournalPolicy(journal, config);
|
|
287
|
+
const validateIgnore = ignorePolicyValidator(config);
|
|
288
|
+
if (validateIgnore)
|
|
289
|
+
await validateIgnore();
|
|
290
|
+
if (journal.version === 2)
|
|
291
|
+
throw new Error(ignoreMergeRecoveryGuidance);
|
|
292
|
+
if (!options.force) {
|
|
186
293
|
throw new Error("A merged transfer needs recovery. Run /sync sync to reconcile it. If newer local edits or remote revisions prevent recovery, review /sync diff and explicitly choose push --force or pull --force; the selected directional result will archive the old journal, not restore old bytes. Keep its backup; do not downgrade while recovery is pending.");
|
|
187
294
|
}
|
|
188
295
|
}
|
|
@@ -3,4 +3,4 @@ import type { CommandOptions } from "../commands/command-types.js";
|
|
|
3
3
|
import type { EngineContext as ExtensionCommandContext, EngineContext as ExtensionContext } from "../host.js";
|
|
4
4
|
import { type ConflictResolution } from "./conflict-resolution.js";
|
|
5
5
|
/** Established-baseline sync only. First-source selection remains in the existing command flow. */
|
|
6
|
-
export declare function mergeSync(ctx: ExtensionContext | ExtensionCommandContext, options: CommandOptions, factory?: SyncBackendFactory, resolution?: ConflictResolution): Promise<"applied" | "cancelled" | undefined>;
|
|
6
|
+
export declare function mergeSync(ctx: ExtensionContext | ExtensionCommandContext, options: CommandOptions, factory?: SyncBackendFactory, resolution?: ConflictResolution): Promise<"applied" | "archived" | "cancelled" | undefined>;
|
|
@@ -3,6 +3,7 @@ import { expectedRemoteHead, SyncBackendConflictError, } from "../backends/sync-
|
|
|
3
3
|
import { loadConfig, syncCheckConfigFingerprint } from "../settings/config.js";
|
|
4
4
|
import { effectiveSessionRoot, requireStableMergeSessionRoot, snapshotOptionsForContext, } from "../snapshot/session-paths.js";
|
|
5
5
|
import { createSnapshot, filterSnapshotForConfigPolicy, mergeRemotePreservedFiles, regenerateSnapshotIdentity, scanSnapshot, } from "../snapshot/snapshot.js";
|
|
6
|
+
import { ignorePolicyValidator } from "../snapshot/snapshot-transaction-policy.js";
|
|
6
7
|
import { hasCurrentMergeBaseline, pruneMergeBaselines, readMergeAncestors, stageMergeBaseline, } from "../state/merge-baseline-store.js";
|
|
7
8
|
import { readStateForConfig, statePathForConfig, syncStateFingerprint, writeStateForConfig, } from "../state/sync-state-store.js";
|
|
8
9
|
import { confirmMergeReview } from "../ui/merge-review.js";
|
|
@@ -18,7 +19,7 @@ import { ContinuousError } from "./continuous-errors.js";
|
|
|
18
19
|
import { planFileMerge } from "./file-merge-planner.js";
|
|
19
20
|
import { overlayLocalFields, portableSnapshot, sameLocalFields } from "./local-fields.js";
|
|
20
21
|
import { applyMergedSnapshot, preflightMergedTargets } from "./merge-apply.js";
|
|
21
|
-
import { clearMergeJournal, mergeJournalIdentity, readMergeJournal, writeMergeJournal, } from "./merge-journal.js";
|
|
22
|
+
import { assertMergeJournalPolicy, clearMergeJournal, mergeJournalIdentity, mergeJournalPolicy, readMergeJournal, reviewInactiveIgnoreMerge, sameMergeRecoveryHead, writeMergeJournal, } from "./merge-journal.js";
|
|
22
23
|
import { mergeTransferError } from "./merge-transfer-error.js";
|
|
23
24
|
import { acceptedMergeFiles, progressState } from "./partial-progress.js";
|
|
24
25
|
import { formatRemoteSelectionStatus, readSnapshotForHead, requireCompatibleRemoteSelection, } from "./remote-snapshot.js";
|
|
@@ -54,6 +55,8 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
54
55
|
};
|
|
55
56
|
const config = await loadConfig(options.setup);
|
|
56
57
|
validateOwner(config);
|
|
58
|
+
if (config.pathPolicy === "ignore-file" && !config.ignorePolicy)
|
|
59
|
+
throw new Error("Merged sync requires the resolved local ignore-file policy.");
|
|
57
60
|
validateRetryAuthorization(config);
|
|
58
61
|
const configToken = syncCheckConfigFingerprint(config);
|
|
59
62
|
const modelToken = JSON.stringify(ctx.model);
|
|
@@ -84,15 +87,34 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
84
87
|
if (options.auto && (!startupTransferEnabled(latest) || !ctx.isIdle()))
|
|
85
88
|
throw new Error("Automatic transfer is no longer authorized at this idle boundary.");
|
|
86
89
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
+
const validateIgnore = ignorePolicyValidator({
|
|
91
|
+
...config,
|
|
92
|
+
signal: options.signal,
|
|
93
|
+
validateMutation: () => {
|
|
94
|
+
validateOwner();
|
|
95
|
+
if (options.auto && !ctx.isIdle())
|
|
96
|
+
throw new Error("Automatic transfer is no longer authorized at this idle boundary.");
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
const validateFresh = validateIgnore
|
|
100
|
+
? async () => {
|
|
101
|
+
await validate();
|
|
102
|
+
await validateIgnore();
|
|
103
|
+
}
|
|
104
|
+
: validate;
|
|
105
|
+
await validateFresh();
|
|
90
106
|
const pending = await timings.measure("transfer journal read", () => readMergeJournal(config));
|
|
91
107
|
await validate();
|
|
92
108
|
if (pending && options.agentRetryRefusal)
|
|
93
109
|
throw new Error("A pending merge journal requires ordinary Sync now before retrying a refused candidate.");
|
|
110
|
+
if (pending)
|
|
111
|
+
assertMergeJournalPolicy(pending, config);
|
|
112
|
+
const backend = await timings.measure("transfer backend initialization", () => factory(config));
|
|
113
|
+
await validate();
|
|
94
114
|
if (pending) {
|
|
95
|
-
const recovered = await timings.measure("transfer journal recovery", () => completeJournal(ctx, config, backend, pending, validate,
|
|
115
|
+
const recovered = await timings.measure("transfer journal recovery", () => completeJournal(ctx, config, backend, pending, { validate, validateFresh, validateOwner }, timings, options, resolution ? undefined : isCurrent));
|
|
116
|
+
if (recovered === "archived" || recovered === "cancelled")
|
|
117
|
+
return recovered;
|
|
96
118
|
if (!recovered) {
|
|
97
119
|
if ((options.auto || !options.silent) && !options.signal?.aborted)
|
|
98
120
|
ctx.ui.notify("Interrupted candidate is not active; local content and baseline were unchanged. Evidence was reconciled without retrying publication. Run sync again for a fresh plan.", "warning");
|
|
@@ -153,10 +175,11 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
153
175
|
}
|
|
154
176
|
}
|
|
155
177
|
const rawRemote = head
|
|
156
|
-
? await timings.measure("transfer snapshot download", () => readSnapshotForHead(backend, head, options.signal))
|
|
178
|
+
? await timings.measure("transfer snapshot download", () => readSnapshotForHead(backend, head, options.signal, config))
|
|
157
179
|
: undefined;
|
|
158
180
|
await validate();
|
|
159
181
|
if (rawRemote) {
|
|
182
|
+
requireCompatibleRemoteSelection(config, rawRemote);
|
|
160
183
|
const files = [...local.files, ...rawRemote.files];
|
|
161
184
|
if (files.length > 16_384 ||
|
|
162
185
|
files.reduce((bytes, file) => bytes + file.contentBase64.length * 0.75, 0) > 64 * 1024 * 1024) {
|
|
@@ -167,7 +190,6 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
167
190
|
? portableSnapshot(filterSnapshotForConfigPolicy(rawRemote, config, { sessionDir: sessionRoot }), rawRemote.localFields)
|
|
168
191
|
: undefined;
|
|
169
192
|
if (rawRemote) {
|
|
170
|
-
requireCompatibleRemoteSelection(config, rawRemote);
|
|
171
193
|
const validation = await timings.measure("transfer merge planning", () => planFileMerge({
|
|
172
194
|
baseline: state.lastFileHashes,
|
|
173
195
|
local: local.files,
|
|
@@ -232,7 +254,7 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
232
254
|
if (config.agentMode && !resolution) {
|
|
233
255
|
const { resolveAgentPlan } = await import("./agent-plan.js");
|
|
234
256
|
await validate();
|
|
235
|
-
plan = await resolveAgentPlan(ctx, options, config, backend, state, local, localRaw, remote, head, plan, snapshotOptions,
|
|
257
|
+
plan = await resolveAgentPlan(ctx, options, config, backend, state, local, localRaw, remote, head, plan, snapshotOptions, validateFresh);
|
|
236
258
|
await validate();
|
|
237
259
|
if (plan.kind !== "planned" || (plan.conflicts.length && !config.partialSync))
|
|
238
260
|
throw new ContinuousError("unsafe", "Autonomous sync paused: unsupported or refused conflict groups remain; no transfer was performed.");
|
|
@@ -351,7 +373,7 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
351
373
|
throw new ContinuousError("stale", "Remote changed before baseline acceptance; retry from a fresh observation.");
|
|
352
374
|
await options.agentAcceptance?.commitCandidate?.();
|
|
353
375
|
await validate();
|
|
354
|
-
await timings.measure("transfer baseline write", () => writeAcceptedState(config, head, accepted,
|
|
376
|
+
await timings.measure("transfer baseline write", () => writeAcceptedState(config, head, accepted, validateFresh, progress));
|
|
355
377
|
await timings.measure("transfer cleanup", () => pruneMergeBaselines(config, acceptedState(config, head, accepted, progress), captureMutationOwner(ctx, options.signal)));
|
|
356
378
|
await validate();
|
|
357
379
|
await timings.measure("transfer cleanup", () => pruneCompletedConflicts(config, backend.identity, acceptedState(config, head, accepted, progress), accepted, remote, captureMutationOwner(ctx, options.signal)));
|
|
@@ -403,9 +425,9 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
403
425
|
progress = await persistProgress();
|
|
404
426
|
await validate();
|
|
405
427
|
const backup = await timings.measure("transfer backup", () => backupLocal(config.snapshotIdentity, snapshotOptions, options.signal));
|
|
406
|
-
await
|
|
428
|
+
await validateFresh();
|
|
407
429
|
const journal = {
|
|
408
|
-
|
|
430
|
+
...mergeJournalPolicy(config),
|
|
409
431
|
identity: mergeJournalIdentity(config, backend.identity),
|
|
410
432
|
before: localRaw,
|
|
411
433
|
after,
|
|
@@ -425,7 +447,7 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
425
447
|
const atCommit = await timings.measure("transfer local snapshot", () => createSnapshot(config.snapshotIdentity, snapshotOptions));
|
|
426
448
|
await validate();
|
|
427
449
|
if (!sameHashes(fileHashMap(atCommit), fileHashMap(localRaw)) || atCommitState !== journal.stateIdentity) {
|
|
428
|
-
await
|
|
450
|
+
await validateFresh();
|
|
429
451
|
await clearMergeJournal(config);
|
|
430
452
|
throw new ContinuousError("stale", "Local content or baseline changed before publication; candidate retired without transfer. Review a fresh sync.");
|
|
431
453
|
}
|
|
@@ -435,18 +457,19 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
435
457
|
...(ctx.protectedSessionFiles ?? []),
|
|
436
458
|
...[ctx.sessionManager.getSessionFile?.()].filter((file) => Boolean(file)),
|
|
437
459
|
]));
|
|
438
|
-
await validate();
|
|
439
460
|
}
|
|
440
461
|
catch (error) {
|
|
441
|
-
await
|
|
462
|
+
await validateFresh();
|
|
442
463
|
await clearMergeJournal(config);
|
|
443
464
|
throw error;
|
|
444
465
|
}
|
|
466
|
+
await validateFresh();
|
|
445
467
|
try {
|
|
446
468
|
if (publish) {
|
|
447
469
|
const result = await timings.measure("transfer remote publication", () => backend.publishSnapshot(upload, expectedRemoteHead(head), {
|
|
448
470
|
signal: options.signal,
|
|
449
471
|
onCommit: options.onCommit,
|
|
472
|
+
...(validateIgnore ? { validateIgnorePolicy: validateFresh } : {}),
|
|
450
473
|
}));
|
|
451
474
|
journal.committedHead = result.head;
|
|
452
475
|
journal.warnings = result.warnings;
|
|
@@ -459,6 +482,7 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
459
482
|
if (error instanceof SyncBackendConflictError &&
|
|
460
483
|
error.phase === "before-commit" &&
|
|
461
484
|
!error.candidateMayHaveBeenActive) {
|
|
485
|
+
await validateFresh();
|
|
462
486
|
await clearMergeJournal(config);
|
|
463
487
|
if (attempt + 1 < MAX_ATTEMPTS)
|
|
464
488
|
continue;
|
|
@@ -468,7 +492,7 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
468
492
|
// Every uncertain/after-commit outcome retains evidence and is never blindly retried.
|
|
469
493
|
throw mergeTransferError(error, config.backend);
|
|
470
494
|
}
|
|
471
|
-
const completed = await timings.measure("transfer journal recovery", () => completeJournal(ctx, config, backend, journal, validate,
|
|
495
|
+
const completed = await timings.measure("transfer journal recovery", () => completeJournal(ctx, config, backend, journal, { validate, validateFresh, validateOwner }, timings, options));
|
|
472
496
|
if (!completed) {
|
|
473
497
|
if (!options.signal?.aborted && (options.auto || !options.silent))
|
|
474
498
|
ctx.ui.notify("Remote changed before local apply; candidate retired without transfer. Run sync again.", "warning");
|
|
@@ -491,41 +515,52 @@ export async function mergeSync(ctx, options, factory = createSyncBackend, resol
|
|
|
491
515
|
await timings.measure("transfer cleanup", () => releaseConflictArtifacts(config, ownedStatePath, createdArtifacts));
|
|
492
516
|
}
|
|
493
517
|
}
|
|
494
|
-
async function completeJournal(ctx, config, backend, journal, validate,
|
|
518
|
+
async function completeJournal(ctx, config, backend, journal, { validate, validateFresh, validateOwner, }, timings, options, isCurrent) {
|
|
519
|
+
const { auto, signal } = options;
|
|
520
|
+
const validateMutation = () => {
|
|
521
|
+
validateOwner();
|
|
522
|
+
if (auto && !ctx.isIdle())
|
|
523
|
+
throw new Error("Automatic file apply is no longer idle; evidence retained.");
|
|
524
|
+
};
|
|
495
525
|
if (journal.identity !== mergeJournalIdentity(config, backend.identity) ||
|
|
496
526
|
!sameLocalFields(journal.upload.localFields, config.localFields))
|
|
497
527
|
throw new Error("Merge journal belongs to a different setup, selection or local-field policy; preserve it for reviewed recovery.");
|
|
498
|
-
await
|
|
528
|
+
await validateFresh();
|
|
499
529
|
const sessionRoot = config.scope === "agent-directory" || syncSessionsSelected(config)
|
|
500
530
|
? await effectiveSessionRoot(ctx, config, signal)
|
|
501
531
|
: undefined;
|
|
502
532
|
await validate();
|
|
503
533
|
if (sessionRoot !== undefined && journal.sessionRoot !== sessionRoot) {
|
|
504
|
-
throw new Error("Merge journal session root is missing or differs from this context; preserve
|
|
534
|
+
throw new Error("Merge journal session root is missing or differs from this context; preserve its journal and backup for review.");
|
|
505
535
|
}
|
|
506
536
|
const snapshotOptions = { ...snapshotOptionsForContext(ctx, config), sessionDir: sessionRoot, signal };
|
|
507
537
|
const head = await timings.measure("transfer remote head", () => backend.readHead(signal));
|
|
508
|
-
if (!journal.committedHead &&
|
|
509
|
-
head &&
|
|
510
|
-
(backend.sameRevision(head.revision, journal.expectedHead.revision) ||
|
|
511
|
-
backend.matchesUncommittedRecoveryHead?.(head, journal.expectedHead))) {
|
|
512
|
-
await validate();
|
|
513
|
-
const local = await timings.measure("transfer local snapshot", () => createSnapshot(config.snapshotIdentity, snapshotOptions));
|
|
514
|
-
if (!sameHashes(fileHashMap(local), fileHashMap(journal.before)) ||
|
|
515
|
-
syncStateFingerprint(await timings.measure("transfer state read", () => readStateForConfig(config))) !==
|
|
516
|
-
journal.stateIdentity) {
|
|
517
|
-
throw new Error("Uncertain publication is not active, but local content or baseline changed; keep the journal for reviewed recovery.");
|
|
518
|
-
}
|
|
519
|
-
await clearMergeJournal(config);
|
|
520
|
-
return false;
|
|
521
|
-
}
|
|
522
538
|
await validate();
|
|
539
|
+
const readRetirementEvidence = async () => {
|
|
540
|
+
const state = await timings.measure("transfer state read", () => readStateForConfig(config));
|
|
541
|
+
await validateFresh();
|
|
542
|
+
const local = await timings.measure("transfer local snapshot", () => createSnapshot(config.snapshotIdentity, snapshotOptions));
|
|
543
|
+
validateMutation();
|
|
544
|
+
const latest = await timings.measure("transfer remote head", () => backend.readHead(signal));
|
|
545
|
+
validateMutation();
|
|
546
|
+
if (!sameMergeRecoveryHead(backend, head, latest))
|
|
547
|
+
throw new Error("Remote head changed during merge recovery; journal and backup retained.");
|
|
548
|
+
return {
|
|
549
|
+
sameBaseline: syncStateFingerprint(state) === journal.stateIdentity,
|
|
550
|
+
sameLocal: sameHashes(fileHashMap(local), fileHashMap(journal.before)),
|
|
551
|
+
};
|
|
552
|
+
};
|
|
523
553
|
// Baseline publication is the durable completion boundary. A later remote revision
|
|
524
554
|
// cannot undo that acceptance; retire only the journal for the recorded commit.
|
|
525
|
-
if (journal.committedHead
|
|
555
|
+
if (journal.committedHead?.snapshotId === journal.upload.id &&
|
|
556
|
+
typeof journal.committedHead.revision === "string" &&
|
|
557
|
+
journal.committedHead.revision &&
|
|
558
|
+
(!head || !backend.sameRevision(head.revision, journal.committedHead.revision))) {
|
|
526
559
|
const state = await timings.measure("transfer state read", () => readStateForConfig(config));
|
|
527
560
|
await validate();
|
|
528
561
|
if (matchesAcceptedState(state, config, journal.committedHead, journal.accepted ?? journal.after, journal.progress)) {
|
|
562
|
+
if (config.ignorePolicy)
|
|
563
|
+
await validateFresh();
|
|
529
564
|
await clearMergeJournal(config);
|
|
530
565
|
await validate();
|
|
531
566
|
await pruneMergeBaselines(config, state, captureMutationOwner(ctx, signal));
|
|
@@ -533,12 +568,37 @@ async function completeJournal(ctx, config, backend, journal, validate, timings,
|
|
|
533
568
|
return true;
|
|
534
569
|
}
|
|
535
570
|
}
|
|
571
|
+
if (head &&
|
|
572
|
+
(journal.version === 2 || head.selection?.version === 4) &&
|
|
573
|
+
inspectRemoteSelection(config.include, { selection: head.selection, files: [] }, config.exclude, config).kind !==
|
|
574
|
+
"same")
|
|
575
|
+
throw new Error("Remote ignore-file policy differs or is unavailable; preserve the pending merge for review.");
|
|
576
|
+
if (!journal.committedHead &&
|
|
577
|
+
head &&
|
|
578
|
+
(backend.sameRevision(head.revision, journal.expectedHead.revision) ||
|
|
579
|
+
backend.matchesUncommittedRecoveryHead?.(head, journal.expectedHead))) {
|
|
580
|
+
if (journal.version === 2 &&
|
|
581
|
+
(head.snapshotId !== journal.expectedHead.snapshotId ||
|
|
582
|
+
head.snapshotRef !== journal.expectedHead.snapshotRef ||
|
|
583
|
+
head.snapshotId === journal.upload.id))
|
|
584
|
+
throw new Error("Cannot verify that the ignore-file candidate is inactive; preserve the journal and backup.");
|
|
585
|
+
const { sameBaseline, sameLocal } = await readRetirementEvidence();
|
|
586
|
+
validateMutation();
|
|
587
|
+
if (!sameBaseline || !sameLocal) {
|
|
588
|
+
if (journal.version === 2) {
|
|
589
|
+
if (!sameBaseline)
|
|
590
|
+
throw new Error("Sync baseline changed after uncertain publication; preserve the journal and backup for review.");
|
|
591
|
+
return reviewInactiveIgnoreMerge(ctx, config, backend, journal, head, options, validateFresh, isCurrent);
|
|
592
|
+
}
|
|
593
|
+
throw new Error("Uncertain publication is not active, but local content or baseline changed; keep the journal for reviewed recovery.");
|
|
594
|
+
}
|
|
595
|
+
await clearMergeJournal(config);
|
|
596
|
+
return false;
|
|
597
|
+
}
|
|
536
598
|
if (journal.applyOnly && (!head || !backend.sameRevision(head.revision, journal.expectedHead.revision))) {
|
|
537
|
-
const
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
if (sameHashes(fileHashMap(local), fileHashMap(journal.before)) &&
|
|
541
|
-
syncStateFingerprint(state) === journal.stateIdentity) {
|
|
599
|
+
const { sameBaseline, sameLocal } = await readRetirementEvidence();
|
|
600
|
+
validateMutation();
|
|
601
|
+
if (sameBaseline && sameLocal) {
|
|
542
602
|
await clearMergeJournal(config);
|
|
543
603
|
return false;
|
|
544
604
|
}
|
|
@@ -549,14 +609,14 @@ async function completeJournal(ctx, config, backend, journal, validate, timings,
|
|
|
549
609
|
(journal.committedHead && !backend.sameRevision(head.revision, journal.committedHead.revision))) {
|
|
550
610
|
throw new Error("Publication outcome cannot be reconciled with the current remote head. Journal and backup retained; do not retry publication or restore old bytes blindly.");
|
|
551
611
|
}
|
|
552
|
-
const observed = await timings.measure("transfer snapshot download", () => readSnapshotForHead(backend, head, signal));
|
|
612
|
+
const observed = await timings.measure("transfer snapshot download", () => readSnapshotForHead(backend, head, signal, config));
|
|
553
613
|
requireCompatibleRemoteSelection(config, observed);
|
|
554
614
|
if (!sameHashes(fileHashMap(observed), fileHashMap(journal.upload)) ||
|
|
555
615
|
JSON.stringify(observed.selection) !== JSON.stringify(journal.upload.selection))
|
|
556
616
|
throw new Error("Remote snapshot does not match the recorded merge publication.");
|
|
557
617
|
const state = await timings.measure("transfer state read", () => readStateForConfig(config));
|
|
558
618
|
if (matchesAcceptedState(state, config, head, journal.accepted ?? journal.after, journal.progress)) {
|
|
559
|
-
await
|
|
619
|
+
await validateFresh();
|
|
560
620
|
await clearMergeJournal(config);
|
|
561
621
|
await validate();
|
|
562
622
|
await pruneMergeBaselines(config, state, captureMutationOwner(ctx, signal));
|
|
@@ -567,25 +627,18 @@ async function completeJournal(ctx, config, backend, journal, validate, timings,
|
|
|
567
627
|
throw new Error("Sync baseline changed after the interrupted merge; preserve its journal and review recovery.");
|
|
568
628
|
}
|
|
569
629
|
if (inspectRemoteSelection(config.include, observed, config.exclude, config).kind !== "same")
|
|
570
|
-
throw new Error("Pending merge has unavailable remote selection metadata; preserve its journal and
|
|
630
|
+
throw new Error("Pending merge has unavailable remote selection metadata; preserve its journal and backup for review.");
|
|
571
631
|
if (sessionRoot !== undefined)
|
|
572
632
|
requireStableMergeSessionRoot(journal.before, journal.after, config.scope);
|
|
573
633
|
await validate();
|
|
574
|
-
const validateOwner = captureMutationOwner(ctx, signal);
|
|
575
|
-
const validateMutation = () => {
|
|
576
|
-
validateOwner();
|
|
577
|
-
validateBackground?.();
|
|
578
|
-
if (auto && !ctx.isIdle())
|
|
579
|
-
throw new Error("Automatic file apply is no longer idle; evidence retained.");
|
|
580
|
-
};
|
|
581
634
|
await timings.measure("transfer local apply", () => applyMergedSnapshot(journal.before, journal.after, protectedSessionPaths(ctx, sessionRoot), { ...snapshotOptions, validateMutation }, validate, ctx.sessionManager.getSessionFile?.()));
|
|
582
635
|
await validate();
|
|
583
636
|
const headAtAcceptance = await timings.measure("transfer remote head", () => backend.readHead(signal));
|
|
584
637
|
await validate();
|
|
585
638
|
if (!headAtAcceptance || !backend.sameRevision(headAtAcceptance.revision, head.revision))
|
|
586
639
|
throw new Error("Remote changed during merged apply; journal and backup retained for review.");
|
|
587
|
-
await timings.measure("transfer baseline write", () => writeAcceptedState(config, head, journal.accepted ?? journal.after,
|
|
588
|
-
await
|
|
640
|
+
await timings.measure("transfer baseline write", () => writeAcceptedState(config, head, journal.accepted ?? journal.after, validateFresh, journal.progress));
|
|
641
|
+
await validateFresh();
|
|
589
642
|
await clearMergeJournal(config);
|
|
590
643
|
await validate();
|
|
591
644
|
await timings.measure("transfer cleanup", () => pruneMergeBaselines(config, acceptedState(config, head, journal.accepted ?? journal.after, journal.progress), captureMutationOwner(ctx, signal)));
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import type { RemoteHead, SyncBackend } from "../backends/sync-backend.js";
|
|
2
2
|
import type { AnySyncConfig } from "../settings/settings-types.js";
|
|
3
3
|
import type { Snapshot } from "../snapshot/snapshot-types.js";
|
|
4
|
+
import type { SyncState } from "../state/state-types.js";
|
|
4
5
|
import { type RemoteSelectionState } from "./sync-policy.js";
|
|
5
|
-
export declare function readSnapshotForHead(backend: SyncBackend, head: RemoteHead, signal?: AbortSignal): Promise<Snapshot>;
|
|
6
|
+
export declare function readSnapshotForHead(backend: SyncBackend, head: RemoteHead, signal?: AbortSignal, config?: AnySyncConfig): Promise<Snapshot>;
|
|
7
|
+
export declare function readRemoteSnapshotForUpload(backend: SyncBackend, config: AnySyncConfig, head: RemoteHead | undefined, state: SyncState, options: {
|
|
8
|
+
force?: boolean;
|
|
9
|
+
signal?: AbortSignal;
|
|
10
|
+
}): Promise<Snapshot | undefined>;
|
|
11
|
+
export declare function sameRemoteHead(backend: SyncBackend, left: RemoteHead | undefined, right: RemoteHead | undefined): boolean;
|
|
6
12
|
export declare function requireCompatibleRemoteSelection(config: AnySyncConfig, snapshot: Snapshot): void;
|
|
13
|
+
export declare function inspectHeadSelection(backend: SyncBackend, config: AnySyncConfig, head: RemoteHead, signal?: AbortSignal): Promise<RemoteSelectionState>;
|
|
7
14
|
export declare function formatRemoteSelectionStatus(state: RemoteSelectionState | undefined): string;
|
|
8
15
|
export declare function readRemoteSnapshot(backend: SyncBackend, config: AnySyncConfig, signal?: AbortSignal, options?: {
|
|
9
16
|
allowSelectionDifference?: boolean;
|
|
@@ -24,6 +31,6 @@ export declare function readRemoteSnapshot(backend: SyncBackend, config: AnySync
|
|
|
24
31
|
syncSessions: boolean | undefined;
|
|
25
32
|
selection: import("../snapshot/snapshot-types.js").SnapshotSelection;
|
|
26
33
|
files: import("../snapshot/snapshot-types.js").SnapshotFile[];
|
|
27
|
-
};
|
|
34
|
+
} | undefined;
|
|
28
35
|
selectionState: RemoteSelectionState;
|
|
29
36
|
}>;
|