@lmzhen/dsh-evolution-skill-health 0.25.1 → 0.25.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 (2) hide show
  1. package/lib/client.js +73 -1
  2. package/package.json +7 -3
package/lib/client.js CHANGED
@@ -21,6 +21,56 @@ window.__ModuleLoader__.load({
21
21
  */
22
22
  /** The locale namespace this bundle registers. */
23
23
  const NS = "evolution-skill-health";
24
+ /** Chinese dictionary. */
25
+ const zh = {
26
+ "entry.label": "技能健康",
27
+ "title": "技能健康",
28
+ "hint": "体检引擎的结论,按规则聚合。未标定的阈值只报规则名、不报数字;读不到的技能按「不可读」列出,不当作没问题。",
29
+ "refresh": "刷新",
30
+ "loading": "读取中…",
31
+ "group.byRule": "按规则",
32
+ "group.bySkill": "按技能",
33
+ "verdict.ok": "正常",
34
+ "verdict.warn": "警告",
35
+ "verdict.error": "错误",
36
+ "verdict.unreadable": "不可读",
37
+ "counts": "{ok} 正常 · {warn} 警告 · {error} 错误 · {unreadable} 不可读",
38
+ "col.rule": "规则",
39
+ "col.skills": "涉及技能",
40
+ "col.count": "次数",
41
+ "count.notCalibrated": "未标定",
42
+ "empty": "没有可报告的结论。",
43
+ "empty.noneReported": "本次没有降级项——这不等于每个技能都可读。",
44
+ "line": "位置:{path}",
45
+ "line.unknown": "位置:未知",
46
+ "unreadable.note": "读不到内容,因此无法判断(不是「通过」)。",
47
+ "loading.failed": "读取失败——现在判断不了;点「刷新」重试。"
48
+ };
49
+ /** English dictionary. */
50
+ const en = {
51
+ "entry.label": "Skill Health",
52
+ "title": "Skill Health",
53
+ "hint": "What the health engine found, aggregated by rule. A rule whose threshold is not calibrated yet is named without a number; skills that cannot be read are listed as unreadable, never as fine.",
54
+ "refresh": "Refresh",
55
+ "loading": "Loading…",
56
+ "group.byRule": "By rule",
57
+ "group.bySkill": "By skill",
58
+ "verdict.ok": "OK",
59
+ "verdict.warn": "Warn",
60
+ "verdict.error": "Error",
61
+ "verdict.unreadable": "Unreadable",
62
+ "counts": "{ok} ok · {warn} warn · {error} error · {unreadable} unreadable",
63
+ "col.rule": "Rule",
64
+ "col.skills": "Skills",
65
+ "col.count": "Count",
66
+ "count.notCalibrated": "not calibrated",
67
+ "empty": "Nothing to report.",
68
+ "empty.noneReported": "No degraded row was reported — this does NOT assert that every skill is readable.",
69
+ "line": "line: {path}",
70
+ "line.unknown": "line: UNKNOWN",
71
+ "unreadable.note": "The content could not be read, so this cannot be judged (it is not a pass).",
72
+ "loading.failed": "Reading failed — this cannot be judged right now; press Refresh to retry."
73
+ };
24
74
  //#endregion
25
75
  //#region src/client/Panel.ts
26
76
  /**
@@ -79,7 +129,29 @@ window.__ModuleLoader__.load({
79
129
  */
80
130
  function apply(ctx) {
81
131
  const seam = ctx;
82
- const label = () => seam.locale.bind(NS)("entry.label");
132
+ let registered = false;
133
+ ctx.effect(() => {
134
+ try {
135
+ const dispose = seam.locale.register(NS, {
136
+ zh,
137
+ en
138
+ });
139
+ registered = true;
140
+ return dispose;
141
+ } catch (error) {
142
+ ctx.logger.warn(`evolution-skill-health: the locale seat refused the "${NS}" dictionary (${String(error)}); the row falls back to the bundle copy.`);
143
+ return () => {};
144
+ }
145
+ }, "evolution-skill-health: locale");
146
+ const label = () => {
147
+ const fallback = zh["entry.label"] ?? "技能健康";
148
+ if (!registered) return fallback;
149
+ try {
150
+ return seam.locale.bind(NS)("entry.label");
151
+ } catch {
152
+ return fallback;
153
+ }
154
+ };
83
155
  seam.slots.inject("sidebar.panellist", function* () {
84
156
  yield seam.slots.register({
85
157
  name: "sidebar.panellist",
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  ]
12
12
  }
13
13
  },
14
- "version": "0.25.1",
14
+ "version": "0.25.3",
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
@@ -28,6 +28,10 @@
28
28
  "types": "./lib/types/index.d.ts",
29
29
  "default": "./lib/index.js"
30
30
  },
31
+ "./client": {
32
+ "types": "./lib/types/client/index.d.ts",
33
+ "default": "./lib/client.js"
34
+ },
31
35
  "./package.json": "./package.json"
32
36
  },
33
37
  "files": [
@@ -39,13 +43,13 @@
39
43
  "@deepseek-ai/cordis": "^4.0.1",
40
44
  "@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.1",
41
45
  "react": "^18.2.0",
42
- "@lmzhen/dsh-evolution-curator": "^0.25.1"
46
+ "@lmzhen/dsh-evolution-curator": "^0.25.3"
43
47
  },
44
48
  "devDependencies": {
45
49
  "@deepseek-ai/cordis": "^4.0.1",
46
50
  "@deepseek-ai/dsh-host-webserver": "^0.2.0-rc.1",
47
51
  "@types/react": "~18.3.1",
48
52
  "react": "^18.2.0",
49
- "@lmzhen/dsh-evolution-curator": "^0.25.1"
53
+ "@lmzhen/dsh-evolution-curator": "^0.25.3"
50
54
  }
51
55
  }