@narumitw/pi-sync 0.50.3 → 0.51.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.
Files changed (218) hide show
  1. package/README.md +4 -1
  2. package/dist/chunks/{chunk-6LP3MCR2.ts → chunk-2JZFHNLM.ts} +3 -5
  3. package/dist/chunks/chunk-2JZFHNLM.ts.map +7 -0
  4. package/dist/chunks/{chunk-LCRI3ABW.ts → chunk-2RZSQWBH.ts} +8 -19
  5. package/dist/chunks/chunk-2RZSQWBH.ts.map +7 -0
  6. package/dist/chunks/{chunk-IJ6FJFA5.ts → chunk-4AIHXRKE.ts} +11 -17
  7. package/dist/chunks/chunk-4AIHXRKE.ts.map +7 -0
  8. package/dist/chunks/{chunk-C7XY5NF5.ts → chunk-4MPIH46N.ts} +29 -51
  9. package/dist/chunks/chunk-4MPIH46N.ts.map +7 -0
  10. package/dist/chunks/{chunk-5B3FXBLE.ts → chunk-6546TS54.ts} +16 -20
  11. package/dist/chunks/chunk-6546TS54.ts.map +7 -0
  12. package/dist/chunks/{chunk-Q2TUM5X6.ts → chunk-6NT3YFGY.ts} +2 -2
  13. package/dist/chunks/chunk-6NT3YFGY.ts.map +7 -0
  14. package/dist/chunks/{chunk-2B2ELUF5.ts → chunk-7D5SF7P3.ts} +1 -1
  15. package/dist/chunks/chunk-7D5SF7P3.ts.map +7 -0
  16. package/dist/chunks/{chunk-YDWUZVPN.ts → chunk-7KHKWL3Q.ts} +28 -47
  17. package/dist/chunks/chunk-7KHKWL3Q.ts.map +7 -0
  18. package/dist/chunks/{chunk-ZI5MXMEX.ts → chunk-BVVP33U5.ts} +2 -4
  19. package/dist/chunks/chunk-BVVP33U5.ts.map +7 -0
  20. package/dist/chunks/{chunk-SZWBGPID.ts → chunk-DM4X4FIA.ts} +8 -13
  21. package/dist/chunks/chunk-DM4X4FIA.ts.map +7 -0
  22. package/dist/chunks/{chunk-SL64RLXR.ts → chunk-DZUSTGQV.ts} +8 -16
  23. package/dist/chunks/chunk-DZUSTGQV.ts.map +7 -0
  24. package/dist/chunks/{chunk-YHEMENKV.ts → chunk-E42GXD6D.ts} +13 -19
  25. package/dist/chunks/chunk-E42GXD6D.ts.map +7 -0
  26. package/dist/chunks/{chunk-Z4DQF6L3.ts → chunk-ECYCNZOE.ts} +1 -1
  27. package/dist/chunks/chunk-ECYCNZOE.ts.map +7 -0
  28. package/dist/chunks/{chunk-OEX4ABY6.ts → chunk-EEJPYTWE.ts} +11 -21
  29. package/dist/chunks/chunk-EEJPYTWE.ts.map +7 -0
  30. package/dist/chunks/{chunk-CPEHGXJV.ts → chunk-G4RUXRWZ.ts} +3 -5
  31. package/dist/chunks/chunk-G4RUXRWZ.ts.map +7 -0
  32. package/dist/chunks/{chunk-T2B5IU74.ts → chunk-HGJH56KR.ts} +4 -4
  33. package/dist/chunks/chunk-HGJH56KR.ts.map +7 -0
  34. package/dist/chunks/{chunk-JAAKLL6M.ts → chunk-IVXEDPAD.ts} +10 -34
  35. package/dist/chunks/chunk-IVXEDPAD.ts.map +7 -0
  36. package/dist/chunks/chunk-K3RIEL6J.ts +20 -0
  37. package/dist/chunks/chunk-K3RIEL6J.ts.map +7 -0
  38. package/dist/chunks/{chunk-LTBWGSBV.ts → chunk-MSSW6F3R.ts} +1 -1
  39. package/dist/chunks/chunk-MSSW6F3R.ts.map +7 -0
  40. package/dist/chunks/{chunk-T3HH3UEJ.ts → chunk-OVDTF5CH.ts} +4 -10
  41. package/dist/chunks/chunk-OVDTF5CH.ts.map +7 -0
  42. package/dist/chunks/{chunk-NJFUIVYL.ts → chunk-PWMWOJP4.ts} +1 -1
  43. package/dist/chunks/chunk-PWMWOJP4.ts.map +7 -0
  44. package/dist/chunks/{chunk-HUDQATCL.ts → chunk-Q32CQWPM.ts} +6 -8
  45. package/dist/chunks/chunk-Q32CQWPM.ts.map +7 -0
  46. package/dist/chunks/{chunk-ETTRJDNP.ts → chunk-QLSN7AGX.ts} +6 -13
  47. package/dist/chunks/chunk-QLSN7AGX.ts.map +7 -0
  48. package/dist/chunks/{chunk-THMF4BVL.ts → chunk-SWUXA3MH.ts} +1 -1
  49. package/dist/chunks/chunk-SWUXA3MH.ts.map +7 -0
  50. package/dist/chunks/{chunk-TEN2ZBJV.ts → chunk-T2SJD3N7.ts} +2 -4
  51. package/dist/chunks/chunk-T2SJD3N7.ts.map +7 -0
  52. package/dist/chunks/{chunk-AUSDLD6F.ts → chunk-T56RNRZJ.ts} +10 -26
  53. package/dist/chunks/chunk-T56RNRZJ.ts.map +7 -0
  54. package/dist/chunks/{chunk-DHVFS4QK.ts → chunk-UA7RXOIT.ts} +37 -90
  55. package/dist/chunks/chunk-UA7RXOIT.ts.map +7 -0
  56. package/dist/chunks/{chunk-D5X27LCA.ts → chunk-UETBKTDI.ts} +1 -1
  57. package/dist/chunks/chunk-UETBKTDI.ts.map +7 -0
  58. package/dist/chunks/{chunk-CHH26D4F.ts → chunk-YFADF5ZQ.ts} +7 -6
  59. package/dist/chunks/chunk-YFADF5ZQ.ts.map +7 -0
  60. package/dist/chunks/{chunk-CCSN3F47.ts → chunk-YPXGU5OR.ts} +4 -4
  61. package/dist/chunks/chunk-YPXGU5OR.ts.map +7 -0
  62. package/dist/chunks/{file-selection-FTTKAOYX.ts → file-selection-RAVHRYFG.ts} +14 -26
  63. package/dist/chunks/file-selection-RAVHRYFG.ts.map +7 -0
  64. package/dist/chunks/{git-backend-GMVS4PD4.ts → git-backend-IAANDL3K.ts} +41 -104
  65. package/dist/chunks/git-backend-IAANDL3K.ts.map +7 -0
  66. package/dist/chunks/manager-result-dispatcher-OTUMQM26.ts +23 -0
  67. package/dist/chunks/{manager-ui-IPAOAWZA.ts → manager-ui-763NEKJY.ts} +124 -251
  68. package/dist/chunks/manager-ui-763NEKJY.ts.map +7 -0
  69. package/dist/chunks/remote-selection-ui-TZTJF32Y.ts +22 -0
  70. package/dist/chunks/{s3-backend-66O4FGBH.ts → s3-backend-XGXUOPUN.ts} +23 -54
  71. package/dist/chunks/s3-backend-XGXUOPUN.ts.map +7 -0
  72. package/dist/chunks/{setup-switch-IS2PEZ3J.ts → setup-switch-5G2VNJHL.ts} +9 -9
  73. package/dist/chunks/{setup-wizard-JUJZYNNM.ts → setup-wizard-YIEWGX32.ts} +12 -12
  74. package/dist/chunks/setup-wizard-YIEWGX32.ts.map +7 -0
  75. package/dist/chunks/{snapshot-HKEWCVK6.ts → snapshot-JL5DFSXI.ts} +5 -5
  76. package/dist/chunks/sync-inspection-P3ENJLNF.ts +20 -0
  77. package/dist/chunks/{sync-operations-LBX3GKCM.ts → sync-operations-AR76EB6C.ts} +85 -201
  78. package/dist/chunks/sync-operations-AR76EB6C.ts.map +7 -0
  79. package/dist/chunks/{sync-state-Q2FTXTW6.ts → sync-state-VHJUZ4YG.ts} +6 -6
  80. package/dist/chunks/{webdav-backend-ECIKD7SO.ts → webdav-backend-3EGUONAT.ts} +20 -51
  81. package/dist/chunks/webdav-backend-3EGUONAT.ts.map +7 -0
  82. package/dist/index.ts +49 -74
  83. package/dist/index.ts.map +3 -3
  84. package/docs/settings.md +9 -0
  85. package/package.json +61 -62
  86. package/src/backends/backend-factory.ts +15 -15
  87. package/src/backends/backend-identity.ts +31 -31
  88. package/src/backends/backend-types.ts +42 -42
  89. package/src/backends/git/git-backend.ts +714 -788
  90. package/src/backends/git/git-config.ts +104 -111
  91. package/src/backends/git/git-runner.ts +230 -247
  92. package/src/backends/git/git-storage.ts +228 -245
  93. package/src/backends/s3/s3-backend.ts +408 -441
  94. package/src/backends/s3/s3-client.ts +288 -333
  95. package/src/backends/sync-backend.ts +65 -65
  96. package/src/backends/webdav/webdav-backend.ts +542 -589
  97. package/src/backends/webdav/webdav-client.ts +292 -316
  98. package/src/backends/webdav/webdav-config.ts +57 -68
  99. package/src/commands/command-execution.ts +270 -289
  100. package/src/commands/command-handler.ts +160 -163
  101. package/src/commands/command-types.ts +13 -13
  102. package/src/commands/command.ts +190 -196
  103. package/src/commands/setup-completions.ts +1 -1
  104. package/src/paths.ts +47 -47
  105. package/src/settings/config-errors.ts +4 -5
  106. package/src/settings/config-file.ts +473 -506
  107. package/src/settings/config.ts +171 -174
  108. package/src/settings/settings-management.ts +191 -216
  109. package/src/settings/settings-store.ts +63 -77
  110. package/src/settings/settings-types.ts +78 -75
  111. package/src/settings/settings-validation.ts +328 -364
  112. package/src/snapshot/session-paths.ts +41 -55
  113. package/src/snapshot/snapshot-apply.ts +197 -229
  114. package/src/snapshot/snapshot-codec.ts +29 -31
  115. package/src/snapshot/snapshot-paths.ts +4 -6
  116. package/src/snapshot/snapshot-transaction.ts +161 -170
  117. package/src/snapshot/snapshot-types.ts +24 -24
  118. package/src/snapshot/snapshot.ts +310 -343
  119. package/src/state/json-file.ts +11 -11
  120. package/src/state/lock.ts +226 -242
  121. package/src/state/lockfile-fs.ts +20 -20
  122. package/src/state/operation-availability.ts +36 -41
  123. package/src/state/state-directory.ts +171 -173
  124. package/src/state/state-types.ts +15 -15
  125. package/src/state/sync-state-store.ts +23 -23
  126. package/src/sync/automatic-sync.ts +75 -80
  127. package/src/sync/remote-snapshot.ts +52 -60
  128. package/src/sync/setup-switch.ts +99 -114
  129. package/src/sync/signals.ts +3 -5
  130. package/src/sync/startup-check.ts +97 -111
  131. package/src/sync/sync-decision.ts +76 -80
  132. package/src/sync/sync-error-guidance.ts +41 -48
  133. package/src/sync/sync-errors.ts +10 -10
  134. package/src/sync/sync-inspection.ts +29 -33
  135. package/src/sync/sync-loaders.ts +28 -36
  136. package/src/sync/sync-mutations.ts +510 -622
  137. package/src/sync/sync-operations.ts +7 -7
  138. package/src/sync/sync-policy.ts +296 -326
  139. package/src/sync/sync-queries.ts +175 -194
  140. package/src/sync/sync-state.ts +74 -100
  141. package/src/sync-extension.ts +89 -101
  142. package/src/sync.ts +26 -26
  143. package/src/types.ts +37 -37
  144. package/src/ui/automatic-sync-summary.ts +1 -3
  145. package/src/ui/cancellable-operation.ts +89 -101
  146. package/src/ui/file-selection.ts +250 -274
  147. package/src/ui/manager-attention.ts +51 -63
  148. package/src/ui/manager-recovery.ts +48 -57
  149. package/src/ui/manager-result-dispatcher.ts +62 -76
  150. package/src/ui/manager-state.ts +200 -232
  151. package/src/ui/manager-ui.ts +264 -362
  152. package/src/ui/remote-selection-ui.ts +547 -588
  153. package/src/ui/secret-input.ts +197 -205
  154. package/src/ui/settings-ui.ts +175 -172
  155. package/src/ui/setup/git-ui.ts +232 -261
  156. package/src/ui/setup/s3-credentials-ui.ts +58 -65
  157. package/src/ui/setup/s3-ui.ts +171 -195
  158. package/src/ui/setup/setup-actions.ts +91 -101
  159. package/src/ui/setup/setup-location-ui.ts +121 -137
  160. package/src/ui/setup/setup-name-ui.ts +27 -27
  161. package/src/ui/setup/setup-prompts.ts +65 -65
  162. package/src/ui/setup/setup-review.ts +58 -59
  163. package/src/ui/setup/setup-switcher.ts +156 -160
  164. package/src/ui/setup/setup-wizard.ts +28 -28
  165. package/src/ui/setup/text-input.ts +54 -58
  166. package/src/ui/setup/webdav-ui.ts +246 -293
  167. package/src/ui/storage-connections-ui.ts +317 -369
  168. package/src/ui/sync-attention.ts +148 -164
  169. package/src/ui/sync-format.ts +110 -121
  170. package/src/ui/sync-resolution-ui.ts +147 -153
  171. package/src/ui/sync-setups-ui.ts +218 -238
  172. package/src/ui/sync-status.ts +17 -0
  173. package/src/ui/terminal-text.ts +2 -2
  174. package/dist/chunks/chunk-2B2ELUF5.ts.map +0 -7
  175. package/dist/chunks/chunk-5B3FXBLE.ts.map +0 -7
  176. package/dist/chunks/chunk-6LP3MCR2.ts.map +0 -7
  177. package/dist/chunks/chunk-AUSDLD6F.ts.map +0 -7
  178. package/dist/chunks/chunk-C7XY5NF5.ts.map +0 -7
  179. package/dist/chunks/chunk-CCSN3F47.ts.map +0 -7
  180. package/dist/chunks/chunk-CHH26D4F.ts.map +0 -7
  181. package/dist/chunks/chunk-CPEHGXJV.ts.map +0 -7
  182. package/dist/chunks/chunk-D5X27LCA.ts.map +0 -7
  183. package/dist/chunks/chunk-DHVFS4QK.ts.map +0 -7
  184. package/dist/chunks/chunk-ETTRJDNP.ts.map +0 -7
  185. package/dist/chunks/chunk-HUDQATCL.ts.map +0 -7
  186. package/dist/chunks/chunk-IJ6FJFA5.ts.map +0 -7
  187. package/dist/chunks/chunk-JAAKLL6M.ts.map +0 -7
  188. package/dist/chunks/chunk-LCRI3ABW.ts.map +0 -7
  189. package/dist/chunks/chunk-LTBWGSBV.ts.map +0 -7
  190. package/dist/chunks/chunk-NJFUIVYL.ts.map +0 -7
  191. package/dist/chunks/chunk-OEX4ABY6.ts.map +0 -7
  192. package/dist/chunks/chunk-Q2TUM5X6.ts.map +0 -7
  193. package/dist/chunks/chunk-SL64RLXR.ts.map +0 -7
  194. package/dist/chunks/chunk-SZWBGPID.ts.map +0 -7
  195. package/dist/chunks/chunk-T2B5IU74.ts.map +0 -7
  196. package/dist/chunks/chunk-T3HH3UEJ.ts.map +0 -7
  197. package/dist/chunks/chunk-TEN2ZBJV.ts.map +0 -7
  198. package/dist/chunks/chunk-THMF4BVL.ts.map +0 -7
  199. package/dist/chunks/chunk-YDWUZVPN.ts.map +0 -7
  200. package/dist/chunks/chunk-YHEMENKV.ts.map +0 -7
  201. package/dist/chunks/chunk-Z4DQF6L3.ts.map +0 -7
  202. package/dist/chunks/chunk-ZI5MXMEX.ts.map +0 -7
  203. package/dist/chunks/file-selection-FTTKAOYX.ts.map +0 -7
  204. package/dist/chunks/git-backend-GMVS4PD4.ts.map +0 -7
  205. package/dist/chunks/manager-result-dispatcher-ASKGOSW5.ts +0 -22
  206. package/dist/chunks/manager-ui-IPAOAWZA.ts.map +0 -7
  207. package/dist/chunks/remote-selection-ui-QDNR7WEI.ts +0 -21
  208. package/dist/chunks/s3-backend-66O4FGBH.ts.map +0 -7
  209. package/dist/chunks/setup-wizard-JUJZYNNM.ts.map +0 -7
  210. package/dist/chunks/sync-inspection-CST2KL65.ts +0 -20
  211. package/dist/chunks/sync-operations-LBX3GKCM.ts.map +0 -7
  212. package/dist/chunks/webdav-backend-ECIKD7SO.ts.map +0 -7
  213. /package/dist/chunks/{manager-result-dispatcher-ASKGOSW5.ts.map → manager-result-dispatcher-OTUMQM26.ts.map} +0 -0
  214. /package/dist/chunks/{remote-selection-ui-QDNR7WEI.ts.map → remote-selection-ui-TZTJF32Y.ts.map} +0 -0
  215. /package/dist/chunks/{setup-switch-IS2PEZ3J.ts.map → setup-switch-5G2VNJHL.ts.map} +0 -0
  216. /package/dist/chunks/{snapshot-HKEWCVK6.ts.map → snapshot-JL5DFSXI.ts.map} +0 -0
  217. /package/dist/chunks/{sync-inspection-CST2KL65.ts.map → sync-inspection-P3ENJLNF.ts.map} +0 -0
  218. /package/dist/chunks/{sync-state-Q2FTXTW6.ts.map → sync-state-VHJUZ4YG.ts.map} +0 -0
@@ -5,13 +5,13 @@ import {
5
5
  readRemoteSnapshot,
6
6
  readSnapshotForHead,
7
7
  requireCompatibleRemoteSelection
8
- } from "./chunk-HUDQATCL.ts";
8
+ } from "./chunk-Q32CQWPM.ts";
9
9
  import {
10
10
  inspectSync
11
- } from "./chunk-SZWBGPID.ts";
11
+ } from "./chunk-DM4X4FIA.ts";
12
12
  import {
13
13
  createSyncBackend
14
- } from "./chunk-T2B5IU74.ts";
14
+ } from "./chunk-HGJH56KR.ts";
15
15
  import {
16
16
  canPullRemoteSessionsOnFirstSync,
17
17
  canPullRemoteSettingsOnFirstSync,
@@ -24,47 +24,50 @@ import {
24
24
  snapshotHashesMatchState,
25
25
  snapshotsMatch,
26
26
  syncPolicyChanged
27
- } from "./chunk-AUSDLD6F.ts";
27
+ } from "./chunk-T56RNRZJ.ts";
28
28
  import {
29
29
  applySnapshotTransaction,
30
30
  recoverPendingSnapshotTransactions
31
- } from "./chunk-IJ6FJFA5.ts";
31
+ } from "./chunk-4AIHXRKE.ts";
32
32
  import {
33
33
  inspectLock,
34
34
  isLockGuardHeld,
35
35
  isStaleLock,
36
36
  withLock
37
- } from "./chunk-ETTRJDNP.ts";
37
+ } from "./chunk-QLSN7AGX.ts";
38
+ import {
39
+ setSyncStatus
40
+ } from "./chunk-K3RIEL6J.ts";
38
41
  import {
39
42
  throwIfAborted
40
- } from "./chunk-NJFUIVYL.ts";
43
+ } from "./chunk-PWMWOJP4.ts";
41
44
  import {
42
45
  readStateForConfig,
43
46
  writeStateForConfig
44
- } from "./chunk-CCSN3F47.ts";
47
+ } from "./chunk-YPXGU5OR.ts";
45
48
  import {
46
49
  safeTerminalText
47
- } from "./chunk-LTBWGSBV.ts";
50
+ } from "./chunk-MSSW6F3R.ts";
48
51
  import {
49
52
  loadConfig,
50
53
  syncConfigReviewIdentity,
51
54
  syncSessionsWarnings
52
- } from "./chunk-C7XY5NF5.ts";
53
- import "./chunk-6LP3MCR2.ts";
55
+ } from "./chunk-4MPIH46N.ts";
56
+ import "./chunk-2JZFHNLM.ts";
54
57
  import {
55
58
  encodeSnapshot
56
- } from "./chunk-Q2TUM5X6.ts";
59
+ } from "./chunk-6NT3YFGY.ts";
57
60
  import {
58
61
  stateDir
59
- } from "./chunk-ZI5MXMEX.ts";
60
- import "./chunk-TEN2ZBJV.ts";
62
+ } from "./chunk-BVVP33U5.ts";
63
+ import "./chunk-T2SJD3N7.ts";
61
64
  import {
62
65
  expectedRemoteHead
63
- } from "./chunk-D5X27LCA.ts";
66
+ } from "./chunk-UETBKTDI.ts";
64
67
  import {
65
68
  SyncDecisionRequiredError,
66
69
  errorMessage
67
- } from "./chunk-2B2ELUF5.ts";
70
+ } from "./chunk-7D5SF7P3.ts";
68
71
  import {
69
72
  createSnapshot,
70
73
  filterSnapshotForConfigPolicy,
@@ -77,16 +80,16 @@ import {
77
80
  snapshotIncludesSessions,
78
81
  snapshotTarget,
79
82
  snapshotWithoutSessions
80
- } from "./chunk-OEX4ABY6.ts";
83
+ } from "./chunk-EEJPYTWE.ts";
81
84
  import {
82
85
  sessionStorageRoot
83
- } from "./chunk-THMF4BVL.ts";
86
+ } from "./chunk-SWUXA3MH.ts";
84
87
  import {
85
88
  agentDir,
86
89
  sessionDirForApply,
87
90
  sessionDirFromContext,
88
91
  snapshotOptionsForContext
89
- } from "./chunk-T3HH3UEJ.ts";
92
+ } from "./chunk-OVDTF5CH.ts";
90
93
  import {
91
94
  assertWithinRoot,
92
95
  includeFromSelectionConfig,
@@ -96,7 +99,7 @@ import {
96
99
  parentPaths,
97
100
  safeJoin,
98
101
  toPosix
99
- } from "./chunk-JAAKLL6M.ts";
102
+ } from "./chunk-IVXEDPAD.ts";
100
103
 
101
104
  // src/sync/sync-mutations.ts
102
105
  import fs2 from "node:fs/promises";
@@ -153,8 +156,7 @@ function preflightSnapshotApply(root, snapshot, current, options = {}) {
153
156
  remotePaths.add(normalized);
154
157
  const target = snapshotTarget(root, normalized, options.sessionDir);
155
158
  const content = decodeBase64Strict(file.contentBase64, normalized);
156
- if (sha256(content) !== file.sha256)
157
- throw new Error(`Checksum mismatch in snapshot file: ${normalized}`);
159
+ if (sha256(content) !== file.sha256) throw new Error(`Checksum mismatch in snapshot file: ${normalized}`);
158
160
  writes.push({ target, content });
159
161
  }
160
162
  const deletePaths = /* @__PURE__ */ new Set();
@@ -175,9 +177,7 @@ function preflightSnapshotApply(root, snapshot, current, options = {}) {
175
177
  function protectSnapshotApplyPlan(root, plan, protectedRelativePaths, sessionDir) {
176
178
  if (protectedRelativePaths.size === 0) return plan;
177
179
  const protectedTargets = new Set(
178
- [...protectedRelativePaths].map(
179
- (relativePath) => snapshotTarget(root, relativePath, sessionDir)
180
- )
180
+ [...protectedRelativePaths].map((relativePath) => snapshotTarget(root, relativePath, sessionDir))
181
181
  );
182
182
  return {
183
183
  writes: plan.writes.filter((item) => !protectedTargets.has(item.target)),
@@ -240,11 +240,7 @@ async function preflightSnapshotMutations(root, plan, sessionDir) {
240
240
  await assertNoSymlinkParents(rootForTarget(root, target, sessionDir), target);
241
241
  }
242
242
  for (const item of plan.writes) {
243
- await prepareSnapshotWrite(
244
- rootForTarget(root, item.target, sessionDir),
245
- item.target,
246
- deletePaths
247
- );
243
+ await prepareSnapshotWrite(rootForTarget(root, item.target, sessionDir), item.target, deletePaths);
248
244
  }
249
245
  }
250
246
  function rootForTarget(root, target, sessionDir) {
@@ -257,8 +253,7 @@ async function prepareSnapshotWrite(root, target, deletePaths) {
257
253
  if (parentWillBeReplaced) return;
258
254
  try {
259
255
  const stat = await fs.lstat(target);
260
- if (stat.isSymbolicLink())
261
- throw new Error(`Refusing to overwrite symlink during snapshot apply: ${target}`);
256
+ if (stat.isSymbolicLink()) throw new Error(`Refusing to overwrite symlink during snapshot apply: ${target}`);
262
257
  if (stat.isDirectory() && !deletePaths.has(target)) {
263
258
  throw new Error(`Refusing to overwrite directory during snapshot apply: ${target}`);
264
259
  }
@@ -275,8 +270,7 @@ async function ensureSafeDirectory(root, directory, deletePaths) {
275
270
  current = path.join(current, part);
276
271
  try {
277
272
  const stat = await fs.lstat(current);
278
- if (stat.isSymbolicLink())
279
- throw new Error(`Refusing to follow symlink during snapshot apply: ${current}`);
273
+ if (stat.isSymbolicLink()) throw new Error(`Refusing to follow symlink during snapshot apply: ${current}`);
280
274
  if (!stat.isDirectory()) {
281
275
  if (deletePaths.has(current)) return true;
282
276
  throw new Error(`Snapshot path parent is not a directory: ${current}`);
@@ -298,10 +292,8 @@ async function assertNoSymlinkParents(root, target) {
298
292
  current = path.join(current, part);
299
293
  try {
300
294
  const stat = await fs.lstat(current);
301
- if (stat.isSymbolicLink())
302
- throw new Error(`Refusing to follow symlink during snapshot apply: ${current}`);
303
- if (!stat.isDirectory())
304
- throw new Error(`Snapshot path parent is not a directory: ${current}`);
295
+ if (stat.isSymbolicLink()) throw new Error(`Refusing to follow symlink during snapshot apply: ${current}`);
296
+ if (!stat.isDirectory()) throw new Error(`Snapshot path parent is not a directory: ${current}`);
305
297
  } catch (error) {
306
298
  if (error.code === "ENOENT") return;
307
299
  throw error;
@@ -314,11 +306,7 @@ function formatDiff(local, remote) {
314
306
  const localMap = fileHashMap(local);
315
307
  const remoteMap = fileHashMap(remote);
316
308
  const allPaths = [.../* @__PURE__ */ new Set([...Object.keys(localMap), ...Object.keys(remoteMap)])].sort();
317
- const lines = [
318
- `local: ${local.files.length} files`,
319
- `remote: ${remote.id} (${remote.files.length} files)`,
320
- ""
321
- ];
309
+ const lines = [`local: ${local.files.length} files`, `remote: ${remote.id} (${remote.files.length} files)`, ""];
322
310
  let changed = 0;
323
311
  for (const filePath of allPaths) {
324
312
  if (!localMap[filePath]) {
@@ -336,9 +324,7 @@ function formatDiff(local, remote) {
336
324
  return lines.join("\n");
337
325
  }
338
326
  function formatSnapshotOnlyDiff(title, snapshot) {
339
- return [`${title}: ${snapshot.id}`, ...snapshot.files.map((file) => `Add: ${file.path}`)].join(
340
- "\n"
341
- );
327
+ return [`${title}: ${snapshot.id}`, ...snapshot.files.map((file) => `Add: ${file.path}`)].join("\n");
342
328
  }
343
329
  function formatPushSummary(config, destination, upload, head, preservedRemoteFileCount = 0, remote) {
344
330
  return [
@@ -348,9 +334,7 @@ function formatPushSummary(config, destination, upload, head, preservedRemoteFil
348
334
  `Sessions: ${upload.syncSessions ? "included \u2014 may contain private conversations" : "not included"}`,
349
335
  head ? `Remote latest: ${head.snapshotId}` : "Remote latest: empty",
350
336
  "Publication effect: the backend's active head will reference the new immutable snapshot.",
351
- ...remote && inspectRemoteSelection(config.include, remote).kind === "different" ? [
352
- "Included-content policy effect: replace the differing remote selection with this setup's local selection."
353
- ] : [],
337
+ ...remote && inspectRemoteSelection(config.include, remote).kind === "different" ? ["Included-content policy effect: replace the differing remote selection with this setup's local selection."] : [],
354
338
  formatPublicationPreview(remote, upload),
355
339
  preservedRemoteFileCount > 0 ? `Possible secrets in locally managed files were scanned before this prompt; ${preservedRemoteFileCount} preserved remote file(s) were not rescanned.` : "Possible secrets were scanned before this prompt."
356
340
  ].join("\n");
@@ -386,9 +370,7 @@ function formatRollbackSummary(config, destination, local, remote, requestedSnap
386
370
  }
387
371
  function formatPublicationPreview(remote, upload) {
388
372
  if (!remote) {
389
- return ["Remote is empty.", ...upload.files.map((file) => `Add remotely: ${file.path}`)].join(
390
- "\n"
391
- );
373
+ return ["Remote is empty.", ...upload.files.map((file) => `Add remotely: ${file.path}`)].join("\n");
392
374
  }
393
375
  return formatDirectionalChanges(remote, upload, {
394
376
  add: "Add remotely",
@@ -404,8 +386,7 @@ function formatDirectionalChanges(before, after, labels) {
404
386
  for (const filePath of paths) {
405
387
  if (!beforeMap[filePath]) lines.push(`${labels.add}: ${filePath}`);
406
388
  else if (!afterMap[filePath]) lines.push(`${labels.remove}: ${filePath}`);
407
- else if (beforeMap[filePath] !== afterMap[filePath])
408
- lines.push(`${labels.update}: ${filePath}`);
389
+ else if (beforeMap[filePath] !== afterMap[filePath]) lines.push(`${labels.update}: ${filePath}`);
409
390
  }
410
391
  if (lines.length === 0) lines.push("No file changes.");
411
392
  return lines.join("\n");
@@ -449,11 +430,7 @@ function createSyncDecision(options) {
449
430
  "",
450
431
  "Why a decision is required:",
451
432
  ...causeLines,
452
- ...policyChanged ? [
453
- "",
454
- `Previously included: ${safeList(previousInclude)}`,
455
- `Currently included: ${safeList(currentInclude)}`
456
- ] : [],
433
+ ...policyChanged ? ["", `Previously included: ${safeList(previousInclude)}`, `Currently included: ${safeList(currentInclude)}`] : [],
457
434
  "",
458
435
  "Observed differences:",
459
436
  ...comparison.split("\n").map(safeTerminalText)
@@ -475,7 +452,6 @@ function safeList(values) {
475
452
  }
476
453
 
477
454
  // src/sync/sync-mutations.ts
478
- var STATUS_KEY = "sync";
479
455
  var VERSION = 1;
480
456
  var POST_LOCAL_COMMIT_TIMEOUT_MS = 3e4;
481
457
  var PublicationStatePersistenceError = class extends Error {
@@ -494,10 +470,9 @@ var PublicationStatePersistenceError = class extends Error {
494
470
  var RollbackPublicationError = class extends Error {
495
471
  backupPath;
496
472
  constructor(backupPath, cause) {
497
- super(
498
- `Rollback applied locally with backup ${backupPath}, but remote publication failed: ${errorMessage(cause)}`,
499
- { cause }
500
- );
473
+ super(`Rollback applied locally with backup ${backupPath}, but remote publication failed: ${errorMessage(cause)}`, {
474
+ cause
475
+ });
501
476
  this.name = "RollbackPublicationError";
502
477
  this.backupPath = backupPath;
503
478
  }
@@ -505,32 +480,21 @@ var RollbackPublicationError = class extends Error {
505
480
  async function push(ctx, options, input, factory = createSyncBackend) {
506
481
  const config = input?.config ?? await loadConfig(options.setup);
507
482
  throwIfAborted(options.signal);
508
- ctx.ui.setStatus(STATUS_KEY, `pushing ${config.setupName}`);
483
+ setSyncStatus(ctx, `pushing ${config.setupName}`);
509
484
  const backend = input?.backend ?? await factory(config);
510
485
  const state = input?.state ?? await readStateForConfig(config);
511
486
  throwIfAborted(options.signal);
512
487
  const local = input?.local ?? await createSnapshot(config.snapshotIdentity, snapshotOptionsForContext(ctx, config));
513
488
  throwIfAborted(options.signal);
514
489
  let head = await backend.readHead(options.signal);
515
- let remoteForUpload = await readRemoteSnapshotForUpload(
516
- backend,
517
- config,
518
- head,
519
- state,
520
- options.signal
521
- );
490
+ let remoteForUpload = await readRemoteSnapshotForUpload(backend, config, head, state, options.signal);
522
491
  if (!options.force && !remoteForUpload && head?.selection && inspectRemoteSelection(config.include, { selection: head.selection, files: [] }).kind === "different") {
523
492
  remoteForUpload = await readSnapshotForHead(backend, head, options.signal);
524
493
  }
525
494
  if (remoteForUpload && !options.force) {
526
495
  requireCompatibleRemoteSelection(config, remoteForUpload);
527
496
  }
528
- if (remoteChangedSinceState(
529
- head,
530
- state,
531
- config,
532
- (left, right) => backend.sameRevision(left, right)
533
- ) && !options.force) {
497
+ if (remoteChangedSinceState(head, state, config, (left, right) => backend.sameRevision(left, right)) && !options.force) {
534
498
  const remoteForConflict = remoteForUpload ? filterSnapshotForConfigPolicy(remoteForUpload, config) : void 0;
535
499
  if (!remoteForConflict || !snapshotHashesMatchState(remoteForConflict, state, config)) {
536
500
  throw createSyncDecision({
@@ -545,21 +509,12 @@ async function push(ctx, options, input, factory = createSyncBackend) {
545
509
  });
546
510
  }
547
511
  }
548
- let upload = await snapshotForUpload(
549
- backend,
550
- config,
551
- local,
552
- head,
553
- remoteForUpload,
554
- options.signal
555
- );
512
+ let upload = await snapshotForUpload(backend, config, local, head, remoteForUpload, options.signal);
556
513
  if (!config.skipSecretScan) {
557
514
  const secrets = scanSnapshot(local);
558
515
  if (secrets.length > 0) {
559
- throw new Error(
560
- `Refusing to push possible secrets:
561
- ${secrets.map((s) => `- ${s}`).join("\n")}`
562
- );
516
+ throw new Error(`Refusing to push possible secrets:
517
+ ${secrets.map((s) => `- ${s}`).join("\n")}`);
563
518
  }
564
519
  }
565
520
  if (!await confirmPush(ctx, options, config, backend, local, upload, head, remoteForUpload)) {
@@ -570,14 +525,7 @@ ${secrets.map((s) => `- ${s}`).join("\n")}`
570
525
  if (!sameRemoteHead(backend, head, refreshedHead)) {
571
526
  head = refreshedHead;
572
527
  remoteForUpload = head ? await backend.readSnapshot(head.snapshotRef, options.signal) : void 0;
573
- upload = await snapshotForUpload(
574
- backend,
575
- config,
576
- local,
577
- head,
578
- remoteForUpload,
579
- options.signal
580
- );
528
+ upload = await snapshotForUpload(backend, config, local, head, remoteForUpload, options.signal);
581
529
  if (!await confirmPush(
582
530
  ctx,
583
531
  options,
@@ -610,7 +558,7 @@ ${secrets.map((s) => `- ${s}`).join("\n")}`
610
558
  throw new PublicationStatePersistenceError(result.head, error);
611
559
  }
612
560
  if (options.signal?.aborted) return;
613
- ctx.ui.setStatus(STATUS_KEY, void 0);
561
+ setSyncStatus(ctx, void 0);
614
562
  if (!options.silent) {
615
563
  ctx.ui.notify(
616
564
  [
@@ -625,14 +573,11 @@ ${secrets.map((s) => `- ${s}`).join("\n")}`
625
573
  async function pull(ctx, options, factory = createSyncBackend) {
626
574
  const config = await loadConfig(options.setup);
627
575
  throwIfAborted(options.signal);
628
- ctx.ui.setStatus(STATUS_KEY, `pulling ${config.setupName}`);
576
+ setSyncStatus(ctx, `pulling ${config.setupName}`);
629
577
  const backend = await factory(config);
630
578
  const state = await readStateForConfig(config);
631
579
  throwIfAborted(options.signal);
632
- const local = await createSnapshot(
633
- config.snapshotIdentity,
634
- snapshotOptionsForContext(ctx, config)
635
- );
580
+ const local = await createSnapshot(config.snapshotIdentity, snapshotOptionsForContext(ctx, config));
636
581
  throwIfAborted(options.signal);
637
582
  const { head, snapshot: remote } = await readRemoteSnapshot(backend, config, options.signal);
638
583
  throwIfAborted(options.signal);
@@ -663,24 +608,14 @@ async function pull(ctx, options, factory = createSyncBackend) {
663
608
  }
664
609
  if (!options.yes && !await ctx.ui.confirm(
665
610
  snapshotIncludesSessions(remote) ? "Pull pi settings and sessions?" : "Pull pi settings?",
666
- formatPullSummary(
667
- config,
668
- backend.destination,
669
- local,
670
- remote,
671
- protectedSessionPaths(ctx).size
672
- )
611
+ formatPullSummary(config, backend.destination, local, remote, protectedSessionPaths(ctx).size)
673
612
  )) {
674
- ctx.ui.setStatus(STATUS_KEY, void 0);
613
+ setSyncStatus(ctx, void 0);
675
614
  ctx.ui.notify("Pull cancelled.", "info");
676
615
  return "cancelled";
677
616
  }
678
617
  throwIfAborted(options.signal);
679
- const backup = await backupLocal(
680
- config.snapshotIdentity,
681
- snapshotOptionsForContext(ctx, config),
682
- options.signal
683
- );
618
+ const backup = await backupLocal(config.snapshotIdentity, snapshotOptionsForContext(ctx, config), options.signal);
684
619
  const applySessionDir = await sessionDirForApply(ctx, remote);
685
620
  throwIfAborted(options.signal);
686
621
  options.onCommit?.();
@@ -697,12 +632,9 @@ async function pull(ctx, options, factory = createSyncBackend) {
697
632
  include: [...config.include]
698
633
  });
699
634
  if (options.signal?.aborted) return "applied";
700
- ctx.ui.setStatus(STATUS_KEY, void 0);
635
+ setSyncStatus(ctx, void 0);
701
636
  if (!options.silent) {
702
- ctx.ui.notify(
703
- `Pulled ${remote.files.length} files from ${remote.id}. Backup: ${backup}`,
704
- "info"
705
- );
637
+ ctx.ui.notify(`Pulled ${remote.files.length} files from ${remote.id}. Backup: ${backup}`, "info");
706
638
  } else if (options.auto && config.include.includes("sessions") && snapshotIncludesSessions(remote)) {
707
639
  ctx.ui.notify(
708
640
  "Pulled Pi sessions after startup selected the current session. Restart Pi or resume a pulled session to use newly synced conversations.",
@@ -718,10 +650,7 @@ async function syncBoth(ctx, options, factory = createSyncBackend) {
718
650
  const backend = await factory(config);
719
651
  const state = await readStateForConfig(config);
720
652
  throwIfAborted(options.signal);
721
- const local = await createSnapshot(
722
- config.snapshotIdentity,
723
- snapshotOptionsForContext(ctx, config)
724
- );
653
+ const local = await createSnapshot(config.snapshotIdentity, snapshotOptionsForContext(ctx, config));
725
654
  throwIfAborted(options.signal);
726
655
  if (config.include.length === 0) {
727
656
  if (!options.silent) {
@@ -774,8 +703,7 @@ async function syncBoth(ctx, options, factory = createSyncBackend) {
774
703
  lastFileHashes: fileHashMap(remote),
775
704
  include: [...config.include]
776
705
  });
777
- if (!options.silent)
778
- ctx.ui.notify("pi-sync state initialized; local settings already match remote.", "info");
706
+ if (!options.silent) ctx.ui.notify("pi-sync state initialized; local settings already match remote.", "info");
779
707
  return;
780
708
  }
781
709
  if (localChanged && remoteChanged && remote && snapshotsMatch(local, remote)) {
@@ -810,13 +738,7 @@ async function syncBoth(ctx, options, factory = createSyncBackend) {
810
738
  await push(ctx, options, void 0, factory);
811
739
  return;
812
740
  }
813
- if (shouldRefreshSyncedState(
814
- remote,
815
- head,
816
- state,
817
- config,
818
- (left, right) => backend.sameRevision(left, right)
819
- )) {
741
+ if (shouldRefreshSyncedState(remote, head, state, config, (left, right) => backend.sameRevision(left, right))) {
820
742
  await writeStateForConfig(config, {
821
743
  version: VERSION,
822
744
  profile: config.snapshotIdentity,
@@ -835,9 +757,7 @@ async function rollback(ctx, options, factory = createSyncBackend, expectedSelec
835
757
  throwIfAborted(options.signal);
836
758
  const backend = await factory(config);
837
759
  if (expectedSelection && (backend.identity !== expectedSelection.backendIdentity || config.setupName !== expectedSelection.setup)) {
838
- throw new Error(
839
- "Sync setup or storage location changed while history was open; reopen history and retry."
840
- );
760
+ throw new Error("Sync setup or storage location changed while history was open; reopen history and retry.");
841
761
  }
842
762
  const decoded = await backend.readSnapshot(target, options.signal);
843
763
  const selected = filterSnapshotForConfigPolicy(
@@ -845,32 +765,18 @@ async function rollback(ctx, options, factory = createSyncBackend, expectedSelec
845
765
  config
846
766
  );
847
767
  const remote = regenerateSnapshotIdentity(selected);
848
- const local = await createSnapshot(
849
- config.snapshotIdentity,
850
- snapshotOptionsForContext(ctx, config)
851
- );
768
+ const local = await createSnapshot(config.snapshotIdentity, snapshotOptionsForContext(ctx, config));
852
769
  const expectedHead = await backend.readHead(options.signal);
853
770
  throwIfAborted(options.signal);
854
771
  if (!options.yes && !await ctx.ui.confirm(
855
772
  snapshotIncludesSessions(remote) ? "Rollback pi settings and sessions?" : "Rollback pi settings?",
856
- formatRollbackSummary(
857
- config,
858
- backend.destination,
859
- local,
860
- remote,
861
- target,
862
- protectedSessionPaths(ctx).size
863
- )
773
+ formatRollbackSummary(config, backend.destination, local, remote, target, protectedSessionPaths(ctx).size)
864
774
  )) {
865
775
  ctx.ui.notify("Rollback cancelled.", "info");
866
776
  return;
867
777
  }
868
778
  throwIfAborted(options.signal);
869
- const backup = await backupLocal(
870
- config.snapshotIdentity,
871
- snapshotOptionsForContext(ctx, config),
872
- options.signal
873
- );
779
+ const backup = await backupLocal(config.snapshotIdentity, snapshotOptionsForContext(ctx, config), options.signal);
874
780
  const applySessionDir = await sessionDirForApply(ctx, remote);
875
781
  throwIfAborted(options.signal);
876
782
  options.onCommit?.();
@@ -881,15 +787,9 @@ async function rollback(ctx, options, factory = createSyncBackend, expectedSelec
881
787
  let result;
882
788
  try {
883
789
  const completionSignal = AbortSignal.timeout(POST_LOCAL_COMMIT_TIMEOUT_MS);
884
- const upload = await snapshotForUpload(
885
- backend,
886
- config,
887
- remote,
888
- expectedHead,
889
- void 0,
890
- completionSignal,
891
- { ignoreUnreadableRemote: true }
892
- );
790
+ const upload = await snapshotForUpload(backend, config, remote, expectedHead, void 0, completionSignal, {
791
+ ignoreUnreadableRemote: true
792
+ });
893
793
  result = await backend.publishSnapshot(upload, expectedRemoteHead(expectedHead), {
894
794
  signal: completionSignal
895
795
  });
@@ -959,18 +859,11 @@ async function confirmPush(ctx, options, config, backend, local, upload, head, r
959
859
  if (options.yes) return true;
960
860
  const confirmed = await ctx.ui.confirm(
961
861
  title,
962
- formatPushSummary(
963
- config,
964
- backend.destination,
965
- upload,
966
- head,
967
- countPreservedRemoteFiles(local, upload),
968
- remote
969
- )
862
+ formatPushSummary(config, backend.destination, upload, head, countPreservedRemoteFiles(local, upload), remote)
970
863
  );
971
864
  throwIfAborted(options.signal);
972
865
  if (confirmed) return true;
973
- ctx.ui.setStatus(STATUS_KEY, void 0);
866
+ setSyncStatus(ctx, void 0);
974
867
  ctx.ui.notify("Push cancelled.", "info");
975
868
  return false;
976
869
  }
@@ -993,17 +886,21 @@ async function backupLocal(profile, options = {}, signal) {
993
886
  }
994
887
 
995
888
  // src/sync/sync-queries.ts
996
- var STATUS_KEY2 = "sync";
997
889
  var DEFAULT_PROFILE = "default";
998
890
  async function status(ctx, options, factory = createSyncBackend) {
999
891
  const config = await loadConfig(options.setup);
1000
892
  throwIfAborted(options.signal);
1001
- ctx.ui.setStatus(STATUS_KEY2, `checking ${config.setupName}`);
1002
- const { head, selectionState, localChanged, remoteChanged, localFiles, destination, capability } = await inspectSync(config, snapshotOptionsForContext(ctx, config), options.signal, factory);
893
+ setSyncStatus(ctx, `checking ${config.setupName}`);
894
+ const { head, selectionState, localChanged, remoteChanged, localFiles, destination, capability } = await inspectSync(
895
+ config,
896
+ snapshotOptionsForContext(ctx, config),
897
+ options.signal,
898
+ factory
899
+ );
1003
900
  throwIfAborted(options.signal);
1004
901
  const remoteText = head ? `remote: ${head.snapshotId} from ${head.machine} at ${head.createdAt}` : "remote: empty";
1005
902
  const warnings = syncSessionsWarnings(config);
1006
- ctx.ui.setStatus(STATUS_KEY2, void 0);
903
+ setSyncStatus(ctx, void 0);
1007
904
  ctx.ui.notify(
1008
905
  [
1009
906
  `sync setup: ${config.setupName}`,
@@ -1025,21 +922,15 @@ async function status(ctx, options, factory = createSyncBackend) {
1025
922
  async function diff(ctx, options, factory = createSyncBackend) {
1026
923
  const config = await loadConfig(options.setup);
1027
924
  throwIfAborted(options.signal);
1028
- ctx.ui.setStatus(STATUS_KEY2, `checking ${config.setupName}`);
925
+ setSyncStatus(ctx, `checking ${config.setupName}`);
1029
926
  const backend = await factory(config);
1030
- const local = await createSnapshot(
1031
- config.snapshotIdentity,
1032
- snapshotOptionsForContext(ctx, config)
1033
- );
927
+ const local = await createSnapshot(config.snapshotIdentity, snapshotOptionsForContext(ctx, config));
1034
928
  throwIfAborted(options.signal);
1035
- const { snapshot: remote, selectionState } = await readRemoteSnapshot(
1036
- backend,
1037
- config,
1038
- options.signal,
1039
- { allowSelectionDifference: true }
1040
- );
929
+ const { snapshot: remote, selectionState } = await readRemoteSnapshot(backend, config, options.signal, {
930
+ allowSelectionDifference: true
931
+ });
1041
932
  throwIfAborted(options.signal);
1042
- ctx.ui.setStatus(STATUS_KEY2, void 0);
933
+ setSyncStatus(ctx, void 0);
1043
934
  const warnings = syncSessionsWarnings(config);
1044
935
  const header = [
1045
936
  `sync setup: ${config.setupName}`,
@@ -1052,12 +943,9 @@ async function diff(ctx, options, factory = createSyncBackend) {
1052
943
  ].join("\n");
1053
944
  const level = warnings.length > 0 || selectionState?.kind === "different" ? "warning" : "info";
1054
945
  if (!remote) {
1055
- ctx.ui.notify(
1056
- `${header}
946
+ ctx.ui.notify(`${header}
1057
947
 
1058
- ${formatSnapshotOnlyDiff("Remote is empty. Local push would upload", local)}`,
1059
- level
1060
- );
948
+ ${formatSnapshotOnlyDiff("Remote is empty. Local push would upload", local)}`, level);
1061
949
  return;
1062
950
  }
1063
951
  ctx.ui.notify(`${header}
@@ -1110,16 +998,12 @@ async function doctor(ctx, options, factory = createSyncBackend) {
1110
998
  throwIfAborted(options.signal);
1111
999
  if (lock.status === "valid" && isStaleLock(lock.lock)) {
1112
1000
  level = "warning";
1113
- messages.push(
1114
- `lock: stale (pid ${lock.lock.pid}); run /sync unlock --stale after verifying no sync is running`
1115
- );
1001
+ messages.push(`lock: stale (pid ${lock.lock.pid}); run /sync unlock --stale after verifying no sync is running`);
1116
1002
  } else if (lock.status === "valid") {
1117
1003
  messages.push(`lock: held by pid ${lock.lock.pid} since ${lock.lock.startedAt}`);
1118
1004
  } else if (lock.status === "unreadable") {
1119
1005
  level = "warning";
1120
- messages.push(
1121
- "lock: unreadable; use /sync unlock --stale only after verifying no sync is running"
1122
- );
1006
+ messages.push("lock: unreadable; use /sync unlock --stale only after verifying no sync is running");
1123
1007
  } else if (await isLockGuardHeld()) {
1124
1008
  throwIfAborted(options.signal);
1125
1009
  level = "warning";
@@ -1191,4 +1075,4 @@ export {
1191
1075
  status,
1192
1076
  syncBoth
1193
1077
  };
1194
- //# sourceMappingURL=sync-operations-LBX3GKCM.ts.map
1078
+ //# sourceMappingURL=sync-operations-AR76EB6C.ts.map