@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
@@ -9,7 +9,9 @@ The configuration skill provides guidance only; the user performs settings chang
9
9
  - [Secret scanning](#secret-scanning)
10
10
  - [Autonomous sync](#autonomous-sync)
11
11
  - [Continuous sync](#continuous-sync)
12
+ - [Daemon lifetime and unattended permission](#daemon-lifetime-and-unattended-permission)
12
13
  - [Included content](#included-content)
14
+ - [Excluded paths](#excluded-paths)
13
15
  - [Unsupported old settings and recovery](#unsupported-old-settings-and-recovery)
14
16
 
15
17
  ## ⚙️ Settings
@@ -46,15 +48,16 @@ Global settings apply to all setups on this device; they are not remote policy.
46
48
 
47
49
  | Scope | Fields | Required values and defaults |
48
50
  | --- | --- | --- |
49
- | Document | `version`, `onSwitch`, `storageConnections`, `syncSetups` | All are required in a manually written document; supported versions are 3, 4, and 5. |
51
+ | Document | `version`, `onSwitch`, `storageConnections`, `syncSetups` | All are required in a manually written document; supported versions are 3, 4, 5, and 6. |
50
52
  | Current setup | `activeSyncSetup` | Required when setups exist; absent when the setup catalog is empty. |
51
53
  | Global preferences | `skipSecretScan`, `showStatus`, `debug` | Optional booleans; defaults are false, true, and false. |
52
54
  | Setup selection | `sync.include`, `sync.automatic` | Both are required; the manager starts with automatic sync Off. |
53
55
  | Setup behavior | `sync.automaticTransfer`, `sync.agentMode`, `sync.continuous`, `sync.mergeSettings`, `sync.mergeContent`, `sync.partialSync` | Optional booleans; all default to false. |
54
- | Portable policy | `sync.localFields` | Optional array; any explicit array, including `[]`, requires version 4 or 5. |
55
- | Content/partial policy | `sync.mergeContent`, `sync.partialSync` | Enabling either requires version 5. |
56
+ | Portable policy | `sync.localFields` | Optional array; any explicit array, including `[]`, requires version 4, 5, or 6. |
57
+ | Content/partial policy | `sync.mergeContent`, `sync.partialSync` | Enabling either requires version 5 or 6. |
58
+ | Path exclusions | `sync.exclude` | Optional array; an explicit array, including `[]`, requires version 6. |
56
59
 
57
- Do not downgrade version 4 or 5 merely because an option is turned off.
60
+ Do not downgrade version 4, 5, or 6 merely because an option is turned off.
58
61
  The four automatic controls have separate effects:
59
62
 
60
63
  - **Automatic sync** (`sync.automatic`) enables startup observation and selected-content shutdown pushes when sessions are included.
@@ -67,8 +70,8 @@ None of these controls is enabled by invoking the configuration skill.
67
70
  ### Editing in the manager
68
71
 
69
72
  Open `/sync` → **Settings** to go directly to **Pi Sync Settings**.
70
- The screen has one searchable flat list with all 16 rows in their existing order and no category navigation or headings.
71
- **Included paths** and **Compare included paths** are adjacent; the latter compares path policies, not file contents.
73
+ The screen has one searchable flat list with 17 rows and no category navigation or headings.
74
+ **Included paths**, **Excluded paths**, and **Compare included paths** keep content policy together; comparison covers both rule lists, not file contents.
72
75
  **Storage location** edits the current setup's coordinates, while **Manage sync setups** and **Manage storage connections** retain the catalog and affected-setup reviews.
73
76
  Returning from catalog management refreshes the rows; switching or removing the owning setup closes its old Settings screen.
74
77
 
@@ -189,7 +192,7 @@ Automatic sync alone does not perform startup transfers or open dialogs; review
189
192
  Print/JSON skip startup checks.
190
193
  Checks compare local hashes and remote metadata against the last sync baseline, so revision changes and missing baselines require review rather than proving a file conflict.
191
194
 
192
- The setting still permits automatic shutdown pushes of selected content when `sessions` is included, in all modes; this is not limited to uploading session files.
195
+ The setting still permits automatic shutdown pushes of selected content when `sessions` is included; this is not limited to uploading session files. Print/JSON require an already running, reviewed service and never launch one for shutdown.
193
196
  Reload skips shutdown push.
194
197
  Settings changes apply to subsequent operations; changing this setting does not schedule another startup check until the next session start.
195
198
  Foreground `/sync` cancels a pending check before opening Settings.
@@ -316,7 +319,8 @@ This preserves selected-but-missing paths without syncing `pi-sync.json`, storag
316
319
  Adoption revalidates the remote head, immutable snapshot, and complete reviewed setup configuration, including the shared connection and credentials, before one atomic settings update.
317
320
  Cancelling the network check leaves the content list unchanged.
318
321
  A settings save that has started its atomic replacement can still finish; later cancellation does not undo it.
319
- The saved state changes only `sync.include`, preserves unknown settings fields, and never pulls files or writes sync state.
322
+ The saved state changes `sync.include` and exclusion rules together, preserves unknown settings fields, and never pulls files or writes sync state.
323
+ Adopting an explicit remote exclude policy also reviews the version-6 upgrade; adopting a legacy no-exclude list clears existing rules to `[]` without downgrading.
320
324
  Its explicit Continue action starts a fresh **Sync now** route, while **Done** leaves the reviewed settings change saved without implying a file operation.
321
325
  Keeping this device's list opens the reviewed force-push path and explicitly replaces the remote policy while preserving eligible unmanaged remote files.
322
326
 
@@ -331,6 +335,59 @@ Adding `sessions` requires a privacy acknowledgement in interactive flows.
331
335
  Session JSONL can contain prompts, tool output, file paths, images, and secrets.
332
336
  Pull protects the currently open session file; restart Pi or resume a pulled session to use newly synchronized conversations.
333
337
 
338
+ ### Excluded paths
339
+
340
+ `sync.exclude` is an optional per-setup array of relative paths or basic glob patterns; absence means no rules.
341
+ An explicit array requires settings version 6 and publishes snapshot version 4 with selection policy version 2.
342
+ Other setups without an explicit array keep their existing snapshot format.
343
+ New clients still read old settings and snapshots; older clients must refuse the opted-in formats.
344
+
345
+ For an existing setup in a version-6 document, the `sync` object can contain:
346
+
347
+ ```json
348
+ {
349
+ "include": ["settings.json", "skills", "extensions"],
350
+ "exclude": ["skills/private", "extensions/**/*.test.ts"],
351
+ "automatic": false
352
+ }
353
+ ```
354
+
355
+ Rules win over includes and are anchored to the logical snapshot root, with `/` separators on every platform.
356
+ Literal paths match themselves and their descendants; `skills/private` does not match `skills/private-copy`.
357
+ `*` and `?` match within one segment; whole-segment `**` matches zero or more segments.
358
+ A matching directory excludes its whole subtree, including hidden files.
359
+ Matching is case-insensitive, includes dotfiles, and combines rules with OR, independent of rule order.
360
+ Use `**/*.log` for a filename pattern at any depth; `*.log` matches only at the root.
361
+ Sessions use virtual `sessions/...` paths even when stored in a custom physical directory.
362
+ A trailing `/**` also excludes its root; excluding `sessions` or `sessions/**` disables the legacy sessions-enabled shutdown push before state/backend work.
363
+
364
+ Negation/re-inclusion, comments, braces, character classes, extglobs, absolute/drive/UNC paths, traversal, backslashes, controls, empty rules, and case-equivalent duplicates are rejected.
365
+ The limits are 1,024 rules, 4,096 UTF-8 bytes per rule, and 256 KiB total.
366
+ Overlapping rules and rules for currently absent or unselected paths are allowed.
367
+ This syntax is not Git ignore compatibility and does not load an ignore file.
368
+
369
+ **Settings → Excluded paths** uses a JSON-array draft and an exact **Save changes**, **Discard changes**, or **Continue editing** review.
370
+ Empty input keeps the current draft; `[]` clears rules.
371
+ Only Save writes settings and upgrades to version 6; cancelling or a stale/failed save leaves the previous valid settings intact.
372
+ Changes apply to subsequent operations and do not start a transfer.
373
+ The canonical user file is the only scope; no project override or environment-variable mirror is added.
374
+ RPC remains read-only and shows the manual settings path.
375
+
376
+ Collection skips excluded content before reading its bytes and prunes excluded directories.
377
+ Pi's own session-directory configuration may still need to be read to resolve a session root; exclusions do not replace Pi configuration resolution.
378
+ Push, pull, merged/automatic sync, previews, rollback, accepted hashes, conflict/model evidence, and watcher hints honor the same rules.
379
+ Excluded local files are not overwritten or deleted; ancestor replacements that would remove excluded descendants are refused.
380
+ New publications omit matching remote files even if those files were previously preserved, while other unselected remote content retains its preservation behavior.
381
+ Old history and backups are **not erased**.
382
+
383
+ Comparison and adoption include both lists, even when no matching file exists.
384
+ Ordinary and automatic transfers, including forced pull, pause on a remote-policy difference.
385
+ Review the rules and use the existing confirmed force push to publish this device's authoritative policy.
386
+ Removing a rule can expose local content or permit remote replacement.
387
+ Clearing rules retains `[]` and the newer versions; never downgrade in place.
388
+ A pending transaction or merge journal under different rules remains available for reviewed recovery rather than replaying old writes.
389
+ To return to an older client, stop automatic work, resolve pending recovery with a compatible client, preserve backups, and create a separate reviewed legacy-compatible setup/location.
390
+
334
391
  ### Automatic startup transfer
335
392
 
336
393
  `sync.automaticTransfer` is optional and accepts only a boolean; absent means `false`.
@@ -366,7 +423,7 @@ Unknown fields remain preserved and malformed/invalid files block saves, just as
366
423
 
367
424
  ### Autonomous sync
368
425
 
369
- Autonomous sync uses the unchanged `sync.agentMode` key, an optional per-setup boolean, default `false`, in settings versions 3, 4, and 5.
426
+ Autonomous sync uses the unchanged `sync.agentMode` key, an optional per-setup boolean, default `false`, in settings versions 3, 4, 5, and 6.
370
427
  Open **Settings → Autonomous sync** and review the setup, destination, selected paths, transfer authorization, model disclosure, costs, and autonomous writes before enabling.
371
428
  RPC users can explicitly set the same field in the private settings file.
372
429
  Setting it to `true` is authorization, not just a display preference.
@@ -465,15 +522,27 @@ No Pi core changes or other extension are required.
465
522
 
466
523
  <a id="experimental-continuous-sync"></a>
467
524
 
525
+ ### Daemon lifetime and unattended permission
526
+
527
+ Pi starts or connects to the `sync-daemon` service from `@narumitw/sync-daemon` only for configured interactive work or an explicit setup/command. The service is a normal dependency, not another Pi extension. Unconfigured reads create no service or settings. Closing Pi releases its tasks, not the daemon; no OS service is installed.
528
+
529
+ Before the first daemon-owned mutation, close or upgrade older Pi processes and review `/sync daemon handover`. An absent lock does not prove that an idle older process is absent. Settings and existing state/snapshot formats remain authoritative in the same locations; Pi proposes settings changes and the daemon serializes their publication.
530
+
531
+ Existing Automatic, Autonomous, and Continuous consent does not authorize zero-client work. `/sync daemon allow-after-exit` requires Autonomous and Continuous to be enabled, then separately reviews the setup, selected private content, recurring costs, and independently available provider/model. `/sync daemon revoke-after-exit` stops new unattended work. Setup changes invalidate the saved digest. Changing an interactive client’s model, working directory, or session-directory binding revokes older unattended grants; reverting that binding does not restore them. Reopen the review to grant permission again.
532
+
533
+ The standalone model host uses the agent-root `auth.json`/`models.json` through public Pi SDK APIs and the environment captured at service launch. Credential commands run non-interactively from the canonical agent root. Parent-only providers/accounts and runtime keys are not copied; unavailable capabilities retain conflicts rather than selecting a fallback. Restart after changing the service environment. Neither the parent conversation nor its tools are sent to the resolver.
534
+
535
+ A failed consent write blocks automatic work in that service instance. Repair persistence and revoke permission before an explicit restart; do not assume a failed write changed the retained consent file. `stop` and `restart` drain compatible work and never replace an uncertain or incompatible live owner silently. See [migration, diagnostics, and rollback](https://github.com/narumiruna/pi-extensions/blob/main/packages/pi-sync/docs/daemon-migration.md).
536
+
468
537
  ### Continuous sync
469
538
 
470
- `sync.continuous` is an optional per-setup boolean, default `false`, in settings versions 3, 4 and 5.
539
+ `sync.continuous` is an optional per-setup boolean, default `false`, in settings versions 3, 4, 5 and 6.
471
540
  Open **Settings → Continuous sync** after enabling Autonomous sync.
472
541
  RPC users can set the field explicitly in the private settings file.
473
542
  Existing Autonomous sync consent does not enable recurring requests.
474
543
 
475
544
  The separate review names the setup, storage connection, destination, included paths, recurring costs and automatic writes.
476
- An elected idle session uses its selected Pi model; a different session can use a different provider/model.
545
+ The service uses the participating idle clients’ matching independently reproducible model binding; differing bindings pause automatic work.
477
546
  The save uses the existing atomic settings writer.
478
547
  Cancellation after the final publication check cannot undo a committed save.
479
548
  Reopen Settings to read the saved value.
@@ -487,13 +556,13 @@ Turning Autonomous sync off also stops monitoring; a saved Continuous sync On va
487
556
 
488
557
  A control-file change during monitoring is detected by a watcher or the five-second local control check.
489
558
  If monitoring is already off, external enablement requires the next session start or a foreground `/sync` command.
490
- Print/JSON create no continuous resources.
491
- No daemon remains after Pi exits.
559
+ Print/JSON do not launch a service. If one already exists, they attach passive session facts and pause its automatic work until that client leaves.
560
+ The service survives ordinary Pi exit; work with zero clients needs the separate permission below.
492
561
 
493
562
  Upgrade all Pi processes sharing an agent directory before enabling Continuous sync.
494
563
  Older releases do not implement its election or automatic accounting.
495
- One scheduler lease coordinates participating sessions/processes sharing the same canonical agent directory.
496
- Standbys only check local eligibility/ownership; they do not duplicate remote polling, watchers or inference.
564
+ One detached service coordinates participating clients sharing the same canonical agent directory and reuses the engine’s scheduler lease, watchers, and request accounting.
565
+ Clients do not run a second transfer scheduler.
497
566
  Each computer has a separate scheduler.
498
567
  Remote conditional publication and revision checks remain authoritative across computers.
499
568
  The lease does not exclude arbitrary editors or writers in other Pi processes.
@@ -601,9 +670,11 @@ Field merging and nonempty portable projections also refuse unsafe integers, non
601
670
  Example: `"localFields": ["shellPath"]`.
602
671
  Coupled fields must be excluded together.
603
672
  Nonempty rules require `settings.json` in `sync.include`; absent or explicitly empty rules remain valid for other selections.
604
- Saving nonempty rules in Settings confirms an upgrade to settings version 4; manual edits must declare version 4 too.
673
+ Saving nonempty rules in Settings confirms an upgrade to at least settings version 4; manual edits must declare version 4 or newer.
674
+ Existing version-5/6 settings are never downgraded by a field-policy edit.
605
675
  Absent rules keep a setup nonportable, including unrelated setups in a version-4 document.
606
- An explicit array opts that setup into snapshot version 2; `[]` after rule removal retains this reviewed opt-in and differs from absence.
676
+ An explicit array opts that setup into at least snapshot version 2; exclude-enabled setups retain version 4.
677
+ `[]` after rule removal retains this reviewed opt-in and differs from absence.
607
678
  Older clients must refuse portable data rather than replace local-only values.
608
679
 
609
680
  Portable projections normalize remote JSON deterministically while local overlay preserves unaffected local member/value bytes and excluded values or absence.
@@ -640,8 +711,9 @@ Never reinterpret portable snapshots with an old binary.
640
711
  ### Content merge and partial progress
641
712
 
642
713
  `sync.mergeContent` and `sync.partialSync` are independent opt-in booleans, both default `false`.
643
- The owning **Settings → Content merge / partial progress** setting offers Off, Merge only, Merge + partial, and Partial only and confirms an explicit settings-version-5 upgrade.
644
- Manual configuration must also declare version 5.
714
+ The owning **Settings → Content merge / partial progress** setting offers Off, Merge only, Merge + partial, and Partial only and confirms an explicit upgrade to at least settings version 5.
715
+ Manual configuration must also declare version 5 or 6.
716
+ Exclude-enabled partial publications retain snapshot version 4 instead of downgrading to version 3.
645
717
  Settings version 5 retains the portable-policy behavior of version 4; moving from a legacy setup can require the existing separately confirmed directional policy migration.
646
718
  Disabling options retains the schema and recovery evidence.
647
719
 
@@ -1,23 +1,2 @@
1
- import type { AnySyncConfig } from "../settings/settings-types.js";
2
- import type { SyncBackend } from "./sync-backend.js";
3
-
4
- export type SyncBackendFactory = {
5
- bivarianceHack(config: AnySyncConfig): SyncBackend | Promise<SyncBackend>;
6
- }["bivarianceHack"];
7
-
8
- export const createSyncBackend: SyncBackendFactory = async (config) => {
9
- switch (config.backend.type) {
10
- case "s3": {
11
- const { S3SyncBackend } = await import("./s3/s3-backend.js");
12
- return new S3SyncBackend(config.backend);
13
- }
14
- case "webdav": {
15
- const { WebDavSyncBackend } = await import("./webdav/webdav-backend.js");
16
- return new WebDavSyncBackend(config.backend);
17
- }
18
- case "git": {
19
- const { GitSyncBackend } = await import("./git/git-backend.js");
20
- return new GitSyncBackend(config.backend);
21
- }
22
- }
23
- };
1
+ export type * from "@narumitw/sync-daemon/engine/backends/backend-factory";
2
+ export { createSyncBackend } from "@narumitw/sync-daemon/engine/backends/backend-factory";
@@ -1,40 +1,5 @@
1
- import type { AnySyncConfig } from "../settings/settings-types.js";
2
- import { normalizeGitRemoteIdentity } from "./git/git-config.js";
3
- import { normalizeWebDavIdentityUrl } from "./webdav/webdav-config.js";
4
-
5
- export function backendIdentityCoordinates(config: AnySyncConfig) {
6
- switch (config.backend.type) {
7
- case "s3":
8
- return JSON.stringify([
9
- "s3",
10
- normalizeEndpointIdentity(config.backend.profile.endpoint),
11
- config.backend.destination.bucket,
12
- config.storagePath,
13
- ]);
14
- case "git":
15
- return JSON.stringify([
16
- "git",
17
- normalizeGitRemoteIdentity(config.backend.profile.remote),
18
- config.backend.destination.branch,
19
- config.storagePath,
20
- ]);
21
- case "webdav":
22
- return JSON.stringify([
23
- "webdav",
24
- normalizeWebDavIdentityUrl(config.backend.profile.url),
25
- config.backend.profile.username,
26
- config.storagePath,
27
- ]);
28
- }
29
- }
30
-
31
- export function normalizeEndpointIdentity(endpoint: string) {
32
- try {
33
- const url = new URL(endpoint.trim());
34
- url.hostname = url.hostname.toLowerCase();
35
- url.pathname = url.pathname.replace(/\/+$/gu, "");
36
- return url.toString().replace(/\/$/u, "");
37
- } catch {
38
- return endpoint.trim();
39
- }
40
- }
1
+ export type * from "@narumitw/sync-daemon/engine/backends/backend-identity";
2
+ export {
3
+ backendIdentityCoordinates,
4
+ normalizeEndpointIdentity,
5
+ } from "@narumitw/sync-daemon/engine/backends/backend-identity";
@@ -1,81 +1 @@
1
- import type { SnapshotSelection } from "../snapshot/snapshot-types.js";
2
- /** Backend-only resolved S3 connection fields. */
3
- export interface ResolvedS3StorageProfile {
4
- kind: "r2" | "s3-compatible";
5
- endpoint: string;
6
- region: string;
7
- accessKeyId: string;
8
- secretAccessKey: string;
9
- sessionToken?: string;
10
- }
11
-
12
- /** Backend-only coordinates. `prefix` is the complete reviewed v3 storage path. */
13
- export interface ResolvedS3Destination {
14
- bucket: string;
15
- prefix: string;
16
- /** Snapshot/wire identity; never derived from the local setup name. */
17
- namespace: string;
18
- }
19
-
20
- export interface ResolvedS3Backend {
21
- type: "s3";
22
- profile: ResolvedS3StorageProfile;
23
- destination: ResolvedS3Destination;
24
- }
25
-
26
- export interface ResolvedWebDavStorageProfile {
27
- kind: "webdav";
28
- url: string;
29
- username: string;
30
- password: string;
31
- }
32
-
33
- /** Backend-only coordinates. `path` is the complete reviewed v3 storage path. */
34
- export interface ResolvedWebDavDestination {
35
- path: string;
36
- namespace: string;
37
- }
38
-
39
- export interface ResolvedWebDavBackend {
40
- type: "webdav";
41
- profile: ResolvedWebDavStorageProfile;
42
- destination: ResolvedWebDavDestination;
43
- }
44
-
45
- export interface ResolvedGitStorageProfile {
46
- kind: "git";
47
- remote: string;
48
- }
49
-
50
- /** Backend-only coordinates. `directory` is the complete reviewed v3 storage path. */
51
- export interface ResolvedGitDestination {
52
- branch: string;
53
- directory: string;
54
- namespace: string;
55
- }
56
-
57
- export interface ResolvedGitBackend {
58
- type: "git";
59
- profile: ResolvedGitStorageProfile;
60
- destination: ResolvedGitDestination;
61
- }
62
-
63
- export type ResolvedSyncBackend = ResolvedS3Backend | ResolvedWebDavBackend | ResolvedGitBackend;
64
-
65
- export interface LatestPointer {
66
- version: number;
67
- profile: string;
68
- snapshot: string;
69
- sha256: string;
70
- createdAt: string;
71
- machine: string;
72
- syncSessions?: boolean;
73
- /** Lightweight projection; the immutable snapshot remains authoritative. */
74
- selection?: SnapshotSelection;
75
- }
76
-
77
- export interface RemoteObject<T> {
78
- value?: T;
79
- etag?: string;
80
- missing: boolean;
81
- }
1
+ export type * from "@narumitw/sync-daemon/engine/backends/backend-types";