@lmzhen/dsh-evolution-skill-health 0.35.0 → 0.36.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/lib/client.js CHANGED
@@ -115,6 +115,52 @@ window.__ModuleLoader__.load({
115
115
  //#region ../evolution-client-kit/src/notice.ts
116
116
  /** One inline state notice: semantic tone plus text, no surface-specific styling. */
117
117
  //#endregion
118
+ //#region ../evolution-client-kit/src/presentation/decision-frame.ts
119
+ /** One decision card: title, facts, at most one primary, secondary actions and details. */
120
+ //#endregion
121
+ //#region ../evolution-client-kit/src/presentation/task-banner.ts
122
+ /** A read-only task hint; it deliberately has no primary action. */
123
+ //#endregion
124
+ //#region ../evolution-client-kit/src/presentation/chips.ts
125
+ /** Read-only status chips and toggleable filter chips. */
126
+ //#endregion
127
+ //#region ../evolution-client-kit/src/presentation/empty-state.ts
128
+ /** A compact completed/empty state with at most one primary next step. */
129
+ //#endregion
130
+ //#region ../evolution-client-kit/src/presentation/disclosure-group.ts
131
+ /** A native details group for normal/secondary facts. */
132
+ //#endregion
133
+ //#region ../evolution-client-kit/src/presentation/time-text.ts
134
+ /** The one local-time presentation used by reading surfaces. */
135
+ //#endregion
136
+ //#region ../evolution-client-kit/src/presentation/action-menu.ts
137
+ /**
138
+ * The one seam onto the platform's menu material, plus a small fallback for deployments
139
+ * without the primitive row. No page owns a second menu implementation.
140
+ */
141
+ const PLATFORM_UI_MODULE$1 = "@deepseek-ai/dsh-client-ui-primitives";
142
+ /**
143
+ * Accept only the two component functions; a namespace row without them is not a menu.
144
+ * @param row - the module row's exports.
145
+ * @returns the two components, or undefined.
146
+ */
147
+ function menuPrimitivesFrom(row) {
148
+ const surface = row.MenuSurface;
149
+ const item = row.MenuItemButton;
150
+ if (typeof surface !== "function" || typeof item !== "function") return void 0;
151
+ return {
152
+ MenuSurface: surface,
153
+ MenuItemButton: item
154
+ };
155
+ }
156
+ (() => {
157
+ try {
158
+ return menuPrimitivesFrom(require(PLATFORM_UI_MODULE$1));
159
+ } catch {
160
+ return;
161
+ }
162
+ })();
163
+ //#endregion
118
164
  //#region ../evolution-client-kit/src/action.ts
119
165
  /**
120
166
  * Command-only actions. Approval decisions are a separate host API and must never
@@ -317,6 +363,8 @@ window.__ModuleLoader__.load({
317
363
  "loading": "读取中…",
318
364
  "group.byRule": "按规则",
319
365
  "group.bySkill": "按技能",
366
+ "health.complete": "没有需要处理的问题",
367
+ "health.normal": "{n} 项正常,展开查看",
320
368
  "verdict.healthy": "正常",
321
369
  "verdict.warn": "警告",
322
370
  "verdict.needs-restructure": "需重构",
@@ -399,6 +447,8 @@ window.__ModuleLoader__.load({
399
447
  "loading": "Loading…",
400
448
  "group.byRule": "By rule",
401
449
  "group.bySkill": "By skill",
450
+ "health.complete": "Nothing needs attention",
451
+ "health.normal": "{n} normal items — expand to view",
402
452
  "verdict.healthy": "OK",
403
453
  "verdict.warn": "Warn",
404
454
  "verdict.needs-restructure": "Needs restructure",
@@ -501,14 +551,19 @@ window.__ModuleLoader__.load({
501
551
  ":where(.dsh-evolution-skill-health) { --evo-type-lg:calc(1em + 2px);--evo-type-body:1em;--evo-type-sm:calc(1em - 1px);--evo-type-xs:calc(1em - 2px);--evo-space-2:2px;--evo-space-4:4px;--evo-space-6:6px;--evo-space-8:8px;--evo-space-10:10px;--evo-space-12:12px;--evo-space-14:14px;--evo-space-16:16px;--evo-space-20:20px;--evo-radius-chip:4px;--evo-radius-control:8px;--evo-radius-surface:12px;--evo-radius-pill:999px;--evo-hairline-width:.5px;--evo-hairline-marker:2px;--evo-measure-read:80ch;--evo-leading-base:1.5;--evo-tone-quiet:var(--dsw-alias-label-secondary);--evo-tone-primary:var(--dsw-alias-brand-primary);--evo-tone-danger:var(--dsw-alias-state-error-primary);--evo-tone-success:var(--dsw-alias-state-success-primary);--evo-focus-ring:2px solid var(--dsw-alias-label-primary);--evo-focus-offset:-2px;--evo-cap-aside:280px;--evo-cap-block:260px }",
502
552
  ":where(.dsh-evolution-skill-health) { display: flex; flex-direction: column; gap: var(--evo-space-12); padding: var(--evo-space-16); color: var(--dsw-alias-label-primary); font-size: var(--evo-type-sm); line-height: var(--evo-leading-base); }",
503
553
  ":where(.dsh-evolution-skill-health [data-role=\"hint\"]) { margin: 0; color: var(--dsw-alias-label-secondary); }",
504
- ":where(.dsh-evolution-skill-health [data-role=\"stats\"]) { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: var(--evo-space-8); }",
505
- ":where(.dsh-evolution-skill-health [data-role=\"stat\"]) { display: flex; flex-direction: column; gap: var(--evo-space-2); padding: var(--evo-space-8) var(--evo-space-10); border: var(--evo-hairline-width) solid var(--dsw-alias-border-l1); border-radius: var(--evo-radius-control); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }",
554
+ ":where(.dsh-evolution-skill-health [data-role=\"stats\"]) { display: flex; flex-wrap: wrap; gap: var(--evo-space-6); }",
555
+ ":where(.dsh-evolution-skill-health [data-role=\"stat\"]) { display: inline-flex; align-items: baseline; gap: var(--evo-space-4); padding: var(--evo-space-4) var(--evo-space-10); border: var(--evo-hairline-width) solid var(--dsw-alias-border-l1); border-radius: var(--evo-radius-pill); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }",
556
+ ":where(.dsh-evolution-skill-health [data-role=\"stat-value\"]) { font-size: var(--evo-type-sm); }",
557
+ ":where(.dsh-evolution-skill-health [data-role=\"health-complete\"]) { padding: var(--evo-space-12) var(--evo-space-14); border: var(--evo-hairline-width) solid var(--dsw-alias-state-success-primary); border-radius: var(--evo-radius-control); background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-state-success-primary); }",
558
+ ":where(.dsh-evolution-skill-health [data-role=\"health-normal\"]) { display: flex; flex-direction: column; gap: var(--evo-space-4); padding-top: var(--evo-space-4); }",
559
+ ":where(.dsh-evolution-skill-health [data-role=\"health-normal\"] > summary) { cursor: pointer; color: var(--dsw-alias-label-tertiary); font-size: var(--evo-type-xs); }",
506
560
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][aria-pressed=\"true\"]) { border-color: var(--dsw-alias-brand-primary); background: var(--dsw-alias-interactive-bg-hover); }",
561
+ ":where(.dsh-evolution-skill-health [data-role=\"stat\"]:disabled) { opacity: 0.55; cursor: default; }",
507
562
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][data-tone=\"ok\"]) { box-shadow: inset 2px 0 0 var(--dsw-alias-state-success-primary); }",
508
563
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][data-tone=\"warn\"]) { box-shadow: inset 2px 0 0 var(--dsw-alias-state-warn-primary); }",
509
564
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][data-tone=\"error\"]) { box-shadow: inset 2px 0 0 var(--dsw-alias-state-error-primary); }",
510
565
  ":where(.dsh-evolution-skill-health [data-role=\"stat\"][data-tone=\"unreadable\"]) { box-shadow: inset 2px 0 0 var(--evo-tone-quiet); }",
511
- ":where(.dsh-evolution-skill-health [data-role=\"stat-value\"]) { font-size: var(--evo-type-lg); font-variant-numeric: tabular-nums; line-height: 1; }",
566
+ ":where(.dsh-evolution-skill-health [data-role=\"stat-value\"]) { font-variant-numeric: tabular-nums; }",
512
567
  ":where(.dsh-evolution-skill-health [data-role=\"stat-label\"]) { color: var(--dsw-alias-label-tertiary); }",
513
568
  ":where(.dsh-evolution-skill-health [data-role=\"group-title\"]) { margin: 0; font-weight: 500; }",
514
569
  ":where(.dsh-evolution-skill-health [data-role=\"rule-table\"]) { display: table; width: 100%; border-collapse: collapse; border: var(--evo-hairline-width) solid var(--dsw-alias-border-l1); border-radius: var(--evo-radius-control); overflow: hidden; }",
@@ -553,6 +608,29 @@ window.__ModuleLoader__.load({
553
608
  return cached ?? void 0;
554
609
  }
555
610
  //#endregion
611
+ //#region src/client/health-presentation.ts
612
+ /**
613
+ * Split rows without dropping or inventing a verdict. Unreadable is an issue, never normal.
614
+ * @param rows - all rows in the current projection.
615
+ * @returns issues in severity order and the normal remainder.
616
+ */
617
+ function healthViewModel(rows) {
618
+ const order = [
619
+ "error",
620
+ "needs-restructure",
621
+ "warn",
622
+ "unreadable",
623
+ "healthy"
624
+ ];
625
+ const sorted = [...rows].sort((a, b) => order.indexOf(a.verdict) - order.indexOf(b.verdict) || a.name.localeCompare(b.name));
626
+ const issues = sorted.filter((row) => row.verdict !== "healthy");
627
+ return {
628
+ issues,
629
+ normal: sorted.filter((row) => row.verdict === "healthy"),
630
+ hasIssues: issues.length > 0
631
+ };
632
+ }
633
+ //#endregion
556
634
  //#region src/client/Panel.ts
557
635
  /**
558
636
  * The panel body: a four-state summary plus the list aggregated BY RULE.
@@ -649,17 +727,8 @@ window.__ModuleLoader__.load({
649
727
  }
650
728
  }, text);
651
729
  }
652
- /** H4: the evidence queue by skill, before the by-rule summary. */
653
- function skillQueue(face, t) {
654
- const order = [
655
- "error",
656
- "needs-restructure",
657
- "warn",
658
- "unreadable",
659
- "healthy"
660
- ];
661
- const rows = [...face.rows].sort((a, b) => order.indexOf(a.verdict) - order.indexOf(b.verdict) || a.name.localeCompare(b.name));
662
- return (0, react.createElement)("div", { "data-role": "skill-queue" }, (0, react.createElement)("h3", { "data-role": "group-title" }, t("group.bySkill")), ...rows.map((row) => (0, react.createElement)("div", {
730
+ function skillRowNode(face, t, row) {
731
+ return (0, react.createElement)("div", {
663
732
  key: row.name,
664
733
  "data-role": "skill-row",
665
734
  "data-tone": row.verdict
@@ -675,7 +744,14 @@ window.__ModuleLoader__.load({
675
744
  t,
676
745
  role: "action-copy",
677
746
  label: t("action.copy")
678
- })))));
747
+ })));
748
+ }
749
+ /** H4: issues first, normal items folded behind one native details summary. */
750
+ function skillQueue(face, t, model) {
751
+ return (0, react.createElement)("div", { "data-role": "skill-queue" }, (0, react.createElement)("h3", { "data-role": "group-title" }, t("group.bySkill")), model.hasIssues ? null : (0, react.createElement)("div", { "data-role": "health-complete" }, t("health.complete")), ...model.issues.map((row) => skillRowNode(face, t, row)), model.normal.length === 0 ? null : (0, react.createElement)("details", {
752
+ "data-role": "health-normal",
753
+ className: "evo-health-normal"
754
+ }, (0, react.createElement)("summary", null, t("health.normal").replace("{n}", String(model.normal.length))), ...model.normal.map((row) => skillRowNode(face, t, row))));
679
755
  }
680
756
  /** The rule table: a grid so counts line up, with a tone bar per row and skill pills. */
681
757
  function ruleTable(face, t) {
@@ -787,6 +863,7 @@ window.__ModuleLoader__.load({
787
863
  "data-tone": TONE[kind],
788
864
  "aria-pressed": verdictFilter === kind ? "true" : "false",
789
865
  "aria-label": t("verdict." + kind),
866
+ disabled: (counts.get(kind) ?? 0) === 0,
790
867
  onClick: () => {
791
868
  setVerdictFilter((previous) => previous === kind ? void 0 : kind);
792
869
  }
@@ -849,7 +926,7 @@ window.__ModuleLoader__.load({
849
926
  })(), viewMode === "skills" ? (0, react.createElement)("div", {
850
927
  id: "evo-health-skills",
851
928
  role: "tabpanel"
852
- }, skillQueue(shown, t)) : (0, react.createElement)("div", {
929
+ }, skillQueue(shown, t, healthViewModel(shown.rows))) : (0, react.createElement)("div", {
853
930
  id: "evo-health-rules",
854
931
  role: "tabpanel"
855
932
  }, (0, react.createElement)("h3", { "data-role": "group-title" }, t("group.byRule")), ruleTable(shown, t)));
@@ -0,0 +1,15 @@
1
+ /** Pure health reading shape: issues first, normal items folded behind a summary. */
2
+ import type { HealthRow } from './Panel.ts';
3
+ /** The split the health page renders from; counts remain the caller's whole-row facts. */
4
+ export interface HealthViewModel {
5
+ readonly issues: readonly HealthRow[];
6
+ readonly normal: readonly HealthRow[];
7
+ readonly hasIssues: boolean;
8
+ }
9
+ /**
10
+ * Split rows without dropping or inventing a verdict. Unreadable is an issue, never normal.
11
+ * @param rows - all rows in the current projection.
12
+ * @returns issues in severity order and the normal remainder.
13
+ */
14
+ export declare function healthViewModel(rows: readonly HealthRow[]): HealthViewModel;
15
+ //# sourceMappingURL=health-presentation.d.ts.map
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  ]
12
12
  }
13
13
  },
14
- "version": "0.35.0",
14
+ "version": "0.36.0",
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
@@ -42,18 +42,18 @@
42
42
  "peerDependencies": {
43
43
  "@deepseek-ai/cordis": "^4.0.5",
44
44
  "react": "^18.2.0",
45
- "@lmzhen/dsh-evolution-core": "^0.35.0",
46
- "@lmzhen/dsh-evolution-curator": "^0.35.0"
45
+ "@lmzhen/dsh-evolution-core": "^0.36.0",
46
+ "@lmzhen/dsh-evolution-curator": "^0.36.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@deepseek-ai/cordis": "^4.0.5",
50
50
  "@types/react": "~18.3.1",
51
51
  "react": "^18.2.0",
52
- "@lmzhen/dsh-evolution-core": "^0.35.0",
53
- "@lmzhen/dsh-evolution-curator": "^0.35.0"
52
+ "@lmzhen/dsh-evolution-core": "^0.36.0",
53
+ "@lmzhen/dsh-evolution-curator": "^0.36.0"
54
54
  },
55
55
  "dependencies": {
56
- "@lmzhen/dsh-evolution-client-kit": "^0.35.0"
56
+ "@lmzhen/dsh-evolution-client-kit": "^0.36.0"
57
57
  },
58
58
  "engines": {
59
59
  "dsh": ">=0.2.1-rc.2 <0.2.2-0"