@narumitw/pi-sync 0.59.0 → 0.60.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 (327) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +25 -17
  3. package/dist/chunks/{chunk-AMJRUXFT.ts → chunk-2JNFEZ3V.ts} +2 -6
  4. package/dist/chunks/{chunk-AMJRUXFT.ts.map → chunk-2JNFEZ3V.ts.map} +1 -1
  5. package/dist/chunks/{chunk-NGW4JMBF.ts → chunk-4RNCZZY7.ts} +33 -27
  6. package/dist/chunks/{chunk-NGW4JMBF.ts.map → chunk-4RNCZZY7.ts.map} +3 -3
  7. package/dist/chunks/{chunk-2ZZJXITS.ts → chunk-6LHIRS5R.ts} +30 -47
  8. package/dist/chunks/chunk-6LHIRS5R.ts.map +7 -0
  9. package/dist/chunks/{config-J5VZUY4J.ts → chunk-7AC2RX4M.ts} +6 -13
  10. package/dist/chunks/chunk-7AC2RX4M.ts.map +7 -0
  11. package/dist/chunks/{chunk-76HID27T.ts → chunk-BGGKHHO4.ts} +18 -14
  12. package/dist/chunks/{chunk-76HID27T.ts.map → chunk-BGGKHHO4.ts.map} +1 -1
  13. package/dist/chunks/chunk-BWWTOQOW.ts +737 -0
  14. package/dist/chunks/chunk-BWWTOQOW.ts.map +7 -0
  15. package/dist/chunks/chunk-CEMFCWIU.ts +20 -0
  16. package/dist/chunks/chunk-CEMFCWIU.ts.map +7 -0
  17. package/dist/chunks/chunk-CZNBKIM5.ts +20 -0
  18. package/dist/chunks/chunk-CZNBKIM5.ts.map +7 -0
  19. package/dist/chunks/{chunk-YIPK23JW.ts → chunk-ENFHHB5O.ts} +1 -16
  20. package/dist/chunks/{chunk-YIPK23JW.ts.map → chunk-ENFHHB5O.ts.map} +1 -1
  21. package/dist/chunks/{chunk-KHBPED6W.ts → chunk-GSQGBVKG.ts} +2 -2
  22. package/dist/chunks/chunk-HNKLBM3U.ts +18 -0
  23. package/dist/chunks/chunk-HNKLBM3U.ts.map +7 -0
  24. package/dist/chunks/{chunk-QPC5HT3A.ts → chunk-J5COV5TY.ts} +21 -2
  25. package/dist/chunks/chunk-J5COV5TY.ts.map +7 -0
  26. package/dist/chunks/chunk-JKBUYCPC.ts +52 -0
  27. package/dist/chunks/chunk-JKBUYCPC.ts.map +7 -0
  28. package/dist/chunks/chunk-JZKCOM62.ts +26 -0
  29. package/dist/chunks/chunk-JZKCOM62.ts.map +7 -0
  30. package/dist/chunks/chunk-M7RHV3H6.ts +33 -0
  31. package/dist/chunks/chunk-M7RHV3H6.ts.map +7 -0
  32. package/dist/chunks/chunk-NPT2G4FU.ts +15 -0
  33. package/dist/chunks/chunk-NPT2G4FU.ts.map +7 -0
  34. package/dist/chunks/chunk-PDBTD2K6.ts +11 -0
  35. package/dist/chunks/chunk-PDBTD2K6.ts.map +7 -0
  36. package/dist/chunks/chunk-UBE6XWOM.ts +29 -0
  37. package/dist/chunks/chunk-UBE6XWOM.ts.map +7 -0
  38. package/dist/chunks/{chunk-PQ75RPUP.ts → chunk-UZUUUY7C.ts} +8 -8
  39. package/dist/chunks/chunk-VZCWYXRS.ts +23 -0
  40. package/dist/chunks/chunk-VZCWYXRS.ts.map +7 -0
  41. package/dist/chunks/{chunk-DTPELCPW.ts → chunk-YWEYRRQI.ts} +45 -37
  42. package/dist/chunks/chunk-YWEYRRQI.ts.map +7 -0
  43. package/dist/chunks/{chunk-ECYCNZOE.ts → chunk-ZMNVNECV.ts} +5 -1
  44. package/dist/chunks/chunk-ZMNVNECV.ts.map +7 -0
  45. package/dist/chunks/{command-handler-SDGKIQH2.ts → command-handler-FO4XBBHF.ts} +80 -86
  46. package/dist/chunks/command-handler-FO4XBBHF.ts.map +7 -0
  47. package/dist/chunks/conflict-review-XBSME2ER.ts +18 -0
  48. package/dist/chunks/conflict-review-XBSME2ER.ts.map +7 -0
  49. package/dist/chunks/{continuous-record-OM64J27R.ts → continuous-record-ZHUXVO4E.ts} +5 -13
  50. package/dist/chunks/continuous-record-ZHUXVO4E.ts.map +7 -0
  51. package/dist/chunks/continuous-storage-SQBAXACF.ts +27 -0
  52. package/dist/chunks/continuous-storage-SQBAXACF.ts.map +7 -0
  53. package/dist/chunks/{file-selection-7HEVPO4T.ts → file-selection-S6CNNNQI.ts} +11 -14
  54. package/dist/chunks/{file-selection-7HEVPO4T.ts.map → file-selection-S6CNNNQI.ts.map} +1 -1
  55. package/dist/chunks/manager-result-dispatcher-I2AMCCE7.ts +18 -0
  56. package/dist/chunks/{manager-ui-65ZETN6F.ts → manager-ui-AY5ZU6B4.ts} +180 -164
  57. package/dist/chunks/manager-ui-AY5ZU6B4.ts.map +7 -0
  58. package/dist/chunks/merge-review-SGDLMVS4.ts +10 -0
  59. package/dist/chunks/remote-selection-ui-GZHPDQ4L.ts +17 -0
  60. package/dist/chunks/{setup-switch-AB27ADDI.ts → setup-switch-M3BAFGJM.ts} +9 -13
  61. package/dist/chunks/{setup-wizard-5FILKFLQ.ts → setup-wizard-NFAWP4KF.ts} +18 -21
  62. package/dist/chunks/{setup-wizard-5FILKFLQ.ts.map → setup-wizard-NFAWP4KF.ts.map} +1 -1
  63. package/dist/chunks/{snapshot-G3W2GOGB.ts → snapshot-D4SFDP5J.ts} +8 -13
  64. package/dist/chunks/snapshot-D4SFDP5J.ts.map +7 -0
  65. package/dist/chunks/snapshot-transaction-directory-TNKBQ3UQ.ts +13 -0
  66. package/dist/chunks/snapshot-transaction-directory-TNKBQ3UQ.ts.map +7 -0
  67. package/dist/chunks/state-directory-JZSZVVPX.ts +17 -0
  68. package/dist/chunks/sync-inspection-BJ4KPPNO.ts +23 -0
  69. package/dist/chunks/sync-inspection-BJ4KPPNO.ts.map +7 -0
  70. package/dist/chunks/sync-operations-TLWER2TT.ts +45 -0
  71. package/dist/chunks/sync-operations-TLWER2TT.ts.map +7 -0
  72. package/dist/chunks/{sync-state-H4TFZZ7S.ts → sync-state-FVCJJ7MY.ts} +5 -11
  73. package/dist/chunks/sync-state-FVCJJ7MY.ts.map +7 -0
  74. package/dist/index.ts +269 -313
  75. package/dist/index.ts.map +4 -4
  76. package/docs/daemon-migration.md +93 -0
  77. package/docs/tui-contract.md +12 -0
  78. package/package.json +3 -6
  79. package/skills/configure-pi-sync/SKILL.md +1 -1
  80. package/skills/configure-pi-sync/references/configuration.md +19 -6
  81. package/src/backends/backend-factory.ts +2 -23
  82. package/src/backends/backend-identity.ts +5 -40
  83. package/src/backends/backend-types.ts +1 -81
  84. package/src/backends/git/git-backend.ts +6 -784
  85. package/src/backends/git/git-config.ts +8 -130
  86. package/src/backends/git/git-runner.ts +7 -255
  87. package/src/backends/git/git-storage.ts +14 -293
  88. package/src/backends/s3/s3-backend.ts +11 -523
  89. package/src/backends/s3/s3-client.ts +2 -399
  90. package/src/backends/s3/s3-conditions.ts +2 -67
  91. package/src/backends/snapshot-pointer.ts +2 -27
  92. package/src/backends/sync-backend.ts +6 -101
  93. package/src/backends/webdav/webdav-backend.ts +10 -622
  94. package/src/backends/webdav/webdav-client.ts +6 -370
  95. package/src/backends/webdav/webdav-config.ts +8 -82
  96. package/src/commands/command-execution.ts +40 -36
  97. package/src/commands/command.ts +23 -1
  98. package/src/daemon/apply-gate.ts +146 -0
  99. package/src/daemon/pi-client.ts +591 -0
  100. package/src/daemon/recovery.ts +103 -0
  101. package/src/paths.ts +12 -83
  102. package/src/settings/config-errors.ts +2 -6
  103. package/src/settings/config-file.ts +19 -693
  104. package/src/settings/config.ts +16 -263
  105. package/src/settings/settings-management.ts +11 -254
  106. package/src/settings/settings-store.ts +10 -48
  107. package/src/settings/settings-types.ts +1 -157
  108. package/src/settings/settings-validation.ts +17 -435
  109. package/src/snapshot/session-paths.ts +11 -111
  110. package/src/snapshot/snapshot-apply.ts +9 -322
  111. package/src/snapshot/snapshot-case-replacement.ts +6 -80
  112. package/src/snapshot/snapshot-codec.ts +2 -59
  113. package/src/snapshot/snapshot-exclude-safety.ts +2 -44
  114. package/src/snapshot/snapshot-mutation-queues.ts +6 -142
  115. package/src/snapshot/snapshot-paths.ts +2 -11
  116. package/src/snapshot/snapshot-root-transition.ts +6 -154
  117. package/src/snapshot/snapshot-transaction-directory.ts +5 -16
  118. package/src/snapshot/snapshot-transaction-plan.ts +2 -72
  119. package/src/snapshot/snapshot-transaction.ts +6 -946
  120. package/src/snapshot/snapshot-types.ts +1 -43
  121. package/src/snapshot/snapshot.ts +19 -447
  122. package/src/state/json-file.ts +2 -47
  123. package/src/state/lock-policy.ts +2 -2
  124. package/src/state/lock.ts +10 -292
  125. package/src/state/lockfile-fs.ts +2 -25
  126. package/src/state/merge-baseline-store.ts +8 -208
  127. package/src/state/mutation-directory-sync.ts +2 -34
  128. package/src/state/operation-availability.ts +7 -59
  129. package/src/state/state-directory.ts +8 -243
  130. package/src/state/state-types.ts +1 -25
  131. package/src/state/sync-state-store.ts +11 -75
  132. package/src/sync/agent-candidate.ts +7 -256
  133. package/src/sync/agent-plan.ts +2 -107
  134. package/src/sync/agent-policy.ts +10 -13
  135. package/src/sync/agent-refusal-retry.ts +2 -54
  136. package/src/sync/agent-request.ts +2 -19
  137. package/src/sync/agent-runner.ts +2 -191
  138. package/src/sync/agent-store.ts +7 -182
  139. package/src/sync/agent-sync.ts +2 -141
  140. package/src/sync/apply-review.ts +2 -63
  141. package/src/sync/automatic-sync.ts +55 -111
  142. package/src/sync/conflict-artifact-ownership.ts +2 -63
  143. package/src/sync/conflict-artifacts.ts +8 -195
  144. package/src/sync/conflict-groups.ts +2 -68
  145. package/src/sync/conflict-preview.ts +2 -56
  146. package/src/sync/conflict-resolution.ts +2 -93
  147. package/src/sync/conflict-retention.ts +2 -72
  148. package/src/sync/conflict-review.ts +3 -92
  149. package/src/sync/content-conflicts.ts +2 -73
  150. package/src/sync/continuous-errors.ts +7 -85
  151. package/src/sync/continuous-lease.ts +2 -216
  152. package/src/sync/continuous-record.ts +10 -261
  153. package/src/sync/continuous-storage.ts +12 -64
  154. package/src/sync/continuous-sync.ts +2 -563
  155. package/src/sync/continuous-watch.ts +2 -61
  156. package/src/sync/exclude-policy.ts +6 -84
  157. package/src/sync/field-migration.ts +2 -39
  158. package/src/sync/file-merge-planner.ts +2 -143
  159. package/src/sync/json-document.ts +7 -184
  160. package/src/sync/local-field-policy.ts +2 -29
  161. package/src/sync/local-fields.ts +9 -119
  162. package/src/sync/merge-apply.ts +2 -439
  163. package/src/sync/merge-journal.ts +10 -228
  164. package/src/sync/merge-transfer-error.ts +2 -72
  165. package/src/sync/merged-sync.ts +2 -919
  166. package/src/sync/mutation-owner.ts +2 -22
  167. package/src/sync/package-merge.ts +2 -87
  168. package/src/sync/partial-progress.ts +2 -55
  169. package/src/sync/remote-snapshot.ts +7 -79
  170. package/src/sync/session-merge.ts +2 -194
  171. package/src/sync/settings-conflicts.ts +2 -64
  172. package/src/sync/settings-merge.ts +6 -121
  173. package/src/sync/signals.ts +2 -8
  174. package/src/sync/startup-check.ts +15 -31
  175. package/src/sync/startup-timings.ts +2 -94
  176. package/src/sync/sync-decision.ts +3 -111
  177. package/src/sync/sync-error-guidance.ts +2 -46
  178. package/src/sync/sync-errors.ts +7 -23
  179. package/src/sync/sync-inspection.ts +10 -59
  180. package/src/sync/sync-local.ts +2 -44
  181. package/src/sync/sync-mutations.ts +10 -788
  182. package/src/sync/sync-operations.ts +32 -11
  183. package/src/sync/sync-policy.ts +34 -474
  184. package/src/sync/sync-queries.ts +2 -247
  185. package/src/sync/sync-state.ts +18 -157
  186. package/src/sync/text-merge.ts +10 -133
  187. package/src/sync-extension.ts +192 -142
  188. package/src/ui/manager-state.ts +35 -23
  189. package/src/ui/manager-ui.ts +80 -36
  190. package/src/ui/sync-attention.ts +7 -49
  191. package/dist/chunks/agent-candidate-ZHN7FTZT.ts +0 -30
  192. package/dist/chunks/agent-plan-ILFEUJ2E.ts +0 -124
  193. package/dist/chunks/agent-plan-ILFEUJ2E.ts.map +0 -7
  194. package/dist/chunks/agent-refusal-retry-HRMHCX2A.ts +0 -73
  195. package/dist/chunks/agent-refusal-retry-HRMHCX2A.ts.map +0 -7
  196. package/dist/chunks/agent-runner-FCRV2Z75.ts +0 -185
  197. package/dist/chunks/agent-runner-FCRV2Z75.ts.map +0 -7
  198. package/dist/chunks/agent-store-CCKN4DPR.ts +0 -175
  199. package/dist/chunks/agent-store-CCKN4DPR.ts.map +0 -7
  200. package/dist/chunks/agent-sync-EGA2I5W7.ts +0 -22
  201. package/dist/chunks/chunk-25QCU3LY.ts +0 -220
  202. package/dist/chunks/chunk-25QCU3LY.ts.map +0 -7
  203. package/dist/chunks/chunk-2JZFHNLM.ts +0 -113
  204. package/dist/chunks/chunk-2JZFHNLM.ts.map +0 -7
  205. package/dist/chunks/chunk-2UKUKIBI.ts +0 -25
  206. package/dist/chunks/chunk-2UKUKIBI.ts.map +0 -7
  207. package/dist/chunks/chunk-2ZZJXITS.ts.map +0 -7
  208. package/dist/chunks/chunk-3JTZF7Z5.ts +0 -77
  209. package/dist/chunks/chunk-3JTZF7Z5.ts.map +0 -7
  210. package/dist/chunks/chunk-3ST7RSYN.ts +0 -21
  211. package/dist/chunks/chunk-3ST7RSYN.ts.map +0 -7
  212. package/dist/chunks/chunk-4NVHHDN2.ts +0 -61
  213. package/dist/chunks/chunk-4NVHHDN2.ts.map +0 -7
  214. package/dist/chunks/chunk-5SFMBY5P.ts +0 -26
  215. package/dist/chunks/chunk-5SFMBY5P.ts.map +0 -7
  216. package/dist/chunks/chunk-6OFMB6KK.ts +0 -215
  217. package/dist/chunks/chunk-6OFMB6KK.ts.map +0 -7
  218. package/dist/chunks/chunk-6XU5HZAN.ts +0 -205
  219. package/dist/chunks/chunk-6XU5HZAN.ts.map +0 -7
  220. package/dist/chunks/chunk-6YGRZSCN.ts +0 -128
  221. package/dist/chunks/chunk-6YGRZSCN.ts.map +0 -7
  222. package/dist/chunks/chunk-7D5SF7P3.ts +0 -29
  223. package/dist/chunks/chunk-7D5SF7P3.ts.map +0 -7
  224. package/dist/chunks/chunk-7WYF2KUO.ts +0 -1161
  225. package/dist/chunks/chunk-7WYF2KUO.ts.map +0 -7
  226. package/dist/chunks/chunk-APDNHB2T.ts +0 -2037
  227. package/dist/chunks/chunk-APDNHB2T.ts.map +0 -7
  228. package/dist/chunks/chunk-AR2DGDUI.ts +0 -55
  229. package/dist/chunks/chunk-AR2DGDUI.ts.map +0 -7
  230. package/dist/chunks/chunk-DT7M4VQS.ts +0 -69
  231. package/dist/chunks/chunk-DT7M4VQS.ts.map +0 -7
  232. package/dist/chunks/chunk-DTPELCPW.ts.map +0 -7
  233. package/dist/chunks/chunk-ECYCNZOE.ts.map +0 -7
  234. package/dist/chunks/chunk-FHE2DCA2.ts +0 -61
  235. package/dist/chunks/chunk-FHE2DCA2.ts.map +0 -7
  236. package/dist/chunks/chunk-G4RUXRWZ.ts +0 -48
  237. package/dist/chunks/chunk-G4RUXRWZ.ts.map +0 -7
  238. package/dist/chunks/chunk-ILXMZ2HU.ts +0 -58
  239. package/dist/chunks/chunk-ILXMZ2HU.ts.map +0 -7
  240. package/dist/chunks/chunk-LA3HQMFG.ts +0 -115
  241. package/dist/chunks/chunk-LA3HQMFG.ts.map +0 -7
  242. package/dist/chunks/chunk-M6VQJIOU.ts +0 -54
  243. package/dist/chunks/chunk-M6VQJIOU.ts.map +0 -7
  244. package/dist/chunks/chunk-MKC3PXCN.ts +0 -369
  245. package/dist/chunks/chunk-MKC3PXCN.ts.map +0 -7
  246. package/dist/chunks/chunk-OQBE2OMB.ts +0 -88
  247. package/dist/chunks/chunk-OQBE2OMB.ts.map +0 -7
  248. package/dist/chunks/chunk-P3YD4ONV.ts +0 -123
  249. package/dist/chunks/chunk-P3YD4ONV.ts.map +0 -7
  250. package/dist/chunks/chunk-PRUEIIK7.ts +0 -24
  251. package/dist/chunks/chunk-PRUEIIK7.ts.map +0 -7
  252. package/dist/chunks/chunk-PWMWOJP4.ts +0 -17
  253. package/dist/chunks/chunk-PWMWOJP4.ts.map +0 -7
  254. package/dist/chunks/chunk-QPC5HT3A.ts.map +0 -7
  255. package/dist/chunks/chunk-QQVK2XFC.ts +0 -64
  256. package/dist/chunks/chunk-QQVK2XFC.ts.map +0 -7
  257. package/dist/chunks/chunk-RDOX3VH5.ts +0 -140
  258. package/dist/chunks/chunk-RDOX3VH5.ts.map +0 -7
  259. package/dist/chunks/chunk-S7D6XWHI.ts +0 -258
  260. package/dist/chunks/chunk-S7D6XWHI.ts.map +0 -7
  261. package/dist/chunks/chunk-SHPNS7FM.ts +0 -64
  262. package/dist/chunks/chunk-SHPNS7FM.ts.map +0 -7
  263. package/dist/chunks/chunk-SWRVXVFD.ts +0 -248
  264. package/dist/chunks/chunk-SWRVXVFD.ts.map +0 -7
  265. package/dist/chunks/chunk-T2SJD3N7.ts +0 -99
  266. package/dist/chunks/chunk-T2SJD3N7.ts.map +0 -7
  267. package/dist/chunks/chunk-T2TYBLXK.ts +0 -27
  268. package/dist/chunks/chunk-T2TYBLXK.ts.map +0 -7
  269. package/dist/chunks/chunk-UZSDS4HF.ts +0 -403
  270. package/dist/chunks/chunk-UZSDS4HF.ts.map +0 -7
  271. package/dist/chunks/chunk-VPODHKOX.ts +0 -229
  272. package/dist/chunks/chunk-VPODHKOX.ts.map +0 -7
  273. package/dist/chunks/chunk-WEKGW7HV.ts +0 -162
  274. package/dist/chunks/chunk-WEKGW7HV.ts.map +0 -7
  275. package/dist/chunks/chunk-WUHRVSWI.ts +0 -369
  276. package/dist/chunks/chunk-WUHRVSWI.ts.map +0 -7
  277. package/dist/chunks/chunk-X7R6DCVF.ts +0 -28
  278. package/dist/chunks/chunk-X7R6DCVF.ts.map +0 -7
  279. package/dist/chunks/chunk-XJHQPB3E.ts +0 -107
  280. package/dist/chunks/chunk-XJHQPB3E.ts.map +0 -7
  281. package/dist/chunks/chunk-XZ3ZTHKR.ts +0 -1184
  282. package/dist/chunks/chunk-XZ3ZTHKR.ts.map +0 -7
  283. package/dist/chunks/chunk-YDVQYUHE.ts +0 -34
  284. package/dist/chunks/chunk-YDVQYUHE.ts.map +0 -7
  285. package/dist/chunks/chunk-YEULK7MK.ts +0 -415
  286. package/dist/chunks/chunk-YEULK7MK.ts.map +0 -7
  287. package/dist/chunks/chunk-YHT4YTYG.ts +0 -31
  288. package/dist/chunks/chunk-YHT4YTYG.ts.map +0 -7
  289. package/dist/chunks/chunk-ZW5ZLGBI.ts +0 -154
  290. package/dist/chunks/chunk-ZW5ZLGBI.ts.map +0 -7
  291. package/dist/chunks/command-handler-SDGKIQH2.ts.map +0 -7
  292. package/dist/chunks/conflict-artifacts-MYSH3L2J.ts +0 -33
  293. package/dist/chunks/conflict-review-J6ZSPNWL.ts +0 -190
  294. package/dist/chunks/conflict-review-J6ZSPNWL.ts.map +0 -7
  295. package/dist/chunks/continuous-sync-BH5SWIRV.ts +0 -590
  296. package/dist/chunks/continuous-sync-BH5SWIRV.ts.map +0 -7
  297. package/dist/chunks/git-backend-6CKI6CUG.ts +0 -1074
  298. package/dist/chunks/git-backend-6CKI6CUG.ts.map +0 -7
  299. package/dist/chunks/local-fields-SR7PH66U.ts +0 -27
  300. package/dist/chunks/local-fields-SR7PH66U.ts.map +0 -7
  301. package/dist/chunks/manager-result-dispatcher-CXUP5WDP.ts +0 -33
  302. package/dist/chunks/manager-result-dispatcher-CXUP5WDP.ts.map +0 -7
  303. package/dist/chunks/manager-ui-65ZETN6F.ts.map +0 -7
  304. package/dist/chunks/merge-baseline-store-4Y2X7P2D.ts +0 -26
  305. package/dist/chunks/merge-baseline-store-4Y2X7P2D.ts.map +0 -7
  306. package/dist/chunks/remote-selection-ui-W55BQDJQ.ts +0 -32
  307. package/dist/chunks/remote-selection-ui-W55BQDJQ.ts.map +0 -7
  308. package/dist/chunks/s3-backend-FDK7JSDQ.ts +0 -845
  309. package/dist/chunks/s3-backend-FDK7JSDQ.ts.map +0 -7
  310. package/dist/chunks/setup-switch-AB27ADDI.ts.map +0 -7
  311. package/dist/chunks/snapshot-G3W2GOGB.ts.map +0 -7
  312. package/dist/chunks/snapshot-transaction-SGRUWT73.ts +0 -25
  313. package/dist/chunks/snapshot-transaction-SGRUWT73.ts.map +0 -7
  314. package/dist/chunks/sync-inspection-MDYHZHT7.ts +0 -26
  315. package/dist/chunks/sync-inspection-MDYHZHT7.ts.map +0 -7
  316. package/dist/chunks/sync-operations-ZAUP65FH.ts +0 -1032
  317. package/dist/chunks/sync-operations-ZAUP65FH.ts.map +0 -7
  318. package/dist/chunks/sync-state-H4TFZZ7S.ts.map +0 -7
  319. package/dist/chunks/webdav-backend-UNMIAXM5.ts +0 -852
  320. package/dist/chunks/webdav-backend-UNMIAXM5.ts.map +0 -7
  321. /package/dist/chunks/{chunk-KHBPED6W.ts.map → chunk-GSQGBVKG.ts.map} +0 -0
  322. /package/dist/chunks/{chunk-PQ75RPUP.ts.map → chunk-UZUUUY7C.ts.map} +0 -0
  323. /package/dist/chunks/{agent-candidate-ZHN7FTZT.ts.map → manager-result-dispatcher-I2AMCCE7.ts.map} +0 -0
  324. /package/dist/chunks/{agent-sync-EGA2I5W7.ts.map → merge-review-SGDLMVS4.ts.map} +0 -0
  325. /package/dist/chunks/{config-J5VZUY4J.ts.map → remote-selection-ui-GZHPDQ4L.ts.map} +0 -0
  326. /package/dist/chunks/{conflict-artifacts-MYSH3L2J.ts.map → setup-switch-M3BAFGJM.ts.map} +0 -0
  327. /package/dist/chunks/{continuous-record-OM64J27R.ts.map → state-directory-JZSZVVPX.ts.map} +0 -0
@@ -1,12 +1,42 @@
1
1
  // @generated by scripts/build-runtime.mjs; do not edit.
2
2
  // @ts-nocheck -- generated JavaScript uses a .ts extension for Pi's Jiti loader.
3
+ import {
4
+ dispatchManagerResult
5
+ } from "./chunk-UZUUUY7C.ts";
6
+ import {
7
+ captureMutationOwner,
8
+ runCancellableOperation
9
+ } from "./chunk-4RNCZZY7.ts";
3
10
  import {
4
11
  SETUP_SWITCH_ACTION_OPTIONS,
5
12
  saveOnSwitch,
6
13
  setupSwitchActionFromLabel,
7
14
  setupSwitchActionLabel,
8
15
  useSyncSetup
9
- } from "./chunk-76HID27T.ts";
16
+ } from "./chunk-BGGKHHO4.ts";
17
+ import {
18
+ observationMatchesConfig,
19
+ observationSummary,
20
+ readStateForConfig,
21
+ syncAttentionMatchesConfig,
22
+ syncStateFingerprint
23
+ } from "./chunk-6LHIRS5R.ts";
24
+ import {
25
+ normalizeSyncExclude,
26
+ sameSyncExclude
27
+ } from "./chunk-NPT2G4FU.ts";
28
+ import {
29
+ confirmMergeReview
30
+ } from "./chunk-GSQGBVKG.ts";
31
+ import {
32
+ loadConfig,
33
+ loadPartialConfig,
34
+ syncCheckConfigFingerprint,
35
+ syncConfigReviewIdentity
36
+ } from "./chunk-7AC2RX4M.ts";
37
+ import {
38
+ configureSyncStatus
39
+ } from "./chunk-ENFHHB5O.ts";
10
40
  import {
11
41
  applyS3CredentialUpdate,
12
42
  chooseS3CredentialUpdate,
@@ -26,146 +56,63 @@ import {
26
56
  showEditS3Target,
27
57
  showEditWebDavStorageProfile,
28
58
  showEditWebDavTarget
29
- } from "./chunk-DTPELCPW.ts";
30
- import {
31
- automaticSyncSummary
32
- } from "./chunk-ECYCNZOE.ts";
33
- import {
34
- dispatchManagerResult
35
- } from "./chunk-PQ75RPUP.ts";
36
- import {
37
- runCancellableOperation
38
- } from "./chunk-NGW4JMBF.ts";
39
- import "./chunk-OQBE2OMB.ts";
40
- import "./chunk-2UKUKIBI.ts";
59
+ } from "./chunk-YWEYRRQI.ts";
41
60
  import {
42
- confirmMergeReview
43
- } from "./chunk-KHBPED6W.ts";
44
- import "./chunk-ILXMZ2HU.ts";
45
- import {
46
- addStorageConnection,
47
- removeStorageConnection,
48
- removeSyncSetup,
49
- updateStorageConnection,
50
- updateSyncSetup
51
- } from "./chunk-6XU5HZAN.ts";
52
- import "./chunk-QQVK2XFC.ts";
61
+ isCloudflareR2Endpoint,
62
+ normalizeS3Endpoint,
63
+ ownRecord
64
+ } from "./chunk-M7RHV3H6.ts";
53
65
  import {
66
+ automaticSyncSummary,
54
67
  syncErrorGuidance
55
- } from "./chunk-G4RUXRWZ.ts";
56
- import {
57
- sameLocalFields
58
- } from "./chunk-P3YD4ONV.ts";
68
+ } from "./chunk-ZMNVNECV.ts";
59
69
  import {
60
- observationMatchesConfig,
61
- observationSummary,
62
- syncAttentionMatchesConfig
63
- } from "./chunk-2ZZJXITS.ts";
70
+ loadOnSwitch,
71
+ readLocalConfigObject,
72
+ requireSettings,
73
+ updateLocalConfig
74
+ } from "./chunk-VZCWYXRS.ts";
64
75
  import {
65
76
  AUTOMATIC_SYNC_DESCRIPTION,
66
77
  STARTUP_TRANSFER_DESCRIPTION,
67
78
  startupTransferSummary
68
- } from "./chunk-QPC5HT3A.ts";
69
- import {
70
- captureMutationOwner
71
- } from "./chunk-T2TYBLXK.ts";
72
- import {
73
- safeTerminalText
74
- } from "./chunk-AMJRUXFT.ts";
79
+ } from "./chunk-J5COV5TY.ts";
75
80
  import {
76
- configureSyncStatus
77
- } from "./chunk-YIPK23JW.ts";
81
+ throwIfAborted
82
+ } from "./chunk-PDBTD2K6.ts";
78
83
  import {
79
- errorMessage
80
- } from "./chunk-7D5SF7P3.ts";
84
+ addStorageConnection,
85
+ removeStorageConnection,
86
+ removeSyncSetup,
87
+ updateStorageConnection,
88
+ updateSyncSetup
89
+ } from "./chunk-JZKCOM62.ts";
81
90
  import {
82
91
  activeLocalConfigPath,
83
- isCloudflareR2Endpoint,
84
- loadConfig,
85
- loadOnSwitch,
86
- loadPartialConfig,
87
- localConfigPath,
88
- normalizeS3Endpoint,
89
- ownRecord,
90
- readLocalConfigObject,
91
- requireSettings,
92
- syncCheckConfigFingerprint,
93
- syncConfigReviewIdentity,
94
- updateLocalConfig
95
- } from "./chunk-XZ3ZTHKR.ts";
96
- import {
97
- normalizeLocalFields
98
- } from "./chunk-X7R6DCVF.ts";
92
+ localConfigPath
93
+ } from "./chunk-UBE6XWOM.ts";
99
94
  import {
100
- inspectLock,
101
- isLockGuardHeld,
102
- isStaleLock
103
- } from "./chunk-S7D6XWHI.ts";
104
- import {
105
- throwIfAborted
106
- } from "./chunk-PWMWOJP4.ts";
107
- import "./chunk-ZW5ZLGBI.ts";
95
+ errorMessage
96
+ } from "./chunk-HNKLBM3U.ts";
108
97
  import {
109
- readStateForConfig,
110
- syncStateFingerprint
111
- } from "./chunk-4NVHHDN2.ts";
112
- import "./chunk-AR2DGDUI.ts";
113
- import "./chunk-SWRVXVFD.ts";
114
- import "./chunk-2JZFHNLM.ts";
115
- import "./chunk-T2SJD3N7.ts";
116
- import "./chunk-MKC3PXCN.ts";
98
+ safeTerminalText
99
+ } from "./chunk-2JNFEZ3V.ts";
117
100
  import {
118
101
  compareSyncInclude,
119
102
  syncIncludeSelection,
120
103
  syncSessionsSelected
121
- } from "./chunk-WUHRVSWI.ts";
122
- import "./chunk-LA3HQMFG.ts";
123
- import {
124
- normalizeSyncExclude,
125
- sameSyncExclude
126
- } from "./chunk-3JTZF7Z5.ts";
127
- import "./chunk-FHE2DCA2.ts";
104
+ } from "./chunk-JKBUYCPC.ts";
128
105
 
129
106
  // src/ui/manager-ui.ts
130
- import { defineMenu as defineMenu6, runMenu as runMenu6 } from "@narumitw/pi-tui-kit";
107
+ import { defineMenu as defineMenu6, runDocumentReview, runMenu as runMenu6 } from "@narumitw/pi-tui-kit";
131
108
 
132
109
  // src/state/operation-availability.ts
133
- var DEFAULT_INSPECTION_DEPENDENCIES = {
134
- inspectMetadata: inspectLock,
135
- inspectGuard: isLockGuardHeld
136
- };
137
- async function inspectOperationAvailability(dependencies = DEFAULT_INSPECTION_DEPENDENCIES) {
138
- try {
139
- const metadata = await dependencies.inspectMetadata();
140
- const guardHeld = await dependencies.inspectGuard();
141
- return classifyOperationAvailability(metadata, guardHeld);
142
- } catch (error) {
143
- return { kind: "inspection-error", message: errorMessage(error) };
144
- }
145
- }
146
- function classifyOperationAvailability(metadata, guardHeld) {
147
- if (metadata.status === "valid" && !isStaleLock(metadata.lock)) {
148
- return { kind: "live", lock: metadata.lock };
149
- }
150
- if (guardHeld) {
151
- return {
152
- kind: "busy",
153
- metadata: metadata.status,
154
- ...metadata.status === "valid" ? { lock: metadata.lock } : {}
155
- };
156
- }
157
- if (metadata.status === "valid") {
158
- return { kind: "recoverable-stale", lock: metadata.lock };
159
- }
160
- if (metadata.status === "unreadable") return { kind: "recoverable-unreadable" };
161
- return { kind: "free" };
162
- }
163
- function operationBlocksChanges(availability) {
164
- return availability.kind !== "free";
165
- }
166
- function operationCanRecover(availability) {
167
- return availability.kind === "recoverable-stale" || availability.kind === "recoverable-unreadable";
168
- }
110
+ import {
111
+ classifyOperationAvailability,
112
+ inspectOperationAvailability,
113
+ operationBlocksChanges,
114
+ operationCanRecover
115
+ } from "@narumitw/sync-daemon/engine/state/operation-availability";
169
116
 
170
117
  // src/ui/manager-attention.ts
171
118
  function attentionMainMenuItems(manager) {
@@ -195,7 +142,7 @@ function blockedSyncMenuItem(label, manager) {
195
142
  };
196
143
  }
197
144
  async function showManagerAttention(ctx, attention, runRoute, signal, onSelectionResolved) {
198
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-W55BQDJQ.ts");
145
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-GZHPDQ4L.ts");
199
146
  if (signal?.aborted) return "close";
200
147
  const review = await showRemoteSelectionReview(ctx, attention.decision.setupName, signal, void 0, {
201
148
  decision: attention.decision,
@@ -522,7 +469,6 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
522
469
  const config = await loadConfig();
523
470
  const operation = await inspectOperation();
524
471
  const changesBlocked = operationBlocksChanges(operation);
525
- const selection = syncIncludeSelection(config.include);
526
472
  let currentAttention;
527
473
  if (attention) {
528
474
  try {
@@ -538,39 +484,27 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
538
484
  const noSyncedContent = config.include.length === 0;
539
485
  const syncState = changesBlocked ? void 0 : await readStateForConfig(config).catch(() => void 0);
540
486
  const currentObservation = observation && observationMatchesConfig(observation, config) && syncState && syncStateFingerprint(syncState) === observation.inspection.stateIdentity ? observation : void 0;
541
- const lastAppliedSnapshot = changesBlocked ? "Unavailable while operations are locked" : syncState?.lastAppliedSnapshot ? `${truncateToWidth(safeTerminalText(syncState.lastAppliedSnapshot), 20, "\u2026")} (application time unavailable; full ID in History)` : syncState ? "Never synced" : "Unavailable";
487
+ const lastAppliedSnapshot = changesBlocked ? "Unavailable while operations are locked" : syncState?.lastAppliedSnapshot ? `${truncateToWidth(safeTerminalText(syncState.lastAppliedSnapshot), 12, "\u2026")} \xB7 application time unavailable` : syncState ? "Never synced" : "Unavailable";
542
488
  const canSwitch = await countValidSyncSetups(configuredTargets, signal) > 1;
543
489
  const mainActions = [...MAIN_MENU_ACTIONS];
544
490
  if (config.agentMode && !noSyncedContent) mainActions.splice(1, 0, "Retry refused model result\u2026");
545
491
  if (canSwitch) mainActions.push("Switch sync setup");
546
492
  if (syncState?.unresolved?.length) mainActions.unshift("Review unresolved conflicts");
493
+ const background = changesBlocked ? [] : await backgroundSummary(config);
494
+ signal?.throwIfAborted();
547
495
  const ordinaryTitle = [
548
496
  "Manage sync",
549
- "",
550
497
  `Current sync setup: ${safeTerminalText(config.setupName)}`,
551
498
  `Storage: ${backendStorageDescription(config)}`,
552
- "CURRENT STATE",
553
- ...syncState?.unresolved?.length ? [
554
- `Unresolved: ${syncState.unresolved.length} dependency groups \xB7 choose Review unresolved conflicts`,
555
- `Last observed: ${safeTerminalText(syncState.lastObservedSnapshot ?? "unknown")}`
556
- ] : [],
499
+ ...syncState?.unresolved?.length ? [`Unresolved: ${syncState.unresolved.length} dependency groups \xB7 review needed`] : [],
557
500
  ...currentAttention ? [
558
501
  currentAttention.decision.setupName === config.setupName ? "Sync status: Review needed" : `Sync status: Review needed for setup ${safeTerminalText(currentAttention.decision.setupName)}`,
559
- attentionComparison?.remoteOnly.length === 0 && attentionComparison.localOnly.length === 0 ? attentionExclusionsDiffer ? "Synced-content exclusion rules differ." : "Only the synced-content order differs." : `Remote-only paths: ${attentionComparison?.remoteOnly.length ?? 0} \xB7 Device-only paths: ${attentionComparison?.localOnly.length ?? 0}${attentionExclusionsDiffer ? " \xB7 Exclusion rules differ." : ""}`,
560
- "Nothing has been changed."
561
- ] : currentObservation ? [
562
- `Startup check (${safeTerminalText(currentObservation.checkedAt)}): ${observationSummary(currentObservation)}`,
563
- "Check-time observation only; synchronization rechecks current content."
564
- ] : ["Remote status: Not checked"],
565
- `Included: ${selection.builtIns.length} built-in group${selection.builtIns.length === 1 ? "" : "s"} \xB7 ${selection.custom.length} extra path${selection.custom.length === 1 ? "" : "s"} \xB7 Sessions ${syncSessionsSelected(config) ? "on" : "off"}`,
566
- `Automatic sync: ${automaticSyncSummary(config.automatic)}`,
567
- `Startup transfer: ${startupTransferSummary(config)}`,
568
- `Autonomous sync: ${config.agentMode ? "On (autonomous merged sync)" : "Off"}`,
569
- ...config.continuous ? await (await import("./continuous-record-OM64J27R.ts")).continuousStatusLines(config) : [],
502
+ attentionComparison?.remoteOnly.length === 0 && attentionComparison.localOnly.length === 0 ? attentionExclusionsDiffer ? "Synced-content exclusion rules differ." : "Only the synced-content order differs." : `Remote-only paths: ${attentionComparison?.remoteOnly.length ?? 0} \xB7 Device-only paths: ${attentionComparison?.localOnly.length ?? 0}${attentionExclusionsDiffer ? " \xB7 Exclusion rules differ." : ""}`
503
+ ] : currentObservation ? [`Observed ${safeTerminalText(currentObservation.checkedAt)}: ${observationSummary(currentObservation)}`] : ["Remote status: Not checked"],
570
504
  `Last applied: ${lastAppliedSnapshot}`,
571
- ...noSyncedContent ? ["", "No included content is selected. Choose included content in Settings before syncing."] : [],
572
- "",
573
- "ACTIONS \xB7 transfer, inspect, or manage"
505
+ ...config.agentMode ? ["Auto-apply: On \xB7 AI requests may incur costs"] : config.automaticTransfer || config.automatic && syncSessionsSelected(config) ? ["Automatic transfer permission: On \xB7 see Settings"] : [],
506
+ ...background,
507
+ ...noSyncedContent ? ["", "No included content is selected. Choose included content in Settings before syncing."] : []
574
508
  ];
575
509
  return {
576
510
  title: (changesBlocked ? ["Manage sync", ...operationStatusLines(operation)] : ordinaryTitle).join("\n"),
@@ -601,6 +535,26 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
601
535
  };
602
536
  }
603
537
  }
538
+ async function backgroundSummary(config) {
539
+ if (!config.continuous) return [];
540
+ if (!config.agentMode) return ["Background sync: Paused \xB7 enable Autonomous sync"];
541
+ try {
542
+ const { continuousBinding, readContinuousPrivateDocument } = await import("./continuous-storage-SQBAXACF.ts");
543
+ const recordApi = await import("./continuous-record-ZHUXVO4E.ts");
544
+ const binding = await continuousBinding(config);
545
+ const document = await readContinuousPrivateDocument(`${binding}.json`);
546
+ if (!document) return ["Background sync: Enabled \xB7 not yet observed"];
547
+ recordApi.validateContinuousRecord(document.value, binding);
548
+ const record = document.value;
549
+ const phases = { waiting: "Waiting", syncing: "Syncing", retry: "Retry", blocked: "Blocked" };
550
+ return [
551
+ `Background sync (recorded): ${phases[record.phase]}${record.error ? ` \xB7 ${record.error}` : ""}`,
552
+ ...record.transferred === void 0 ? [] : [`Last background transfer: Success \xB7 ${new Date(record.transferred).toISOString()}`]
553
+ ];
554
+ } catch {
555
+ return ["Background sync: Unknown \xB7 open Diagnostics"];
556
+ }
557
+ }
604
558
  function operationActions(operation, noSyncedContent, canSwitch, mainActions) {
605
559
  if (operationCanRecover(operation)) {
606
560
  return ["Restore sync access\u2026 (recommended)", "History", "Help"];
@@ -659,6 +613,16 @@ function backendStorageDescription(config) {
659
613
  // src/ui/settings-ui.ts
660
614
  import { defineMenu as defineMenu5, runMenu as runMenu5 } from "@narumitw/pi-tui-kit";
661
615
 
616
+ // src/sync/local-fields.ts
617
+ import {
618
+ normalizeLocalFields,
619
+ overlayLocalFields,
620
+ portableSnapshot,
621
+ sameLocalFields,
622
+ validatePortableSnapshot,
623
+ validateSnapshotFieldPolicy
624
+ } from "@narumitw/sync-daemon/engine/sync/local-fields";
625
+
662
626
  // src/ui/agent-mode-setting.ts
663
627
  import { isDeepStrictEqual } from "node:util";
664
628
  var AGENT_MODE_DESCRIPTION = "This setup: sync eligible changes at session startup and on Sync now without transfer confirmation. Use the selected Pi model to resolve supported text and settings conflicts. Eligible conflict content may be sent to its provider and incur costs. Selected local and remote content can be replaced or deleted. Unresolved conflicts pause unless partial sync permits independent progress. Continuous sync is a separate opt-in. No automatic reload.";
@@ -1891,7 +1855,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1891
1855
  },
1892
1856
  "remote-include": async ({ signal: actionSignal }) => {
1893
1857
  const reviewSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
1894
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-W55BQDJQ.ts");
1858
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-GZHPDQ4L.ts");
1895
1859
  if (reviewSignal.aborted) return { kind: "rejected" };
1896
1860
  const review = await showRemoteSelectionReview(ctx, setupName, reviewSignal, void 0, {
1897
1861
  origin: "settings",
@@ -1967,36 +1931,46 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
1967
1931
  return false;
1968
1932
  }
1969
1933
  };
1934
+ const menuItems = (manager) => {
1935
+ const attentionItems = attentionMainMenuItems(manager);
1936
+ const managerItems = manager.actions.map((label) => blockedSyncMenuItem(label, manager) ?? syncMainMenuItem(label));
1937
+ const operationFirst = manager.operation !== void 0 && manager.operation.kind !== "free";
1938
+ return operationFirst ? [...managerItems, ...attentionItems] : [...attentionItems, ...managerItems];
1939
+ };
1970
1940
  const menu = defineMenu6({
1971
1941
  start: "main",
1972
1942
  screens: {
1973
- main: ({ state }) => {
1974
- const attentionItems = attentionMainMenuItems(state.manager);
1975
- const managerItems = state.manager.actions.map(
1976
- (label) => blockedSyncMenuItem(label, state.manager) ?? syncMainMenuItem(label)
1977
- );
1978
- const operationFirst = state.manager.operation !== void 0 && state.manager.operation.kind !== "free";
1979
- return {
1980
- kind: "actions",
1981
- title: "Manage sync",
1982
- // Frequent transfers stay visible; status is advisory and Help remains a direct route.
1983
- lines: [
1984
- ...state.manager.title.split("\n").slice(1),
1985
- "Help: /sync help \xB7 Fresh status: /sync status \xB7 Differences: /sync diff"
1986
- ],
1987
- items: operationFirst ? [...managerItems, ...attentionItems] : [...attentionItems, ...managerItems],
1988
- hint: "close"
1989
- };
1990
- }
1943
+ main: ({ state }) => ({
1944
+ kind: "choice",
1945
+ title: "Manage sync",
1946
+ lines: state.manager.title.split("\n").slice(1),
1947
+ items: menuItems(state.manager).map((item) => ({
1948
+ id: item.id,
1949
+ label: ctx.mode === "tui" && item.id === "sync" ? "Sync\u2026" : item.label,
1950
+ details: [item.description ?? "Review synced content."],
1951
+ searchText: `${item.label} ${item.description ?? ""}`,
1952
+ disabled: item.disabled,
1953
+ disabledReason: item.disabledReason
1954
+ })),
1955
+ action: "activate",
1956
+ enableSearch: true,
1957
+ viewportSize: 5,
1958
+ hint: "close"
1959
+ })
1991
1960
  },
1992
1961
  actions: {
1962
+ activate: async (invocation) => {
1963
+ const item = menuItems(invocation.state.manager).find((candidate) => candidate.id === invocation.itemId);
1964
+ if (!item || item.disabled || !("action" in item) || !item.action) return { kind: "stay" };
1965
+ return menu.actions[item.action](invocation);
1966
+ },
1993
1967
  "review-attention": async ({ state }) => {
1994
1968
  const attention = state.manager.attention;
1995
1969
  if (attention && options.getAttention?.() !== attention) return { kind: "stay" };
1996
1970
  if (!attention) {
1997
1971
  const observation = state.manager.observation;
1998
1972
  if (!observation) return { kind: "stay" };
1999
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-W55BQDJQ.ts");
1973
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-GZHPDQ4L.ts");
2000
1974
  if (sessionSignal?.aborted) return { kind: "close" };
2001
1975
  const config = await loadConfig();
2002
1976
  if (sessionSignal?.aborted) return { kind: "close" };
@@ -2127,6 +2101,30 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
2127
2101
  const validate = captureMutationOwner(ctx, signal);
2128
2102
  const config = await loadConfig(state.manager.configReview?.setupName);
2129
2103
  validate();
2104
+ if (config.continuous) {
2105
+ const { continuousStatusLines } = await import("./continuous-record-ZHUXVO4E.ts");
2106
+ validate();
2107
+ const lines = await continuousStatusLines(config);
2108
+ validate();
2109
+ const review = await runDocumentReview(ctx, {
2110
+ title: "Sync diagnostics",
2111
+ lines: [`Setup: ${safeTerminalText(config.setupName)} \xB7 local observations only`],
2112
+ content: lines.join("\n"),
2113
+ confirmation: { label: "Continue to backend checks\u2026" },
2114
+ hint: "back",
2115
+ signal,
2116
+ isCurrent
2117
+ });
2118
+ validate();
2119
+ if (review.kind === "cancelled") return { kind: review.reason === "close" ? "close" : "stay" };
2120
+ if (review.kind !== "confirmed") return { kind: "stay" };
2121
+ const current = await loadConfig();
2122
+ validate();
2123
+ if (syncCheckConfigFingerprint(config) !== syncCheckConfigFingerprint(current)) {
2124
+ ctx.ui.notify("Setup changed during diagnostics review; reopen Diagnostics.", "warning");
2125
+ return { kind: "stay" };
2126
+ }
2127
+ }
2130
2128
  const confirmed = await ctx.ui.confirm(
2131
2129
  "Run diagnostics?",
2132
2130
  `Setup: ${safeTerminalText(config.setupName)}
@@ -2269,10 +2267,28 @@ function syncMainMenuItem(label) {
2269
2267
  id: action,
2270
2268
  label,
2271
2269
  action,
2272
- description: action === "retry-refusal" ? "Transfer: confirm one fresh model request for a current cached refusal; may incur costs." : action === "doctor" ? "Manage: review backend checks before running." : action === "settings" || action === "history" || action === "switch" ? "Manage" : action === "sync" ? "Transfer: choose a safe direction or review conflicts." : action === "pull" ? "Transfer: remote \u2192 local; review writes and removals." : action === "push" ? "Transfer: local \u2192 remote active snapshot; review publication." : action === "status" || action === "diff" ? "Inspect: read current local and remote state without transferring files." : void 0
2270
+ description: {
2271
+ sync: "Merge changes on both sides.",
2272
+ "retry-refusal": "Retry model; may incur costs.",
2273
+ pull: "Remote \u2192 this device.",
2274
+ push: "This device \u2192 remote snapshot.",
2275
+ diff: "Inspect changes; no transfer.",
2276
+ status: "Check remote; no transfer.",
2277
+ settings: "Change sync settings.",
2278
+ history: "Review snapshots and rollback.",
2279
+ doctor: "Review backend diagnostics.",
2280
+ switch: "Choose another sync setup.",
2281
+ conflicts: "Review unresolved file groups.",
2282
+ recover: "Review local lock recovery.",
2283
+ refresh: "Recheck the operation lock.",
2284
+ setups: "Manage sync setups.",
2285
+ connections: "Manage storage connections.",
2286
+ help: "Read sync commands and safety.",
2287
+ init: "Configure a sync setup."
2288
+ }[action]
2273
2289
  };
2274
2290
  }
2275
2291
  export {
2276
2292
  showSyncManager
2277
2293
  };
2278
- //# sourceMappingURL=manager-ui-65ZETN6F.ts.map
2294
+ //# sourceMappingURL=manager-ui-AY5ZU6B4.ts.map