@narumitw/pi-sync 0.60.5 → 0.62.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 +25 -0
- package/README.md +32 -23
- package/dist/chunks/{chunk-F64YWRXG.ts → chunk-3E3TR3JE.ts} +4 -4
- package/dist/chunks/{chunk-YVH5VJR4.ts → chunk-6PFZUEUG.ts} +138 -61
- package/dist/chunks/chunk-6PFZUEUG.ts.map +7 -0
- package/dist/chunks/{chunk-ZIL6PW5L.ts → chunk-6YKOHBSC.ts} +2 -2
- package/dist/chunks/{chunk-OA4NZLSL.ts → chunk-APZVJAEW.ts} +4 -3
- package/dist/chunks/{chunk-KPWZNMKM.ts → chunk-ECYCNZOE.ts} +1 -5
- package/dist/chunks/chunk-ECYCNZOE.ts.map +7 -0
- package/dist/chunks/chunk-GELYN4UC.ts +14 -0
- package/dist/chunks/chunk-GELYN4UC.ts.map +7 -0
- package/dist/chunks/{chunk-V2QIMC3U.ts → chunk-GSCZ4VXV.ts} +13 -8
- package/dist/chunks/chunk-GSCZ4VXV.ts.map +7 -0
- package/dist/chunks/{chunk-6W2SNZ5P.ts → chunk-IBXEM35O.ts} +8 -3
- package/dist/chunks/{chunk-6W2SNZ5P.ts.map → chunk-IBXEM35O.ts.map} +3 -3
- package/dist/chunks/{chunk-6KIWZ4AY.ts → chunk-INECVQNR.ts} +13 -12
- package/dist/chunks/chunk-INECVQNR.ts.map +7 -0
- package/dist/chunks/chunk-JREGWM2B.ts +139 -0
- package/dist/chunks/chunk-JREGWM2B.ts.map +7 -0
- package/dist/chunks/{chunk-277VHM2P.ts → chunk-MNYRU5U5.ts} +5 -2
- package/dist/chunks/{chunk-277VHM2P.ts.map → chunk-MNYRU5U5.ts.map} +2 -2
- package/dist/chunks/chunk-NHFGAZEC.ts +277 -0
- package/dist/chunks/chunk-NHFGAZEC.ts.map +7 -0
- package/dist/chunks/{chunk-EMRFVLZM.ts → chunk-NXWHPVXR.ts} +2 -2
- package/dist/chunks/{chunk-SMVKMYLK.ts → chunk-P4GI7LTT.ts} +2 -2
- package/dist/chunks/{chunk-MCUZFUHY.ts → chunk-PWESMTH6.ts} +10 -10
- package/dist/chunks/{chunk-V4AMI3VL.ts → chunk-R3SAMXB6.ts} +10 -2
- package/dist/chunks/chunk-R3SAMXB6.ts.map +7 -0
- package/dist/chunks/{chunk-RNIEVDTR.ts → chunk-T3LABNHF.ts} +2 -2
- package/dist/chunks/{chunk-S3R3W3KF.ts → chunk-UMPA5S7X.ts} +2 -2
- package/dist/chunks/{chunk-WP2M67XZ.ts → chunk-WBIOSK76.ts} +2 -2
- package/dist/chunks/{chunk-LAXTCSX4.ts → chunk-ZB3GNX3P.ts} +124 -139
- package/dist/chunks/chunk-ZB3GNX3P.ts.map +7 -0
- package/dist/chunks/{chunk-HEB6YT64.ts → chunk-ZO52JM4H.ts} +2 -2
- package/dist/chunks/{command-handler-TNPWFIPG.ts → command-handler-6ATREPG7.ts} +44 -40
- package/dist/chunks/command-handler-6ATREPG7.ts.map +7 -0
- package/dist/chunks/{conflict-review-ETCSYJTH.ts → conflict-review-MAOGTIAI.ts} +4 -4
- package/dist/chunks/{continuous-record-3XDXDOMV.ts → continuous-record-3SKJ6I3V.ts} +2 -2
- package/dist/chunks/{continuous-storage-HLKCHF6Z.ts → continuous-storage-3EU6I7Z3.ts} +2 -2
- package/dist/chunks/{file-selection-DD6X4J2K.ts → file-selection-QR2KZVGD.ts} +28 -15
- package/dist/chunks/file-selection-QR2KZVGD.ts.map +7 -0
- package/dist/chunks/manager-result-dispatcher-MC6EQOQY.ts +19 -0
- package/dist/chunks/{manager-ui-LFONXWQN.ts → manager-ui-AOFUNXAJ.ts} +648 -305
- package/dist/chunks/manager-ui-AOFUNXAJ.ts.map +7 -0
- package/dist/chunks/remote-selection-ui-4BTP2OJR.ts +18 -0
- package/dist/chunks/{setup-switch-SPZE7HIQ.ts → setup-switch-Y6AMFFNK.ts} +7 -7
- package/dist/chunks/{setup-wizard-5JYKAEIT.ts → setup-wizard-5G426MOZ.ts} +18 -16
- package/dist/chunks/setup-wizard-5G426MOZ.ts.map +7 -0
- package/dist/chunks/{snapshot-5HY3M2NL.ts → snapshot-ZUJJZCFW.ts} +2 -2
- package/dist/chunks/{snapshot-transaction-directory-OU2D7R7A.ts → snapshot-transaction-directory-F46JWRAU.ts} +2 -2
- package/dist/chunks/{state-directory-XXHU73Z3.ts → state-directory-CMAIF34J.ts} +2 -2
- package/dist/chunks/{sync-inspection-6VGR2UVZ.ts → sync-inspection-ITZ6Z4DE.ts} +7 -7
- package/dist/chunks/{sync-operations-SAKAZL6Z.ts → sync-operations-NMVKF7SE.ts} +13 -9
- package/dist/chunks/sync-operations-NMVKF7SE.ts.map +7 -0
- package/dist/chunks/{sync-state-2LMIXJ2C.ts → sync-state-QIT64TKV.ts} +2 -2
- package/dist/daemon/LICENSE +21 -0
- package/dist/daemon/dist/build-version.js +8 -0
- package/dist/daemon/dist/child-sdk.mjs +17 -0
- package/dist/daemon/dist/cli.js +169 -0
- package/dist/daemon/dist/client.js +909 -0
- package/dist/daemon/dist/consent.js +265 -0
- package/dist/daemon/dist/document.js +6 -0
- package/dist/daemon/dist/endpoint.js +91 -0
- package/dist/daemon/dist/engine/backends/backend-factory.js +16 -0
- package/dist/daemon/dist/engine/backends/backend-identity.js +38 -0
- package/dist/daemon/dist/engine/backends/backend-types.js +1 -0
- package/dist/daemon/dist/engine/backends/git/git-backend.js +715 -0
- package/dist/daemon/dist/engine/backends/git/git-config.js +118 -0
- package/dist/daemon/dist/engine/backends/git/git-runner.js +232 -0
- package/dist/daemon/dist/engine/backends/git/git-storage.js +252 -0
- package/dist/daemon/dist/engine/backends/s3/s3-backend.js +444 -0
- package/dist/daemon/dist/engine/backends/s3/s3-client.js +352 -0
- package/dist/daemon/dist/engine/backends/s3/s3-conditions.js +66 -0
- package/dist/daemon/dist/engine/backends/snapshot-pointer.js +22 -0
- package/dist/daemon/dist/engine/backends/sync-backend.js +23 -0
- package/dist/daemon/dist/engine/backends/webdav/webdav-backend.js +542 -0
- package/dist/daemon/dist/engine/backends/webdav/webdav-client.js +326 -0
- package/dist/daemon/dist/engine/backends/webdav/webdav-config.js +73 -0
- package/dist/daemon/dist/engine/commands/command-types.js +1 -0
- package/dist/daemon/dist/engine/host.js +16 -0
- package/dist/daemon/dist/engine/ignore/effective-ignore-policy.js +33 -0
- package/dist/daemon/dist/engine/ignore/ignore-edit.js +102 -0
- package/dist/daemon/dist/engine/ignore/ignore-initialization.js +186 -0
- package/dist/daemon/dist/engine/ignore/ignore-migration-prompt.js +139 -0
- package/dist/daemon/dist/engine/ignore/ignore-settings.js +322 -0
- package/dist/daemon/dist/engine/ignore/ignore-source.js +250 -0
- package/dist/daemon/dist/engine/paths.js +71 -0
- package/dist/daemon/dist/engine/settings/config-errors.js +4 -0
- package/dist/daemon/dist/engine/settings/config-file.js +736 -0
- package/dist/daemon/dist/engine/settings/config.js +301 -0
- package/dist/daemon/dist/engine/settings/settings-management.js +193 -0
- package/dist/daemon/dist/engine/settings/settings-store.js +41 -0
- package/dist/daemon/dist/engine/settings/settings-types.js +1 -0
- package/dist/daemon/dist/engine/settings/settings-validation.js +384 -0
- package/dist/daemon/dist/engine/snapshot/session-paths.js +160 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-apply.js +348 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-bounds.js +20 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-case-replacement.js +82 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-codec.js +61 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-entry-projection.js +78 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-exclude-safety.js +262 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-mutation-queues.js +133 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-paths.js +11 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-payload.js +10 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-reviewed-preimages.js +60 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-root-transition.js +138 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-directory.js +16 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-images.js +387 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-plan.js +68 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-policy.js +276 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-stage.js +303 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-verification.js +78 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction.js +813 -0
- package/dist/daemon/dist/engine/snapshot/snapshot-types.js +9 -0
- package/dist/daemon/dist/engine/snapshot/snapshot.js +678 -0
- package/dist/daemon/dist/engine/state/json-file.js +49 -0
- package/dist/daemon/dist/engine/state/lock-policy.js +2 -0
- package/dist/daemon/dist/engine/state/lock.js +259 -0
- package/dist/daemon/dist/engine/state/lockfile-fs.js +13 -0
- package/dist/daemon/dist/engine/state/merge-baseline-store.js +198 -0
- package/dist/daemon/dist/engine/state/mutation-directory-sync.js +34 -0
- package/dist/daemon/dist/engine/state/operation-availability.js +40 -0
- package/dist/daemon/dist/engine/state/state-directory.js +227 -0
- package/dist/daemon/dist/engine/state/state-types.js +1 -0
- package/dist/daemon/dist/engine/state/sync-state-store.js +54 -0
- package/dist/daemon/dist/engine/sync/agent-candidate.js +207 -0
- package/dist/daemon/dist/engine/sync/agent-plan.js +84 -0
- package/dist/daemon/dist/engine/sync/agent-policy.js +10 -0
- package/dist/daemon/dist/engine/sync/agent-refusal-retry.js +39 -0
- package/dist/daemon/dist/engine/sync/agent-request.js +13 -0
- package/dist/daemon/dist/engine/sync/agent-runner.js +183 -0
- package/dist/daemon/dist/engine/sync/agent-store.js +177 -0
- package/dist/daemon/dist/engine/sync/agent-sync.js +132 -0
- package/dist/daemon/dist/engine/sync/apply-review.js +52 -0
- package/dist/daemon/dist/engine/sync/conflict-artifact-ownership.js +53 -0
- package/dist/daemon/dist/engine/sync/conflict-artifacts.js +158 -0
- package/dist/daemon/dist/engine/sync/conflict-groups.js +76 -0
- package/dist/daemon/dist/engine/sync/conflict-preview.js +53 -0
- package/dist/daemon/dist/engine/sync/conflict-resolution.js +53 -0
- package/dist/daemon/dist/engine/sync/conflict-retention.js +61 -0
- package/dist/daemon/dist/engine/sync/conflict-review.js +73 -0
- package/dist/daemon/dist/engine/sync/content-conflicts.js +70 -0
- package/dist/daemon/dist/engine/sync/continuous-errors.js +66 -0
- package/dist/daemon/dist/engine/sync/continuous-lease.js +206 -0
- package/dist/daemon/dist/engine/sync/continuous-record.js +199 -0
- package/dist/daemon/dist/engine/sync/continuous-storage.js +59 -0
- package/dist/daemon/dist/engine/sync/continuous-sync.js +521 -0
- package/dist/daemon/dist/engine/sync/continuous-watch.js +140 -0
- package/dist/daemon/dist/engine/sync/exclude-policy.js +86 -0
- package/dist/daemon/dist/engine/sync/field-migration.js +20 -0
- package/dist/daemon/dist/engine/sync/file-merge-planner.js +123 -0
- package/dist/daemon/dist/engine/sync/initialization.js +80 -0
- package/dist/daemon/dist/engine/sync/json-document.js +172 -0
- package/dist/daemon/dist/engine/sync/local-field-policy.js +26 -0
- package/dist/daemon/dist/engine/sync/local-fields.js +196 -0
- package/dist/daemon/dist/engine/sync/merge-apply.js +529 -0
- package/dist/daemon/dist/engine/sync/merge-journal.js +295 -0
- package/dist/daemon/dist/engine/sync/merge-transfer-error.js +64 -0
- package/dist/daemon/dist/engine/sync/merged-sync.js +674 -0
- package/dist/daemon/dist/engine/sync/mutation-owner.js +18 -0
- package/dist/daemon/dist/engine/sync/package-merge.js +82 -0
- package/dist/daemon/dist/engine/sync/partial-progress.js +41 -0
- package/dist/daemon/dist/engine/sync/remote-snapshot.js +104 -0
- package/dist/daemon/dist/engine/sync/resolver-stream.js +34 -0
- package/dist/daemon/dist/engine/sync/session-merge.js +178 -0
- package/dist/daemon/dist/engine/sync/session-push.js +33 -0
- package/dist/daemon/dist/engine/sync/settings-conflicts.js +56 -0
- package/dist/daemon/dist/engine/sync/settings-merge.js +93 -0
- package/dist/daemon/dist/engine/sync/signals.js +8 -0
- package/dist/daemon/dist/engine/sync/startup-timings.js +44 -0
- package/dist/daemon/dist/engine/sync/sync-decision.js +81 -0
- package/dist/daemon/dist/engine/sync/sync-error-guidance.js +55 -0
- package/dist/daemon/dist/engine/sync/sync-errors.js +18 -0
- package/dist/daemon/dist/engine/sync/sync-inspection.js +42 -0
- package/dist/daemon/dist/engine/sync/sync-loaders.js +8 -0
- package/dist/daemon/dist/engine/sync/sync-local.js +40 -0
- package/dist/daemon/dist/engine/sync/sync-mutations.js +733 -0
- package/dist/daemon/dist/engine/sync/sync-operations.js +3 -0
- package/dist/daemon/dist/engine/sync/sync-policy.js +621 -0
- package/dist/daemon/dist/engine/sync/sync-queries.js +212 -0
- package/dist/daemon/dist/engine/sync/sync-state.js +129 -0
- package/dist/daemon/dist/engine/sync/text-merge.js +124 -0
- package/dist/daemon/dist/engine/types.js +2 -0
- package/dist/daemon/dist/engine/ui/merge-review.js +7 -0
- package/dist/daemon/dist/engine/ui/merged-sync-summary.js +86 -0
- package/dist/daemon/dist/engine/ui/sync-format.js +165 -0
- package/dist/daemon/dist/engine/ui/sync-status.js +30 -0
- package/dist/daemon/dist/engine/ui/terminal-text.js +9 -0
- package/dist/daemon/dist/engine/ui/transfer-changes.js +24 -0
- package/dist/daemon/dist/engine/ui/transfer-review.js +19 -0
- package/dist/daemon/dist/engine-service.js +344 -0
- package/dist/daemon/dist/identity.js +241 -0
- package/dist/daemon/dist/idle-exit.js +77 -0
- package/dist/daemon/dist/index.js +4 -0
- package/dist/daemon/dist/lifecycle-log.js +53 -0
- package/dist/daemon/dist/lifecycle.js +21 -0
- package/dist/daemon/dist/model-signature.js +7 -0
- package/dist/daemon/dist/monitor.js +272 -0
- package/dist/daemon/dist/participant-admission.js +30 -0
- package/dist/daemon/dist/protocol.js +104 -0
- package/dist/daemon/dist/resolver-host.js +78 -0
- package/dist/daemon/dist/server.js +953 -0
- package/dist/daemon/dist/service-host.js +174 -0
- package/dist/daemon/dist/upgrade-repair.js +55 -0
- package/dist/daemon/package.json +3 -0
- package/dist/index.ts +32 -32
- package/dist/package.json +6 -0
- package/docs/daemon-migration.md +27 -16
- package/package.json +11 -5
- package/skills/configure-pi-sync/SKILL.md +38 -13
- package/skills/configure-pi-sync/references/configuration.md +61 -34
- package/src/commands/command-execution.ts +8 -2
- package/src/daemon/pi-client.ts +1 -0
- package/src/settings/config.ts +1 -0
- package/src/sync/sync-operations.ts +18 -10
- package/src/sync/sync-policy.ts +5 -0
- package/src/ui/agent-mode-setting.ts +9 -1
- package/src/ui/excluded-paths-ui.ts +157 -2
- package/src/ui/file-selection.ts +12 -7
- package/src/ui/ignore-file-ui.ts +271 -0
- package/src/ui/ignore-migration-prompt.ts +65 -0
- package/src/ui/manager-state.ts +39 -20
- package/src/ui/manager-ui.ts +38 -19
- package/src/ui/remote-selection-ui.ts +159 -33
- package/src/ui/settings-frame.ts +2 -8
- package/src/ui/settings-review.ts +26 -0
- package/src/ui/settings-ui.ts +327 -199
- package/src/ui/setup/directory-rules.ts +81 -0
- package/src/ui/setup/git-ui.ts +14 -24
- package/src/ui/setup/s3-ui.ts +13 -26
- package/src/ui/setup/setup-actions.ts +0 -4
- package/src/ui/setup/setup-prompts.ts +99 -17
- package/src/ui/setup/setup-switcher.ts +4 -2
- package/src/ui/setup/setup-wizard.ts +5 -4
- package/src/ui/setup/webdav-ui.ts +13 -27
- package/src/ui/storage-connections-ui.ts +22 -14
- package/src/ui/sync-attention.ts +8 -3
- package/src/ui/sync-format.ts +8 -1
- package/src/ui/sync-setups-ui.ts +47 -27
- package/dist/chunks/chunk-6KIWZ4AY.ts.map +0 -7
- package/dist/chunks/chunk-KPWZNMKM.ts.map +0 -7
- package/dist/chunks/chunk-LAXTCSX4.ts.map +0 -7
- package/dist/chunks/chunk-V2QIMC3U.ts.map +0 -7
- package/dist/chunks/chunk-V4AMI3VL.ts.map +0 -7
- package/dist/chunks/chunk-YVH5VJR4.ts.map +0 -7
- package/dist/chunks/command-handler-TNPWFIPG.ts.map +0 -7
- package/dist/chunks/file-selection-DD6X4J2K.ts.map +0 -7
- package/dist/chunks/manager-result-dispatcher-2GFNWHDM.ts +0 -18
- package/dist/chunks/manager-ui-LFONXWQN.ts.map +0 -7
- package/dist/chunks/remote-selection-ui-GFR6TDTX.ts +0 -17
- package/dist/chunks/setup-wizard-5JYKAEIT.ts.map +0 -7
- package/dist/chunks/sync-operations-SAKAZL6Z.ts.map +0 -7
- /package/dist/chunks/{chunk-F64YWRXG.ts.map → chunk-3E3TR3JE.ts.map} +0 -0
- /package/dist/chunks/{chunk-ZIL6PW5L.ts.map → chunk-6YKOHBSC.ts.map} +0 -0
- /package/dist/chunks/{chunk-OA4NZLSL.ts.map → chunk-APZVJAEW.ts.map} +0 -0
- /package/dist/chunks/{chunk-EMRFVLZM.ts.map → chunk-NXWHPVXR.ts.map} +0 -0
- /package/dist/chunks/{chunk-SMVKMYLK.ts.map → chunk-P4GI7LTT.ts.map} +0 -0
- /package/dist/chunks/{chunk-MCUZFUHY.ts.map → chunk-PWESMTH6.ts.map} +0 -0
- /package/dist/chunks/{chunk-RNIEVDTR.ts.map → chunk-T3LABNHF.ts.map} +0 -0
- /package/dist/chunks/{chunk-S3R3W3KF.ts.map → chunk-UMPA5S7X.ts.map} +0 -0
- /package/dist/chunks/{chunk-WP2M67XZ.ts.map → chunk-WBIOSK76.ts.map} +0 -0
- /package/dist/chunks/{chunk-HEB6YT64.ts.map → chunk-ZO52JM4H.ts.map} +0 -0
- /package/dist/chunks/{conflict-review-ETCSYJTH.ts.map → conflict-review-MAOGTIAI.ts.map} +0 -0
- /package/dist/chunks/{continuous-record-3XDXDOMV.ts.map → continuous-record-3SKJ6I3V.ts.map} +0 -0
- /package/dist/chunks/{continuous-storage-HLKCHF6Z.ts.map → continuous-storage-3EU6I7Z3.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-2GFNWHDM.ts.map → manager-result-dispatcher-MC6EQOQY.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-GFR6TDTX.ts.map → remote-selection-ui-4BTP2OJR.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-SPZE7HIQ.ts.map → setup-switch-Y6AMFFNK.ts.map} +0 -0
- /package/dist/chunks/{snapshot-5HY3M2NL.ts.map → snapshot-ZUJJZCFW.ts.map} +0 -0
- /package/dist/chunks/{snapshot-transaction-directory-OU2D7R7A.ts.map → snapshot-transaction-directory-F46JWRAU.ts.map} +0 -0
- /package/dist/chunks/{state-directory-XXHU73Z3.ts.map → state-directory-CMAIF34J.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-6VGR2UVZ.ts.map → sync-inspection-ITZ6Z4DE.ts.map} +0 -0
- /package/dist/chunks/{sync-state-2LMIXJ2C.ts.map → sync-state-QIT64TKV.ts.map} +0 -0
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
type RemoteSelectionDecision,
|
|
17
17
|
type RemoteSelectionState,
|
|
18
18
|
sameSyncInclude,
|
|
19
|
+
syncDirectoryPolicyKey,
|
|
19
20
|
} from "../sync/sync-policy.js";
|
|
20
21
|
import {
|
|
21
22
|
type RunRoute,
|
|
@@ -186,22 +187,36 @@ async function showSelectionDifference(
|
|
|
186
187
|
items: [
|
|
187
188
|
{
|
|
188
189
|
id: "review",
|
|
189
|
-
label:
|
|
190
|
-
|
|
190
|
+
label: state.decision.ignorePolicyComparison
|
|
191
|
+
? "Review policy difference"
|
|
192
|
+
: "Review all paths (recommended)",
|
|
193
|
+
description: state.decision.ignorePolicyComparison
|
|
194
|
+
? "Compare published policy information without adopting rules."
|
|
195
|
+
: "Compare exact remote-only, device-only, and ordered lists.",
|
|
191
196
|
to: "review",
|
|
192
197
|
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
198
|
+
...(adoptionUnavailable(state.decision)
|
|
199
|
+
? []
|
|
200
|
+
: [
|
|
201
|
+
{
|
|
202
|
+
id: "adopt",
|
|
203
|
+
label: "Use remote content list",
|
|
204
|
+
description: "Save the reviewed rules on this device without pulling files.",
|
|
205
|
+
action: "adopt" as const,
|
|
206
|
+
},
|
|
207
|
+
]),
|
|
208
|
+
...(!canPublishLocalPolicy(state.decision)
|
|
209
|
+
? []
|
|
210
|
+
: [
|
|
211
|
+
{
|
|
212
|
+
id: "keep",
|
|
213
|
+
label: state.decision.ignorePolicyComparison
|
|
214
|
+
? "Review publishing this device's policy…"
|
|
215
|
+
: "Keep this device's content list and update remote…",
|
|
216
|
+
description: "Open the existing exact force-push preview without skipping confirmation.",
|
|
217
|
+
action: "keep" as const,
|
|
218
|
+
},
|
|
219
|
+
]),
|
|
205
220
|
{ id: "cancel", label: options.cancelLabel ?? "Cancel", action: "cancel" },
|
|
206
221
|
],
|
|
207
222
|
hint: "back",
|
|
@@ -251,6 +266,8 @@ async function showSelectionDifference(
|
|
|
251
266
|
ownedSignal.throwIfAborted();
|
|
252
267
|
validateOwner();
|
|
253
268
|
assertLocalSelectionCurrent(currentConfig, state.decision);
|
|
269
|
+
const refusal = adoptionUnavailable(state.decision);
|
|
270
|
+
if (refusal) throw new Error(refusal);
|
|
254
271
|
if (!currentConfig.include.includes("sessions") && state.decision.remoteInclude.includes("sessions")) {
|
|
255
272
|
onDialog?.(true);
|
|
256
273
|
let acknowledged: boolean;
|
|
@@ -267,7 +284,11 @@ async function showSelectionDifference(
|
|
|
267
284
|
validateOwner();
|
|
268
285
|
if (!acknowledged) return undefined;
|
|
269
286
|
}
|
|
270
|
-
if (
|
|
287
|
+
if (
|
|
288
|
+
!currentConfig.scope &&
|
|
289
|
+
state.decision.remoteExclude !== undefined &&
|
|
290
|
+
currentConfig.exclude === undefined
|
|
291
|
+
) {
|
|
271
292
|
onDialog?.(true);
|
|
272
293
|
let confirmed: boolean;
|
|
273
294
|
try {
|
|
@@ -306,6 +327,9 @@ async function showSelectionDifference(
|
|
|
306
327
|
...adoption.value.config,
|
|
307
328
|
include: [...state.decision.remoteInclude],
|
|
308
329
|
exclude: adoptedExclude(state.decision),
|
|
330
|
+
...(adoption.value.config.scope
|
|
331
|
+
? { reinclude: [...(state.decision.remoteDirectory?.reinclude ?? [])] }
|
|
332
|
+
: {}),
|
|
309
333
|
});
|
|
310
334
|
flowState = { decision: state.decision, saved: true };
|
|
311
335
|
return { kind: "to" as const, screen: "saved" as const };
|
|
@@ -321,16 +345,19 @@ async function showSelectionDifference(
|
|
|
321
345
|
}
|
|
322
346
|
},
|
|
323
347
|
keep: async ({ state, signal: actionSignal }) => {
|
|
348
|
+
if (!canPublishLocalPolicy(state.decision)) return { kind: "stay" as const };
|
|
324
349
|
if (!runRoute) {
|
|
325
350
|
ctx.ui.notify("The reviewed update-remote route is unavailable.", "error");
|
|
326
351
|
return { kind: "stay" as const };
|
|
327
352
|
}
|
|
328
353
|
const signal = combineSignals(sessionSignal, actionSignal);
|
|
329
354
|
try {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
355
|
+
if (!state.decision.ignorePolicyComparison) {
|
|
356
|
+
const latest = await loadConfig(state.decision.setupName);
|
|
357
|
+
if (signal.aborted) return { kind: "close" as const };
|
|
358
|
+
validateOwner();
|
|
359
|
+
assertLocalSelectionCurrent(latest, state.decision);
|
|
360
|
+
}
|
|
334
361
|
const result = await runCancellableOperation(
|
|
335
362
|
ctx,
|
|
336
363
|
"Preparing this device's push preview…",
|
|
@@ -453,11 +480,12 @@ async function loadAdoptionReview(
|
|
|
453
480
|
const snapshot = await readSnapshotForHead(backend, reviewedHead, signal);
|
|
454
481
|
throwIfAborted(signal);
|
|
455
482
|
validateOwner();
|
|
456
|
-
const state = inspectRemoteSelection(config.include, snapshot, config.exclude);
|
|
483
|
+
const state = inspectRemoteSelection(config.include, snapshot, config.exclude, config);
|
|
457
484
|
if (
|
|
458
485
|
state.kind !== "different" ||
|
|
459
486
|
!sameSyncInclude(state.include, decision.remoteInclude) ||
|
|
460
|
-
!sameSyncExclude(state.exclude, decision.remoteExclude)
|
|
487
|
+
!sameSyncExclude(state.exclude, decision.remoteExclude) ||
|
|
488
|
+
!matchesRemoteDirectory(state, decision)
|
|
461
489
|
) {
|
|
462
490
|
throw new StaleRemoteSelectionReviewError("Remote synced content changed while the comparison was open.");
|
|
463
491
|
}
|
|
@@ -479,11 +507,17 @@ async function revalidateAndAdopt(
|
|
|
479
507
|
const currentSnapshot = await readSnapshotForHead(review.backend, currentHead, signal);
|
|
480
508
|
throwIfAborted(signal);
|
|
481
509
|
validateOwner();
|
|
482
|
-
const currentState = inspectRemoteSelection(
|
|
510
|
+
const currentState = inspectRemoteSelection(
|
|
511
|
+
review.config.include,
|
|
512
|
+
currentSnapshot,
|
|
513
|
+
review.config.exclude,
|
|
514
|
+
review.config,
|
|
515
|
+
);
|
|
483
516
|
if (
|
|
484
517
|
currentState.kind !== "different" ||
|
|
485
518
|
!sameSyncInclude(currentState.include, decision.remoteInclude) ||
|
|
486
|
-
!sameSyncExclude(currentState.exclude, decision.remoteExclude)
|
|
519
|
+
!sameSyncExclude(currentState.exclude, decision.remoteExclude) ||
|
|
520
|
+
!matchesRemoteDirectory(currentState, decision)
|
|
487
521
|
) {
|
|
488
522
|
throw new StaleRemoteSelectionReviewError("Remote synced content changed while the comparison was open.");
|
|
489
523
|
}
|
|
@@ -491,13 +525,24 @@ async function revalidateAndAdopt(
|
|
|
491
525
|
decision.setupName,
|
|
492
526
|
(setup) => {
|
|
493
527
|
validateOwner();
|
|
528
|
+
const refusal = adoptionUnavailable(decision);
|
|
529
|
+
if (refusal) throw new Error(refusal);
|
|
530
|
+
const exclude = adoptedExclude(decision);
|
|
531
|
+
if (setup.sync.pathPolicy === "ignore-file") throw new Error("An ignore-file setup cannot adopt remote rules.");
|
|
532
|
+
if (setup.sync.scope === "agent-directory") {
|
|
533
|
+
return {
|
|
534
|
+
...setup,
|
|
535
|
+
sync: {
|
|
536
|
+
...setup.sync,
|
|
537
|
+
exclude,
|
|
538
|
+
reinclude: [...(decision.remoteDirectory?.reinclude ?? [])],
|
|
539
|
+
sessions: decision.remoteInclude.includes("sessions"),
|
|
540
|
+
},
|
|
541
|
+
};
|
|
542
|
+
}
|
|
494
543
|
return {
|
|
495
544
|
...setup,
|
|
496
|
-
sync: {
|
|
497
|
-
...setup.sync,
|
|
498
|
-
include: [...decision.remoteInclude],
|
|
499
|
-
...(adoptedExclude(decision) === undefined ? {} : { exclude: adoptedExclude(decision) }),
|
|
500
|
-
},
|
|
545
|
+
sync: { ...setup.sync, include: [...decision.remoteInclude], ...(exclude === undefined ? {} : { exclude }) },
|
|
501
546
|
};
|
|
502
547
|
},
|
|
503
548
|
{
|
|
@@ -537,7 +582,7 @@ async function inspectConfiguredRemoteSelection(
|
|
|
537
582
|
return {
|
|
538
583
|
kind: "selection",
|
|
539
584
|
config,
|
|
540
|
-
state: inspectRemoteSelection(config.include, snapshot, config.exclude),
|
|
585
|
+
state: inspectRemoteSelection(config.include, snapshot, config.exclude, config),
|
|
541
586
|
};
|
|
542
587
|
}
|
|
543
588
|
|
|
@@ -597,13 +642,77 @@ function adoptedExclude(decision: RemoteSelectionDecision) {
|
|
|
597
642
|
: [...decision.remoteExclude];
|
|
598
643
|
}
|
|
599
644
|
|
|
645
|
+
function scopesDiffer(decision: RemoteSelectionDecision) {
|
|
646
|
+
return decision.localDirectory?.scope !== decision.remoteDirectory?.scope;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function canPublishLocalPolicy(decision: RemoteSelectionDecision) {
|
|
650
|
+
if (decision.ignorePolicyComparison) {
|
|
651
|
+
return (
|
|
652
|
+
decision.ignorePolicyComparison !== "match" && decision.ignorePolicyComparison !== "local-legacy-remote-ignore"
|
|
653
|
+
);
|
|
654
|
+
}
|
|
655
|
+
return !scopesDiffer(decision);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
function adoptionUnavailable(decision: RemoteSelectionDecision) {
|
|
659
|
+
if (decision.ignorePolicyComparison)
|
|
660
|
+
return "Ignore files are local. Published metadata cannot reconstruct remote rules.";
|
|
661
|
+
if (scopesDiffer(decision))
|
|
662
|
+
return "Scope differs. Configure a setup with the remote scope to join it; this location is not migrated in place.";
|
|
663
|
+
if (
|
|
664
|
+
decision.remoteDirectory?.scope &&
|
|
665
|
+
decision.remoteInclude.includes("sessions") &&
|
|
666
|
+
!decision.localInclude.includes("sessions")
|
|
667
|
+
)
|
|
668
|
+
return "Enable session sync explicitly in Settings before adopting these rules.";
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
function matchesRemoteDirectory(
|
|
672
|
+
state: Extract<RemoteSelectionState, { kind: "different" }>,
|
|
673
|
+
decision: RemoteSelectionDecision,
|
|
674
|
+
) {
|
|
675
|
+
return (
|
|
676
|
+
syncDirectoryPolicyKey(state) ===
|
|
677
|
+
syncDirectoryPolicyKey({
|
|
678
|
+
include: decision.remoteInclude,
|
|
679
|
+
exclude: decision.remoteExclude,
|
|
680
|
+
...decision.remoteDirectory,
|
|
681
|
+
})
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function directoryReviewLines(decision: RemoteSelectionDecision) {
|
|
686
|
+
if (!decision.localDirectory?.scope && !decision.remoteDirectory?.scope) return [];
|
|
687
|
+
const unavailable = adoptionUnavailable(decision);
|
|
688
|
+
return [
|
|
689
|
+
`Remote scope: ${decision.remoteDirectory?.scope ? "Pi agent directory" : "selected paths or legacy"}`,
|
|
690
|
+
`This device scope: ${decision.localDirectory?.scope ? "Pi agent directory" : "selected paths"}`,
|
|
691
|
+
`Remote re-included paths: ${safeList(decision.remoteDirectory?.reinclude ?? [])}`,
|
|
692
|
+
`This device re-included paths: ${safeList(decision.localDirectory?.reinclude ?? [])}`,
|
|
693
|
+
...(unavailable ? [unavailable] : []),
|
|
694
|
+
];
|
|
695
|
+
}
|
|
696
|
+
|
|
600
697
|
function selectionSummaryLines(decision: RemoteSelectionDecision) {
|
|
698
|
+
if (decision.ignorePolicyComparison) {
|
|
699
|
+
return [
|
|
700
|
+
`Sync setup: ${safeTerminalText(decision.setupName)}`,
|
|
701
|
+
adoptionUnavailable(decision) ?? "Nothing changed.",
|
|
702
|
+
decision.ignorePolicyComparison === "local-legacy-remote-ignore"
|
|
703
|
+
? "The remote uses an ignore policy. Migrate and review your local setup before transferring."
|
|
704
|
+
: "Review a fresh push before publishing this device's policy. No files or settings have changed.",
|
|
705
|
+
];
|
|
706
|
+
}
|
|
601
707
|
const comparison = compareSyncInclude(decision.localInclude, decision.remoteInclude);
|
|
602
708
|
return [
|
|
603
709
|
`Sync setup: ${safeTerminalText(decision.setupName)}`,
|
|
604
710
|
"Nothing changed. Review both lists before choosing what happens next.",
|
|
711
|
+
...directoryReviewLines(decision),
|
|
605
712
|
...excludeReviewLines(decision),
|
|
606
|
-
...(
|
|
713
|
+
...(!decision.localDirectory?.scope &&
|
|
714
|
+
!decision.remoteDirectory?.scope &&
|
|
715
|
+
comparison.remoteOnly.length === 0 &&
|
|
607
716
|
comparison.localOnly.length === 0 &&
|
|
608
717
|
sameSyncExclude(decision.localExclude, decision.remoteExclude)
|
|
609
718
|
? ["Only the ordering differs; membership is the same."]
|
|
@@ -612,9 +721,13 @@ function selectionSummaryLines(decision: RemoteSelectionDecision) {
|
|
|
612
721
|
}
|
|
613
722
|
|
|
614
723
|
function formatSelectionDifference(decision: RemoteSelectionDecision) {
|
|
724
|
+
if (decision.ignorePolicyComparison) return selectionSummaryLines(decision).join("\n");
|
|
615
725
|
const comparison = compareSyncInclude(decision.localInclude, decision.remoteInclude);
|
|
616
726
|
return [
|
|
617
|
-
...(
|
|
727
|
+
...directoryReviewLines(decision),
|
|
728
|
+
...(!decision.localDirectory?.scope &&
|
|
729
|
+
!decision.remoteDirectory?.scope &&
|
|
730
|
+
comparison.remoteOnly.length === 0 &&
|
|
618
731
|
comparison.localOnly.length === 0 &&
|
|
619
732
|
sameSyncExclude(decision.localExclude, decision.remoteExclude)
|
|
620
733
|
? ["Only ordering differs; both lists contain the same paths.", ""]
|
|
@@ -645,12 +758,16 @@ function formatSelectionDifference(decision: RemoteSelectionDecision) {
|
|
|
645
758
|
}
|
|
646
759
|
|
|
647
760
|
function formatRemoteSelectionSummary(decision: RemoteSelectionDecision) {
|
|
761
|
+
if (decision.ignorePolicyComparison) return selectionSummaryLines(decision).join("\n");
|
|
648
762
|
const comparison = compareSyncInclude(decision.localInclude, decision.remoteInclude);
|
|
649
763
|
return [
|
|
650
764
|
`Synced content for “${safeTerminalText(decision.setupName)}” differs from this device.`,
|
|
651
765
|
`Remote-only: ${safeList(comparison.remoteOnly)}`,
|
|
652
766
|
`Device-only: ${safeList(comparison.localOnly)}`,
|
|
653
|
-
...(
|
|
767
|
+
...directoryReviewLines(decision),
|
|
768
|
+
...(!decision.localDirectory?.scope &&
|
|
769
|
+
!decision.remoteDirectory?.scope &&
|
|
770
|
+
comparison.remoteOnly.length === 0 &&
|
|
654
771
|
comparison.localOnly.length === 0 &&
|
|
655
772
|
sameSyncExclude(decision.localExclude, decision.remoteExclude)
|
|
656
773
|
? [
|
|
@@ -684,10 +801,13 @@ function decisionFromState(
|
|
|
684
801
|
return {
|
|
685
802
|
setupName: config.setupName,
|
|
686
803
|
configIdentity: syncConfigReviewFingerprint(config),
|
|
804
|
+
ignorePolicyComparison: state.ignorePolicyComparison,
|
|
687
805
|
localInclude: [...config.include],
|
|
688
806
|
remoteInclude: [...state.include],
|
|
689
807
|
...(config.exclude === undefined ? {} : { localExclude: [...config.exclude] }),
|
|
690
808
|
...(state.exclude === undefined ? {} : { remoteExclude: [...state.exclude] }),
|
|
809
|
+
...(config.scope ? { localDirectory: { scope: config.scope, reinclude: config.reinclude } } : {}),
|
|
810
|
+
...(state.scope ? { remoteDirectory: { scope: state.scope, reinclude: state.reinclude } } : {}),
|
|
691
811
|
};
|
|
692
812
|
}
|
|
693
813
|
|
|
@@ -695,7 +815,13 @@ function assertLocalSelectionCurrent(config: AnySyncConfig, decision: RemoteSele
|
|
|
695
815
|
if (
|
|
696
816
|
syncConfigReviewFingerprint(config) === decision.configIdentity &&
|
|
697
817
|
sameSyncInclude(config.include, decision.localInclude) &&
|
|
698
|
-
sameSyncExclude(config.exclude, decision.localExclude)
|
|
818
|
+
sameSyncExclude(config.exclude, decision.localExclude) &&
|
|
819
|
+
syncDirectoryPolicyKey(config) ===
|
|
820
|
+
syncDirectoryPolicyKey({
|
|
821
|
+
include: decision.localInclude,
|
|
822
|
+
exclude: decision.localExclude,
|
|
823
|
+
...decision.localDirectory,
|
|
824
|
+
})
|
|
699
825
|
) {
|
|
700
826
|
return;
|
|
701
827
|
}
|
package/src/ui/settings-frame.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { stripVTControlCharacters } from "node:util";
|
|
2
2
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
3
|
+
import type { Component } from "@earendil-works/pi-tui";
|
|
3
4
|
|
|
4
5
|
/** Adapt only public rendering/input boundaries; Kit still owns search, saves and focus. */
|
|
5
6
|
export function boundedSettingsUI(ctx: ExtensionCommandContext): ExtensionCommandContext["ui"] {
|
|
@@ -19,14 +20,7 @@ export function boundedSettingsUI(ctx: ExtensionCommandContext): ExtensionComman
|
|
|
19
20
|
return typeof value === "function" ? value.bind(target) : value;
|
|
20
21
|
},
|
|
21
22
|
});
|
|
22
|
-
const guard = <
|
|
23
|
-
T extends {
|
|
24
|
-
render(width: number): string[];
|
|
25
|
-
handleMouse?: import("@earendil-works/pi-tui").Component["handleMouse"];
|
|
26
|
-
},
|
|
27
|
-
>(
|
|
28
|
-
component: T,
|
|
29
|
-
): T => {
|
|
23
|
+
const guard = <T extends Component>(component: T): T => {
|
|
30
24
|
const render = component.render.bind(component);
|
|
31
25
|
const handleMouse = component.handleMouse?.bind(component);
|
|
32
26
|
let sourceRow = 0;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { readActiveLocalConfigDocumentForRepair } from "../settings/config-file.js";
|
|
2
|
+
import { validateSettingsDocument } from "../settings/settings-validation.js";
|
|
3
|
+
import { safeTerminalText } from "./terminal-text.js";
|
|
4
|
+
|
|
5
|
+
export async function loadSettingsCatalog() {
|
|
6
|
+
const document = await readActiveLocalConfigDocumentForRepair();
|
|
7
|
+
if (!document) return undefined;
|
|
8
|
+
const settings = validateSettingsDocument(document.parsed);
|
|
9
|
+
const ignoreSetups = Object.entries(settings.syncSetups)
|
|
10
|
+
.filter(([, setup]) => setup.sync.pathPolicy === "ignore-file")
|
|
11
|
+
.map(([name]) => name);
|
|
12
|
+
return { settings, path: document.path, ignoreSetups };
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const IGNORE_SETUP_MANAGEMENT_LIMIT =
|
|
16
|
+
"Adding, editing, and switching setups are unavailable while any setup uses an ignore file.";
|
|
17
|
+
|
|
18
|
+
export function ignoreSetupRecovery(settingsPath: string) {
|
|
19
|
+
return [
|
|
20
|
+
`For manual recovery, close Pi and back up: ${safeTerminalText(settingsPath)}`,
|
|
21
|
+
"Remove the ignore-file entries from syncSetups.",
|
|
22
|
+
"Set activeSyncSetup to a remaining setup, or remove it if none remain.",
|
|
23
|
+
"Keep the settings version, ignore files, and remote data unchanged.",
|
|
24
|
+
"Preserve any pending journal and backup. Review automatic sync before restarting Pi.",
|
|
25
|
+
];
|
|
26
|
+
}
|