dsh-agent-control-center 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-agent-control-center",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "DSH Agent Control Center: AGENTS.md editing with backups, tool inventory, sessions, real token usage, agent metadata, diagnostics and templates in one settings page.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -115,6 +115,7 @@ const MODULES = [
115
115
  ['recovery', 'lib/modules/i-recovery.js', 'src/client/pages/recovery.js', 'src/client/i18n/recovery.js', 'tests/recovery.test.mjs'],
116
116
  ['instruction', 'lib/modules/j-instruction.js', 'src/client/pages/instruction.js', 'src/client/i18n/instruction.js', 'tests/instruction.test.mjs'],
117
117
  ['export', 'lib/modules/k-export.js', 'src/client/pages/export.js', 'src/client/i18n/export.js', 'tests/export.test.mjs'],
118
+ ['health', 'lib/modules/l-health.js', 'src/client/pages/health.js', 'src/client/i18n/health.js', 'tests/health-check.test.mjs'],
118
119
  ]
119
120
 
120
121
  const present = []
@@ -0,0 +1,260 @@
1
+ /* Health page (module L) — vocabulary for the read-only health check.
2
+ *
3
+ * Host-provided evidence (plugin ids, module names, settings namespace ids,
4
+ * secret key names, scan file paths and compatibility reason texts) is data and
5
+ * is rendered verbatim by the page; every sentence the page itself writes lives
6
+ * here, in both languages, with the same key set (the build proves parity). */
7
+ ACC.addI18n({
8
+ zh: {
9
+ 'nav.health': '健康检查',
10
+ 'nav.desc.health': '插件清单、设置命名空间、分区冲突与兼容性的只读体检',
11
+
12
+ 'health.readOnlyNotice': '本页只读:只读取插件行、设置元数据、扫描结果与兼容性结论,不修改任何插件或配置。',
13
+ 'health.loading': '正在读取体检数据…',
14
+ 'health.refreshing': '刷新中…',
15
+ 'health.refresh': '刷新',
16
+ 'health.blockFailed': '这一块不可用',
17
+ 'health.unavailable': '当前不可用',
18
+ 'health.unavailableNextStep': '下一步:确认宿主已加载包含 health 模块的本插件版本(旧宿主没有 health.* 方法),然后刷新本页。',
19
+ 'health.reasonMissing': '宿主没有给出原因',
20
+ 'health.noteLabel': '说明',
21
+ 'health.hostHealthTitle': '宿主通道',
22
+ 'health.moduleMissingReason': '宿主没有加载 health 模块(可能是旧版插件或该模块未启用)',
23
+ 'health.moduleMissingHint': '升级本插件到包含 health 模块的版本后刷新本页;本页不会退回显示推测数据。',
24
+ 'health.moduleBlockedReason': '宿主报告 health 模块被阻断',
25
+ 'health.moduleBlockedHint': '按该模块的详情修复后刷新;只读页不会执行修复。',
26
+
27
+ 'health.summaryTitle': '体检结论',
28
+ 'health.summarySubtitle': '四项只读事实的汇总:插件清单、设置命名空间、section 冲突与兼容性',
29
+ 'health.worst': '最严重项',
30
+ 'health.worstNone': '全部通过',
31
+ 'health.worstHint': '先处理这一块;其余块的证据在下方各自列出。',
32
+ 'health.severity.ok': '通过',
33
+ 'health.severity.warn': '注意',
34
+ 'health.severity.error': '错误',
35
+ 'health.severity.info': '信息',
36
+ 'health.block.plugins': '插件',
37
+ 'health.block.settings': '设置',
38
+ 'health.block.sections': '分区扫描',
39
+ 'health.block.compat': '兼容性',
40
+ 'health.tile.plugins': '插件',
41
+ 'health.tile.settings': '设置命名空间',
42
+ 'health.tile.sections': '分区冲突',
43
+ 'health.tile.compat': '兼容',
44
+ 'health.tileAnomalies': '{count} 个异常',
45
+ 'health.tileNoAnomalies': '无异常',
46
+ 'health.tileSectionsCount': '共 {count} 个 section',
47
+ 'health.redacted': '已脱敏',
48
+ 'health.notRedacted': '未验证脱敏',
49
+ 'health.readOnlyYes': '只读',
50
+ 'health.readOnlyNo': '可写',
51
+ 'health.generatedAt': '生成时间 {time}',
52
+ 'health.summaryPartial': '部分子项不可用:空值显示为 —,不显示推测数据。',
53
+ 'health.summaryMissingWorst': '汇总没有给出最严重项结论;请刷新或逐块查看原因。',
54
+ 'health.tilesAria': '体检分项',
55
+
56
+ 'health.refresh.summary': '刷新体检结论',
57
+ 'health.refresh.plugins': '刷新插件清单',
58
+ 'health.refresh.settings': '刷新设置命名空间',
59
+ 'health.refresh.sections': '刷新分区扫描结果',
60
+ 'health.refresh.compat': '刷新兼容性结论',
61
+ 'health.refresh.host': '刷新宿主通道',
62
+
63
+ 'health.pluginsTitle': '插件清单',
64
+ 'health.pluginsSubtitle': '来自宿主 pluginManager 的插件行;无法地址化的行与重复注册单独列出',
65
+ 'health.source': '来源',
66
+ 'health.pluginsColumnEntry': 'entryId',
67
+ 'health.pluginsColumnModule': 'moduleName',
68
+ 'health.pluginsColumnPatch': 'patchId',
69
+ 'health.pluginsColumnReadOnly': 'readOnlyReason',
70
+ 'health.pluginsEmpty': '没有插件行',
71
+ 'health.pluginsEmptyHint': '宿主 pluginManager 返回空清单;请确认当前 profile 是否安装了插件。',
72
+ 'health.anomaliesTitle': '清单异常',
73
+ 'health.anomaliesNone': '没有检测到插件清单异常',
74
+ 'health.anomaliesNoneHint': '插件行地址与 moduleName 均唯一。',
75
+ 'health.anomalyKindLabel': '类型',
76
+ 'health.anomalySuggestion': '建议动作',
77
+ 'health.anomalyKind.duplicate-module': '重复模块',
78
+ 'health.anomalyKind.unaddressable': '不可地址化',
79
+ 'health.anomalyKindUnknown': '其他异常',
80
+ 'health.anomalyAction.duplicate-module': '在 profile 中只保留一个注册行,或为重复的模块改名。',
81
+ 'health.anomalyAction.unaddressable': '改用插件自身配置或 profile patch 中可寻址的行;无法通过 patch 控制的插件行不应在此修改。',
82
+ 'health.anomalyActionGeneric': '核对重复或无地址的行,必要时在 profile patch 中调整注册。',
83
+
84
+ 'health.settingsTitle': '设置命名空间',
85
+ 'health.settingsSubtitle': '只读元数据:命名空间、修订、自动生成与 secret 键名',
86
+ 'health.settingsRedactionOk': '已脱敏',
87
+ 'health.settingsRedactionFail': '未验证脱敏',
88
+ 'health.settingsRedactionOkHint': '宿主按 redactSecrets:true 返回元数据,未出现原值。',
89
+ 'health.settingsRedactionFailHint': '检测到未经脱敏的 secret 元数据;原值已丢弃,请升级宿主或移除该命名空间。',
90
+ 'health.settingsOwn': '本插件命名空间',
91
+ 'health.settingsDeclared': '已声明',
92
+ 'health.settingsNotDeclared': '未声明',
93
+ 'health.settingsEnabled': '已启用',
94
+ 'health.settingsDisabled': '已禁用',
95
+ 'health.settingsColumnNs': 'ns',
96
+ 'health.settingsColumnRevision': 'revision',
97
+ 'health.settingsColumnAutoGenerate': 'autoGenerate',
98
+ 'health.settingsColumnSecretKeys': 'secretKeys',
99
+ 'health.secretKeyCount': '{count} 个',
100
+ 'health.yes': '是',
101
+ 'health.no': '否',
102
+ 'health.settingsEmpty': '没有设置命名空间',
103
+ 'health.settingsEmptyHint': '宿主 settings.describe 返回空列表;请确认当前 profile 与插件命名空间是否正确。',
104
+ 'health.settingsNote': '来源 settings.describe({ redactSecrets: true }):只返回命名空间元数据与 secret 键名,schema/value/base/user 原值不进入响应。',
105
+
106
+ 'health.sectionsTitle': '设置分区静态扫描',
107
+ 'health.sectionsSubtitle': '扫描 profile 下客户端 bundle 中的字面量 settings.section 注册',
108
+ 'health.sectionsScanned': '已扫描 {packages} 个包、{files} 个客户端文件',
109
+ 'health.sectionsColumnId': 'id',
110
+ 'health.sectionsColumnOwner': 'owner',
111
+ 'health.sectionsColumnFile': 'file',
112
+ 'health.sectionsEmpty': '扫描没有发现 settings.section 注册',
113
+ 'health.sectionsEmptyHint': '若期望有设置项,请确认对应插件已构建带字面量 settings.section 的 client.js。',
114
+ 'health.sectionsNote': '静态扫描可能漏检动态注册:只覆盖构建产物内的字面量 settings.section。',
115
+ 'health.conflictsTitle': '分区 id 冲突',
116
+ 'health.conflictsNone': '没有检测到冲突',
117
+ 'health.conflictsNoneHint': '没有被多个插件包重复注册的 settings.section id;动态注册不在静态扫描范围内。',
118
+ 'health.conflictKindLabel': '类型',
119
+ 'health.conflictOwners': '注册者',
120
+ 'health.conflictSuggestion': '建议',
121
+ 'health.conflictKind.duplicate-id': '重复 id',
122
+ 'health.conflictKindUnknown': '其他冲突',
123
+ 'health.conflictSuggestionFallback': '请核对注册者并只保留一个 settings.section id。',
124
+
125
+ 'health.compatTitle': '兼容性',
126
+ 'health.compatSubtitle': '宿主版本判定结论与只读模式;写操作在看结论前应保持关闭',
127
+ 'health.compatLevel': 'level',
128
+ 'health.compatVersion': 'version',
129
+ 'health.compatReadOnly': 'readOnly',
130
+ 'health.compatReasons': '兼容性原因',
131
+ 'health.compatReasonsNone': '兼容层没有给出原因',
132
+ 'health.compatReasonsNoneHint': '没有给出原因通常表示当前宿主版本已通过校验;写操作仍应先看 readOnly。',
133
+ },
134
+ en: {
135
+ 'nav.health': 'Health check',
136
+ 'nav.desc.health': 'Read-only check of the plugin inventory, settings namespaces, section conflicts and compatibility',
137
+
138
+ 'health.readOnlyNotice': 'This page is read-only: it only reads plugin rows, settings metadata, scan results and the compatibility verdict. It never modifies a plugin or configuration.',
139
+ 'health.loading': 'Loading health data…',
140
+ 'health.refreshing': 'Refreshing…',
141
+ 'health.refresh': 'Refresh',
142
+ 'health.blockFailed': 'This block is unavailable',
143
+ 'health.unavailable': 'Currently unavailable',
144
+ 'health.unavailableNextStep': 'Next step: confirm the host loaded a plugin build that includes the health module (older hosts expose no health.* methods), then refresh this page.',
145
+ 'health.reasonMissing': 'The host gave no reason',
146
+ 'health.noteLabel': 'Note',
147
+ 'health.hostHealthTitle': 'Host channel',
148
+ 'health.moduleMissingReason': 'The host did not load the health module (older plugin build or the module is disabled)',
149
+ 'health.moduleMissingHint': 'Upgrade this plugin to a build that includes the health module, then refresh this page; the page never falls back to guessed data.',
150
+ 'health.moduleBlockedReason': 'The host reports the health module is blocked',
151
+ 'health.moduleBlockedHint': 'Fix this module detail, then refresh; this read-only page performs no repair.',
152
+
153
+ 'health.summaryTitle': 'Health verdict',
154
+ 'health.summarySubtitle': 'Four read-only facts folded together: plugin inventory, settings namespaces, section conflicts and compatibility',
155
+ 'health.worst': 'Most severe',
156
+ 'health.worstNone': 'All checks passed',
157
+ 'health.worstHint': 'Address this block first; evidence for the other blocks is listed below.',
158
+ 'health.severity.ok': 'OK',
159
+ 'health.severity.warn': 'Warning',
160
+ 'health.severity.error': 'Error',
161
+ 'health.severity.info': 'Info',
162
+ 'health.block.plugins': 'Plugins',
163
+ 'health.block.settings': 'Settings',
164
+ 'health.block.sections': 'Section scan',
165
+ 'health.block.compat': 'Compatibility',
166
+ 'health.tile.plugins': 'Plugins',
167
+ 'health.tile.settings': 'Settings namespaces',
168
+ 'health.tile.sections': 'Section conflicts',
169
+ 'health.tile.compat': 'Compatibility',
170
+ 'health.tileAnomalies': '{count} anomalies',
171
+ 'health.tileNoAnomalies': 'No anomalies',
172
+ 'health.tileSectionsCount': '{count} sections',
173
+ 'health.redacted': 'Redaction verified',
174
+ 'health.notRedacted': 'Redaction unverified',
175
+ 'health.readOnlyYes': 'Read-only',
176
+ 'health.readOnlyNo': 'Writable',
177
+ 'health.generatedAt': 'Generated {time}',
178
+ 'health.summaryPartial': 'Some sub-results are unavailable: empty values render as — instead of guessed data.',
179
+ 'health.summaryMissingWorst': 'The summary reported no most-severe verdict; refresh or inspect each block for the reason.',
180
+ 'health.tilesAria': 'Health check sections',
181
+
182
+ 'health.refresh.summary': 'Refresh health summary',
183
+ 'health.refresh.plugins': 'Refresh plugin inventory',
184
+ 'health.refresh.settings': 'Refresh settings namespaces',
185
+ 'health.refresh.sections': 'Refresh section scan',
186
+ 'health.refresh.compat': 'Refresh compatibility verdict',
187
+ 'health.refresh.host': 'Refresh host channel',
188
+
189
+ 'health.pluginsTitle': 'Plugin inventory',
190
+ 'health.pluginsSubtitle': 'Plugin rows from the host pluginManager; unaddressable rows and duplicate registrations are listed separately',
191
+ 'health.source': 'Source',
192
+ 'health.pluginsColumnEntry': 'entryId',
193
+ 'health.pluginsColumnModule': 'moduleName',
194
+ 'health.pluginsColumnPatch': 'patchId',
195
+ 'health.pluginsColumnReadOnly': 'readOnlyReason',
196
+ 'health.pluginsEmpty': 'No plugin rows',
197
+ 'health.pluginsEmptyHint': 'The host pluginManager returned an empty list; confirm the current profile is expected to install plugins.',
198
+ 'health.anomaliesTitle': 'Inventory anomalies',
199
+ 'health.anomaliesNone': 'No plugin-inventory anomalies detected',
200
+ 'health.anomaliesNoneHint': 'Plugin entry ids and module names are all unique.',
201
+ 'health.anomalyKindLabel': 'Kind',
202
+ 'health.anomalySuggestion': 'Suggested action',
203
+ 'health.anomalyKind.duplicate-module': 'Duplicate module',
204
+ 'health.anomalyKind.unaddressable': 'Unaddressable row',
205
+ 'health.anomalyKindUnknown': 'Other anomaly',
206
+ 'health.anomalyAction.duplicate-module': 'Keep a single row per module in the profile, or rename the duplicate registration.',
207
+ 'health.anomalyAction.unaddressable': "Use the addressable row from the plugin's own configuration or profile patch; a row the patch cannot address must not be edited here.",
208
+ 'health.anomalyActionGeneric': 'Inspect the duplicate or unaddressable rows and adjust their registration in the profile patch if needed.',
209
+
210
+ 'health.settingsTitle': 'Settings namespaces',
211
+ 'health.settingsSubtitle': 'Read-only metadata: namespace, revision, auto-generate and secret key names',
212
+ 'health.settingsRedactionOk': 'Redaction verified',
213
+ 'health.settingsRedactionFail': 'Redaction unverified',
214
+ 'health.settingsRedactionOkHint': 'The host returned metadata under redactSecrets:true; no raw values appeared.',
215
+ 'health.settingsRedactionFailHint': 'Secret metadata arrived unredacted; raw values were dropped. Upgrade the host or remove that namespace.',
216
+ 'health.settingsOwn': 'Own namespace',
217
+ 'health.settingsDeclared': 'Declared',
218
+ 'health.settingsNotDeclared': 'Not declared',
219
+ 'health.settingsEnabled': 'Enabled',
220
+ 'health.settingsDisabled': 'Disabled',
221
+ 'health.settingsColumnNs': 'ns',
222
+ 'health.settingsColumnRevision': 'revision',
223
+ 'health.settingsColumnAutoGenerate': 'autoGenerate',
224
+ 'health.settingsColumnSecretKeys': 'secretKeys',
225
+ 'health.secretKeyCount': '{count}',
226
+ 'health.yes': 'Yes',
227
+ 'health.no': 'No',
228
+ 'health.settingsEmpty': 'No settings namespaces',
229
+ 'health.settingsEmptyHint': 'The host settings.describe returned an empty list; confirm the current profile and plugin namespace.',
230
+ 'health.settingsNote': 'Source settings.describe({ redactSecrets: true }): namespace metadata and secret key names only; schema/value/base/user never enter the response.',
231
+
232
+ 'health.sectionsTitle': 'Settings-section static scan',
233
+ 'health.sectionsSubtitle': 'Scans literal settings.section registrations inside client bundles under the profile',
234
+ 'health.sectionsScanned': 'Scanned {packages} packages and {files} client files',
235
+ 'health.sectionsColumnId': 'id',
236
+ 'health.sectionsColumnOwner': 'owner',
237
+ 'health.sectionsColumnFile': 'file',
238
+ 'health.sectionsEmpty': 'The scan found no settings.section registrations',
239
+ 'health.sectionsEmptyHint': 'If settings entries are expected, confirm the owning plugin built a client.js that contains a literal settings.section registration.',
240
+ 'health.sectionsNote': 'The static scan can miss dynamically registered sections: it only covers literal settings.section entries in built bundles.',
241
+ 'health.conflictsTitle': 'Section id conflicts',
242
+ 'health.conflictsNone': 'No conflicts detected',
243
+ 'health.conflictsNoneHint': 'No settings.section id is registered by more than one plugin package; dynamic registrations stay outside the static scan.',
244
+ 'health.conflictKindLabel': 'Kind',
245
+ 'health.conflictOwners': 'Owners',
246
+ 'health.conflictSuggestion': 'Suggestion',
247
+ 'health.conflictKind.duplicate-id': 'Duplicate id',
248
+ 'health.conflictKindUnknown': 'Other conflict',
249
+ 'health.conflictSuggestionFallback': 'Inspect the owners and keep a single settings.section id.',
250
+
251
+ 'health.compatTitle': 'Compatibility',
252
+ 'health.compatSubtitle': 'Host version verdict and read-only mode; write operations stay disabled until this verdict is known',
253
+ 'health.compatLevel': 'level',
254
+ 'health.compatVersion': 'version',
255
+ 'health.compatReadOnly': 'readOnly',
256
+ 'health.compatReasons': 'Compatibility reasons',
257
+ 'health.compatReasonsNone': 'The compatibility layer reported no reasons',
258
+ 'health.compatReasonsNoneHint': 'No reasons usually means the current host version passed validation; still check readOnly before writing.',
259
+ },
260
+ })