@narumitw/pi-sync 0.67.2 → 0.68.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 +17 -0
- package/README.md +29 -49
- package/dist/chunks/{chunk-XUZV4OGI.ts → chunk-335XTMMZ.ts} +3 -2
- package/dist/chunks/{chunk-XUZV4OGI.ts.map → chunk-335XTMMZ.ts.map} +2 -2
- package/dist/chunks/{chunk-PUSMSKIM.ts → chunk-AYGMIMCV.ts} +2 -11
- package/dist/chunks/chunk-AYGMIMCV.ts.map +7 -0
- package/dist/chunks/{chunk-2MSJDLSM.ts → chunk-BCDBT4X3.ts} +7 -7
- package/dist/chunks/{chunk-GRXNUC6O.ts → chunk-FQKWGVMA.ts} +20 -54
- package/dist/chunks/chunk-FQKWGVMA.ts.map +7 -0
- package/dist/chunks/{chunk-DGVZYS7T.ts → chunk-FR6A7ASZ.ts} +8 -11
- package/dist/chunks/chunk-FR6A7ASZ.ts.map +7 -0
- package/dist/chunks/{chunk-3NS4PMCI.ts → chunk-J52GYZO6.ts} +2 -8
- package/dist/chunks/{chunk-3NS4PMCI.ts.map → chunk-J52GYZO6.ts.map} +2 -2
- package/dist/chunks/{chunk-2MUAR5GH.ts → chunk-KAIVTJIQ.ts} +7 -10
- package/dist/chunks/chunk-KAIVTJIQ.ts.map +7 -0
- package/dist/chunks/{chunk-WBIOSK76.ts → chunk-R7PN3KIY.ts} +1 -2
- package/dist/chunks/{chunk-3Q3DMMID.ts → chunk-TLYT6HVI.ts} +8 -8
- package/dist/chunks/{chunk-UF2HU2NM.ts → chunk-WCGLU526.ts} +39 -118
- package/dist/chunks/chunk-WCGLU526.ts.map +7 -0
- package/dist/chunks/{chunk-JREGWM2B.ts → chunk-XNUARYLR.ts} +1 -2
- package/dist/chunks/{chunk-C3E75DXW.ts → chunk-YV2R5SJU.ts} +73 -85
- package/dist/chunks/chunk-YV2R5SJU.ts.map +7 -0
- package/dist/chunks/{command-handler-HWRPH3K3.ts → command-handler-S6BRZMPW.ts} +117 -69
- package/dist/chunks/command-handler-S6BRZMPW.ts.map +7 -0
- package/dist/chunks/{conflict-review-OBBBSVQD.ts → conflict-review-3XMYDJIK.ts} +2 -2
- package/dist/chunks/{file-selection-GASCVN45.ts → file-selection-4BOQBXS7.ts} +10 -17
- package/dist/chunks/file-selection-4BOQBXS7.ts.map +7 -0
- package/dist/chunks/{manager-result-dispatcher-MJ6G2CEI.ts → manager-result-dispatcher-A4IWLS4J.ts} +7 -7
- package/dist/chunks/{manager-ui-Z3B5ZTA6.ts → manager-ui-KHMCSLLV.ts} +114 -581
- package/dist/chunks/manager-ui-KHMCSLLV.ts.map +7 -0
- package/dist/chunks/{chunk-ECUCXF5Y.ts → merge-review-LWMUE5IW.ts} +2 -3
- package/dist/chunks/{remote-selection-ui-34WC7OFE.ts → remote-selection-ui-F6NJBQ3Y.ts} +6 -6
- package/dist/chunks/{setup-switch-JZDFQPVW.ts → setup-switch-7LMIRMZ7.ts} +6 -6
- package/dist/chunks/{setup-wizard-YOXLXLBY.ts → setup-wizard-2NRPR433.ts} +11 -16
- package/dist/chunks/{setup-wizard-YOXLXLBY.ts.map → setup-wizard-2NRPR433.ts.map} +1 -1
- package/dist/chunks/{sync-inspection-NIITROKS.ts → sync-inspection-QGM54YCM.ts} +5 -5
- package/dist/chunks/{sync-operations-FFI4ZZQL.ts → sync-operations-DTQMKVRQ.ts} +2 -2
- package/dist/daemon/dist/build-id.json +1 -0
- package/dist/daemon/dist/build-version.js +24 -4
- package/dist/daemon/dist/cli.js +51 -67
- package/dist/daemon/dist/client-transport.js +15 -5
- package/dist/daemon/dist/client.js +2 -10
- package/dist/daemon/dist/consent.js +13 -126
- package/dist/daemon/dist/daemon-startup.js +135 -30
- package/dist/daemon/dist/daemon-status.js +56 -0
- package/dist/daemon/dist/engine/backends/git/git-backend.js +4 -17
- package/dist/daemon/dist/engine/backends/git/git-storage.js +11 -44
- package/dist/daemon/dist/engine/backends/s3/s3-backend.js +6 -6
- package/dist/daemon/dist/engine/backends/webdav/webdav-backend.js +6 -6
- package/dist/daemon/dist/engine/settings/config.js +16 -149
- package/dist/daemon/dist/engine/settings/retired-ignore-policy.js +16 -0
- package/dist/daemon/dist/engine/settings/retired-ignore-recovery.js +14 -0
- package/dist/daemon/dist/engine/settings/settings-management.js +2 -10
- package/dist/daemon/dist/engine/settings/settings-validation.js +8 -21
- package/dist/daemon/dist/engine/snapshot/session-paths.js +13 -41
- package/dist/daemon/dist/engine/snapshot/snapshot-apply.js +8 -24
- package/dist/daemon/dist/engine/snapshot/snapshot-codec.js +7 -11
- package/dist/daemon/dist/engine/snapshot/snapshot-exclude-safety.js +19 -76
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-images.js +1 -7
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction-policy.js +8 -102
- package/dist/daemon/dist/engine/snapshot/snapshot-transaction.js +20 -100
- package/dist/daemon/dist/engine/snapshot/snapshot-types.js +1 -11
- package/dist/daemon/dist/engine/snapshot/snapshot.js +26 -78
- package/dist/daemon/dist/engine/state/sync-state-store.js +5 -1
- package/dist/daemon/dist/engine/sync/agent-plan.js +0 -1
- package/dist/daemon/dist/engine/sync/agent-policy.js +1 -1
- package/dist/daemon/dist/engine/sync/conflict-review.js +0 -2
- package/dist/daemon/dist/engine/sync/continuous-sync.js +2 -17
- package/dist/daemon/dist/engine/sync/continuous-watch.js +3 -7
- package/dist/daemon/dist/engine/sync/directional-action.js +3 -21
- package/dist/daemon/dist/engine/sync/initialization.js +4 -15
- package/dist/daemon/dist/engine/sync/local-fields.js +4 -65
- package/dist/daemon/dist/engine/sync/merge-apply.js +8 -31
- package/dist/daemon/dist/engine/sync/merge-journal.js +8 -118
- package/dist/daemon/dist/engine/sync/merged-sync.js +13 -70
- package/dist/daemon/dist/engine/sync/push-review.js +1 -16
- package/dist/daemon/dist/engine/sync/remote-snapshot.js +48 -65
- package/dist/daemon/dist/engine/sync/startup-bootstrap.js +3 -3
- package/dist/daemon/dist/engine/sync/sync-error-guidance.js +1 -1
- package/dist/daemon/dist/engine/sync/sync-inspection.js +1 -2
- package/dist/daemon/dist/engine/sync/sync-mutations.js +26 -118
- package/dist/daemon/dist/engine/sync/sync-policy.js +26 -150
- package/dist/daemon/dist/engine/sync/sync-queries.js +1 -8
- package/dist/daemon/dist/engine/sync/sync-rollback.js +12 -50
- package/dist/daemon/dist/engine/sync/sync-state.js +2 -15
- package/dist/daemon/dist/engine/sync/transfer-freshness.js +7 -17
- package/dist/daemon/dist/engine/sync/transfer-size-limits.js +3 -7
- package/dist/daemon/dist/engine-service.js +62 -205
- package/dist/daemon/dist/foreground-queue-outcome.js +0 -4
- package/dist/daemon/dist/index.js +2 -0
- package/dist/daemon/dist/legacy-consent-guard.js +34 -0
- package/dist/daemon/dist/server.js +99 -11
- package/dist/daemon/dist/service-host.js +3 -9
- package/dist/daemon/package.json +1 -1
- package/dist/index.ts +49 -49
- package/dist/index.ts.map +3 -3
- package/docs/agent-continuous-hardening.md +2 -0
- package/docs/continuous-sync-verification.md +1 -1
- package/docs/daemon-migration.md +17 -15
- package/docs/tui-contract.md +4 -6
- package/package.json +2 -3
- package/skills/configure-pi-sync/SKILL.md +23 -78
- package/skills/configure-pi-sync/references/configuration.md +59 -76
- package/src/commands/command-execution.ts +15 -38
- package/src/commands/command-handler.ts +0 -4
- package/src/commands/command.ts +2 -1
- package/src/daemon/daemon-status-ui.ts +64 -0
- package/src/daemon/directional-recovery.ts +4 -33
- package/src/daemon/pi-client.ts +87 -94
- package/src/settings/config.ts +0 -1
- package/src/sync/setup-switch.ts +1 -4
- package/src/sync-extension.ts +14 -27
- package/src/ui/cancellable-operation.ts +2 -13
- package/src/ui/excluded-paths-ui.ts +1 -4
- package/src/ui/file-selection.ts +0 -5
- package/src/ui/manager-state.ts +12 -75
- package/src/ui/manager-ui.ts +7 -96
- package/src/ui/remote-selection-ui.ts +29 -130
- package/src/ui/settings-ui.ts +169 -388
- package/src/ui/setup/setup-actions.ts +4 -16
- package/src/ui/setup/setup-prompts.ts +12 -49
- package/src/ui/setup/setup-switcher.ts +8 -14
- package/src/ui/storage-connections-ui.ts +21 -32
- package/src/ui/sync-setups-ui.ts +27 -53
- package/dist/chunks/chunk-2MUAR5GH.ts.map +0 -7
- package/dist/chunks/chunk-C3E75DXW.ts.map +0 -7
- package/dist/chunks/chunk-DGVZYS7T.ts.map +0 -7
- package/dist/chunks/chunk-EJDDRS6O.ts +0 -17
- package/dist/chunks/chunk-EJDDRS6O.ts.map +0 -7
- package/dist/chunks/chunk-GRXNUC6O.ts.map +0 -7
- package/dist/chunks/chunk-I72HGZJJ.ts +0 -106
- package/dist/chunks/chunk-I72HGZJJ.ts.map +0 -7
- package/dist/chunks/chunk-KNEUL4XN.ts +0 -30
- package/dist/chunks/chunk-KNEUL4XN.ts.map +0 -7
- package/dist/chunks/chunk-PUSMSKIM.ts.map +0 -7
- package/dist/chunks/chunk-UF2HU2NM.ts.map +0 -7
- package/dist/chunks/chunk-WFBHWYI6.ts +0 -18
- package/dist/chunks/chunk-WFBHWYI6.ts.map +0 -7
- package/dist/chunks/command-handler-HWRPH3K3.ts.map +0 -7
- package/dist/chunks/config-P54GGMXY.ts +0 -39
- package/dist/chunks/continuous-record-3SKJ6I3V.ts +0 -23
- package/dist/chunks/continuous-record-3SKJ6I3V.ts.map +0 -7
- package/dist/chunks/continuous-storage-3EU6I7Z3.ts +0 -27
- package/dist/chunks/continuous-storage-3EU6I7Z3.ts.map +0 -7
- package/dist/chunks/file-selection-GASCVN45.ts.map +0 -7
- package/dist/chunks/ignore-file-ui-5BWA6LBC.ts +0 -21
- package/dist/chunks/manager-ui-Z3B5ZTA6.ts.map +0 -7
- package/dist/chunks/merge-review-C2KETZKY.ts +0 -11
- package/dist/chunks/merge-review-C2KETZKY.ts.map +0 -7
- package/dist/chunks/remote-selection-ui-34WC7OFE.ts.map +0 -7
- package/dist/chunks/setup-switch-JZDFQPVW.ts.map +0 -7
- package/dist/daemon/dist/engine/ignore/adoption-journal.js +0 -146
- package/dist/daemon/dist/engine/ignore/effective-ignore-policy.js +0 -33
- package/dist/daemon/dist/engine/ignore/ignore-edit.js +0 -102
- package/dist/daemon/dist/engine/ignore/ignore-initialization.js +0 -288
- package/dist/daemon/dist/engine/ignore/ignore-migration-prompt.js +0 -139
- package/dist/daemon/dist/engine/ignore/ignore-settings.js +0 -391
- package/dist/daemon/dist/engine/ignore/ignore-source.js +0 -250
- package/dist/daemon/dist/engine/ignore/snapshot-ignore-rules.js +0 -39
- package/dist/daemon/dist/engine/sync/ignore-adoption-recovery.js +0 -50
- package/dist/daemon/dist/engine/sync/ignore-adoption.js +0 -416
- package/dist/daemon/dist/engine/sync/ignore-publication.js +0 -23
- package/dist/daemon/dist/engine/ui/ignore-rule-preview.js +0 -18
- package/dist/daemon/dist/monitor.js +0 -344
- package/src/ui/agent-mode-setting.ts +0 -99
- package/src/ui/ignore-file-guidance.ts +0 -7
- package/src/ui/ignore-file-ui.ts +0 -105
- package/src/ui/ignore-migration-prompt.ts +0 -65
- package/src/ui/settings-review.ts +0 -26
- /package/dist/chunks/{chunk-2MSJDLSM.ts.map → chunk-BCDBT4X3.ts.map} +0 -0
- /package/dist/chunks/{chunk-WBIOSK76.ts.map → chunk-R7PN3KIY.ts.map} +0 -0
- /package/dist/chunks/{chunk-3Q3DMMID.ts.map → chunk-TLYT6HVI.ts.map} +0 -0
- /package/dist/chunks/{chunk-JREGWM2B.ts.map → chunk-XNUARYLR.ts.map} +0 -0
- /package/dist/chunks/{conflict-review-OBBBSVQD.ts.map → conflict-review-3XMYDJIK.ts.map} +0 -0
- /package/dist/chunks/{config-P54GGMXY.ts.map → manager-result-dispatcher-A4IWLS4J.ts.map} +0 -0
- /package/dist/chunks/{chunk-ECUCXF5Y.ts.map → merge-review-LWMUE5IW.ts.map} +0 -0
- /package/dist/chunks/{ignore-file-ui-5BWA6LBC.ts.map → remote-selection-ui-F6NJBQ3Y.ts.map} +0 -0
- /package/dist/chunks/{manager-result-dispatcher-MJ6G2CEI.ts.map → setup-switch-7LMIRMZ7.ts.map} +0 -0
- /package/dist/chunks/{sync-inspection-NIITROKS.ts.map → sync-inspection-QGM54YCM.ts.map} +0 -0
- /package/dist/chunks/{sync-operations-FFI4ZZQL.ts.map → sync-operations-DTQMKVRQ.ts.map} +0 -0
package/src/ui/settings-ui.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { isKeyRelease, Key, matchesKey } from "@earendil-works/pi-tui";
|
|
3
3
|
import { defineMenu, type MenuSettingItem, runMenu } from "@narumitw/pi-tui-kit";
|
|
4
|
-
import { piDaemonClient } from "../daemon/pi-client.js";
|
|
5
4
|
import { configFromSettings, loadSettingsConfig, syncCheckConfigFingerprint } from "../settings/config.js";
|
|
6
5
|
import { localConfigPath, readActiveLocalConfigDocumentForRepair } from "../settings/config-file.js";
|
|
7
6
|
import { updateSyncSetup } from "../settings/settings-management.js";
|
|
8
7
|
import { updateLocalConfig } from "../settings/settings-store.js";
|
|
9
8
|
import { validateSettingsDocument } from "../settings/settings-validation.js";
|
|
10
|
-
import { startupTransferEnabled } from "../sync/agent-policy.js";
|
|
11
9
|
import { normalizeLocalFields, sameLocalFields } from "../sync/local-fields.js";
|
|
12
10
|
import {
|
|
13
11
|
SETUP_SWITCH_ACTION_OPTIONS,
|
|
@@ -16,20 +14,10 @@ import {
|
|
|
16
14
|
setupSwitchActionLabel,
|
|
17
15
|
} from "../sync/setup-switch.js";
|
|
18
16
|
import { captureMutationOwner } from "../sync/sync-local.js";
|
|
19
|
-
import { syncSessionsSelected } from "../sync/sync-policy.js";
|
|
20
|
-
import {
|
|
21
|
-
AGENT_MODE_DESCRIPTION,
|
|
22
|
-
CONTINUOUS_DESCRIPTION,
|
|
23
|
-
saveAgentMode,
|
|
24
|
-
saveContinuousMode,
|
|
25
|
-
} from "./agent-mode-setting.js";
|
|
26
17
|
import type { RunRoute } from "./cancellable-operation.js";
|
|
27
18
|
import { directoryScopeSummary, showExcludedPaths } from "./excluded-paths-ui.js";
|
|
28
|
-
import { manualIgnoreFileGuidance } from "./ignore-file-guidance.js";
|
|
29
|
-
import { ignoreFileSettingsAvailable, showIgnoreFileAction } from "./ignore-file-ui.js";
|
|
30
19
|
import { dispatchManagerResult } from "./manager-result-dispatcher.js";
|
|
31
20
|
import { boundedSettingsUI } from "./settings-frame.js";
|
|
32
|
-
import { IGNORE_SETUP_MANAGEMENT_LIMIT, ignoreSetupRecovery } from "./settings-review.js";
|
|
33
21
|
import { showEditSyncSetupStorage, showSyncSetupManager } from "./setup/setup-actions.js";
|
|
34
22
|
import { showStorageConnections } from "./storage-connections-ui.js";
|
|
35
23
|
import { AUTOMATIC_SYNC_DESCRIPTION, STARTUP_TRANSFER_DESCRIPTION, startupTransferSummary } from "./sync-behavior.js";
|
|
@@ -86,28 +74,19 @@ export async function showSyncSettings(
|
|
|
86
74
|
} catch {
|
|
87
75
|
config = undefined;
|
|
88
76
|
}
|
|
89
|
-
const limited = config?.reservedIgnoreNames !== undefined && !(await ignoreFileSettingsAvailable(ctx, signal));
|
|
90
77
|
if (!isCurrent()) return disposition;
|
|
91
78
|
ctx.ui.notify(
|
|
92
79
|
[
|
|
93
80
|
document === null
|
|
94
81
|
? "Could not read the active pi-sync settings file. Check file access or repair the JSON before reopening /sync."
|
|
95
82
|
: `Edit pi-sync settings manually: ${safeTerminalText(settingsPath)}`,
|
|
96
|
-
...(
|
|
97
|
-
...(!limited && config
|
|
83
|
+
...(config
|
|
98
84
|
? [
|
|
99
85
|
"In the active entry in syncSetups, set sync.maxFileSizeMiB or sync.maxDirectorySizeMiB to a positive whole number of MiB with a safe byte count. Remove a field to turn that limit Off.",
|
|
100
86
|
"A limit requires settings version 9. Upgrade all Pi Sync clients and daemons that share this agent directory before enabling a limit. Keep version 9 even if both limits are later Off.",
|
|
101
87
|
]
|
|
102
88
|
: []),
|
|
103
|
-
...(
|
|
104
|
-
? ["Use TUI Settings → Review automatic transfers to approve the current setup separately."]
|
|
105
|
-
: []),
|
|
106
|
-
...(config?.pathPolicy === "ignore-file"
|
|
107
|
-
? [manualIgnoreFileGuidance(config.ignoreFile ?? ".syncignore")]
|
|
108
|
-
: config?.scope === "agent-directory"
|
|
109
|
-
? directoryScopeSummary(config)
|
|
110
|
-
: []),
|
|
89
|
+
...(config?.scope === "agent-directory" ? directoryScopeSummary(config) : []),
|
|
111
90
|
].join("\n"),
|
|
112
91
|
"info",
|
|
113
92
|
);
|
|
@@ -140,16 +119,12 @@ export async function showSyncSettings(
|
|
|
140
119
|
}
|
|
141
120
|
const initial = await loadSettingsConfig(reviewedSetup);
|
|
142
121
|
if (!isCurrent()) return disposition;
|
|
143
|
-
const ignoreAvailable = await ignoreFileSettingsAvailable(ctx, signal);
|
|
144
122
|
if (!isCurrent()) return disposition;
|
|
145
123
|
const setupName = initial.setupName;
|
|
146
124
|
type Action =
|
|
147
125
|
| TransferSizeLimit["field"]
|
|
148
126
|
| "automatic"
|
|
149
127
|
| "automatic-transfer"
|
|
150
|
-
| "agent-mode"
|
|
151
|
-
| "continuous"
|
|
152
|
-
| "authorize-automatic"
|
|
153
128
|
| "merge-settings"
|
|
154
129
|
| "local-fields"
|
|
155
130
|
| "content-policy"
|
|
@@ -159,8 +134,6 @@ export async function showSyncSettings(
|
|
|
159
134
|
| "on-switch"
|
|
160
135
|
| "include"
|
|
161
136
|
| "exclude"
|
|
162
|
-
| "ignore-switch"
|
|
163
|
-
| "ignore-migrate"
|
|
164
137
|
| "remote-include"
|
|
165
138
|
| "storage-location"
|
|
166
139
|
| "setups"
|
|
@@ -175,244 +148,165 @@ export async function showSyncSettings(
|
|
|
175
148
|
title: "Pi Sync Settings",
|
|
176
149
|
lines: [
|
|
177
150
|
`Setup: ${safeTerminalText(state.setupName)} · Connection: ${safeTerminalText(state.connectionName)}`,
|
|
178
|
-
|
|
179
|
-
? ["Setup preferences are read-only; adding, editing, and switching setups are unavailable."]
|
|
180
|
-
: ["Back does not undo saved changes."]),
|
|
181
|
-
...(state.pathPolicy === "ignore-file" ? [manualIgnoreFileGuidance(state.ignoreFile ?? ".syncignore")] : []),
|
|
151
|
+
"Back does not undo saved changes.",
|
|
182
152
|
],
|
|
183
|
-
items:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
id: "authorizeAutomatic",
|
|
341
|
-
label: "Review automatic transfers",
|
|
342
|
-
description:
|
|
343
|
-
"Separate approval for the enabled modes and exact current policy. Saving settings alone does not grant permission.",
|
|
344
|
-
currentValue: "Review",
|
|
345
|
-
action: "authorize-automatic" as const,
|
|
346
|
-
},
|
|
347
|
-
]
|
|
348
|
-
: []),
|
|
349
|
-
{
|
|
350
|
-
id: "onSwitch",
|
|
351
|
-
label: "On setup switch",
|
|
352
|
-
description:
|
|
353
|
-
state.reservedIgnoreNames === undefined
|
|
354
|
-
? "All setups on this device: ask before a pull review, open it automatically, or switch without pulling. Applies to subsequent switches."
|
|
355
|
-
: "While ignore-file setups exist, switching saves only the active setup. Run a reviewed pull separately.",
|
|
356
|
-
currentValue: setupSwitchActionLabel(state.onSwitch),
|
|
357
|
-
values: SETUP_SWITCH_ACTION_OPTIONS.map(({ label }) => label),
|
|
358
|
-
action: "on-switch",
|
|
359
|
-
},
|
|
360
|
-
{
|
|
361
|
-
id: "mergeSettings",
|
|
362
|
-
label: "Merge settings fields",
|
|
363
|
-
description:
|
|
364
|
-
"This setup, opt-in: merge independent global settings.json root fields with a verified private ancestor. Arrays and nested objects remain atomic. Applies to subsequent sync; no reload.",
|
|
365
|
-
currentValue: state.mergeSettings ? "On" : "Off",
|
|
366
|
-
values: ["On", "Off"],
|
|
367
|
-
action: "merge-settings",
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
id: "contentPolicy",
|
|
371
|
-
label: "Content merge / partial progress",
|
|
372
|
-
description: `This setup, opt-in: ${state.scope === "agent-directory" ? "review format compatibility" : "review the version-5 upgrade"} before saving. Merge bounded text and prefix-only sessions; partial progress keeps withheld versions and baselines. Applies to subsequent sync; disabling does not clear recovery evidence.`,
|
|
373
|
-
currentValue: state.mergeContent
|
|
374
|
-
? state.partialSync
|
|
375
|
-
? "Merge + partial"
|
|
376
|
-
: "Merge only"
|
|
377
|
-
: state.partialSync
|
|
378
|
-
? "Partial only"
|
|
379
|
-
: "Off",
|
|
380
|
-
values: ["Off", "Merge only", "Merge + partial", "Partial only"],
|
|
381
|
-
action: "content-policy",
|
|
382
|
-
},
|
|
383
|
-
{
|
|
384
|
-
id: "skipSecretScan",
|
|
385
|
-
label: "Skip secret scan",
|
|
386
|
-
description:
|
|
387
|
-
"All setups on this device: skip possible-secret checks on subsequent pushes, including automatic pushes. Other safety checks remain. Diagnostics still scans.",
|
|
388
|
-
currentValue: state.skipSecretScan ? "On" : "Off",
|
|
389
|
-
values: ["On", "Off"],
|
|
390
|
-
action: "skip-secret-scan",
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
id: "showStatus",
|
|
394
|
-
label: "Show sync status",
|
|
395
|
-
description:
|
|
396
|
-
"All setups on this device: saved and applied immediately to Pi status. Review widgets and notifications remain available.",
|
|
397
|
-
currentValue: state.showStatus ? "On" : "Off",
|
|
398
|
-
values: ["On", "Off"],
|
|
399
|
-
action: "show-status",
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
id: "debug",
|
|
403
|
-
label: "Debug mode",
|
|
404
|
-
description:
|
|
405
|
-
"Write startup timings and sync events to the local pi-sync.log. Pi applies this at the next session start; the daemon applies it at its next settings check.",
|
|
406
|
-
currentValue: state.debug ? "On" : "Off",
|
|
407
|
-
values: ["On", "Off"],
|
|
408
|
-
action: "debug",
|
|
409
|
-
},
|
|
410
|
-
] satisfies MenuSettingItem<Action>[]
|
|
411
|
-
).map((item) =>
|
|
412
|
-
state.reservedIgnoreNames !== undefined && !ignoreAvailable && !["setups", "connections"].includes(item.id)
|
|
413
|
-
? { ...item, disabled: true }
|
|
414
|
-
: item,
|
|
415
|
-
),
|
|
153
|
+
items: [
|
|
154
|
+
...(state.scope === "agent-directory"
|
|
155
|
+
? [
|
|
156
|
+
{
|
|
157
|
+
id: "include",
|
|
158
|
+
label: "Agent directory scope",
|
|
159
|
+
description:
|
|
160
|
+
"Edit exclusions, re-inclusions, and session opt-in in one reviewed draft. No transfer starts.",
|
|
161
|
+
currentValue: `${state.exclude?.length ?? 0} excluded · ${state.reinclude?.length ?? 0} re-included · Sessions ${state.include.includes("sessions") ? "opted in" : "off"}`,
|
|
162
|
+
action: "include" as const,
|
|
163
|
+
},
|
|
164
|
+
]
|
|
165
|
+
: [
|
|
166
|
+
{
|
|
167
|
+
id: "include",
|
|
168
|
+
label: "Included paths",
|
|
169
|
+
description:
|
|
170
|
+
"This setup: choose paths in a draft, then review and Save or Discard. No transfer is started.",
|
|
171
|
+
currentValue: `${state.include.length} paths · Edit`,
|
|
172
|
+
action: "include" as const,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "exclude",
|
|
176
|
+
label: "Excluded paths",
|
|
177
|
+
description:
|
|
178
|
+
"This setup: draft relative paths or *, ?, ** patterns, then review Save/Discard. No transfer starts; old history is retained.",
|
|
179
|
+
currentValue: `${state.exclude?.length ?? 0} rules · Edit`,
|
|
180
|
+
action: "exclude" as const,
|
|
181
|
+
},
|
|
182
|
+
]),
|
|
183
|
+
{
|
|
184
|
+
id: "remoteInclude",
|
|
185
|
+
label: state.scope === "agent-directory" ? "Compare sync policies" : "Compare included paths",
|
|
186
|
+
description:
|
|
187
|
+
"Compare what sync manages on this device and the remote, not file contents. No files transfer unless you explicitly Continue.",
|
|
188
|
+
currentValue: "Review",
|
|
189
|
+
action: "remote-include" as const,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "localFields",
|
|
193
|
+
label: "Machine-local fields",
|
|
194
|
+
description:
|
|
195
|
+
"This setup: settings.json root fields excluded from future portable snapshots, not project overrides. Policy changes require reviewed directional migration; old history remains.",
|
|
196
|
+
currentValue: `${state.localFields?.length ?? 0} fields · Edit`,
|
|
197
|
+
action: "local-fields",
|
|
198
|
+
},
|
|
199
|
+
...transferSizeLimits.map(({ field, label, description }) => ({
|
|
200
|
+
id: field,
|
|
201
|
+
label,
|
|
202
|
+
description: `This setup: ${description} Also applies to automatic transfers. Saving starts no transfer.`,
|
|
203
|
+
currentValue: transferSizeLimitLabel(state[field]),
|
|
204
|
+
action: field,
|
|
205
|
+
})),
|
|
206
|
+
{
|
|
207
|
+
id: "storageLocation",
|
|
208
|
+
label: "Storage location",
|
|
209
|
+
description: "This setup: review and save bucket, branch, or path changes. Remote history is not moved.",
|
|
210
|
+
currentValue:
|
|
211
|
+
state.backend.type === "s3"
|
|
212
|
+
? `${safeTerminalText(state.backend.destination.bucket)} · ${safeTerminalText(state.backend.destination.prefix)}`
|
|
213
|
+
: state.backend.type === "git"
|
|
214
|
+
? `${safeTerminalText(state.backend.destination.branch)} · ${safeTerminalText(state.backend.destination.directory)}`
|
|
215
|
+
: safeTerminalText(state.backend.destination.path),
|
|
216
|
+
action: "storage-location",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: "setups",
|
|
220
|
+
label: "Manage sync setups",
|
|
221
|
+
description:
|
|
222
|
+
"This device: add, switch, edit, or remove sync setups. Each edit identifies its owner before saving.",
|
|
223
|
+
currentValue: "Open",
|
|
224
|
+
action: "setups",
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: "connections",
|
|
228
|
+
label: "Manage storage connections",
|
|
229
|
+
description:
|
|
230
|
+
"Shared connections on this device: review affected setups before saving server or credential changes.",
|
|
231
|
+
currentValue: "Open",
|
|
232
|
+
action: "connections",
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: "automatic",
|
|
236
|
+
label: "Automatic sync",
|
|
237
|
+
description: AUTOMATIC_SYNC_DESCRIPTION,
|
|
238
|
+
currentValue: state.automatic ? "On" : "Off",
|
|
239
|
+
values: ["On", "Off"],
|
|
240
|
+
action: "automatic",
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
id: "automaticTransfer",
|
|
244
|
+
label: "Startup transfer",
|
|
245
|
+
description: `${STARTUP_TRANSFER_DESCRIPTION} Saved preference and requirements: ${startupTransferSummary(state)}.`,
|
|
246
|
+
currentValue: state.automaticTransfer ? "On" : "Off",
|
|
247
|
+
values: ["On", "Off"],
|
|
248
|
+
action: "automatic-transfer",
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: "onSwitch",
|
|
252
|
+
label: "On setup switch",
|
|
253
|
+
description:
|
|
254
|
+
"All setups on this device: ask before a pull review, open it automatically, or switch without pulling. Applies to subsequent switches.",
|
|
255
|
+
currentValue: setupSwitchActionLabel(state.onSwitch),
|
|
256
|
+
values: SETUP_SWITCH_ACTION_OPTIONS.map(({ label }) => label),
|
|
257
|
+
action: "on-switch",
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: "mergeSettings",
|
|
261
|
+
label: "Merge settings fields",
|
|
262
|
+
description:
|
|
263
|
+
"This setup, opt-in: merge independent global settings.json root fields with a verified private ancestor. Arrays and nested objects remain atomic. Applies to subsequent sync; no reload.",
|
|
264
|
+
currentValue: state.mergeSettings ? "On" : "Off",
|
|
265
|
+
values: ["On", "Off"],
|
|
266
|
+
action: "merge-settings",
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
id: "contentPolicy",
|
|
270
|
+
label: "Content merge / partial progress",
|
|
271
|
+
description: `This setup, opt-in: ${state.scope === "agent-directory" ? "review format compatibility" : "review the version-5 upgrade"} before saving. Merge bounded text and prefix-only sessions; partial progress keeps withheld versions and baselines. Applies to subsequent sync; disabling does not clear recovery evidence.`,
|
|
272
|
+
currentValue: state.mergeContent
|
|
273
|
+
? state.partialSync
|
|
274
|
+
? "Merge + partial"
|
|
275
|
+
: "Merge only"
|
|
276
|
+
: state.partialSync
|
|
277
|
+
? "Partial only"
|
|
278
|
+
: "Off",
|
|
279
|
+
values: ["Off", "Merge only", "Merge + partial", "Partial only"],
|
|
280
|
+
action: "content-policy",
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: "skipSecretScan",
|
|
284
|
+
label: "Skip secret scan",
|
|
285
|
+
description:
|
|
286
|
+
"All setups on this device: skip possible-secret checks on subsequent pushes, including automatic pushes. Other safety checks remain. Diagnostics still scans.",
|
|
287
|
+
currentValue: state.skipSecretScan ? "On" : "Off",
|
|
288
|
+
values: ["On", "Off"],
|
|
289
|
+
action: "skip-secret-scan",
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: "showStatus",
|
|
293
|
+
label: "Show sync status",
|
|
294
|
+
description:
|
|
295
|
+
"All setups on this device: saved and applied immediately to Pi status. Review widgets and notifications remain available.",
|
|
296
|
+
currentValue: state.showStatus ? "On" : "Off",
|
|
297
|
+
values: ["On", "Off"],
|
|
298
|
+
action: "show-status",
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: "debug",
|
|
302
|
+
label: "Debug mode",
|
|
303
|
+
description:
|
|
304
|
+
"Write startup timings and sync events to the local pi-sync.log. Pi applies this at the next session start; the daemon applies it at its next settings check.",
|
|
305
|
+
currentValue: state.debug ? "On" : "Off",
|
|
306
|
+
values: ["On", "Off"],
|
|
307
|
+
action: "debug",
|
|
308
|
+
},
|
|
309
|
+
] satisfies MenuSettingItem<Action>[],
|
|
416
310
|
}),
|
|
417
311
|
},
|
|
418
312
|
actions: {
|
|
@@ -444,7 +338,7 @@ export async function showSyncSettings(
|
|
|
444
338
|
if (
|
|
445
339
|
!(await ctx.ui.confirm(
|
|
446
340
|
"Save content policy?",
|
|
447
|
-
`${previous.
|
|
341
|
+
`${previous.scope === "agent-directory" ? "Agent directory scope uses snapshot version 5; older clients must refuse it." : "This explicitly upgrades settings to at least version 5; partial snapshots use version 3, or version 4 with exclusions, and older clients must refuse them."} Text/session merge is conservative. Partial sync preserves withheld versions and old baselines. Disabling does not clear unresolved groups or recovery evidence. Review a directional migration first if portable policy changes.`,
|
|
448
342
|
{ signal: mutationSignal },
|
|
449
343
|
))
|
|
450
344
|
)
|
|
@@ -520,7 +414,7 @@ export async function showSyncSettings(
|
|
|
520
414
|
if (sameLocalFields(previous.localFields, fields)) return { kind: "stay" };
|
|
521
415
|
const confirmed = await ctx.ui.confirm(
|
|
522
416
|
"Save portable field policy?",
|
|
523
|
-
`${previous.
|
|
417
|
+
`${previous.scope === "agent-directory" ? "Agent directory scope uses snapshot version 5." : "This opts into at least settings/snapshot version 4/2; exclude-enabled setups retain snapshot version 4."} Older clients must refuse unsupported formats. Future snapshots omit these fields, but old remote history is NOT erased. Review an explicit force push/pull migration before further sync. Removed rules can expose or replace local-only values.`,
|
|
524
418
|
{ signal: mutationSignal },
|
|
525
419
|
);
|
|
526
420
|
validate();
|
|
@@ -572,61 +466,6 @@ export async function showSyncSettings(
|
|
|
572
466
|
return { kind: "rejected" };
|
|
573
467
|
}
|
|
574
468
|
},
|
|
575
|
-
"agent-mode": async ({ value, signal: actionSignal }) => {
|
|
576
|
-
const mutationSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
577
|
-
const validate = captureMutationOwner(ctx, mutationSignal);
|
|
578
|
-
try {
|
|
579
|
-
const saved = await saveAgentMode(ctx, setupName, value === "On", mutationSignal);
|
|
580
|
-
if (!saved) return { kind: "rejected" };
|
|
581
|
-
try {
|
|
582
|
-
validate();
|
|
583
|
-
ctx.ui.notify(
|
|
584
|
-
"Autonomous sync saved. Applies to subsequent sync and the next session start; no transfer started.",
|
|
585
|
-
"info",
|
|
586
|
-
);
|
|
587
|
-
} catch {
|
|
588
|
-
// The save committed. A closed or replaced UI must not report a failed save.
|
|
589
|
-
// The next Settings read shows the persisted value.
|
|
590
|
-
}
|
|
591
|
-
return { kind: "stay" };
|
|
592
|
-
} catch (error) {
|
|
593
|
-
try {
|
|
594
|
-
validate();
|
|
595
|
-
} catch {
|
|
596
|
-
return { kind: "rejected" };
|
|
597
|
-
}
|
|
598
|
-
notifySaveFailure(ctx, error);
|
|
599
|
-
return { kind: "rejected" };
|
|
600
|
-
}
|
|
601
|
-
},
|
|
602
|
-
continuous: async ({ value, signal: actionSignal }) => {
|
|
603
|
-
const mutationSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
604
|
-
const validate = captureMutationOwner(ctx, mutationSignal);
|
|
605
|
-
try {
|
|
606
|
-
const saved = await saveContinuousMode(ctx, setupName, value === "On", mutationSignal);
|
|
607
|
-
if (!saved) return { kind: "rejected" };
|
|
608
|
-
try {
|
|
609
|
-
validate();
|
|
610
|
-
ctx.ui.notify(
|
|
611
|
-
value === "On"
|
|
612
|
-
? "Continuous sync enabled. Monitoring starts after the /sync command or manager closes; completed work is not undone."
|
|
613
|
-
: "Continuous sync disabled. Completed work is not undone.",
|
|
614
|
-
"info",
|
|
615
|
-
);
|
|
616
|
-
} catch {
|
|
617
|
-
/* committed save; do not use stale UI */
|
|
618
|
-
}
|
|
619
|
-
return { kind: "stay" };
|
|
620
|
-
} catch (error) {
|
|
621
|
-
try {
|
|
622
|
-
validate();
|
|
623
|
-
} catch {
|
|
624
|
-
return { kind: "rejected" };
|
|
625
|
-
}
|
|
626
|
-
notifySaveFailure(ctx, error);
|
|
627
|
-
return { kind: "rejected" };
|
|
628
|
-
}
|
|
629
|
-
},
|
|
630
469
|
"automatic-transfer": async ({ value, signal: actionSignal }) => {
|
|
631
470
|
const automaticTransfer = value === "On";
|
|
632
471
|
const mutationSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
@@ -710,47 +549,13 @@ export async function showSyncSettings(
|
|
|
710
549
|
await showExcludedPaths(ctx, setupName, editorSignal);
|
|
711
550
|
return resumeSettings(editorSignal);
|
|
712
551
|
},
|
|
713
|
-
"
|
|
714
|
-
const reviewSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
715
|
-
const validate = captureMutationOwner(ctx, reviewSignal);
|
|
716
|
-
const client = piDaemonClient(ctx);
|
|
717
|
-
try {
|
|
718
|
-
validate();
|
|
719
|
-
const policy = (await client.run("daemon.policy", {}, reviewSignal)) as {
|
|
720
|
-
setup: string;
|
|
721
|
-
fingerprint: string;
|
|
722
|
-
automatic: boolean;
|
|
723
|
-
};
|
|
724
|
-
validate();
|
|
725
|
-
if (policy.setup !== state.setupName) return exitSettings();
|
|
726
|
-
if (policy.automatic) {
|
|
727
|
-
ctx.ui.notify("Automatic work is already approved for this setup and policy.", "info");
|
|
728
|
-
return { kind: "stay" };
|
|
729
|
-
}
|
|
730
|
-
const accepted = await client.run(
|
|
731
|
-
"daemon.authorize-connected",
|
|
732
|
-
{ fingerprint: policy.fingerprint },
|
|
733
|
-
reviewSignal,
|
|
734
|
-
);
|
|
735
|
-
validate();
|
|
736
|
-
if (accepted === true) ctx.ui.notify("Automatic work approved for this setup and policy.", "info");
|
|
737
|
-
return { kind: "stay" };
|
|
738
|
-
} catch (error) {
|
|
739
|
-
if (reviewSignal.aborted || !isCurrent()) return exitSettings();
|
|
740
|
-
notifySaveFailure(ctx, error);
|
|
741
|
-
return { kind: "rejected" };
|
|
742
|
-
}
|
|
743
|
-
},
|
|
744
|
-
"ignore-switch": ignoreAction("switch"),
|
|
745
|
-
"ignore-migrate": ignoreAction("migrate"),
|
|
746
|
-
"remote-include": async ({ state, signal: actionSignal }) => {
|
|
747
|
-
if (state.reservedIgnoreNames !== undefined && !ignoreAvailable) return { kind: "rejected" };
|
|
552
|
+
"remote-include": async ({ signal: actionSignal }) => {
|
|
748
553
|
const reviewSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
749
554
|
const { showRemoteSelectionReview } = await import("./remote-selection-ui.js");
|
|
750
555
|
if (reviewSignal.aborted) return { kind: "rejected" };
|
|
751
556
|
const review = await showRemoteSelectionReview(ctx, setupName, reviewSignal, undefined, {
|
|
752
557
|
origin: "settings",
|
|
753
|
-
|
|
558
|
+
runRoute,
|
|
754
559
|
});
|
|
755
560
|
if (reviewSignal.aborted) return { kind: "rejected" };
|
|
756
561
|
if (review.kind === "route-result") {
|
|
@@ -779,21 +584,17 @@ export async function showSyncSettings(
|
|
|
779
584
|
if (action.signal.aborted || signal?.aborted) return { kind: "rejected" };
|
|
780
585
|
validate();
|
|
781
586
|
if (result?.kind === "stay") {
|
|
782
|
-
const { value
|
|
587
|
+
const { value } = action;
|
|
783
588
|
const enabled = value === "On";
|
|
784
589
|
const setup = safeTerminalText(setupName);
|
|
785
|
-
const approval =
|
|
786
|
-
enabled && state.reservedIgnoreNames !== undefined
|
|
787
|
-
? " Use Review automatic transfers to approve this policy separately."
|
|
788
|
-
: "";
|
|
789
590
|
const message = {
|
|
790
|
-
automatic: `Automatic sync for “${setup}”: ${value}.${enabled ? " New startup checks begin next session." : ""}
|
|
791
|
-
"automatic-transfer": `Startup transfer for “${setup}”: ${value}.${enabled ? " Applies at the next session start." : ""}
|
|
591
|
+
automatic: `Automatic sync for “${setup}”: ${value}.${enabled ? " New startup checks begin next session." : ""}`,
|
|
592
|
+
"automatic-transfer": `Startup transfer for “${setup}”: ${value}.${enabled ? " Applies at the next session start." : ""}`,
|
|
792
593
|
"merge-settings": `Merge settings fields for “${setup}”: ${value}. Applies to subsequent sync operations.`,
|
|
793
594
|
"skip-secret-scan": `Secret scan ${enabled ? "disabled" : "enabled"} for subsequent pushes in all setups.`,
|
|
794
595
|
"show-status": `Show sync status: ${value}. Applies immediately to all setups.`,
|
|
795
596
|
debug: `Debug mode: ${value}. Pi applies it at the next session start.`,
|
|
796
|
-
"on-switch": `On setup switch: ${value}
|
|
597
|
+
"on-switch": `On setup switch: ${value}.`,
|
|
797
598
|
}[id];
|
|
798
599
|
ctx.ui.notify(`Saved. ${message}`, "info");
|
|
799
600
|
}
|
|
@@ -863,13 +664,8 @@ export async function showSyncSettings(
|
|
|
863
664
|
}
|
|
864
665
|
try {
|
|
865
666
|
validate();
|
|
866
|
-
const approval =
|
|
867
|
-
state.reservedIgnoreNames !== undefined &&
|
|
868
|
-
(startupTransferEnabled(state) || (state.automatic && syncSessionsSelected(state)))
|
|
869
|
-
? " Use Review automatic transfers to approve this policy separately."
|
|
870
|
-
: "";
|
|
871
667
|
ctx.ui.notify(
|
|
872
|
-
`Saved. ${label} for “${setupLabel}”: ${transferSizeLimitLabel(limit)}. Applies to subsequent transfers; no transfer started
|
|
668
|
+
`Saved. ${label} for “${setupLabel}”: ${transferSizeLimitLabel(limit)}. Applies to subsequent transfers; no transfer started.`,
|
|
873
669
|
"info",
|
|
874
670
|
);
|
|
875
671
|
} catch {
|
|
@@ -878,21 +674,6 @@ export async function showSyncSettings(
|
|
|
878
674
|
return stay;
|
|
879
675
|
};
|
|
880
676
|
}
|
|
881
|
-
function ignoreAction(action: Parameters<typeof showIgnoreFileAction>[2]) {
|
|
882
|
-
return async ({ state, signal: actionSignal }: { state: SettingsState; signal: AbortSignal }) => {
|
|
883
|
-
if (!ignoreAvailable || (state.pathPolicy === "ignore-file") === (action === "migrate"))
|
|
884
|
-
return { kind: "rejected" as const };
|
|
885
|
-
const editorSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
|
|
886
|
-
const latest = await loadSettingsConfig();
|
|
887
|
-
if (editorSignal.aborted || !isCurrent()) return { kind: "close" as const };
|
|
888
|
-
if (syncCheckConfigFingerprint(latest) !== syncCheckConfigFingerprint(state)) {
|
|
889
|
-
ctx.ui.notify("Sync setup changed while Settings was open; reopen it before changing the policy.", "warning");
|
|
890
|
-
return { kind: "close" as const };
|
|
891
|
-
}
|
|
892
|
-
await showIgnoreFileAction(ctx, setupName, action, state.ignoreFile ?? ".syncignore", editorSignal);
|
|
893
|
-
return resumeSettings(editorSignal);
|
|
894
|
-
};
|
|
895
|
-
}
|
|
896
677
|
async function resumeSettings(editorSignal: AbortSignal) {
|
|
897
678
|
if (editorSignal.aborted || !isCurrent()) return { kind: "close" as const };
|
|
898
679
|
try {
|