dsh-config-manager 0.8.2 → 0.10.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 (418) hide show
  1. package/lib/adapters/mcp.js +51 -15
  2. package/lib/adapters/messages.d.ts +1 -0
  3. package/lib/adapters/messages.js +2 -0
  4. package/lib/adapters/patch-key-guard.d.ts +23 -0
  5. package/lib/adapters/patch-key-guard.js +13 -0
  6. package/lib/adapters/plugin-data.d.ts +19 -5
  7. package/lib/adapters/plugin-data.js +76 -22
  8. package/lib/adapters/plugins.d.ts +14 -1
  9. package/lib/adapters/plugins.js +204 -6
  10. package/lib/adapters/prompts.js +15 -4
  11. package/lib/adapters/test-helpers.d.ts +15 -1
  12. package/lib/adapters/test-helpers.js +11 -0
  13. package/lib/cli/actions.d.ts +7 -105
  14. package/lib/cli/actions.js +16 -172
  15. package/lib/cli/control-state.d.ts +54 -0
  16. package/lib/cli/control-state.js +107 -0
  17. package/lib/cli/help.d.ts +1 -1
  18. package/lib/cli/help.js +21 -14
  19. package/lib/cli/index.js +132 -104
  20. package/lib/cli/sessions-repair.js +58 -22
  21. package/lib/cli/web/client-script.d.ts +1 -1
  22. package/lib/cli/web/client-script.js +71 -5
  23. package/lib/cli/web/page.d.ts +9 -19
  24. package/lib/cli/web/page.js +277 -173
  25. package/lib/cli/web/routes.js +85 -25
  26. package/lib/cli/write-gates.d.ts +61 -0
  27. package/lib/cli/write-gates.js +110 -0
  28. package/lib/client.d.ts +196 -75
  29. package/lib/client.js +8139 -7487
  30. package/lib/core/backup.d.ts +0 -4
  31. package/lib/core/backup.js +21 -4
  32. package/lib/core/boot-rescue.d.ts +1 -1
  33. package/lib/core/boot-rescue.js +12 -1
  34. package/lib/core/boot-safety.js +37 -2
  35. package/lib/core/conflict-decisions.js +2 -1
  36. package/lib/core/exporter.js +22 -1
  37. package/lib/core/journal.d.ts +54 -4
  38. package/lib/core/journal.js +158 -35
  39. package/lib/core/local-plugin-host.d.ts +29 -0
  40. package/lib/core/local-plugin-host.js +55 -48
  41. package/lib/core/messages.d.ts +17 -0
  42. package/lib/core/messages.js +34 -0
  43. package/lib/core/migration-history.js +16 -9
  44. package/lib/core/model-tools.d.ts +2 -2
  45. package/lib/core/model-tools.js +20 -2
  46. package/lib/core/patch-chain.d.ts +65 -0
  47. package/lib/core/patch-chain.js +100 -0
  48. package/lib/core/patch-document.d.ts +32 -4
  49. package/lib/core/patch-document.js +48 -17
  50. package/lib/core/patch-secret-guard.d.ts +49 -0
  51. package/lib/core/patch-secret-guard.js +164 -0
  52. package/lib/core/reconcile.d.ts +8 -0
  53. package/lib/core/reconcile.js +18 -3
  54. package/lib/core/reinstall.d.ts +2 -0
  55. package/lib/core/reinstall.js +6 -2
  56. package/lib/core/restore.js +31 -6
  57. package/lib/core/section-sanitize.d.ts +32 -0
  58. package/lib/core/section-sanitize.js +13 -0
  59. package/lib/core/snapshot-diff.d.ts +30 -0
  60. package/lib/core/snapshot-diff.js +56 -20
  61. package/lib/core/startup-barrier.js +8 -2
  62. package/lib/core/types.d.ts +38 -1
  63. package/lib/core/update-check.js +51 -2
  64. package/lib/foreign/kernel.js +9 -2
  65. package/lib/foreign/read-claude-plugins.js +29 -11
  66. package/lib/foreign/read-dsh.js +31 -2
  67. package/lib/foreign/session-ir.js +50 -9
  68. package/lib/foreign/session-read.d.ts +8 -0
  69. package/lib/foreign/session-read.js +26 -0
  70. package/lib/index.d.ts +9 -4
  71. package/lib/index.js +42 -47
  72. package/lib/profiles/dsh-profile-io.d.ts +20 -0
  73. package/lib/profiles/dsh-profile-io.js +27 -0
  74. package/lib/profiles/dsh-profile-manager.d.ts +27 -0
  75. package/lib/profiles/dsh-profile-manager.js +45 -4
  76. package/lib/profiles/dsh-profile-runtime.d.ts +5 -1
  77. package/lib/profiles/dsh-profile-runtime.js +16 -3
  78. package/lib/profiles/process-control.d.ts +18 -1
  79. package/lib/profiles/process-control.js +25 -1
  80. package/lib/routes/profiles.js +2 -1
  81. package/lib/routes/sync.js +19 -1
  82. package/lib/schema/types.d.ts +11 -0
  83. package/lib/security/redaction.js +22 -6
  84. package/lib/sync/autosync-repeat.d.ts +27 -0
  85. package/lib/sync/autosync-repeat.js +23 -0
  86. package/lib/sync/autosync-scheduler.d.ts +47 -2
  87. package/lib/sync/autosync-scheduler.js +217 -53
  88. package/lib/sync/baseline-heal.js +7 -0
  89. package/lib/sync/baseline-record.d.ts +67 -0
  90. package/lib/sync/baseline-record.js +74 -0
  91. package/lib/sync/blob-store.js +13 -0
  92. package/lib/sync/content-diff.d.ts +39 -0
  93. package/lib/sync/content-diff.js +46 -0
  94. package/lib/sync/git/git-transport.d.ts +32 -1
  95. package/lib/sync/git/git-transport.js +146 -26
  96. package/lib/sync/github-auth.d.ts +17 -1
  97. package/lib/sync/github-auth.js +37 -1
  98. package/lib/sync/local-changes.d.ts +15 -0
  99. package/lib/sync/local-changes.js +39 -0
  100. package/lib/sync/merge-apply-plan.d.ts +38 -0
  101. package/lib/sync/merge-apply-plan.js +76 -0
  102. package/lib/sync/merge-keyed.d.ts +68 -0
  103. package/lib/sync/merge-keyed.js +124 -0
  104. package/lib/sync/messages.d.ts +1 -0
  105. package/lib/sync/messages.js +2 -0
  106. package/lib/sync/patch-line-identity.d.ts +19 -0
  107. package/lib/sync/patch-line-identity.js +99 -0
  108. package/lib/sync/pending-merge.d.ts +41 -0
  109. package/lib/sync/pending-merge.js +61 -0
  110. package/lib/sync/plugin-removals.d.ts +15 -15
  111. package/lib/sync/plugin-removals.js +134 -83
  112. package/lib/sync/push-skip.d.ts +55 -0
  113. package/lib/sync/push-skip.js +70 -0
  114. package/lib/sync/s3/s3-transport.d.ts +14 -2
  115. package/lib/sync/s3/s3-transport.js +72 -48
  116. package/lib/sync/sync-engine.d.ts +44 -51
  117. package/lib/sync/sync-engine.js +160 -194
  118. package/lib/sync/sync-history.d.ts +7 -0
  119. package/lib/sync/sync-state.d.ts +28 -0
  120. package/lib/sync/sync-state.js +20 -0
  121. package/lib/sync/transport.d.ts +12 -3
  122. package/lib/sync/transport.js +13 -4
  123. package/lib/sync/webdav/webdav-transport.d.ts +19 -2
  124. package/lib/sync/webdav/webdav-transport.js +81 -40
  125. package/lib/sync/workspace-merge.d.ts +8 -2
  126. package/lib/ui/artifact-view.d.ts +1 -1
  127. package/lib/ui/commands.js +5 -11
  128. package/lib/ui/dsh-profiles-view.d.ts +8 -3
  129. package/lib/ui/dsh-profiles-view.js +9 -5
  130. package/lib/ui/foreign-view.d.ts +14 -0
  131. package/lib/ui/foreign-view.js +34 -0
  132. package/lib/ui/i18n.d.ts +7 -1
  133. package/lib/ui/i18n.js +15 -2
  134. package/lib/ui/menu-placement.js +1 -1
  135. package/lib/ui/migration-consult-view.d.ts +11 -0
  136. package/lib/ui/migration-consult-view.js +15 -0
  137. package/lib/ui/overview-view.d.ts +7 -0
  138. package/lib/ui/overview-view.js +3 -0
  139. package/lib/ui/report.d.ts +9 -0
  140. package/lib/ui/report.js +17 -4
  141. package/lib/ui/selection-model.d.ts +10 -2
  142. package/lib/ui/selection-model.js +23 -3
  143. package/lib/utils/async-once.d.ts +11 -0
  144. package/lib/utils/async-once.js +15 -0
  145. package/lib/utils/patch-chain-read.d.ts +51 -0
  146. package/lib/utils/patch-chain-read.js +240 -0
  147. package/lib/utils/patch-yaml.d.ts +39 -1
  148. package/lib/utils/patch-yaml.js +82 -2
  149. package/lib/utils/paths.d.ts +13 -0
  150. package/lib/utils/paths.js +35 -0
  151. package/lib/utils/workdir-lock.js +18 -3
  152. package/package.json +3 -2
  153. package/src/adapters/mcp.test.ts +29 -0
  154. package/src/adapters/mcp.ts +52 -14
  155. package/src/adapters/messages.ts +2 -0
  156. package/src/adapters/patch-key-guard.ts +29 -0
  157. package/src/adapters/plugin-data.test.ts +126 -0
  158. package/src/adapters/plugin-data.ts +97 -26
  159. package/src/adapters/plugins.test.ts +403 -0
  160. package/src/adapters/plugins.ts +198 -8
  161. package/src/adapters/prompts.ts +15 -4
  162. package/src/adapters/test-helpers.ts +15 -1
  163. package/src/cli/actions.test.ts +74 -1
  164. package/src/cli/actions.ts +27 -246
  165. package/src/cli/control-state.ts +143 -0
  166. package/src/cli/help.ts +21 -14
  167. package/src/cli/index.ts +123 -107
  168. package/src/cli/sessions-repair.ts +55 -22
  169. package/src/cli/web/client-script.ts +71 -5
  170. package/src/cli/web/page.ts +327 -208
  171. package/src/cli/web/routes.ts +85 -25
  172. package/src/cli/web/web.test.ts +65 -0
  173. package/src/cli/write-gates.ts +149 -0
  174. package/src/client/ConfigManagerSection.tsx +8 -4
  175. package/src/client/about/AboutPanel.tsx +9 -12
  176. package/src/client/about/release-notes-view.test.ts +17 -0
  177. package/src/client/about/release-notes-view.ts +49 -24
  178. package/src/client/api.ts +2 -1
  179. package/src/client/chat/ChatEntryView.tsx +2 -2
  180. package/src/client/chat/rollback-entry-view.ts +6 -1
  181. package/src/client/common/CommandPalette.tsx +6 -3
  182. package/src/client/common/ConfirmDialog.tsx +29 -12
  183. package/src/client/common/ContentPicker.tsx +24 -24
  184. package/src/client/common/Modal.tsx +12 -5
  185. package/src/client/common/MoreMenu.tsx +4 -1
  186. package/src/client/common/RunsCenter.tsx +103 -32
  187. package/src/client/common/Select.tsx +2 -2
  188. package/src/client/common/floating-bounds.ts +1 -1
  189. package/src/client/common/floating-units.test.ts +1 -2
  190. package/src/client/common/plan-text-redaction.test.ts +190 -5
  191. package/src/client/common/runs-center-guard.test.ts +60 -0
  192. package/src/client/common/runs-center-view.test.ts +128 -0
  193. package/src/client/common/runs-center-view.ts +96 -0
  194. package/src/client/common/section-title-action.test.ts +66 -0
  195. package/src/client/common/ui.tsx +93 -30
  196. package/src/client/config-manager.module.css +1515 -270
  197. package/src/client/consult/ConsultCard.tsx +7 -6
  198. package/src/client/environment/EnvironmentPanel.tsx +22 -25
  199. package/src/client/environment/maintenance/DiskUsageCard.tsx +69 -96
  200. package/src/client/environment/profiles-incomplete-ui.test.ts +8 -8
  201. package/src/client/export/ExportView.tsx +7 -16
  202. package/src/client/history/HistoryPanel.tsx +88 -28
  203. package/src/client/history/history-locales.ts +3 -3
  204. package/src/client/home/BackupScheduleCard.tsx +77 -69
  205. package/src/client/home/HomePanel.tsx +47 -12
  206. package/src/client/import/ConflictList.tsx +13 -13
  207. package/src/client/import/ForeignImportView.tsx +67 -9
  208. package/src/client/import/ImportWizardView.tsx +4 -4
  209. package/src/client/import/PathMappingForm.tsx +36 -9
  210. package/src/client/import/PathPickerDialog.tsx +2 -1
  211. package/src/client/import/import-wizard-split.test.ts +1 -1
  212. package/src/client/import/import-wizard-steps.tsx +51 -39
  213. package/src/client/import/use-import-wizard-controller.test.ts +129 -0
  214. package/src/client/import/use-import-wizard-controller.ts +116 -22
  215. package/src/client/library/ArtifactRow.tsx +2 -2
  216. package/src/client/library/BackupInspectView.tsx +21 -15
  217. package/src/client/library/LibraryActions.tsx +116 -28
  218. package/src/client/library/LibraryPanel.tsx +14 -15
  219. package/src/client/library/RestorePlanView.tsx +13 -8
  220. package/src/client/locales/about.ts +0 -2
  221. package/src/client/locales/backup.ts +15 -12
  222. package/src/client/locales/common.ts +2 -0
  223. package/src/client/locales/export.ts +5 -12
  224. package/src/client/locales/foreign.ts +4 -2
  225. package/src/client/locales/import.ts +5 -2
  226. package/src/client/locales/overview.ts +4 -0
  227. package/src/client/locales/profiles.ts +32 -4
  228. package/src/client/locales/restore.ts +2 -2
  229. package/src/client/locales/sessions.ts +0 -2
  230. package/src/client/locales/shell.ts +2 -2
  231. package/src/client/market/MarketImportReview.tsx +4 -4
  232. package/src/client/market/MarketPanel.tsx +58 -56
  233. package/src/client/market/MyConfigsList.tsx +34 -32
  234. package/src/client/market/MyConfigsLoginCard.tsx +12 -15
  235. package/src/client/market/MyConfigsView.tsx +8 -15
  236. package/src/client/market/MyConfigsWizard.tsx +7 -12
  237. package/src/client/market/market-locales.ts +0 -6
  238. package/src/client/market/my-configs-split.test.ts +2 -1
  239. package/src/client/nav-menu-clip-guard.test.ts +52 -0
  240. package/src/client/recovery/IncompleteCopiesSection.tsx +1 -3
  241. package/src/client/recovery/RecoveryPanel.tsx +35 -22
  242. package/src/client/recovery/RollbackCard.tsx +132 -75
  243. package/src/client/recovery/RollbackFileChanges.tsx +40 -27
  244. package/src/client/recovery/SessionHealthCard.tsx +2 -2
  245. package/src/client/recovery/SessionHealthDialog.tsx +5 -7
  246. package/src/client/recovery/SessionLayoutSection.tsx +3 -5
  247. package/src/client/recovery/recovery-locales.ts +12 -8
  248. package/src/client/recovery/rollback-enabled.ts +29 -0
  249. package/src/client/recovery/use-recovery-write.ts +5 -0
  250. package/src/client/run-store.test.ts +30 -0
  251. package/src/client/run-store.ts +21 -1
  252. package/src/client/sync/AddChannelCard.tsx +65 -0
  253. package/src/client/sync/AutosyncCard.tsx +184 -108
  254. package/src/client/sync/ChannelClearConfirmDialog.tsx +5 -1
  255. package/src/client/sync/ChannelConfigDialog.tsx +27 -48
  256. package/src/client/sync/MergePreviewView.tsx +5 -7
  257. package/src/client/sync/PushPreviewCard.tsx +2 -1
  258. package/src/client/sync/PushReportSections.tsx +35 -0
  259. package/src/client/sync/SyncChannelEntryCard.tsx +33 -24
  260. package/src/client/sync/SyncConfirmView.tsx +130 -133
  261. package/src/client/sync/SyncLogList.tsx +29 -14
  262. package/src/client/sync/SyncPanel.tsx +188 -185
  263. package/src/client/sync/SyncProbeRow.tsx +5 -7
  264. package/src/client/sync/SyncRepositoryPicker.tsx +17 -4
  265. package/src/client/sync/SyncSecuritySection.tsx +157 -0
  266. package/src/client/sync/SyncSettingsDialog.tsx +293 -0
  267. package/src/client/sync/SyncSettingsView.test.ts +26 -8
  268. package/src/client/sync/WorkDirCard.tsx +2 -4
  269. package/src/client/sync/config-clear-guard.test.ts +94 -0
  270. package/src/client/sync/config-clear-guard.ts +98 -0
  271. package/src/client/sync/config-dirty.test.ts +91 -0
  272. package/src/client/sync/config-dirty.ts +88 -0
  273. package/src/client/sync/history-model.test.ts +2 -0
  274. package/src/client/sync/history-model.ts +5 -0
  275. package/src/client/sync/merge-request.ts +20 -0
  276. package/src/client/sync/sync-api.ts +13 -1
  277. package/src/client/sync/sync-locales.ts +95 -47
  278. package/src/client/sync/sync-panel-clear.test.ts +44 -0
  279. package/src/client/sync/sync-push-preview.test.ts +9 -0
  280. package/src/client/sync/sync-view.test.ts +20 -0
  281. package/src/client/sync/sync-view.ts +76 -4
  282. package/src/core/backup.test.ts +61 -1
  283. package/src/core/backup.ts +21 -4
  284. package/src/core/boot-rescue.test.ts +35 -0
  285. package/src/core/boot-rescue.ts +13 -2
  286. package/src/core/boot-safety.test.ts +25 -0
  287. package/src/core/boot-safety.ts +37 -2
  288. package/src/core/conflict-decisions.ts +2 -1
  289. package/src/core/exporter.ts +21 -1
  290. package/src/core/journal.test.ts +183 -0
  291. package/src/core/journal.ts +163 -25
  292. package/src/core/local-plugin-host.test.ts +68 -2
  293. package/src/core/local-plugin-host.ts +31 -4
  294. package/src/core/messages.ts +34 -0
  295. package/src/core/migration-history.test.ts +27 -0
  296. package/src/core/migration-history.ts +12 -4
  297. package/src/core/model-tools.test.ts +67 -0
  298. package/src/core/model-tools.ts +22 -4
  299. package/src/core/patch-chain.test.ts +83 -0
  300. package/src/core/patch-chain.ts +150 -0
  301. package/src/core/patch-document.test.ts +48 -1
  302. package/src/core/patch-document.ts +66 -15
  303. package/src/core/patch-layers.test.ts +1 -1
  304. package/src/core/patch-secret-guard.test.ts +110 -0
  305. package/src/core/patch-secret-guard.ts +176 -0
  306. package/src/core/reconcile.ts +32 -4
  307. package/src/core/reinstall.ts +8 -2
  308. package/src/core/restore.ts +32 -7
  309. package/src/core/section-sanitize.ts +37 -0
  310. package/src/core/smoke.test.ts +2 -1
  311. package/src/core/snapshot-diff.test.ts +73 -1
  312. package/src/core/snapshot-diff.ts +66 -21
  313. package/src/core/startup-barrier.test.ts +64 -0
  314. package/src/core/startup-barrier.ts +8 -2
  315. package/src/core/types.ts +43 -2
  316. package/src/core/update-check.test.ts +40 -0
  317. package/src/core/update-check.ts +53 -2
  318. package/src/foreign/claude-code.test.ts +5 -0
  319. package/src/foreign/claude-plugins.test.ts +57 -0
  320. package/src/foreign/claude-sessions-bytes.test.ts +7 -1
  321. package/src/foreign/dsh.test.ts +23 -0
  322. package/src/foreign/kernel.ts +9 -2
  323. package/src/foreign/read-claude-plugins.ts +32 -11
  324. package/src/foreign/read-dsh.ts +33 -2
  325. package/src/foreign/session-ir.test.ts +67 -0
  326. package/src/foreign/session-ir.ts +54 -14
  327. package/src/foreign/session-read.ts +23 -0
  328. package/src/index.facade.test.ts +186 -6
  329. package/src/index.ts +53 -47
  330. package/src/profiles/dsh-profile-copy-rollback.test.ts +58 -4
  331. package/src/profiles/dsh-profile-io.ts +29 -0
  332. package/src/profiles/dsh-profile-manager.test.ts +30 -0
  333. package/src/profiles/dsh-profile-manager.ts +53 -5
  334. package/src/profiles/dsh-profile-runtime.test.ts +29 -7
  335. package/src/profiles/dsh-profile-runtime.ts +17 -3
  336. package/src/profiles/process-control.test.ts +97 -0
  337. package/src/profiles/process-control.ts +28 -1
  338. package/src/routes/profiles.ts +2 -1
  339. package/src/routes/sync.ts +19 -1
  340. package/src/schema/types.ts +16 -1
  341. package/src/security/redaction.test.ts +31 -0
  342. package/src/security/redaction.ts +23 -6
  343. package/src/security/security.test.ts +1 -1
  344. package/src/sync/autosync-repeat.test.ts +58 -0
  345. package/src/sync/autosync-repeat.ts +55 -0
  346. package/src/sync/autosync-scheduler.test.ts +515 -0
  347. package/src/sync/autosync-scheduler.ts +225 -51
  348. package/src/sync/baseline-heal.ts +6 -0
  349. package/src/sync/baseline-record.ts +135 -0
  350. package/src/sync/blob-store.test.ts +16 -0
  351. package/src/sync/blob-store.ts +13 -0
  352. package/src/sync/content-diff.test.ts +95 -0
  353. package/src/sync/content-diff.ts +79 -0
  354. package/src/sync/git/git-transport.test.ts +151 -4
  355. package/src/sync/git/git-transport.ts +143 -27
  356. package/src/sync/github-auth.test.ts +26 -1
  357. package/src/sync/github-auth.ts +37 -1
  358. package/src/sync/local-changes.ts +40 -0
  359. package/src/sync/merge-apply-plan.ts +117 -0
  360. package/src/sync/merge-keyed.test.ts +167 -0
  361. package/src/sync/merge-keyed.ts +160 -0
  362. package/src/sync/messages.ts +3 -0
  363. package/src/sync/patch-line-identity.test.ts +73 -0
  364. package/src/sync/patch-line-identity.ts +105 -0
  365. package/src/sync/pending-merge.test.ts +41 -0
  366. package/src/sync/pending-merge.ts +85 -0
  367. package/src/sync/plugin-removals.test.ts +199 -39
  368. package/src/sync/plugin-removals.ts +150 -64
  369. package/src/sync/push-skip.test.ts +326 -0
  370. package/src/sync/push-skip.ts +102 -0
  371. package/src/sync/s3/s3-delete-and-blob-index.test.ts +249 -0
  372. package/src/sync/s3/s3-transport.ts +76 -42
  373. package/src/sync/sync-config.test.ts +39 -12
  374. package/src/sync/sync-device-identity.test.ts +3 -0
  375. package/src/sync/sync-engine.test.ts +465 -12
  376. package/src/sync/sync-engine.ts +189 -193
  377. package/src/sync/sync-history.ts +7 -0
  378. package/src/sync/sync-state.ts +48 -0
  379. package/src/sync/transport.test.ts +13 -1
  380. package/src/sync/transport.ts +12 -4
  381. package/src/sync/webdav/webdav-delete-and-blob-index.test.ts +249 -0
  382. package/src/sync/webdav/webdav-transport.ts +86 -34
  383. package/src/sync/workspace-merge.ts +9 -2
  384. package/src/ui/artifact-view.ts +1 -1
  385. package/src/ui/commands.test.ts +11 -0
  386. package/src/ui/commands.ts +5 -14
  387. package/src/ui/dsh-profiles-view.test.ts +16 -0
  388. package/src/ui/dsh-profiles-view.ts +11 -5
  389. package/src/ui/foreign-view.test.ts +49 -0
  390. package/src/ui/foreign-view.ts +47 -0
  391. package/src/ui/i18n.ts +15 -2
  392. package/src/ui/menu-placement.ts +1 -1
  393. package/src/ui/migration-consult-view.test.ts +20 -1
  394. package/src/ui/migration-consult-view.ts +17 -0
  395. package/src/ui/overview-view.ts +10 -0
  396. package/src/ui/report.test.ts +25 -1
  397. package/src/ui/report.ts +15 -4
  398. package/src/ui/selection-model.test.ts +29 -1
  399. package/src/ui/selection-model.ts +25 -4
  400. package/src/utils/async-once.ts +14 -0
  401. package/src/utils/js-yaml4.d.ts +35 -0
  402. package/src/utils/patch-chain-read.test.ts +171 -0
  403. package/src/utils/patch-chain-read.ts +259 -0
  404. package/src/utils/patch-yaml.test.ts +215 -3
  405. package/src/utils/patch-yaml.ts +98 -2
  406. package/src/utils/paths.test.ts +14 -1
  407. package/src/utils/paths.ts +35 -0
  408. package/src/utils/workdir-lock.test.ts +69 -0
  409. package/src/utils/workdir-lock.ts +17 -3
  410. package/lib/ui/path-mapping.d.ts +0 -38
  411. package/lib/ui/path-mapping.js +0 -75
  412. package/src/client/common/InfoHint.tsx +0 -289
  413. package/src/client/common/info-hint-guard.test.ts +0 -1119
  414. package/src/client/sync/DecryptPasswordCard.tsx +0 -48
  415. package/src/client/sync/SecurityOptionsCard.tsx +0 -97
  416. package/src/client/sync/SyncSectionPickerDialog.tsx +0 -213
  417. package/src/ui/path-mapping.test.ts +0 -67
  418. package/src/ui/path-mapping.ts +0 -103
@@ -22,9 +22,7 @@ export const zh = {
22
22
  'config.tokenSaved': '凭据已配置',
23
23
  'config.tokenMissing': '未配置令牌:可拉取公开仓库,无法推送',
24
24
  'config.tokenPlaceholder': 'ghp_…(可选)',
25
- // 配置保存(自动保存 + 显式保存按钮)
26
- 'config.save': '立即保存',
27
- 'config.saveHint': '表单改动会自动保存:密码/token 安全写入 DSH credentials,不会写入同步文件或日志。',
25
+ // 配置保存(全自动保存:无手动按钮,成功后标题行闪「已保存」徽章;凭据去向在各密钥字段的 title 里)
28
26
  'config.savedTick': '已保存',
29
27
  // 通道选择器
30
28
  'channel.title': '同步通道',
@@ -32,10 +30,8 @@ export const zh = {
32
30
  'channel.webdav': 'WebDAV 服务器',
33
31
  'channel.s3': '对象存储(S3 兼容)',
34
32
  'channel.gist': 'GitHub Gist',
35
- 'channel.perChannelHint': '每条通道(Git / WebDAV / 对象存储 / Gist)的自动同步、同步模式、加密与远端快照各自独立配置。',
36
33
  // 通道入口卡(弹窗驱动:点按钮 → 弹窗内配置通道)
37
34
  'channel.open': '配置',
38
- 'channel.openHint': '远程同步通过「同步通道」进行:Git 私有仓库或 WebDAV 服务器。',
39
35
  // 断开通道配置(用户实测要求:配置过就必须能删掉,否则打不通的通道会永久占位)
40
36
  'channel.expand': '展开通道详情',
41
37
  'channel.collapse': '收起通道详情',
@@ -43,10 +39,17 @@ export const zh = {
43
39
  'channel.clearConfirmTitle': '断开同步通道配置?',
44
40
  'channel.clearConfirmMessage': '将删除「{channel}」的本机配置、已保存的凭据与自动同步开关。远端快照与本机备份不受影响;断开后可重新配置。',
45
41
  'channel.clearConfirm': '断开配置',
42
+ 'channel.clearBusy': '还有保存请求没完成,稍后再点一次断开(最多等 5 秒)',
46
43
  'channel.clearGitSignOut': 'Git 通道的访问令牌会被一并删除:GitHub 登录状态随之失效,需要重新登录(不会自动恢复)。',
47
44
  'channel.configured': '已配置',
48
45
  'channel.notConfigured': '未配置',
49
46
  'channel.currentUrl': '当前地址',
47
+ // 2026-11-14 用户要求改同步页结构:页面只留已配置的通道卡,其余通道进「添加通道」卡
48
+ 'addChannel.title': '添加通道',
49
+ 'addChannel.git': '把配置推进你自己的 Git 仓库(GitHub 仓库可在弹窗里直接登录)',
50
+ 'addChannel.webdav': '同步到 WebDAV 空间:坚果云、Nextcloud、ownCloud、Seafile、群晖、Box',
51
+ 'addChannel.s3': '同步到对象存储桶:AWS S3、阿里云 OSS、腾讯云 COS、MinIO、七牛 Kodo',
52
+ 'addChannel.gist': '用单个 GitHub Gist 存快照,不必新建仓库',
50
53
  // issue #79:Git 工作副本(origin 是否跟随仓库地址 + 显式重建入口)
51
54
  'workdir.title': '工作副本',
52
55
  'workdir.hint': '同步使用的 Git 工作副本。每次同步都会让它的 origin 跟随当前仓库地址;改地址后若仍失败,可在这里重指向或重新克隆。',
@@ -80,12 +83,10 @@ export const zh = {
80
83
  'webdav.url': '服务器地址',
81
84
  'webdav.urlHint': 'WebDAV 服务器根地址(https://…)。同步快照与索引存放于该地址的 dsh-config-manager/ 子目录下。请勿在地址中包含用户名/密码。',
82
85
  'webdav.username': '用户名',
83
- 'webdav.usernameHint': 'HTTP Basic 认证用户名(非敏感,可回显)。',
84
86
  'webdav.password': '密码',
85
87
  'webdav.passwordHint': '将安全写入 DSH credentials(引用名 {ref}),不会写入同步文件或日志。留空表示沿用已保存的凭据。',
86
88
  'webdav.passwordSaved': '凭据已配置',
87
89
  'webdav.passwordPlaceholder': '密码(可选)',
88
- 'webdav.presetHint': '选择常见 WebDAV 服务器可快速填入地址;含 <占位符> 的模板请替换为你的真实服务器/用户名。',
89
90
  // 预设服务器的显示名(英文界面零中文:中文名只住在 zh 目录,en 用品牌英文名)
90
91
  'webdav.preset.custom': 'Custom URL',
91
92
  'webdav.preset.jianguoyun': '坚果云 (Jianguoyun)',
@@ -123,7 +124,6 @@ export const zh = {
123
124
  'repoPicker.createFailed': '新建仓库失败',
124
125
  'repoPicker.nameRequired': '请填写仓库名。',
125
126
  'repoPicker.nameInvalid': '仓库名只能包含字母、数字、点、下划线、连字符(最长 100 字符,不能以点开头)。',
126
- 'repoPicker.privateOnly': '新建的仓库固定为私有:公开仓库会公开你的配置内容。',
127
127
  // 状态
128
128
  // 操作
129
129
  // 报告
@@ -134,18 +134,21 @@ export const zh = {
134
134
  // 名字必须写明方向(issue 121):这条链路只下行、绝不上传 —— 叫「同步」会被读成双向。
135
135
  'syncflow.title': '从远端合并到本机',
136
136
  'syncflow.button': '从远端合并到本机',
137
- // 方向说明(ⓘ,挂在动作行):只下行 + 双向该去哪儿;常驻成行会与按钮名重复(DESIGN.md §7)
137
+ // 方向说明(悬停 title,挂在动作行):只下行 + 双向该去哪儿;常驻成行会与按钮名重复(DESIGN.md §7)
138
138
  // 方案 A:有基线且三方合并全部 skip = 远端与本机一致,不必同步
139
139
  'syncflow.upToDate': '已是最新,无需同步',
140
140
  'syncflow.syncing': '正在同步…',
141
141
  // 阶段文案:一键同步先拉远端快照做只读合并预览(最慢的一步),必须有可见反馈
142
142
  'syncflow.checkingRemote': '正在检查远端变更…',
143
143
  'syncflow.syncFailed': '同步失败',
144
+ // 快照行(2026-11-14 恢复:用户要求把「选择历史快照」下拉与刷新按钮放回页面)
144
145
  'syncflow.snapshotOption': '({date} · {count} 分区)',
145
146
  'syncflow.selectSnapshot': '选择历史快照',
146
147
  'syncflow.refreshSnapshots': '刷新快照列表',
147
148
  'syncflow.latestSnapshot': '最新快照',
148
149
  'syncflow.noSnapshots': '远端暂无快照',
150
+ // ⑥ 设备身份:只有快照确实带 deviceName 时才追加
151
+ 'syncflow.snapshotDevice': '由 {device} 推送',
149
152
  'syncflow.confirmImport': '确认导入',
150
153
  'syncflow.cancel': '取消',
151
154
  'syncflow.adoptRemote': '采用远端',
@@ -180,20 +183,20 @@ export const zh = {
180
183
  'syncflow.pushChanged': '有改动',
181
184
  'syncflow.pushUnchanged': '无改动',
182
185
  'syncflow.pushConfirm': '确认推送',
186
+ // issue #140:内容没变时缺省不新建快照;勾选 = 强制新建(与 agent 的 force 同义)
187
+ 'syncflow.pushForce': '内容未变化也新建快照(强制推送)',
183
188
  'syncflow.pushFirstBaseline': '远端暂无快照:本次将创建首个同步基线',
184
189
  'syncflow.remoteEmptyGuide': '远端还没有任何快照:这是首次同步,先点「推送到远端」把本机配置推上去(推送会创建第一个快照),之后才能拉取。',
185
190
  // 同步模式(默认快速导出 / 高级自定义导出)
186
191
  'mode.title': '同步分区',
187
- 'mode.hint': '同步范围 = 勾选的分区集合(默认已勾选推荐分区,可随时改)。',
188
192
  'mode.selectedCount': '已勾选 {n} / {total}',
189
- 'mode.sectionsHint': '默认可同步的是可移植分区;平台相关分区(MCP 服务器)与设备相关分区(插件文件、凭据状态、历史会话)只有你在这里主动勾选才参与同步。',
190
193
  'mode.deletePlugins': '跟随远端删除插件',
191
194
  'mode.deletePluginsHint': '远端快照里已经没有、本机也没改过的插件会被卸载(判断依据是共同祖先里还有它 —— 那只可能是别处删掉了)。卸载只发生在插件分区真正被应用的那一轮;失败逐项提示、其余同步照常完成。desktop 保留档案与宿主自己不会被删。',
192
195
  'mode.atLeastOne': '请至少勾选一个同步分区',
193
- 'mode.sectionPortable': '可移植',
196
+ 'mode.sectionPortable': '可移植 · 默认同步',
194
197
  'mode.sectionRecommended': '推荐',
195
- 'mode.sectionDeviceSpecific': '设备相关',
196
- 'mode.sectionPlatformSpecific': '平台相关',
198
+ 'mode.sectionDeviceSpecific': '设备相关 · 默认不同步',
199
+ 'mode.sectionPlatformSpecific': '平台相关 · 默认不同步',
197
200
  'mode.mcpHint': 'MCP 服务器按 patch 行写回(导入时落回原层)。按包安装的 stdio 服务器(npx / uvx / pipx)配置本身可跨机;若 command / args / cwd 里是绝对路径,或目标机没装对应运行时,导入分析会给出提示 —— 配置会照常写入,但服务器在目标机可能起不来。',
198
201
  'mode.sessionsLimit': '同步最近多少个会话',
199
202
  'mode.sessionsLimitHint': '历史会话内容敏感,默认只带最近的 5 个(0 = 只勾选不带会话);单位是一个会话目录,同一会话的全部日志一起走。',
@@ -209,20 +212,27 @@ export const zh = {
209
212
  'mode.pickerHint': '改动即时生效并保存(关闭弹窗即完成)。',
210
213
  'mode.pickerBack': '返回分区列表',
211
214
  'mode.pickerDone': '完成',
215
+ // 同步设置弹窗(2026-11-14 用户要求:分区 / 加密 / 解密三块收进一个弹窗,页面只留摘要行)
216
+ 'mode.settingsTitle': '同步设置',
217
+ 'mode.settingsOpen': '设置',
218
+ 'mode.tabContent': '同步内容',
219
+ 'mode.tabAutosync': '自动同步',
220
+ 'mode.tabSecurity': '加密与密码',
221
+ // 摘要行徽章:push 前必须看见「这份快照加不加密码」
222
+ 'mode.encryptOn': '加密已开',
223
+ 'mode.encryptOff': '未加密',
212
224
  // 加密与密钥导出(手动推送;自动同步恒推普通快照、遇加密快照跳过)
213
- 'mode.security': '加密与密钥导出(安全选项)',
225
+ 'mode.security': '加密与密钥导出',
214
226
  'mode.encrypt': '加密备份',
215
- 'mode.encryptHint': '用密码加密同步快照(AES-256-GCM)。密码保存在本机 DSH 凭据库(~/.dsh/.credentials.yaml)以便长期复用:不写入同步文件、不落日志、不写入备份(除非同时勾选「导出密钥」并加密)。自动同步无法解密加密快照,会自动跳过并在同步历史中提示。',
227
+ 'mode.encryptHint': '用密码加密同步快照(AES-256-GCM)。密码存在本机 DSH 凭据库(~/.dsh/.credentials.yaml)长期复用:不写进同步文件、日志或备份(除非同时勾选「导出密钥」)。自动同步没有密码,遇到加密快照会跳过并在同步历史提示。',
216
228
  'mode.password': '加密密码',
217
229
  'mode.passwordConfirm': '确认密码',
218
230
  'mode.passwordMismatch': '两次输入的密码不一致',
219
231
  'mode.passwordRequired': '加密必须设置密码',
220
- 'mode.passwordSavedHint': '本机已保存密码:留空即沿用,输入新密码会覆盖已保存的密码。',
221
232
  'mode.passwordPlaceholder': '已保存(留空即沿用)',
222
233
  'mode.passwordClearNotice': '取消勾选会删除已保存的密码',
223
234
  'mode.includeSecrets': '导出密钥',
224
235
  'mode.includeSecretsHint': '把真实凭据值(~/.dsh/.credentials.yaml)写入加密快照,可在另一台机器上随同步一并写回本机凭据;勾选时自动选中加密,密钥绝不进入未加密快照。',
225
- 'mode.encryptAutosyncNotice': '加密快照仅通过手动推送/拉取使用;自动同步无密码,遇到加密快照会跳过并在历史中提示。',
226
236
  'mode.decryptPassword': '解密密码(加密快照拉取/同步用,可选)',
227
237
  'mode.decryptPasswordHint': '输入后保存在本机凭据库,下次拉取自动使用;只有拉取的快照确实加密时才会用到 —— 未加密的备份不会使用密码。',
228
238
  'mode.decryptPasswordSaved': '已保存到本机',
@@ -231,6 +241,8 @@ export const zh = {
231
241
  // 自动同步(方案 A)
232
242
  'autosync.title': '自动同步',
233
243
  'autosync.description': '开启后,DSH 在后台保持配置一致:本地配置有改动时自动上传,检测到远端有新快照时才自动拉取合并;定时器仅作兜底轮询,无变化不重复动作。仅在无冲突且无需人工干预时才自动写入本地。',
244
+ // issue #143:同步页原本没有任何指向保留策略的线索 —— 远端快照同样按它裁剪。
245
+ 'autosync.retentionNotice': '远端快照与定时备份共用同一份保留策略(会裁剪旧快照),在首页「定时备份」里设置。',
234
246
  'autosync.enable': '启用',
235
247
  'autosync.interval': '兜底轮询间隔',
236
248
  'autosync.intervalHint': '兜底检查节奏:间隔到点 / DSH 启动时检查远端是否有新快照,有才拉取合并。启用「本地改动即时同步」后,保存配置会立刻触发一轮,不必等这里。',
@@ -261,9 +273,13 @@ export const zh = {
261
273
  // issue #79:跳过原因上状态行(改造前只进 info 级日志,界面完全看不到「为什么没同步」)
262
274
  'autosync.skipReasonLabel': '跳过原因',
263
275
  'autosync.skipReasonConflictCount': '{reason}(远端另有 {n} 个分区待确认,可在同步页手动处理)',
276
+ // P2(2026-11-14):待裁决分区是**持久状态**(sync-state.pendingMerge),不是某一轮的结论 ——
277
+ // 这句话在关掉自动同步后也要说清「有什么在等」,并给出开始时间。
278
+ 'autosync.pendingMerge': '待裁决 {n} 个分区(自 {time})',
264
279
  'autosync.lastMessage': '本轮消息',
265
280
  // 同步历史(含自动同步记录)
266
281
  'history.title': '同步历史',
282
+ 'history.refresh': '刷新',
267
283
  'history.empty': '尚无同步历史',
268
284
  'history.emptyHint': '完成首次推送 / 从远端合并 / 自动同步后,这里会显示记录。',
269
285
  'history.colTime': '时间',
@@ -289,13 +305,17 @@ export const zh = {
289
305
  'history.autosyncReasonUnknown': '未知',
290
306
  'history.autosyncReasonConflictKeptLocal': '已按策略保留本机并覆盖远端',
291
307
  'history.autosyncReasonUpToDate': '无变化(本地与远端一致)',
308
+ 'history.autosyncReasonWarning': '部分内容未落地(详情见本轮告警)',
292
309
  'history.autosyncReasonUnchanged': '远端无新快照,无需合并',
310
+ 'history.autosyncReasonAllConflicted': '有分区仍在等冲突裁决,本轮未上传(裁决后会照常推送)',
293
311
  'history.autosyncConflicted': '跳过冲突分区:{sections}',
294
312
  'history.autosyncApplied': '应用分区:{sections}',
295
313
  'history.autosyncError': '错误:{error}',
296
314
  // 触发通道(同步历史「由哪个通道触发」)
297
315
  'history.channelGit': 'GitHub',
298
316
  'history.channelWebdav': 'WebDAV',
317
+ 'history.channelS3': 'S3',
318
+ 'history.channelGist': 'Gist',
299
319
  // 列表头部统计摘要(需求 4F)
300
320
  'history.stats.total': '共 {count} 条',
301
321
  'history.stats.autosync': '自动同步 {count}',
@@ -307,8 +327,6 @@ export const zh = {
307
327
  // 会被 store 的去重逻辑合并(互相顶掉),故此处为每个动作单独给出可区分文案。
308
328
  'toast.autosyncLoadFailed': '读取自动同步状态失败',
309
329
  'toast.configSaveFailed': '保存通道配置失败',
310
- 'toast.configSaved': '通道配置已保存',
311
- 'toast.configNothingToSave': '请先填写通道地址再保存',
312
330
  'toast.channelCleared': '{channel} 配置已断开',
313
331
  'toast.githubCodeCopied': '已复制一次性授权代码 {code}',
314
332
  'toast.githubCodeCopyFailed': '自动复制失败,请手动复制上面的一次性授权代码',
@@ -317,6 +335,10 @@ export const zh = {
317
335
  'toast.pushPreviewFailed': '推送预览失败',
318
336
  'toast.pushFailed': '推送失败',
319
337
  'toast.pushDone': '推送完成',
338
+ // issue #140:内容与远端最新快照一致 ⇒ 什么都没上传
339
+ 'toast.pushSkipped': '内容未变化,已跳过',
340
+ // issue 146:目标分区全被未裁决冲突扣下 ⇒ 一个分区都没推
341
+ 'toast.pushAllConflicted': '未推送任何分区:还有分区待冲突裁决',
320
342
  'toast.syncStartFailed': '从远端合并失败',
321
343
  'toast.autosyncUpdateFailed': '自动同步设置更新失败',
322
344
  'toast.autosyncUpdated': '自动同步设置已更新',
@@ -340,7 +362,6 @@ export const zh = {
340
362
  'syncflow.importPartialToast': '部分成功:{n} 项未生效,请查看结果明细',
341
363
  'syncflow.importPartial': '部分成功:{n} 项未生效(其余已写入,未整体回滚)',
342
364
  'syncflow.ineffectiveItems': '未生效项',
343
- 'history.remoteMovedAction': '在产物库查看远端快照',
344
365
  'syncflow.compat.excellent': '兼容性:优秀',
345
366
  'syncflow.compat.good': '兼容性:良好(备份来自更旧的 DSH)',
346
367
  'syncflow.compat.partial': '兼容性:部分兼容(跨平台 / 分区缺失 / 版本超前,需人工确认)',
@@ -350,7 +371,6 @@ export const zh = {
350
371
  'cloud.s3Title': '对象存储(S3 兼容)',
351
372
  'cloud.gistTitle': 'GitHub Gist',
352
373
  'cloud.provider': '兼容商',
353
- 'cloud.providerHint': '五家共用同一套 SigV4 签名实现;端点与寻址风格按兼容商取缺省。',
354
374
  'cloud.provider.s3': 'AWS S3',
355
375
  'cloud.provider.oss': '阿里云 OSS',
356
376
  'cloud.provider.cos': '腾讯云 COS',
@@ -470,8 +490,16 @@ export const zh = {
470
490
  'probe.snapshotCount': '远端现有快照:{count} 份',
471
491
  // 「不支持自检」= 能力边界(不是故障):中性结论一句,绝不显示「操作失败」
472
492
  'probe.unsupported': '该通道不提供连通性自检',
473
- // ---- cloud-sync 借鉴项 ⑥:快照的推送方设备(旧快照没有该字段 → 不显示设备行)----
474
- 'syncflow.snapshotDevice': '由 {device} 推送',
493
+ // ---- 2026-11-14 同步设置弹窗收成两页签(用户要求:自动同步与密码合一页)----
494
+ 'mode.tabAutosyncSecurity': '设置',
495
+ 'mode.pluginsGroup': '插件',
496
+ 'mode.decryptGroup': '解密密码',
497
+ // 行式设置行里这行标签只放「是什么」(长括注会把 240 宽控件挤到第二行),机制挂在 mode.decryptPasswordHint 的 title 上
498
+ 'mode.decryptPasswordShort': '解密密码',
499
+ // 段名与行标签的悬停说明(2026-11-14 用户要求「同步页面的标题都要有能读到的 title」)
500
+ 'mode.securityHint': '这一段管两件事:加密备份把同步快照上密码,导出密钥把本机真实凭据一起放进加密快照。两者都需要加密开启;密码与凭据都存本机凭据库,不进同步文件、日志或备份。',
501
+ 'mode.passwordHint': '两个框填一致才会保存;失焦即落库,之后留空表示沿用已保存的密码。取消勾选「加密备份」会删掉已存密码。',
502
+ 'mode.pluginsGroupHint': '这一段的设置只作用于「插件」分区:远端已删、本机没改过的插件会被卸载,失败逐项提示、其余同步照常完成。',
475
503
  } as const;
476
504
 
477
505
  export const en: Record<keyof typeof zh, string> = {
@@ -489,19 +517,15 @@ export const en: Record<keyof typeof zh, string> = {
489
517
  'config.tokenSaved': 'Credential configured',
490
518
  'config.tokenMissing': 'No token: public repos can be pulled, but pushing will fail',
491
519
  'config.tokenPlaceholder': 'ghp_… (optional)',
492
- // Config save (auto-save + explicit save button)
493
- 'config.save': 'Save now',
494
- 'config.saveHint': 'Form changes are saved automatically: password/token goes securely into DSH credentials, never into sync files or logs.',
520
+ // Config save (automatic only: no manual button; the title row flashes a "Saved" badge)
495
521
  'config.savedTick': 'Saved',
496
522
  'channel.title': 'Sync Channel',
497
523
  'channel.git': 'Git private repo',
498
524
  'channel.webdav': 'WebDAV server',
499
525
  'channel.s3': 'Object storage (S3-compatible)',
500
526
  'channel.gist': 'GitHub Gist',
501
- 'channel.perChannelHint': 'Auto sync, sync mode, encryption and remote snapshots are configured independently for each channel (Git / WebDAV / object storage / Gist).',
502
527
  // Channel entry card (dialog-driven: click the button → configure the channel in the dialog)
503
528
  'channel.open': 'Configure',
504
- 'channel.openHint': 'Remote sync runs through a sync channel: a private Git repository or a WebDAV server.',
505
529
  // Disconnect channel config (user report: once configured there was no way out)
506
530
  'channel.expand': 'Expand channel details',
507
531
  'channel.collapse': 'Collapse channel details',
@@ -509,10 +533,17 @@ export const en: Record<keyof typeof zh, string> = {
509
533
  'channel.clearConfirmTitle': 'Disconnect sync channel?',
510
534
  'channel.clearConfirmMessage': 'This removes the local configuration of "{channel}", its saved credentials and its auto-sync switch. Remote snapshots and local backups are untouched; you can configure it again later.',
511
535
  'channel.clearConfirm': 'Disconnect',
536
+ 'channel.clearBusy': 'A save is still in flight; try disconnecting again in a moment (up to 5 seconds).',
512
537
  'channel.clearGitSignOut': 'The git channel access token is deleted too: your GitHub sign-in becomes invalid and must be redone (it does not come back automatically).',
513
538
  'channel.configured': 'Configured',
514
539
  'channel.notConfigured': 'Not configured',
515
540
  'channel.currentUrl': 'Current URL',
541
+ // 2026-11-14 sync page structure: only configured channels get their own card; the rest live behind "Add channel"
542
+ 'addChannel.title': 'Add channel',
543
+ 'addChannel.git': 'Push your configuration to your own Git repository (a GitHub repository can sign in from the dialog)',
544
+ 'addChannel.webdav': 'Sync into a WebDAV space: Jianguoyun, Nextcloud, ownCloud, Seafile, Synology, Box',
545
+ 'addChannel.s3': 'Sync into an object-storage bucket: AWS S3, Alibaba Cloud OSS, Tencent Cloud COS, MinIO, Qiniu Kodo',
546
+ 'addChannel.gist': 'Keep snapshots in a single GitHub Gist, so you do not have to create a repository',
516
547
  // issue #79: Git working copy (origin follows the repository address; explicit rebuild entry)
517
548
  'workdir.title': 'Working copy',
518
549
  'workdir.hint': 'The Git working copy used for sync. Every sync makes its origin follow the configured repository address; if it still fails after an address change, re-point or clone it again here.',
@@ -546,12 +577,10 @@ export const en: Record<keyof typeof zh, string> = {
546
577
  'webdav.url': 'Server URL',
547
578
  'webdav.urlHint': 'WebDAV server root URL (https://…). Sync snapshots and the index are stored under a dsh-config-manager/ subdirectory of that URL. Do not include a username/password in the URL.',
548
579
  'webdav.username': 'Username',
549
- 'webdav.usernameHint': 'HTTP Basic auth username (not sensitive, may be shown).',
550
580
  'webdav.password': 'Password',
551
581
  'webdav.passwordHint': 'Securely written into DSH credentials (ref {ref}); never written into sync files or logs. Leave blank to reuse the saved credential.',
552
582
  'webdav.passwordSaved': 'Credential configured',
553
583
  'webdav.passwordPlaceholder': 'Password (optional)',
554
- 'webdav.presetHint': 'Pick a common WebDAV server to prefill the URL; templates containing <placeholders> need to be replaced with your real server/username.',
555
584
  'webdav.preset.custom': 'Custom URL',
556
585
  'webdav.preset.jianguoyun': 'Jianguoyun (Nutstore)',
557
586
  'webdav.preset.nextcloud': 'Nextcloud',
@@ -587,7 +616,6 @@ export const en: Record<keyof typeof zh, string> = {
587
616
  'repoPicker.createFailed': 'Could not create the repository',
588
617
  'repoPicker.nameRequired': 'Enter a repository name.',
589
618
  'repoPicker.nameInvalid': 'A repository name may contain letters, digits, dots, underscores and hyphens (max 100 characters, cannot start with a dot).',
590
- 'repoPicker.privateOnly': 'Newly created repositories are always private: a public repository would expose your config contents.',
591
619
  'push.title': 'Push Result',
592
620
  'sections.title': 'Synced Sections',
593
621
  'warnings.title': 'Section Warnings',
@@ -603,6 +631,7 @@ export const en: Record<keyof typeof zh, string> = {
603
631
  'syncflow.refreshSnapshots': 'Refresh snapshots',
604
632
  'syncflow.latestSnapshot': 'Latest snapshot',
605
633
  'syncflow.noSnapshots': 'No remote snapshots',
634
+ 'syncflow.snapshotDevice': 'Pushed by {device}',
606
635
  'syncflow.confirmImport': 'Confirm import',
607
636
  'syncflow.cancel': 'Cancel',
608
637
  'syncflow.adoptRemote': 'Adopt remote',
@@ -637,20 +666,19 @@ export const en: Record<keyof typeof zh, string> = {
637
666
  'syncflow.pushChanged': 'Changed',
638
667
  'syncflow.pushUnchanged': 'Unchanged',
639
668
  'syncflow.pushConfirm': 'Push',
669
+ 'syncflow.pushForce': 'Create a new snapshot even when content is unchanged (force push)',
640
670
  'syncflow.pushFirstBaseline': 'No remote snapshots yet: this push creates the first sync baseline',
641
671
  'syncflow.remoteEmptyGuide': 'No remote snapshots yet: this is the first sync — click "Push to remote" to upload your local config (that push creates the first snapshot); pulling only works afterwards.',
642
672
  // Sync mode (default quick export / advanced custom export)
643
673
  'mode.title': 'Sync Sections',
644
- 'mode.hint': 'Sync scope = the ticked set of sections (recommended sections are ticked by default and can be changed any time).',
645
674
  'mode.selectedCount': '{n} / {total} selected',
646
- 'mode.sectionsHint': 'Portable sections sync by default; platform-dependent sections (MCP servers) and device-specific sections (plugin files, credentials status, sessions) only participate when you explicitly tick them here.',
647
675
  'mode.deletePlugins': 'Delete plugins to follow the remote',
648
676
  'mode.deletePluginsHint': 'Plugins that are gone from the remote snapshot and unmodified locally get uninstalled (the evidence is the common ancestor still listing them — only another device could have removed them). Removal runs only in the round where the plugins section is actually applied; failures are reported per item and the rest of the sync still completes. The reserved desktop profile and the host itself are never removed.',
649
677
  'mode.atLeastOne': 'Select at least one section to sync',
650
- 'mode.sectionPortable': 'Portable',
678
+ 'mode.sectionPortable': 'Portable · synced by default',
651
679
  'mode.sectionRecommended': 'Recommended',
652
- 'mode.sectionDeviceSpecific': 'Device-specific',
653
- 'mode.sectionPlatformSpecific': 'Platform-dependent',
680
+ 'mode.sectionDeviceSpecific': 'Device-specific · off by default',
681
+ 'mode.sectionPlatformSpecific': 'Platform-dependent · off by default',
654
682
  'mode.mcpHint': 'MCP servers are written back as patch lines (restored to their original layer on import). Stdio servers installed from a package (npx / uvx / pipx) are portable by themselves; if command / args / cwd contain absolute paths, or the target machine lacks the runtime, the import analysis will say so — the config is still written, but the server may fail to start there.',
655
683
  'mode.sessionsLimit': 'How many recent sessions to sync',
656
684
  'mode.sessionsLimitHint': 'Session content is sensitive, so only the latest 5 are included by default (0 = select the section but carry no sessions); the unit is a session directory, so all logs of one session travel together.',
@@ -666,20 +694,27 @@ export const en: Record<keyof typeof zh, string> = {
666
694
  'mode.pickerHint': 'Changes apply and are saved immediately (closing the dialog finishes the task).',
667
695
  'mode.pickerBack': 'Back to sections',
668
696
  'mode.pickerDone': 'Done',
697
+ // Sync settings dialog (2026-11-14: sections / encryption / decryption moved into one dialog; the page keeps one summary row)
698
+ 'mode.settingsTitle': 'Sync Settings',
699
+ 'mode.settingsOpen': 'Settings',
700
+ 'mode.tabContent': 'Content',
701
+ 'mode.tabAutosync': 'Auto sync',
702
+ 'mode.tabSecurity': 'Encryption & passwords',
703
+ // Summary badge: whether this snapshot is encrypted must be visible before pushing
704
+ 'mode.encryptOn': 'Encrypted',
705
+ 'mode.encryptOff': 'Not encrypted',
669
706
  // Encryption & secret export (manual push only; auto sync always pushes plain snapshots and skips encrypted ones)
670
- 'mode.security': 'Encryption & Secret Export (Security Options)',
707
+ 'mode.security': 'Encryption & Secret Export',
671
708
  'mode.encrypt': 'Encrypt backup',
672
- 'mode.encryptHint': 'Encrypt the sync snapshot with a password (AES-256-GCM). The password is kept in the local DSH credential store (~/.dsh/.credentials.yaml) for reuse: it is never written to sync files, logs or backups (unless "Export secrets" is checked together with encryption). Auto sync cannot decrypt encrypted snapshots, so it skips them and reports it in sync history.',
709
+ 'mode.encryptHint': 'Encrypt the sync snapshot with a password (AES-256-GCM). The password is kept in the local DSH credential store (~/.dsh/.credentials.yaml) for reuse: it is never written to sync files, logs or backups (unless "Export secrets" is checked together with encryption). Auto sync has no password, so it skips encrypted snapshots and reports them in sync history.',
673
710
  'mode.password': 'Encryption password',
674
711
  'mode.passwordConfirm': 'Confirm password',
675
712
  'mode.passwordMismatch': 'Passwords do not match',
676
713
  'mode.passwordRequired': 'Encryption requires a password',
677
- 'mode.passwordSavedHint': 'A password is already saved locally: leave the fields empty to reuse it, or type a new one to replace it.',
678
714
  'mode.passwordPlaceholder': 'Saved (leave empty to reuse)',
679
715
  'mode.passwordClearNotice': 'Unchecking this deletes the saved password',
680
716
  'mode.includeSecrets': 'Export secrets',
681
717
  'mode.includeSecretsHint': 'Write real credential values (~/.dsh/.credentials.yaml) into the encrypted snapshot so another machine can restore them with the sync; checking this auto-selects encryption, and secrets never enter a plaintext snapshot.',
682
- 'mode.encryptAutosyncNotice': 'Encrypted snapshots are only produced/consumed by manual push/pull; auto sync has no password, so it skips encrypted snapshots and reports them in history.',
683
718
  'mode.decryptPassword': 'Decryption password (for encrypted snapshot pull/sync, optional)',
684
719
  'mode.decryptPasswordHint': 'Once entered it is saved in the local credential store and reused automatically; it is only ever used when the pulled snapshot is actually encrypted — plaintext backups never use the password.',
685
720
  'mode.decryptPasswordSaved': 'Saved locally',
@@ -687,6 +722,7 @@ export const en: Record<keyof typeof zh, string> = {
687
722
  'mode.clearSavedPassword': 'Delete saved password',
688
723
  'autosync.title': 'Auto Sync',
689
724
  'autosync.description': 'When enabled, DSH keeps config in sync in the background: uploads locally-changed config automatically, pulls and merges only when it detects a new remote snapshot; the timer is just a fallback poll and no-ops when nothing changed. Local writes happen only when there are no conflicts or manual-decision items.',
725
+ 'autosync.retentionNotice': 'Remote snapshots share one retention policy with scheduled backups (older snapshots get pruned); set it on the Home card "Auto backup".',
690
726
  'autosync.enable': 'Enabled',
691
727
  'autosync.interval': 'Fallback poll interval',
692
728
  'autosync.intervalHint': 'Fallback cadence: on interval / DSH startup it checks whether the remote has a newer snapshot and only then pulls and merges (no upload). With "Sync local changes immediately" on, saving a config triggers a run right away.',
@@ -717,8 +753,11 @@ export const en: Record<keyof typeof zh, string> = {
717
753
  // issue #79: surface the skip reason in the status line (previously info-level log only)
718
754
  'autosync.skipReasonLabel': 'Skip reason',
719
755
  'autosync.skipReasonConflictCount': '{reason} ({n} more {n, plural, section|sections} on the remote need confirmation — handle them on the sync page)',
756
+ // P2: persisted pending-merge state (not one round's conclusion)
757
+ 'autosync.pendingMerge': '{n} {n, plural, section|sections} need your decision (since {time})',
720
758
  'autosync.lastMessage': 'Last message',
721
759
  'history.title': 'Sync History',
760
+ 'history.refresh': 'Refresh',
722
761
  'history.empty': 'No sync history yet',
723
762
  'history.emptyHint': 'Records appear here after your first push / merge from remote / auto sync.',
724
763
  'history.colTime': 'Time',
@@ -743,13 +782,17 @@ export const en: Record<keyof typeof zh, string> = {
743
782
  'history.autosyncReasonUnknown': 'Unknown',
744
783
  'history.autosyncReasonConflictKeptLocal': 'Kept the local version and overwrote the remote as configured',
745
784
  'history.autosyncReasonUpToDate': 'No changes (local and remote match)',
785
+ 'history.autosyncReasonWarning': 'Some content did not land (see this run’s warnings)',
746
786
  'history.autosyncReasonUnchanged': 'No new remote snapshot to merge',
787
+ 'history.autosyncReasonAllConflicted': 'Sections are still waiting for conflict resolution, so nothing was uploaded this run',
747
788
  'history.autosyncConflicted': 'Skipped conflict sections: {sections}',
748
789
  'history.autosyncApplied': 'Applied sections: {sections}',
749
790
  'history.autosyncError': 'Error: {error}',
750
791
  // Trigger channel (which channel triggered this history entry)
751
792
  'history.channelGit': 'GitHub',
752
793
  'history.channelWebdav': 'WebDAV',
794
+ 'history.channelS3': 'S3',
795
+ 'history.channelGist': 'Gist',
753
796
  // List header stats summary (requirement 4F)
754
797
  'history.stats.total': '{count} total',
755
798
  'history.stats.autosync': '{count} auto sync',
@@ -759,8 +802,6 @@ export const en: Record<keyof typeof zh, string> = {
759
802
  // Toast receipts (R-20: per-action wording; identical kind+text would be de-duplicated)
760
803
  'toast.autosyncLoadFailed': 'Failed to load auto-sync status',
761
804
  'toast.configSaveFailed': 'Failed to save channel config',
762
- 'toast.configSaved': 'Channel config saved',
763
- 'toast.configNothingToSave': 'Enter a channel URL before saving',
764
805
  'toast.channelCleared': '{channel} configuration disconnected',
765
806
  'toast.githubCodeCopied': 'One-time code {code} copied to clipboard',
766
807
  'toast.githubCodeCopyFailed': 'Auto-copy failed — copy the one-time code above manually',
@@ -769,6 +810,8 @@ export const en: Record<keyof typeof zh, string> = {
769
810
  'toast.pushPreviewFailed': 'Failed to build push preview',
770
811
  'toast.pushFailed': 'Push failed',
771
812
  'toast.pushDone': 'Push completed',
813
+ 'toast.pushSkipped': 'No content changes — skipped',
814
+ 'toast.pushAllConflicted': 'Nothing pushed: sections still await conflict resolution',
772
815
  'toast.syncStartFailed': 'Merge from remote failed',
773
816
  'toast.autosyncUpdateFailed': 'Failed to update auto-sync settings',
774
817
  'toast.autosyncUpdated': 'Auto-sync settings updated',
@@ -790,7 +833,6 @@ export const en: Record<keyof typeof zh, string> = {
790
833
  'syncflow.importPartialToast': 'Partly successful: {n} {n, plural, item did|items did} not take effect — check the result details',
791
834
  'syncflow.importPartial': 'Partly successful: {n} {n, plural, item did|items did} not take effect (the rest were written; nothing rolled back)',
792
835
  'syncflow.ineffectiveItems': 'Items that did not take effect',
793
- 'history.remoteMovedAction': 'View remote snapshots in Library',
794
836
  'syncflow.compat.excellent': 'Compatibility: excellent',
795
837
  'syncflow.compat.good': 'Compatibility: good (backup from an older DSH)',
796
838
  'syncflow.compat.partial': 'Compatibility: partial (cross-platform / missing sections / newer version — review)',
@@ -800,7 +842,6 @@ export const en: Record<keyof typeof zh, string> = {
800
842
  'cloud.s3Title': 'Object storage (S3-compatible)',
801
843
  'cloud.gistTitle': 'GitHub Gist',
802
844
  'cloud.provider': 'Vendor',
803
- 'cloud.providerHint': 'All five vendors share one SigV4 implementation; endpoint and addressing style follow the vendor defaults.',
804
845
  'cloud.provider.s3': 'AWS S3',
805
846
  'cloud.provider.oss': 'Alibaba Cloud OSS',
806
847
  'cloud.provider.cos': 'Tencent Cloud COS',
@@ -920,8 +961,15 @@ export const en: Record<keyof typeof zh, string> = {
920
961
  'probe.snapshotCount': 'Snapshots on the remote: {count}',
921
962
  // "Unsupported" is a capability boundary, not a failure: neutral wording, never "operation failed"
922
963
  'probe.unsupported': 'This channel does not offer a connectivity self-check',
923
- // ---- cloud-sync borrowing ⑥: device that pushed each snapshot (old snapshots have no such field, so no device line is shown) ----
924
- 'syncflow.snapshotDevice': 'Pushed by {device}',
964
+ // ---- 2026-11-14 settings dialog collapsed to two tabs (auto sync + passwords merged) ----
965
+ 'mode.tabAutosyncSecurity': 'Settings',
966
+ 'mode.pluginsGroup': 'Plugins',
967
+ 'mode.decryptGroup': 'Decryption password',
968
+ 'mode.decryptPasswordShort': 'Decryption password',
969
+ // Hover text for section titles and row labels (2026-11-14: every title on the sync page must be readable on hover)
970
+ 'mode.securityHint': 'This section covers two things: encrypted backups seal the snapshot with a password, and "export secrets" puts the real credential values into that encrypted snapshot. Both require encryption; the password and credentials stay in the local credential store and never enter sync files, logs or backups.',
971
+ 'mode.passwordHint': 'Saved only when both fields match; saving happens on blur, and an empty field later means reuse what is saved. Turning encryption off deletes the saved password.',
972
+ 'mode.pluginsGroupHint': 'These settings apply only to the "plugins" section: plugins deleted on the remote and untouched locally get uninstalled; failures are listed per item and the rest of the sync still completes.',
925
973
  };
926
974
 
927
975
  /** 字典键联合(注册处 compile-time 校验) */
@@ -0,0 +1,44 @@
1
+ /**
2
+ * SyncPanel 断开流程的源码守卫(反方复核后加的护栏;本仓无 DOM 测试环境,见 runs-center-guard.test.ts 同款做法)。
3
+ *
4
+ * 钉住四件被反方证伪过的错法,任何一件回来都算回归:
5
+ * G-1 断开前必须走 prepareClear(取消防抖 + 丢排队载荷 + 等在途落定,超时抛错),
6
+ * 不能退回「只等 inFlight」——防抖未到点时它立即放行,600ms 后旧值写回宿主;
7
+ * G-2 不许恢复「断开后自愈 clear」(会把用户随后保存成功的新配置连凭据一起删掉);
8
+ * G-3 回执作废时不许改写保存队列(那属于新保存,改 inFlight 会让防重入失效);
9
+ * G-4 关闭配置弹窗必须复位脏标记(否则非法输入永久屏蔽宿主真值)。
10
+ */
11
+ import test from 'node:test';
12
+ import assert from 'node:assert/strict';
13
+ import { readFileSync } from 'node:fs';
14
+
15
+ const panel = readFileSync(new URL('./SyncPanel.tsx', import.meta.url), 'utf8');
16
+ const guard = readFileSync(new URL('./config-clear-guard.ts', import.meta.url), 'utf8');
17
+
18
+ test('G-1 断开走 prepareClear(取消防抖 + 丢载荷 + 等在途落定)', () => {
19
+ assert.ok(panel.includes('beforeClear={() => prepareClear({'), '断开前必须用 prepareClear');
20
+ assert.ok(panel.includes('cancelPendingSave: () => dropPendingSave(true)'), '必须撤防抖 + 丢排队载荷(且保留 inFlight 供等待)');
21
+ assert.ok(panel.includes("isBusy: () => saveQueueRef.current.inFlight, busyMessage: t('channel.clearBusy')"), '必须用 getter 探活,超时带文案抛错');
22
+ assert.ok(panel.includes('clearTimeout(saveTimer.current)'), '防抖 timer 必须真的 clearTimeout');
23
+ const from = panel.indexOf('beforeClear={() => prepareClear(');
24
+ assert.ok(from > 0, '找不到 beforeClear 装配点');
25
+ assert.equal(panel.slice(from, from + 220).includes('waitForQuiescence'), false, '不许绕过 prepareClear 直接等 inFlight');
26
+ });
27
+
28
+ test('G-2 不自愈 clear(自愈会删掉用户随后保存成功的新配置)', () => {
29
+ assert.equal(panel.includes('shouldSelfHealClear'), false, 'SyncPanel 不得再引用自愈判定');
30
+ assert.equal(guard.includes('shouldSelfHealClear'), false, '守卫模块不得再提供自愈判定');
31
+ assert.equal(panel.includes('healRef'), false, 'healRef 已删');
32
+ });
33
+
34
+ test('G-3 回执作废时不改写保存队列', () => {
35
+ assert.equal(panel.includes('saveQueueOnSettled(stale ?'), false, '作废分支不得强行清 inFlight/pending');
36
+ assert.ok(panel.includes('if (!stale) {'), '补发只能在非作废分支里做');
37
+ assert.ok(panel.includes('const settled = saveQueueOnSettled(saveQueueRef.current)'), 'settled 必须基于当前队列');
38
+ });
39
+
40
+ test('G-4 关闭配置弹窗复位脏标记', () => {
41
+ const from = panel.indexOf('const closeChannelDialog');
42
+ assert.ok(from > 0, '找不到 closeChannelDialog');
43
+ assert.ok(panel.slice(from, from + 800).includes('dirtyRef.current = resetDirty(); setChannelOpen(false)'), '关闭=放弃未落盘输入,脏标记必须复位');
44
+ });
@@ -72,6 +72,15 @@ test('pushPreviewView: 含凭据推送 → 显式提示「本次含真实凭据
72
72
  assert.equal(withoutSecrets.credentialsHint, '', '不含凭据时不显示该提示');
73
73
  });
74
74
 
75
+ test('pushPreviewView: 全被冲突扣下 → 不显示「将推送 0 个分区」(issue #146,与 push 同口径)', () => {
76
+ const view = pushPreviewView(okPreview({ sections: [], skipped: 'all-conflicted', message: '没有可推送的分区' }), t);
77
+ assert.ok(view !== null && view.ok, '全扣下不是错误');
78
+ assert.deepEqual(view.rows, []);
79
+ assert.equal(view.headline, zhUiT('sync.pushAllConflicted'), '横幅说的是「没得推」,不是「推送 0 个」');
80
+ assert.equal(view.hint, '没有可推送的分区', '引擎说明照常上屏');
81
+ assert.equal(view.error, null);
82
+ });
83
+
75
84
  test('pushPreviewView: null 预览 → null(无弹窗内容)', () => {
76
85
  assert.equal(pushPreviewView(null, t), null);
77
86
  });
@@ -214,6 +214,14 @@ test('sync-view: push 成功报告 → ok 头部含快照 id + 分区透传', ()
214
214
  assert.deepEqual(view?.sections, ['settings', 'plugins'])
215
215
  })
216
216
 
217
+ test('sync-view: push 报告带预览条数 → counts 透传(D-12 名称 · 条数)', () => {
218
+ const report: SyncPushReport = { ok: true, snapshotId: 'sync-2', sections: ['settings', 'plugins'], warnings: [] }
219
+ const view = pushReportView(report, zhUiT, { settings: 12, plugins: 3 })
220
+ assert.deepEqual(view?.counts, { settings: 12, plugins: 3 })
221
+ // 没有预览(缺省第三参)→ 空对象,渲染侧只显分区名
222
+ assert.deepEqual(pushReportView(report, zhUiT)?.counts, {})
223
+ })
224
+
217
225
  test('sync-view: push 失败报告 → error 显示引擎 message', () => {
218
226
  const report: SyncPushReport = { ok: false, snapshotId: '', sections: [], warnings: [], message: '全部导出失败' }
219
227
  const view = pushReportView(report, zhUiT)
@@ -221,6 +229,18 @@ test('sync-view: push 失败报告 → error 显示引擎 message', () => {
221
229
  assert.equal(view?.headline, '全部导出失败')
222
230
  })
223
231
 
232
+ test('sync-view: issue #140 内容未变 → skipped 头部说「已跳过」并给出沿用的远端快照', () => {
233
+ const report: SyncPushReport = {
234
+ ok: true, snapshotId: 'sync-1', sections: ['settings'], warnings: [],
235
+ skipped: 'unchanged', adoptedSnapshotId: 'sync-1',
236
+ }
237
+ const view = pushReportView(report, zhUiT)
238
+ assert.equal(view?.kind, 'skipped', '不是 ok(本轮什么都没写),也不是 error')
239
+ assert.match(view?.headline ?? '', /已跳过/)
240
+ assert.match(view?.headline ?? '', /sync-1/, '要说清沿用的是哪一份远端快照')
241
+ assert.deepEqual(view?.sections, ['settings'], '分区列表照常透传(用户要知道范围)')
242
+ })
243
+
224
244
  test('sync-view: null 报告 → null(不渲染卡片)', () => {
225
245
  assert.equal(pushReportView(null, zhUiT), null)
226
246
  assert.equal(pullReportView(null, zhUiT), null)