@narumitw/pi-sync 0.57.9 → 0.57.11
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 +14 -0
- package/README.md +7 -1
- package/dist/chunks/{agent-candidate-GNEYR225.ts → agent-candidate-OCDPRI5G.ts} +12 -9
- package/dist/chunks/{agent-plan-3L7CRFDM.ts → agent-plan-P5B5RGZ7.ts} +22 -18
- package/dist/chunks/{agent-plan-3L7CRFDM.ts.map → agent-plan-P5B5RGZ7.ts.map} +1 -1
- package/dist/chunks/{agent-refusal-retry-RPTMUQXK.ts → agent-refusal-retry-476YGNU5.ts} +11 -8
- package/dist/chunks/{agent-refusal-retry-RPTMUQXK.ts.map → agent-refusal-retry-476YGNU5.ts.map} +1 -1
- package/dist/chunks/{agent-store-55CZOCPX.ts → agent-store-RJSMNOYP.ts} +12 -11
- package/dist/chunks/{agent-store-55CZOCPX.ts.map → agent-store-RJSMNOYP.ts.map} +1 -1
- package/dist/chunks/agent-sync-EUK2CPSS.ts +22 -0
- package/dist/chunks/{chunk-U3XRI2HF.ts → chunk-3IYAPMST.ts} +11 -11
- package/dist/chunks/{chunk-B4QZBDBT.ts → chunk-45COPAK7.ts} +10 -3
- package/dist/chunks/chunk-45COPAK7.ts.map +7 -0
- package/dist/chunks/chunk-5SFMBY5P.ts +26 -0
- package/dist/chunks/chunk-5SFMBY5P.ts.map +7 -0
- package/dist/chunks/{chunk-ED3TYIVW.ts → chunk-5TSCBBPP.ts} +5 -5
- package/dist/chunks/{chunk-5QAE3G3K.ts → chunk-67INJPKR.ts} +6 -6
- package/dist/chunks/{chunk-IWZH5KYS.ts → chunk-6LD5KX55.ts} +10 -10
- package/dist/chunks/{chunk-AAEEHR7H.ts → chunk-6O3EDBRL.ts} +2 -2
- package/dist/chunks/{chunk-CRKTAPSL.ts → chunk-7A35ZAVO.ts} +333 -237
- package/dist/chunks/chunk-7A35ZAVO.ts.map +7 -0
- package/dist/chunks/{chunk-6FVVRTL5.ts → chunk-7OLLPPLU.ts} +77 -63
- package/dist/chunks/chunk-7OLLPPLU.ts.map +7 -0
- package/dist/chunks/{chunk-PQW6GS4J.ts → chunk-7ZIYU5QS.ts} +12 -10
- package/dist/chunks/{chunk-PQW6GS4J.ts.map → chunk-7ZIYU5QS.ts.map} +1 -1
- package/dist/chunks/{chunk-S7QS4AWK.ts → chunk-AKMV47YC.ts} +5 -5
- package/dist/chunks/chunk-AR2DGDUI.ts +55 -0
- package/dist/chunks/chunk-AR2DGDUI.ts.map +7 -0
- package/dist/chunks/{chunk-GNH73BJ5.ts → chunk-BEST45H2.ts} +7 -7
- package/dist/chunks/chunk-CBLTWXAU.ts +114 -0
- package/dist/chunks/chunk-CBLTWXAU.ts.map +7 -0
- package/dist/chunks/{chunk-GP5DU62N.ts → chunk-CPT2BN6N.ts} +2 -2
- package/dist/chunks/{chunk-UPNVIUBN.ts → chunk-DN4IA7MR.ts} +6 -6
- package/dist/chunks/{chunk-PG7NMFP2.ts → chunk-DRTC4PKM.ts} +8 -8
- package/dist/chunks/chunk-ESKOPQVB.ts +348 -0
- package/dist/chunks/chunk-ESKOPQVB.ts.map +7 -0
- package/dist/chunks/{chunk-MKKF4IMY.ts → chunk-F7E3VFXU.ts} +5 -5
- package/dist/chunks/{chunk-HUZ5CR4W.ts → chunk-FHE2DCA2.ts} +3 -52
- package/dist/chunks/chunk-FHE2DCA2.ts.map +7 -0
- package/dist/chunks/{chunk-UBV24CG4.ts → chunk-FLHCOJCD.ts} +3 -3
- package/dist/chunks/chunk-GNYGNHFF.ts +27 -0
- package/dist/chunks/chunk-GNYGNHFF.ts.map +7 -0
- package/dist/chunks/chunk-KYTT7KV4.ts +319 -0
- package/dist/chunks/chunk-KYTT7KV4.ts.map +7 -0
- package/dist/chunks/{chunk-A6HU4ERM.ts → chunk-MKSMJPVA.ts} +6 -23
- package/dist/chunks/chunk-MKSMJPVA.ts.map +7 -0
- package/dist/chunks/{chunk-ORGBI36T.ts → chunk-OJARL2TG.ts} +4 -4
- package/dist/chunks/{chunk-JCH3VXIO.ts → chunk-OKPPZA4D.ts} +150 -91
- package/dist/chunks/chunk-OKPPZA4D.ts.map +7 -0
- package/dist/chunks/{chunk-QO333NM4.ts → chunk-OVBAW7KV.ts} +180 -133
- package/dist/chunks/chunk-OVBAW7KV.ts.map +7 -0
- package/dist/chunks/{chunk-GSNPASKB.ts → chunk-Q23JJW7E.ts} +6 -6
- package/dist/chunks/{chunk-YK52VDXG.ts → chunk-TIMWN2RH.ts} +10 -8
- package/dist/chunks/{chunk-YK52VDXG.ts.map → chunk-TIMWN2RH.ts.map} +1 -1
- package/dist/chunks/{chunk-UOHR7LRO.ts → chunk-TZC7GDJE.ts} +10 -22
- package/dist/chunks/chunk-TZC7GDJE.ts.map +7 -0
- package/dist/chunks/chunk-X7R6DCVF.ts +28 -0
- package/dist/chunks/chunk-X7R6DCVF.ts.map +7 -0
- package/dist/chunks/{chunk-76NB4R7U.ts → chunk-XJHQPB3E.ts} +2 -2
- package/dist/chunks/{chunk-BDB4IDM3.ts → chunk-Y4UVXOLQ.ts} +8 -6
- package/dist/chunks/{chunk-BDB4IDM3.ts.map → chunk-Y4UVXOLQ.ts.map} +1 -1
- package/dist/chunks/{chunk-P7DD5PWZ.ts → chunk-ZDDBZH72.ts} +3 -3
- package/dist/chunks/command-handler-F2E7A5T5.ts +548 -0
- package/dist/chunks/command-handler-F2E7A5T5.ts.map +7 -0
- package/dist/chunks/{config-KGIYTTXQ.ts → config-HYG7G5EM.ts} +7 -6
- package/dist/chunks/{conflict-artifacts-FXFIIBCB.ts → conflict-artifacts-J6WSDCWP.ts} +13 -9
- package/dist/chunks/{conflict-review-3X37QEIT.ts → conflict-review-2QMO2K6Q.ts} +31 -25
- package/dist/chunks/{conflict-review-3X37QEIT.ts.map → conflict-review-2QMO2K6Q.ts.map} +1 -1
- package/dist/chunks/{continuous-record-SQJ47CXN.ts → continuous-record-AH7JGYKM.ts} +8 -7
- package/dist/chunks/{continuous-sync-Q6QUD6TY.ts → continuous-sync-VRMXCA5X.ts} +33 -28
- package/dist/chunks/{continuous-sync-Q6QUD6TY.ts.map → continuous-sync-VRMXCA5X.ts.map} +1 -1
- package/dist/chunks/{file-selection-3JJYOVNR.ts → file-selection-IELTXSGZ.ts} +11 -10
- package/dist/chunks/{file-selection-3JJYOVNR.ts.map → file-selection-IELTXSGZ.ts.map} +1 -1
- package/dist/chunks/{git-backend-NYKSG5X6.ts → git-backend-KHD36W27.ts} +15 -12
- package/dist/chunks/{git-backend-NYKSG5X6.ts.map → git-backend-KHD36W27.ts.map} +1 -1
- package/dist/chunks/{local-fields-6DGYOOIK.ts → local-fields-JEKAPZKD.ts} +9 -5
- package/dist/chunks/manager-result-dispatcher-6W52NM7F.ts +32 -0
- package/dist/chunks/{manager-ui-ZH6DEC2G.ts → manager-ui-LM7DSJ2Y.ts} +124 -67
- package/dist/chunks/manager-ui-LM7DSJ2Y.ts.map +7 -0
- package/dist/chunks/{merge-baseline-store-RFCAH7KL.ts → merge-baseline-store-65GKUMXI.ts} +6 -5
- package/dist/chunks/remote-selection-ui-TD4C4W3J.ts +31 -0
- package/dist/chunks/{s3-backend-F7PR5FB3.ts → s3-backend-L24UZ6IK.ts} +24 -18
- package/dist/chunks/s3-backend-L24UZ6IK.ts.map +7 -0
- package/dist/chunks/{setup-switch-E7PHKI6J.ts → setup-switch-PIPXYPCW.ts} +6 -7
- package/dist/chunks/{setup-wizard-OVHZYXNW.ts → setup-wizard-RR5U3SUB.ts} +8 -9
- package/dist/chunks/{setup-wizard-OVHZYXNW.ts.map → setup-wizard-RR5U3SUB.ts.map} +1 -1
- package/dist/chunks/{snapshot-THS5EY2L.ts → snapshot-RGNDYT6A.ts} +10 -6
- package/dist/chunks/snapshot-transaction-26BQO36S.ts +24 -0
- package/dist/chunks/sync-inspection-MOMLGUTD.ts +25 -0
- package/dist/chunks/sync-inspection-MOMLGUTD.ts.map +7 -0
- package/dist/chunks/{sync-operations-Y72GNIQ2.ts → sync-operations-CV3TULLD.ts} +66 -57
- package/dist/chunks/{sync-operations-Y72GNIQ2.ts.map → sync-operations-CV3TULLD.ts.map} +1 -1
- package/dist/chunks/{sync-state-CFL4RRRB.ts → sync-state-7L4NT7W2.ts} +8 -5
- package/dist/chunks/sync-state-7L4NT7W2.ts.map +7 -0
- package/dist/chunks/{webdav-backend-TGFUH3SF.ts → webdav-backend-3ZCACILP.ts} +15 -12
- package/dist/chunks/{webdav-backend-TGFUH3SF.ts.map → webdav-backend-3ZCACILP.ts.map} +1 -1
- package/dist/index.ts +54 -537
- package/dist/index.ts.map +3 -3
- package/package.json +2 -2
- package/skills/configure-pi-sync/references/configuration.md +8 -1
- package/src/backends/s3/s3-client.ts +8 -1
- package/src/commands/command-execution.ts +8 -3
- package/src/paths.ts +6 -1
- package/src/settings/config-file.ts +205 -118
- package/src/settings/config.ts +2 -2
- package/src/settings/settings-management.ts +15 -1
- package/src/settings/settings-store.ts +0 -14
- package/src/settings/settings-validation.ts +1 -1
- package/src/snapshot/session-paths.ts +15 -2
- package/src/snapshot/snapshot-mutation-queues.ts +142 -0
- package/src/snapshot/snapshot-transaction-directory.ts +16 -0
- package/src/snapshot/snapshot-transaction.ts +123 -137
- package/src/sync/automatic-sync.ts +12 -6
- package/src/sync/local-field-policy.ts +29 -0
- package/src/sync/local-fields.ts +3 -29
- package/src/sync/merge-apply.ts +6 -0
- package/src/sync/mutation-owner.ts +22 -0
- package/src/sync/startup-check.ts +3 -2
- package/src/sync/sync-loaders.ts +4 -0
- package/src/sync/sync-local.ts +2 -19
- package/src/sync-extension.ts +7 -2
- package/src/ui/cancellable-operation.ts +36 -13
- package/src/ui/manager-state.ts +3 -1
- package/src/ui/manager-ui.ts +76 -24
- package/src/ui/remote-selection-ui.ts +131 -82
- package/src/ui/settings-ui.ts +2 -1
- package/dist/chunks/chunk-6FVVRTL5.ts.map +0 -7
- package/dist/chunks/chunk-A6HU4ERM.ts.map +0 -7
- package/dist/chunks/chunk-B4QZBDBT.ts.map +0 -7
- package/dist/chunks/chunk-CRKTAPSL.ts.map +0 -7
- package/dist/chunks/chunk-HUZ5CR4W.ts.map +0 -7
- package/dist/chunks/chunk-JCH3VXIO.ts.map +0 -7
- package/dist/chunks/chunk-QO333NM4.ts.map +0 -7
- package/dist/chunks/chunk-QOFMXPM5.ts +0 -735
- package/dist/chunks/chunk-QOFMXPM5.ts.map +0 -7
- package/dist/chunks/chunk-UOHR7LRO.ts.map +0 -7
- package/dist/chunks/manager-result-dispatcher-HOCM2GDA.ts +0 -24
- package/dist/chunks/manager-ui-ZH6DEC2G.ts.map +0 -7
- package/dist/chunks/remote-selection-ui-YFPGYGNE.ts +0 -23
- package/dist/chunks/s3-backend-F7PR5FB3.ts.map +0 -7
- package/dist/chunks/sync-inspection-J25EEKZK.ts +0 -21
- /package/dist/chunks/{agent-candidate-GNEYR225.ts.map → agent-candidate-OCDPRI5G.ts.map} +0 -0
- /package/dist/chunks/{config-KGIYTTXQ.ts.map → agent-sync-EUK2CPSS.ts.map} +0 -0
- /package/dist/chunks/{chunk-U3XRI2HF.ts.map → chunk-3IYAPMST.ts.map} +0 -0
- /package/dist/chunks/{chunk-ED3TYIVW.ts.map → chunk-5TSCBBPP.ts.map} +0 -0
- /package/dist/chunks/{chunk-5QAE3G3K.ts.map → chunk-67INJPKR.ts.map} +0 -0
- /package/dist/chunks/{chunk-IWZH5KYS.ts.map → chunk-6LD5KX55.ts.map} +0 -0
- /package/dist/chunks/{chunk-AAEEHR7H.ts.map → chunk-6O3EDBRL.ts.map} +0 -0
- /package/dist/chunks/{chunk-S7QS4AWK.ts.map → chunk-AKMV47YC.ts.map} +0 -0
- /package/dist/chunks/{chunk-GNH73BJ5.ts.map → chunk-BEST45H2.ts.map} +0 -0
- /package/dist/chunks/{chunk-GP5DU62N.ts.map → chunk-CPT2BN6N.ts.map} +0 -0
- /package/dist/chunks/{chunk-UPNVIUBN.ts.map → chunk-DN4IA7MR.ts.map} +0 -0
- /package/dist/chunks/{chunk-PG7NMFP2.ts.map → chunk-DRTC4PKM.ts.map} +0 -0
- /package/dist/chunks/{chunk-MKKF4IMY.ts.map → chunk-F7E3VFXU.ts.map} +0 -0
- /package/dist/chunks/{chunk-UBV24CG4.ts.map → chunk-FLHCOJCD.ts.map} +0 -0
- /package/dist/chunks/{chunk-ORGBI36T.ts.map → chunk-OJARL2TG.ts.map} +0 -0
- /package/dist/chunks/{chunk-GSNPASKB.ts.map → chunk-Q23JJW7E.ts.map} +0 -0
- /package/dist/chunks/{chunk-76NB4R7U.ts.map → chunk-XJHQPB3E.ts.map} +0 -0
- /package/dist/chunks/{chunk-P7DD5PWZ.ts.map → chunk-ZDDBZH72.ts.map} +0 -0
- /package/dist/chunks/{conflict-artifacts-FXFIIBCB.ts.map → config-HYG7G5EM.ts.map} +0 -0
- /package/dist/chunks/{continuous-record-SQJ47CXN.ts.map → conflict-artifacts-J6WSDCWP.ts.map} +0 -0
- /package/dist/chunks/{local-fields-6DGYOOIK.ts.map → continuous-record-AH7JGYKM.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-HOCM2GDA.ts.map → local-fields-JEKAPZKD.ts.map} +0 -0
- /package/dist/chunks/{merge-baseline-store-RFCAH7KL.ts.map → manager-result-dispatcher-6W52NM7F.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-YFPGYGNE.ts.map → merge-baseline-store-65GKUMXI.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-E7PHKI6J.ts.map → remote-selection-ui-TD4C4W3J.ts.map} +0 -0
- /package/dist/chunks/{snapshot-THS5EY2L.ts.map → setup-switch-PIPXYPCW.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-J25EEKZK.ts.map → snapshot-RGNDYT6A.ts.map} +0 -0
- /package/dist/chunks/{sync-state-CFL4RRRB.ts.map → snapshot-transaction-26BQO36S.ts.map} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
-
import {
|
|
4
|
-
setSyncStatus
|
|
5
|
-
} from "./chunk-K3RIEL6J.ts";
|
|
6
3
|
import {
|
|
7
4
|
safeTerminalText
|
|
8
5
|
} from "./chunk-AMJRUXFT.ts";
|
|
6
|
+
import {
|
|
7
|
+
setSyncStatus
|
|
8
|
+
} from "./chunk-K3RIEL6J.ts";
|
|
9
9
|
import {
|
|
10
10
|
syncCheckConfigFingerprint,
|
|
11
11
|
syncConfigReviewFingerprint
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OVBAW7KV.ts";
|
|
13
13
|
import {
|
|
14
14
|
compareSyncInclude,
|
|
15
15
|
sameSyncInclude
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KYTT7KV4.ts";
|
|
17
17
|
|
|
18
18
|
// src/ui/sync-attention.ts
|
|
19
19
|
import { truncateToWidth } from "@earendil-works/pi-tui";
|
|
@@ -164,4 +164,4 @@ export {
|
|
|
164
164
|
observationMatchesConfig,
|
|
165
165
|
observationSummary
|
|
166
166
|
};
|
|
167
|
-
//# sourceMappingURL=chunk-
|
|
167
|
+
//# sourceMappingURL=chunk-Q23JJW7E.ts.map
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
+
import {
|
|
4
|
+
sameLocalFields,
|
|
5
|
+
validatePortableSnapshot
|
|
6
|
+
} from "./chunk-MKSMJPVA.ts";
|
|
3
7
|
import {
|
|
4
8
|
safeTerminalText
|
|
5
9
|
} from "./chunk-AMJRUXFT.ts";
|
|
6
10
|
import {
|
|
7
11
|
syncConfigReviewFingerprint
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
sameLocalFields,
|
|
11
|
-
validatePortableSnapshot
|
|
12
|
-
} from "./chunk-A6HU4ERM.ts";
|
|
12
|
+
} from "./chunk-OVBAW7KV.ts";
|
|
13
13
|
import {
|
|
14
14
|
throwIfAborted
|
|
15
15
|
} from "./chunk-PWMWOJP4.ts";
|
|
16
16
|
import {
|
|
17
|
-
filterSnapshotForConfigPolicy
|
|
17
|
+
filterSnapshotForConfigPolicy
|
|
18
|
+
} from "./chunk-ESKOPQVB.ts";
|
|
19
|
+
import {
|
|
18
20
|
inspectRemoteSelection,
|
|
19
21
|
remoteSelectionMismatch,
|
|
20
22
|
sameSyncInclude,
|
|
21
23
|
snapshotSelectionInclude
|
|
22
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-KYTT7KV4.ts";
|
|
23
25
|
|
|
24
26
|
// src/sync/remote-snapshot.ts
|
|
25
27
|
async function readSnapshotForHead(backend, head, signal) {
|
|
@@ -84,4 +86,4 @@ export {
|
|
|
84
86
|
formatRemoteSelectionStatus,
|
|
85
87
|
readRemoteSnapshot
|
|
86
88
|
};
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-TIMWN2RH.ts.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sync/remote-snapshot.ts"],
|
|
4
4
|
"sourcesContent": ["import type { RemoteHead, SyncBackend } from \"../backends/sync-backend.js\";\nimport { syncConfigReviewFingerprint } from \"../settings/config.js\";\nimport type { AnySyncConfig } from \"../settings/settings-types.js\";\nimport { filterSnapshotForConfigPolicy } from \"../snapshot/snapshot.js\";\nimport type { Snapshot } from \"../snapshot/snapshot-types.js\";\nimport { safeTerminalText } from \"../ui/terminal-text.js\";\nimport { sameLocalFields, validatePortableSnapshot } from \"./local-fields.js\";\nimport { throwIfAborted } from \"./signals.js\";\nimport {\n inspectRemoteSelection,\n type RemoteSelectionState,\n remoteSelectionMismatch,\n sameSyncInclude,\n snapshotSelectionInclude,\n} from \"./sync-policy.js\";\n\nexport async function readSnapshotForHead(backend: SyncBackend, head: RemoteHead, signal?: AbortSignal) {\n const snapshot = await backend.readSnapshot(head.snapshotRef, signal);\n throwIfAborted(signal);\n validatePortableSnapshot(snapshot);\n if (snapshot.id !== head.snapshotId) {\n throw new Error(`Remote head ${head.snapshotId} resolved to unexpected snapshot ${snapshot.id}.`);\n }\n if (head.selection) {\n const snapshotInclude = snapshotSelectionInclude(snapshot);\n if (!snapshotInclude || !sameSyncInclude(head.selection.include, snapshotInclude)) {\n throw new Error(\"Remote head selection does not match its immutable snapshot.\");\n }\n }\n return snapshot;\n}\n\nexport function requireCompatibleRemoteSelection(config: AnySyncConfig, snapshot: Snapshot) {\n if (!sameLocalFields(config.localFields, snapshot.localFields))\n throw new Error(\n \"Remote local-field policy differs; confirm a reviewed directional migration. Old history is not erased.\",\n );\n const state = inspectRemoteSelection(config.include, snapshot);\n if (state.kind === \"different\") {\n throw remoteSelectionMismatch(config, state.include, syncConfigReviewFingerprint(config));\n }\n}\n\nexport function formatRemoteSelectionStatus(state: RemoteSelectionState | undefined) {\n if (!state) return \"remote included content: unavailable (remote is empty)\";\n if (state.kind === \"same\") return \"remote included content: matches this setup\";\n if (state.kind === \"legacy\") {\n return `remote included content: unavailable in legacy snapshot (${state.discovered.length} path${state.discovered.length === 1 ? \"\" : \"s\"} discovered, partial)`;\n }\n return [\n \"remote included content: differs from this setup\",\n `remote-only selection: ${safeList(state.remoteOnly)}`,\n `local-only selection: ${safeList(state.localOnly)}`,\n ].join(\"\\n\");\n}\n\nfunction safeList(values: readonly string[]) {\n return values.length > 0 ? values.map(safeTerminalText).join(\", \") : \"none\";\n}\n\nexport async function readRemoteSnapshot(\n backend: SyncBackend,\n config: AnySyncConfig,\n signal?: AbortSignal,\n options: { allowSelectionDifference?: boolean } = {},\n) {\n const head = await backend.readHead(signal);\n if (!head) return { head: undefined, snapshot: undefined, selectionState: undefined };\n const snapshot = await readSnapshotForHead(backend, head, signal);\n const selectionState = inspectRemoteSelection(config.include, snapshot);\n if (!options.allowSelectionDifference && selectionState.kind === \"different\") {\n const configIdentity = syncConfigReviewFingerprint(config);\n throw remoteSelectionMismatch(config, selectionState.include, configIdentity);\n }\n return {\n head,\n snapshot: filterSnapshotForConfigPolicy(snapshot, config),\n selectionState,\n };\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,eAAsB,oBAAoB,SAAsB,MAAkB,QAAsB;AACtG,QAAM,WAAW,MAAM,QAAQ,aAAa,KAAK,aAAa,MAAM;AACpE,iBAAe,MAAM;AACrB,2BAAyB,QAAQ;AACjC,MAAI,SAAS,OAAO,KAAK,YAAY;AACnC,UAAM,IAAI,MAAM,eAAe,KAAK,UAAU,oCAAoC,SAAS,EAAE,GAAG;AAAA,EAClG;AACA,MAAI,KAAK,WAAW;AAClB,UAAM,kBAAkB,yBAAyB,QAAQ;AACzD,QAAI,CAAC,mBAAmB,CAAC,gBAAgB,KAAK,UAAU,SAAS,eAAe,GAAG;AACjF,YAAM,IAAI,MAAM,8DAA8D;AAAA,IAChF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,iCAAiC,QAAuB,UAAoB;AAC1F,MAAI,CAAC,gBAAgB,OAAO,aAAa,SAAS,WAAW;AAC3D,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AACF,QAAM,QAAQ,uBAAuB,OAAO,SAAS,QAAQ;AAC7D,MAAI,MAAM,SAAS,aAAa;AAC9B,UAAM,wBAAwB,QAAQ,MAAM,SAAS,4BAA4B,MAAM,CAAC;AAAA,EAC1F;AACF;AAEO,SAAS,4BAA4B,OAAyC;AACnF,MAAI,CAAC,MAAO,QAAO;AACnB,MAAI,MAAM,SAAS,OAAQ,QAAO;AAClC,MAAI,MAAM,SAAS,UAAU;AAC3B,WAAO,4DAA4D,MAAM,WAAW,MAAM,QAAQ,MAAM,WAAW,WAAW,IAAI,KAAK,GAAG;AAAA,EAC5I;AACA,SAAO;AAAA,IACL;AAAA,IACA,0BAA0B,SAAS,MAAM,UAAU,CAAC;AAAA,IACpD,yBAAyB,SAAS,MAAM,SAAS,CAAC;AAAA,EACpD,EAAE,KAAK,IAAI;AACb;AAEA,SAAS,SAAS,QAA2B;AAC3C,SAAO,OAAO,SAAS,IAAI,OAAO,IAAI,gBAAgB,EAAE,KAAK,IAAI,IAAI;AACvE;AAEA,eAAsB,mBACpB,SACA,QACA,QACA,UAAkD,CAAC,GACnD;AACA,QAAM,OAAO,MAAM,QAAQ,SAAS,MAAM;AAC1C,MAAI,CAAC,KAAM,QAAO,EAAE,MAAM,QAAW,UAAU,QAAW,gBAAgB,OAAU;AACpF,QAAM,WAAW,MAAM,oBAAoB,SAAS,MAAM,MAAM;AAChE,QAAM,iBAAiB,uBAAuB,OAAO,SAAS,QAAQ;AACtE,MAAI,CAAC,QAAQ,4BAA4B,eAAe,SAAS,aAAa;AAC5E,UAAM,iBAAiB,4BAA4B,MAAM;AACzD,UAAM,wBAAwB,QAAQ,eAAe,SAAS,cAAc;AAAA,EAC9E;AACA,SAAO;AAAA,IACL;AAAA,IACA,UAAU,8BAA8B,UAAU,MAAM;AAAA,IACxD;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
3
|
import {
|
|
4
4
|
encodeSnapshot
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FLHCOJCD.ts";
|
|
6
6
|
import {
|
|
7
7
|
throwIfAborted
|
|
8
8
|
} from "./chunk-PWMWOJP4.ts";
|
|
9
9
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
sessionDirFromContext,
|
|
13
|
-
sessionSnapshotPathFromAbsolute
|
|
14
|
-
} from "./chunk-QOFMXPM5.ts";
|
|
10
|
+
syncDirectory
|
|
11
|
+
} from "./chunk-AR2DGDUI.ts";
|
|
15
12
|
import {
|
|
16
13
|
stateDir
|
|
17
14
|
} from "./chunk-SWRVXVFD.ts";
|
|
18
15
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
createSnapshot,
|
|
17
|
+
sessionSnapshotPathFromAbsolute
|
|
18
|
+
} from "./chunk-ESKOPQVB.ts";
|
|
19
|
+
import {
|
|
20
|
+
sessionDirFromContext
|
|
21
|
+
} from "./chunk-CBLTWXAU.ts";
|
|
21
22
|
|
|
22
23
|
// src/sync/sync-local.ts
|
|
23
24
|
import fs from "node:fs/promises";
|
|
@@ -29,18 +30,6 @@ function protectedSessionPaths(ctx, sessionRoot = sessionDirFromContext(ctx)) {
|
|
|
29
30
|
const snapshotPath = sessionFile ? sessionSnapshotPathFromAbsolute(sessionFile, sessionRoot) : void 0;
|
|
30
31
|
return snapshotPath ? /* @__PURE__ */ new Set([snapshotPath]) : /* @__PURE__ */ new Set();
|
|
31
32
|
}
|
|
32
|
-
function captureMutationOwner(ctx, signal) {
|
|
33
|
-
const manager = ctx.sessionManager;
|
|
34
|
-
const file = manager.getSessionFile?.();
|
|
35
|
-
const id = manager.getSessionId?.();
|
|
36
|
-
const cwd = manager.getCwd?.();
|
|
37
|
-
const root = agentDir();
|
|
38
|
-
return () => {
|
|
39
|
-
throwIfAborted(signal);
|
|
40
|
-
if (ctx.sessionManager !== manager || manager.getSessionFile?.() !== file || manager.getSessionId?.() !== id || manager.getCwd?.() !== cwd || agentDir() !== root)
|
|
41
|
-
throw new Error("Session changed during file mutation; evidence retained for review.");
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
33
|
async function backupLocal(profile, options = {}, signal) {
|
|
45
34
|
throwIfAborted(signal);
|
|
46
35
|
const snapshot = await createSnapshot(profile, { ...options, signal });
|
|
@@ -64,7 +53,6 @@ async function backupLocal(profile, options = {}, signal) {
|
|
|
64
53
|
|
|
65
54
|
export {
|
|
66
55
|
protectedSessionPaths,
|
|
67
|
-
captureMutationOwner,
|
|
68
56
|
backupLocal
|
|
69
57
|
};
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-TZC7GDJE.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sync/sync-local.ts"],
|
|
4
|
+
"sourcesContent": ["import fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { ExtensionCommandContext, ExtensionContext } from \"@earendil-works/pi-coding-agent\";\nimport { sessionDirFromContext } from \"../snapshot/session-paths.js\";\nimport { createSnapshot, sessionSnapshotPathFromAbsolute } from \"../snapshot/snapshot.js\";\nimport { encodeSnapshot } from \"../snapshot/snapshot-codec.js\";\nimport type { SnapshotOptions } from \"../snapshot/snapshot-types.js\";\nimport { syncDirectory } from \"../state/json-file.js\";\nimport { stateDir } from \"../state/state-directory.js\";\nimport { throwIfAborted } from \"./signals.js\";\n\nexport function protectedSessionPaths(\n ctx: ExtensionCommandContext | ExtensionContext,\n sessionRoot = sessionDirFromContext(ctx),\n) {\n const getSessionFile = ctx.sessionManager.getSessionFile;\n if (typeof getSessionFile !== \"function\") return new Set<string>();\n const sessionFile = getSessionFile.call(ctx.sessionManager) as string | undefined;\n const snapshotPath = sessionFile ? sessionSnapshotPathFromAbsolute(sessionFile, sessionRoot) : undefined;\n return snapshotPath ? new Set([snapshotPath]) : new Set<string>();\n}\n\nexport { captureMutationOwner } from \"./mutation-owner.js\";\n\nexport async function backupLocal(profile: string, options: SnapshotOptions = {}, signal?: AbortSignal) {\n throwIfAborted(signal);\n const snapshot = await createSnapshot(profile, { ...options, signal });\n throwIfAborted(signal);\n const backupDirectory = path.join(stateDir(), \"backups\");\n await fs.mkdir(backupDirectory, { recursive: true, mode: 0o700 });\n throwIfAborted(signal);\n const backupPath = path.join(backupDirectory, `${snapshot.id}.json.gz`);\n const encoded = await encodeSnapshot(snapshot);\n throwIfAborted(signal);\n const handle = await fs.open(backupPath, \"wx\", 0o600);\n try {\n await handle.writeFile(encoded);\n await handle.sync();\n } finally {\n await handle.close();\n }\n await syncDirectory(backupDirectory);\n return backupPath;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAUV,SAAS,sBACd,KACA,cAAc,sBAAsB,GAAG,GACvC;AACA,QAAM,iBAAiB,IAAI,eAAe;AAC1C,MAAI,OAAO,mBAAmB,WAAY,QAAO,oBAAI,IAAY;AACjE,QAAM,cAAc,eAAe,KAAK,IAAI,cAAc;AAC1D,QAAM,eAAe,cAAc,gCAAgC,aAAa,WAAW,IAAI;AAC/F,SAAO,eAAe,oBAAI,IAAI,CAAC,YAAY,CAAC,IAAI,oBAAI,IAAY;AAClE;AAIA,eAAsB,YAAY,SAAiB,UAA2B,CAAC,GAAG,QAAsB;AACtG,iBAAe,MAAM;AACrB,QAAM,WAAW,MAAM,eAAe,SAAS,EAAE,GAAG,SAAS,OAAO,CAAC;AACrE,iBAAe,MAAM;AACrB,QAAM,kBAAkB,KAAK,KAAK,SAAS,GAAG,SAAS;AACvD,QAAM,GAAG,MAAM,iBAAiB,EAAE,WAAW,MAAM,MAAM,IAAM,CAAC;AAChE,iBAAe,MAAM;AACrB,QAAM,aAAa,KAAK,KAAK,iBAAiB,GAAG,SAAS,EAAE,UAAU;AACtE,QAAM,UAAU,MAAM,eAAe,QAAQ;AAC7C,iBAAe,MAAM;AACrB,QAAM,SAAS,MAAM,GAAG,KAAK,YAAY,MAAM,GAAK;AACpD,MAAI;AACF,UAAM,OAAO,UAAU,OAAO;AAC9B,UAAM,OAAO,KAAK;AAAA,EACpB,UAAE;AACA,UAAM,OAAO,MAAM;AAAA,EACrB;AACA,QAAM,cAAc,eAAe;AACnC,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// @generated by scripts/build-runtime.mjs; do not edit.
|
|
2
|
+
// @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
|
|
3
|
+
|
|
4
|
+
// src/sync/local-field-policy.ts
|
|
5
|
+
function normalizeLocalFields(value) {
|
|
6
|
+
if (value === void 0) return [];
|
|
7
|
+
if (!Array.isArray(value) || value.length > 128 || value.some(
|
|
8
|
+
(field) => typeof field !== "string" || !field || field.length > 128 || /[\p{Cc}\p{Cf}\p{Cs}]/u.test(field) || ["__proto__", "constructor", "prototype"].includes(field)
|
|
9
|
+
))
|
|
10
|
+
throw new Error("localFields must be at most 128 safe settings.json root field names.");
|
|
11
|
+
if (new Set(value).size !== value.length) throw new Error("Duplicate localFields rule.");
|
|
12
|
+
for (const [first, second] of [
|
|
13
|
+
["defaultProvider", "defaultModel"],
|
|
14
|
+
["skills", "enableSkillCommands"],
|
|
15
|
+
["queueMode", "steeringMode"],
|
|
16
|
+
["websockets", "transport"],
|
|
17
|
+
["enableAnalytics", "trackingId"]
|
|
18
|
+
]) {
|
|
19
|
+
if (value.includes(first) !== value.includes(second))
|
|
20
|
+
throw new Error("Coupled settings fields must be excluded together.");
|
|
21
|
+
}
|
|
22
|
+
return [...value].sort();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
normalizeLocalFields
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=chunk-X7R6DCVF.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/sync/local-field-policy.ts"],
|
|
4
|
+
"sourcesContent": ["/** Initial rules select whole root fields of the global settings.json only. */\nexport function normalizeLocalFields(value: unknown): string[] {\n if (value === undefined) return [];\n if (\n !Array.isArray(value) ||\n value.length > 128 ||\n value.some(\n (field) =>\n typeof field !== \"string\" ||\n !field ||\n field.length > 128 ||\n /[\\p{Cc}\\p{Cf}\\p{Cs}]/u.test(field) ||\n [\"__proto__\", \"constructor\", \"prototype\"].includes(field),\n )\n )\n throw new Error(\"localFields must be at most 128 safe settings.json root field names.\");\n if (new Set(value).size !== value.length) throw new Error(\"Duplicate localFields rule.\");\n for (const [first, second] of [\n [\"defaultProvider\", \"defaultModel\"],\n [\"skills\", \"enableSkillCommands\"],\n [\"queueMode\", \"steeringMode\"],\n [\"websockets\", \"transport\"],\n [\"enableAnalytics\", \"trackingId\"],\n ]) {\n if (value.includes(first) !== value.includes(second))\n throw new Error(\"Coupled settings fields must be excluded together.\");\n }\n return [...value].sort();\n}\n"],
|
|
5
|
+
"mappings": ";;;;AACO,SAAS,qBAAqB,OAA0B;AAC7D,MAAI,UAAU,OAAW,QAAO,CAAC;AACjC,MACE,CAAC,MAAM,QAAQ,KAAK,KACpB,MAAM,SAAS,OACf,MAAM;AAAA,IACJ,CAAC,UACC,OAAO,UAAU,YACjB,CAAC,SACD,MAAM,SAAS,OACf,wBAAwB,KAAK,KAAK,KAClC,CAAC,aAAa,eAAe,WAAW,EAAE,SAAS,KAAK;AAAA,EAC5D;AAEA,UAAM,IAAI,MAAM,sEAAsE;AACxF,MAAI,IAAI,IAAI,KAAK,EAAE,SAAS,MAAM,OAAQ,OAAM,IAAI,MAAM,6BAA6B;AACvF,aAAW,CAAC,OAAO,MAAM,KAAK;AAAA,IAC5B,CAAC,mBAAmB,cAAc;AAAA,IAClC,CAAC,UAAU,qBAAqB;AAAA,IAChC,CAAC,aAAa,cAAc;AAAA,IAC5B,CAAC,cAAc,WAAW;AAAA,IAC1B,CAAC,mBAAmB,YAAY;AAAA,EAClC,GAAG;AACD,QAAI,MAAM,SAAS,KAAK,MAAM,MAAM,SAAS,MAAM;AACjD,YAAM,IAAI,MAAM,oDAAoD;AAAA,EACxE;AACA,SAAO,CAAC,GAAG,KAAK,EAAE,KAAK;AACzB;",
|
|
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
|
isDeniedPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-FHE2DCA2.ts";
|
|
6
6
|
|
|
7
7
|
// src/sync/file-merge-planner.ts
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
@@ -104,4 +104,4 @@ export {
|
|
|
104
104
|
mergePathIdentity,
|
|
105
105
|
collidingPaths
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
107
|
+
//# sourceMappingURL=chunk-XJHQPB3E.ts.map
|
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
import {
|
|
4
4
|
portableSnapshot,
|
|
5
5
|
sameLocalFields
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MKSMJPVA.ts";
|
|
7
|
+
import {
|
|
8
|
+
filterSnapshotForConfigPolicy,
|
|
9
|
+
isSessionPath
|
|
10
|
+
} from "./chunk-ESKOPQVB.ts";
|
|
7
11
|
import {
|
|
8
12
|
canonicalSnapshotPathForConfig,
|
|
9
13
|
customIncludePathsByLower,
|
|
10
|
-
filterSnapshotForConfigPolicy,
|
|
11
14
|
includeFromSelectionConfig,
|
|
12
15
|
isConfiguredSnapshotPath,
|
|
13
|
-
isSessionPath,
|
|
14
16
|
normalizeSyncInclude
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KYTT7KV4.ts";
|
|
16
18
|
import {
|
|
17
19
|
toPosix
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FHE2DCA2.ts";
|
|
19
21
|
|
|
20
22
|
// src/sync/sync-state.ts
|
|
21
23
|
function hasLocalChanges(local, state, config) {
|
|
@@ -118,4 +120,4 @@ export {
|
|
|
118
120
|
canPullRemoteSettingsOnFirstSync,
|
|
119
121
|
canPullRemoteSessionsOnFirstSync
|
|
120
122
|
};
|
|
121
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-Y4UVXOLQ.ts.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/sync/sync-state.ts"],
|
|
4
4
|
"sourcesContent": ["import type { RemoteHead } from \"../backends/sync-backend.js\";\nimport { toPosix } from \"../paths.js\";\nimport {\n canonicalSnapshotPathForConfig,\n filterSnapshotForConfigPolicy,\n isConfiguredSnapshotPath,\n isSessionPath,\n} from \"../snapshot/snapshot.js\";\nimport type { Snapshot } from \"../snapshot/snapshot-types.js\";\nimport type { SyncState } from \"../state/state-types.js\";\nimport { portableSnapshot, sameLocalFields } from \"./local-fields.js\";\nimport {\n customIncludePathsByLower,\n includeFromSelectionConfig,\n normalizeSyncInclude,\n type SyncSelectionConfig,\n} from \"./sync-policy.js\";\n\ntype SyncPolicyConfig = SyncSelectionConfig & { localFields?: string[] };\n\nexport function hasLocalChanges(local: Snapshot, state: SyncState, config: SyncPolicyConfig) {\n return (\n (Boolean(state.lastAppliedSnapshot) && !sameLocalFields(state.localFields, config.localFields)) ||\n !sameHashes(fileHashMap(portableSnapshot(local, config.localFields)), stateHashMapForConfig(state, config))\n );\n}\n\nexport function remoteChangedSinceState(\n head: RemoteHead | undefined,\n state: SyncState,\n config: SyncPolicyConfig,\n sameRevision: (left: string, right: string) => boolean,\n) {\n if (!head) return Boolean(state.lastAppliedSnapshot);\n if (head.snapshotId !== state.lastAppliedSnapshot) return true;\n if (state.lastRemoteRevision && !sameRevision(head.revision, state.lastRemoteRevision)) return true;\n if (syncPolicyChanged(state, config)) return true;\n return (\n includeFromSelectionConfig(config).includes(\"sessions\") && !state.include?.includes(\"sessions\") && head.syncSessions\n );\n}\n\nexport function hasRemoteChanges(\n remote: Snapshot,\n state: SyncState,\n config: SyncPolicyConfig,\n ignoredPaths = new Set<string>(),\n) {\n if (remote.id === state.lastAppliedSnapshot && !syncPolicyChanged(state, config)) return false;\n return !snapshotHashesMatchState(\n portableSnapshot(filterSnapshotForConfigPolicy(remote, config), remote.localFields),\n state,\n config,\n ignoredPaths,\n );\n}\n\nexport function sameHashes(left: Record<string, string>, right: Record<string, string>) {\n const keys = new Set([...Object.keys(left), ...Object.keys(right)]);\n for (const key of keys) if (left[key] !== right[key]) return false;\n return true;\n}\n\nexport function fileHashMap(snapshot: Snapshot) {\n return Object.fromEntries(snapshot.files.map((file) => [file.path, file.sha256]));\n}\n\nfunction stateHashMapForConfig(state: SyncState, config: SyncPolicyConfig) {\n const includePaths = customIncludePathsByLower(includeFromSelectionConfig(config));\n return Object.fromEntries(\n Object.entries(state.lastFileHashes)\n .filter(([filePath]) => isConfiguredSnapshotPath(filePath, config))\n .map(([filePath, hash]) => [canonicalSnapshotPathForConfig(filePath, includePaths), hash]),\n );\n}\n\nexport function snapshotHashesMatchState(\n snapshot: Snapshot,\n state: SyncState,\n config: SyncPolicyConfig,\n ignoredPaths = new Set<string>(),\n) {\n return sameHashes(\n withoutHashPaths(fileHashMap(snapshot), ignoredPaths),\n withoutHashPaths(stateHashMapForConfig(state, config), ignoredPaths),\n );\n}\n\nexport function snapshotsMatch(left: Snapshot, right: Snapshot) {\n return left.syncSessions === right.syncSessions && sameHashes(fileHashMap(left), fileHashMap(right));\n}\n\nfunction withoutHashPaths(hashes: Record<string, string>, ignoredPaths: Set<string>) {\n if (ignoredPaths.size === 0) return hashes;\n return Object.fromEntries(Object.entries(hashes).filter(([filePath]) => !ignoredPaths.has(toPosix(filePath))));\n}\n\nexport function syncPolicyChanged(state: SyncState, config: SyncPolicyConfig) {\n return syncIncludeChanged(state, config) || !sameLocalFields(state.localFields, config.localFields);\n}\n\nexport function shouldRefreshSyncedState(\n remote: Snapshot,\n head: RemoteHead | undefined,\n state: SyncState,\n config: SyncPolicyConfig,\n sameRevision: (left: string, right: string) => boolean,\n) {\n return (\n remote.id !== state.lastAppliedSnapshot ||\n Boolean(head && (!state.lastRemoteRevision || !sameRevision(head.revision, state.lastRemoteRevision))) ||\n syncPolicyChanged(state, config)\n );\n}\n\nfunction syncIncludeChanged(state: SyncState, config: SyncPolicyConfig) {\n const stored = state.include ? normalizeSyncInclude(state.include) : includeFromSelectionConfig(state);\n const current = includeFromSelectionConfig(config);\n return stored.length !== current.length || stored.some((item, index) => item !== current[index]);\n}\n\nexport function settingsHashMap(snapshot: Snapshot) {\n return Object.fromEntries(\n snapshot.files.filter((file) => !isSessionPath(file.path)).map((file) => [file.path, file.sha256]),\n );\n}\n\nexport function sessionHashMap(snapshot: Snapshot) {\n return Object.fromEntries(\n snapshot.files.filter((file) => isSessionPath(file.path)).map((file) => [file.path, file.sha256]),\n );\n}\n\nexport function settingsHashMapFromState(state: SyncState) {\n return Object.fromEntries(Object.entries(state.lastFileHashes).filter(([filePath]) => !isSessionPath(filePath)));\n}\n\nexport function settingsHashesMatchState(remote: Snapshot, state: SyncState) {\n return sameHashes(settingsHashMap(remote), settingsHashMapFromState(state));\n}\n\nexport function canPullRemoteSettingsOnFirstSync(local: Snapshot, remote: Snapshot) {\n const remoteSettings = settingsHashMap(remote);\n return Object.entries(settingsHashMap(local)).every(([filePath, hash]) => remoteSettings[filePath] === hash);\n}\n\nexport function canPullRemoteSessionsOnFirstSync(local: Snapshot, remote: Snapshot) {\n const localSessions = sessionHashMap(local);\n const remoteSessions = sessionHashMap(remote);\n return Object.entries(localSessions).every(([filePath, hash]) => remoteSessions[filePath] === hash);\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
runCancellableOperation,
|
|
5
5
|
showRemoteSelectionReview
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OKPPZA4D.ts";
|
|
7
7
|
import {
|
|
8
8
|
safeTerminalText
|
|
9
9
|
} from "./chunk-AMJRUXFT.ts";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
loadConfig,
|
|
15
15
|
syncConfigReviewIdentity
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OVBAW7KV.ts";
|
|
17
17
|
|
|
18
18
|
// src/ui/sync-resolution-ui.ts
|
|
19
19
|
import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
|
|
@@ -206,4 +206,4 @@ async function dispatchManagerResult(ctx, initialResult, origin, runRoute, signa
|
|
|
206
206
|
export {
|
|
207
207
|
dispatchManagerResult
|
|
208
208
|
};
|
|
209
|
-
//# sourceMappingURL=chunk-
|
|
209
|
+
//# sourceMappingURL=chunk-ZDDBZH72.ts.map
|