dsh-config-manager 0.4.1 → 0.4.3

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 (131) hide show
  1. package/README.md +14 -0
  2. package/lib/cli/actions.js +2 -3
  3. package/lib/cli/import-source.js +2 -6
  4. package/lib/cli/index.js +2 -3
  5. package/lib/client.d.ts +5 -5
  6. package/lib/client.js +26250 -25872
  7. package/lib/core/access-mode.d.ts +25 -0
  8. package/lib/core/access-mode.js +28 -0
  9. package/lib/core/exporter.js +2 -4
  10. package/lib/core/host-schedulers/cache-cleanup.d.ts +41 -0
  11. package/lib/core/host-schedulers/cache-cleanup.js +45 -0
  12. package/lib/core/host-schedulers/lifecycle-hooks.d.ts +51 -0
  13. package/lib/core/host-schedulers/lifecycle-hooks.js +78 -0
  14. package/lib/core/host-schedulers/market-cache.d.ts +40 -0
  15. package/lib/core/host-schedulers/market-cache.js +92 -0
  16. package/lib/core/model-tools.js +2 -6
  17. package/lib/core/restore.d.ts +0 -2
  18. package/lib/core/restore.js +16 -18
  19. package/lib/core/verify-recovery.js +4 -7
  20. package/lib/index.d.ts +3 -22
  21. package/lib/index.js +74 -330
  22. package/lib/profiles/dsh-profile-manager.d.ts +23 -1
  23. package/lib/profiles/dsh-profile-manager.js +70 -2
  24. package/lib/routes/kit.d.ts +61 -1
  25. package/lib/routes/kit.js +72 -3
  26. package/lib/routes/prefs.js +6 -6
  27. package/lib/routes/recovery.js +25 -41
  28. package/lib/routes/request-trust.d.ts +28 -0
  29. package/lib/routes/request-trust.js +65 -0
  30. package/lib/routes/route-support.d.ts +23 -1
  31. package/lib/routes/route-support.js +185 -0
  32. package/lib/routes/snapshots.js +4 -11
  33. package/lib/routes/sync.js +5 -7
  34. package/lib/security/redaction.d.ts +5 -1
  35. package/lib/security/redaction.js +26 -23
  36. package/lib/sync/backup-scheduler.js +2 -6
  37. package/lib/ui/backup-inspect.d.ts +1 -1
  38. package/lib/ui/dsh-profiles-view.d.ts +0 -10
  39. package/lib/ui/dsh-profiles-view.js +3 -7
  40. package/lib/ui/snapshots-view.d.ts +0 -14
  41. package/lib/ui/snapshots-view.js +16 -2
  42. package/lib/utils/paths.d.ts +20 -4
  43. package/lib/utils/paths.js +22 -6
  44. package/lib/utils/time.d.ts +31 -0
  45. package/lib/utils/time.js +54 -0
  46. package/package.json +1 -1
  47. package/src/cli/actions.ts +2 -3
  48. package/src/cli/import-source.ts +2 -7
  49. package/src/cli/index.ts +2 -3
  50. package/src/client/about/AboutPanel.tsx +8 -1
  51. package/src/client/about/ReleaseBody.tsx +22 -52
  52. package/src/client/about/ReleaseNotesDialog.tsx +15 -69
  53. package/src/client/about/release-notes-view.ts +4 -11
  54. package/src/client/common/access-mode.ts +21 -0
  55. package/src/client/common/info-hint-guard.test.ts +11 -5
  56. package/src/client/common/ui.tsx +23 -0
  57. package/src/client/config-manager.module.css +201 -32
  58. package/src/client/css-token-guard.test.ts +135 -1
  59. package/src/client/home/HomePanel.tsx +31 -6
  60. package/src/client/import/ConflictList.tsx +3 -3
  61. package/src/client/import/ImportWizardView.tsx +1 -1
  62. package/src/client/library/ArtifactRow.tsx +2 -2
  63. package/src/client/library/RestorePlanView.tsx +21 -9
  64. package/src/client/library/report-dismiss.test.ts +5 -3
  65. package/src/client/locales/about.ts +103 -0
  66. package/src/client/locales/backup.ts +141 -0
  67. package/src/client/locales/common.ts +113 -0
  68. package/src/client/locales/export.ts +184 -0
  69. package/src/client/locales/foreign.ts +184 -0
  70. package/src/client/locales/import-compat.ts +32 -0
  71. package/src/client/locales/import.ts +192 -0
  72. package/src/client/locales/next-steps.ts +25 -0
  73. package/src/client/locales/overview-control.ts +32 -0
  74. package/src/client/locales/overview.ts +153 -0
  75. package/src/client/locales/profiles.ts +263 -0
  76. package/src/client/locales/report.ts +17 -0
  77. package/src/client/locales/restore.ts +132 -0
  78. package/src/client/locales/sessions.ts +257 -0
  79. package/src/client/locales/shell.ts +149 -0
  80. package/src/client/locales.ts +49 -1783
  81. package/src/client/market/MarketImportReview.tsx +2 -2
  82. package/src/client/market/MarketPanel.tsx +1 -1
  83. package/src/client/market/market-view.ts +3 -5
  84. package/src/client/recovery/RecoveryPanel.tsx +62 -1054
  85. package/src/client/recovery/SessionHealthCard.tsx +134 -0
  86. package/src/client/recovery/SessionHealthDialog.tsx +665 -0
  87. package/src/client/recovery/SessionLayoutSection.tsx +284 -0
  88. package/src/client/recovery/recovery-api.ts +10 -1
  89. package/src/client/recovery/recovery-panel-layout.test.ts +20 -5
  90. package/src/client/recovery/session-dialog-mount.test.ts +16 -9
  91. package/src/client/recovery/use-recovery-write.test.ts +90 -0
  92. package/src/client/recovery/use-recovery-write.ts +53 -0
  93. package/src/client/run-store.ts +57 -2
  94. package/src/client/sync/PushPreviewCard.tsx +2 -2
  95. package/src/client/sync/SyncConfirmView.tsx +5 -5
  96. package/src/client/sync/SyncLogList.tsx +2 -2
  97. package/src/client/sync/history-model.ts +4 -5
  98. package/src/client/sync/sync-view.ts +3 -4
  99. package/src/core/access-mode.ts +37 -0
  100. package/src/core/exporter.ts +2 -4
  101. package/src/core/host-schedulers/cache-cleanup.test.ts +84 -0
  102. package/src/core/host-schedulers/cache-cleanup.ts +74 -0
  103. package/src/core/host-schedulers/lifecycle-hooks.test.ts +111 -0
  104. package/src/core/host-schedulers/lifecycle-hooks.ts +118 -0
  105. package/src/core/host-schedulers/market-cache.test.ts +93 -0
  106. package/src/core/host-schedulers/market-cache.ts +116 -0
  107. package/src/core/model-tools.ts +2 -7
  108. package/src/core/restore-failure-state.test.ts +210 -0
  109. package/src/core/restore.ts +16 -18
  110. package/src/core/verify-recovery.ts +4 -7
  111. package/src/index.ts +81 -335
  112. package/src/profiles/dsh-profile-copy-rollback.test.ts +156 -0
  113. package/src/profiles/dsh-profile-manager.ts +71 -3
  114. package/src/routes/kit.ts +106 -3
  115. package/src/routes/prefs.ts +6 -6
  116. package/src/routes/recovery.ts +25 -42
  117. package/src/routes/request-trust.ts +97 -0
  118. package/src/routes/route-support.ts +208 -1
  119. package/src/routes/snapshots.ts +4 -9
  120. package/src/routes/sync.ts +4 -7
  121. package/src/security/redaction.ts +29 -23
  122. package/src/sync/backup-scheduler.ts +3 -6
  123. package/src/sync/sync-config.test.ts +24 -13
  124. package/src/ui/backup-inspect.ts +1 -1
  125. package/src/ui/dsh-profiles-view.ts +3 -5
  126. package/src/ui/i18n.test.ts +8 -3
  127. package/src/ui/snapshots-view.ts +2 -2
  128. package/src/utils/paths.test.ts +36 -1
  129. package/src/utils/paths.ts +30 -6
  130. package/src/utils/time.test.ts +46 -0
  131. package/src/utils/time.ts +55 -0
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Config Manager 字典分域 · Star 引导弹窗与关于页。
3
+ *
4
+ * tech-debt #22(2026-11 拆分):本文件只承载该域键值;聚合与键顺序由 ../locales.ts 编排。
5
+ * 约束:zh 文案逐字保留、en 一键一镜像(`Record<keyof typeof zh, string>` 编译期校验),
6
+ * 键集合由 src/core/engine-locale.test.ts 的既有键冻结指纹兜底。本文件零依赖、零 import。
7
+ */
8
+ export const zh = {
9
+ // —— 错误 ——
10
+ // —— Star 引导弹窗 ——
11
+ 'starPrompt.title': '喜欢 Config Manager 吗?',
12
+ 'starPrompt.body': '如果你觉得这个插件有用,欢迎到 GitHub 点个 ⭐ Star 支持一下——你的支持是持续维护的最大动力!',
13
+ 'starPrompt.star': '去点 Star',
14
+ 'starPrompt.dismiss': '不再提示',
15
+ // —— 关于 ——
16
+ 'about.official': '官方',
17
+ 'about.version': '版本 {version}',
18
+ 'about.dshVersion': 'DSH {version}',
19
+ 'about.links': '相关链接',
20
+ 'about.star': '⭐ 在 GitHub 上点赞',
21
+ 'about.repo': 'GitHub 仓库',
22
+ 'about.docs': '使用文档',
23
+ 'about.issues': '反馈问题',
24
+ 'about.feedbackHint': '遇到界面问题?复制环境信息,粘进 issue 就行',
25
+ 'about.copyEnv': '复制环境信息',
26
+ 'about.authorLabel': '作者',
27
+ 'about.loading': '正在获取版本信息…',
28
+ 'about.retryStatus': '重新获取',
29
+ 'about.releaseNotes': '更新内容',
30
+ 'about.diag.label': '插件清单来源',
31
+ 'about.diag.profileDir': '目录:{path}',
32
+ 'about.diag.profile': 'profile:{profile}',
33
+ 'about.diag.pluginCount': '已识别插件:{count} 个',
34
+ 'about.diag.manifestUnreadable': '读不到 package.json:插件清单为空(核对 profile 与 DSH_HOME)',
35
+ 'about.diag.hint': '若与实际不符,请据此检查当前档案的启动方式(宿主 profileContext / 启动参数 --profile / 环境变量 DSH_PROFILE)与 DSH_HOME 环境变量。',
36
+ 'about.releaseNotes.title': '版本更新内容',
37
+ 'about.releaseNotes.loading': '正在获取更新内容…',
38
+ 'about.releaseNotes.loadingMore': '正在加载更多版本…',
39
+ 'about.releaseNotes.empty': '暂无发布记录',
40
+ 'about.releaseNotes.retry': '重试',
41
+ 'about.releaseNotes.viewOnGithub': '在 GitHub 上查看全部 Releases',
42
+ 'about.releaseNotes.viewSingleOnGithub': '在 GitHub 上查看此版本',
43
+ 'about.releaseNotes.allLoaded': '已加载全部版本记录',
44
+ 'about.releaseNotes.prerelease': '预发布',
45
+ 'about.releaseNotes.latest': '最新',
46
+ 'about.releaseNotes.noBody': '该版本暂无详细更新说明。',
47
+ 'about.releaseNotes.confirm': '确认',
48
+ 'about.releaseNotes.neverShow': '永不提示',
49
+ 'about.cli.title': 'CLI 救援工具',
50
+ 'about.cli.hint': 'GUI 运行在 DSH 内部——DSH 无法启动时,独立安装的 CLI(dsh-config-manager)是第一救援手段:列快照 / 离线恢复 / 一键重装 DSH,全程无需 DSH 运行。安装一次即可在任何机器上用:',
51
+ 'about.cli.docs': 'CLI 使用文档',
52
+ // issue #126:内嵌面板的访问边界(宿主 --host 局域网地址 / 反代会被围栏拒绝,不是数据坏了)
53
+ 'about.access.title': '访问范围',
54
+ 'about.access.hint': '本面板只接受两种来源:本机回环地址(127.0.0.1 / localhost),或宿主已信任的地址与已登录的 dsh web 会话。用 dsh web --host <局域网地址> 启动后从别的机器打开时,页面能加载但读不到本机数据——改用 ssh -L 3080:127.0.0.1:3080 隧道从 localhost 打开即可。CLI 与 agent 工具不受此限制。',
55
+ } as const;
56
+
57
+ export const en: Record<keyof typeof zh, string> = {
58
+ // —— Star prompt dialog ——
59
+ 'starPrompt.title': 'Enjoying Config Manager?',
60
+ 'starPrompt.body': 'If you find this plugin useful, please give it a ⭐ on GitHub — your support keeps it maintained!',
61
+ 'starPrompt.star': 'Star on GitHub',
62
+ 'starPrompt.dismiss': "Don't ask again",
63
+ // —— About ——
64
+ 'about.official': 'Official',
65
+ 'about.version': 'Version {version}',
66
+ 'about.dshVersion': 'DSH {version}',
67
+ 'about.links': 'Links',
68
+ 'about.star': '⭐ Star on GitHub',
69
+ 'about.repo': 'GitHub Repository',
70
+ 'about.docs': 'Documentation',
71
+ 'about.issues': 'Report an issue',
72
+ 'about.feedbackHint': 'Hit a UI problem? Copy the environment info and paste it into your issue.',
73
+ 'about.copyEnv': 'Copy environment info',
74
+ 'about.authorLabel': 'Author',
75
+ 'about.loading': 'Loading version info…',
76
+ 'about.retryStatus': 'Retry',
77
+ 'about.releaseNotes': 'Release Notes',
78
+ 'about.diag.label': 'Plugin list source',
79
+ 'about.diag.profileDir': 'Directory: {path}',
80
+ 'about.diag.profile': 'profile: {profile}',
81
+ 'about.diag.pluginCount': 'Plugins detected: {count}',
82
+ 'about.diag.manifestUnreadable': 'package.json unreadable: plugin list is empty (check profile and DSH_HOME)',
83
+ 'about.diag.hint': 'If this does not match your setup, check how the profile was launched (host profileContext / --profile argument / DSH_PROFILE environment variable) and the DSH_HOME environment variable.',
84
+ 'about.releaseNotes.title': 'Release Notes',
85
+ 'about.releaseNotes.loading': 'Loading release notes…',
86
+ 'about.releaseNotes.loadingMore': 'Loading more releases…',
87
+ 'about.releaseNotes.empty': 'No releases',
88
+ 'about.releaseNotes.retry': 'Retry',
89
+ 'about.releaseNotes.viewOnGithub': 'View all releases on GitHub',
90
+ 'about.releaseNotes.viewSingleOnGithub': 'View on GitHub',
91
+ 'about.releaseNotes.allLoaded': 'All releases loaded',
92
+ 'about.releaseNotes.prerelease': 'Pre-release',
93
+ 'about.releaseNotes.latest': 'Latest',
94
+ 'about.releaseNotes.noBody': 'No description provided for this release.',
95
+ 'about.releaseNotes.confirm': 'Confirm',
96
+ 'about.releaseNotes.neverShow': "Don't show again",
97
+ 'about.cli.title': 'CLI Rescue Tool',
98
+ 'about.cli.hint': 'The GUI lives inside DSH — when DSH cannot start, the separately installed CLI (dsh-config-manager) is your first rescue tool: list snapshots / offline restore / one-click DSH reinstall, no DSH runtime needed. Install once and use it on any machine:',
99
+ 'about.cli.docs': 'CLI documentation',
100
+ // issue #126: the panel's access boundary (host --host LAN address / reverse proxy is fenced)
101
+ 'about.access.title': 'Access scope',
102
+ 'about.access.hint': 'This panel accepts only two sources: loopback on this machine (127.0.0.1 / localhost), or an address and signed-in dsh web session the host already trusts. Started with dsh web --host <LAN address> and opened from another machine, the page loads but cannot read local data — open it through an ssh -L 3080:127.0.0.1:3080 tunnel via localhost instead. The CLI and agent tools are not affected.',
103
+ };
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Config Manager 字典分域 · 定时全量备份与保留策略(GFS 分层)。
3
+ *
4
+ * tech-debt #22(2026-11 拆分):本文件只承载该域键值;聚合与键顺序由 ../locales.ts 编排。
5
+ * 约束:zh 文案逐字保留、en 一键一镜像(`Record<keyof typeof zh, string>` 编译期校验),
6
+ * 键集合由 src/core/engine-locale.test.ts 的既有键冻结指纹兜底。本文件零依赖、零 import。
7
+ */
8
+ export const zh = {
9
+ // —— 定时全量备份(快照 tab)——
10
+ 'backupSchedule.title': '定时全量备份',
11
+ 'backupSchedule.hint': '按固定间隔在后台自动导出全量备份 ZIP(恒不含 secret、不加密;要加密请手动导出)。配置存 sync/backup-schedule.json,随 self 分区备份 / 远程同步迁移。',
12
+ 'backupSchedule.enabled': '启用定时备份',
13
+ 'backupSchedule.enabledHint': '开启后 DSH 在后台按间隔自动备份;每次启动时立即执行一次(距上次运行不足 1 小时则跳过启动触发)。',
14
+ 'backupSchedule.interval': '备份间隔',
15
+ 'backupSchedule.interval.6h': '每 6 小时',
16
+ 'backupSchedule.interval.12h': '每 12 小时',
17
+ 'backupSchedule.interval.24h': '每 24 小时',
18
+ 'backupSchedule.interval.7d': '每 7 天',
19
+ 'backupSchedule.interval.custom': '自定义(每周固定时刻)',
20
+ 'backupSchedule.customHint': '每周在选定星期与时刻各执行一次全量备份(错过的时间点不补跑)',
21
+ // 自定义档三个下拉的无障碍名(无可见 label:它们与「启用定时备份」复选框同排)
22
+ 'backupSchedule.weekday': '星期',
23
+ 'backupSchedule.hour': '小时',
24
+ 'backupSchedule.minute': '分钟',
25
+ 'backupSchedule.weekday.sunday': '周日',
26
+ 'backupSchedule.weekday.monday': '周一',
27
+ 'backupSchedule.weekday.tuesday': '周二',
28
+ 'backupSchedule.weekday.wednesday': '周三',
29
+ 'backupSchedule.weekday.thursday': '周四',
30
+ 'backupSchedule.weekday.friday': '周五',
31
+ 'backupSchedule.weekday.saturday': '周六',
32
+ 'backupSchedule.save': '保存设置',
33
+ 'backupSchedule.saved': '设置已保存',
34
+ 'backupSchedule.runNow': '立即备份',
35
+ 'backupSchedule.lastRun': '上次运行',
36
+ 'backupSchedule.never': '从未运行',
37
+ 'backupSchedule.status.success': '成功',
38
+ 'backupSchedule.status.skipped': '已跳过',
39
+ 'backupSchedule.status.failed': '失败',
40
+ 'backupSchedule.consecutiveFailures': '定时备份连续失败 {count} 次,请检查配置(磁盘空间 / 权限 / 分区导出错误)',
41
+ 'backupSchedule.loading': '加载定时备份设置…',
42
+ 'backupSchedule.error': '定时备份设置加载失败',
43
+ // —— 保留策略(m-retention:GFS 分层)——
44
+ 'retention.title': '保留策略',
45
+ 'retention.hint': '控制自动清理保留多少份(快照与定时备份共用)。置顶的快照与未收敛恢复点恒豁免自动清理。',
46
+ 'retention.keepLast': '最近保留',
47
+ 'retention.keepLastHint': '按时间保留最近 N 份;0 = 不按「最近」保留',
48
+ 'retention.keepMonthly': '每月保留',
49
+ 'retention.keepMonthlyHint': '每月额外保留最新 1 份,最多覆盖 N 个月;0 = 关闭',
50
+ 'retention.keepYearly': '每年保留',
51
+ 'retention.keepYearlyHint': '每年额外保留最新 1 份,最多覆盖 N 年;0 = 关闭',
52
+ 'retention.unit': '份',
53
+ 'retention.months': '个月',
54
+ 'retention.years': '年',
55
+ 'retention.tiersOff': '仅保留最近 N 份',
56
+ 'retention.appliesTo': '生效于:导入前快照 + 定时备份产物',
57
+ 'backupFiles.hint': '导出产物(手动导出与定时备份)统一在此管理:可下载到本机、直接导入恢复,或删除。定时备份自动保留最近 10 个。',
58
+ 'backupFiles.empty': '暂无备份文件',
59
+ 'backupFiles.delete': '删除',
60
+ 'backupFiles.deleteConfirmTitle': '删除备份文件',
61
+ 'backupFiles.deleteConfirm': '确认删除备份文件「{name}」?此操作不可恢复。',
62
+ 'backupFiles.deleted': '已删除备份文件「{name}」',
63
+ 'backupFiles.inspect': '查看 / 对比',
64
+ 'backupFiles.inspectLoading': '正在分析备份内容…',
65
+ 'backupFiles.inspectEmpty': '该备份无法分析(文件损坏或格式不支持)',
66
+ 'backupFiles.inspectSections': '包含的分区',
67
+ 'backupFiles.inspectDiff': '与此备份的差异(只读预览)',
68
+ 'backupFiles.inspectItems': '变更明细',
69
+ 'backupFiles.inspectGroup.conflicts': '冲突(需决策)',
70
+ 'backupFiles.inspectGroup.changes': '变更(将写入)',
71
+ 'backupFiles.inspectGroup.paths': '路径映射(需处理)',
72
+ 'backupFiles.inspectGroup.skipped': '已一致(无需处理)',
73
+ 'backupFiles.inspectGroup.others': '其他',
74
+ } as const;
75
+
76
+ export const en: Record<keyof typeof zh, string> = {
77
+ // —— Scheduled full backups (snapshots tab) ——
78
+ 'backupSchedule.title': 'Scheduled Full Backups',
79
+ 'backupSchedule.hint': 'Automatically export a full backup ZIP in the background on a fixed cadence (secrets are never included, never encrypted — use manual export for encryption). Config lives in sync/backup-schedule.json and migrates with the self section.',
80
+ 'backupSchedule.enabled': 'Enable scheduled backups',
81
+ 'backupSchedule.enabledHint': 'When on, DSH backs up automatically on the cadence below; one run fires on every startup (skipped if less than 1h since the last run).',
82
+ 'backupSchedule.interval': 'Backup interval',
83
+ 'backupSchedule.interval.6h': 'Every 6 hours',
84
+ 'backupSchedule.interval.12h': 'Every 12 hours',
85
+ 'backupSchedule.interval.24h': 'Every 24 hours',
86
+ 'backupSchedule.interval.7d': 'Every 7 days',
87
+ 'backupSchedule.interval.custom': 'Custom (weekly at a fixed time)',
88
+ 'backupSchedule.customHint': 'Runs a full backup once a week at the selected weekday and time (missed triggers are not backfilled)',
89
+ 'backupSchedule.weekday': 'Weekday',
90
+ 'backupSchedule.hour': 'Hour',
91
+ 'backupSchedule.minute': 'Minute',
92
+ 'backupSchedule.weekday.sunday': 'Sunday',
93
+ 'backupSchedule.weekday.monday': 'Monday',
94
+ 'backupSchedule.weekday.tuesday': 'Tuesday',
95
+ 'backupSchedule.weekday.wednesday': 'Wednesday',
96
+ 'backupSchedule.weekday.thursday': 'Thursday',
97
+ 'backupSchedule.weekday.friday': 'Friday',
98
+ 'backupSchedule.weekday.saturday': 'Saturday',
99
+ 'backupSchedule.save': 'Save settings',
100
+ 'backupSchedule.saved': 'Settings saved',
101
+ 'backupSchedule.runNow': 'Back up now',
102
+ 'backupSchedule.lastRun': 'Last run',
103
+ 'backupSchedule.never': 'Never run',
104
+ 'backupSchedule.status.success': 'Success',
105
+ 'backupSchedule.status.skipped': 'Skipped',
106
+ 'backupSchedule.status.failed': 'Failed',
107
+ 'backupSchedule.consecutiveFailures': 'Scheduled backups failed {count} {count, plural, time|times} in a row — check the configuration (disk space / permissions / section export errors)',
108
+ 'backupSchedule.loading': 'Loading scheduled backup settings…',
109
+ 'backupSchedule.error': 'Failed to load scheduled backup settings',
110
+ // —— Retention policy (m-retention: GFS tiers) ——
111
+ 'retention.title': 'Retention policy',
112
+ 'retention.hint': 'Controls how many copies auto-cleanup keeps (shared by snapshots and scheduled backups). Pinned snapshots and unsettled recovery points are always exempt.',
113
+ 'retention.keepLast': 'Keep last',
114
+ 'retention.keepLastHint': 'Keep the newest N by time; 0 disables the "recent" tier',
115
+ 'retention.keepMonthly': 'Keep monthly',
116
+ 'retention.keepMonthlyHint': 'Additionally keep the newest copy of each month, for at most N months; 0 disables',
117
+ 'retention.keepYearly': 'Keep yearly',
118
+ 'retention.keepYearlyHint': 'Additionally keep the newest copy of each year, for at most N years; 0 disables',
119
+ 'retention.unit': 'copies',
120
+ 'retention.months': 'months',
121
+ 'retention.years': 'years',
122
+ 'retention.tiersOff': 'Newest N copies only',
123
+ 'retention.appliesTo': 'Applies to: pre-import snapshots + scheduled backup artifacts',
124
+ 'backupFiles.hint': 'All export artifacts (manual exports and scheduled backups) are managed here: download to your machine, import to restore, or delete. Scheduled backups auto-keep the latest 10.',
125
+ 'backupFiles.empty': 'No backup files yet',
126
+ 'backupFiles.delete': 'Delete',
127
+ 'backupFiles.deleteConfirmTitle': 'Delete backup file',
128
+ 'backupFiles.deleteConfirm': 'Delete backup file "{name}"? This cannot be undone.',
129
+ 'backupFiles.deleted': 'Deleted backup file “{name}”',
130
+ 'backupFiles.inspect': 'Inspect / Compare',
131
+ 'backupFiles.inspectLoading': 'Analyzing backup contents…',
132
+ 'backupFiles.inspectEmpty': 'This backup could not be analyzed (corrupt or unsupported format)',
133
+ 'backupFiles.inspectSections': 'Sections included',
134
+ 'backupFiles.inspectDiff': 'Diff against this backup (read-only preview)',
135
+ 'backupFiles.inspectItems': 'Change details',
136
+ 'backupFiles.inspectGroup.conflicts': 'Conflicts (need decision)',
137
+ 'backupFiles.inspectGroup.changes': 'Changes (will apply)',
138
+ 'backupFiles.inspectGroup.paths': 'Path mappings (need handling)',
139
+ 'backupFiles.inspectGroup.skipped': 'Identical (nothing to do)',
140
+ 'backupFiles.inspectGroup.others': 'Others',
141
+ };
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Config Manager 字典分域 · 入口与公共(分区显示名、关于片段、公共标点、Toast)。
3
+ *
4
+ * tech-debt #22(2026-11 拆分):本文件只承载该域键值;聚合与键顺序由 ../locales.ts 编排。
5
+ * 约束:zh 文案逐字保留、en 一键一镜像(`Record<keyof typeof zh, string>` 编译期校验),
6
+ * 键集合由 src/core/engine-locale.test.ts 的既有键冻结指纹兜底。本文件零依赖、零 import。
7
+ */
8
+ export const zh = {
9
+ // 入口
10
+ 'section.label': '备份与迁移',
11
+ 'section.description': '导出 / 导入 / 迁移 DSH 配置(备份不含密钥,加密备份可选)',
12
+ // 分区显示名(SectionId → 文案;唯一映射见 common/section-labels.ts。UI-08)
13
+ 'section.settings': '设置',
14
+ 'section.ui': 'UI 偏好',
15
+ 'section.providers': 'Provider 与模型',
16
+ 'section.plugins': '插件清单',
17
+ 'section.mcp': 'MCP 服务器',
18
+ 'section.prompts': '提示词',
19
+ 'section.skills': '技能',
20
+ 'section.agentPresets': 'Agent 预设',
21
+ 'section.agentInstructions': '全局指令',
22
+ 'section.workspaces': '工作区',
23
+ 'section.pluginFiles': '插件散落配置',
24
+ 'section.credentialsStatus': '凭据状态',
25
+ 'section.secrets': '密钥',
26
+ 'section.sessions': '历史会话',
27
+ 'section.self': '配置管理器设置',
28
+ 'section.pluginData': '插件数据目录',
29
+ 'section.pluginAssets': '插件大文件',
30
+ // 视图切换
31
+ 'view.about': '关于',
32
+ // 关于页「一键复制环境信息」片段(提 issue 用):zh 保留双语标题(维护者可读),en 纯英文
33
+ 'about.snippet.environment': '### 环境 / Environment',
34
+ // 更新内容拉取失败(GitHub API):错误对象里也必须是当前语言
35
+ 'about.releaseNotes.rateLimited': 'GitHub API 速率限制(Rate limit exceeded),请稍后再试或直接在 GitHub 上查看。',
36
+ 'about.releaseNotes.fetchFailed': 'GitHub API 请求失败 ({status} {statusText})',
37
+ 'about.snippet.plugin': '- 插件版本 / Plugin: {version}',
38
+ 'about.snippet.dsh': '- DSH 版本 / DSH: {version}',
39
+ 'about.snippet.platform': '- 平台 / Platform: {platform}',
40
+ 'about.snippet.pluginDir': '- 插件清单目录 / Plugin dir: {dir}',
41
+ // 公共
42
+ 'common.close': '关闭',
43
+ 'common.cancel': '取消',
44
+ // 标点也属界面文案:英文界面不得出现全角冒号(label:value 形态的分隔符走这个词条)
45
+ 'common.labelSeparator': ':',
46
+ 'common.back': '上一步',
47
+ 'common.next': '下一步',
48
+ 'common.retry': '重试',
49
+ // 落盘失败(sessionStorage 配额满/不可用):状态还在内存里,但刷新即丢 —— 必须说清
50
+ 'common.saveFailed': '浏览器存储写入失败:当前进度仍在本页内存中,刷新会丢失',
51
+ 'common.loading': '加载中…',
52
+ 'common.unknownError': '未知错误',
53
+ // client-F6:拼接类标点走字典(英文界面不得出现全角括号 / 顿号)
54
+ 'common.parens': '({text})',
55
+ // client-F5:关于页 CLI 命令说明(此前硬编码中文)
56
+ 'about.cli.help': '列出全部 CLI 命令与用法(离线可用)',
57
+ 'about.cli.snapshots': '列出本机回滚快照(无需 DSH 运行)',
58
+ 'about.cli.restore': '恢复到导入前状态(离线)',
59
+ 'about.cli.reinstall': '一键重装 DSH(救援)',
60
+ 'common.listSeparator': '、',
61
+ // 全局通知(右下角 Toast)的通用文案
62
+ 'toast.copied': '已复制到剪贴板',
63
+ 'toast.copyFailed': '复制失败,请手动选择文本复制',
64
+ } as const;
65
+
66
+ export const en: Record<keyof typeof zh, string> = {
67
+ 'section.label': 'Backup & Migration',
68
+ 'section.description': 'Export / import / migrate DSH configuration (backups exclude secrets; encrypted backups optional)',
69
+ // Section display names (SectionId → text; the single mapping lives in common/section-labels.ts, UI-08)
70
+ 'section.settings': 'Settings',
71
+ 'section.ui': 'UI Preferences',
72
+ 'section.providers': 'Providers & Models',
73
+ 'section.plugins': 'Plugin list',
74
+ 'section.mcp': 'MCP Servers',
75
+ 'section.prompts': 'Prompts',
76
+ 'section.skills': 'Skills',
77
+ 'section.agentPresets': 'Agent Presets',
78
+ 'section.agentInstructions': 'Agent Instructions',
79
+ 'section.workspaces': 'Workspaces',
80
+ 'section.pluginFiles': 'Plugin config files',
81
+ 'section.credentialsStatus': 'Credentials Status',
82
+ 'section.secrets': 'Secrets',
83
+ 'section.sessions': 'Sessions',
84
+ 'section.self': 'Config Manager settings',
85
+ 'section.pluginData': 'Plugin data dirs',
86
+ 'section.pluginAssets': 'Plugin large files',
87
+ 'view.about': 'About',
88
+ 'about.snippet.environment': '### Environment',
89
+ 'about.releaseNotes.rateLimited': 'GitHub API rate limit exceeded — please try again later, or view the release notes directly on GitHub.',
90
+ 'about.releaseNotes.fetchFailed': 'GitHub API request failed ({status} {statusText})',
91
+ 'about.snippet.plugin': '- Plugin version: {version}',
92
+ 'about.snippet.dsh': '- DSH version: {version}',
93
+ 'about.snippet.platform': '- Platform: {platform}',
94
+ 'about.snippet.pluginDir': '- Plugin directory: {dir}',
95
+ 'common.close': 'Close',
96
+ 'common.cancel': 'Cancel',
97
+ 'common.labelSeparator': ': ',
98
+ 'common.back': 'Back',
99
+ 'common.next': 'Next',
100
+ 'common.retry': 'Retry',
101
+ // Persist failure (sessionStorage quota / unavailable): state is in memory but a refresh loses it
102
+ 'common.saveFailed': 'Could not write browser storage: the current progress stays in this page only and is lost on refresh',
103
+ 'common.loading': 'Loading…',
104
+ 'common.unknownError': 'Unknown error',
105
+ 'common.parens': '({text})',
106
+ 'about.cli.help': 'List every CLI command and its usage (works offline)',
107
+ 'about.cli.snapshots': 'List local rollback snapshots (no running DSH needed)',
108
+ 'about.cli.restore': 'Restore to the pre-import state (offline)',
109
+ 'about.cli.reinstall': 'One-shot DSH reinstall (rescue)',
110
+ 'common.listSeparator': ', ',
111
+ 'toast.copied': 'Copied to clipboard',
112
+ 'toast.copyFailed': 'Copy failed — select the text and copy manually',
113
+ };
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Config Manager 字典分域 · 导出(加密、文件名)与内容选择器(含插件树、分组显示名)。
3
+ *
4
+ * tech-debt #22(2026-11 拆分):本文件只承载该域键值;聚合与键顺序由 ../locales.ts 编排。
5
+ * 约束:zh 文案逐字保留、en 一键一镜像(`Record<keyof typeof zh, string>` 编译期校验),
6
+ * 键集合由 src/core/engine-locale.test.ts 的既有键冻结指纹兜底。本文件零依赖、零 import。
7
+ */
8
+ export const zh = {
9
+ // —— 导出 ——
10
+ 'export.hint': '默认导出推荐分区(可迁移、不含设备专属数据)。',
11
+ 'export.encrypt': '加密备份',
12
+ 'export.encryptHint': '用密码加密整个备份文件(AES-256-GCM)。密码仅用于本次加密,不会写入备份或任何配置文件;导入时必须输入该密码才能解锁。',
13
+ 'export.password': '备份加密密码',
14
+ 'export.passwordConfirm': '确认密码',
15
+ 'export.passwordMismatch': '两次输入的密码不一致',
16
+ 'export.passwordRequired': '加密备份必须设置密码',
17
+ 'export.includeSecrets': '导出密钥',
18
+ 'export.includeSecretsHint': '把真实密钥(凭据值)写入备份。密钥必须以加密形式保存:勾选时会自动选中「加密备份」;取消「加密备份」会同时取消「导出密钥」。',
19
+ 'export.run': '开始导出',
20
+ 'export.download': '下载备份文件',
21
+ 'export.saved': '已保存到下载目录:{name}',
22
+ 'export.selectionWarnings': '以下分区为设备相关数据,跨设备导入时可能不适用:',
23
+ 'export.fileName': '自定义文件名',
24
+ 'export.fileNameHint': '留空自动命名(dsh-config-<日期>.zip);无需手动输入 .zip 后缀,保存时自动补全。仅允许字母数字、空格、- _ .。',
25
+ 'export.fileNameInvalid': '文件名不合法:仅允许字母数字、空格、- _ .,不能包含路径分隔符。',
26
+ 'export.note': '备注',
27
+ 'export.notePlaceholder': '例如:迁移前的完整备份 / 2026-08 存档',
28
+ 'export.noteHint': '备注保存在本机备份列表中(随配置备份迁移),便于区分多个导出产物。',
29
+ 'export.compositionTitle': '本次将导出',
30
+ 'export.compositionHint': '按当前勾选估算(只读预览,零写入)',
31
+ 'export.compositionPartial': '将导出 {sections} 个分区 · 已读取 {units} 个条目 · 约 {size}(含未读取分区,实际不少于该值)',
32
+ 'export.compositionEmpty': '没有勾选任何可导出的内容',
33
+ // —— 内容选择器(Phase 1 条目级导出选择)——
34
+ 'picker.title': '选择要导出的内容',
35
+ 'picker.search': '搜索分区或条目…',
36
+ 'picker.selectAll': '全选',
37
+ 'picker.selectNone': '全不选',
38
+ 'picker.expand': '展开',
39
+ 'picker.collapse': '收起',
40
+ 'picker.partial': '部分',
41
+ 'picker.blankSession': '新会话',
42
+ 'picker.highRisk': '高风险',
43
+ 'picker.highRiskHint': '该分区来自公共仓库、未经官方审核:勾选后会在本机安装插件 / 写入文件 / 注入全局指令。导入前会创建可回滚快照,风险由你确认。',
44
+ 'picker.locked': '捆绑',
45
+ 'picker.lockedHint': '与同组条目必须一起导出(例如 pnpm patch 声明与其补丁文件),取消任一都会整组取消。',
46
+ 'picker.selectedOf': '已选 {selected}/{total}',
47
+ 'picker.fileCount': '{count} 个文件',
48
+ 'picker.summary': '将导出 {sections} 个分区 · {units} 个条目 · 约 {size}',
49
+ 'picker.loading': '正在读取可导出的条目…',
50
+ 'picker.loadingItems': '正在读取条目…',
51
+ 'picker.loadingSection': '读取中…',
52
+ 'picker.empty': '没有匹配的分区或条目',
53
+ 'picker.sessionWorkspaceLinked': '会话与工作区联动勾选:勾上会话会自动勾上它所属的工作区;取消工作区会取消它的会话',
54
+ 'picker.unitsUnavailable': '部分分区的条目清单读取失败,这些分区将整体导出。',
55
+ 'picker.sectionLoadFailed': '读取失败 · 将整体导出',
56
+ 'picker.deviceSpecific': '设备相关',
57
+ 'picker.sensitive': '敏感',
58
+ 'picker.showAll': '显示全部(共 {count} 条)',
59
+ 'picker.summaryImport': '{sections} 个分区 · {units} 个条目',
60
+ // —— 「插件与扩展」组内嵌的插件树(插件 → 清单条目 / 数据目录 / 大文件)——
61
+ 'picker.pluginRoot': '插件',
62
+ 'picker.pluginLeafPlugin': '插件清单条目',
63
+ 'picker.pluginLeafConfig': '数据目录(配置)',
64
+ 'picker.pluginLeafAssets': '大文件(壁纸 / 数据库)',
65
+ 'picker.pluginAreaUnread': '未读取',
66
+ 'picker.pluginAreaAbsent': '无内容',
67
+ 'picker.bucketPlugins': '插件分区的其他条目(补丁行 / pnpm-workspace.yaml)',
68
+ 'picker.bucketLooseFiles': '未归属到插件的配置(~/.dsh 根)',
69
+ 'picker.bucketHint': '这些条目没有可证明的插件归属,不猜;展开可逐条勾选。',
70
+ 'picker.groupHint.extensions': '只列出能证明的归属(内置来源表 + 插件自述 dsh.dataDirs);没有包名信息的配置留在「未归属」。',
71
+ // 导出目录的分组标题(与 ui/types.ts 的 EXPORT_GROUPS 一一对应,顺序由它决定)
72
+ 'group.general': '通用',
73
+ 'group.ai': 'AI',
74
+ 'group.extensions': '插件与扩展',
75
+ 'group.mcp': 'MCP / 工具',
76
+ 'group.customization': '定制',
77
+ 'group.automation': '自动化',
78
+ 'group.workspace': '工作区',
79
+ 'group.ui': '界面',
80
+ 'group.optional': '可选数据',
81
+ 'import.nothingSelected': '未勾选任何内容',
82
+ 'import.excludedByUser': '取消勾选 {count} 项(未导入、未入快照)',
83
+ 'import.consult.hint': '只读分析:先看结论与依据,确认后再选择要导入的内容。',
84
+ 'consult.title': '迁移前咨询',
85
+ 'library.pullTitle': '拉取远端快照',
86
+ // 「拉取」不是只读预览:宿主把该快照落地成本机 ZIP 后**直接进导入向导**(拉取即导入)。
87
+ // 文案必须说清后半程,否则用户以为只是比对差异(2026-10-04 用户报告)。
88
+ 'library.pulling': '正在拉取并导入…',
89
+ // 「下载」是另一条路:同样先拉取落地,但不进向导,而是交给浏览器下载到「下载」目录。
90
+ 'library.downloadTitle': '下载远端快照',
91
+ 'library.downloading': '正在拉取并下载…',
92
+
93
+ 'import.consult.unavailable': '暂时无法生成咨询报告(不影响继续导入)。',
94
+ 'import.picker.title': '选择要导入的内容',
95
+ 'import.picker.hint': '不勾选的条目不会被导入、也不会进快照;随时可以回到这一步修改。',
96
+ } as const;
97
+
98
+ export const en: Record<keyof typeof zh, string> = {
99
+ 'export.hint': 'Exports the recommended sections by default (portable, no device-specific data).',
100
+ 'export.encrypt': 'Encrypt backup',
101
+ 'export.encryptHint': 'Encrypt the entire backup file with a password (AES-256-GCM). The password is used once and never written into the backup or any config file; it is required to unlock the backup on import.',
102
+ 'export.password': 'Backup encryption password',
103
+ 'export.passwordConfirm': 'Confirm password',
104
+ 'export.passwordMismatch': 'Passwords do not match',
105
+ 'export.passwordRequired': 'An encryption password is required when encrypting the backup',
106
+ 'export.includeSecrets': 'Export secrets',
107
+ 'export.includeSecretsHint': 'Write the real secrets (credential values) into the backup. Secrets must be stored encrypted: checking this also checks \u201cEncrypt backup\u201d; unchecking \u201cEncrypt backup\u201d unchecks this.',
108
+ 'export.run': 'Start Export',
109
+ 'export.download': 'Download backup file',
110
+ 'export.saved': 'Saved to downloads: {name}',
111
+ 'export.selectionWarnings': 'Device-specific sections may not apply on another machine:',
112
+ 'export.fileName': 'Custom file name',
113
+ 'export.fileNameHint': 'Leave empty to auto-name (dsh-config-<date>.zip); no need to type .zip — it is appended automatically. Letters, digits, spaces, - _ . only.',
114
+ 'export.fileNameInvalid': 'Invalid file name: letters, digits, spaces, - _ . only, no path separators.',
115
+ 'export.note': 'Note',
116
+ 'export.notePlaceholder': 'e.g. Full backup before migration / 2026-08 archive',
117
+ 'export.noteHint': 'The note is shown in the local backup list (and travels with the config backup) so you can tell exports apart.',
118
+ 'export.compositionTitle': 'This export',
119
+ 'export.compositionHint': 'Estimated from the current selection (read-only, zero writes)',
120
+ 'export.compositionPartial': '{sections} {sections, plural, section|sections} · {units} {units, plural, item|items} read · ~{size} (includes sections not read yet; the real total is no less)',
121
+ 'export.compositionEmpty': 'Nothing selected to export',
122
+ // —— Content picker (Phase 1: per-item export selection) ——
123
+ 'picker.title': 'Choose what to export',
124
+ 'picker.search': 'Search sections or items…',
125
+ 'picker.selectAll': 'Select all',
126
+ 'picker.selectNone': 'Select none',
127
+ 'picker.expand': 'Expand',
128
+ 'picker.collapse': 'Collapse',
129
+ 'picker.partial': 'Partial',
130
+ 'picker.blankSession': 'New Session',
131
+ 'picker.highRisk': 'High risk',
132
+ 'picker.highRiskHint': 'This section comes from a public repository without official review: selecting it installs plugins / writes files / injects global instructions on this machine. A rollback snapshot is taken before import, so the risk stays yours to confirm.',
133
+ 'picker.locked': 'Bundle',
134
+ 'picker.lockedHint': 'Must be exported together with its group (e.g. a pnpm patch declaration and its patch file); clearing either clears the whole group.',
135
+ 'picker.selectedOf': '{selected}/{total} selected',
136
+ 'picker.fileCount': '{count} {count, plural, file|files}',
137
+ 'picker.summary': 'Exporting {sections} {sections, plural, section|sections} · {units} {units, plural, item|items} · ~{size}',
138
+ 'picker.loading': 'Reading exportable items…',
139
+ 'picker.loadingItems': 'Reading items…',
140
+ 'picker.loadingSection': 'Loading…',
141
+ 'picker.empty': 'No matching sections or items',
142
+ 'picker.sessionWorkspaceLinked': 'Session and workspace selection are linked: checking a session also checks the workspace that owns it; unchecking a workspace unchecks its sessions',
143
+ 'picker.unitsUnavailable': 'Item lists failed to load for some sections; those will be exported as a whole.',
144
+ 'picker.sectionLoadFailed': 'Load failed · exported as a whole',
145
+ 'picker.deviceSpecific': 'Device-specific',
146
+ 'picker.sensitive': 'Sensitive',
147
+ 'picker.showAll': 'Show all ({count})',
148
+ 'picker.summaryImport': '{sections} {sections, plural, section|sections} · {units} {units, plural, item|items}',
149
+ // —— Plugin tree embedded in the Extensions group (plugin → list entry / data dirs / large files) ——
150
+ 'picker.pluginRoot': 'Plugins',
151
+ 'picker.pluginLeafPlugin': 'Plugin list entry',
152
+ 'picker.pluginLeafConfig': 'Data dir (config)',
153
+ 'picker.pluginLeafAssets': 'Large files (wallpapers / databases)',
154
+ 'picker.pluginAreaUnread': 'Not read yet',
155
+ 'picker.pluginAreaAbsent': 'No content',
156
+ 'picker.bucketPlugins': 'Other entries of the plugins section (patch lines / pnpm-workspace.yaml)',
157
+ 'picker.bucketLooseFiles': 'Config not attributable to a plugin (~/.dsh root)',
158
+ 'picker.bucketHint': 'These entries have no provable plugin ownership — we never guess; expand to tick them one by one.',
159
+ 'picker.groupHint.extensions': 'Only provable ownership is listed (built-in source table + plugins that declare dsh.dataDirs); config without a package name stays under "unowned".',
160
+ // Export catalog group titles (mirror of ui/types.ts EXPORT_GROUPS; it decides the order)
161
+ 'group.general': 'General',
162
+ 'group.ai': 'AI',
163
+ 'group.extensions': 'Extensions',
164
+ 'group.mcp': 'MCP / Tools',
165
+ 'group.customization': 'Customization',
166
+ 'group.automation': 'Automation',
167
+ 'group.workspace': 'Workspace',
168
+ 'group.ui': 'UI',
169
+ 'group.optional': 'Optional Data',
170
+ 'import.nothingSelected': 'Nothing selected',
171
+ 'import.excludedByUser': '{count} deselected (not imported, not snapshotted)',
172
+ 'import.consult.hint': 'Read-only analysis: review the verdict and its evidence first, then choose what to import.',
173
+ 'consult.title': 'Pre-migration consultation',
174
+ 'library.pullTitle': 'Pull remote snapshot',
175
+ // "Pull" is not a read-only preview: the host stages the snapshot as a local ZIP and goes
176
+ // straight into the import wizard (pull-then-import), so the text must say so.
177
+ 'library.pulling': 'Pulling and importing…',
178
+ 'library.downloadTitle': 'Download remote snapshot',
179
+ 'library.downloading': 'Pulling and downloading…',
180
+
181
+ 'import.consult.unavailable': 'The consultation report is unavailable right now (importing can still continue).',
182
+ 'import.picker.title': 'Choose what to import',
183
+ 'import.picker.hint': 'Unchecked items are neither imported nor snapshotted; you can come back to this step anytime.',
184
+ };