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,257 @@
1
+ /**
2
+ * Config Manager 字典分域 · 会话归位(issue #45:跨机恢复后按 cwd 归位)。
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
+ // ---------- 会话归位(issue #45:跨机恢复后按 cwd 归位) ----------
10
+ 'nav.more': '更多',
11
+ 'palette.label': '命令面板',
12
+ 'palette.shortcut': '⌘/Ctrl+K',
13
+ 'palette.hint': '↑↓ 选择 · ↵ 执行 · Esc 关闭',
14
+ 'task.title.about': '关于',
15
+ 'task.title.export': '导出配置',
16
+ 'task.title.history': '迁移历史',
17
+ 'task.title.import': '导入配置',
18
+ 'task.title.market': '逛市场',
19
+ 'task.title.publish': '发布到市场',
20
+ 'task.title.runs': '活动记录',
21
+ 'task.back': '← 返回{page}',
22
+ 'common.infoHint': '查看说明',
23
+ 'about.update.title': '插件更新',
24
+ 'about.update.offline': '检查更新会访问 npm registry;离线或受限网络下失败属正常,不影响其它功能。',
25
+ 'about.update.current': '当前版本 {version}',
26
+ 'about.update.upToDate': '已是最新版本',
27
+ 'about.update.available': '有新版本 {latest}',
28
+ 'about.update.failed': '检查失败:{error}',
29
+ 'about.update.commandHint': '装完需重启 DSH',
30
+ 'about.update.copyCommand': '复制升级命令',
31
+ 'about.update.noCommand': '未识别到当前档案,或该档案由桌面端独占管理 —— 请在 DSH 的插件页更新本插件。',
32
+ 'about.update.check': '检查更新',
33
+ 'about.update.recheck': '重新检查',
34
+ 'about.update.apply': '立即更新',
35
+ 'about.update.applied': '已更新到 {version},重启 DSH 后生效',
36
+ 'about.update.dialog.title': '更新到 {version}',
37
+ 'about.update.dialog.from': '当前版本 {current}',
38
+ 'about.update.dialog.loadingNotes': '正在获取更新说明…',
39
+ 'about.update.dialog.notesFailed': '获取更新说明失败:{error}(不影响更新)',
40
+ 'about.update.dialog.noNotes': '未找到 v{version} 的发布说明,可直接更新。',
41
+ 'about.update.dialog.notExact': '未找到 v{version} 的发布说明,以下为最新一条发布内容。',
42
+ 'about.update.dialog.viewOnGithub': '在 GitHub 查看全部版本',
43
+ 'about.update.dialog.viewReleaseOnGithub': '在 GitHub 查看此版本',
44
+ 'about.update.dialog.install': '立即更新',
45
+ 'about.update.dialog.installing': '正在更新,请稍候…',
46
+ 'about.update.dialog.done': '更新完成:已安装 v{version}。',
47
+ 'about.update.dialog.restart': '需完全退出并重启 DSH 才会生效',
48
+ 'about.update.code.invalidVersion': '版本号无效,未能更新。',
49
+ 'about.update.code.profileUnknown': '无法识别当前档案,请在 DSH 的插件页更新本插件。',
50
+ 'about.update.code.unsupportedProfile': '桌面端档案由桌面应用独占管理,请在 DSH 的插件页更新本插件。',
51
+ 'about.update.code.nonRegistryInstall': '当前是本机/开发来源安装(link/file/git),不会用 registry 版本覆盖它 —— 请在来源目录更新。',
52
+ 'about.update.code.notNewer': '目标版本不高于当前版本,无需更新。',
53
+ 'about.update.code.installFailed': '更新失败:{error}',
54
+ 'palette.group.action': '动作',
55
+ 'palette.group.library': '产物库',
56
+ 'palette.group.navigate': '前往',
57
+ 'palette.group.rescue': '处置',
58
+ 'palette.group.view': '视图',
59
+ 'palette.placeholder': '输入命令或搜索…',
60
+ 'palette.empty': '没有匹配的命令',
61
+ 'shell.runs.title': '运行',
62
+ 'environment.title': '环境',
63
+ 'environment.tab.profiles': '档案',
64
+ 'environment.tab.maintenance': '维护与诊断',
65
+ 'profiles.version.dsh': 'DSH {version}',
66
+ 'profiles.version.format': '会话格式 v{version}',
67
+ 'profiles.format.newer': '对话在此实例不可见',
68
+ 'profiles.format.older': '对话在该档案不可见',
69
+ 'nextSteps.sessionsRestart.hint': '写入 {count} 个会话文件;DSH 只在启动时建立会话列表与工作区投影 —— 桌面端退出应用重开,CLI 档案重启 dsh。',
70
+ 'import.source.title': '来源与兼容性',
71
+ 'import.source.dsh': 'DSH 版本:{source} → 本机 {target}',
72
+ 'import.source.platform': '平台:{source} → 本机 {target}',
73
+ 'import.source.schema': '备份格式:v{version}',
74
+ 'import.source.reasons': '判定依据',
75
+ 'import.sessionFormat.skipped': '本次按「跳过」处置未导入 {count} 条会话(格式版本高于本机 DSH,导入了也看不到)',
76
+ 'import.sessionFormat.retryPlan': '重新生成计划',
77
+ 'import.sessionFormat.option.abort': '中止导入(推荐)',
78
+ 'import.sessionFormat.hint.abort': '在计划阶段就停下,不写入任何内容。',
79
+ 'import.sessionFormat.option.skip': '跳过这些会话',
80
+ 'import.sessionFormat.hint.skip': '这些会话默认不勾选(可在内容选择器改回),其余分区照常导入。',
81
+ 'import.sessionFormat.option.guide': '仅提示,照常导入',
82
+ 'import.sessionFormat.hint.guide': '会话文件照常写入,但本机 DSH 里看不到这些对话。',
83
+ 'import.sessionFormat.title': '本机读不了的会话',
84
+ 'import.sessionFormat.blocked': '已按「中止」停止,未写入任何内容 —— 改选「跳过」或「仅提示」后重新生成计划。',
85
+ 'import.sessionFormat.summary': '包内 {count} 条会话是 v{newer} 格式,本机只支持 v{target}:DSH 会静默跳过,不报错也不出现在工作区',
86
+ 'import.sessionFormat.sampled': '格式体检是抽查:已检查 {checked} 条,另有 {skipped} 条未检查(未检查的按可读处理,不参与本次处置)',
87
+ 'import.sessionFormat.guide.upgrade': '把本档案的 DSH 升级到支持 v{newer} 的版本(当前支持 v{target})后重新导入;或在导出机用不高于 v{target} 的 DSH 重新导出。',
88
+ 'import.sessionFormat.guide.doctor': '离线体检本机存量会话(只读):',
89
+ 'import.sessionFormat.guide.copy': '复制离线体检命令',
90
+ 'backupFiles.encryptedHint': '整包加密的备份:导入时需先输入备份密码解锁(文件本身没有损坏)',
91
+ 'library.expand': '展开 {name}',
92
+ 'library.moreActions': '更多操作',
93
+ 'backupFiles.inspectEncrypted': '这是整包加密的备份,无法直接查看内容:请点「导入」——向导会先让你输入备份密码解锁,解锁后即可看到包含的分区与差异。',
94
+ 'library.source.all': '全部',
95
+ 'library.kind.snapshot': '本机快照',
96
+ 'library.kind.backupFile': '备份文件',
97
+ 'library.kind.remote': '远端快照',
98
+ // cloud-sync 借鉴项 ⑥:快照的推送方设备(仅当快照 manifest 带 deviceName 时才渲染;旧快照不显示占位)
99
+ 'library.remoteDevice': '由 {device} 推送',
100
+ 'library.kind.market': '市场配置',
101
+ 'library.title': '产物库',
102
+ 'library.searchPlaceholder': '搜索文件名 / 备注 / 快照 id',
103
+ 'library.sourceFailed': '{count} 个来源读取失败',
104
+ // 读不到 ≠ 没有:快照目录被权限/占位挡住时如实说明(宿主 out.unreadable 透传)
105
+ 'library.snapshotsUnreadable': '快照目录读取失败:可能有快照读不出',
106
+ // 预览后磁盘已变化:绝不执行另一套没确认过的动作,请重新预览
107
+ 'snapshots.planChanged': '环境在预览后发生了变化,恢复已取消 —— 请重新预览确认',
108
+ // 删除快照被 recovery 引用挡住(与自动保留清理的 F3 豁免同源)
109
+ 'library.snapshotReferencedByRecovery': '该快照是事故恢复的回滚点,已拒绝删除(请先处理恢复事项)',
110
+ 'library.snapshotReferenceUnreadable': '读不到恢复引用清单,已保守拒绝删除(请重试)',
111
+ 'library.retry': '重试',
112
+ 'library.emptyFiltered': '没有匹配的产物',
113
+ 'library.delete': '删除',
114
+ 'library.remoteDeleteTitle': '删除远端快照',
115
+ 'library.remoteDeleteConfirm': '确认删除远端快照 {time}?该文件将从远端仓库中删除,不可恢复。',
116
+ 'library.remoteDeleteBaseline': '注意:这是当前的同步基线(本机上次同步到的那份)。删除不会改动本机配置,但下次同步会重新比对远端最新快照。',
117
+ 'library.remoteDeleted': '已删除远端快照',
118
+ 'library.summary.count': '共 {count} 个',
119
+ 'library.summary.filtered': '{shown} / {total} 个',
120
+ 'library.new.export': '手动导出',
121
+ 'library.new.import': '从文件导入',
122
+ 'library.new.market': '逛市场',
123
+ 'import.reason.crossPlatform': '跨平台:备份来自 {source},本机是 {target}',
124
+ 'palette.rescue.recovery': '事故恢复',
125
+ 'palette.rescue.mode': '救援模式',
126
+ // S7:回滚点(工作区 + 会话回退)命令标题
127
+ 'palette.rescue.rollback': '回滚点(工作区 + 会话回退)',
128
+ 'import.reason.schemaUnsupported': '包内 schema 版本 v{version} 超出本插件支持范围',
129
+ 'import.reason.missingSections': '备份声明但包内缺失 {count} 个分区:{sections}',
130
+ 'import.reason.sourceNewer': '备份来自更新的 DSH({source} → 本机 {target}):可能有本机不认识的配置',
131
+ 'import.reason.sourceOlder': '备份来自更旧的 DSH({source} → 本机 {target}):向后兼容',
132
+ } as const;
133
+
134
+ export const en: Record<keyof typeof zh, string> = {
135
+ // ---------- session grouping (issue #45) ----------
136
+ 'nav.more': 'More',
137
+ 'palette.label': 'Command palette',
138
+ 'palette.shortcut': '⌘/Ctrl+K',
139
+ 'palette.hint': '↑↓ select · ↵ run · Esc close',
140
+ 'task.title.about': 'About',
141
+ 'task.title.export': 'Export config',
142
+ 'task.title.history': 'Migration history',
143
+ 'task.title.import': 'Import config',
144
+ 'task.title.market': 'Browse market',
145
+ 'task.title.publish': 'Publish to market',
146
+ 'task.title.runs': 'Activity log',
147
+ 'task.back': '← Back to {page}',
148
+ 'common.infoHint': 'Show description',
149
+ 'about.update.title': 'Plugin updates',
150
+ 'about.update.offline': 'The check calls the npm registry; failures are expected offline and affect nothing else.',
151
+ 'about.update.current': 'Current version {version}',
152
+ 'about.update.upToDate': 'Up to date',
153
+ 'about.update.available': 'New version {latest}',
154
+ 'about.update.failed': 'Check failed: {error}',
155
+ 'about.update.commandHint': 'Restart DSH after installing',
156
+ 'about.update.copyCommand': 'Copy upgrade command',
157
+ 'about.update.noCommand': 'The current profile is unknown or managed exclusively by the desktop app — update this plugin from DSH\'s plugin page.',
158
+ 'about.update.check': 'Check for updates',
159
+ 'about.update.recheck': 'Check again',
160
+ 'about.update.apply': 'Update now',
161
+ 'about.update.applied': 'Updated to {version} — restart DSH to apply',
162
+ 'about.update.dialog.title': 'Update to {version}',
163
+ 'about.update.dialog.from': 'Current version {current}',
164
+ 'about.update.dialog.loadingNotes': 'Loading release notes…',
165
+ 'about.update.dialog.notesFailed': 'Could not load release notes: {error} (you can still update)',
166
+ 'about.update.dialog.noNotes': 'No release notes found for v{version}. You can still update.',
167
+ 'about.update.dialog.notExact': 'No release notes found for v{version}; showing the latest release instead.',
168
+ 'about.update.dialog.viewOnGithub': 'View all releases on GitHub',
169
+ 'about.update.dialog.viewReleaseOnGithub': 'View this release on GitHub',
170
+ 'about.update.dialog.install': 'Update now',
171
+ 'about.update.dialog.installing': 'Updating, please wait…',
172
+ 'about.update.dialog.done': 'Update complete: v{version} installed.',
173
+ 'about.update.dialog.restart': 'Fully quit and restart DSH to take effect',
174
+ 'about.update.code.invalidVersion': 'Invalid version — nothing was updated.',
175
+ 'about.update.code.profileUnknown': "Could not determine the current profile; update this plugin from DSH's plugin page.",
176
+ 'about.update.code.unsupportedProfile': "The desktop profile is managed by the desktop app; update this plugin from DSH's plugin page.",
177
+ 'about.update.code.nonRegistryInstall': 'Installed from a local/dev source (link/file/git) — a registry version will not overwrite it. Update it in its source directory.',
178
+ 'about.update.code.notNewer': 'The target version is not newer than the current one; nothing to do.',
179
+ 'about.update.code.installFailed': 'Update failed: {error}',
180
+ 'palette.group.action': 'Actions',
181
+ 'palette.group.library': 'Library',
182
+ 'palette.group.navigate': 'Go to',
183
+ 'palette.group.rescue': 'Recovery',
184
+ 'palette.group.view': 'Views',
185
+ 'palette.placeholder': 'Type a command or search…',
186
+ 'palette.empty': 'No matching commands',
187
+ 'shell.runs.title': 'Runs',
188
+ 'environment.title': 'Environment',
189
+ 'environment.tab.profiles': 'Profiles',
190
+ 'environment.tab.maintenance': 'Maintenance',
191
+ 'profiles.version.dsh': 'DSH {version}',
192
+ 'profiles.version.format': 'session format v{version}',
193
+ 'profiles.format.newer': 'its conversations are hidden here',
194
+ 'profiles.format.older': 'conversations here are hidden there',
195
+ 'nextSteps.sessionsRestart.hint': '{count} session {count, plural, file|files} written. DSH builds the session list and workspace projection only at startup — on Desktop quit and reopen the app, for CLI profiles restart dsh.',
196
+ 'import.source.title': 'Source & compatibility',
197
+ 'import.source.dsh': 'DSH version: {source} → local {target}',
198
+ 'import.source.platform': 'Platform: {source} → local {target}',
199
+ 'import.source.schema': 'Backup format: v{version}',
200
+ 'import.source.reasons': 'Why this score',
201
+ 'import.sessionFormat.skipped': '{count} {count, plural, session was|sessions were} not imported because of the \"skip\" disposition (their format is newer than this DSH build — they would not be visible anyway)',
202
+ 'import.sessionFormat.retryPlan': 'Regenerate plan',
203
+ 'import.sessionFormat.option.abort': 'Abort the import (recommended)',
204
+ 'import.sessionFormat.hint.abort': 'Stops at the planning stage and writes nothing.',
205
+ 'import.sessionFormat.option.skip': 'Skip these sessions',
206
+ 'import.sessionFormat.hint.skip': 'Those sessions are left unchecked (tick them back in the content picker if you want); everything else imports as usual.',
207
+ 'import.sessionFormat.option.guide': 'Warn only, import as usual',
208
+ 'import.sessionFormat.hint.guide': 'Session files are written as usual, but this DSH build will not show those conversations.',
209
+ 'import.sessionFormat.title': 'Sessions this DSH build cannot read',
210
+ 'import.sessionFormat.blocked': 'Stopped by \"abort\" — nothing was written. Pick \"skip\" or \"warn only\" and regenerate the plan.',
211
+ 'import.sessionFormat.summary': '{count} {count, plural, session log is|session logs are} v{newer} while this build supports v{target}: DSH skips them silently — no error, and they never appear in the workspace',
212
+ 'import.sessionFormat.sampled': 'The format check was sampled: {checked} checked, {skipped} not checked (unchecked ones are treated as readable and are not affected by this disposition)',
213
+ 'import.sessionFormat.guide.upgrade': 'Upgrade the DSH build of this profile to one that supports v{newer} (this build supports v{target}) and import again; or re-export on the source machine with a DSH build no newer than v{target}.',
214
+ 'import.sessionFormat.guide.doctor': 'Inspect the sessions already on this machine (read-only):',
215
+ 'import.sessionFormat.guide.copy': 'Copy the offline inspection command',
216
+ 'backupFiles.encryptedHint': 'Fully encrypted backup: importing requires the backup password to unlock it first (the file itself is intact)',
217
+ 'library.expand': 'Expand {name}',
218
+ 'library.moreActions': 'More actions',
219
+ 'backupFiles.inspectEncrypted': 'This backup is fully encrypted, so its contents cannot be inspected directly. Use Import — the wizard asks for the backup password, unlocks the archive, and then shows its sections and diff.',
220
+ 'library.source.all': 'All',
221
+ 'library.kind.snapshot': 'Local snapshot',
222
+ 'library.kind.backupFile': 'Backup file',
223
+ 'library.kind.remote': 'Remote snapshot',
224
+ 'library.remoteDevice': 'Pushed by {device}',
225
+ 'library.kind.market': 'Market config',
226
+ 'library.title': 'Artifact library',
227
+ 'library.searchPlaceholder': 'Search file name / note / snapshot id',
228
+ 'library.sourceFailed': '{count} sources failed to load',
229
+ // "cannot read" is not "no snapshots": surface the host's out.unreadable fact
230
+ 'library.snapshotsUnreadable': 'Snapshot folder unreadable: snapshots may exist',
231
+ // The environment changed after the preview: never run a different, unconfirmed plan
232
+ 'snapshots.planChanged': 'The environment changed after the preview, so the restore was cancelled — preview again to confirm',
233
+ // Deleting a snapshot that recovery still references is refused (same F3 exemption as auto-prune)
234
+ 'library.snapshotReferencedByRecovery': 'This snapshot is a recovery rollback point — deletion refused (resolve the recovery items first)',
235
+ 'library.snapshotReferenceUnreadable': 'The recovery reference list could not be read — deletion conservatively refused (please retry)',
236
+ 'library.retry': 'Retry',
237
+ 'library.emptyFiltered': 'No matching artifacts',
238
+ 'library.delete': 'Delete',
239
+ 'library.remoteDeleteTitle': 'Delete remote snapshot',
240
+ 'library.remoteDeleteConfirm': 'Delete remote snapshot {time}? The file will be removed from the remote repository and cannot be recovered.',
241
+ 'library.remoteDeleteBaseline': 'Note: this is the current sync baseline (the snapshot this machine last synced to). Deleting it does not change this machine, but the next sync will re-compare against the latest remote snapshot.',
242
+ 'library.remoteDeleted': 'Remote snapshot deleted',
243
+ 'library.summary.count': '{count} total',
244
+ 'library.summary.filtered': '{shown} of {total}',
245
+ 'library.new.export': 'Export',
246
+ 'library.new.import': 'Import from file',
247
+ 'library.new.market': 'Browse market',
248
+ 'import.reason.crossPlatform': 'Cross-platform: backup from {source}, local is {target}',
249
+ 'palette.rescue.recovery': 'Incident recovery',
250
+ 'palette.rescue.mode': 'Rescue mode',
251
+ // S7: rollback points (workspace + session rewind) command title
252
+ 'palette.rescue.rollback': 'Rollback points (workspace + session rewind)',
253
+ 'import.reason.schemaUnsupported': 'The bundle uses schema v{version}, beyond what this plugin supports',
254
+ 'import.reason.missingSections': 'Declared by the backup but missing from the archive: {count} {count, plural, section|sections} — {sections}',
255
+ 'import.reason.sourceNewer': 'Backup comes from a newer DSH ({source} → local {target}): it may contain settings this build does not know',
256
+ 'import.reason.sourceOlder': 'Backup comes from an older DSH ({source} → local {target}): backward compatible',
257
+ };
@@ -0,0 +1,149 @@
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
+ // —— 同步状态行(Workbench Rebuild)——
10
+ // —— Shell(Workbench Rebuild 2026-09:导航条/状态栏/抽屉)——
11
+ 'nav.home': '首页',
12
+ 'nav.export': '导出',
13
+ 'nav.import': '导入',
14
+ 'nav.sync': '同步',
15
+ 'nav.market': '市场',
16
+ // 快照详情弹窗(点快照卡片打开;只读)
17
+ // 重启之后不再让人重启(真机反馈):这一句只陈述「本次启动的实际情况」
18
+ 'shell.running.restore': '快照恢复',
19
+ 'shell.status.idle': '就绪',
20
+ 'shell.status.running': '{count} 个任务进行中',
21
+ 'shell.status.recovery': '恢复待处理',
22
+ // —— 运行中心(活动抽屉「进行中」段;终止 = 协作式取消)——
23
+ 'shell.status.runningAction': '查看进行中的任务',
24
+ 'runs.loading': '正在读取任务列表…',
25
+ 'runs.loadFailed': '读取任务列表失败:{message}',
26
+ 'runs.empty': '近期没有任何任务(运行中的任务会实时出现在这里)',
27
+ 'runs.retentionHint': '刚结束的任务保留 30 分钟;完整操作审计见「迁移历史」',
28
+ 'runs.runningBadge': '{count} 个进行中',
29
+ 'runs.awaitingBadge': '{count} 个等待你选择',
30
+ 'runs.awaitingDecision': '等待你选择',
31
+ 'runs.decideNow': '去选择',
32
+ 'runs.cancelAction': '终止…',
33
+ 'runs.counts': '成功 {ok} · 警告 {warn} · 失败 {fail} · 跳过 {skip}',
34
+ 'runs.kind.export': '导出',
35
+ 'runs.kind.import': '导入',
36
+ 'runs.kind.autosync': '自动同步',
37
+ 'runs.kind.sync-apply': '从远端合并',
38
+ 'runs.kind.backup-schedule': '定时备份',
39
+ 'runs.kind.restore': '快照恢复',
40
+ 'runs.kind.profile-switch': '档案切换',
41
+ 'runs.kind.recovery': '事故恢复',
42
+ 'runs.status.running': '进行中',
43
+ 'runs.status.done': '已完成',
44
+ 'runs.status.failed': '失败',
45
+ 'runs.progress.running': '执行中',
46
+ 'runs.progress.done': '已完成',
47
+ 'runs.progress.failed': '已失败',
48
+ 'runs.cancelTitle': '终止这个任务',
49
+ 'runs.cancelCost': '已应用 {applied} 项、未执行 {pending} 项',
50
+ 'runs.cancelCostUnknown': '已应用项数未知(宿主未上报进度计数)',
51
+ 'runs.cancel.rollback': '回滚到导入前',
52
+ 'runs.cancel.rollbackDesc': '撤销本次导入已应用的全部改动,回到导入前的快照状态',
53
+ 'runs.cancel.keep': '保留已应用项',
54
+ 'runs.cancel.keepDesc': '只停掉未执行的部分,已经写进配置的内容留在本机;随后会自动做一次启动安全审计',
55
+ 'runs.cancelKeepWarn': '「保留」会留下一笔未完成的导入:审计只能压低 DSH 启动失败的概率,不能保证。若 DSH 起不来,用「事故恢复 / SAFE MODE」或离线 CLI 处理。',
56
+ 'runs.recommended': '推荐',
57
+ 'runs.cancelAbort': '继续运行',
58
+ 'runs.cancelConfirm': '确认终止',
59
+ 'runs.cancelRequestedToast': '已请求终止:将在当前计划项完成后暂停',
60
+ 'runs.cancelWaiting': '已请求终止 · 等当前步骤结束 · 已等 {minutes} 分钟',
61
+ 'runs.cancelWaitingJustNow': '已请求终止 · 等当前步骤结束',
62
+ 'runs.cancelStuck': '长时间没有到达安全点。若出现「跳过当前插件」请先点它;仍不行请重启 DSH —— 环境锁由本进程持有,重启即释放,不重启时其他写操作会一直被拒(423)。',
63
+ 'runs.lock.title': '环境锁',
64
+ 'runs.lock.needsAction': '需要处理',
65
+ 'runs.lock.held': '使用中',
66
+ 'runs.lock.attentionDesc': '残留锁(持有进程已不存在)或锁状态无法判定:重试/重启都不会自愈,需显式回收。',
67
+ 'runs.lock.heldDesc': '被另一项任务持有,会自行释放;若它就是上方卡住的那次导入,只能重启 DSH。',
68
+ 'runs.lock.recover': '回收残留锁',
69
+ 'runs.lock.recoverOk': '已回收残留锁',
70
+ 'runs.lock.recoverRefused': '未回收({state}):只有「持有者已确证死亡」的残留锁才允许回收,活锁会自行释放',
71
+ 'runs.lock.recoverFailed': '回收失败:{message}',
72
+ 'runs.lock.readFailed': '读不到环境锁状态:{message}',
73
+ 'runs.skipRequestedToast': '已请求跳过当前插件',
74
+ 'runs.decisionAcceptedToast': '已提交你的选择',
75
+ 'runs.decisionTooLateToast': '来不及了:等待超时已按安全侧默认(回滚)继续',
76
+ 'runs.actionFailed': '操作失败:{message}',
77
+ 'runs.unsupported': '该任务不支持手动终止',
78
+ } as const;
79
+
80
+ export const en: Record<keyof typeof zh, string> = {
81
+ // —— Shell(Workbench Rebuild 2026-09)——
82
+ 'nav.home': 'Home',
83
+ 'nav.export': 'Export',
84
+ 'nav.import': 'Import',
85
+ 'nav.sync': 'Sync',
86
+ 'nav.market': 'Market',
87
+ // Snapshot detail dialog (opened by clicking a snapshot card; read-only)
88
+ // After the restart the banner must stop asking for one (real-machine feedback)
89
+ 'shell.running.restore': 'Snapshot restore',
90
+ 'shell.status.idle': 'Idle',
91
+ 'shell.status.running': '{count} {count, plural, task|tasks} running',
92
+ 'shell.status.recovery': 'Recovery pending',
93
+ // —— Run center (the drawer's "In progress" segment; terminate = cooperative cancel) ——
94
+ 'shell.status.runningAction': 'View running tasks',
95
+ 'runs.loading': 'Loading tasks...',
96
+ 'runs.loadFailed': 'Failed to load tasks: {message}',
97
+ 'runs.empty': 'No recent tasks (running ones appear here live)',
98
+ 'runs.retentionHint': 'Recently finished tasks are kept for 30 minutes; the full audit lives in Migration History',
99
+ 'runs.runningBadge': '{count} running',
100
+ 'runs.awaitingBadge': '{count} waiting for you',
101
+ 'runs.awaitingDecision': 'Waiting for you',
102
+ 'runs.decideNow': 'Decide',
103
+ 'runs.cancelAction': 'Terminate...',
104
+ 'runs.counts': 'OK {ok} · warn {warn} · fail {fail} · skip {skip}',
105
+ 'runs.kind.export': 'Export',
106
+ 'runs.kind.import': 'Import',
107
+ 'runs.kind.autosync': 'Auto sync',
108
+ 'runs.kind.sync-apply': 'Merge from remote',
109
+ 'runs.kind.backup-schedule': 'Scheduled backup',
110
+ 'runs.kind.restore': 'Snapshot restore',
111
+ 'runs.kind.profile-switch': 'Profile switch',
112
+ 'runs.kind.recovery': 'Incident recovery',
113
+ 'runs.status.running': 'Running',
114
+ 'runs.status.done': 'Done',
115
+ 'runs.status.failed': 'Failed',
116
+ 'runs.progress.running': 'Running',
117
+ 'runs.progress.done': 'Done',
118
+ 'runs.progress.failed': 'Failed',
119
+ 'runs.cancelTitle': 'Terminate this task',
120
+ 'runs.cancelCost': '{applied} applied, {pending} not executed',
121
+ 'runs.cancelCostUnknown': 'Applied item count is unknown (the host did not report progress counts)',
122
+ 'runs.cancel.rollback': 'Roll back to before the import',
123
+ 'runs.cancel.rollbackDesc': 'Undo every change this import applied and return to the pre-import snapshot',
124
+ 'runs.cancel.keep': 'Keep applied items',
125
+ 'runs.cancel.keepDesc': 'Stop only the remaining work and keep what is already written; a launch safety audit runs right after',
126
+ 'runs.cancelKeepWarn': 'Keeping leaves an unfinished import behind: the audit only lowers the chance of DSH failing to start, it cannot guarantee it. If DSH will not start, use incident recovery / SAFE MODE or the offline CLI.',
127
+ 'runs.recommended': 'Recommended',
128
+ 'runs.cancelAbort': 'Keep running',
129
+ 'runs.cancelConfirm': 'Terminate',
130
+ 'runs.cancelRequestedToast': 'Termination requested: it pauses after the current plan item finishes',
131
+ 'runs.cancelWaiting': 'Termination requested · waits for the current step · {minutes} min so far',
132
+ 'runs.cancelWaitingJustNow': 'Termination requested · waits for the current step',
133
+ 'runs.cancelStuck': 'No safe point reached for a long time. If "Skip current plugin" appears, click it first; otherwise restart DSH -- the environment lock is held by this process, so a restart releases it. Without a restart, every other write keeps being rejected (423).',
134
+ 'runs.lock.title': 'Environment lock',
135
+ 'runs.lock.needsAction': 'Action needed',
136
+ 'runs.lock.held': 'In use',
137
+ 'runs.lock.attentionDesc': 'Leftover lock (holder no longer exists) or undeterminable state: retrying or restarting will NOT fix it -- recover explicitly.',
138
+ 'runs.lock.heldDesc': 'Held by another task; it releases itself. If it is the stuck import above, only a DSH restart frees it.',
139
+ 'runs.lock.recover': 'Recover leftover lock',
140
+ 'runs.lock.recoverOk': 'Leftover lock recovered',
141
+ 'runs.lock.recoverRefused': 'Not recovered ({state}): only a leftover lock whose holder is proven dead may be recovered; a live lock releases itself',
142
+ 'runs.lock.recoverFailed': 'Recovery failed: {message}',
143
+ 'runs.lock.readFailed': 'Cannot read the environment lock state: {message}',
144
+ 'runs.skipRequestedToast': 'Requested to skip the current plugin',
145
+ 'runs.decisionAcceptedToast': 'Your choice was submitted',
146
+ 'runs.decisionTooLateToast': 'Too late: the wait timed out and the safe-side default (roll back) already continued',
147
+ 'runs.actionFailed': 'Action failed: {message}',
148
+ 'runs.unsupported': 'This task does not support manual termination',
149
+ };