@narumitw/pi-sync 0.61.0 → 0.63.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 +46 -25
- package/dist/chunks/{chunk-277VHM2P.ts → chunk-27F5W7DX.ts} +7 -3
- package/dist/chunks/chunk-27F5W7DX.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-CKUGCBHP.ts +114 -0
- package/dist/chunks/chunk-CKUGCBHP.ts.map +7 -0
- package/dist/chunks/chunk-EJDDRS6O.ts +17 -0
- package/dist/chunks/chunk-EJDDRS6O.ts.map +7 -0
- package/dist/chunks/{chunk-JVFCVPPD.ts → chunk-EXDWEFIJ.ts} +87 -147
- package/dist/chunks/chunk-EXDWEFIJ.ts.map +7 -0
- package/dist/chunks/{chunk-4SR3ZYHA.ts → chunk-GELYN4UC.ts} +2 -2
- package/dist/chunks/{chunk-2ZGV5KNC.ts → chunk-HSCAFOT5.ts} +15 -12
- package/dist/chunks/chunk-HSCAFOT5.ts.map +7 -0
- package/dist/chunks/{chunk-YQSFJLJ3.ts → chunk-IBXEM35O.ts} +4 -3
- package/dist/chunks/{chunk-2JHAN3ZO.ts → chunk-JREGWM2B.ts} +3 -3
- package/dist/chunks/chunk-MANNB4WZ.ts +36 -0
- package/dist/chunks/chunk-MANNB4WZ.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-ZVGRZD4C.ts → chunk-R3SAMXB6.ts} +2 -2
- package/dist/chunks/{chunk-4KTJLJSJ.ts → chunk-S6FUUWV5.ts} +148 -21
- package/dist/chunks/chunk-S6FUUWV5.ts.map +7 -0
- package/dist/chunks/{chunk-PJMM75W5.ts → chunk-SXCH4Q5O.ts} +41 -23
- package/dist/chunks/chunk-SXCH4Q5O.ts.map +7 -0
- package/dist/chunks/{chunk-RNIEVDTR.ts → chunk-T3LABNHF.ts} +2 -2
- package/dist/chunks/{chunk-E3YLRLJM.ts → chunk-UGS6RYDZ.ts} +14 -12
- package/dist/chunks/chunk-UGS6RYDZ.ts.map +7 -0
- package/dist/chunks/{chunk-S3R3W3KF.ts → chunk-UMPA5S7X.ts} +2 -2
- package/dist/chunks/{chunk-EMVZL4PH.ts → chunk-V76KCWHO.ts} +7 -5
- package/dist/chunks/{chunk-EMVZL4PH.ts.map → chunk-V76KCWHO.ts.map} +1 -1
- package/dist/chunks/{chunk-S7F4FOAS.ts → chunk-VQ47JBLF.ts} +5 -5
- package/dist/chunks/{chunk-WP2M67XZ.ts → chunk-WBIOSK76.ts} +2 -2
- package/dist/chunks/chunk-WFBHWYI6.ts +18 -0
- package/dist/chunks/chunk-WFBHWYI6.ts.map +7 -0
- package/dist/chunks/{chunk-HEB6YT64.ts → chunk-ZO52JM4H.ts} +2 -2
- package/dist/chunks/{command-handler-K4XJOGYC.ts → command-handler-VINMQ7ZM.ts} +26 -43
- package/dist/chunks/command-handler-VINMQ7ZM.ts.map +7 -0
- package/dist/chunks/{conflict-review-IGKY2TOJ.ts → conflict-review-PCDFRIVB.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-MGGVOKM7.ts → file-selection-KID23GAD.ts} +21 -14
- package/dist/chunks/file-selection-KID23GAD.ts.map +7 -0
- package/dist/chunks/manager-result-dispatcher-GDB74IOP.ts +20 -0
- package/dist/chunks/{manager-ui-KYQ5AZJS.ts → manager-ui-YHDECYKI.ts} +454 -167
- package/dist/chunks/manager-ui-YHDECYKI.ts.map +7 -0
- package/dist/chunks/remote-selection-ui-GPITNEBF.ts +19 -0
- package/dist/chunks/{setup-switch-D6K6PBPC.ts → setup-switch-L54X5U5I.ts} +7 -7
- package/dist/chunks/{setup-wizard-4DYUDHJR.ts → setup-wizard-YO4MCPUF.ts} +15 -11
- package/dist/chunks/{setup-wizard-4DYUDHJR.ts.map → setup-wizard-YO4MCPUF.ts.map} +1 -1
- 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-J3CRBORL.ts → sync-inspection-H2WX5SUT.ts} +5 -5
- package/dist/chunks/{sync-operations-BVWYYKH3.ts → sync-operations-2MZAYHL2.ts} +13 -9
- package/dist/chunks/sync-operations-2MZAYHL2.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 +383 -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 +746 -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 +252 -0
- package/dist/daemon/dist/engine/ignore/ignore-migration-prompt.js +139 -0
- package/dist/daemon/dist/engine/ignore/ignore-settings.js +393 -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 +344 -0
- package/dist/daemon/dist/engine/settings/settings-management.js +199 -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 +165 -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 +296 -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 +855 -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 +85 -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 +139 -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 +538 -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-acceptance.js +29 -0
- package/dist/daemon/dist/engine/sync/merge-apply.js +532 -0
- package/dist/daemon/dist/engine/sync/merge-journal.js +314 -0
- package/dist/daemon/dist/engine/sync/merge-transfer-error.js +64 -0
- package/dist/daemon/dist/engine/sync/merged-sync.js +666 -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 +119 -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 +47 -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 +754 -0
- package/dist/daemon/dist/engine/sync/sync-operations.js +3 -0
- package/dist/daemon/dist/engine/sync/sync-policy.js +646 -0
- package/dist/daemon/dist/engine/sync/sync-queries.js +212 -0
- package/dist/daemon/dist/engine/sync/sync-state.js +124 -0
- package/dist/daemon/dist/engine/sync/text-merge.js +124 -0
- package/dist/daemon/dist/engine/sync/transfer-freshness.js +82 -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 +441 -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 +324 -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 +994 -0
- package/dist/daemon/dist/service-host.js +175 -0
- package/dist/daemon/dist/upgrade-repair.js +55 -0
- package/dist/daemon/package.json +3 -0
- package/dist/index.ts +40 -37
- package/dist/index.ts.map +4 -4
- package/dist/package.json +6 -0
- package/docs/daemon-migration.md +27 -16
- package/package.json +9 -3
- package/skills/configure-pi-sync/SKILL.md +24 -46
- package/skills/configure-pi-sync/references/configuration.md +62 -22
- package/src/commands/command-execution.ts +13 -9
- package/src/commands/command-types.ts +1 -0
- package/src/daemon/pi-client.ts +4 -2
- package/src/settings/config.ts +2 -0
- package/src/sync/automatic-sync.ts +9 -2
- package/src/sync/setup-switch.ts +38 -15
- package/src/sync/startup-check.ts +7 -4
- package/src/sync/sync-operations.ts +18 -10
- package/src/ui/excluded-paths-ui.ts +6 -3
- package/src/ui/file-selection.ts +7 -2
- package/src/ui/ignore-file-guidance.ts +7 -0
- package/src/ui/ignore-file-ui.ts +97 -0
- package/src/ui/ignore-migration-prompt.ts +65 -0
- package/src/ui/manager-state.ts +40 -14
- package/src/ui/manager-ui.ts +41 -19
- package/src/ui/remote-selection-ui.ts +88 -28
- package/src/ui/settings-review.ts +26 -0
- package/src/ui/settings-ui.ts +378 -224
- package/src/ui/setup/setup-actions.ts +16 -4
- package/src/ui/setup/setup-prompts.ts +55 -9
- package/src/ui/setup/setup-switcher.ts +24 -11
- package/src/ui/storage-connections-ui.ts +50 -20
- package/src/ui/sync-setups-ui.ts +65 -30
- package/dist/chunks/chunk-277VHM2P.ts.map +0 -7
- package/dist/chunks/chunk-2ZGV5KNC.ts.map +0 -7
- package/dist/chunks/chunk-4KTJLJSJ.ts.map +0 -7
- package/dist/chunks/chunk-E3YLRLJM.ts.map +0 -7
- package/dist/chunks/chunk-ECYCNZOE.ts +0 -12
- package/dist/chunks/chunk-ECYCNZOE.ts.map +0 -7
- package/dist/chunks/chunk-JVFCVPPD.ts.map +0 -7
- package/dist/chunks/chunk-PJMM75W5.ts.map +0 -7
- package/dist/chunks/command-handler-K4XJOGYC.ts.map +0 -7
- package/dist/chunks/file-selection-MGGVOKM7.ts.map +0 -7
- package/dist/chunks/manager-result-dispatcher-4VJVDEUD.ts +0 -19
- package/dist/chunks/manager-ui-KYQ5AZJS.ts.map +0 -7
- package/dist/chunks/remote-selection-ui-W3KOZM3W.ts +0 -18
- package/dist/chunks/sync-operations-BVWYYKH3.ts.map +0 -7
- /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-4SR3ZYHA.ts.map → chunk-GELYN4UC.ts.map} +0 -0
- /package/dist/chunks/{chunk-YQSFJLJ3.ts.map → chunk-IBXEM35O.ts.map} +0 -0
- /package/dist/chunks/{chunk-2JHAN3ZO.ts.map → chunk-JREGWM2B.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-ZVGRZD4C.ts.map → chunk-R3SAMXB6.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-S7F4FOAS.ts.map → chunk-VQ47JBLF.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-IGKY2TOJ.ts.map → conflict-review-PCDFRIVB.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-4VJVDEUD.ts.map → manager-result-dispatcher-GDB74IOP.ts.map} +0 -0
- /package/dist/chunks/{remote-selection-ui-W3KOZM3W.ts.map → remote-selection-ui-GPITNEBF.ts.map} +0 -0
- /package/dist/chunks/{setup-switch-D6K6PBPC.ts.map → setup-switch-L54X5U5I.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-J3CRBORL.ts.map → sync-inspection-H2WX5SUT.ts.map} +0 -0
- /package/dist/chunks/{sync-state-2LMIXJ2C.ts.map → sync-state-QIT64TKV.ts.map} +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
# Pi Sync settings reference
|
|
2
2
|
|
|
3
3
|
This is the authoritative public settings reference for Pi Sync.
|
|
4
|
-
The
|
|
4
|
+
The user performs settings changes and reviewed operations; the configuration skill can also make an explicitly requested edit to a known local rule file.
|
|
5
5
|
|
|
6
6
|
- [Complete version 3 example](#complete-version-3-example)
|
|
7
7
|
- [Required backend shapes](#required-backend-shapes)
|
|
8
|
+
- [Automatic sync controls](#automatic-sync-controls)
|
|
8
9
|
- [Status display](#status-display)
|
|
9
10
|
- [Secret scanning](#secret-scanning)
|
|
10
11
|
- [Autonomous sync](#autonomous-sync)
|
|
11
12
|
- [Continuous sync](#continuous-sync)
|
|
12
13
|
- [Daemon lifetime and unattended permission](#daemon-lifetime-and-unattended-permission)
|
|
14
|
+
- [Ignore-file policy](#ignore-file-policy)
|
|
13
15
|
- [Included content](#included-content)
|
|
14
16
|
- [Excluded paths](#excluded-paths)
|
|
15
17
|
- [Unsupported old settings and recovery](#unsupported-old-settings-and-recovery)
|
|
@@ -48,10 +50,11 @@ Global settings apply to all setups on this device; they are not remote policy.
|
|
|
48
50
|
|
|
49
51
|
| Scope | Fields | Required values and defaults |
|
|
50
52
|
| --- | --- | --- |
|
|
51
|
-
| Document | `version`, `onSwitch`, `storageConnections`, `syncSetups` | All are required in a manually written document; versions 3 through
|
|
53
|
+
| Document | `version`, `onSwitch`, `storageConnections`, `syncSetups` | All are required in a manually written document; versions 3 through 8 are supported. |
|
|
52
54
|
| Current setup | `activeSyncSetup` | Required when setups exist; absent when the setup catalog is empty. |
|
|
53
55
|
| Global preferences | `skipSecretScan`, `showStatus`, `debug` | Optional booleans; defaults are false, true, and false. |
|
|
54
|
-
| Setup selection | `sync.scope`, `sync.include`, `sync.automatic` |
|
|
56
|
+
| Setup selection | `sync.scope`, `sync.include`, `sync.automatic` | Legacy directory scope requires version 7 or later and omits `include`; selected-path setups require `include`. Both require explicit `automatic`. |
|
|
57
|
+
| Ignore-file selection | `sync.scope`, `sync.pathPolicy`, `sync.ignoreFile`, `sync.sessions` | Version 8, `scope: "agent-directory"`, `pathPolicy: "ignore-file"`. `ignoreFile` defaults to `.syncignore`; sessions require `true` and the rules must allow them. Use reviewed setup or migration, not manual JSON edits. |
|
|
55
58
|
| Setup behavior | `sync.automaticTransfer`, `sync.agentMode`, `sync.continuous`, `sync.mergeSettings`, `sync.mergeContent`, `sync.partialSync` | Optional booleans; all default to false. |
|
|
56
59
|
| Portable policy | `sync.localFields` | Optional array; any explicit array, including `[]`, requires version 4 or later. |
|
|
57
60
|
| Content/partial policy | `sync.mergeContent`, `sync.partialSync` | Enabling either requires version 5 or later. |
|
|
@@ -59,19 +62,24 @@ Global settings apply to all setups on this device; they are not remote policy.
|
|
|
59
62
|
| Directory exceptions | `sync.reinclude`, `sync.sessions` | Optional with directory scope. `reinclude` wins over `exclude`; sessions require `true`. |
|
|
60
63
|
|
|
61
64
|
Do not downgrade the settings version when an option is turned off.
|
|
62
|
-
|
|
65
|
+
|
|
66
|
+
### Automatic sync controls
|
|
67
|
+
|
|
68
|
+
The four controls select separate behaviors:
|
|
63
69
|
|
|
64
70
|
- **Automatic sync** (`sync.automatic`) enables startup observation and selected-content shutdown pushes when sessions are included.
|
|
65
71
|
- **Startup transfer** (`sync.automaticTransfer`) enables one eligible startup transfer.
|
|
66
|
-
- **Autonomous sync** (`sync.agentMode`, unchanged)
|
|
72
|
+
- **Autonomous sync** (`sync.agentMode`, unchanged) allows eligible startup and **Sync now** transfers without another transfer confirmation, plus model assistance and disclosure for supported conflicts.
|
|
67
73
|
- **Continuous sync** (`sync.continuous`) adds recurring work only with Autonomous sync enabled.
|
|
68
74
|
|
|
75
|
+
If any setup in the settings file uses an ignore file, enabling these modes alone does not authorize transfers. Enable the modes you want for the current setup, then use **Settings → Review automatic transfers** in TUI. This applies even when the current setup uses a legacy policy. Review again after settings or rule-file changes. Work after the last Pi exits still requires [separate permission](#daemon-lifetime-and-unattended-permission).
|
|
76
|
+
|
|
69
77
|
None of these controls is enabled by invoking the configuration skill.
|
|
70
78
|
|
|
71
79
|
### Editing in the manager
|
|
72
80
|
|
|
73
81
|
Open `/sync` → **Settings** to go directly to **Pi Sync Settings**.
|
|
74
|
-
The screen uses a searchable flat list without category navigation. Compare content rules separately from file contents
|
|
82
|
+
The screen uses a searchable flat list without category navigation. Compare content rules separately from file contents. Legacy setups retain their path controls. Ignore-file setups show the local path for manual editing and offer a reviewed switch to another existing file.
|
|
75
83
|
**Storage location** edits the current setup's coordinates, while **Manage sync setups** and **Manage storage connections** retain the catalog and affected-setup reviews.
|
|
76
84
|
Returning from catalog management refreshes the rows; switching or removing the owning setup closes its old Settings screen.
|
|
77
85
|
|
|
@@ -186,7 +194,7 @@ An occupied destination requires an explicit different path; Git requires a diff
|
|
|
186
194
|
This check does not contact the server or discover setups configured only on other machines.
|
|
187
195
|
|
|
188
196
|
Every setup requires explicit `sync.automatic`. Set `sync.scope` for directory scope, or set `sync.include` for selected paths.
|
|
189
|
-
|
|
197
|
+
Legacy setup offers automatic sync with Off first. New ignore-file setups save with automatic sync off; use Settings to review and enable automatic behavior separately. **Join an existing remote** instead saves with automatic sync and sessions off, then reviews the remote policy without transferring files. Existing values are not rewritten.
|
|
190
198
|
When enabled, the current setup receives one background startup check in TUI/RPC, including reload/new/resume/fork.
|
|
191
199
|
Automatic sync alone does not perform startup transfers or open dialogs; review changes through `/sync`.
|
|
192
200
|
Print/JSON skip startup checks.
|
|
@@ -200,10 +208,10 @@ The check deadline is 30 seconds plus bounded cleanup, with manual retry through
|
|
|
200
208
|
Continuous sync is a separate opt-in.
|
|
201
209
|
See [Background startup checks](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/README.md#background-startup-checks) for recovery and Git cache exceptions.
|
|
202
210
|
|
|
203
|
-
New setups
|
|
204
|
-
The
|
|
211
|
+
New TUI setups use the [ignore-file policy](#ignore-file-policy) when the daemon supports it. The legacy wizard defaults to directory scope; its selected-path choices are Recommended (the nine non-session Pi roots listed below) and Minimal (`settings.json` and `AGENTS.md`).
|
|
212
|
+
The setup review shows the scope and exact backend destination.
|
|
205
213
|
R2/S3 requires an explicitly entered existing bucket and never creates one.
|
|
206
|
-
Saving setup or connection settings does not
|
|
214
|
+
Saving setup or connection settings does not transfer files.
|
|
207
215
|
|
|
208
216
|
Invalid fields retry without discarding earlier answers.
|
|
209
217
|
Retryable local I/O failures retain the exact draft for another Save.
|
|
@@ -291,9 +299,41 @@ Authentication and transport failures give credentials/permissions or address/ne
|
|
|
291
299
|
Git reads remote snapshots and checks its local cache; write access is not tested.
|
|
292
300
|
WebDAV retains its isolated conditional-write/cleanup probe and repair of a missing active-snapshot history entry.
|
|
293
301
|
|
|
302
|
+
### Ignore-file policy
|
|
303
|
+
|
|
304
|
+
New TUI setups use `.syncignore` when the daemon advertises support. Existing setups, including legacy directory setups, keep their current policy and can coexist with ignore-file setups in a version 8 document. To migrate a legacy setup, choose **Review migration now** when offered on first opening the TUI manager or **Settings → Migrate to ignore file…** later. **Not now** defers the offer for that setup on this device; closing the offer without a choice does not persist a deferral. Review added and removed local and remote paths, and consider files that could be added later. Legacy selected paths and `reinclude` rules do not always translate directly.
|
|
305
|
+
|
|
306
|
+
For reference, the `sync` object of a version 8 setup using the default rule file can look like this. This fragment is not a complete document or a substitute for review:
|
|
307
|
+
|
|
308
|
+
```json
|
|
309
|
+
{
|
|
310
|
+
"scope": "agent-directory",
|
|
311
|
+
"pathPolicy": "ignore-file",
|
|
312
|
+
"sessions": false,
|
|
313
|
+
"automatic": false
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
On confirmation the daemon can create a missing default file on Linux, macOS, and Windows. If automatic creation is unavailable on your filesystem, use the exact path and starter text shown by Pi Sync. Create a regular UTF-8 file there without overwriting an existing file, then reopen the setup or migration and confirm the review. The starter rules are:
|
|
318
|
+
|
|
319
|
+
```gitignore
|
|
320
|
+
/npm/
|
|
321
|
+
/sessions/
|
|
322
|
+
/auth.json
|
|
323
|
+
/truth.json
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
A leading `/` anchors a rule to the agent directory; a trailing `/` matches a directory. Rules are case-sensitive on every device. Blank lines, comments, wildcards, and ordered `!` exceptions follow Git ignore patterns for a single root file. An exception cannot restore a child under an excluded parent. Use `/` as the path separator; escaped `/` is not supported. There are no nested or project rules. A valid existing file, even an empty one, is reused as-is. Another rule file must already exist: choose a single safe filename directly in the agent directory, not a path, symlink, or linked alias. Missing or unsafe rules block transfers; an absent default can inform preview but cannot authorize transfer.
|
|
327
|
+
|
|
328
|
+
Use **Settings → Ignore file** to find the source or review a switch. Edit the existing file manually, with no sync or recovery running, and recheck `/sync files` before approving a transfer. All setups sharing the file see the edit. There is no in-app rule save. Sessions require separate opt-in and must be allowed by the rules: the starter `/sessions/` still excludes them. Match sessions by logical `sessions/` paths even when stored elsewhere. Pi credentials and trust (`auth.json` and `trust.json`), Pi Sync private settings and state, and `.syncignore` and configured alternatives stay local independently of the rules. `truth.json` is a starter exclusion, not Pi's trust file. Loaded sessions stay protected during apply. Ignored files are not replaced or removed by transfer. Retained snapshots and backups are not erased.
|
|
329
|
+
|
|
330
|
+
Setup, migration, switching the rule file, and editing rules do not start a transfer or grant permission for one. Upgrade all peers before publishing a version 6 snapshot. It carries a portable policy fingerprint, not the filename or rule text. Configure matching rules in the same order and matching session opt-in on peers; do not copy rules from the remote. A legacy or mismatched head requires separately reviewed directional policy publication, not `--yes` or automatic work. Use `/sync diff` to inspect the scope and `/sync` to review the direction. A pull cannot apply a foreign policy; rollback requires compatible history. If rules, setup, or head change during review, reopen the review rather than relying on stale approval.
|
|
331
|
+
|
|
332
|
+
For blocked or interrupted creation or transfer, stop new work and preserve the rule file, creation marker, journals, backups, and consent records. Use the compatible daemon to review recovery with the originating setup and exact source. If source or remote evidence differs, keep it rather than forcing replay or deleting a marker. Before settings commit the old policy remains authoritative; a verified starter or settings backup can remain after a failed save. After any v6 publication, downgrading the package alone is not rollback. Close incompatible clients, verify daemon exit, and review compatible local and remote restoration before resuming transfers; keep the retained history intact.
|
|
333
|
+
|
|
294
334
|
### Agent-directory scope
|
|
295
335
|
|
|
296
|
-
|
|
336
|
+
A legacy directory setup in a version 7 or later settings document can use:
|
|
297
337
|
|
|
298
338
|
```json
|
|
299
339
|
{
|
|
@@ -418,7 +458,7 @@ To return to an older client, stop automatic work, resolve pending recovery with
|
|
|
418
458
|
### Automatic startup transfer
|
|
419
459
|
|
|
420
460
|
`sync.automaticTransfer` is optional and accepts only a boolean; absent means `false`.
|
|
421
|
-
Set it through **/sync → Settings → Startup transfer**.
|
|
461
|
+
Set it through **/sync → Settings → Startup transfer**. If any setup uses an ignore file, follow the [separate approval step](#automatic-sync-controls) after enabling it.
|
|
422
462
|
It is separate from `sync.automatic`: the legacy setting retains observation and selected-content shutdown behavior.
|
|
423
463
|
|
|
424
464
|
When explicitly enabled, one startup transfer waits for an idle boundary in TUI/RPC.
|
|
@@ -450,10 +490,9 @@ Unknown fields remain preserved and malformed/invalid files block saves, just as
|
|
|
450
490
|
|
|
451
491
|
### Autonomous sync
|
|
452
492
|
|
|
453
|
-
Autonomous sync uses the unchanged `sync.agentMode` key, an optional per-setup boolean, default `false`, in settings versions 3 through
|
|
493
|
+
Autonomous sync uses the unchanged `sync.agentMode` key, an optional per-setup boolean, default `false`, in settings versions 3 through 8.
|
|
454
494
|
Open **Settings → Autonomous sync** and review the setup, destination, content policy, transfer authorization, model disclosure, costs, and autonomous writes before enabling. For directory scope, the review shows session opt-in separately from path rules.
|
|
455
|
-
RPC users can explicitly
|
|
456
|
-
Setting it to `true` is authorization, not just a display preference.
|
|
495
|
+
In a legacy-only settings file, RPC users can authorize Autonomous sync by explicitly setting this field to `true`. If any setup uses an ignore file, follow the [separate approval step](#automatic-sync-controls) after enabling it.
|
|
457
496
|
|
|
458
497
|
Autonomous sync authorizes one eligible merged sync at the next session startup and the same flow from **Sync now** or `/sync sync`, without another transfer confirmation.
|
|
459
498
|
It can publish, replace, or delete selected local and remote content.
|
|
@@ -553,7 +592,7 @@ No Pi core changes or other extension are required.
|
|
|
553
592
|
|
|
554
593
|
### Daemon lifetime and unattended permission
|
|
555
594
|
|
|
556
|
-
|
|
595
|
+
For configured interactive work or an explicit setup or command, Pi starts the daemon bundled with the Pi Sync npm package or connects to an existing compatible owner. The daemon runs in a separate Node.js process, not as another Pi extension or an OS service. Unconfigured reads create no service or settings. The daemon owns the shared lifetime decision. For standalone and bundled CLI commands, see the [daemon CLI guide](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/daemon-migration.md#daemon-cli).
|
|
557
596
|
|
|
558
597
|
When no registered live client PID remains for that canonical agent directory and no valid explicit after-exit grant covers the active setup, a fixed 30-second grace period starts. Explicit CLI start without clients follows the same rule. Live passive, disconnected, publishing, and orderly retired PIDs keep the service alive. Detach, heartbeat loss, and an empty active-participant list are not proof of exit. `/reload`, `/new`, fork, and resume preserve shared ownership while their Pi process remains alive. A client arriving before shutdown becomes final cancels automatic exit. There is no new setting, environment variable, or keep-alive flag.
|
|
559
598
|
|
|
@@ -569,9 +608,9 @@ A failed consent write blocks automatic work in that service instance. Uncertain
|
|
|
569
608
|
|
|
570
609
|
### Continuous sync
|
|
571
610
|
|
|
572
|
-
`sync.continuous` is an optional per-setup boolean, default `false`, in settings versions 3 through
|
|
611
|
+
`sync.continuous` is an optional per-setup boolean, default `false`, in settings versions 3 through 8.
|
|
573
612
|
Open **Settings → Continuous sync** after enabling Autonomous sync. For directory scope, the review shows session opt-in separately from path rules.
|
|
574
|
-
RPC users can
|
|
613
|
+
In a legacy-only settings file, RPC users can opt in by explicitly setting this field to `true`. If any setup uses an ignore file, follow the [separate approval step](#automatic-sync-controls) after enabling it.
|
|
575
614
|
Existing Autonomous sync consent does not enable recurring requests.
|
|
576
615
|
|
|
577
616
|
The separate review names the setup, storage connection, destination, included paths, recurring costs and automatic writes.
|
|
@@ -584,6 +623,7 @@ Reopen Settings to read the saved value.
|
|
|
584
623
|
|
|
585
624
|
Monitoring starts at an eligible TUI/RPC session startup, after awaited local transaction recovery, or after a foreground `/sync` command or manager closes.
|
|
586
625
|
It replaces the duplicate one-shot startup transfer, not the legacy shutdown policy.
|
|
626
|
+
Removing the last ignore-file setup does not resume monitoring in the already attached sessions. To resume enabled Continuous sync, close `/sync` and run `/reload` in an attached TUI session, or close and reopen one Pi client. This does not grant after-exit permission.
|
|
587
627
|
Turning Continuous sync off stops its work without disabling Autonomous sync.
|
|
588
628
|
Turning Autonomous sync off also stops monitoring; a saved Continuous sync On value remains ineffective until Autonomous sync is enabled again.
|
|
589
629
|
|
|
@@ -705,7 +745,7 @@ Coupled fields must be excluded together.
|
|
|
705
745
|
Selected-path setups with nonempty rules must include `settings.json` in `sync.include`. Directory-scope setups must omit `sync.include` and can configure local fields without it. Path rules still govern whether `settings.json` syncs, and nonempty field rules require that exact file spelling if it is synced. Absent or explicitly empty rules remain valid for either scope.
|
|
706
746
|
Settings asks for confirmation before saving changes to these rules. An explicit array requires settings version 4 or later, and editing the rules does not downgrade an existing settings version.
|
|
707
747
|
Absent rules keep a setup nonportable, including unrelated setups in a version-4 document.
|
|
708
|
-
An explicit array opts that setup into at least snapshot version 2; exclusion-enabled selected-path setups retain version 4,
|
|
748
|
+
An explicit array opts that setup into at least snapshot version 2; exclusion-enabled selected-path setups retain version 4, legacy directory scope retains version 5, and ignore-file setups use version 6.
|
|
709
749
|
`[]` after rule removal retains this reviewed opt-in and differs from absence.
|
|
710
750
|
Older clients must refuse portable data rather than replace local-only values.
|
|
711
751
|
|
|
@@ -735,7 +775,7 @@ Capture occurs after accepted directions or journaled merge; cache staging prece
|
|
|
735
775
|
Missing/corrupt cache never invents a baseline from current data or assumes remote retention.
|
|
736
776
|
Preserve unknown/corrupted or nonprivate records and pending journals for manual review; pruning applies the same storage/schema/byte validation as reading.
|
|
737
777
|
Journal identity distinguishes absent and explicit empty policies.
|
|
738
|
-
Integrity validation uses the journal's recorded rules, so intact old-policy journals remain readable after a settings change; ordinary replay still rejects mismatched current rules, while reviewed force push
|
|
778
|
+
Integrity validation uses the journal's recorded rules, so intact old-policy journals remain readable after a settings change; ordinary replay still rejects mismatched current rules, while a reviewed force push or pull may archive a legacy path-policy journal.
|
|
739
779
|
Older absence-conflating journal identities fail closed and remain available for an explicitly reviewed force direction; do not downgrade portable setups.
|
|
740
780
|
To return to an older client, first use this version to review rule removal and publish a complete nonportable copy to a separate version-3 setup, with Pi closed during the change.
|
|
741
781
|
Never reinterpret portable snapshots with an old binary.
|
|
@@ -744,8 +784,8 @@ Never reinterpret portable snapshots with an old binary.
|
|
|
744
784
|
|
|
745
785
|
`sync.mergeContent` and `sync.partialSync` are independent opt-in booleans, both default `false`.
|
|
746
786
|
The owning **Settings → Content merge / partial progress** setting offers Off, Merge only, Merge + partial, and Partial only and confirms an explicit upgrade to at least settings version 5.
|
|
747
|
-
|
|
748
|
-
Partial publications retain snapshot version 4 for exclusion-enabled selected paths
|
|
787
|
+
Use a supported settings version of at least 5 (at least 7 for legacy directory scope and 8 for ignore-file policy).
|
|
788
|
+
Partial publications retain snapshot version 4 for exclusion-enabled selected paths, version 5 for legacy directory scope, and version 6 for ignore-file policy.
|
|
749
789
|
Settings version 5 retains the portable-policy behavior of version 4; moving from a legacy setup can require the existing separately confirmed directional policy migration.
|
|
750
790
|
Disabling options retains the schema and recovery evidence.
|
|
751
791
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtensionCommandContext, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { piDaemonClient, remoteOperation } from "../daemon/pi-client.js";
|
|
3
|
-
import {
|
|
3
|
+
import { loadSettingsConfig, sessionTokenWarnings, syncSessionsWarnings } from "../settings/config.js";
|
|
4
4
|
import { activeLocalConfigPath, createLocalConfigDocument, localConfigPath } from "../settings/config-file.js";
|
|
5
5
|
import { localConfigTemplate, readLocalConfigObject } from "../settings/settings-store.js";
|
|
6
6
|
import type { AnySyncConfig } from "../settings/settings-types.js";
|
|
@@ -11,6 +11,7 @@ import type { SyncLoaders } from "../sync/sync-loaders.js";
|
|
|
11
11
|
import { RemoteSelectionMismatchError, syncSessionsSelected } from "../sync/sync-policy.js";
|
|
12
12
|
import { automaticSyncSummary } from "../ui/automatic-sync-summary.js";
|
|
13
13
|
import type { RunRouteResult } from "../ui/cancellable-operation.js";
|
|
14
|
+
import { manualIgnoreFileGuidance } from "../ui/ignore-file-guidance.js";
|
|
14
15
|
import { trackOperationDialogs } from "../ui/operation-dialogs.js";
|
|
15
16
|
import { startupTransferSummary } from "../ui/sync-behavior.js";
|
|
16
17
|
import { setSyncStatus } from "../ui/sync-status.js";
|
|
@@ -183,7 +184,7 @@ export async function executeCommand(
|
|
|
183
184
|
const operations = await loaders.operations();
|
|
184
185
|
throwIfAborted(options.signal);
|
|
185
186
|
const outcome = await operations.syncBoth(ctx, options);
|
|
186
|
-
return { kind: "completed", ...(retryRefusal && outcome ? { outcome } : {}) };
|
|
187
|
+
return { kind: "completed", ...(retryRefusal && outcome && outcome !== "archived" ? { outcome } : {}) };
|
|
187
188
|
}
|
|
188
189
|
case "history": {
|
|
189
190
|
const operations = await loaders.operations();
|
|
@@ -256,7 +257,8 @@ async function initConfig(ctx: ExtensionCommandContext, signal?: AbortSignal) {
|
|
|
256
257
|
}
|
|
257
258
|
|
|
258
259
|
async function showConfig(ctx: ExtensionCommandContext, options: CommandOptions) {
|
|
259
|
-
const config = await
|
|
260
|
+
const config = await loadSettingsConfig(options.setup);
|
|
261
|
+
throwIfAborted(options.signal);
|
|
260
262
|
const warnings = [
|
|
261
263
|
...(config.backend.type === "s3" ? sessionTokenWarnings(config.backend.profile) : []),
|
|
262
264
|
...syncSessionsWarnings(config),
|
|
@@ -276,12 +278,14 @@ async function showConfig(ctx: ExtensionCommandContext, options: CommandOptions)
|
|
|
276
278
|
`autonomous sync: ${config.agentMode ? "On" : "Off"}`,
|
|
277
279
|
`continuous sync: ${config.continuous ? (config.agentMode ? "On" : "paused; Autonomous sync is Off") : "Off"}`,
|
|
278
280
|
config.scope ? "sync scope: Pi agent directory" : `included content: ${config.include.join(", ") || "none"}`,
|
|
279
|
-
...(config.
|
|
280
|
-
? [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
281
|
+
...(config.pathPolicy === "ignore-file"
|
|
282
|
+
? ["path policy: local ignore file", manualIgnoreFileGuidance(config.ignoreFile ?? ".syncignore")]
|
|
283
|
+
: config.scope
|
|
284
|
+
? [
|
|
285
|
+
`excluded paths: ${config.exclude?.map(safeTerminalText).join(", ") || "none"}`,
|
|
286
|
+
`re-included paths: ${config.reinclude?.map(safeTerminalText).join(", ") || "none"}`,
|
|
287
|
+
]
|
|
288
|
+
: []),
|
|
285
289
|
`sessions: ${syncSessionsSelected(config) ? "included" : "not included"}`,
|
|
286
290
|
`settings file: ${localConfigPath()}`,
|
|
287
291
|
...warnings,
|
package/src/daemon/pi-client.ts
CHANGED
|
@@ -210,6 +210,7 @@ export async function remoteOperation(ctx: ExtensionContext, operation: string,
|
|
|
210
210
|
const payload = {
|
|
211
211
|
args,
|
|
212
212
|
...(setup === undefined ? {} : { setup }),
|
|
213
|
+
...(options.automaticFingerprint === undefined ? {} : { automaticFingerprint: options.automaticFingerprint }),
|
|
213
214
|
yes: options.yes,
|
|
214
215
|
force: options.force,
|
|
215
216
|
stale: options.stale,
|
|
@@ -329,13 +330,14 @@ export class PiDaemonClient {
|
|
|
329
330
|
model: protectionOnly ? undefined : this.modelBinding(),
|
|
330
331
|
};
|
|
331
332
|
}
|
|
332
|
-
async configured() {
|
|
333
|
+
async configured(matches?: (settings: ReturnType<typeof validateSettingsDocument>) => boolean) {
|
|
333
334
|
this.validate();
|
|
334
335
|
await settingsQueue;
|
|
335
336
|
this.validate();
|
|
336
337
|
const document = await peekLocalConfigDocument();
|
|
337
338
|
this.validate();
|
|
338
|
-
|
|
339
|
+
const settings = document && validateSettingsDocument(document.parsed);
|
|
340
|
+
return Boolean(settings?.activeSyncSetup && (matches?.(settings) ?? true));
|
|
339
341
|
}
|
|
340
342
|
async pauseForSessionChange() {
|
|
341
343
|
this.validate();
|
package/src/settings/config.ts
CHANGED
|
@@ -6,11 +6,13 @@ export {
|
|
|
6
6
|
loadConfig,
|
|
7
7
|
loadConfigForCheck,
|
|
8
8
|
loadPartialConfig,
|
|
9
|
+
loadSettingsConfig,
|
|
9
10
|
sessionTokenWarnings,
|
|
10
11
|
syncCheckConfigFingerprint,
|
|
11
12
|
syncConfigReviewFingerprint,
|
|
12
13
|
syncConfigReviewIdentity,
|
|
13
14
|
syncSessionsWarnings,
|
|
15
|
+
syncSettingsConfigFingerprint,
|
|
14
16
|
syncSetupReviewIdentity,
|
|
15
17
|
syncSetupStorageReview,
|
|
16
18
|
} from "@narumitw/pi-sync-daemon/engine/settings/config";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { setSyncSetupCompletions } from "../commands/command.js";
|
|
3
3
|
import { piDaemonClient } from "../daemon/pi-client.js";
|
|
4
|
+
import { configFromSettings, loadConfigForCheck, syncCheckConfigFingerprint } from "../settings/config.js";
|
|
4
5
|
import { isMissingConfigError } from "../settings/config-errors.js";
|
|
5
6
|
import type { AnySyncConfig, PiSyncSettingsV3 } from "../settings/settings-types.js";
|
|
6
7
|
import { configureSyncStatus } from "../ui/sync-status.js";
|
|
@@ -9,6 +10,7 @@ import { throwIfAborted } from "./signals.js";
|
|
|
9
10
|
import { createStartupTimings, type StartupTimingPublisher } from "./startup-timings.js";
|
|
10
11
|
import { errorMessage } from "./sync-errors.js";
|
|
11
12
|
import type { SyncLoaders } from "./sync-loaders.js";
|
|
13
|
+
import { syncSessionsSelected } from "./sync-policy.js";
|
|
12
14
|
|
|
13
15
|
export async function startSession(
|
|
14
16
|
ctx: ExtensionContext,
|
|
@@ -65,11 +67,16 @@ export async function startSession(
|
|
|
65
67
|
export async function autoPushSessions(ctx: ExtensionContext, signal: AbortSignal, _loaders: SyncLoaders) {
|
|
66
68
|
try {
|
|
67
69
|
const client = piDaemonClient(ctx);
|
|
68
|
-
|
|
70
|
+
const eligible = (config: AnySyncConfig) => config.automatic && syncSessionsSelected(config);
|
|
71
|
+
if (!(await client.configured((settings) => eligible(configFromSettings(settings))))) return;
|
|
69
72
|
throwIfAborted(signal);
|
|
73
|
+
const config = await loadConfigForCheck(undefined, signal);
|
|
74
|
+
throwIfAborted(signal);
|
|
75
|
+
if (!eligible(config)) return;
|
|
76
|
+
const automaticFingerprint = syncCheckConfigFingerprint(config);
|
|
70
77
|
await client.run(
|
|
71
78
|
"shutdown",
|
|
72
|
-
{ args: [], yes: true, force: false, stale: false, silent: true, reload: false },
|
|
79
|
+
{ args: [], yes: true, force: false, stale: false, silent: true, reload: false, automaticFingerprint },
|
|
73
80
|
signal,
|
|
74
81
|
);
|
|
75
82
|
} catch (error) {
|
package/src/sync/setup-switch.ts
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { setSyncSetupCompletions } from "../commands/command.js";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
configFromSettings,
|
|
5
|
+
loadConfigForCheck,
|
|
6
|
+
loadSettingsConfig,
|
|
7
|
+
syncCheckConfigFingerprint,
|
|
8
|
+
syncConfigReviewIdentity,
|
|
9
|
+
} from "../settings/config.js";
|
|
4
10
|
import { configuredSyncSetupNames, updateLocalConfig } from "../settings/settings-store.js";
|
|
5
11
|
import type { OnSwitchAction } from "../settings/settings-types.js";
|
|
6
12
|
import { normalizeOnSwitch } from "../settings/settings-validation.js";
|
|
7
13
|
import { safeTerminalText } from "../ui/terminal-text.js";
|
|
8
|
-
import { throwIfAborted } from "./signals.js";
|
|
9
14
|
import { SetupPullRequiresUiError } from "./sync-errors.js";
|
|
15
|
+
import { captureMutationOwner } from "./sync-local.js";
|
|
10
16
|
|
|
11
17
|
export { SetupPullRequiresUiError } from "./sync-errors.js";
|
|
12
18
|
|
|
@@ -44,27 +50,36 @@ export async function useSyncSetup(
|
|
|
44
50
|
expectedAction?: OnSwitchAction,
|
|
45
51
|
signal?: AbortSignal,
|
|
46
52
|
expectedSetupIdentity?: string,
|
|
53
|
+
expectedOperationIdentity?: string,
|
|
47
54
|
): Promise<SetupSwitchResult> {
|
|
48
55
|
const normalized = name.trim();
|
|
49
56
|
if (!normalized) throw new Error("Usage: /sync use <setup>");
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
57
|
+
const validate = captureMutationOwner(ctx, signal);
|
|
58
|
+
const metadata = await loadSettingsConfig(normalized);
|
|
59
|
+
validate();
|
|
60
|
+
const reviewedSetupIdentity = expectedSetupIdentity ?? syncConfigReviewIdentity(metadata);
|
|
61
|
+
const loadedConfig = await loadConfigForCheck(normalized, signal);
|
|
62
|
+
validate();
|
|
63
|
+
const operationIdentity = syncCheckConfigFingerprint(loadedConfig);
|
|
64
|
+
if (expectedOperationIdentity !== undefined && operationIdentity !== expectedOperationIdentity) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
"Setup settings or local rule source changed while the switch preview was open; reopen it and review again.",
|
|
67
|
+
);
|
|
68
|
+
}
|
|
53
69
|
const switchResult: { action: OnSwitchAction; switched: boolean } = {
|
|
54
70
|
action: "ask-before-pull",
|
|
55
71
|
switched: false,
|
|
56
72
|
};
|
|
57
73
|
await updateLocalConfig((current) => {
|
|
58
|
-
|
|
74
|
+
validate();
|
|
59
75
|
const setup = current.syncSetups[normalized];
|
|
60
76
|
if (!setup) {
|
|
61
77
|
throw new Error(`Sync setup “${safeTerminalText(normalized)}” no longer exists.`);
|
|
62
78
|
}
|
|
63
|
-
const
|
|
64
|
-
const connection = current.storageConnections[connectionName];
|
|
79
|
+
const latest = configFromSettings(current, normalized);
|
|
65
80
|
if (
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
syncConfigReviewIdentity(latest) !== reviewedSetupIdentity ||
|
|
82
|
+
syncCheckConfigFingerprint(latest) !== syncCheckConfigFingerprint(metadata)
|
|
68
83
|
) {
|
|
69
84
|
throw new Error(
|
|
70
85
|
`Sync setup “${safeTerminalText(normalized)}” changed while the switch preview was open; reopen it and review the current destination.`,
|
|
@@ -74,6 +89,7 @@ export async function useSyncSetup(
|
|
|
74
89
|
if (expectedAction !== undefined && switchResult.action !== expectedAction) {
|
|
75
90
|
throw new Error("Setup-switch behavior changed while the preview was open; reopen it and retry.");
|
|
76
91
|
}
|
|
92
|
+
if (loadedConfig.reservedIgnoreNames !== undefined) switchResult.action = "switch-only";
|
|
77
93
|
if (switchResult.action === "pull-after-switch" && !ctx.hasUI) {
|
|
78
94
|
throw new SetupPullRequiresUiError(
|
|
79
95
|
`Automatic setup pulls require interactive confirmation; sync setup “${safeTerminalText(normalized)}” was not switched. Use TUI or RPC mode.`,
|
|
@@ -83,13 +99,14 @@ export async function useSyncSetup(
|
|
|
83
99
|
switchResult.switched = true;
|
|
84
100
|
return { ...current, activeSyncSetup: normalized };
|
|
85
101
|
}, signal);
|
|
86
|
-
|
|
102
|
+
validate();
|
|
87
103
|
if (!switchResult.switched) {
|
|
88
104
|
ctx.ui.notify(`Sync setup “${safeTerminalText(normalized)}” is already current.`, "info");
|
|
89
105
|
return { pullApplied: false };
|
|
90
106
|
}
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
const names = await configuredSyncSetupNames();
|
|
108
|
+
validate();
|
|
109
|
+
setSyncSetupCompletions(names);
|
|
93
110
|
|
|
94
111
|
if (switchResult.action === "switch-only") {
|
|
95
112
|
ctx.ui.notify(`Switched to “${safeTerminalText(normalized)}”. No files were pulled.`, "info");
|
|
@@ -108,19 +125,25 @@ export async function useSyncSetup(
|
|
|
108
125
|
"pi-sync will check the remote snapshot and show the exact local writes and deletions before applying anything.",
|
|
109
126
|
{ signal },
|
|
110
127
|
);
|
|
111
|
-
|
|
128
|
+
validate();
|
|
112
129
|
if (!confirmed) {
|
|
113
130
|
ctx.ui.notify(`Switched to “${safeTerminalText(normalized)}”; files were not pulled.`, "info");
|
|
114
131
|
return { pullApplied: false };
|
|
115
132
|
}
|
|
116
133
|
}
|
|
117
134
|
|
|
135
|
+
const latest = await loadConfigForCheck(undefined, signal);
|
|
136
|
+
validate();
|
|
137
|
+
if (syncCheckConfigFingerprint(latest) !== operationIdentity) {
|
|
138
|
+
ctx.ui.notify("The active setup or its settings changed. No files were pulled; reopen the review.", "warning");
|
|
139
|
+
return { pullApplied: false };
|
|
140
|
+
}
|
|
118
141
|
ctx.ui.notify(`Switched to “${safeTerminalText(normalized)}”. Checking remote files for a reviewed pull…`, "info");
|
|
119
142
|
if (!pullCurrentSetup) {
|
|
120
143
|
throw new Error(`Switched to “${safeTerminalText(normalized)}”, but pull is unavailable.`);
|
|
121
144
|
}
|
|
122
145
|
const pullOutcome = await pullCurrentSetup(normalized);
|
|
123
|
-
|
|
146
|
+
validate();
|
|
124
147
|
if (pullOutcome === "cancelled") {
|
|
125
148
|
ctx.ui.notify(
|
|
126
149
|
`Pull cancelled; sync setup “${safeTerminalText(normalized)}” remains current and synced files were not changed.`,
|
|
@@ -76,7 +76,7 @@ export function createStartupCheck(
|
|
|
76
76
|
.then(async () => {
|
|
77
77
|
try {
|
|
78
78
|
throwIfAborted(signal);
|
|
79
|
-
config = initialConfig ?? (await loadConfigForCheck());
|
|
79
|
+
config = initialConfig ?? (await loadConfigForCheck(undefined, signal));
|
|
80
80
|
task.transfer = startupTransferEnabled(config);
|
|
81
81
|
throwIfAborted(signal);
|
|
82
82
|
if (!config.automatic && !startupTransferEnabled(config)) return;
|
|
@@ -86,7 +86,7 @@ export function createStartupCheck(
|
|
|
86
86
|
setSyncStatus(ctx, "sync ...", { activity: "checking" });
|
|
87
87
|
const { inspectSync } = await timings.measure("inspection import", () => loaders.inspection());
|
|
88
88
|
throwIfAborted(signal);
|
|
89
|
-
const currentConfig = await loadConfigForCheck();
|
|
89
|
+
const currentConfig = await loadConfigForCheck(undefined, signal);
|
|
90
90
|
throwIfAborted(signal);
|
|
91
91
|
if (syncCheckConfigFingerprint(currentConfig) !== identity) return;
|
|
92
92
|
// The daemon owns the operation and cache guards.
|
|
@@ -94,7 +94,7 @@ export function createStartupCheck(
|
|
|
94
94
|
inspectSync(captured, snapshotOptionsForContext(ctx, captured), signal, undefined, timings),
|
|
95
95
|
);
|
|
96
96
|
throwIfAborted(signal);
|
|
97
|
-
const latest = await loadConfigForCheck();
|
|
97
|
+
const latest = await loadConfigForCheck(undefined, signal);
|
|
98
98
|
throwIfAborted(signal);
|
|
99
99
|
if (syncCheckConfigFingerprint(latest) !== identity) return;
|
|
100
100
|
const state = await withStateDirectoryAccess(() => readStateForConfig(latest));
|
|
@@ -115,7 +115,9 @@ export function createStartupCheck(
|
|
|
115
115
|
) {
|
|
116
116
|
const operations = await timings.measure("operations import", () => loaders.operations());
|
|
117
117
|
throwIfAborted(signal);
|
|
118
|
-
|
|
118
|
+
const transferConfig = await loadConfigForCheck(undefined, signal);
|
|
119
|
+
throwIfAborted(signal);
|
|
120
|
+
if (!isCurrent() || syncCheckConfigFingerprint(transferConfig) !== identity) return;
|
|
119
121
|
if (!ctx.isIdle()) {
|
|
120
122
|
pending = { ctx, signal: sessionSignal, config: captured };
|
|
121
123
|
return;
|
|
@@ -129,6 +131,7 @@ export function createStartupCheck(
|
|
|
129
131
|
silent: true,
|
|
130
132
|
reload: false,
|
|
131
133
|
auto: true,
|
|
134
|
+
automaticFingerprint: identity,
|
|
132
135
|
signal,
|
|
133
136
|
startupTimings: timings,
|
|
134
137
|
onCommit: () => attention.clearObservation(),
|
|
@@ -3,19 +3,27 @@ import type { CommandOptions } from "../commands/command-types.js";
|
|
|
3
3
|
import { remoteOperation } from "../daemon/pi-client.js";
|
|
4
4
|
import type { SetupPullOutcome } from "./setup-switch.js";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
ctx: ExtensionContext,
|
|
8
|
-
operation: string,
|
|
9
|
-
options: CommandOptions,
|
|
10
|
-
): Promise<SetupPullOutcome | undefined> {
|
|
11
|
-
const result = await remoteOperation(ctx, operation, options);
|
|
6
|
+
function transferResult(result: unknown): SetupPullOutcome | undefined {
|
|
12
7
|
if (result === undefined || result === "applied" || result === "cancelled") return result;
|
|
13
8
|
throw new Error("Invalid transfer result from pi-sync-daemon.");
|
|
14
9
|
}
|
|
15
|
-
export const push = (ctx: ExtensionContext, options: CommandOptions) =>
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
|
|
10
|
+
export const push = async (ctx: ExtensionContext, options: CommandOptions) =>
|
|
11
|
+
transferResult(await remoteOperation(ctx, "push", options));
|
|
12
|
+
export const pull = async (ctx: ExtensionContext, options: CommandOptions) =>
|
|
13
|
+
transferResult(await remoteOperation(ctx, "pull", options));
|
|
14
|
+
export async function syncBoth(ctx: ExtensionContext, options: CommandOptions) {
|
|
15
|
+
const result = await remoteOperation(ctx, options.auto ? "startup-transfer" : "sync", options);
|
|
16
|
+
if (
|
|
17
|
+
result === "archived" &&
|
|
18
|
+
!options.auto &&
|
|
19
|
+
!options.agentRetryRefusal &&
|
|
20
|
+
!options.yes &&
|
|
21
|
+
ctx.hasUI &&
|
|
22
|
+
(ctx.mode === "tui" || ctx.mode === "rpc")
|
|
23
|
+
)
|
|
24
|
+
return result;
|
|
25
|
+
return transferResult(result);
|
|
26
|
+
}
|
|
19
27
|
export async function rollback(ctx: ExtensionContext, options: CommandOptions) {
|
|
20
28
|
await remoteOperation(ctx, "rollback", options);
|
|
21
29
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
|
|
3
|
-
import {
|
|
3
|
+
import { loadSettingsConfig, syncCheckConfigFingerprint } from "../settings/config.js";
|
|
4
4
|
import { localConfigPath } from "../settings/config-file.js";
|
|
5
5
|
import { updateSyncSetup } from "../settings/settings-management.js";
|
|
6
6
|
import type { AnySyncConfig } from "../settings/settings-types.js";
|
|
@@ -29,7 +29,7 @@ export async function showExcludedPaths(ctx: ExtensionCommandContext, setupName:
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
validate();
|
|
32
|
-
const config = await
|
|
32
|
+
const config = await loadSettingsConfig(setupName);
|
|
33
33
|
validate();
|
|
34
34
|
if (config.scope === "agent-directory") return showDirectoryScope(ctx, config, signal);
|
|
35
35
|
if (ctx.mode !== "tui") {
|
|
@@ -100,6 +100,8 @@ export async function showExcludedPaths(ctx: ExtensionCommandContext, setupName:
|
|
|
100
100
|
setupName,
|
|
101
101
|
(setup) => {
|
|
102
102
|
validate();
|
|
103
|
+
if (setup.sync.pathPolicy === "ignore-file")
|
|
104
|
+
throw new Error("Edit the ignore file to change this setup's policy.");
|
|
103
105
|
return { ...setup, sync: { ...setup.sync, exclude } };
|
|
104
106
|
},
|
|
105
107
|
{ expectedConfigFingerprint: syncCheckConfigFingerprint(config), upgradeExclude: true, signal },
|
|
@@ -217,7 +219,8 @@ export async function showDirectoryScope(ctx: ExtensionCommandContext, config: A
|
|
|
217
219
|
config.setupName,
|
|
218
220
|
(setup) => {
|
|
219
221
|
validate();
|
|
220
|
-
if (setup.sync.scope !== "agent-directory"
|
|
222
|
+
if (setup.sync.scope !== "agent-directory" || setup.sync.pathPolicy === "ignore-file")
|
|
223
|
+
throw new Error("Sync scope changed during review.");
|
|
221
224
|
return {
|
|
222
225
|
...setup,
|
|
223
226
|
sync: {
|
package/src/ui/file-selection.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
|
|
4
|
-
import {
|
|
4
|
+
import { loadSettingsConfig, syncCheckConfigFingerprint } from "../settings/config.js";
|
|
5
5
|
import { localConfigPath } from "../settings/config-file.js";
|
|
6
6
|
import { updateSyncSetup } from "../settings/settings-management.js";
|
|
7
7
|
import { agentDir } from "../snapshot/session-paths.js";
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
syncIncludeSelection,
|
|
14
14
|
} from "../sync/sync-policy.js";
|
|
15
15
|
import { showDirectoryScope } from "./excluded-paths-ui.js";
|
|
16
|
+
import { manualIgnoreFileGuidance } from "./ignore-file-guidance.js";
|
|
16
17
|
|
|
17
18
|
const BUILT_IN_PREFIX = "builtin:";
|
|
18
19
|
const CUSTOM_PREFIX = "custom:";
|
|
@@ -27,9 +28,13 @@ interface SelectionDraft {
|
|
|
27
28
|
|
|
28
29
|
export async function showFileSelection(ctx: ExtensionCommandContext, setupName?: string, signal?: AbortSignal) {
|
|
29
30
|
const validate = captureMutationOwner(ctx, signal);
|
|
30
|
-
const config = await
|
|
31
|
+
const config = await loadSettingsConfig(setupName);
|
|
31
32
|
if (signal?.aborted) return;
|
|
32
33
|
validate();
|
|
34
|
+
if (config.pathPolicy === "ignore-file") {
|
|
35
|
+
if (ctx.hasUI) ctx.ui.notify(manualIgnoreFileGuidance(config.ignoreFile ?? ".syncignore"), "info");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
33
38
|
if (config.scope === "agent-directory") return showDirectoryScope(ctx, config, signal);
|
|
34
39
|
const selection = syncIncludeSelection(config.include);
|
|
35
40
|
const original: SelectionDraft = {
|