@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
|
@@ -8,38 +8,44 @@ import {
|
|
|
8
8
|
ownRecord,
|
|
9
9
|
requiredString,
|
|
10
10
|
validateConfigName
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-APZVJAEW.ts";
|
|
12
12
|
import {
|
|
13
|
-
automaticSyncSummary
|
|
14
|
-
|
|
15
|
-
} from "./chunk-KPWZNMKM.ts";
|
|
13
|
+
automaticSyncSummary
|
|
14
|
+
} from "./chunk-ECYCNZOE.ts";
|
|
16
15
|
import {
|
|
17
16
|
configuredSyncSetupNames,
|
|
18
17
|
readLocalConfigObject
|
|
19
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-WBIOSK76.ts";
|
|
20
19
|
import {
|
|
21
20
|
AUTOMATIC_SYNC_DESCRIPTION,
|
|
22
21
|
setSyncSetupCompletions
|
|
23
22
|
} from "./chunk-HLCML3OW.ts";
|
|
23
|
+
import {
|
|
24
|
+
acknowledgeSessions,
|
|
25
|
+
directoryScopeLines,
|
|
26
|
+
promptDirectoryRules,
|
|
27
|
+
saveReviewedDraft,
|
|
28
|
+
starterDirectoryRules
|
|
29
|
+
} from "./chunk-JREGWM2B.ts";
|
|
24
30
|
import {
|
|
25
31
|
throwIfAborted
|
|
26
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-UMPA5S7X.ts";
|
|
27
33
|
import {
|
|
28
34
|
addStorageConnection,
|
|
29
35
|
addSyncSetup,
|
|
30
36
|
saveNewV3Settings,
|
|
31
37
|
updateStorageConnection,
|
|
32
38
|
updateSyncSetup
|
|
33
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-NXWHPVXR.ts";
|
|
34
40
|
import {
|
|
35
41
|
errorMessage
|
|
36
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-6YKOHBSC.ts";
|
|
43
|
+
import {
|
|
44
|
+
DEFAULT_SYNC_INCLUDE
|
|
45
|
+
} from "./chunk-R3SAMXB6.ts";
|
|
37
46
|
import {
|
|
38
47
|
safeTerminalText
|
|
39
48
|
} from "./chunk-2JNFEZ3V.ts";
|
|
40
|
-
import {
|
|
41
|
-
DEFAULT_SYNC_INCLUDE
|
|
42
|
-
} from "./chunk-V4AMI3VL.ts";
|
|
43
49
|
|
|
44
50
|
// src/commands/setup-completions.ts
|
|
45
51
|
async function refreshTargetCompletions() {
|
|
@@ -53,7 +59,7 @@ import {
|
|
|
53
59
|
normalizeGitRemote,
|
|
54
60
|
normalizeGitRemoteIdentity,
|
|
55
61
|
validateGitNamespace
|
|
56
|
-
} from "
|
|
62
|
+
} from "#pi-sync-daemon/engine/backends/git/git-config";
|
|
57
63
|
|
|
58
64
|
// src/ui/setup/text-input.ts
|
|
59
65
|
async function requiredExistingBucket(ctx, example, signal) {
|
|
@@ -204,15 +210,75 @@ async function readSetupConnection(name, signal) {
|
|
|
204
210
|
if (!connection) throw new Error("Storage connection changed; reopen setup.");
|
|
205
211
|
return connection;
|
|
206
212
|
}
|
|
207
|
-
async function
|
|
213
|
+
async function chooseSetupPolicy(ctx, signal, { legacySessions = false } = {}) {
|
|
208
214
|
const choice = await ctx.ui.select(
|
|
209
|
-
"Choose
|
|
210
|
-
[
|
|
215
|
+
"Choose synced content\n\nAgent directory (recommended): sync all eligible files, including custom paths, except sessions, bin, and npm.\nJoining existing storage? Review its policy after saving. It will not be adopted automatically.\nLegacy mode: use a fixed list of included paths.",
|
|
216
|
+
[
|
|
217
|
+
"Agent directory (recommended)",
|
|
218
|
+
"Agent directory \xB7 edit starter rules",
|
|
219
|
+
"Join an existing remote",
|
|
220
|
+
"Recommended Pi settings",
|
|
221
|
+
"Minimal settings",
|
|
222
|
+
"Cancel"
|
|
223
|
+
],
|
|
211
224
|
{ signal }
|
|
212
225
|
);
|
|
213
|
-
signal?.
|
|
214
|
-
|
|
215
|
-
|
|
226
|
+
if (signal?.aborted || !choice || choice === "Cancel") return void 0;
|
|
227
|
+
const join = choice === "Join an existing remote";
|
|
228
|
+
if (!join && choice !== "Agent directory (recommended)" && choice !== "Agent directory \xB7 edit starter rules" && choice !== "Recommended Pi settings" && choice !== "Minimal settings")
|
|
229
|
+
return void 0;
|
|
230
|
+
const joinScope = join ? await ctx.ui.select(
|
|
231
|
+
"Choose the existing remote's scope\n\nUse Selected paths for an older setup with an include list. These choices do not change the remote's scope.",
|
|
232
|
+
["Pi agent directory", "Selected paths (legacy)", "Cancel"],
|
|
233
|
+
{ signal }
|
|
234
|
+
) : void 0;
|
|
235
|
+
if (signal?.aborted || join && joinScope !== "Pi agent directory" && joinScope !== "Selected paths (legacy)")
|
|
236
|
+
return void 0;
|
|
237
|
+
const legacy = choice === "Recommended Pi settings" || choice === "Minimal settings" || joinScope === "Selected paths (legacy)";
|
|
238
|
+
const draft = starterDirectoryRules();
|
|
239
|
+
const editRules = choice === "Agent directory \xB7 edit starter rules";
|
|
240
|
+
if (editRules) {
|
|
241
|
+
const exclude = await promptDirectoryRules(ctx, "exclude", draft.exclude, signal);
|
|
242
|
+
if (signal?.aborted || !exclude) return void 0;
|
|
243
|
+
draft.exclude = exclude;
|
|
244
|
+
const reinclude = await promptDirectoryRules(ctx, "reinclude", draft.reinclude, signal);
|
|
245
|
+
if (signal?.aborted || !reinclude) return void 0;
|
|
246
|
+
draft.reinclude = reinclude;
|
|
247
|
+
}
|
|
248
|
+
const automatic = join ? false : await chooseAutomaticSync(ctx, signal);
|
|
249
|
+
if (signal?.aborted || automatic === void 0) return void 0;
|
|
250
|
+
const sessions = join || legacy && !legacySessions ? false : await chooseSessions(ctx, signal);
|
|
251
|
+
if (signal?.aborted || sessions === void 0) return void 0;
|
|
252
|
+
const remoteWarning = join ? "After saving, compare the remote policy. Automatic sync and sessions start Off. No policy is adopted without your review." : "If this location already has sync data, compare its policy in Settings before transferring. A mismatch blocks sync.";
|
|
253
|
+
if (legacy) {
|
|
254
|
+
const include = choice === "Minimal settings" ? ["settings.json", "AGENTS.md"] : [...DEFAULT_SYNC_INCLUDE];
|
|
255
|
+
return {
|
|
256
|
+
sync: { include: [...include, ...sessions ? ["sessions"] : []], automatic },
|
|
257
|
+
lines: [...includedContentLines(include, sessions), remoteWarning],
|
|
258
|
+
join
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
draft.sessions = sessions;
|
|
262
|
+
if (sessions && !editRules) draft.exclude = draft.exclude.filter((rule) => rule !== "sessions");
|
|
263
|
+
return {
|
|
264
|
+
sync: {
|
|
265
|
+
scope: "agent-directory",
|
|
266
|
+
exclude: draft.exclude,
|
|
267
|
+
...draft.reinclude.length ? { reinclude: draft.reinclude } : {},
|
|
268
|
+
sessions: draft.sessions,
|
|
269
|
+
automatic
|
|
270
|
+
},
|
|
271
|
+
lines: [...directoryScopeLines(draft), remoteWarning],
|
|
272
|
+
join
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
async function finishSetup(ctx, name, message, join, signal) {
|
|
276
|
+
if (signal?.aborted) return;
|
|
277
|
+
ctx.ui.notify(message, "info");
|
|
278
|
+
if (!join) return;
|
|
279
|
+
const { showRemoteSelectionReview } = await import("./remote-selection-ui-4BTP2OJR.ts");
|
|
280
|
+
if (signal?.aborted) return;
|
|
281
|
+
await showRemoteSelectionReview(ctx, name, signal, void 0, { origin: "settings" });
|
|
216
282
|
}
|
|
217
283
|
async function chooseAutomaticSync(ctx, signal) {
|
|
218
284
|
const choice = await ctx.ui.select(
|
|
@@ -234,13 +300,7 @@ async function chooseSessions(ctx, signal) {
|
|
|
234
300
|
signal?.throwIfAborted();
|
|
235
301
|
if (!choice || choice === "Cancel") return void 0;
|
|
236
302
|
if (choice !== "Include session conversations") return false;
|
|
237
|
-
|
|
238
|
-
"Include session conversations?",
|
|
239
|
-
"I understand that session JSONL can contain prompts, tool output, paths, screenshots, and secrets.",
|
|
240
|
-
{ signal }
|
|
241
|
-
);
|
|
242
|
-
signal?.throwIfAborted();
|
|
243
|
-
return confirmed ? true : void 0;
|
|
303
|
+
return await acknowledgeSessions(ctx, signal) ? true : void 0;
|
|
244
304
|
}
|
|
245
305
|
function includedContentLines(include, sessions = false) {
|
|
246
306
|
const paths = [...include, ...sessions && !include.includes("sessions") ? ["sessions"] : []];
|
|
@@ -274,72 +334,14 @@ A local label, such as home or work.`,
|
|
|
274
334
|
);
|
|
275
335
|
}
|
|
276
336
|
|
|
277
|
-
// src/ui/setup/setup-review.ts
|
|
278
|
-
import { defineMenu, runMenu } from "@narumitw/pi-tui-kit";
|
|
279
|
-
async function saveReviewedDraft(ctx, title, lines, label, save, signal) {
|
|
280
|
-
let saved = false;
|
|
281
|
-
let failure;
|
|
282
|
-
let failureText;
|
|
283
|
-
const menu = defineMenu({
|
|
284
|
-
start: "review",
|
|
285
|
-
screens: {
|
|
286
|
-
review: () => ({
|
|
287
|
-
kind: "review",
|
|
288
|
-
title,
|
|
289
|
-
content: [...failureText ? [failureText, ""] : [], ...lines].join("\n"),
|
|
290
|
-
lines: ["Review before saving. Back cancels this draft."],
|
|
291
|
-
format: { kind: "text" },
|
|
292
|
-
viewportSize: "adaptive",
|
|
293
|
-
confirm: { id: "save", label, action: "save" },
|
|
294
|
-
hint: "back"
|
|
295
|
-
})
|
|
296
|
-
},
|
|
297
|
-
actions: {
|
|
298
|
-
save: async ({ signal: actionSignal }) => {
|
|
299
|
-
try {
|
|
300
|
-
actionSignal.throwIfAborted();
|
|
301
|
-
await save(actionSignal);
|
|
302
|
-
saved = true;
|
|
303
|
-
return { kind: "close" };
|
|
304
|
-
} catch (error) {
|
|
305
|
-
if (actionSignal.aborted) return { kind: "close" };
|
|
306
|
-
if (!retryableSettingsError(error)) {
|
|
307
|
-
failure = error;
|
|
308
|
-
return { kind: "close" };
|
|
309
|
-
}
|
|
310
|
-
failureText = `Not saved. ${syncErrorGuidance(error)}
|
|
311
|
-
Your draft is retained. Fix the problem, then save again, or cancel.`;
|
|
312
|
-
ctx.ui.notify(failureText, "error");
|
|
313
|
-
return { kind: "stay" };
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
});
|
|
318
|
-
const result = await runMenu(ctx, menu, {
|
|
319
|
-
getState: () => void 0,
|
|
320
|
-
signal,
|
|
321
|
-
isCurrent: () => !signal?.aborted
|
|
322
|
-
});
|
|
323
|
-
if (signal?.aborted) return false;
|
|
324
|
-
if (failure) throw failure;
|
|
325
|
-
if (result.kind === "error") throw result.error;
|
|
326
|
-
return saved;
|
|
327
|
-
}
|
|
328
|
-
function retryableSettingsError(error) {
|
|
329
|
-
const code = error?.code;
|
|
330
|
-
return code !== void 0 && ["EACCES", "EPERM", "ENOSPC", "EBUSY", "EIO", "EMFILE", "ENFILE", "EROFS"].includes(code);
|
|
331
|
-
}
|
|
332
|
-
|
|
333
337
|
// src/ui/setup/git-ui.ts
|
|
334
338
|
async function showGitSetup(ctx, targetName, signal) {
|
|
335
339
|
const remote = await promptGitRemote(ctx, signal);
|
|
336
340
|
if (!remote) return false;
|
|
337
341
|
const destination = await promptGitDestination(ctx, signal);
|
|
338
342
|
if (!destination) return false;
|
|
339
|
-
const
|
|
340
|
-
if (!
|
|
341
|
-
const automatic = await chooseAutomaticSync(ctx, signal);
|
|
342
|
-
if (automatic === void 0) return false;
|
|
343
|
+
const policy = await chooseSetupPolicy(ctx, signal);
|
|
344
|
+
if (signal?.aborted || !policy) return false;
|
|
343
345
|
const saved = await saveReviewedDraft(
|
|
344
346
|
ctx,
|
|
345
347
|
"Review Git sync setup",
|
|
@@ -349,8 +351,8 @@ async function showGitSetup(ctx, targetName, signal) {
|
|
|
349
351
|
`Remote: ${safeTerminalText(remote)}`,
|
|
350
352
|
`Sync branch: ${safeTerminalText(destination.branch)}`,
|
|
351
353
|
`Storage location: ${safeTerminalText(destination.directory)}`,
|
|
352
|
-
...
|
|
353
|
-
`Automatic sync: ${automaticSyncSummary(automatic)}`,
|
|
354
|
+
...policy.lines,
|
|
355
|
+
`Automatic sync: ${automaticSyncSummary(policy.sync.automatic)}`,
|
|
354
356
|
"Authentication: existing Git credential helper or SSH configuration (not stored by pi-sync).",
|
|
355
357
|
"pi-sync manages the entire branch. The repository must already exist; a new branch is created on first push.",
|
|
356
358
|
"Saving does not contact remote storage or start syncing."
|
|
@@ -367,15 +369,15 @@ async function showGitSetup(ctx, targetName, signal) {
|
|
|
367
369
|
branch: destination.branch,
|
|
368
370
|
path: destination.directory
|
|
369
371
|
},
|
|
370
|
-
sync:
|
|
372
|
+
sync: policy.sync
|
|
371
373
|
}
|
|
372
374
|
},
|
|
373
375
|
saveSignal
|
|
374
376
|
),
|
|
375
377
|
signal
|
|
376
378
|
);
|
|
377
|
-
if (saved
|
|
378
|
-
ctx
|
|
379
|
+
if (saved)
|
|
380
|
+
await finishSetup(ctx, targetName, `Saved Git sync setup \u201C${safeTerminalText(targetName)}\u201D.`, policy.join, signal);
|
|
379
381
|
return saved;
|
|
380
382
|
}
|
|
381
383
|
async function showAddGitStorageProfile(ctx, signal) {
|
|
@@ -437,10 +439,8 @@ async function showAddGitTarget(ctx, name, profile, signal) {
|
|
|
437
439
|
signal
|
|
438
440
|
);
|
|
439
441
|
if (!storage) return false;
|
|
440
|
-
const
|
|
441
|
-
if (!
|
|
442
|
-
const automatic = await chooseAutomaticSync(ctx, signal);
|
|
443
|
-
if (automatic === void 0) return false;
|
|
442
|
+
const policy = await chooseSetupPolicy(ctx, signal);
|
|
443
|
+
if (signal?.aborted || !policy) return false;
|
|
444
444
|
const connection = await readSetupConnection(profile, signal);
|
|
445
445
|
if (connection?.type !== "git") throw new Error("Storage connection changed; reopen setup.");
|
|
446
446
|
const saved = await saveReviewedDraft(
|
|
@@ -452,15 +452,15 @@ async function showAddGitTarget(ctx, name, profile, signal) {
|
|
|
452
452
|
`Remote: ${safeTerminalText(connection.remote)}`,
|
|
453
453
|
`Sync branch: ${safeTerminalText(storage.branch)}`,
|
|
454
454
|
`Storage location: ${safeTerminalText(storage.path)}`,
|
|
455
|
-
...
|
|
456
|
-
`Automatic sync: ${automaticSyncSummary(automatic)}`,
|
|
455
|
+
...policy.lines,
|
|
456
|
+
`Automatic sync: ${automaticSyncSummary(policy.sync.automatic)}`,
|
|
457
457
|
"pi-sync manages the entire branch. Adding this setup does not sync or modify remote data."
|
|
458
458
|
],
|
|
459
459
|
"Add sync setup",
|
|
460
|
-
(saveSignal) => addSyncSetup(name, { storage, sync:
|
|
460
|
+
(saveSignal) => addSyncSetup(name, { storage, sync: policy.sync }, saveSignal, connection),
|
|
461
461
|
signal
|
|
462
462
|
);
|
|
463
|
-
if (saved
|
|
463
|
+
if (saved) await finishSetup(ctx, name, `Added sync setup \u201C${safeTerminalText(name)}\u201D.`, policy.join, signal);
|
|
464
464
|
return saved;
|
|
465
465
|
}
|
|
466
466
|
async function showEditGitTarget(ctx, partial, signal) {
|
|
@@ -650,12 +650,8 @@ async function showS3Setup(ctx, preset, targetName, signal) {
|
|
|
650
650
|
if (!location) return false;
|
|
651
651
|
const credentials = await chooseS3Credentials(ctx, signal);
|
|
652
652
|
if (!credentials) return false;
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
655
|
-
const automatic = await chooseAutomaticSync(ctx, signal);
|
|
656
|
-
if (automatic === void 0) return false;
|
|
657
|
-
const sessions = await chooseSessions(ctx, signal);
|
|
658
|
-
if (sessions === void 0) return false;
|
|
653
|
+
const policy = await chooseSetupPolicy(ctx, signal, { legacySessions: true });
|
|
654
|
+
if (signal?.aborted || !policy) return false;
|
|
659
655
|
const saved = await saveReviewedDraft(
|
|
660
656
|
ctx,
|
|
661
657
|
"Review sync setup",
|
|
@@ -666,8 +662,8 @@ async function showS3Setup(ctx, preset, targetName, signal) {
|
|
|
666
662
|
`Region: ${safeTerminalText(region)}`,
|
|
667
663
|
`Bucket: ${safeTerminalText(location.bucket)}`,
|
|
668
664
|
`Storage location: ${safeTerminalText(location.path)}`,
|
|
669
|
-
...
|
|
670
|
-
`Automatic sync: ${automaticSyncSummary(automatic)}`,
|
|
665
|
+
...policy.lines,
|
|
666
|
+
`Automatic sync: ${automaticSyncSummary(policy.sync.automatic)}`,
|
|
671
667
|
`Credentials: ${credentials.summary}`,
|
|
672
668
|
"The bucket must already exist. Saving does not contact remote storage or start syncing."
|
|
673
669
|
],
|
|
@@ -691,7 +687,7 @@ async function showS3Setup(ctx, preset, targetName, signal) {
|
|
|
691
687
|
bucket: location.bucket,
|
|
692
688
|
path: location.path
|
|
693
689
|
},
|
|
694
|
-
sync:
|
|
690
|
+
sync: policy.sync
|
|
695
691
|
}
|
|
696
692
|
},
|
|
697
693
|
saveSignal
|
|
@@ -700,8 +696,7 @@ async function showS3Setup(ctx, preset, targetName, signal) {
|
|
|
700
696
|
);
|
|
701
697
|
if (!saved || signal?.aborted) return false;
|
|
702
698
|
await refreshTargetCompletions();
|
|
703
|
-
|
|
704
|
-
ctx.ui.notify(`Sync setup \u201C${safeTerminalText(targetName)}\u201D saved. Choose Sync now to start.`, "info");
|
|
699
|
+
await finishSetup(ctx, targetName, `Sync setup \u201C${safeTerminalText(targetName)}\u201D saved.`, policy.join, signal);
|
|
705
700
|
return true;
|
|
706
701
|
}
|
|
707
702
|
async function showAddS3Target(ctx, raw, profile, name, signal) {
|
|
@@ -709,10 +704,8 @@ async function showAddS3Target(ctx, raw, profile, name, signal) {
|
|
|
709
704
|
if (!location) return;
|
|
710
705
|
const storage = await promptAvailableSetupStorage(ctx, { connection: profile, ...location }, signal);
|
|
711
706
|
if (!storage) return;
|
|
712
|
-
const
|
|
713
|
-
if (!
|
|
714
|
-
const automatic = await chooseAutomaticSync(ctx, signal);
|
|
715
|
-
if (automatic === void 0) return;
|
|
707
|
+
const policy = await chooseSetupPolicy(ctx, signal);
|
|
708
|
+
if (signal?.aborted || !policy) return;
|
|
716
709
|
const connection = await readSetupConnection(profile, signal);
|
|
717
710
|
if (connection.type !== "s3") throw new Error("Storage connection changed; reopen setup.");
|
|
718
711
|
const saved = await saveReviewedDraft(
|
|
@@ -724,18 +717,18 @@ async function showAddS3Target(ctx, raw, profile, name, signal) {
|
|
|
724
717
|
`Endpoint: ${safeTerminalText(connection.endpoint)}`,
|
|
725
718
|
`Bucket: ${safeTerminalText(storage.bucket)}`,
|
|
726
719
|
`Storage location: ${safeTerminalText(storage.path)}`,
|
|
727
|
-
...
|
|
728
|
-
`Automatic sync: ${automaticSyncSummary(automatic)}`,
|
|
720
|
+
...policy.lines,
|
|
721
|
+
`Automatic sync: ${automaticSyncSummary(policy.sync.automatic)}`,
|
|
729
722
|
"Only the current setup is checked at startup. Shutdown can push selected content when sessions are included.",
|
|
730
723
|
"The bucket must already exist. Adding this setup does not sync or modify remote data."
|
|
731
724
|
],
|
|
732
725
|
"Add sync setup",
|
|
733
|
-
(saveSignal) => addSyncSetup(name, { storage, sync:
|
|
726
|
+
(saveSignal) => addSyncSetup(name, { storage, sync: policy.sync }, saveSignal, connection),
|
|
734
727
|
signal
|
|
735
728
|
);
|
|
736
729
|
if (!saved || signal?.aborted) return;
|
|
737
730
|
await refreshTargetCompletions();
|
|
738
|
-
|
|
731
|
+
await finishSetup(ctx, name, `Added sync setup \u201C${safeTerminalText(name)}\u201D.`, policy.join, signal);
|
|
739
732
|
}
|
|
740
733
|
async function showEditS3Target(ctx, partial, signal) {
|
|
741
734
|
const bucket = await requiredInput(
|
|
@@ -788,7 +781,7 @@ import {
|
|
|
788
781
|
normalizeWebDavUrl,
|
|
789
782
|
validateWebDavCredentials,
|
|
790
783
|
validateWebDavNamespace
|
|
791
|
-
} from "
|
|
784
|
+
} from "#pi-sync-daemon/engine/backends/webdav/webdav-config";
|
|
792
785
|
|
|
793
786
|
// src/ui/setup/webdav-ui.ts
|
|
794
787
|
async function showWebDavSetup(ctx, targetName, signal) {
|
|
@@ -801,12 +794,8 @@ async function showWebDavSetup(ctx, targetName, signal) {
|
|
|
801
794
|
if (password === void 0) return false;
|
|
802
795
|
const remotePath = await chooseDestination(ctx, signal);
|
|
803
796
|
if (!remotePath) return false;
|
|
804
|
-
const
|
|
805
|
-
if (!
|
|
806
|
-
const automatic = await chooseAutomaticSync(ctx, signal);
|
|
807
|
-
if (automatic === void 0) return false;
|
|
808
|
-
const sessions = await chooseSessions(ctx, signal);
|
|
809
|
-
if (sessions === void 0) return false;
|
|
797
|
+
const policy = await chooseSetupPolicy(ctx, signal, { legacySessions: true });
|
|
798
|
+
if (signal?.aborted || !policy) return false;
|
|
810
799
|
const saved = await saveReviewedDraft(
|
|
811
800
|
ctx,
|
|
812
801
|
"Review WebDAV setup",
|
|
@@ -816,8 +805,8 @@ async function showWebDavSetup(ctx, targetName, signal) {
|
|
|
816
805
|
`URL: ${safeTerminalText(url)}`,
|
|
817
806
|
`Storage location: ${safeTerminalText(remotePath)}`,
|
|
818
807
|
"Username and password: stored privately (values hidden)",
|
|
819
|
-
...
|
|
820
|
-
`Automatic sync: ${automaticSyncSummary(automatic)}`,
|
|
808
|
+
...policy.lines,
|
|
809
|
+
`Automatic sync: ${automaticSyncSummary(policy.sync.automatic)}`,
|
|
821
810
|
"Check setup tests whether this server can safely save sync updates using a temporary probe.",
|
|
822
811
|
"Saving does not contact remote storage or start syncing."
|
|
823
812
|
],
|
|
@@ -829,15 +818,14 @@ async function showWebDavSetup(ctx, targetName, signal) {
|
|
|
829
818
|
connection: { type: "webdav", url, credentials: { username, password } },
|
|
830
819
|
setup: {
|
|
831
820
|
storage: { connection: targetName, path: remotePath },
|
|
832
|
-
sync:
|
|
821
|
+
sync: policy.sync
|
|
833
822
|
}
|
|
834
823
|
},
|
|
835
824
|
saveSignal
|
|
836
825
|
),
|
|
837
826
|
signal
|
|
838
827
|
);
|
|
839
|
-
if (saved
|
|
840
|
-
ctx.ui.notify(`Sync setup \u201C${safeTerminalText(targetName)}\u201D saved. Choose Sync now to start.`, "info");
|
|
828
|
+
if (saved) await finishSetup(ctx, targetName, `Sync setup \u201C${safeTerminalText(targetName)}\u201D saved.`, policy.join, signal);
|
|
841
829
|
return saved;
|
|
842
830
|
}
|
|
843
831
|
async function showAddWebDavTarget(ctx, name, profile, signal) {
|
|
@@ -845,10 +833,8 @@ async function showAddWebDavTarget(ctx, name, profile, signal) {
|
|
|
845
833
|
if (!remotePath) return false;
|
|
846
834
|
const storage = await promptAvailableSetupStorage(ctx, { connection: profile, path: remotePath }, signal);
|
|
847
835
|
if (!storage) return false;
|
|
848
|
-
const
|
|
849
|
-
if (!
|
|
850
|
-
const automatic = await chooseAutomaticSync(ctx, signal);
|
|
851
|
-
if (automatic === void 0) return false;
|
|
836
|
+
const policy = await chooseSetupPolicy(ctx, signal);
|
|
837
|
+
if (signal?.aborted || !policy) return false;
|
|
852
838
|
const connection = await readSetupConnection(profile, signal);
|
|
853
839
|
if (connection.type !== "webdav") throw new Error("Storage connection changed; reopen setup.");
|
|
854
840
|
const saved = await saveReviewedDraft(
|
|
@@ -859,15 +845,15 @@ async function showAddWebDavTarget(ctx, name, profile, signal) {
|
|
|
859
845
|
`Storage connection: ${safeTerminalText(profile)}`,
|
|
860
846
|
`URL: ${safeTerminalText(connection.url)}`,
|
|
861
847
|
`Storage location: ${safeTerminalText(storage.path)}`,
|
|
862
|
-
...
|
|
863
|
-
`Automatic sync: ${automaticSyncSummary(automatic)}`,
|
|
848
|
+
...policy.lines,
|
|
849
|
+
`Automatic sync: ${automaticSyncSummary(policy.sync.automatic)}`,
|
|
864
850
|
"Adding this setup does not sync or modify remote data."
|
|
865
851
|
],
|
|
866
852
|
"Add sync setup",
|
|
867
|
-
(saveSignal) => addSyncSetup(name, { storage, sync:
|
|
853
|
+
(saveSignal) => addSyncSetup(name, { storage, sync: policy.sync }, saveSignal, connection),
|
|
868
854
|
signal
|
|
869
855
|
);
|
|
870
|
-
if (saved
|
|
856
|
+
if (saved) await finishSetup(ctx, name, `Added sync setup \u201C${safeTerminalText(name)}\u201D.`, policy.join, signal);
|
|
871
857
|
return saved;
|
|
872
858
|
}
|
|
873
859
|
async function showEditWebDavTarget(ctx, partial, signal) {
|
|
@@ -1021,7 +1007,6 @@ export {
|
|
|
1021
1007
|
requiredInput,
|
|
1022
1008
|
requiredValueInput,
|
|
1023
1009
|
promptResourceName,
|
|
1024
|
-
saveReviewedDraft,
|
|
1025
1010
|
showGitSetup,
|
|
1026
1011
|
showAddGitStorageProfile,
|
|
1027
1012
|
showEditGitStorageProfile,
|
|
@@ -1039,4 +1024,4 @@ export {
|
|
|
1039
1024
|
showAddWebDavStorageProfile,
|
|
1040
1025
|
showEditWebDavStorageProfile
|
|
1041
1026
|
};
|
|
1042
|
-
//# sourceMappingURL=chunk-
|
|
1027
|
+
//# sourceMappingURL=chunk-ZB3GNX3P.ts.map
|