@logictan/dsh-config-manager 0.1.60

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 (429) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/cordis.patch.yml +21 -0
  4. package/lib/adapters/agent-instructions.d.ts +13 -0
  5. package/lib/adapters/agent-instructions.js +46 -0
  6. package/lib/adapters/agent-presets.d.ts +13 -0
  7. package/lib/adapters/agent-presets.js +14 -0
  8. package/lib/adapters/credentials.d.ts +37 -0
  9. package/lib/adapters/credentials.js +122 -0
  10. package/lib/adapters/file-collection.d.ts +15 -0
  11. package/lib/adapters/file-collection.js +127 -0
  12. package/lib/adapters/index.d.ts +57 -0
  13. package/lib/adapters/index.js +55 -0
  14. package/lib/adapters/link-report.d.ts +16 -0
  15. package/lib/adapters/link-report.js +47 -0
  16. package/lib/adapters/mcp.d.ts +28 -0
  17. package/lib/adapters/mcp.js +178 -0
  18. package/lib/adapters/plugin-files.d.ts +18 -0
  19. package/lib/adapters/plugin-files.js +142 -0
  20. package/lib/adapters/plugins.d.ts +41 -0
  21. package/lib/adapters/plugins.js +603 -0
  22. package/lib/adapters/pnpm-workspace.d.ts +26 -0
  23. package/lib/adapters/pnpm-workspace.js +147 -0
  24. package/lib/adapters/prompts.d.ts +30 -0
  25. package/lib/adapters/prompts.js +231 -0
  26. package/lib/adapters/providers.d.ts +34 -0
  27. package/lib/adapters/providers.js +155 -0
  28. package/lib/adapters/self.d.ts +17 -0
  29. package/lib/adapters/self.js +71 -0
  30. package/lib/adapters/sessions.d.ts +14 -0
  31. package/lib/adapters/sessions.js +15 -0
  32. package/lib/adapters/settings.d.ts +28 -0
  33. package/lib/adapters/settings.js +165 -0
  34. package/lib/adapters/skills.d.ts +13 -0
  35. package/lib/adapters/skills.js +14 -0
  36. package/lib/adapters/test-helpers.d.ts +125 -0
  37. package/lib/adapters/test-helpers.js +236 -0
  38. package/lib/adapters/ui.d.ts +27 -0
  39. package/lib/adapters/ui.js +89 -0
  40. package/lib/adapters/workspaces.d.ts +13 -0
  41. package/lib/adapters/workspaces.js +106 -0
  42. package/lib/client.d.ts +1026 -0
  43. package/lib/client.js +10047 -0
  44. package/lib/core/analyzer.d.ts +99 -0
  45. package/lib/core/analyzer.js +934 -0
  46. package/lib/core/backup.d.ts +138 -0
  47. package/lib/core/backup.js +513 -0
  48. package/lib/core/boot-rescue.d.ts +146 -0
  49. package/lib/core/boot-rescue.js +618 -0
  50. package/lib/core/cache-cleaner.d.ts +31 -0
  51. package/lib/core/cache-cleaner.js +95 -0
  52. package/lib/core/config-lifecycle.d.ts +180 -0
  53. package/lib/core/config-lifecycle.js +481 -0
  54. package/lib/core/config-snapshot.d.ts +135 -0
  55. package/lib/core/config-snapshot.js +424 -0
  56. package/lib/core/config-state.d.ts +70 -0
  57. package/lib/core/config-state.js +177 -0
  58. package/lib/core/consult-source.d.ts +58 -0
  59. package/lib/core/consult-source.js +260 -0
  60. package/lib/core/crash-report.d.ts +84 -0
  61. package/lib/core/crash-report.js +317 -0
  62. package/lib/core/exporter.d.ts +68 -0
  63. package/lib/core/exporter.js +375 -0
  64. package/lib/core/ghost-sweep.d.ts +19 -0
  65. package/lib/core/ghost-sweep.js +52 -0
  66. package/lib/core/importer.d.ts +60 -0
  67. package/lib/core/importer.js +29 -0
  68. package/lib/core/index.d.ts +14 -0
  69. package/lib/core/index.js +14 -0
  70. package/lib/core/journal.d.ts +197 -0
  71. package/lib/core/journal.js +418 -0
  72. package/lib/core/local-plugin-host.d.ts +35 -0
  73. package/lib/core/local-plugin-host.js +120 -0
  74. package/lib/core/local-plugin-pack.d.ts +135 -0
  75. package/lib/core/local-plugin-pack.js +278 -0
  76. package/lib/core/messages.d.ts +310 -0
  77. package/lib/core/messages.js +621 -0
  78. package/lib/core/migration-consult.d.ts +117 -0
  79. package/lib/core/migration-consult.js +363 -0
  80. package/lib/core/migration-history.d.ts +153 -0
  81. package/lib/core/migration-history.js +411 -0
  82. package/lib/core/model-tools.d.ts +50 -0
  83. package/lib/core/model-tools.js +148 -0
  84. package/lib/core/msg-types.d.ts +8 -0
  85. package/lib/core/msg-types.js +6 -0
  86. package/lib/core/phase3-child-crash.d.ts +1 -0
  87. package/lib/core/phase3-child-crash.js +87 -0
  88. package/lib/core/phase3-host.d.ts +138 -0
  89. package/lib/core/phase3-host.js +359 -0
  90. package/lib/core/phase3-prod-child.d.ts +1 -0
  91. package/lib/core/phase3-prod-child.js +35 -0
  92. package/lib/core/phase4-crash-child.d.ts +1 -0
  93. package/lib/core/phase4-crash-child.js +103 -0
  94. package/lib/core/plugin-cli.d.ts +150 -0
  95. package/lib/core/plugin-cli.js +497 -0
  96. package/lib/core/reconcile.d.ts +120 -0
  97. package/lib/core/reconcile.js +389 -0
  98. package/lib/core/recovery-orchestrator.d.ts +94 -0
  99. package/lib/core/recovery-orchestrator.js +327 -0
  100. package/lib/core/restore.d.ts +162 -0
  101. package/lib/core/restore.js +703 -0
  102. package/lib/core/rollback.d.ts +12 -0
  103. package/lib/core/rollback.js +145 -0
  104. package/lib/core/run-registry.d.ts +85 -0
  105. package/lib/core/run-registry.js +157 -0
  106. package/lib/core/startup-barrier.d.ts +53 -0
  107. package/lib/core/startup-barrier.js +77 -0
  108. package/lib/core/types.d.ts +515 -0
  109. package/lib/core/types.js +27 -0
  110. package/lib/core/undo.d.ts +73 -0
  111. package/lib/core/undo.js +87 -0
  112. package/lib/core/validator.d.ts +18 -0
  113. package/lib/core/validator.js +77 -0
  114. package/lib/core/verify-recovery.d.ts +21 -0
  115. package/lib/core/verify-recovery.js +256 -0
  116. package/lib/core/watcher.d.ts +101 -0
  117. package/lib/core/watcher.js +219 -0
  118. package/lib/index.d.ts +238 -0
  119. package/lib/index.js +2764 -0
  120. package/lib/migrations/index.d.ts +29 -0
  121. package/lib/migrations/index.js +56 -0
  122. package/lib/migrations/v1-to-v2.d.ts +9 -0
  123. package/lib/migrations/v1-to-v2.js +10 -0
  124. package/lib/profiles/index.d.ts +4 -0
  125. package/lib/profiles/index.js +5 -0
  126. package/lib/profiles/profile-manager.d.ts +106 -0
  127. package/lib/profiles/profile-manager.js +543 -0
  128. package/lib/schema/config.d.ts +28 -0
  129. package/lib/schema/config.js +165 -0
  130. package/lib/schema/index.d.ts +24 -0
  131. package/lib/schema/index.js +26 -0
  132. package/lib/schema/manifest.d.ts +28 -0
  133. package/lib/schema/manifest.js +109 -0
  134. package/lib/schema/tombstones.d.ts +46 -0
  135. package/lib/schema/tombstones.js +64 -0
  136. package/lib/schema/types.d.ts +232 -0
  137. package/lib/schema/types.js +8 -0
  138. package/lib/schema/versions.d.ts +27 -0
  139. package/lib/schema/versions.js +50 -0
  140. package/lib/security/encryption.d.ts +85 -0
  141. package/lib/security/encryption.js +279 -0
  142. package/lib/security/index.d.ts +16 -0
  143. package/lib/security/index.js +17 -0
  144. package/lib/security/integrity.d.ts +30 -0
  145. package/lib/security/integrity.js +78 -0
  146. package/lib/security/redaction.d.ts +26 -0
  147. package/lib/security/redaction.js +95 -0
  148. package/lib/security/secret-scanner.d.ts +86 -0
  149. package/lib/security/secret-scanner.js +404 -0
  150. package/lib/security/vault.d.ts +59 -0
  151. package/lib/security/vault.js +151 -0
  152. package/lib/security/zip-security.d.ts +27 -0
  153. package/lib/security/zip-security.js +154 -0
  154. package/lib/sync/autosync-config.d.ts +39 -0
  155. package/lib/sync/autosync-config.js +151 -0
  156. package/lib/sync/autosync-scheduler.d.ts +139 -0
  157. package/lib/sync/autosync-scheduler.js +564 -0
  158. package/lib/sync/fs.d.ts +18 -0
  159. package/lib/sync/fs.js +49 -0
  160. package/lib/sync/git/git-transport.d.ts +100 -0
  161. package/lib/sync/git/git-transport.js +437 -0
  162. package/lib/sync/github-auth.d.ts +131 -0
  163. package/lib/sync/github-auth.js +264 -0
  164. package/lib/sync/layout.d.ts +43 -0
  165. package/lib/sync/layout.js +203 -0
  166. package/lib/sync/snapshot-json.d.ts +9 -0
  167. package/lib/sync/snapshot-json.js +107 -0
  168. package/lib/sync/sync-config.d.ts +81 -0
  169. package/lib/sync/sync-config.js +281 -0
  170. package/lib/sync/sync-engine.d.ts +269 -0
  171. package/lib/sync/sync-engine.js +591 -0
  172. package/lib/sync/sync-history.d.ts +42 -0
  173. package/lib/sync/sync-history.js +78 -0
  174. package/lib/sync/sync-selection.d.ts +29 -0
  175. package/lib/sync/sync-selection.js +127 -0
  176. package/lib/sync/sync-session.d.ts +40 -0
  177. package/lib/sync/sync-session.js +54 -0
  178. package/lib/sync/sync-state.d.ts +37 -0
  179. package/lib/sync/sync-state.js +108 -0
  180. package/lib/sync/transport.d.ts +75 -0
  181. package/lib/sync/transport.js +55 -0
  182. package/lib/sync/ui-prefs.d.ts +34 -0
  183. package/lib/sync/ui-prefs.js +109 -0
  184. package/lib/sync/webdav/webdav-transport.d.ts +77 -0
  185. package/lib/sync/webdav/webdav-transport.js +451 -0
  186. package/lib/ui/errors.d.ts +19 -0
  187. package/lib/ui/errors.js +81 -0
  188. package/lib/ui/export-flow.d.ts +82 -0
  189. package/lib/ui/export-flow.js +98 -0
  190. package/lib/ui/i18n.d.ts +289 -0
  191. package/lib/ui/i18n.js +581 -0
  192. package/lib/ui/migration-consult-view.d.ts +91 -0
  193. package/lib/ui/migration-consult-view.js +115 -0
  194. package/lib/ui/progress.d.ts +38 -0
  195. package/lib/ui/progress.js +87 -0
  196. package/lib/ui/report.d.ts +23 -0
  197. package/lib/ui/report.js +153 -0
  198. package/lib/ui/test-helpers.d.ts +69 -0
  199. package/lib/ui/test-helpers.js +154 -0
  200. package/lib/ui/types.d.ts +257 -0
  201. package/lib/ui/types.js +21 -0
  202. package/lib/utils/atomic-write.d.ts +88 -0
  203. package/lib/utils/atomic-write.js +399 -0
  204. package/lib/utils/env-lock.d.ts +393 -0
  205. package/lib/utils/env-lock.js +930 -0
  206. package/lib/utils/hashing.d.ts +17 -0
  207. package/lib/utils/hashing.js +41 -0
  208. package/lib/utils/json.d.ts +24 -0
  209. package/lib/utils/json.js +76 -0
  210. package/lib/utils/logger.d.ts +39 -0
  211. package/lib/utils/logger.js +82 -0
  212. package/lib/utils/paths.d.ts +42 -0
  213. package/lib/utils/paths.js +189 -0
  214. package/lib/utils/proxy.d.ts +69 -0
  215. package/lib/utils/proxy.js +455 -0
  216. package/lib/utils/recursive-walk.d.ts +24 -0
  217. package/lib/utils/recursive-walk.js +134 -0
  218. package/lib/utils/zip.d.ts +54 -0
  219. package/lib/utils/zip.js +285 -0
  220. package/package.json +188 -0
  221. package/src/adapters/agent-instructions.ts +48 -0
  222. package/src/adapters/agent-presets.ts +14 -0
  223. package/src/adapters/credentials.test.ts +90 -0
  224. package/src/adapters/credentials.ts +143 -0
  225. package/src/adapters/file-collection.ts +137 -0
  226. package/src/adapters/files.test.ts +353 -0
  227. package/src/adapters/index.ts +94 -0
  228. package/src/adapters/link-report.test.ts +65 -0
  229. package/src/adapters/link-report.ts +61 -0
  230. package/src/adapters/mcp.test.ts +96 -0
  231. package/src/adapters/mcp.ts +185 -0
  232. package/src/adapters/plugin-files.ts +146 -0
  233. package/src/adapters/plugins.test.ts +326 -0
  234. package/src/adapters/plugins.ts +615 -0
  235. package/src/adapters/pnpm-workspace.test.ts +87 -0
  236. package/src/adapters/pnpm-workspace.ts +150 -0
  237. package/src/adapters/prompts.test.ts +110 -0
  238. package/src/adapters/prompts.ts +230 -0
  239. package/src/adapters/providers.test.ts +126 -0
  240. package/src/adapters/providers.ts +173 -0
  241. package/src/adapters/roundtrip.test.ts +190 -0
  242. package/src/adapters/self.test.ts +92 -0
  243. package/src/adapters/self.ts +75 -0
  244. package/src/adapters/sessions.ts +15 -0
  245. package/src/adapters/settings.test.ts +100 -0
  246. package/src/adapters/settings.ts +187 -0
  247. package/src/adapters/skills.ts +14 -0
  248. package/src/adapters/test-helpers.ts +248 -0
  249. package/src/adapters/ui.test.ts +57 -0
  250. package/src/adapters/ui.ts +108 -0
  251. package/src/adapters/workspaces.test.ts +106 -0
  252. package/src/adapters/workspaces.ts +109 -0
  253. package/src/client/ConfigManagerSection.tsx +90 -0
  254. package/src/client/api.ts +66 -0
  255. package/src/client/client-types.ts +18 -0
  256. package/src/client/common/ErrorBanner.tsx +73 -0
  257. package/src/client/common/Icon.tsx +129 -0
  258. package/src/client/common/Modal.tsx +173 -0
  259. package/src/client/common/ToastViewport.tsx +73 -0
  260. package/src/client/common/toast-store.test.ts +192 -0
  261. package/src/client/common/toast-store.ts +181 -0
  262. package/src/client/common/toast-types.ts +7 -0
  263. package/src/client/common/ui.tsx +342 -0
  264. package/src/client/config-manager.module.css +2971 -0
  265. package/src/client/css-modules.d.ts +8 -0
  266. package/src/client/index.ts +65 -0
  267. package/src/client/locales.ts +56 -0
  268. package/src/client/lucide-icons.d.ts +38 -0
  269. package/src/client/run-store.test.ts +223 -0
  270. package/src/client/run-store.ts +372 -0
  271. package/src/client/sync/SyncConfirmView.tsx +379 -0
  272. package/src/client/sync/SyncHistoryView.test.ts +40 -0
  273. package/src/client/sync/SyncHistoryView.tsx +220 -0
  274. package/src/client/sync/SyncSettingsView.tsx +1535 -0
  275. package/src/client/sync/history-model.test.ts +194 -0
  276. package/src/client/sync/history-model.ts +195 -0
  277. package/src/client/sync/sync-api.test.ts +585 -0
  278. package/src/client/sync/sync-api.ts +543 -0
  279. package/src/client/sync/sync-locales.ts +416 -0
  280. package/src/client/sync/sync-push-preview.test.ts +52 -0
  281. package/src/client/sync/sync-view-v2.test.ts +213 -0
  282. package/src/client/sync/sync-view.test.ts +487 -0
  283. package/src/client/sync/sync-view.ts +759 -0
  284. package/src/core/analyzer.ts +1068 -0
  285. package/src/core/backup.ts +605 -0
  286. package/src/core/boot-rescue.test.ts +847 -0
  287. package/src/core/boot-rescue.ts +737 -0
  288. package/src/core/cache-cleaner.test.ts +169 -0
  289. package/src/core/cache-cleaner.ts +121 -0
  290. package/src/core/config-lifecycle.test.ts +727 -0
  291. package/src/core/config-lifecycle.ts +573 -0
  292. package/src/core/config-snapshot.test.ts +369 -0
  293. package/src/core/config-snapshot.ts +522 -0
  294. package/src/core/config-state.test.ts +381 -0
  295. package/src/core/config-state.ts +207 -0
  296. package/src/core/consult-source.test.ts +199 -0
  297. package/src/core/consult-source.ts +293 -0
  298. package/src/core/crash-report.test.ts +380 -0
  299. package/src/core/crash-report.ts +369 -0
  300. package/src/core/exporter.ts +417 -0
  301. package/src/core/ghost-sweep.test.ts +94 -0
  302. package/src/core/ghost-sweep.ts +67 -0
  303. package/src/core/importer.ts +83 -0
  304. package/src/core/index.ts +56 -0
  305. package/src/core/journal.test.ts +257 -0
  306. package/src/core/journal.ts +518 -0
  307. package/src/core/local-plugin-host.ts +152 -0
  308. package/src/core/local-plugin-pack.test.ts +359 -0
  309. package/src/core/local-plugin-pack.ts +363 -0
  310. package/src/core/messages.test.ts +54 -0
  311. package/src/core/messages.ts +664 -0
  312. package/src/core/migration-consult.test.ts +315 -0
  313. package/src/core/migration-consult.ts +494 -0
  314. package/src/core/migration-history.test.ts +319 -0
  315. package/src/core/migration-history.ts +484 -0
  316. package/src/core/model-tools.test.ts +190 -0
  317. package/src/core/model-tools.ts +208 -0
  318. package/src/core/msg-types.ts +10 -0
  319. package/src/core/phase3-child-crash.ts +95 -0
  320. package/src/core/phase3-host.ts +411 -0
  321. package/src/core/phase3-p1.test.ts +212 -0
  322. package/src/core/phase3-p2b-fingerprint.test.ts +189 -0
  323. package/src/core/phase3-prod-child.ts +36 -0
  324. package/src/core/phase3-production-integration.test.ts +286 -0
  325. package/src/core/phase4-crash-child.ts +101 -0
  326. package/src/core/phase4-crash-injection.test.ts +166 -0
  327. package/src/core/plugin-cli.fs.test.ts +184 -0
  328. package/src/core/plugin-cli.test.ts +137 -0
  329. package/src/core/plugin-cli.ts +563 -0
  330. package/src/core/reconcile.test.ts +392 -0
  331. package/src/core/reconcile.ts +498 -0
  332. package/src/core/recovery-orchestrator.test.ts +145 -0
  333. package/src/core/recovery-orchestrator.ts +366 -0
  334. package/src/core/restore-manage.test.ts +94 -0
  335. package/src/core/restore.ts +849 -0
  336. package/src/core/rollback.ts +151 -0
  337. package/src/core/run-progress.test.ts +237 -0
  338. package/src/core/run-registry.test.ts +232 -0
  339. package/src/core/run-registry.ts +209 -0
  340. package/src/core/smoke.test.ts +842 -0
  341. package/src/core/startup-barrier.ts +99 -0
  342. package/src/core/types.ts +542 -0
  343. package/src/core/undo.ts +116 -0
  344. package/src/core/validator.ts +84 -0
  345. package/src/core/verify-recovery.ts +265 -0
  346. package/src/core/watcher.test.ts +326 -0
  347. package/src/core/watcher.ts +263 -0
  348. package/src/index.facade.test.ts +265 -0
  349. package/src/index.sync.test.ts +217 -0
  350. package/src/index.ts +2975 -0
  351. package/src/migrations/index.ts +71 -0
  352. package/src/migrations/v1-to-v2.ts +17 -0
  353. package/src/profiles/index.ts +8 -0
  354. package/src/profiles/profile-manager.test.ts +282 -0
  355. package/src/profiles/profile-manager.ts +630 -0
  356. package/src/schema/config.ts +165 -0
  357. package/src/schema/index.ts +71 -0
  358. package/src/schema/manifest-schema.test.ts +519 -0
  359. package/src/schema/manifest.ts +124 -0
  360. package/src/schema/tombstones.test.ts +131 -0
  361. package/src/schema/tombstones.ts +89 -0
  362. package/src/schema/types.ts +245 -0
  363. package/src/schema/versions.ts +55 -0
  364. package/src/security/encryption.ts +335 -0
  365. package/src/security/index.ts +16 -0
  366. package/src/security/integrity.ts +102 -0
  367. package/src/security/redaction.ts +101 -0
  368. package/src/security/secret-scanner.ts +445 -0
  369. package/src/security/security.test.ts +1215 -0
  370. package/src/security/vault.test.ts +164 -0
  371. package/src/security/vault.ts +198 -0
  372. package/src/security/zip-security.ts +180 -0
  373. package/src/sync/autosync-config.test.ts +147 -0
  374. package/src/sync/autosync-config.ts +179 -0
  375. package/src/sync/autosync-scheduler.test.ts +490 -0
  376. package/src/sync/autosync-scheduler.ts +646 -0
  377. package/src/sync/fs.ts +48 -0
  378. package/src/sync/git/git-transport.test.ts +673 -0
  379. package/src/sync/git/git-transport.ts +491 -0
  380. package/src/sync/github-auth.test.ts +280 -0
  381. package/src/sync/github-auth.ts +356 -0
  382. package/src/sync/layout.test.ts +270 -0
  383. package/src/sync/layout.ts +222 -0
  384. package/src/sync/snapshot-json.test.ts +119 -0
  385. package/src/sync/snapshot-json.ts +128 -0
  386. package/src/sync/sync-config.test.ts +310 -0
  387. package/src/sync/sync-config.ts +299 -0
  388. package/src/sync/sync-engine.test.ts +1074 -0
  389. package/src/sync/sync-engine.ts +754 -0
  390. package/src/sync/sync-history.test.ts +116 -0
  391. package/src/sync/sync-history.ts +120 -0
  392. package/src/sync/sync-selection.test.ts +186 -0
  393. package/src/sync/sync-selection.ts +143 -0
  394. package/src/sync/sync-session.test.ts +143 -0
  395. package/src/sync/sync-session.ts +77 -0
  396. package/src/sync/sync-state.test.ts +164 -0
  397. package/src/sync/sync-state.ts +131 -0
  398. package/src/sync/transport.test.ts +111 -0
  399. package/src/sync/transport.ts +118 -0
  400. package/src/sync/ui-prefs.test.ts +152 -0
  401. package/src/sync/ui-prefs.ts +135 -0
  402. package/src/sync/webdav/webdav-transport.test.ts +871 -0
  403. package/src/sync/webdav/webdav-transport.ts +535 -0
  404. package/src/ui/errors.test.ts +47 -0
  405. package/src/ui/errors.ts +100 -0
  406. package/src/ui/export-flow.test.ts +87 -0
  407. package/src/ui/export-flow.ts +156 -0
  408. package/src/ui/i18n.ts +590 -0
  409. package/src/ui/migration-consult-view.test.ts +151 -0
  410. package/src/ui/migration-consult-view.ts +178 -0
  411. package/src/ui/progress.test.ts +47 -0
  412. package/src/ui/progress.ts +102 -0
  413. package/src/ui/report.test.ts +101 -0
  414. package/src/ui/report.ts +146 -0
  415. package/src/ui/test-helpers.ts +184 -0
  416. package/src/ui/types.ts +325 -0
  417. package/src/utils/atomic-write.test.ts +312 -0
  418. package/src/utils/atomic-write.ts +422 -0
  419. package/src/utils/env-lock.test.ts +999 -0
  420. package/src/utils/env-lock.ts +1086 -0
  421. package/src/utils/hashing.ts +53 -0
  422. package/src/utils/json.ts +77 -0
  423. package/src/utils/logger.ts +114 -0
  424. package/src/utils/paths.ts +176 -0
  425. package/src/utils/proxy.test.ts +465 -0
  426. package/src/utils/proxy.ts +493 -0
  427. package/src/utils/recursive-walk.test.ts +148 -0
  428. package/src/utils/recursive-walk.ts +145 -0
  429. package/src/utils/zip.ts +332 -0
@@ -0,0 +1,310 @@
1
+ /**
2
+ * 核心引擎双语消息目录(zh 源语言 / en 镜像)。
3
+ *
4
+ * 背景:核心引擎(src/core、src/adapters、src/sync)是「零 DSH 运行时依赖」的
5
+ * 纯引擎层,不能使用 ctx.locale(客户端服务)。所有会流到 UI 报告 / 错误 / 手动提示
6
+ * 的动态字符串集中于本目录:引擎代码经注入的 MsgFunc 生成消息,宿主按 DSH 应用
7
+ * 语言(settings `locale` 命名空间的 preference)注入 zh/en 目录。
8
+ *
9
+ * 纪律:
10
+ * - zh 值 = 既有中文文案原样(缺省行为/测试断言不变);
11
+ * - en 值类型为 Record<keyof typeof zh, string> —— 缺键/多键即编译错误;
12
+ * - 消息以 {param} 插值,缺失参数原样保留,便于排查;
13
+ * - 未知键回退 zh,再回退键名本身(绝不抛错)。
14
+ */
15
+ import type { MsgFunc } from './msg-types.ts';
16
+ export type { MsgFunc, MsgParams } from './msg-types.ts';
17
+ export declare const zh: {
18
+ readonly 'export.encryptionRequired': '导出包含秘密需要注入 EncryptionProvider(m4 实现),拒绝明文导出秘密';
19
+ readonly 'export.sectionFailed': '分区 {adapter} 导出失败: {reason}';
20
+ readonly 'export.credentialsReadFailed': '读取凭据文件失败,跳过秘密导出: {reason}';
21
+ readonly 'export.vaultRefreshed': '凭据明文未进入备份,已镜像到本机 vault({count} 个文件,恢复时可回填)';
22
+ readonly 'export.vaultRefreshSkipped': 'vault 镜像跳过 {rel}: {reason}';
23
+ readonly 'export.vaultRefreshFailed': 'vault 镜像刷新失败(不影响导出): {reason}';
24
+ readonly 'export.fileSectionSecrets': '文件类分区 {section} 中检测到疑似凭据: {path}';
25
+ readonly 'import.readFailed': '无法读取备份文件 "{zip}": {reason}';
26
+ readonly 'import.noManifest': '备份缺少 manifest.json,不是有效的 DSH Config Manager 备份';
27
+ readonly 'import.manifestParseFailed': 'manifest.json 解析失败: {reason}';
28
+ readonly 'import.integrityFailed': '备份完整性校验失败: {entries}';
29
+ readonly 'import.schemaUnsupported': '备份 {version},无法导入(当前支持 v1)';
30
+ readonly 'import.executableWarning': '备份包含可执行文件 "{name}",本插件不会执行它';
31
+ readonly 'import.sectionParseFailed': '分区 {section} 数据解析失败: {reason}';
32
+ readonly 'import.sectionInvalid': '分区 {section} 数据无效: {issues}';
33
+ readonly 'import.adapterAnalyzeFailed': '{adapter}: 分析失败 {reason}';
34
+ readonly 'import.adapterValidationIssue': '{adapter}: {message}';
35
+ readonly 'import.versionUnsupported': '{version}:无法导入';
36
+ readonly 'import.missingSections': '备份声明了但缺少的分区: {sections}';
37
+ readonly 'import.unsupportedSections': '备份包含本版本不支持的分区: {sections}(已跳过,未导入)';
38
+ readonly 'import.unsupportedSectionVersion': '分区 {section} 的数据版本 {version} 高于本版本支持的 1(已跳过该分区)';
39
+ readonly 'import.checksumsMissing': '备份未提供完整性校验表,全部条目未被校验';
40
+ readonly 'import.extraEntries': 'ZIP 内含未登记进校验表的条目: {entries}(未被校验)';
41
+ readonly 'import.migrated': '备份 schema 已从 v{from} 迁移到 v{to}';
42
+ readonly 'import.migrateInvalidManifest': '迁移后的 manifest 不合法: {issues}';
43
+ readonly 'import.postValidationIssue': '导入后校验 {adapter}: {message}';
44
+ readonly 'import.postValidationFailed': '导入后校验 {adapter} 失败: {reason}';
45
+ readonly 'import.conflictKeepCurrent': '(用户选择保留当前)';
46
+ readonly 'import.conflictSkipExisting': '(skipExisting 策略)';
47
+ readonly 'import.conflictReplace': '(replace 策略)';
48
+ readonly 'import.secretMissingDesc': '凭据 {ref} 需要补录';
49
+ readonly 'import.secretNotProvided': '凭据未提供,需补录';
50
+ readonly 'import.notConfirmed': '导入未确认:必须显式 confirm 后才允许修改任何数据';
51
+ readonly 'import.encryptedPasswordRequired': '该备份已加密,必须提供解密密码才能导入(拒绝无密码导入)';
52
+ readonly 'import.encryptedPasswordWrong': '解密密码错误,请重试';
53
+ readonly 'import.notEncryptedContainer': '该文件不是加密备份容器,无法解锁';
54
+ readonly 'import.userSkipped': '用户跳过(导入中点击「跳过当前插件」)';
55
+ readonly 'import.userSkippedDetail': '插件 {name} 已由用户跳过,未安装';
56
+ readonly 'import.vaultRestored': '凭据文件 {rel} 已从本机 vault 回填';
57
+ readonly 'import.vaultMissing': '凭据文件 {rel} 不在本机 vault(跨机恢复需人工重填)';
58
+ readonly 'import.vaultBackfillFailed': 'vault 凭据回填失败(不影响导入结果): {reason}';
59
+ readonly 'rollback.ns.createdNoDelete': '该 namespace 由导入创建,DSH settings 无删除语义';
60
+ readonly 'rollback.ns.manualHint': 'namespace "{ref}" 需人工删除或合并';
61
+ readonly 'rollback.ns.conflictHint': 'settings namespace "{ref}" 需人工核对';
62
+ readonly 'rollback.cred.noReadback': 'DSH 不回读凭据值,无法自动恢复';
63
+ readonly 'rollback.cred.manualHint': '凭据 "{ref}" 请人工重新填写';
64
+ readonly 'rollback.patch.manualHint': 'patch 行 "{ref}" 需人工核对';
65
+ readonly 'rollback.file.manualHint': '文件 "{ref}" 需人工恢复';
66
+ readonly 'rollback.workspace.manualHint': 'workspace "{ref}" 需人工核对';
67
+ readonly 'rollback.unknownEntry': '未知快照条目类型 {kind}';
68
+ readonly 'restore.snapshotInvalid': '快照 {dir} 的 snapshot.json 不是合法对象';
69
+ readonly 'restore.invalidSnapshotId': 'snapshotId 非法(禁止路径分隔符)/ invalid snapshotId';
70
+ readonly 'restore.pathEscape': '路径越界: {path}';
71
+ readonly 'restore.snapshotUntrusted': '快照不可信,拒绝恢复({verdict}):{reason}';
72
+ readonly 'restore.blobPathEscape': 'blob 路径越界: {path}';
73
+ readonly 'restore.hostSkipEscape': '宿主文件路径越界,跳过: {path}';
74
+ readonly 'restore.hostSkipEscapeDetail': '快照登记路径越界,拒绝恢复';
75
+ readonly 'restore.hostNoBlobInfo': '宿主文件 {path} 缺少 blob 副本,跳过';
76
+ readonly 'restore.hostBlobMissing': '宿主文件 {path} 的 blob 缺失,跳过';
77
+ readonly 'restore.hostRestore': '整文件还原 {path}';
78
+ readonly 'restore.backupBeforeWrite': '还原前将备份当前文件到 pre-restore/';
79
+ readonly 'restore.writeDirect': '当前文件不存在,直接写入';
80
+ readonly 'restore.hostRemove': '移除快照时不存在、现已出现的文件 {path}';
81
+ readonly 'restore.backupBeforeRemove': '删除前将备份当前文件到 pre-restore/';
82
+ readonly 'restore.hostSkipAbsent': '宿主文件 {path} 快照时不存在且当前也不存在,无动作';
83
+ readonly 'restore.settingsNotBacked': 'settings 文件 {path} 未被快照登记,无法整文件还原';
84
+ readonly 'restore.settingsNotBackedDetail': '该快照未备份此 settings 文件(可能当时不存在或宿主未暴露 profile)';
85
+ readonly 'restore.noBaseline': '旧快照无 beforePlugins 基线,无法自动卸载插件';
86
+ readonly 'restore.noBaselineDetail': '请人工核对导入期间新增的插件并逐个移除';
87
+ readonly 'restore.pluginRemove': '卸载导入期间新增插件 {name}';
88
+ readonly 'restore.pluginRemoveEmptyBaseline': '快照基线为空(导入前可能未捕获插件清单),请确认后执行';
89
+ readonly 'restore.noAddedPlugins': '无导入期间新增插件(当前已装插件 ⊆ 快照基线)';
90
+ readonly 'restore.fileSkipEscape': '文件条目路径越界,跳过: {adapter}:{ref}';
91
+ readonly 'restore.fileBlobMissing': '文件 {path} 的 blob 缺失,跳过';
92
+ readonly 'restore.fileRestore': '还原文件 {path}({adapter})';
93
+ readonly 'restore.fileRemove': '删除导入写入的文件 {path}({adapter})';
94
+ readonly 'restore.fileSkipAbsent': '文件 {path} 快照时不存在且当前也不存在,无动作';
95
+ readonly 'restore.fileNoBlobInfo': '文件 {path} 缺少 blob 副本信息,跳过';
96
+ readonly 'restore.credentialHint': '凭据 {ref} 需人工补录';
97
+ readonly 'restore.credentialManualHint': '凭据 "{ref}" 请人工重新填写(DSH 不回读凭据值)';
98
+ readonly 'restore.nsAggregate': '{count} 条 settings namespace 条目:快照无 settings 整文件备份,离线无法恢复';
99
+ readonly 'restore.nsAggregateDetail': '需经在线回滚(rollback.ts)或人工核对 settings.yaml';
100
+ readonly 'restore.patchAggregate': '{count} 条 patch 行条目:快照无 cordis.patch.yml 整文件备份,离线无法恢复';
101
+ readonly 'restore.patchAggregateDetail': '需经在线回滚(rollback.ts)或人工核对 patch 文件';
102
+ readonly 'restore.workspaceAggregate': '{count} 条 workspace 记录条目:离线无法恢复(数据在 DSH storages)';
103
+ readonly 'restore.workspaceAggregateDetail': '需经在线回滚(rollback.ts)或人工核对 workspace 注册表';
104
+ readonly 'restore.credentialAbsentAggregate': '{count} 条凭据快照时未配置:若导入已创建,需人工在 DSH 中删除';
105
+ readonly 'restore.uninstallFailedCode': 'dsh plugin remove {name} 失败({code}):{message}';
106
+ readonly 'restore.uninstallFailedExit': 'dsh plugin remove {name} 失败(exit {code}):{tail}';
107
+ readonly 'restore.noOutput': '无输出';
108
+ readonly 'restore.pluginRemoveFailed': '卸载失败';
109
+ readonly 'restore.unknownAction': '未知动作 {kind}: {description}';
110
+ readonly 'restore.missingTargetBlob': '恢复动作缺少 target/blobPath';
111
+ readonly 'restore.missingTarget': '恢复动作缺少 target';
112
+ readonly 'restore.missingPluginName': '恢复动作缺少插件名';
113
+ readonly 'restore.ghostSweepSummary': '发现 {count} 个幽灵会话(备份有记录、磁盘无文件),需人工在 DSH 确认清理:{keys}';
114
+ readonly 'run.conflict.export': '已有进行中的导出任务({runId}),请等待其完成后再试';
115
+ readonly 'run.conflict.import': '已有进行中的导入任务({runId}),请等待其完成后再试';
116
+ readonly 'run.notFound': 'run {runId} not found(可能已过保留期被清理)';
117
+ readonly 'host.exportTimeout': '导出超时(5 分钟):导出过程未完成,请重试;若反复超时请检查 profile 依赖状态';
118
+ readonly 'host.syncPushTimeout': '同步推送超时(5 分钟):请检查网络与仓库可达性后重试';
119
+ readonly 'host.syncPullTimeout': '同步拉取超时(5 分钟):请检查网络与仓库可达性后重试';
120
+ readonly 'host.workspaceUnavailable': 'workspaceRegistry 服务不可用,无法写入工作区';
121
+ readonly 'host.patchUnsupported': 'dsh-config-manager 仅支持管理 {user} 与 profile 的 {profile}(收到 {file})';
122
+ readonly 'host.fsPathEscape': '路径越界: {path}';
123
+ readonly 'host.activationRowFailed': '插件 {pkg} 已安装,但激活行写入 profile 补丁失败:{reason}(重启后该插件可能未激活;修复后重试安装即可幂等补行)';
124
+ readonly 'host.syncTokenWriteFailed': 'token 写入 DSH credentials 失败:{reason}(请在 DSH 凭据管理里配置 {ref} 后重试)';
125
+ readonly 'host.githubMissingClientId': '未配置 GitHub OAuth client_id:请在插件配置中设置 githubClientId(GitHub → Settings → Developer settings → OAuth Apps 注册应用获取)';
126
+ readonly 'host.githubFlowGone': 'GitHub 登录流程不存在或已过期,请重新开始';
127
+ readonly 'host.restoreBlobEscape': 'blob 路径越界: {blob}';
128
+ readonly 'host.restoreUninstallFailed': 'dsh plugin remove {name} 失败(exit {code}):{tail}';
129
+ readonly 'host.restoreNoOutput': '无输出';
130
+ readonly 'adapter.pluginListReadFailed': '插件清单读取失败: {reason}';
131
+ readonly 'adapter.patchReadFailed': 'patch 文件读取失败: {reason}';
132
+ readonly 'adapter.patchReadFailedPrompts': 'patch 文件读取失败,无法提取 prompts: {reason}';
133
+ readonly 'adapter.patchReadFailedMCP': 'patch 文件读取失败,无法提取 MCP: {reason}';
134
+ readonly 'adapter.pnpmReadFailed': 'pnpm-workspace.yaml 读取失败: {reason}';
135
+ readonly 'adapter.localPackFailed': '本地插件打包失败(已跳过,其余插件不受影响): {reason}';
136
+ readonly 'adapter.pluginLocalTarballHint': '(本地源插件,将用备份内自带的 tarball 安装)';
137
+ readonly 'adapter.providerNsReadFailed': 'provider namespace {ns} 读取失败(可能未配置): {reason}';
138
+ readonly 'adapter.credStatusReadFailed': '凭据 {ref} 状态读取失败: {reason}';
139
+ readonly 'adapter.settingsNsReadFailed': '设置 namespace {name} 读取失败: {reason}';
140
+ readonly 'adapter.dirEmpty': '{type} 目录为空或不存在';
141
+ readonly 'adapter.linksFollowed': '{type} 分区:已跟随 {count} 个链接目录收集内容(导入时按普通目录还原,链接结构不会重建)';
142
+ readonly 'adapter.linksSkipped': '{type} 分区:{count} 个链接被跳过,其内容**未进备份** —— {detail}';
143
+ readonly 'adapter.dirsUnreadable': '{type} 分区:{count} 个目录读取失败(权限/竞态),其内容**未进备份** —— {detail}';
144
+ readonly 'adapter.linkReason.loop': '自引用/重复链接';
145
+ readonly 'adapter.linkReason.outsideHome': '目标在 DSH home 之外';
146
+ readonly 'adapter.linkReason.broken': '断链';
147
+ readonly 'adapter.linkReason.unreadable': '目标既非文件也非目录';
148
+ readonly 'adapter.linkReason.tooDeep': '层级过深';
149
+ readonly 'adapter.noSettingsNamespaces': '未配置 settings namespace 清单,settings 分区为空';
150
+ readonly 'adapter.fileCreate': '创建{type}文件 {path}';
151
+ readonly 'adapter.fileSame': '文件 {path} 已一致';
152
+ readonly 'adapter.fileDiff': '文件 {path} 内容不同';
153
+ readonly 'adapter.pluginFileCreate': '创建插件配置文件 {path}';
154
+ readonly 'adapter.pluginFileReserved': '拒绝:{path} 落在内部 recovery/control-plane 保留区(快照/事务/锁/同步存储)';
155
+ readonly 'adapter.fileReserved': '拒绝:{path} 落在内部 recovery/control-plane 保留区(快照/事务/锁/同步存储)';
156
+ readonly 'adapter.mcpCreate': '创建 MCP server {serverName}';
157
+ readonly 'adapter.mcpSame': 'MCP server {serverName} 已一致';
158
+ readonly 'adapter.mcpDiff': 'MCP server {serverName} 与目标不同';
159
+ readonly 'adapter.pwCreate': '写入 pnpm-workspace.yaml(插件构建白名单/冷静期配置)';
160
+ readonly 'adapter.pwUpdate': '更新 pnpm-workspace.yaml(插件构建白名单/冷静期配置)';
161
+ readonly 'adapter.pluginInstall': '安装插件 {name}@{version}';
162
+ readonly 'adapter.pluginSame': '插件 {name} 已安装且版本一致';
163
+ readonly 'adapter.pluginDiff': '插件 {name} 版本不同';
164
+ readonly 'adapter.pluginVersionDetail': '当前 {current} vs 导入 {imported}';
165
+ readonly 'adapter.pluginBundleMember': '(bundle 成员,经聚合包安装)';
166
+ readonly 'adapter.pluginInstallOk': '插件 {name} 已安装{suffix}';
167
+ readonly 'adapter.pluginUpdateTriggered': '插件 {name} 已触发更新(npm 最新版){suffix}';
168
+ readonly 'adapter.pluginRestartSuffix': ',重启 dsh 后生效';
169
+ readonly 'adapter.pwMissing': '导入数据缺少 pnpm-workspace.yaml 内容';
170
+ readonly 'adapter.pluginInstallFailed': '插件 {name} 安装失败:{msg}。可手动安装:dsh plugin --profile {profile} add {name}(其余配置已导入;可修复依赖后在设置页重试或手动安装)';
171
+ readonly 'adapter.pluginUpdateFailed': '插件 {name} 更新失败:{msg}。可手动安装:dsh plugin --profile {profile} add {name}(其余配置已导入;可修复依赖后在设置页重试或手动安装)';
172
+ readonly 'adapter.patchLineCreate': '写入 patch 行 {lineId}';
173
+ readonly 'adapter.patchLineSame': 'patch 行 {lineId} 已一致';
174
+ readonly 'adapter.patchLineDiff': 'patch 行 {lineId} 与目标不同';
175
+ readonly 'adapter.promptSame': '提示词 {name} 已一致';
176
+ readonly 'adapter.promptDiff': '提示词 {name} 与目标不同';
177
+ readonly 'adapter.promptDiffWithLine': '提示词 {name} 与目标不同(目标位于行 {line})';
178
+ readonly 'adapter.promptCreate': '创建提示词 {name}(行 {line})';
179
+ readonly 'adapter.promptManual': '提示词 {name} 在目标无对应来源,请手动配置(DSH 无独立 prompt 存储)';
180
+ readonly 'adapter.providerUnregistered': 'Provider {route} 的命名空间 {ns} 在目标未注册(可能需要安装对应插件)';
181
+ readonly 'adapter.providerCreate': '创建 Provider {route}(namespace {ns})';
182
+ readonly 'adapter.providerSame': 'Provider {route} 已一致';
183
+ readonly 'adapter.providerDiff': 'Provider {route} 与目标不同';
184
+ readonly 'adapter.settingsUnregistered': '设置命名空间 {ns} 在目标未注册(可能需要安装提供它的插件)';
185
+ readonly 'adapter.settingsCreate': '创建设置 {name}';
186
+ readonly 'adapter.settingsSame': '设置 {name} 已一致';
187
+ readonly 'adapter.settingsDiff': '设置 {name} 与目标不同';
188
+ readonly 'adapter.workspaceCreate': '创建工作区 {title}({path})';
189
+ readonly 'adapter.workspaceSame': '工作区 {id} 已一致';
190
+ readonly 'adapter.workspaceDiff': '工作区 {id} 与目标不同';
191
+ readonly 'adapter.workspacePathMapping': '路径需映射: {path}';
192
+ readonly 'adapter.workspaceMissing': '导入数据缺少工作区 {ref}';
193
+ readonly 'adapter.credentialDescription': '凭据补录';
194
+ readonly 'adapter.missingTargetRef': '缺少 target.ref';
195
+ readonly 'adapter.dataMissingFile': '导入数据缺少文件 {ref}';
196
+ readonly 'adapter.patchMissing': '导入数据缺少 patch 行 {ref}';
197
+ readonly 'adapter.pwWritten': 'pnpm-workspace.yaml 已写入(插件安装将按该配置执行)';
198
+ readonly 'adapter.pwWriteFailed': 'pnpm-workspace.yaml 写入失败:{msg}(插件安装可能因此受阻,可修复后在设置页重试)';
199
+ readonly 'adapter.patchFileCreate': '写入 pnpm patch 文件 {path}';
200
+ readonly 'adapter.patchFileWriteFailed': 'pnpm patch 文件 {path} 写入失败:{reason}(对应的 patchedDependencies 声明会被移除)';
201
+ readonly 'adapter.patchFileMissing': 'pnpm patch 文件缺失,无法随备份迁移:{name} → {path}(该 patchedDependencies 条目导入时会被移除)';
202
+ readonly 'adapter.patchFileUnsafe': 'pnpm patch 路径不安全,已跳过:{name} → {path}';
203
+ readonly 'adapter.patchFileReadFailed': 'pnpm patch 文件读取失败:{name} → {path}({reason})';
204
+ readonly 'adapter.patchFileTooLarge': 'pnpm patch 文件过大,未随备份迁移:{name} → {path}(上限 {limit})';
205
+ readonly 'adapter.pwPatchesDropped': '已移除 {count} 条 patchedDependencies 声明(目标机没有对应 patch 文件,保留会让 pnpm 拒绝一切插件安装):{names}';
206
+ readonly 'adapter.pwPatchesDroppedDetail': '导入时会移除 {count} 条无法满足的 patchedDependencies 声明:{names}';
207
+ readonly 'adapter.pwPatchesUnsupported': 'patchedDependencies 为单行 flow 写法,无法安全剔除缺失条目;若目标机没有对应 patch 文件,pnpm 可能拒绝安装:{line}';
208
+ readonly 'adapter.pwWrittenPatchesDropped': 'pnpm-workspace.yaml 已写入,但移除了 {count} 条 patchedDependencies 声明(目标机没有对应 patch 文件):{names}';
209
+ readonly 'adapter.patchWritten': 'patch 行 {ref} 已写入(宿主热重载 patch,无需重启)';
210
+ readonly 'adapter.credentialValueMissing': '凭据值未提供(需补录)';
211
+ readonly 'adapter.promptWarningNoWrite': '提示项,无需写入';
212
+ readonly 'adapter.promptMissing': '导入数据缺少提示词 {id}';
213
+ readonly 'adapter.promptCreated': '提示词 {name} 已创建(行 {ref})';
214
+ readonly 'adapter.patchLineMissing': '目标 patch 行 {ref} 不存在,无法写入';
215
+ readonly 'adapter.promptWritten': '提示词 {name} 已写入 patch 行 {ref}';
216
+ readonly 'adapter.mcpMissing': '导入数据缺少 MCP server {serverName}';
217
+ readonly 'adapter.mcpWritten': 'MCP server {serverName} 已写入 patch(宿主热重载 patch,无需重启)';
218
+ readonly 'adapter.workspaceWriteFailed': '工作区 {ref} 未能写入:{msg}(需映射路径或先在目标创建目录)';
219
+ readonly 'adapter.providerMissing': '导入数据缺少 provider {route}';
220
+ readonly 'adapter.namespaceMissing': '导入数据缺少 namespace {ref}';
221
+ readonly 'adapter.validate.object': '{subject} 数据必须是对象';
222
+ readonly 'adapter.validate.fileSection': '文件分区数据必须是对象';
223
+ readonly 'adapter.validate.version': 'version 必须为 1(收到 {value})';
224
+ readonly 'adapter.validate.array': '{subject} 必须是数组';
225
+ readonly 'adapter.validate.string': '{subject} 必须是字符串';
226
+ readonly 'adapter.validate.localTarballPath': '本地插件 tarball 路径非法(须位于 local-plugins/ 之下且不含 ..): {path}';
227
+ readonly 'adapter.validate.missingObject': '缺少 {subject} 对象';
228
+ readonly 'adapter.validate.recordObject': '{subject} 记录必须是对象';
229
+ readonly 'adapter.validate.requiredField': '缺少 {subject}';
230
+ readonly 'adapter.validate.sourceNamespace': '缺少来源 namespace';
231
+ readonly 'adapter.validate.number': '{subject} 必须是数字';
232
+ readonly 'adapter.validate.nonEmptyRef': '{subject} 记录必须含非空 ref';
233
+ readonly 'adapter.validate.credentialRef': '凭据记录必须含非空 ref';
234
+ readonly 'adapter.validate.fileRelativePath': '文件记录必须含非空 relativePath';
235
+ readonly 'adapter.validate.promptIdentity': 'prompt 记录必须含字符串 name 与 text';
236
+ readonly 'adapter.validate.hasValueFalse': '值未导出,hasValue 必须为 false';
237
+ readonly 'adapter.validate.serverName': 'server 记录必须含非空 serverName';
238
+ readonly 'adapter.validate.workspaceIdentity': 'workspace 记录必须含字符串 id 与 path';
239
+ readonly 'adapter.validate.missingValue': '缺少 value';
240
+ readonly 'sync.denySensitiveSection': '同步拒绝携带敏感分区 {section}(secret 值永不参与同步)';
241
+ readonly 'sync.sectionFailed': '分区 {adapter} 导出失败: {reason}';
242
+ readonly 'sync.unknownSection': '分区 {section} 不存在,已跳过,不参与同步';
243
+ readonly 'sync.noSections': '没有可同步的分区(全部导出失败)';
244
+ readonly 'sync.legacyEncryptedSnapshot': '快照 {id} 是旧版加密快照,当前同步通道不产生也不读取加密快照(请在旧版本中改用明文通道重新推送)';
245
+ readonly 'sync.remoteEmpty': '远端无快照';
246
+ readonly 'sync.missingImporter': 'SyncEngine 缺少 importer:pull 需要注入 Importer(analyzeImport/createImportPlan)';
247
+ readonly 'sync.missingCtx': 'SyncEngine 需要 ctx';
248
+ readonly 'sync.missingTransport': 'SyncEngine 需要完整 SyncTransport(list/upload/download/delete)';
249
+ readonly 'sync.missingStateDir': 'SyncEngine 需要 stateDir';
250
+ readonly 'sync.unchanged': '远端快照与本地一致(无变更)';
251
+ readonly 'sync.changesSummary': 'compatibility={compatibility},共 {count} 项变更';
252
+ readonly 'sync.configWhitespace': '仓库地址不能包含空白字符';
253
+ readonly 'sync.configUnparseable': '无法解析仓库地址: {url}';
254
+ readonly 'sync.configUserinfo': '请勿在仓库地址中包含用户名/密码(认证 token 请使用凭据字段,不会拼入地址)';
255
+ readonly 'sync.state.notObject': 'sync-state.json 损坏:必须是对象';
256
+ readonly 'sync.state.schemaUnsupported': 'sync-state.json schemaVersion 不支持: {version}(期望 {expected})';
257
+ readonly 'sync.state.lastSyncAt': 'sync-state.json 损坏:lastSyncAt 必须是字符串';
258
+ readonly 'sync.state.sections': 'sync-state.json 损坏:sections 必须是对象';
259
+ readonly 'sync.state.sectionRecord': 'sync-state.json 损坏:分区 {section} 记录必须是对象';
260
+ readonly 'sync.state.sectionFields': 'sync-state.json 损坏:分区 {section} 记录必须含字符串 hash/updatedAt';
261
+ readonly 'sync.state.transport': 'sync-state.json 损坏:transport 必须含字符串 type/ref';
262
+ readonly 'sync.git.repoUrlRequired': 'repoUrl 必须是非空字符串';
263
+ readonly 'sync.git.workDirRequired': 'workDir 必须是非空字符串';
264
+ readonly 'sync.git.credentialsRequired': 'credentials 必须提供 getToken()';
265
+ readonly 'sync.git.snapshotMissing': '快照 {id} 不存在(本地工作副本 {dir})';
266
+ readonly 'sync.git.snapshotCorrupt': '加密快照 {id} 损坏({dir}): {err}';
267
+ readonly 'sync.git.repoUnreachable': '仓库不可达或认证失败: {url}';
268
+ readonly 'sync.git.workDirNotRepo': 'workDir 不是 git 仓库(缺少 .git)且目录非空,无法 clone: {dir}';
269
+ readonly 'sync.git.pullFailed': 'git pull 失败: {err}';
270
+ readonly 'sync.git.cmdFailed': 'git {args} 失败 (exit {code}): {err}';
271
+ readonly 'sync.git.repoUrlInvalid': '无法解析 repoUrl(http(s) 仓库必须为合法 URL): {url}';
272
+ readonly 'sync.git.invalidSnapshotId': '非法快照 id: {id}(仅允许字母数字开头,字符限 . _ -)';
273
+ readonly 'sync.webdav.baseUrlRequired': 'baseUrl 必须是非空字符串';
274
+ readonly 'sync.webdav.baseUrlInvalid': '无法解析 baseUrl(必须为合法 http(s) URL): {url}';
275
+ readonly 'sync.webdav.baseUrlUserinfo': '请勿在 baseUrl 中包含用户名/密码(认证走凭据字段,不会拼入地址)';
276
+ readonly 'sync.webdav.usernameRequired': 'username 必须是非空字符串';
277
+ readonly 'sync.webdav.credentialsRequired': 'credentials 必须提供 getPassword()';
278
+ readonly 'sync.webdav.invalidSnapshotId': '非法快照 id: {id}(仅允许字母数字开头,字符限 . _ -)';
279
+ readonly 'sync.webdav.snapshotMissing': '快照 {id} 不存在({url})';
280
+ readonly 'sync.webdav.requestFailed': '{method} {url} 失败 (HTTP {status}): {err}';
281
+ readonly 'sync.webdav.requestError': '{method} {url} 请求出错: {err}';
282
+ readonly 'sync.webdav.timeout': '{method} {url} 请求超时({timeout}ms)';
283
+ readonly 'sync.webdav.tooManyRedirects': '{method} {url} 重定向超过 {n} 次上限,疑似跳转循环';
284
+ readonly 'sync.webdav.indexInvalid': '{url} 解析失败或结构非法: {err}';
285
+ readonly 'sync.webdav.snapshotInvalid': '快照 {id} 解析失败或结构非法: {err}';
286
+ readonly 'sync.pruneListFailed': '远端快照裁剪失败:无法列出远端快照,{reason}';
287
+ readonly 'sync.pruneDeleteFailed': '远端快照裁剪失败:删除快照 {id} 失败,{reason}';
288
+ readonly 'market.invalidItemId': '非法市场条目 id: {id}(仅允许字母数字开头,字符限 . _ -)';
289
+ readonly 'market.urlWhitespace': '市场仓库地址不能包含空白字符';
290
+ readonly 'market.urlUnparseable': '无法解析市场仓库地址: {url}';
291
+ readonly 'market.urlUserinfo': '请勿在市场仓库地址中包含用户名/密码(公开市场无需凭据;token 不会拼入地址)';
292
+ readonly 'market.repoUnreachable': '市场仓库不可达: {url}';
293
+ readonly 'market.cloneFailed': '市场仓库拉取(clone)失败: {err}';
294
+ readonly 'market.pullFailed': '市场仓库同步(pull)失败: {err}';
295
+ readonly 'market.workDirNotRepo': '市场工作目录非空且不是 git 仓库,无法 clone: {dir}';
296
+ readonly 'market.missingIndex': '市场缺少 index.json: {url}';
297
+ readonly 'market.missingManifest': '条目 {id} 缺少 manifest.json';
298
+ readonly 'market.missingZip': '条目 {id} 缺少 config.zip';
299
+ readonly 'market.zipTooLarge': 'config.zip 体积 {size} 超过上限 {limit} 字节';
300
+ readonly 'market.invalid': '条目 {id} 校验未通过: {errors}';
301
+ };
302
+ export declare const en: Record<keyof typeof zh, string>;
303
+ /** 构造 MsgFunc:en → en 目录(缺键回退 zh);其余 → zh。 */
304
+ export declare function makeMsg(lang: 'zh' | 'en' | string | undefined): MsgFunc;
305
+ /** 缺省目录(zh):未注入 msg 的引擎/测试路径使用,行为与改造前完全一致。 */
306
+ export declare const zhMsg: MsgFunc;
307
+ /** 从「可能携带 msg 的对象」取翻译器;缺省 zh。 */
308
+ export declare function msgOf(ctx: {
309
+ msg?: MsgFunc;
310
+ } | undefined): MsgFunc;