@narumitw/pi-sync 0.58.1 → 0.60.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 (334) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +28 -15
  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-MG66XM5U.ts → chunk-4RNCZZY7.ts} +86 -36
  6. package/dist/chunks/chunk-4RNCZZY7.ts.map +7 -0
  7. package/dist/chunks/{config-HYG7G5EM.ts → chunk-7AC2RX4M.ts} +6 -12
  8. package/dist/chunks/chunk-7AC2RX4M.ts.map +7 -0
  9. package/dist/chunks/{chunk-XEODG2PE.ts → chunk-BGGKHHO4.ts} +18 -14
  10. package/dist/chunks/{chunk-XEODG2PE.ts.map → chunk-BGGKHHO4.ts.map} +1 -1
  11. package/dist/chunks/chunk-BWWTOQOW.ts +737 -0
  12. package/dist/chunks/chunk-BWWTOQOW.ts.map +7 -0
  13. package/dist/chunks/chunk-CEMFCWIU.ts +20 -0
  14. package/dist/chunks/chunk-CEMFCWIU.ts.map +7 -0
  15. package/dist/chunks/chunk-CZNBKIM5.ts +20 -0
  16. package/dist/chunks/chunk-CZNBKIM5.ts.map +7 -0
  17. package/dist/chunks/{chunk-YIPK23JW.ts → chunk-ENFHHB5O.ts} +1 -16
  18. package/dist/chunks/{chunk-YIPK23JW.ts.map → chunk-ENFHHB5O.ts.map} +1 -1
  19. package/dist/chunks/{chunk-KHBPED6W.ts → chunk-GSQGBVKG.ts} +2 -2
  20. package/dist/chunks/chunk-HNKLBM3U.ts +18 -0
  21. package/dist/chunks/chunk-HNKLBM3U.ts.map +7 -0
  22. package/dist/chunks/{chunk-QPC5HT3A.ts → chunk-J5COV5TY.ts} +21 -2
  23. package/dist/chunks/chunk-J5COV5TY.ts.map +7 -0
  24. package/dist/chunks/chunk-JKBUYCPC.ts +52 -0
  25. package/dist/chunks/chunk-JKBUYCPC.ts.map +7 -0
  26. package/dist/chunks/chunk-JZKCOM62.ts +26 -0
  27. package/dist/chunks/chunk-JZKCOM62.ts.map +7 -0
  28. package/dist/chunks/chunk-M7RHV3H6.ts +33 -0
  29. package/dist/chunks/chunk-M7RHV3H6.ts.map +7 -0
  30. package/dist/chunks/{chunk-REMGB255.ts → chunk-MIXZVHFR.ts} +35 -10
  31. package/dist/chunks/chunk-MIXZVHFR.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-JYILGR3K.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-U6GXGY5G.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-MRXE5AKK.ts → command-handler-3O76V7Q5.ts} +83 -87
  46. package/dist/chunks/command-handler-3O76V7Q5.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-EPHGR2DU.ts → continuous-record-ZHUXVO4E.ts} +5 -13
  50. package/dist/chunks/continuous-record-ZHUXVO4E.ts.map +7 -0
  51. package/dist/chunks/{file-selection-IELTXSGZ.ts → file-selection-S6CNNNQI.ts} +14 -14
  52. package/dist/chunks/file-selection-S6CNNNQI.ts.map +7 -0
  53. package/dist/chunks/manager-result-dispatcher-I2AMCCE7.ts +18 -0
  54. package/dist/chunks/{manager-ui-AY34N4UY.ts → manager-ui-SJOBTJLY.ts} +221 -147
  55. package/dist/chunks/manager-ui-SJOBTJLY.ts.map +7 -0
  56. package/dist/chunks/merge-review-SGDLMVS4.ts +10 -0
  57. package/dist/chunks/remote-selection-ui-GZHPDQ4L.ts +17 -0
  58. package/dist/chunks/{setup-switch-KLGESLQX.ts → setup-switch-M3BAFGJM.ts} +9 -12
  59. package/dist/chunks/{setup-wizard-ZQAK35BP.ts → setup-wizard-NFAWP4KF.ts} +18 -20
  60. package/dist/chunks/{setup-wizard-ZQAK35BP.ts.map → setup-wizard-NFAWP4KF.ts.map} +1 -1
  61. package/dist/chunks/{snapshot-RGNDYT6A.ts → snapshot-D4SFDP5J.ts} +8 -12
  62. package/dist/chunks/snapshot-D4SFDP5J.ts.map +7 -0
  63. package/dist/chunks/snapshot-transaction-directory-TNKBQ3UQ.ts +13 -0
  64. package/dist/chunks/snapshot-transaction-directory-TNKBQ3UQ.ts.map +7 -0
  65. package/dist/chunks/state-directory-JZSZVVPX.ts +17 -0
  66. package/dist/chunks/sync-inspection-BJ4KPPNO.ts +23 -0
  67. package/dist/chunks/sync-inspection-BJ4KPPNO.ts.map +7 -0
  68. package/dist/chunks/sync-operations-TLWER2TT.ts +45 -0
  69. package/dist/chunks/sync-operations-TLWER2TT.ts.map +7 -0
  70. package/dist/chunks/{sync-state-7L4NT7W2.ts → sync-state-FVCJJ7MY.ts} +5 -10
  71. package/dist/chunks/sync-state-FVCJJ7MY.ts.map +7 -0
  72. package/dist/index.ts +269 -306
  73. package/dist/index.ts.map +4 -4
  74. package/docs/daemon-migration.md +93 -0
  75. package/docs/exclude-policy-audit.md +54 -0
  76. package/docs/exclude-review-ledger.md +36 -0
  77. package/docs/tui-contract.md +1 -1
  78. package/package.json +3 -5
  79. package/skills/configure-pi-sync/SKILL.md +5 -4
  80. package/skills/configure-pi-sync/references/configuration.md +91 -19
  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 -292
  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 +42 -38
  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 -257
  105. package/src/settings/settings-management.ts +11 -253
  106. package/src/settings/settings-store.ts +10 -48
  107. package/src/settings/settings-types.ts +1 -154
  108. package/src/settings/settings-validation.ts +17 -431
  109. package/src/snapshot/session-paths.ts +11 -110
  110. package/src/snapshot/snapshot-apply.ts +9 -306
  111. package/src/snapshot/snapshot-case-replacement.ts +6 -80
  112. package/src/snapshot/snapshot-codec.ts +2 -50
  113. package/src/snapshot/snapshot-exclude-safety.ts +2 -0
  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 -934
  120. package/src/snapshot/snapshot-types.ts +1 -43
  121. package/src/snapshot/snapshot.ts +18 -405
  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 -200
  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 -24
  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 -106
  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 -59
  156. package/src/sync/exclude-policy.ts +6 -0
  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 -108
  162. package/src/sync/merge-apply.ts +2 -434
  163. package/src/sync/merge-journal.ts +10 -219
  164. package/src/sync/merge-transfer-error.ts +2 -72
  165. package/src/sync/merged-sync.ts +2 -914
  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 -54
  169. package/src/sync/remote-snapshot.ts +7 -80
  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 -101
  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 -57
  180. package/src/sync/sync-local.ts +2 -44
  181. package/src/sync/sync-mutations.ts +10 -781
  182. package/src/sync/sync-operations.ts +32 -11
  183. package/src/sync/sync-policy.ts +34 -410
  184. package/src/sync/sync-queries.ts +2 -237
  185. package/src/sync/sync-state.ts +18 -151
  186. package/src/sync/text-merge.ts +10 -133
  187. package/src/sync-extension.ts +192 -142
  188. package/src/ui/excluded-paths-ui.ts +106 -0
  189. package/src/ui/file-selection.ts +6 -3
  190. package/src/ui/manager-state.ts +11 -5
  191. package/src/ui/remote-selection-ui.ts +73 -10
  192. package/src/ui/settings-ui.ts +20 -5
  193. package/src/ui/setup/setup-actions.ts +1 -1
  194. package/src/ui/setup/setup-switcher.ts +3 -2
  195. package/src/ui/storage-connections-ui.ts +2 -2
  196. package/src/ui/sync-attention.ts +17 -3
  197. package/src/ui/sync-format.ts +13 -1
  198. package/dist/chunks/agent-candidate-U2NU3GUX.ts +0 -29
  199. package/dist/chunks/agent-plan-3YXDIJXO.ts +0 -123
  200. package/dist/chunks/agent-plan-3YXDIJXO.ts.map +0 -7
  201. package/dist/chunks/agent-refusal-retry-476YGNU5.ts +0 -72
  202. package/dist/chunks/agent-refusal-retry-476YGNU5.ts.map +0 -7
  203. package/dist/chunks/agent-runner-FCRV2Z75.ts +0 -185
  204. package/dist/chunks/agent-runner-FCRV2Z75.ts.map +0 -7
  205. package/dist/chunks/agent-store-7GINKTS7.ts +0 -175
  206. package/dist/chunks/agent-store-7GINKTS7.ts.map +0 -7
  207. package/dist/chunks/agent-sync-2R4GG2MF.ts +0 -22
  208. package/dist/chunks/chunk-2JZFHNLM.ts +0 -113
  209. package/dist/chunks/chunk-2JZFHNLM.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-45COPAK7.ts +0 -205
  213. package/dist/chunks/chunk-45COPAK7.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-5TSCBBPP.ts +0 -229
  217. package/dist/chunks/chunk-5TSCBBPP.ts.map +0 -7
  218. package/dist/chunks/chunk-6LD5KX55.ts +0 -396
  219. package/dist/chunks/chunk-6LD5KX55.ts.map +0 -7
  220. package/dist/chunks/chunk-6O3EDBRL.ts +0 -258
  221. package/dist/chunks/chunk-6O3EDBRL.ts.map +0 -7
  222. package/dist/chunks/chunk-7A35ZAVO.ts +0 -1109
  223. package/dist/chunks/chunk-7A35ZAVO.ts.map +0 -7
  224. package/dist/chunks/chunk-7D5SF7P3.ts +0 -29
  225. package/dist/chunks/chunk-7D5SF7P3.ts.map +0 -7
  226. package/dist/chunks/chunk-7ZIYU5QS.ts +0 -64
  227. package/dist/chunks/chunk-7ZIYU5QS.ts.map +0 -7
  228. package/dist/chunks/chunk-AKMV47YC.ts +0 -215
  229. package/dist/chunks/chunk-AKMV47YC.ts.map +0 -7
  230. package/dist/chunks/chunk-AR2DGDUI.ts +0 -55
  231. package/dist/chunks/chunk-AR2DGDUI.ts.map +0 -7
  232. package/dist/chunks/chunk-BEST45H2.ts +0 -153
  233. package/dist/chunks/chunk-BEST45H2.ts.map +0 -7
  234. package/dist/chunks/chunk-CBLTWXAU.ts +0 -114
  235. package/dist/chunks/chunk-CBLTWXAU.ts.map +0 -7
  236. package/dist/chunks/chunk-CQD2TJHE.ts +0 -220
  237. package/dist/chunks/chunk-CQD2TJHE.ts.map +0 -7
  238. package/dist/chunks/chunk-DN4IA7MR.ts +0 -61
  239. package/dist/chunks/chunk-DN4IA7MR.ts.map +0 -7
  240. package/dist/chunks/chunk-DT7M4VQS.ts +0 -69
  241. package/dist/chunks/chunk-DT7M4VQS.ts.map +0 -7
  242. package/dist/chunks/chunk-ECYCNZOE.ts.map +0 -7
  243. package/dist/chunks/chunk-ESKOPQVB.ts +0 -348
  244. package/dist/chunks/chunk-ESKOPQVB.ts.map +0 -7
  245. package/dist/chunks/chunk-FHE2DCA2.ts +0 -61
  246. package/dist/chunks/chunk-FHE2DCA2.ts.map +0 -7
  247. package/dist/chunks/chunk-FLHCOJCD.ts +0 -57
  248. package/dist/chunks/chunk-FLHCOJCD.ts.map +0 -7
  249. package/dist/chunks/chunk-G4RUXRWZ.ts +0 -48
  250. package/dist/chunks/chunk-G4RUXRWZ.ts.map +0 -7
  251. package/dist/chunks/chunk-GNYGNHFF.ts +0 -27
  252. package/dist/chunks/chunk-GNYGNHFF.ts.map +0 -7
  253. package/dist/chunks/chunk-KYTT7KV4.ts +0 -319
  254. package/dist/chunks/chunk-KYTT7KV4.ts.map +0 -7
  255. package/dist/chunks/chunk-M6VQJIOU.ts +0 -54
  256. package/dist/chunks/chunk-M6VQJIOU.ts.map +0 -7
  257. package/dist/chunks/chunk-MG66XM5U.ts.map +0 -7
  258. package/dist/chunks/chunk-MKSMJPVA.ts +0 -107
  259. package/dist/chunks/chunk-MKSMJPVA.ts.map +0 -7
  260. package/dist/chunks/chunk-MMQIEDZ6.ts +0 -1994
  261. package/dist/chunks/chunk-MMQIEDZ6.ts.map +0 -7
  262. package/dist/chunks/chunk-OJARL2TG.ts +0 -25
  263. package/dist/chunks/chunk-OJARL2TG.ts.map +0 -7
  264. package/dist/chunks/chunk-OVBAW7KV.ts +0 -1174
  265. package/dist/chunks/chunk-OVBAW7KV.ts.map +0 -7
  266. package/dist/chunks/chunk-PRUEIIK7.ts +0 -24
  267. package/dist/chunks/chunk-PRUEIIK7.ts.map +0 -7
  268. package/dist/chunks/chunk-PWMWOJP4.ts +0 -17
  269. package/dist/chunks/chunk-PWMWOJP4.ts.map +0 -7
  270. package/dist/chunks/chunk-QPC5HT3A.ts.map +0 -7
  271. package/dist/chunks/chunk-REMGB255.ts.map +0 -7
  272. package/dist/chunks/chunk-S5OCYVPS.ts +0 -415
  273. package/dist/chunks/chunk-S5OCYVPS.ts.map +0 -7
  274. package/dist/chunks/chunk-SWRVXVFD.ts +0 -248
  275. package/dist/chunks/chunk-SWRVXVFD.ts.map +0 -7
  276. package/dist/chunks/chunk-T2SJD3N7.ts +0 -99
  277. package/dist/chunks/chunk-T2SJD3N7.ts.map +0 -7
  278. package/dist/chunks/chunk-TIMWN2RH.ts +0 -89
  279. package/dist/chunks/chunk-TIMWN2RH.ts.map +0 -7
  280. package/dist/chunks/chunk-TZC7GDJE.ts +0 -58
  281. package/dist/chunks/chunk-TZC7GDJE.ts.map +0 -7
  282. package/dist/chunks/chunk-U6GXGY5G.ts.map +0 -7
  283. package/dist/chunks/chunk-WQMYV4DW.ts +0 -140
  284. package/dist/chunks/chunk-WQMYV4DW.ts.map +0 -7
  285. package/dist/chunks/chunk-X7R6DCVF.ts +0 -28
  286. package/dist/chunks/chunk-X7R6DCVF.ts.map +0 -7
  287. package/dist/chunks/chunk-XJHQPB3E.ts +0 -107
  288. package/dist/chunks/chunk-XJHQPB3E.ts.map +0 -7
  289. package/dist/chunks/chunk-Y4UVXOLQ.ts +0 -123
  290. package/dist/chunks/chunk-Y4UVXOLQ.ts.map +0 -7
  291. package/dist/chunks/chunk-YDVQYUHE.ts +0 -34
  292. package/dist/chunks/chunk-YDVQYUHE.ts.map +0 -7
  293. package/dist/chunks/chunk-YHT4YTYG.ts +0 -31
  294. package/dist/chunks/chunk-YHT4YTYG.ts.map +0 -7
  295. package/dist/chunks/chunk-ZW5ZLGBI.ts +0 -154
  296. package/dist/chunks/chunk-ZW5ZLGBI.ts.map +0 -7
  297. package/dist/chunks/command-handler-MRXE5AKK.ts.map +0 -7
  298. package/dist/chunks/conflict-artifacts-J6WSDCWP.ts +0 -32
  299. package/dist/chunks/conflict-review-GXA6Y7KY.ts +0 -189
  300. package/dist/chunks/conflict-review-GXA6Y7KY.ts.map +0 -7
  301. package/dist/chunks/continuous-sync-FAFNLEUW.ts +0 -585
  302. package/dist/chunks/continuous-sync-FAFNLEUW.ts.map +0 -7
  303. package/dist/chunks/file-selection-IELTXSGZ.ts.map +0 -7
  304. package/dist/chunks/git-backend-KHD36W27.ts +0 -1077
  305. package/dist/chunks/git-backend-KHD36W27.ts.map +0 -7
  306. package/dist/chunks/local-fields-JEKAPZKD.ts +0 -26
  307. package/dist/chunks/local-fields-JEKAPZKD.ts.map +0 -7
  308. package/dist/chunks/manager-result-dispatcher-XCYPW7RC.ts +0 -32
  309. package/dist/chunks/manager-result-dispatcher-XCYPW7RC.ts.map +0 -7
  310. package/dist/chunks/manager-ui-AY34N4UY.ts.map +0 -7
  311. package/dist/chunks/merge-baseline-store-65GKUMXI.ts +0 -25
  312. package/dist/chunks/merge-baseline-store-65GKUMXI.ts.map +0 -7
  313. package/dist/chunks/remote-selection-ui-MYM2YCPF.ts +0 -31
  314. package/dist/chunks/remote-selection-ui-MYM2YCPF.ts.map +0 -7
  315. package/dist/chunks/s3-backend-L24UZ6IK.ts +0 -844
  316. package/dist/chunks/s3-backend-L24UZ6IK.ts.map +0 -7
  317. package/dist/chunks/setup-switch-KLGESLQX.ts.map +0 -7
  318. package/dist/chunks/snapshot-RGNDYT6A.ts.map +0 -7
  319. package/dist/chunks/snapshot-transaction-26BQO36S.ts +0 -24
  320. package/dist/chunks/snapshot-transaction-26BQO36S.ts.map +0 -7
  321. package/dist/chunks/sync-inspection-MOMLGUTD.ts +0 -25
  322. package/dist/chunks/sync-inspection-MOMLGUTD.ts.map +0 -7
  323. package/dist/chunks/sync-operations-45APGOL3.ts +0 -1021
  324. package/dist/chunks/sync-operations-45APGOL3.ts.map +0 -7
  325. package/dist/chunks/sync-state-7L4NT7W2.ts.map +0 -7
  326. package/dist/chunks/webdav-backend-3ZCACILP.ts +0 -851
  327. package/dist/chunks/webdav-backend-3ZCACILP.ts.map +0 -7
  328. /package/dist/chunks/{chunk-KHBPED6W.ts.map → chunk-GSQGBVKG.ts.map} +0 -0
  329. /package/dist/chunks/{chunk-JYILGR3K.ts.map → chunk-UZUUUY7C.ts.map} +0 -0
  330. /package/dist/chunks/{agent-candidate-U2NU3GUX.ts.map → manager-result-dispatcher-I2AMCCE7.ts.map} +0 -0
  331. /package/dist/chunks/{agent-sync-2R4GG2MF.ts.map → merge-review-SGDLMVS4.ts.map} +0 -0
  332. /package/dist/chunks/{config-HYG7G5EM.ts.map → remote-selection-ui-GZHPDQ4L.ts.map} +0 -0
  333. /package/dist/chunks/{conflict-artifacts-J6WSDCWP.ts.map → setup-switch-M3BAFGJM.ts.map} +0 -0
  334. /package/dist/chunks/{continuous-record-EPHGR2DU.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-XEODG2PE.ts";
16
+ } from "./chunk-BGGKHHO4.ts";
17
+ import {
18
+ observationMatchesConfig,
19
+ observationSummary,
20
+ readStateForConfig,
21
+ syncAttentionMatchesConfig,
22
+ syncStateFingerprint
23
+ } from "./chunk-MIXZVHFR.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,141 +56,63 @@ import {
26
56
  showEditS3Target,
27
57
  showEditWebDavStorageProfile,
28
58
  showEditWebDavTarget
29
- } from "./chunk-U6GXGY5G.ts";
59
+ } from "./chunk-YWEYRRQI.ts";
30
60
  import {
31
- automaticSyncSummary
32
- } from "./chunk-ECYCNZOE.ts";
33
- import {
34
- dispatchManagerResult
35
- } from "./chunk-JYILGR3K.ts";
36
- import {
37
- runCancellableOperation
38
- } from "./chunk-MG66XM5U.ts";
39
- import "./chunk-TIMWN2RH.ts";
40
- import "./chunk-OJARL2TG.ts";
41
- import {
42
- confirmMergeReview
43
- } from "./chunk-KHBPED6W.ts";
44
- import "./chunk-TZC7GDJE.ts";
45
- import {
46
- addStorageConnection,
47
- removeStorageConnection,
48
- removeSyncSetup,
49
- updateStorageConnection,
50
- updateSyncSetup
51
- } from "./chunk-45COPAK7.ts";
52
- import "./chunk-FLHCOJCD.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-MKSMJPVA.ts";
68
+ } from "./chunk-ZMNVNECV.ts";
59
69
  import {
60
- observationMatchesConfig,
61
- observationSummary,
62
- syncAttentionMatchesConfig
63
- } from "./chunk-REMGB255.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-GNYGNHFF.ts";
79
+ } from "./chunk-J5COV5TY.ts";
72
80
  import {
73
- safeTerminalText
74
- } from "./chunk-AMJRUXFT.ts";
75
- 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-OVBAW7KV.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-6O3EDBRL.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-DN4IA7MR.ts";
112
- import "./chunk-AR2DGDUI.ts";
113
- import "./chunk-SWRVXVFD.ts";
114
- import "./chunk-2JZFHNLM.ts";
115
- import "./chunk-T2SJD3N7.ts";
116
- import "./chunk-ESKOPQVB.ts";
98
+ safeTerminalText
99
+ } from "./chunk-2JNFEZ3V.ts";
117
100
  import {
118
101
  compareSyncInclude,
119
- syncIncludeSelection
120
- } from "./chunk-KYTT7KV4.ts";
121
- import "./chunk-CBLTWXAU.ts";
122
- import "./chunk-FHE2DCA2.ts";
102
+ syncIncludeSelection,
103
+ syncSessionsSelected
104
+ } from "./chunk-JKBUYCPC.ts";
123
105
 
124
106
  // src/ui/manager-ui.ts
125
- import { defineMenu as defineMenu5, runMenu as runMenu5 } from "@narumitw/pi-tui-kit";
107
+ import { defineMenu as defineMenu6, runMenu as runMenu6 } from "@narumitw/pi-tui-kit";
126
108
 
127
109
  // src/state/operation-availability.ts
128
- var DEFAULT_INSPECTION_DEPENDENCIES = {
129
- inspectMetadata: inspectLock,
130
- inspectGuard: isLockGuardHeld
131
- };
132
- async function inspectOperationAvailability(dependencies = DEFAULT_INSPECTION_DEPENDENCIES) {
133
- try {
134
- const metadata = await dependencies.inspectMetadata();
135
- const guardHeld = await dependencies.inspectGuard();
136
- return classifyOperationAvailability(metadata, guardHeld);
137
- } catch (error) {
138
- return { kind: "inspection-error", message: errorMessage(error) };
139
- }
140
- }
141
- function classifyOperationAvailability(metadata, guardHeld) {
142
- if (metadata.status === "valid" && !isStaleLock(metadata.lock)) {
143
- return { kind: "live", lock: metadata.lock };
144
- }
145
- if (guardHeld) {
146
- return {
147
- kind: "busy",
148
- metadata: metadata.status,
149
- ...metadata.status === "valid" ? { lock: metadata.lock } : {}
150
- };
151
- }
152
- if (metadata.status === "valid") {
153
- return { kind: "recoverable-stale", lock: metadata.lock };
154
- }
155
- if (metadata.status === "unreadable") return { kind: "recoverable-unreadable" };
156
- return { kind: "free" };
157
- }
158
- function operationBlocksChanges(availability) {
159
- return availability.kind !== "free";
160
- }
161
- function operationCanRecover(availability) {
162
- return availability.kind === "recoverable-stale" || availability.kind === "recoverable-unreadable";
163
- }
110
+ import {
111
+ classifyOperationAvailability,
112
+ inspectOperationAvailability,
113
+ operationBlocksChanges,
114
+ operationCanRecover
115
+ } from "@narumitw/sync-daemon/engine/state/operation-availability";
164
116
 
165
117
  // src/ui/manager-attention.ts
166
118
  function attentionMainMenuItems(manager) {
@@ -190,7 +142,7 @@ function blockedSyncMenuItem(label, manager) {
190
142
  };
191
143
  }
192
144
  async function showManagerAttention(ctx, attention, runRoute, signal, onSelectionResolved) {
193
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-MYM2YCPF.ts");
145
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-GZHPDQ4L.ts");
194
146
  if (signal?.aborted) return "close";
195
147
  const review = await showRemoteSelectionReview(ctx, attention.decision.setupName, signal, void 0, {
196
148
  decision: attention.decision,
@@ -500,7 +452,7 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
500
452
  };
501
453
  }
502
454
  const configuredTargets = ownRecord(raw.syncSetups);
503
- if ((raw.version === 3 || raw.version === 4 || raw.version === 5) && configuredTargets && Object.keys(configuredTargets).length === 0) {
455
+ if ((raw.version === 3 || raw.version === 4 || raw.version === 5 || raw.version === 6) && configuredTargets && Object.keys(configuredTargets).length === 0) {
504
456
  return {
505
457
  title: [
506
458
  "Manage sync",
@@ -529,6 +481,7 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
529
481
  if (signal?.aborted) throw signal.reason;
530
482
  }
531
483
  const attentionComparison = currentAttention ? compareSyncInclude(currentAttention.decision.localInclude, currentAttention.decision.remoteInclude) : void 0;
484
+ const attentionExclusionsDiffer = currentAttention ? !sameSyncExclude(currentAttention.decision.localExclude, currentAttention.decision.remoteExclude) : false;
532
485
  const noSyncedContent = config.include.length === 0;
533
486
  const syncState = changesBlocked ? void 0 : await readStateForConfig(config).catch(() => void 0);
534
487
  const currentObservation = observation && observationMatchesConfig(observation, config) && syncState && syncStateFingerprint(syncState) === observation.inspection.stateIdentity ? observation : void 0;
@@ -550,17 +503,17 @@ async function describeManagerState(signal, attention, inspectOperation = inspec
550
503
  ] : [],
551
504
  ...currentAttention ? [
552
505
  currentAttention.decision.setupName === config.setupName ? "Sync status: Review needed" : `Sync status: Review needed for setup ${safeTerminalText(currentAttention.decision.setupName)}`,
553
- attentionComparison?.remoteOnly.length === 0 && attentionComparison.localOnly.length === 0 ? "Only the synced-content order differs." : `Remote-only paths: ${attentionComparison?.remoteOnly.length ?? 0} \xB7 Device-only paths: ${attentionComparison?.localOnly.length ?? 0}`,
506
+ 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." : ""}`,
554
507
  "Nothing has been changed."
555
508
  ] : currentObservation ? [
556
509
  `Startup check (${safeTerminalText(currentObservation.checkedAt)}): ${observationSummary(currentObservation)}`,
557
510
  "Check-time observation only; synchronization rechecks current content."
558
511
  ] : ["Remote status: Not checked"],
559
- `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 ${selection.sessions ? "on" : "off"}`,
512
+ `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"}`,
560
513
  `Automatic sync: ${automaticSyncSummary(config.automatic)}`,
561
514
  `Startup transfer: ${startupTransferSummary(config)}`,
562
515
  `Autonomous sync: ${config.agentMode ? "On (autonomous merged sync)" : "Off"}`,
563
- ...config.continuous ? await (await import("./continuous-record-EPHGR2DU.ts")).continuousStatusLines(config) : [],
516
+ ...config.continuous ? await (await import("./continuous-record-ZHUXVO4E.ts")).continuousStatusLines(config) : [],
564
517
  `Last applied: ${lastAppliedSnapshot}`,
565
518
  ...noSyncedContent ? ["", "No included content is selected. Choose included content in Settings before syncing."] : [],
566
519
  "",
@@ -651,7 +604,17 @@ function backendStorageDescription(config) {
651
604
  }
652
605
 
653
606
  // src/ui/settings-ui.ts
654
- import { defineMenu as defineMenu4, runMenu as runMenu4 } from "@narumitw/pi-tui-kit";
607
+ import { defineMenu as defineMenu5, runMenu as runMenu5 } from "@narumitw/pi-tui-kit";
608
+
609
+ // src/sync/local-fields.ts
610
+ import {
611
+ normalizeLocalFields,
612
+ overlayLocalFields,
613
+ portableSnapshot,
614
+ sameLocalFields,
615
+ validatePortableSnapshot,
616
+ validateSnapshotFieldPolicy
617
+ } from "@narumitw/sync-daemon/engine/sync/local-fields";
655
618
 
656
619
  // src/ui/agent-mode-setting.ts
657
620
  import { isDeepStrictEqual } from "node:util";
@@ -713,6 +676,105 @@ async function saveAgentMode(ctx, setupName, enabled, signal, preference = "agen
713
676
  return true;
714
677
  }
715
678
 
679
+ // src/ui/excluded-paths-ui.ts
680
+ import { defineMenu as defineMenu2, runMenu as runMenu2 } from "@narumitw/pi-tui-kit";
681
+ async function showExcludedPaths(ctx, setupName, signal) {
682
+ const validate = captureMutationOwner(ctx, signal);
683
+ const isCurrent = () => {
684
+ try {
685
+ validate();
686
+ return true;
687
+ } catch {
688
+ return false;
689
+ }
690
+ };
691
+ validate();
692
+ const config = await loadConfig(setupName);
693
+ validate();
694
+ if (ctx.mode !== "tui") {
695
+ if (ctx.hasUI)
696
+ ctx.ui.notify(
697
+ [
698
+ `Excluded paths: ${(config.exclude ?? []).map(safeTerminalText).join(", ") || "none"}`,
699
+ `Edit sync.exclude in ${safeTerminalText(localConfigPath())}; an explicit array requires settings version 6.`
700
+ ].join("\n"),
701
+ "info"
702
+ );
703
+ return;
704
+ }
705
+ let draft = JSON.stringify(config.exclude ?? []);
706
+ while (isCurrent()) {
707
+ const entered = await ctx.ui.input("Excluded paths \xB7 JSON array \xB7 empty input keeps draft", draft, { signal });
708
+ if (!isCurrent() || entered === void 0) return;
709
+ const input = entered || draft;
710
+ draft = input;
711
+ let exclude;
712
+ try {
713
+ const parsed = JSON.parse(input);
714
+ if (!Array.isArray(parsed)) throw new Error("Enter a JSON string array.");
715
+ exclude = normalizeSyncExclude(parsed);
716
+ } catch {
717
+ ctx.ui.notify("Invalid exclude array or unsupported pattern. No settings changed.", "error");
718
+ continue;
719
+ }
720
+ if (sameSyncExclude(exclude, config.exclude)) return;
721
+ let choice;
722
+ const menu = defineMenu2({
723
+ start: "review",
724
+ screens: {
725
+ review: () => ({
726
+ kind: "actions",
727
+ title: "Review excluded paths",
728
+ lines: [
729
+ `Setup: ${safeTerminalText(config.setupName)}`,
730
+ "Draft only. Save opts into settings version 6 / snapshot version 4; older clients must refuse them.",
731
+ "Excluded local files stay untouched. New snapshots omit matching remote files; old history is NOT erased.",
732
+ "Removing rules can expose local content or allow pull to replace it. Review a force push to publish policy changes.",
733
+ "Previously excluded:",
734
+ ...config.exclude?.length ? config.exclude.map((rule) => `- ${safeTerminalText(rule)}`) : ["(none)"],
735
+ "Proposed excluded paths:",
736
+ ...exclude.length ? exclude.map((rule) => `+ ${safeTerminalText(rule)}`) : ["(none)"]
737
+ ],
738
+ items: [
739
+ { id: "save", label: "Save changes", action: "choose" },
740
+ { id: "discard", label: "Discard changes", action: "choose" },
741
+ { id: "edit", label: "Continue editing", action: "choose" }
742
+ ],
743
+ hint: "close"
744
+ })
745
+ },
746
+ actions: {
747
+ choose: async ({ itemId }) => {
748
+ choice = itemId === "save" ? "save" : itemId === "edit" ? "edit" : "discard";
749
+ return { kind: "close" };
750
+ }
751
+ }
752
+ });
753
+ await runMenu2(ctx, menu, { getState: () => void 0, signal, isCurrent });
754
+ if (!isCurrent()) return;
755
+ if (choice === "edit") continue;
756
+ if (choice !== "save") return;
757
+ try {
758
+ await updateSyncSetup(
759
+ setupName,
760
+ (setup) => {
761
+ validate();
762
+ return { ...setup, sync: { ...setup.sync, exclude } };
763
+ },
764
+ { expectedConfigFingerprint: syncCheckConfigFingerprint(config), upgradeExclude: true, signal }
765
+ );
766
+ if (isCurrent()) ctx.ui.notify("Excluded paths saved. Applies to subsequent sync; no transfer started.", "info");
767
+ } catch (error) {
768
+ if (isCurrent())
769
+ ctx.ui.notify(
770
+ `Excluded paths not saved: ${safeTerminalText(error instanceof Error ? error.message : String(error))}`,
771
+ "error"
772
+ );
773
+ }
774
+ return;
775
+ }
776
+ }
777
+
716
778
  // src/ui/settings-frame.ts
717
779
  import { stripVTControlCharacters } from "node:util";
718
780
  function boundedSettingsUI(ctx) {
@@ -759,11 +821,11 @@ function boundedSettingsUI(ctx) {
759
821
 
760
822
  // src/ui/storage-connections-ui.ts
761
823
  import { isDeepStrictEqual as isDeepStrictEqual2 } from "node:util";
762
- import { defineMenu as defineMenu2, runMenu as runMenu2 } from "@narumitw/pi-tui-kit";
824
+ import { defineMenu as defineMenu3, runMenu as runMenu3 } from "@narumitw/pi-tui-kit";
763
825
  async function showStorageConnections(ctx, signal) {
764
826
  let selectedName;
765
827
  const nameById = /* @__PURE__ */ new Map();
766
- const menu = defineMenu2({
828
+ const menu = defineMenu3({
767
829
  start: "list",
768
830
  screens: {
769
831
  list: ({ state }) => {
@@ -856,7 +918,7 @@ async function showStorageConnections(ctx, signal) {
856
918
  }
857
919
  }
858
920
  });
859
- await runMenu2(ctx, menu, {
921
+ await runMenu3(ctx, menu, {
860
922
  getState: () => loadStorageMenuState(selectedName, signal),
861
923
  signal,
862
924
  isCurrent: () => !signal?.aborted
@@ -869,14 +931,14 @@ async function loadStorageMenuState(selectedName, signal) {
869
931
  const profile = selectedName ? ownRecord(profiles[selectedName]) : void 0;
870
932
  if (!selectedName || !profile) {
871
933
  return {
872
- supportedVersion: raw?.version === 3 || raw?.version === 4 || raw?.version === 5,
934
+ supportedVersion: raw?.version === 3 || raw?.version === 4 || raw?.version === 5 || raw?.version === 6,
873
935
  profiles,
874
936
  selected: void 0
875
937
  };
876
938
  }
877
939
  const usedBy = referencingSetups(raw, selectedName);
878
940
  return {
879
- supportedVersion: raw?.version === 3 || raw?.version === 4 || raw?.version === 5,
941
+ supportedVersion: raw?.version === 3 || raw?.version === 4 || raw?.version === 5 || raw?.version === 6,
880
942
  profiles,
881
943
  selected: {
882
944
  name: selectedName,
@@ -1072,12 +1134,12 @@ function credentialSource(profile) {
1072
1134
  }
1073
1135
 
1074
1136
  // src/ui/setup/setup-switcher.ts
1075
- import { defineMenu as defineMenu3, runMenu as runMenu3 } from "@narumitw/pi-tui-kit";
1137
+ import { defineMenu as defineMenu4, runMenu as runMenu4 } from "@narumitw/pi-tui-kit";
1076
1138
  async function selectSetupForSwitch(ctx, raw, targets, active, signal) {
1077
1139
  let selectedName;
1078
1140
  const nameById = /* @__PURE__ */ new Map();
1079
1141
  const profiles = ownRecord(raw.storageConnections);
1080
- const menu = defineMenu3({
1142
+ const menu = defineMenu4({
1081
1143
  start: "setups",
1082
1144
  screens: {
1083
1145
  setups: () => ({
@@ -1109,7 +1171,7 @@ async function selectSetupForSwitch(ctx, raw, targets, active, signal) {
1109
1171
  }
1110
1172
  }
1111
1173
  });
1112
- await runMenu3(ctx, menu, {
1174
+ await runMenu4(ctx, menu, {
1113
1175
  getState: () => void 0,
1114
1176
  signal,
1115
1177
  isCurrent: () => !signal?.aborted
@@ -1119,7 +1181,7 @@ async function selectSetupForSwitch(ctx, raw, targets, active, signal) {
1119
1181
  async function showSetupSwitcher(ctx, runRoute, selectedName, signal) {
1120
1182
  const raw = await readLocalConfigObject();
1121
1183
  if (signal?.aborted) return false;
1122
- if (raw?.version !== 3 && raw?.version !== 4 && raw?.version !== 5) {
1184
+ if (raw?.version !== 3 && raw?.version !== 4 && raw?.version !== 5 && raw?.version !== 6) {
1123
1185
  ctx.ui.notify("Add a second sync setup before switching setups.", "info");
1124
1186
  return false;
1125
1187
  }
@@ -1163,7 +1225,7 @@ async function showSetupSwitcher(ctx, runRoute, selectedName, signal) {
1163
1225
  `To: ${safeTerminalText(name)}`,
1164
1226
  `Storage: ${backendStorageDescription(config)}`,
1165
1227
  `Included content: ${config.include.length} paths`,
1166
- `Automatic sync: ${automaticSyncSummary(config.automatic)} \xB7 Sessions: ${config.include.includes("sessions") ? "On" : "Off"}`,
1228
+ `Automatic sync: ${automaticSyncSummary(config.automatic)} \xB7 Sessions: ${syncSessionsSelected(config) ? "On" : "Off"}`,
1167
1229
  `Automatic transfer at startup: ${config.automaticTransfer ? "On \u2014 may upload, replace, or delete selected files; no reload" : "Off"}`,
1168
1230
  `Autonomous sync: ${config.agentMode ? "On (autonomous merged sync)" : "Off"}`,
1169
1231
  `Continuous sync: ${config.continuous ? config.agentMode ? "On (recurring requests and transfers)" : "Saved On; paused until Autonomous sync is enabled" : "Off"}`,
@@ -1241,7 +1303,7 @@ async function showAddTarget(ctx, signal) {
1241
1303
  let raw = await readLocalConfigObject();
1242
1304
  if (signal?.aborted) return;
1243
1305
  if (!raw) return void ctx.ui.notify("Set up the first sync setup before adding another.", "info");
1244
- if (raw.version !== 3 && raw.version !== 4 && raw.version !== 5) {
1306
+ if (raw.version !== 3 && raw.version !== 4 && raw.version !== 5 && raw.version !== 6) {
1245
1307
  ctx.ui.notify("Version 1 and version 2 settings are unsupported and are never migrated.", "error");
1246
1308
  return;
1247
1309
  }
@@ -1325,7 +1387,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1325
1387
  if (ctx.mode !== "tui") {
1326
1388
  ctx.ui.notify(`Edit pi-sync settings manually: ${safeTerminalText(localConfigPath())}`, "info");
1327
1389
  if (ctx.mode === "rpc" && ctx.hasUI) {
1328
- const management = defineMenu4({
1390
+ const management = defineMenu5({
1329
1391
  start: "management",
1330
1392
  screens: {
1331
1393
  management: () => ({
@@ -1349,7 +1411,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1349
1411
  }
1350
1412
  }
1351
1413
  });
1352
- await runMenu4(ctx, management, { getState: () => void 0, signal, isCurrent: () => !signal?.aborted });
1414
+ await runMenu5(ctx, management, { getState: () => void 0, signal, isCurrent: () => !signal?.aborted });
1353
1415
  }
1354
1416
  return disposition;
1355
1417
  }
@@ -1357,7 +1419,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1357
1419
  if (signal?.aborted) return "back";
1358
1420
  const setupName = initial.setupName;
1359
1421
  let saveStatus = "Simple choices save immediately. Back does not undo saved changes.";
1360
- const menu = defineMenu4({
1422
+ const menu = defineMenu5({
1361
1423
  start: "settings",
1362
1424
  screens: {
1363
1425
  settings: ({ state }) => ({
@@ -1375,10 +1437,17 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1375
1437
  currentValue: `${state.include.length} paths \xB7 Edit`,
1376
1438
  action: "include"
1377
1439
  },
1440
+ {
1441
+ id: "exclude",
1442
+ label: "Excluded paths",
1443
+ description: "This setup: draft relative paths or *, ?, ** patterns, then review Save/Discard. No transfer starts; old history is retained.",
1444
+ currentValue: `${state.exclude?.length ?? 0} rules \xB7 Edit`,
1445
+ action: "exclude"
1446
+ },
1378
1447
  {
1379
1448
  id: "remoteInclude",
1380
1449
  label: "Compare included paths",
1381
- description: "This setup: compare included-path policies, not file contents. Review before saving either list; no files transfer unless you explicitly Continue.",
1450
+ description: "This setup: compare include and exclude policies, not file contents. Review before saving both lists; no files transfer unless you explicitly Continue.",
1382
1451
  currentValue: "Review",
1383
1452
  action: "remote-include"
1384
1453
  },
@@ -1519,7 +1588,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1519
1588
  const partialSync = value === "Partial only" || value === "Merge + partial";
1520
1589
  if (!await ctx.ui.confirm(
1521
1590
  "Save content policy?",
1522
- "This explicitly upgrades settings to version 5; partial snapshots use version 3 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.",
1591
+ "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.",
1523
1592
  { signal: mutationSignal }
1524
1593
  ))
1525
1594
  return { kind: "rejected" };
@@ -1532,7 +1601,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1532
1601
  throw new Error("Content policy changed during review.");
1533
1602
  return {
1534
1603
  ...current,
1535
- version: 5,
1604
+ version: current.version === 6 ? 6 : 5,
1536
1605
  syncSetups: {
1537
1606
  ...current.syncSetups,
1538
1607
  [setupName]: { ...setup, sync: { ...setup.sync, mergeContent, partialSync } }
@@ -1587,7 +1656,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1587
1656
  if (sameLocalFields(previous.localFields, fields)) return { kind: "stay" };
1588
1657
  const confirmed = await ctx.ui.confirm(
1589
1658
  "Save portable field policy?",
1590
- "This opts into settings/snapshot version 4/2; older clients must refuse them. 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.",
1659
+ "This opts into at least settings/snapshot version 4/2; exclude-enabled setups retain 6/4. Older clients must refuse them. 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.",
1591
1660
  { signal: mutationSignal }
1592
1661
  );
1593
1662
  validate();
@@ -1600,7 +1669,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1600
1669
  throw new Error("Field policy changed while under review; reopen settings.");
1601
1670
  return {
1602
1671
  ...current,
1603
- version: current.version === 5 ? 5 : 4,
1672
+ version: current.version >= 5 ? current.version : 4,
1604
1673
  syncSetups: {
1605
1674
  ...current.syncSetups,
1606
1675
  [setupName]: { ...setup, sync: { ...setup.sync, localFields: fields } }
@@ -1772,9 +1841,14 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1772
1841
  await runRoute("files", editorSignal, void 0, setupName);
1773
1842
  return editorSignal.aborted ? { kind: "rejected" } : { kind: "stay" };
1774
1843
  },
1844
+ exclude: async ({ signal: actionSignal }) => {
1845
+ const editorSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
1846
+ await showExcludedPaths(ctx, setupName, editorSignal);
1847
+ return resumeSettings(editorSignal);
1848
+ },
1775
1849
  "remote-include": async ({ signal: actionSignal }) => {
1776
1850
  const reviewSignal = signal ? AbortSignal.any([signal, actionSignal]) : actionSignal;
1777
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-MYM2YCPF.ts");
1851
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-GZHPDQ4L.ts");
1778
1852
  if (reviewSignal.aborted) return { kind: "rejected" };
1779
1853
  const review = await showRemoteSelectionReview(ctx, setupName, reviewSignal, void 0, {
1780
1854
  origin: "settings",
@@ -1821,7 +1895,7 @@ async function showSyncSettings(ctx, runRoute, signal, reviewedSetup) {
1821
1895
  return { kind: "close" };
1822
1896
  }
1823
1897
  }
1824
- await runMenu4({ ...ctx, ui: boundedSettingsUI(ctx) }, menu, {
1898
+ await runMenu5({ ...ctx, ui: boundedSettingsUI(ctx) }, menu, {
1825
1899
  getState: () => loadConfig(setupName),
1826
1900
  signal,
1827
1901
  isCurrent: () => !signal?.aborted
@@ -1850,7 +1924,7 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
1850
1924
  return false;
1851
1925
  }
1852
1926
  };
1853
- const menu = defineMenu5({
1927
+ const menu = defineMenu6({
1854
1928
  start: "main",
1855
1929
  screens: {
1856
1930
  main: ({ state }) => {
@@ -1879,7 +1953,7 @@ async function showSyncManager(ctx, runRoute, sessionSignal, options = {}) {
1879
1953
  if (!attention) {
1880
1954
  const observation = state.manager.observation;
1881
1955
  if (!observation) return { kind: "stay" };
1882
- const { showRemoteSelectionReview } = await import("./remote-selection-ui-MYM2YCPF.ts");
1956
+ const { showRemoteSelectionReview } = await import("./remote-selection-ui-GZHPDQ4L.ts");
1883
1957
  if (sessionSignal?.aborted) return { kind: "close" };
1884
1958
  const config = await loadConfig();
1885
1959
  if (sessionSignal?.aborted) return { kind: "close" };
@@ -2107,7 +2181,7 @@ S3/R2 reads the latest pointer without writing. Git reads remote snapshots and c
2107
2181
  }, customOptions)
2108
2182
  }
2109
2183
  };
2110
- await runMenu5(menuContext, menu, {
2184
+ await runMenu6(menuContext, menu, {
2111
2185
  getState: async () => {
2112
2186
  const pendingAttention = options.getAttention?.();
2113
2187
  const observation = options.getObservation?.();
@@ -2158,4 +2232,4 @@ function syncMainMenuItem(label) {
2158
2232
  export {
2159
2233
  showSyncManager
2160
2234
  };
2161
- //# sourceMappingURL=manager-ui-AY34N4UY.ts.map
2235
+ //# sourceMappingURL=manager-ui-SJOBTJLY.ts.map