@narumitw/pi-sync 0.67.3 → 0.68.1

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.
Files changed (175) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +26 -48
  3. package/dist/chunks/{chunk-XUZV4OGI.ts → chunk-335XTMMZ.ts} +3 -2
  4. package/dist/chunks/{chunk-XUZV4OGI.ts.map → chunk-335XTMMZ.ts.map} +2 -2
  5. package/dist/chunks/{chunk-PUSMSKIM.ts → chunk-AYGMIMCV.ts} +2 -11
  6. package/dist/chunks/chunk-AYGMIMCV.ts.map +7 -0
  7. package/dist/chunks/{chunk-HLJIRWFL.ts → chunk-BCDBT4X3.ts} +7 -7
  8. package/dist/chunks/{chunk-AVTW6WNP.ts → chunk-FQKWGVMA.ts} +20 -54
  9. package/dist/chunks/chunk-FQKWGVMA.ts.map +7 -0
  10. package/dist/chunks/{chunk-DGVZYS7T.ts → chunk-FR6A7ASZ.ts} +8 -11
  11. package/dist/chunks/chunk-FR6A7ASZ.ts.map +7 -0
  12. package/dist/chunks/{chunk-3NS4PMCI.ts → chunk-J52GYZO6.ts} +2 -8
  13. package/dist/chunks/{chunk-3NS4PMCI.ts.map → chunk-J52GYZO6.ts.map} +2 -2
  14. package/dist/chunks/{chunk-2MUAR5GH.ts → chunk-KAIVTJIQ.ts} +7 -10
  15. package/dist/chunks/chunk-KAIVTJIQ.ts.map +7 -0
  16. package/dist/chunks/{chunk-WBIOSK76.ts → chunk-R7PN3KIY.ts} +1 -2
  17. package/dist/chunks/{chunk-3Q3DMMID.ts → chunk-TLYT6HVI.ts} +8 -8
  18. package/dist/chunks/{chunk-X344HTVV.ts → chunk-WCGLU526.ts} +39 -118
  19. package/dist/chunks/chunk-WCGLU526.ts.map +7 -0
  20. package/dist/chunks/{chunk-CQ4DMLH3.ts → chunk-WQXUZSY5.ts} +25 -83
  21. package/dist/chunks/chunk-WQXUZSY5.ts.map +7 -0
  22. package/dist/chunks/{chunk-JREGWM2B.ts → chunk-XNUARYLR.ts} +1 -2
  23. package/dist/chunks/{command-handler-WF2TDDRZ.ts → command-handler-5LDTCUJE.ts} +64 -59
  24. package/dist/chunks/command-handler-5LDTCUJE.ts.map +7 -0
  25. package/dist/chunks/{conflict-review-GWEL4S6C.ts → conflict-review-SZ3AWTX6.ts} +2 -2
  26. package/dist/chunks/{file-selection-GASCVN45.ts → file-selection-4BOQBXS7.ts} +10 -17
  27. package/dist/chunks/file-selection-4BOQBXS7.ts.map +7 -0
  28. package/dist/chunks/{manager-result-dispatcher-BXN46NRC.ts → manager-result-dispatcher-A4IWLS4J.ts} +7 -7
  29. package/dist/chunks/{manager-ui-FS4QIKRA.ts → manager-ui-KHMCSLLV.ts} +114 -581
  30. package/dist/chunks/manager-ui-KHMCSLLV.ts.map +7 -0
  31. package/dist/chunks/{chunk-ECUCXF5Y.ts → merge-review-LWMUE5IW.ts} +2 -3
  32. package/dist/chunks/{remote-selection-ui-DOYKUMER.ts → remote-selection-ui-F6NJBQ3Y.ts} +6 -6
  33. package/dist/chunks/{setup-switch-JZDFQPVW.ts → setup-switch-7LMIRMZ7.ts} +6 -6
  34. package/dist/chunks/{setup-wizard-PI45SF2C.ts → setup-wizard-2NRPR433.ts} +11 -16
  35. package/dist/chunks/{setup-wizard-PI45SF2C.ts.map → setup-wizard-2NRPR433.ts.map} +1 -1
  36. package/dist/chunks/{sync-inspection-DI5J6EUH.ts → sync-inspection-OTI4JDQ2.ts} +5 -5
  37. package/dist/chunks/{sync-operations-AGNL7QXA.ts → sync-operations-ZUYJLWUN.ts} +2 -2
  38. package/dist/daemon/dist/build-id.json +1 -1
  39. package/dist/daemon/dist/cli.js +22 -3
  40. package/dist/daemon/dist/client-transport.js +2 -0
  41. package/dist/daemon/dist/client.js +2 -10
  42. package/dist/daemon/dist/consent.js +13 -135
  43. package/dist/daemon/dist/engine/backends/git/git-backend.js +4 -17
  44. package/dist/daemon/dist/engine/backends/git/git-storage.js +11 -44
  45. package/dist/daemon/dist/engine/backends/s3/s3-backend.js +6 -6
  46. package/dist/daemon/dist/engine/backends/webdav/webdav-backend.js +6 -6
  47. package/dist/daemon/dist/engine/settings/config.js +16 -149
  48. package/dist/daemon/dist/engine/settings/retired-ignore-policy.js +16 -0
  49. package/dist/daemon/dist/engine/settings/retired-ignore-recovery.js +14 -0
  50. package/dist/daemon/dist/engine/settings/settings-management.js +2 -10
  51. package/dist/daemon/dist/engine/settings/settings-validation.js +8 -21
  52. package/dist/daemon/dist/engine/snapshot/session-paths.js +13 -41
  53. package/dist/daemon/dist/engine/snapshot/snapshot-apply.js +8 -24
  54. package/dist/daemon/dist/engine/snapshot/snapshot-codec.js +7 -11
  55. package/dist/daemon/dist/engine/snapshot/snapshot-exclude-safety.js +19 -76
  56. package/dist/daemon/dist/engine/snapshot/snapshot-transaction-images.js +1 -7
  57. package/dist/daemon/dist/engine/snapshot/snapshot-transaction-policy.js +8 -102
  58. package/dist/daemon/dist/engine/snapshot/snapshot-transaction.js +20 -100
  59. package/dist/daemon/dist/engine/snapshot/snapshot-types.js +1 -11
  60. package/dist/daemon/dist/engine/snapshot/snapshot.js +26 -78
  61. package/dist/daemon/dist/engine/state/sync-state-store.js +5 -1
  62. package/dist/daemon/dist/engine/sync/agent-plan.js +0 -1
  63. package/dist/daemon/dist/engine/sync/agent-policy.js +1 -1
  64. package/dist/daemon/dist/engine/sync/conflict-review.js +0 -2
  65. package/dist/daemon/dist/engine/sync/continuous-sync.js +2 -17
  66. package/dist/daemon/dist/engine/sync/continuous-watch.js +3 -7
  67. package/dist/daemon/dist/engine/sync/directional-action.js +3 -21
  68. package/dist/daemon/dist/engine/sync/initialization.js +4 -15
  69. package/dist/daemon/dist/engine/sync/local-fields.js +4 -65
  70. package/dist/daemon/dist/engine/sync/merge-apply.js +8 -31
  71. package/dist/daemon/dist/engine/sync/merge-journal.js +8 -118
  72. package/dist/daemon/dist/engine/sync/merged-sync.js +12 -70
  73. package/dist/daemon/dist/engine/sync/push-review.js +1 -16
  74. package/dist/daemon/dist/engine/sync/remote-snapshot.js +48 -65
  75. package/dist/daemon/dist/engine/sync/startup-bootstrap.js +3 -3
  76. package/dist/daemon/dist/engine/sync/sync-error-guidance.js +1 -1
  77. package/dist/daemon/dist/engine/sync/sync-inspection.js +1 -2
  78. package/dist/daemon/dist/engine/sync/sync-mutations.js +25 -118
  79. package/dist/daemon/dist/engine/sync/sync-policy.js +26 -150
  80. package/dist/daemon/dist/engine/sync/sync-queries.js +81 -65
  81. package/dist/daemon/dist/engine/sync/sync-rollback.js +12 -50
  82. package/dist/daemon/dist/engine/sync/sync-state.js +2 -15
  83. package/dist/daemon/dist/engine/sync/transfer-freshness.js +7 -17
  84. package/dist/daemon/dist/engine/sync/transfer-size-limits.js +3 -7
  85. package/dist/daemon/dist/engine/ui/sync-format.js +1 -1
  86. package/dist/daemon/dist/engine-service.js +60 -219
  87. package/dist/daemon/dist/foreground-queue-outcome.js +0 -4
  88. package/dist/daemon/dist/legacy-consent-guard.js +34 -0
  89. package/dist/daemon/dist/server.js +4 -8
  90. package/dist/daemon/dist/service-host.js +4 -10
  91. package/dist/daemon/package.json +1 -1
  92. package/dist/index.ts +45 -46
  93. package/dist/index.ts.map +3 -3
  94. package/docs/continuous-sync-verification.md +1 -1
  95. package/docs/daemon-migration.md +7 -5
  96. package/docs/tui-contract.md +4 -6
  97. package/package.json +2 -3
  98. package/skills/configure-pi-sync/SKILL.md +18 -77
  99. package/skills/configure-pi-sync/references/configuration.md +60 -77
  100. package/src/commands/command-execution.ts +13 -29
  101. package/src/commands/command-handler.ts +0 -4
  102. package/src/commands/command.ts +2 -1
  103. package/src/daemon/directional-recovery.ts +4 -33
  104. package/src/daemon/pi-client.ts +28 -90
  105. package/src/settings/config.ts +0 -1
  106. package/src/sync/setup-switch.ts +1 -4
  107. package/src/sync-extension.ts +10 -24
  108. package/src/ui/cancellable-operation.ts +2 -13
  109. package/src/ui/excluded-paths-ui.ts +1 -4
  110. package/src/ui/file-selection.ts +0 -5
  111. package/src/ui/manager-state.ts +12 -75
  112. package/src/ui/manager-ui.ts +7 -96
  113. package/src/ui/remote-selection-ui.ts +29 -130
  114. package/src/ui/settings-ui.ts +169 -388
  115. package/src/ui/setup/setup-actions.ts +4 -16
  116. package/src/ui/setup/setup-prompts.ts +12 -49
  117. package/src/ui/setup/setup-switcher.ts +8 -14
  118. package/src/ui/storage-connections-ui.ts +21 -32
  119. package/src/ui/sync-setups-ui.ts +27 -53
  120. package/dist/chunks/chunk-2MUAR5GH.ts.map +0 -7
  121. package/dist/chunks/chunk-33EDXDLC.ts +0 -106
  122. package/dist/chunks/chunk-33EDXDLC.ts.map +0 -7
  123. package/dist/chunks/chunk-AVTW6WNP.ts.map +0 -7
  124. package/dist/chunks/chunk-CQ4DMLH3.ts.map +0 -7
  125. package/dist/chunks/chunk-DGVZYS7T.ts.map +0 -7
  126. package/dist/chunks/chunk-EJDDRS6O.ts +0 -17
  127. package/dist/chunks/chunk-EJDDRS6O.ts.map +0 -7
  128. package/dist/chunks/chunk-KNEUL4XN.ts +0 -30
  129. package/dist/chunks/chunk-KNEUL4XN.ts.map +0 -7
  130. package/dist/chunks/chunk-PUSMSKIM.ts.map +0 -7
  131. package/dist/chunks/chunk-WFBHWYI6.ts +0 -18
  132. package/dist/chunks/chunk-WFBHWYI6.ts.map +0 -7
  133. package/dist/chunks/chunk-X344HTVV.ts.map +0 -7
  134. package/dist/chunks/command-handler-WF2TDDRZ.ts.map +0 -7
  135. package/dist/chunks/config-P54GGMXY.ts +0 -39
  136. package/dist/chunks/continuous-record-3SKJ6I3V.ts +0 -23
  137. package/dist/chunks/continuous-record-3SKJ6I3V.ts.map +0 -7
  138. package/dist/chunks/continuous-storage-3EU6I7Z3.ts +0 -27
  139. package/dist/chunks/continuous-storage-3EU6I7Z3.ts.map +0 -7
  140. package/dist/chunks/file-selection-GASCVN45.ts.map +0 -7
  141. package/dist/chunks/ignore-file-ui-BEZZZIEE.ts +0 -21
  142. package/dist/chunks/manager-ui-FS4QIKRA.ts.map +0 -7
  143. package/dist/chunks/merge-review-C2KETZKY.ts +0 -11
  144. package/dist/chunks/merge-review-C2KETZKY.ts.map +0 -7
  145. package/dist/chunks/remote-selection-ui-DOYKUMER.ts.map +0 -7
  146. package/dist/chunks/setup-switch-JZDFQPVW.ts.map +0 -7
  147. package/dist/daemon/dist/engine/ignore/adoption-journal.js +0 -146
  148. package/dist/daemon/dist/engine/ignore/effective-ignore-policy.js +0 -33
  149. package/dist/daemon/dist/engine/ignore/ignore-edit.js +0 -102
  150. package/dist/daemon/dist/engine/ignore/ignore-initialization.js +0 -288
  151. package/dist/daemon/dist/engine/ignore/ignore-migration-prompt.js +0 -139
  152. package/dist/daemon/dist/engine/ignore/ignore-settings.js +0 -391
  153. package/dist/daemon/dist/engine/ignore/ignore-source.js +0 -250
  154. package/dist/daemon/dist/engine/ignore/snapshot-ignore-rules.js +0 -39
  155. package/dist/daemon/dist/engine/sync/ignore-adoption-recovery.js +0 -50
  156. package/dist/daemon/dist/engine/sync/ignore-adoption.js +0 -416
  157. package/dist/daemon/dist/engine/sync/ignore-publication.js +0 -23
  158. package/dist/daemon/dist/engine/ui/ignore-rule-preview.js +0 -18
  159. package/dist/daemon/dist/monitor.js +0 -344
  160. package/src/ui/agent-mode-setting.ts +0 -99
  161. package/src/ui/ignore-file-guidance.ts +0 -7
  162. package/src/ui/ignore-file-ui.ts +0 -105
  163. package/src/ui/ignore-migration-prompt.ts +0 -65
  164. package/src/ui/settings-review.ts +0 -26
  165. /package/dist/chunks/{chunk-HLJIRWFL.ts.map → chunk-BCDBT4X3.ts.map} +0 -0
  166. /package/dist/chunks/{chunk-WBIOSK76.ts.map → chunk-R7PN3KIY.ts.map} +0 -0
  167. /package/dist/chunks/{chunk-3Q3DMMID.ts.map → chunk-TLYT6HVI.ts.map} +0 -0
  168. /package/dist/chunks/{chunk-JREGWM2B.ts.map → chunk-XNUARYLR.ts.map} +0 -0
  169. /package/dist/chunks/{conflict-review-GWEL4S6C.ts.map → conflict-review-SZ3AWTX6.ts.map} +0 -0
  170. /package/dist/chunks/{config-P54GGMXY.ts.map → manager-result-dispatcher-A4IWLS4J.ts.map} +0 -0
  171. /package/dist/chunks/{chunk-ECUCXF5Y.ts.map → merge-review-LWMUE5IW.ts.map} +0 -0
  172. /package/dist/chunks/{ignore-file-ui-BEZZZIEE.ts.map → remote-selection-ui-F6NJBQ3Y.ts.map} +0 -0
  173. /package/dist/chunks/{manager-result-dispatcher-BXN46NRC.ts.map → setup-switch-7LMIRMZ7.ts.map} +0 -0
  174. /package/dist/chunks/{sync-inspection-DI5J6EUH.ts.map → sync-inspection-OTI4JDQ2.ts.map} +0 -0
  175. /package/dist/chunks/{sync-operations-AGNL7QXA.ts.map → sync-operations-ZUYJLWUN.ts.map} +0 -0
@@ -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
- ...(limited ? [IGNORE_SETUP_MANAGEMENT_LIMIT, ...ignoreSetupRecovery(settingsPath)] : []),
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
- ...(!limited && config?.reservedIgnoreNames !== undefined
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
- ...(state.reservedIgnoreNames !== undefined && !ignoreAvailable
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
- ...(state.pathPolicy === "ignore-file"
186
- ? ignoreAvailable
187
- ? [
188
- {
189
- id: "ignoreFile",
190
- label: "Ignore file",
191
- description: `Select another existing local file. Sessions: ${state.include.includes("sessions") ? "opted in (rules still apply)" : "off"}. No transfer starts.`,
192
- currentValue: safeTerminalText(state.ignoreFile ?? ".syncignore"),
193
- action: "ignore-switch" as const,
194
- },
195
- ]
196
- : []
197
- : state.reservedIgnoreNames !== undefined && !ignoreAvailable
198
- ? []
199
- : state.scope === "agent-directory"
200
- ? [
201
- {
202
- id: "include",
203
- label: "Agent directory scope",
204
- description:
205
- "Edit exclusions, re-inclusions, and session opt-in in one reviewed draft. No transfer starts.",
206
- currentValue: `${state.exclude?.length ?? 0} excluded · ${state.reinclude?.length ?? 0} re-included · Sessions ${state.include.includes("sessions") ? "opted in" : "off"}`,
207
- action: "include" as const,
208
- },
209
- ]
210
- : [
211
- {
212
- id: "include",
213
- label: "Included paths",
214
- description:
215
- "This setup: choose paths in a draft, then review and Save or Discard. No transfer is started.",
216
- currentValue: `${state.include.length} paths · Edit`,
217
- action: "include" as const,
218
- },
219
- {
220
- id: "exclude",
221
- label: "Excluded paths",
222
- description:
223
- "This setup: draft relative paths or *, ?, ** patterns, then review Save/Discard. No transfer starts; old history is retained.",
224
- currentValue: `${state.exclude?.length ?? 0} rules · Edit`,
225
- action: "exclude" as const,
226
- },
227
- ]),
228
- ...(ignoreAvailable && state.pathPolicy !== "ignore-file"
229
- ? [
230
- {
231
- id: "migrateIgnoreFile",
232
- label: "Migrate to ignore file…",
233
- description: "Review the scope change for this legacy setup. Migration does not start a transfer.",
234
- currentValue: "Review",
235
- action: "ignore-migrate" as const,
236
- },
237
- ]
238
- : []),
239
- ...(state.reservedIgnoreNames !== undefined && !ignoreAvailable
240
- ? []
241
- : [
242
- {
243
- id: "remoteInclude",
244
- label:
245
- ignoreAvailable || state.scope === "agent-directory"
246
- ? "Compare sync policies"
247
- : "Compare included paths",
248
- description:
249
- state.pathPolicy === "ignore-file"
250
- ? "Read-only comparison of local and remote policy, not file contents."
251
- : "Compare what sync manages on this device and the remote, not file contents. No files transfer unless you explicitly Continue.",
252
- currentValue: "Review",
253
- action: "remote-include" as const,
254
- },
255
- ]),
256
- {
257
- id: "localFields",
258
- label: "Machine-local fields",
259
- description:
260
- "This setup: settings.json root fields excluded from future portable snapshots, not project overrides. Policy changes require reviewed directional migration; old history remains.",
261
- currentValue: `${state.localFields?.length ?? 0} fields · Edit`,
262
- action: "local-fields",
263
- },
264
- ...transferSizeLimits.map(({ field, label, description }) => ({
265
- id: field,
266
- label,
267
- description: `This setup: ${description} Also applies to automatic transfers. Saving starts no transfer.`,
268
- currentValue: transferSizeLimitLabel(state[field]),
269
- action: field,
270
- })),
271
- {
272
- id: "storageLocation",
273
- label: "Storage location",
274
- description: "This setup: review and save bucket, branch, or path changes. Remote history is not moved.",
275
- currentValue:
276
- state.backend.type === "s3"
277
- ? `${safeTerminalText(state.backend.destination.bucket)} · ${safeTerminalText(state.backend.destination.prefix)}`
278
- : state.backend.type === "git"
279
- ? `${safeTerminalText(state.backend.destination.branch)} · ${safeTerminalText(state.backend.destination.directory)}`
280
- : safeTerminalText(state.backend.destination.path),
281
- action: "storage-location",
282
- },
283
- {
284
- id: "setups",
285
- label: "Manage sync setups",
286
- description:
287
- state.reservedIgnoreNames !== undefined && !ignoreAvailable
288
- ? "Review configured setups and recovery options. Adding, editing, and switching are unavailable."
289
- : "This device: add, switch, edit, or remove sync setups. Each edit identifies its owner before saving.",
290
- currentValue: "Open",
291
- action: "setups",
292
- },
293
- {
294
- id: "connections",
295
- label: "Manage storage connections",
296
- description:
297
- state.reservedIgnoreNames !== undefined && !ignoreAvailable
298
- ? "Review shared connections. Connection changes are unavailable while ignore-file setups are configured."
299
- : "Shared connections on this device: review affected setups before saving server or credential changes.",
300
- currentValue: "Open",
301
- action: "connections",
302
- },
303
- {
304
- id: "automatic",
305
- label: "Automatic sync",
306
- description: AUTOMATIC_SYNC_DESCRIPTION,
307
- currentValue: state.automatic ? "On" : "Off",
308
- values: ["On", "Off"],
309
- action: "automatic",
310
- },
311
- {
312
- id: "automaticTransfer",
313
- label: "Startup transfer",
314
- description: `${STARTUP_TRANSFER_DESCRIPTION} Saved preference and requirements: ${startupTransferSummary(state)}.`,
315
- currentValue: state.automaticTransfer ? "On" : "Off",
316
- values: ["On", "Off"],
317
- action: "automatic-transfer",
318
- },
319
- {
320
- id: "agentMode",
321
- label: "Autonomous sync",
322
- description: AGENT_MODE_DESCRIPTION,
323
- currentValue: state.agentMode ? "On" : "Off",
324
- values: ["On", "Off"],
325
- action: "agent-mode",
326
- },
327
- {
328
- id: "continuous",
329
- label: "Continuous sync",
330
- description: `${CONTINUOUS_DESCRIPTION}${state.continuous && !state.agentMode ? " Saved On, but paused until Autonomous sync is enabled." : ""}`,
331
- currentValue: state.continuous ? "On" : "Off",
332
- values: ["On", "Off"],
333
- action: "continuous",
334
- },
335
- ...(ignoreAvailable &&
336
- state.reservedIgnoreNames !== undefined &&
337
- (startupTransferEnabled(state) || (state.automatic && syncSessionsSelected(state)))
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.pathPolicy === "ignore-file" ? `Ignore-file policy keeps settings version ${previous.settingsVersion} and publishes snapshot version 7; upgrade older clients first.` : 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.`,
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.pathPolicy === "ignore-file" ? `Ignore-file policy keeps settings version ${previous.settingsVersion} and publishes snapshot version 7.` : 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.`,
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
- "authorize-automatic": async ({ state, signal: actionSignal }) => {
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
- ...(state.pathPolicy === "ignore-file" ? { readOnly: true } : { runRoute }),
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, state } = action;
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." : ""}${approval}`,
791
- "automatic-transfer": `Startup transfer for “${setup}”: ${value}.${enabled ? " Applies at the next session start." : ""}${approval}`,
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}.${state.reservedIgnoreNames !== undefined ? " Switching still won't pull while any setup uses an ignore file." : ""}`,
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.${approval}`,
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 {