@narumitw/pi-sync 0.54.1 → 0.54.3
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 +19 -11
- package/dist/chunks/{chunk-ORQRHEEO.ts → chunk-26PMXY7E.ts} +3 -3
- package/dist/chunks/{chunk-SDZCTCYQ.ts → chunk-2FETCGGT.ts} +2 -2
- package/dist/chunks/{chunk-HUTYAPFP.ts → chunk-35GM6XKM.ts} +275 -151
- package/dist/chunks/chunk-35GM6XKM.ts.map +7 -0
- package/dist/chunks/{chunk-V6VZ5TLG.ts → chunk-A3TFXY4O.ts} +2 -2
- package/dist/chunks/{chunk-5RZPINUQ.ts → chunk-AAZDBIBJ.ts} +2 -2
- package/dist/chunks/{chunk-5ZWQ33XL.ts → chunk-CAGJOKB7.ts} +5 -5
- package/dist/chunks/{chunk-QE7NZZWT.ts → chunk-E6ONFG57.ts} +15 -2
- package/dist/chunks/{chunk-QE7NZZWT.ts.map → chunk-E6ONFG57.ts.map} +2 -2
- package/dist/chunks/{chunk-IJ6VV6FN.ts → chunk-GC3QOL6J.ts} +2 -2
- package/dist/chunks/{chunk-VHXBCEVF.ts → chunk-HMXUKU43.ts} +3 -3
- package/dist/chunks/{chunk-4SBTAVFL.ts → chunk-I4JYVFUS.ts} +5 -6
- package/dist/chunks/chunk-I4JYVFUS.ts.map +7 -0
- package/dist/chunks/{chunk-2DI6PDZV.ts → chunk-ITFR6NNQ.ts} +14 -2
- package/dist/chunks/chunk-ITFR6NNQ.ts.map +7 -0
- package/dist/chunks/{chunk-3B4Z2SKV.ts → chunk-KATKRR3D.ts} +18 -11
- package/dist/chunks/chunk-KATKRR3D.ts.map +7 -0
- package/dist/chunks/{chunk-ANWNQIR7.ts → chunk-KGE47GCZ.ts} +4 -4
- package/dist/chunks/chunk-KGE47GCZ.ts.map +7 -0
- package/dist/chunks/{chunk-CHSIAC4N.ts → chunk-R35N4CL3.ts} +2 -2
- package/dist/chunks/chunk-UZPMDLTL.ts +54 -0
- package/dist/chunks/chunk-UZPMDLTL.ts.map +7 -0
- package/dist/chunks/{chunk-4QVPTIZB.ts → chunk-VCL7TZYW.ts} +2 -2
- package/dist/chunks/{chunk-WFKUKVCP.ts → chunk-XU2VXGQV.ts} +14 -8
- package/dist/chunks/chunk-XU2VXGQV.ts.map +7 -0
- package/dist/chunks/{chunk-UQ3ALBIB.ts → chunk-YTHQEW35.ts} +3 -3
- package/dist/chunks/{conflict-artifacts-BB2FZMIE.ts → conflict-artifacts-4CZFB7WI.ts} +3 -3
- package/dist/chunks/{conflict-review-JRFJIBEN.ts → conflict-review-ZOTOHL2E.ts} +11 -10
- package/dist/chunks/{conflict-review-JRFJIBEN.ts.map → conflict-review-ZOTOHL2E.ts.map} +1 -1
- package/dist/chunks/{file-selection-WZX7HAY2.ts → file-selection-UNHBVVON.ts} +3 -3
- package/dist/chunks/{manager-result-dispatcher-6MQKFCWB.ts → manager-result-dispatcher-HVRTPEVK.ts} +7 -7
- package/dist/chunks/{manager-ui-IURS4WXY.ts → manager-ui-ZIN4BUSF.ts} +297 -136
- package/dist/chunks/manager-ui-ZIN4BUSF.ts.map +7 -0
- package/dist/chunks/{merge-baseline-store-EVQAAML6.ts → merge-baseline-store-ICXVTCML.ts} +5 -3
- package/dist/chunks/{remote-selection-ui-6LJJ4IMQ.ts → remote-selection-ui-H6AEVA3Q.ts} +6 -6
- package/dist/chunks/{s3-backend-AQGV6LFT.ts → s3-backend-Y4P3O5B5.ts} +2 -2
- package/dist/chunks/{setup-switch-KTUWL6DE.ts → setup-switch-ZMW5C4M7.ts} +4 -4
- package/dist/chunks/{setup-wizard-GSDPDFC4.ts → setup-wizard-VW7F3JN4.ts} +5 -5
- package/dist/chunks/{sync-inspection-K45QVLHB.ts → sync-inspection-3EMS2J5B.ts} +5 -4
- package/dist/chunks/{sync-operations-QQ2GXKVC.ts → sync-operations-2CWST333.ts} +140 -24
- package/dist/chunks/sync-operations-2CWST333.ts.map +7 -0
- package/dist/index.ts +103 -68
- package/dist/index.ts.map +2 -2
- package/docs/settings.md +47 -10
- package/docs/tui-contract.md +61 -0
- package/package.json +1 -1
- package/src/commands/command-execution.ts +2 -1
- package/src/commands/command-types.ts +4 -0
- package/src/commands/command.ts +3 -1
- package/src/settings/config.ts +13 -10
- package/src/settings/settings-store.ts +1 -0
- package/src/settings/settings-types.ts +2 -0
- package/src/settings/settings-validation.ts +3 -0
- package/src/snapshot/snapshot-transaction.ts +4 -2
- package/src/state/merge-baseline-store.ts +18 -0
- package/src/sync/apply-review.ts +63 -0
- package/src/sync/automatic-sync.ts +45 -33
- package/src/sync/merged-sync.ts +202 -104
- package/src/sync/startup-check.ts +39 -21
- package/src/sync/startup-timings.ts +90 -0
- package/src/sync/sync-inspection.ts +8 -4
- package/src/sync/sync-mutations.ts +49 -11
- package/src/sync/sync-queries.ts +14 -3
- package/src/ui/manager-state.ts +10 -6
- package/src/ui/manager-ui.ts +57 -7
- package/src/ui/merge-review.ts +3 -3
- package/src/ui/merged-sync-summary.ts +2 -18
- package/src/ui/settings-frame.ts +55 -0
- package/src/ui/settings-ui.ts +141 -43
- package/src/ui/setup/setup-prompts.ts +4 -3
- package/src/ui/sync-behavior.ts +15 -0
- package/src/ui/sync-format.ts +69 -38
- package/src/ui/transfer-changes.ts +33 -0
- package/src/ui/transfer-review.ts +27 -0
- package/dist/chunks/chunk-2DI6PDZV.ts.map +0 -7
- package/dist/chunks/chunk-3B4Z2SKV.ts.map +0 -7
- package/dist/chunks/chunk-4SBTAVFL.ts.map +0 -7
- package/dist/chunks/chunk-ANWNQIR7.ts.map +0 -7
- package/dist/chunks/chunk-HUTYAPFP.ts.map +0 -7
- package/dist/chunks/chunk-WFKUKVCP.ts.map +0 -7
- package/dist/chunks/manager-ui-IURS4WXY.ts.map +0 -7
- package/dist/chunks/sync-operations-QQ2GXKVC.ts.map +0 -7
- /package/dist/chunks/{chunk-ORQRHEEO.ts.map → chunk-26PMXY7E.ts.map} +0 -0
- /package/dist/chunks/{chunk-SDZCTCYQ.ts.map → chunk-2FETCGGT.ts.map} +0 -0
- /package/dist/chunks/{chunk-V6VZ5TLG.ts.map → chunk-A3TFXY4O.ts.map} +0 -0
- /package/dist/chunks/{chunk-5RZPINUQ.ts.map → chunk-AAZDBIBJ.ts.map} +0 -0
- /package/dist/chunks/{chunk-5ZWQ33XL.ts.map → chunk-CAGJOKB7.ts.map} +0 -0
- /package/dist/chunks/{chunk-IJ6VV6FN.ts.map → chunk-GC3QOL6J.ts.map} +0 -0
- /package/dist/chunks/{chunk-VHXBCEVF.ts.map → chunk-HMXUKU43.ts.map} +0 -0
- /package/dist/chunks/{chunk-CHSIAC4N.ts.map → chunk-R35N4CL3.ts.map} +0 -0
- /package/dist/chunks/{chunk-4QVPTIZB.ts.map → chunk-VCL7TZYW.ts.map} +0 -0
- /package/dist/chunks/{chunk-UQ3ALBIB.ts.map → chunk-YTHQEW35.ts.map} +0 -0
- /package/dist/chunks/{conflict-artifacts-BB2FZMIE.ts.map → conflict-artifacts-4CZFB7WI.ts.map} +0 -0
- /package/dist/chunks/{file-selection-WZX7HAY2.ts.map → file-selection-UNHBVVON.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-6MQKFCWB.ts.map → manager-result-dispatcher-HVRTPEVK.ts.map} +0 -0
- /package/dist/chunks/{merge-baseline-store-EVQAAML6.ts.map → merge-baseline-store-ICXVTCML.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-6LJJ4IMQ.ts.map → remote-selection-ui-H6AEVA3Q.ts.map} +0 -0
- /package/dist/chunks/{s3-backend-AQGV6LFT.ts.map → s3-backend-Y4P3O5B5.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-KTUWL6DE.ts.map → setup-switch-ZMW5C4M7.ts.map} +0 -0
- /package/dist/chunks/{setup-wizard-GSDPDFC4.ts.map → setup-wizard-VW7F3JN4.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-K45QVLHB.ts.map → sync-inspection-3EMS2J5B.ts.map} +0 -0
|
@@ -6,29 +6,35 @@ import {
|
|
|
6
6
|
} from "./chunk-BDB4IDM3.ts";
|
|
7
7
|
import {
|
|
8
8
|
createSyncBackend
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2FETCGGT.ts";
|
|
10
|
+
import {
|
|
11
|
+
createStartupTimings
|
|
12
|
+
} from "./chunk-UZPMDLTL.ts";
|
|
10
13
|
import {
|
|
11
14
|
throwIfAborted
|
|
12
15
|
} from "./chunk-PWMWOJP4.ts";
|
|
13
16
|
import {
|
|
14
17
|
readStateForConfig,
|
|
15
18
|
syncStateFingerprint
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VCL7TZYW.ts";
|
|
17
20
|
import {
|
|
18
21
|
createSnapshot,
|
|
19
22
|
inspectRemoteSelection
|
|
20
23
|
} from "./chunk-QOFMXPM5.ts";
|
|
21
24
|
|
|
22
25
|
// src/sync/sync-inspection.ts
|
|
23
|
-
async function inspectSync(config, options, signal, factory = createSyncBackend) {
|
|
26
|
+
async function inspectSync(config, options, signal, factory = createSyncBackend, timings = createStartupTimings()) {
|
|
24
27
|
throwIfAborted(signal);
|
|
25
|
-
const backend = await factory(config);
|
|
28
|
+
const backend = await timings.measure("backend initialization", () => factory(config));
|
|
26
29
|
throwIfAborted(signal);
|
|
27
|
-
const local = await
|
|
30
|
+
const local = await timings.measure(
|
|
31
|
+
"local snapshot",
|
|
32
|
+
() => createSnapshot(config.snapshotIdentity, { ...options, signal })
|
|
33
|
+
);
|
|
28
34
|
throwIfAborted(signal);
|
|
29
|
-
const state = await readStateForConfig(config);
|
|
35
|
+
const state = await timings.measure("sync state read", () => readStateForConfig(config));
|
|
30
36
|
throwIfAborted(signal);
|
|
31
|
-
const head = await backend.readHead(signal);
|
|
37
|
+
const head = await timings.measure("remote head", () => backend.readHead(signal));
|
|
32
38
|
throwIfAborted(signal);
|
|
33
39
|
return {
|
|
34
40
|
head,
|
|
@@ -47,4 +53,4 @@ async function inspectSync(config, options, signal, factory = createSyncBackend)
|
|
|
47
53
|
export {
|
|
48
54
|
inspectSync
|
|
49
55
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-XU2VXGQV.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sync/sync-inspection.ts"],
|
|
4
|
+
"sourcesContent": ["import { createSyncBackend, type SyncBackendFactory } from \"../backends/backend-factory.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\nimport { createSnapshot } from \"../snapshot/snapshot.js\";\nimport type { SnapshotOptions } from \"../snapshot/snapshot-types.js\";\nimport { readStateForConfig, syncStateFingerprint } from \"../state/sync-state-store.js\";\nimport { throwIfAborted } from \"./signals.js\";\nimport { createStartupTimings, type StartupTimings } from \"./startup-timings.js\";\nimport { inspectRemoteSelection } from \"./sync-policy.js\";\nimport { hasLocalChanges, remoteChangedSinceState } from \"./sync-state.js\";\n\n/** Advisory baseline-relative observation, never an authorization to transfer files. */\nexport async function inspectSync(\n config: AnySyncConfig,\n options: SnapshotOptions,\n signal?: AbortSignal,\n factory: SyncBackendFactory = createSyncBackend,\n timings: StartupTimings = createStartupTimings(),\n) {\n throwIfAborted(signal);\n const backend = await timings.measure(\"backend initialization\", () => factory(config));\n throwIfAborted(signal);\n const local = await timings.measure(\"local snapshot\", () =>\n createSnapshot(config.snapshotIdentity, { ...options, signal }),\n );\n throwIfAborted(signal);\n const state = await timings.measure(\"sync state read\", () => readStateForConfig(config));\n throwIfAborted(signal);\n const head = await timings.measure(\"remote head\", () => backend.readHead(signal));\n throwIfAborted(signal);\n return {\n head,\n selectionState: head ? inspectRemoteSelection(config.include, { selection: head.selection, files: [] }) : undefined,\n localFiles: local.files.length,\n localChanged: hasLocalChanges(local, state, config),\n remoteChanged: remoteChangedSinceState(head, state, config, (left, right) => backend.sameRevision(left, right)),\n firstSync: !state.lastAppliedSnapshot,\n emptyInclude: config.include.length === 0,\n stateIdentity: syncStateFingerprint(state),\n destination: backend.destination,\n capability: backend.capability,\n };\n}\n\nexport type SyncInspection = Awaited<ReturnType<typeof inspectSync>>;\n\nexport interface StartupObservation {\n setupName: string;\n configIdentity: string;\n checkedAt: string;\n automaticTransfer?: boolean;\n inspection: SyncInspection;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAWA,eAAsB,YACpB,QACA,SACA,QACA,UAA8B,mBAC9B,UAA0B,qBAAqB,GAC/C;AACA,iBAAe,MAAM;AACrB,QAAM,UAAU,MAAM,QAAQ,QAAQ,0BAA0B,MAAM,QAAQ,MAAM,CAAC;AACrF,iBAAe,MAAM;AACrB,QAAM,QAAQ,MAAM,QAAQ;AAAA,IAAQ;AAAA,IAAkB,MACpD,eAAe,OAAO,kBAAkB,EAAE,GAAG,SAAS,OAAO,CAAC;AAAA,EAChE;AACA,iBAAe,MAAM;AACrB,QAAM,QAAQ,MAAM,QAAQ,QAAQ,mBAAmB,MAAM,mBAAmB,MAAM,CAAC;AACvF,iBAAe,MAAM;AACrB,QAAM,OAAO,MAAM,QAAQ,QAAQ,eAAe,MAAM,QAAQ,SAAS,MAAM,CAAC;AAChF,iBAAe,MAAM;AACrB,SAAO;AAAA,IACL;AAAA,IACA,gBAAgB,OAAO,uBAAuB,OAAO,SAAS,EAAE,WAAW,KAAK,WAAW,OAAO,CAAC,EAAE,CAAC,IAAI;AAAA,IAC1G,YAAY,MAAM,MAAM;AAAA,IACxB,cAAc,gBAAgB,OAAO,OAAO,MAAM;AAAA,IAClD,eAAe,wBAAwB,MAAM,OAAO,QAAQ,CAAC,MAAM,UAAU,QAAQ,aAAa,MAAM,KAAK,CAAC;AAAA,IAC9G,WAAW,CAAC,MAAM;AAAA,IAClB,cAAc,OAAO,QAAQ,WAAW;AAAA,IACxC,eAAe,qBAAqB,KAAK;AAAA,IACzC,aAAa,QAAQ;AAAA,IACrB,YAAY,QAAQ;AAAA,EACtB;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
setSyncSetupCompletions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ITFR6NNQ.ts";
|
|
6
6
|
import {
|
|
7
7
|
safeTerminalText
|
|
8
8
|
} from "./chunk-AMJRUXFT.ts";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
syncConfigReviewIdentity,
|
|
14
14
|
syncSetupReviewIdentity,
|
|
15
15
|
updateLocalConfig
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KATKRR3D.ts";
|
|
17
17
|
import {
|
|
18
18
|
SetupPullRequiresUiError
|
|
19
19
|
} from "./chunk-7D5SF7P3.ts";
|
|
@@ -125,4 +125,4 @@ export {
|
|
|
125
125
|
saveOnSwitch,
|
|
126
126
|
useSyncSetup
|
|
127
127
|
};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-YTHQEW35.ts.map
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
conflictGroups,
|
|
7
7
|
readConflictArtifact,
|
|
8
8
|
saveConflictArtifact
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-26PMXY7E.ts";
|
|
10
10
|
import "./chunk-BDB4IDM3.ts";
|
|
11
11
|
import "./chunk-76NB4R7U.ts";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-VCL7TZYW.ts";
|
|
13
13
|
import "./chunk-BVVP33U5.ts";
|
|
14
14
|
import "./chunk-2JZFHNLM.ts";
|
|
15
15
|
import "./chunk-T2SJD3N7.ts";
|
|
@@ -24,4 +24,4 @@ export {
|
|
|
24
24
|
readConflictArtifact,
|
|
25
25
|
saveConflictArtifact
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=conflict-artifacts-
|
|
27
|
+
//# sourceMappingURL=conflict-artifacts-4CZFB7WI.ts.map
|
|
@@ -3,35 +3,36 @@
|
|
|
3
3
|
import {
|
|
4
4
|
confirmMergeReview,
|
|
5
5
|
mergeSync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-35GM6XKM.ts";
|
|
7
7
|
import {
|
|
8
8
|
conflictArtifactFingerprint,
|
|
9
9
|
readConflictArtifact
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-26PMXY7E.ts";
|
|
11
11
|
import "./chunk-BDB4IDM3.ts";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-A3TFXY4O.ts";
|
|
13
13
|
import {
|
|
14
14
|
createSyncBackend
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-2FETCGGT.ts";
|
|
16
|
+
import "./chunk-KGE47GCZ.ts";
|
|
17
17
|
import {
|
|
18
18
|
captureMutationOwner
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GC3QOL6J.ts";
|
|
20
|
+
import "./chunk-UZPMDLTL.ts";
|
|
20
21
|
import "./chunk-PWMWOJP4.ts";
|
|
21
22
|
import {
|
|
22
23
|
safeTerminalText
|
|
23
24
|
} from "./chunk-AMJRUXFT.ts";
|
|
24
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-E6ONFG57.ts";
|
|
25
26
|
import "./chunk-76NB4R7U.ts";
|
|
26
27
|
import {
|
|
27
28
|
readStateForConfig,
|
|
28
29
|
syncStateFingerprint
|
|
29
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VCL7TZYW.ts";
|
|
30
31
|
import "./chunk-BVVP33U5.ts";
|
|
31
32
|
import {
|
|
32
33
|
loadConfig,
|
|
33
34
|
syncCheckConfigFingerprint
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-KATKRR3D.ts";
|
|
35
36
|
import "./chunk-2JZFHNLM.ts";
|
|
36
37
|
import "./chunk-T2SJD3N7.ts";
|
|
37
38
|
import "./chunk-YDVQYUHE.ts";
|
|
@@ -172,4 +173,4 @@ async function showConflicts(ctx, options, factory = createSyncBackend) {
|
|
|
172
173
|
export {
|
|
173
174
|
showConflicts
|
|
174
175
|
};
|
|
175
|
-
//# sourceMappingURL=conflict-review-
|
|
176
|
+
//# sourceMappingURL=conflict-review-ZOTOHL2E.ts.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sync/conflict-review.ts", "../../src/sync/conflict-preview.ts"],
|
|
4
4
|
"sourcesContent": ["import type { ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { truncateToWidth } from \"@earendil-works/pi-tui\";\nimport { createSyncBackend, type SyncBackendFactory } from \"../backends/backend-factory.js\";\nimport type { CommandOptions } from \"../commands/command-types.js\";\nimport { loadConfig, syncCheckConfigFingerprint } from \"../settings/config.js\";\nimport { readStateForConfig, syncStateFingerprint } from \"../state/sync-state-store.js\";\nimport { confirmMergeReview } from \"../ui/merge-review.js\";\nimport { safeTerminalText } from \"../ui/terminal-text.js\";\nimport { conflictArtifactFingerprint, readConflictArtifact } from \"./conflict-artifacts.js\";\nimport { conflictPreview } from \"./conflict-preview.js\";\nimport { mergeSync } from \"./merged-sync.js\";\nimport { captureMutationOwner } from \"./sync-local.js\";\nexport async function showConflicts(\n ctx: ExtensionContext,\n options: CommandOptions,\n factory: SyncBackendFactory = createSyncBackend,\n) {\n const validate = captureMutationOwner(ctx, options.signal);\n const config = await loadConfig(options.setup);\n validate();\n const state = await readStateForConfig(config);\n validate();\n if (!state.unresolved?.length) {\n ctx.ui.notify(\"No recorded unresolved conflict groups.\", \"info\");\n return;\n }\n if (!ctx.hasUI) {\n ctx.ui.notify(\n `${state.unresolved.length} conflict groups remain unresolved. Review with TUI/RPC; no transfer performed.`,\n \"warning\",\n );\n return;\n }\n const backend = await factory(config);\n validate();\n const labels = state.unresolved.map(\n (group, index) =>\n `${index + 1}: ${group.paths.length} paths \u00B7 ${group.paths\n .slice(0, 3)\n .map((value) => truncateToWidth(safeTerminalText(value), 80))\n .join(\", \")}${group.paths.length > 3 ? \", \u2026\" : \"\"}`,\n );\n const choice = await ctx.ui.select(\"Review unresolved dependency group\", [...labels, \"Keep all unresolved\"], {\n signal: options.signal,\n });\n validate();\n const index = labels.indexOf(choice ?? \"\");\n if (index < 0) return;\n const reference = state.unresolved[index];\n if (!reference) return;\n const artifact = await readConflictArtifact(config, backend.identity, reference.artifact);\n validate();\n const groupIndex = artifact.groups.findIndex(\n (group) => JSON.stringify(group.paths) === JSON.stringify(reference.paths),\n );\n if (groupIndex < 0) throw new Error(\"Conflict reference is stale; refresh sync.\");\n const body = conflictPreview(artifact, reference.paths, backend.destination);\n if (\n !(await confirmMergeReview(\n ctx,\n \"Review private conflict versions\",\n body,\n options.signal,\n () => {\n try {\n validate();\n return true;\n } catch {\n return false;\n }\n },\n \"Continue to resolution choices\",\n ))\n )\n return;\n validate();\n const decision = await ctx.ui.select(\n \"Resolve the entire reviewed group\",\n [\"Keep unresolved\", \"Use local group\", \"Use remote group\"],\n { signal: options.signal },\n );\n validate();\n if (decision !== \"Use local group\" && decision !== \"Use remote group\") return;\n if (syncCheckConfigFingerprint(config) !== syncCheckConfigFingerprint(await loadConfig(options.setup)))\n throw new Error(\"Settings changed during conflict review.\");\n validate();\n await mergeSync(ctx, { ...options, yes: false, auto: false }, factory, {\n token: reference.artifact,\n group: groupIndex,\n source: decision === \"Use local group\" ? \"local\" : \"remote\",\n stateIdentity: syncStateFingerprint(state),\n artifactIdentity: conflictArtifactFingerprint(artifact),\n });\n validate();\n}\n", "import type { SnapshotFile } from \"../snapshot/snapshot-types.js\";\nimport { safeTerminalText } from \"../ui/terminal-text.js\";\nimport type { ConflictArtifact } from \"./conflict-artifacts.js\";\n\nexport const CONFLICT_DISPLAY_BYTES = 2 * 1024 * 1024;\nconst tooLarge = () =>\n new Error(\n \"Conflict review exceeds the 2 MiB display bound; inspect private evidence and use a reviewed explicit direction.\",\n );\n\n/** Index once and refuse a version before decoding if it cannot fit the remaining display budget. */\nexport function conflictPreview(artifact: ConflictArtifact, paths: readonly string[], destination: string) {\n const index = (files: SnapshotFile[]) => new Map(files.map((file) => [file.path, file]));\n const ancestors = index(artifact.ancestors ?? []);\n const local = index(artifact.local.files);\n const remote = index(artifact.remote.files);\n const parts: string[] = [];\n let size = 0;\n const remaining = () => CONFLICT_DISPLAY_BYTES - size - (parts.length ? 1 : 0);\n const append = (value: string, prefix = \"\") => {\n if (Buffer.byteLength(value) + Buffer.byteLength(prefix) > remaining()) throw tooLarge();\n // Sanitize at the display boundary, retaining line endings and raw evidence unchanged.\n parts.push(prefix + value.split(\"\\n\").map(safeTerminalText).join(\"\\n\"));\n size += Buffer.byteLength(prefix) + Buffer.byteLength(value) + (parts.length > 1 ? 1 : 0);\n };\n const version = (files: Map<string, SnapshotFile>, filePath: string) => {\n const file = files.get(filePath);\n if (!file) return append(\"(absent)\");\n append(file.sha256, \"sha256: \");\n if (Buffer.byteLength(file.contentBase64, \"base64\") > remaining()) throw tooLarge();\n const bytes = Buffer.from(file.contentBase64, \"base64\");\n let value: string;\n try {\n value = new TextDecoder(\"utf-8\", { fatal: true, ignoreBOM: true }).decode(bytes);\n } catch {\n return append(file.contentBase64, \"base64: \");\n }\n append(value);\n };\n append(safeTerminalText(destination), \"Storage: \");\n append(\n \"Private conflict versions. Historical artifact is not authority for changed bytes/head. No automatic activation.\",\n );\n for (const filePath of paths) {\n append(safeTerminalText(filePath), \"Path: \");\n append(\"Base:\");\n const hash = artifact.state.lastFileHashes[filePath];\n if (hash && !ancestors.has(filePath)) append(`(verified ancestor unavailable; sha256: ${hash})`);\n else version(ancestors, filePath);\n append(\"Local:\");\n version(local, filePath);\n append(\"Remote:\");\n version(remote, filePath);\n }\n return parts.join(\"\\n\");\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mapp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AAAA,IACrE,OAAO,UAAU;AAAA,IACjB,OAAO;AAAA,IACP,QAAQ,aAAa,oBAAoB,UAAU;AAAA,IACnD,eAAe,qBAAqB,KAAK;AAAA,IACzC,kBAAkB,4BAA4B,QAAQ;AAAA,EACxD,CAAC;AACD,WAAS;AACX;",
|
|
6
6
|
"names": ["index"]
|
|
7
7
|
}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
updateSyncSetup
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-R35N4CL3.ts";
|
|
6
6
|
import {
|
|
7
7
|
loadConfig,
|
|
8
8
|
localConfigPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KATKRR3D.ts";
|
|
10
10
|
import "./chunk-2JZFHNLM.ts";
|
|
11
11
|
import "./chunk-T2SJD3N7.ts";
|
|
12
12
|
import "./chunk-A6HU4ERM.ts";
|
|
@@ -279,4 +279,4 @@ function safeTerminalText(value) {
|
|
|
279
279
|
export {
|
|
280
280
|
showFileSelection
|
|
281
281
|
};
|
|
282
|
-
//# sourceMappingURL=file-selection-
|
|
282
|
+
//# sourceMappingURL=file-selection-UNHBVVON.ts.map
|
package/dist/chunks/{manager-result-dispatcher-6MQKFCWB.ts → manager-result-dispatcher-HVRTPEVK.ts}
RENAMED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
dispatchManagerResult
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-HMXUKU43.ts";
|
|
6
|
+
import "./chunk-CAGJOKB7.ts";
|
|
7
|
+
import "./chunk-A3TFXY4O.ts";
|
|
8
|
+
import "./chunk-2FETCGGT.ts";
|
|
9
9
|
import "./chunk-K3RIEL6J.ts";
|
|
10
10
|
import "./chunk-AMJRUXFT.ts";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-R35N4CL3.ts";
|
|
12
|
+
import "./chunk-KATKRR3D.ts";
|
|
13
13
|
import "./chunk-2JZFHNLM.ts";
|
|
14
14
|
import "./chunk-T2SJD3N7.ts";
|
|
15
15
|
import "./chunk-7D5SF7P3.ts";
|
|
@@ -20,4 +20,4 @@ import "./chunk-HUZ5CR4W.ts";
|
|
|
20
20
|
export {
|
|
21
21
|
dispatchManagerResult
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=manager-result-dispatcher-
|
|
23
|
+
//# sourceMappingURL=manager-result-dispatcher-HVRTPEVK.ts.map
|