@lmzhen/dsh-evolution-merge-ui 0.30.25 → 0.30.28

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
@@ -5,6 +5,83 @@ window.__ModuleLoader__.load({
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  let react = require("react");
8
+ //#region ../evolution-client-kit/src/panel.ts
9
+ function interpolate(text, values) {
10
+ if (values === void 0) return text;
11
+ return text.replace(/\{(\w+)\}/g, (_match, key) => String(values[key] ?? ""));
12
+ }
13
+ function injectStyles(doc, css, tagId) {
14
+ if (doc === void 0) return () => {};
15
+ if (doc.querySelector("style[data-plugin-css=\"" + tagId + "\"]") !== null) return () => {};
16
+ const tag = doc.createElement("style");
17
+ tag.setAttribute("data-plugin-css", tagId);
18
+ tag.textContent = css;
19
+ doc.head.append(tag);
20
+ return () => {
21
+ tag.remove();
22
+ };
23
+ }
24
+ /**
25
+ * Register one sidebar row and its main body under one lifecycle.
26
+ * @param ctx - the client context carrying the slots and locale seats.
27
+ * @param spec - the feature-specific row/body descriptor.
28
+ */
29
+ function registerSidebarPanel(ctx, spec) {
30
+ const seam = ctx;
31
+ let registered = false;
32
+ ctx.effect(() => {
33
+ try {
34
+ const dispose = seam.locale.register(spec.namespace, spec.dictionaries);
35
+ registered = true;
36
+ return dispose;
37
+ } catch (error) {
38
+ ctx.logger.warn(spec.namespace + ": the locale seat refused the dictionary (" + String(error) + "); the panel falls back to the bundle copy");
39
+ return () => {};
40
+ }
41
+ }, spec.namespace + ": locale");
42
+ ctx.effect(() => injectStyles(typeof document === "undefined" ? void 0 : document, spec.styles.css, spec.styles.tagId), spec.namespace + ": styles");
43
+ const fallback = spec.dictionaries[spec.fallback ?? "zh"];
44
+ const lookup = (key) => {
45
+ const own = fallback[key] ?? key;
46
+ if (!registered) return own;
47
+ try {
48
+ return seam.locale.bind(spec.namespace)(key);
49
+ } catch {
50
+ return own;
51
+ }
52
+ };
53
+ const t = (key, values) => interpolate(lookup(key), values);
54
+ const label = () => lookup("entry.label");
55
+ seam.slots.inject("sidebar.panellist", function* () {
56
+ yield seam.slots.register({
57
+ name: "sidebar.panellist",
58
+ id: spec.id,
59
+ order: spec.order,
60
+ label
61
+ }, spec.icon);
62
+ yield seam.slots.register({
63
+ name: "main",
64
+ key: spec.id,
65
+ inject: () => spec.body(t)
66
+ }, spec.component);
67
+ });
68
+ }
69
+ //#endregion
70
+ //#region ../evolution-client-kit/src/workspace.ts
71
+ /**
72
+ * Best-effort workspace id; a seat that is absent or refuses leaves the panel in local scope.
73
+ * @param ctx - the client context.
74
+ * @returns the current workspace id, or undefined.
75
+ */
76
+ function panelWorkspaceId(ctx) {
77
+ const get = ctx.get;
78
+ if (typeof get !== "function") return void 0;
79
+ for (const name of ["workspace", "uiWorkspace"]) try {
80
+ const seat = get.call(ctx, name);
81
+ const id = seat?.workspaceId ?? seat?.currentWorkspaceId;
82
+ if (typeof id === "string" && id.trim() !== "") return id;
83
+ } catch {}
84
+ }
8
85
  //#endregion
9
86
  //#region src/client/api.ts
10
87
  /** Read-only merge wire client. Classifies every failure and never writes. */
@@ -337,7 +414,7 @@ window.__ModuleLoader__.load({
337
414
  } : answer;
338
415
  }
339
416
  //#endregion
340
- //#region src/client/seam.ts
417
+ //#region src/client/ids.ts
341
418
  const PANEL_ID = "merge";
342
419
  //#endregion
343
420
  //#region src/client/messages.ts
@@ -346,7 +423,7 @@ window.__ModuleLoader__.load({
346
423
  "entry.label": "技能合并",
347
424
  "title": "技能合并",
348
425
  "start.scan": "复制扫描命令",
349
- "start.pair": "复制配对命令",
426
+ "start.pair": "复制配对命令模板",
350
427
  "degraded": "读模型降级:",
351
428
  "copied": "已复制:",
352
429
  "row.noSummary": "无摘要",
@@ -472,6 +549,8 @@ window.__ModuleLoader__.load({
472
549
  "row.fullId": "完整编号",
473
550
  "row.actions": "操作",
474
551
  "action.unavailable": "不可用",
552
+ "history.reason.rejected": "人工拒绝合并",
553
+ "history.reason.kept": "无需合并",
475
554
  "history.reason.target-taken": "目标已被占用",
476
555
  "history.reason.source-changed": "源已变更",
477
556
  "history.reason.skipped-ttl": "跳过已到期",
@@ -540,7 +619,7 @@ window.__ModuleLoader__.load({
540
619
  "entry.label": "Skill merge",
541
620
  "title": "Skill merge",
542
621
  "start.scan": "Copy scan command",
543
- "start.pair": "Copy pair command",
622
+ "start.pair": "Copy pair command template",
544
623
  "degraded": "Degraded read model:",
545
624
  "copied": "Copied:",
546
625
  "row.noSummary": "No summary",
@@ -666,6 +745,8 @@ window.__ModuleLoader__.load({
666
745
  "row.fullId": "Full ID",
667
746
  "row.actions": "Actions",
668
747
  "action.unavailable": "Unavailable",
748
+ "history.reason.rejected": "rejected by user",
749
+ "history.reason.kept": "no merge needed",
669
750
  "history.reason.target-taken": "target taken",
670
751
  "history.reason.source-changed": "source changed",
671
752
  "history.reason.skipped-ttl": "skip expired",
@@ -816,11 +897,66 @@ window.__ModuleLoader__.load({
816
897
  ".evolution-merge-panel [data-role=\"body-text\"] { white-space:pre-wrap; overflow-wrap:anywhere; max-height:50vh; overflow:auto; }",
817
898
  ".evolution-merge-panel [data-role=\"overlay\"] { display:flex; flex-direction:column; gap:var(--evo-space-6); padding:var(--evo-space-10); border:var(--evo-hairline-width) solid var(--dsw-alias-border-l2); border-radius:var(--evo-radius-control); }",
818
899
  ".evolution-merge-panel button:focus-visible, .evolution-merge-panel a:focus-visible { outline:2px solid var(--dsw-alias-brand-primary); outline-offset:2px; }",
819
- ".evolution-merge-panel [data-role=\"sort-menu\"] { position:fixed; z-index:70; display:flex; flex-direction:column; min-width:var(--evo-measure-read); padding:var(--evo-space-4); border:var(--evo-hairline-width) solid var(--dsw-alias-border-l2); border-radius:var(--evo-radius-control); background:var(--dsw-alias-bg-layer-1); box-shadow:0 0 var(--evo-space-6) var(--dsw-alias-border-l2); }",
820
- ".evolution-merge-panel [data-role=\"sort-menu\"] button { text-align:left; }",
900
+ ".evolution-merge-panel [data-role=\"sort-menu\"]:not([data-platform]) { position:fixed; z-index:70; display:flex; flex-direction:column; min-width:var(--evo-measure-read); padding:var(--evo-space-4); border:var(--evo-hairline-width) solid var(--dsw-alias-border-l2); border-radius:var(--evo-radius-control); background:var(--dsw-alias-bg-layer-1); box-shadow:0 0 var(--evo-space-6) var(--dsw-alias-border-l2); }",
901
+ ".evolution-merge-panel [data-role=\"sort-menu\"]:not([data-platform]) button { text-align:left; }",
821
902
  ".evolution-merge-panel [data-role=\"refresh\"] { align-self:flex-start; }"
822
903
  ].join("\n");
823
904
  //#endregion
905
+ //#region src/client/platform-menu.ts
906
+ /**
907
+ * The one seam onto the platform's menu material and rows.
908
+ *
909
+ * The family bundle keeps `@deepseek-ai/*` external, so the platform components are reached through
910
+ * the loader-provided `require` (the same door the Markdown seam uses). A deployment without the
911
+ * row gets the panel's own menu fallback; the platform path is not a hard dependency.
912
+ * @module dsh-evolution-merge-ui/client
913
+ */
914
+ const PLATFORM_UI_MODULE = "@deepseek-ai/dsh-client-ui-primitives";
915
+ /**
916
+ * Render the coordinate menu through the platform primitives.
917
+ * @param primitives - the platform MenuSurface/MenuItemButton pair.
918
+ * @param actions - rows in display order.
919
+ * @param label - accessible menu name.
920
+ * @param style - fixed position computed from the pointer.
921
+ * @returns the menu element.
922
+ */
923
+ function renderPlatformMenu(primitives, actions, label, style) {
924
+ return (0, react.createElement)(primitives.MenuSurface, {
925
+ "data-role": "sort-menu",
926
+ "data-platform": "true",
927
+ role: "menu",
928
+ "aria-label": label,
929
+ style
930
+ }, actions.map((action) => (0, react.createElement)(primitives.MenuItemButton, {
931
+ key: action.id,
932
+ children: action.label,
933
+ ...action.separatorBefore === true ? { separatorBefore: true } : {},
934
+ onSelect: action.onSelect
935
+ })));
936
+ }
937
+ /**
938
+ * Accept only the two component functions; a namespace row without them is not a menu.
939
+ * @param row - the module row's exports.
940
+ * @returns the two components, or undefined.
941
+ */
942
+ function menuPrimitivesFrom(row) {
943
+ const surface = row.MenuSurface;
944
+ const item = row.MenuItemButton;
945
+ if (typeof surface !== "function" || typeof item !== "function") return void 0;
946
+ return {
947
+ MenuSurface: surface,
948
+ MenuItemButton: item
949
+ };
950
+ }
951
+ /** The module-table row, when this deployment carries it. */
952
+ const PLATFORM_MENU = (() => {
953
+ try {
954
+ return menuPrimitivesFrom(require(PLATFORM_UI_MODULE));
955
+ } catch {
956
+ return;
957
+ }
958
+ })();
959
+ //#endregion
824
960
  //#region src/client/sorting.ts
825
961
  /** Workspace scope for one tab. A missing panel workspace is the local scope. */
826
962
  function resolveWorkspaceId(workspaceId) {
@@ -1396,14 +1532,18 @@ window.__ModuleLoader__.load({
1396
1532
  const empty = uiState === "empty" ? (0, react.createElement)("div", null, (0, react.createElement)("p", { "data-role": "note" }, t("empty." + snapshot.queue)), (0, react.createElement)("p", { "data-role": "empty-scope" }, t("empty.scope"))) : null;
1397
1533
  const activeFailure = viewFailure !== void 0 ? viewFailure : queue.status === "error" ? queue.failure : void 0;
1398
1534
  const overlay = snapshot.overlay;
1399
- const menuNode = menu === void 0 ? null : (0, react.createElement)("div", {
1535
+ const menuStyle = menu === void 0 ? void 0 : {
1536
+ position: "fixed",
1537
+ zIndex: 70,
1538
+ minWidth: "var(--evo-measure-read)",
1539
+ left: String(Math.min(menu.x, Math.max(0, (globalThis.innerWidth || 1440) - 180))) + "px",
1540
+ top: String(Math.min(menu.y, Math.max(0, (globalThis.innerHeight || 800) - 110))) + "px"
1541
+ };
1542
+ const menuNode = menu === void 0 ? null : PLATFORM_MENU === void 0 ? (0, react.createElement)("div", {
1400
1543
  "data-role": "sort-menu",
1401
1544
  role: "menu",
1402
1545
  "aria-label": t("sort.menu"),
1403
- style: {
1404
- left: String(Math.min(menu.x, Math.max(0, (globalThis.innerWidth || 1440) - 180))) + "px",
1405
- top: String(Math.min(menu.y, Math.max(0, (globalThis.innerHeight || 800) - 110))) + "px"
1406
- }
1546
+ style: menuStyle
1407
1547
  }, (0, react.createElement)("button", {
1408
1548
  type: "button",
1409
1549
  role: "menuitem",
@@ -1425,7 +1565,30 @@ window.__ModuleLoader__.load({
1425
1565
  onClick: () => {
1426
1566
  setMenu(void 0);
1427
1567
  }
1428
- }, t("sort.cancel")));
1568
+ }, t("sort.cancel"))) : renderPlatformMenu(PLATFORM_MENU, [
1569
+ {
1570
+ id: "sort-pin-top",
1571
+ label: t("sort.pinTop"),
1572
+ onSelect: () => {
1573
+ pinMenu("top");
1574
+ }
1575
+ },
1576
+ {
1577
+ id: "sort-pin-bottom",
1578
+ label: t("sort.pinBottom"),
1579
+ onSelect: () => {
1580
+ pinMenu("bottom");
1581
+ }
1582
+ },
1583
+ {
1584
+ id: "sort-cancel",
1585
+ label: t("sort.cancel"),
1586
+ separatorBefore: true,
1587
+ onSelect: () => {
1588
+ setMenu(void 0);
1589
+ }
1590
+ }
1591
+ ], t("sort.menu"), menuStyle);
1429
1592
  return (0, react.createElement)("section", {
1430
1593
  className: CSS_TAG_ID,
1431
1594
  "data-state": uiState
@@ -1826,93 +1989,50 @@ window.__ModuleLoader__.load({
1826
1989
  strokeLinejoin: "round"
1827
1990
  }, (0, react.createElement)("path", { d: "M3 4h10M3 8h6M3 12h8" }));
1828
1991
  }
1829
- function interpolate(text, values) {
1830
- if (values === void 0) return text;
1831
- return text.replace(/\{(\w+)\}/g, (_match, key) => String(values[key] ?? ""));
1832
- }
1833
- /** Best-effort panel workspace; the merge panel itself is not workspace-keyed. */
1834
- function panelWorkspaceId(ctx) {
1835
- const get = ctx.get;
1836
- if (typeof get !== "function") return void 0;
1837
- for (const name of ["workspace", "uiWorkspace"]) try {
1838
- const seat = get.call(ctx, name);
1839
- const id = seat?.workspaceId ?? seat?.currentWorkspaceId;
1840
- if (typeof id === "string" && id.trim() !== "") return id;
1841
- } catch {}
1842
- }
1992
+ /**
1993
+ * Register the merge row and its keyed main body through the shared panel lifecycle.
1994
+ * @param ctx - the client context.
1995
+ */
1843
1996
  function apply(ctx) {
1844
- const seam = ctx;
1845
- let registered = false;
1846
- ctx.effect(() => {
1847
- try {
1848
- const dispose = seam.locale.register(NS, {
1849
- zh,
1850
- en
1851
- });
1852
- registered = true;
1853
- return dispose;
1854
- } catch (error) {
1855
- ctx.logger.warn("evolution-merge-ui: locale seat refused \"evolution-merge\" (" + String(error) + ")");
1856
- return () => {};
1857
- }
1858
- }, "evolution-merge-ui: locale");
1859
- ctx.effect(() => {
1860
- if (document.querySelector("style[data-plugin-css=\"evolution-merge-panel\"]") !== null) return () => {};
1861
- const tag = document.createElement("style");
1862
- tag.setAttribute("data-plugin-css", CSS_TAG_ID);
1863
- tag.textContent = CSS;
1864
- document.head.append(tag);
1865
- return () => {
1866
- tag.remove();
1867
- };
1868
- }, "evolution-merge-ui: styles");
1869
- const t = (key, values) => {
1870
- const fallback = zh[key] ?? key;
1871
- let text = fallback;
1872
- if (registered) try {
1873
- text = seam.locale.bind(NS)(key);
1874
- } catch {
1875
- text = fallback;
1876
- }
1877
- return interpolate(text, values);
1878
- };
1879
- const label = () => t("entry.label");
1880
- seam.slots.inject("sidebar.panellist", function* () {
1881
- yield seam.slots.register({
1882
- name: "sidebar.panellist",
1883
- id: PANEL_ID,
1884
- order: 45,
1885
- label
1886
- }, PanelIcon);
1887
- yield seam.slots.register({
1888
- name: "main",
1889
- key: PANEL_ID,
1890
- inject: () => {
1891
- const source = {
1892
- view,
1893
- rows,
1894
- body,
1895
- history
1896
- };
1897
- let seat;
1898
- try {
1899
- seat = ctx.get?.("configForms");
1900
- } catch {
1901
- seat = void 0;
1902
- }
1903
- const workspaceId = panelWorkspaceId(ctx);
1904
- return {
1905
- store: new MergeStore(source),
1906
- t,
1907
- doctorCommand: "/evolution doctor",
1908
- settings: { ...seat === void 0 ? {} : {
1909
- merge: seat.get("evolution-merge"),
1910
- platform: seat.get("evolution-approval")
1911
- } },
1912
- ...workspaceId === void 0 ? {} : { workspaceId }
1913
- };
1997
+ registerSidebarPanel(ctx, {
1998
+ id: PANEL_ID,
1999
+ order: 45,
2000
+ namespace: NS,
2001
+ dictionaries: {
2002
+ zh,
2003
+ en
2004
+ },
2005
+ styles: {
2006
+ css: CSS,
2007
+ tagId: CSS_TAG_ID
2008
+ },
2009
+ icon: PanelIcon,
2010
+ component: MergePanel,
2011
+ body: (t) => {
2012
+ const source = {
2013
+ view,
2014
+ rows,
2015
+ body,
2016
+ history
2017
+ };
2018
+ let seat;
2019
+ try {
2020
+ seat = ctx.get?.("configForms");
2021
+ } catch {
2022
+ seat = void 0;
1914
2023
  }
1915
- }, MergePanel);
2024
+ const workspaceId = panelWorkspaceId(ctx);
2025
+ return {
2026
+ store: new MergeStore(source),
2027
+ t,
2028
+ doctorCommand: "/evolution doctor",
2029
+ settings: { ...seat === void 0 ? {} : {
2030
+ merge: seat.get("evolution-merge"),
2031
+ platform: seat.get("evolution-approval")
2032
+ } },
2033
+ ...workspaceId === void 0 ? {} : { workspaceId }
2034
+ };
2035
+ }
1916
2036
  });
1917
2037
  }
1918
2038
  //#endregion
@@ -1,7 +1,7 @@
1
1
  /** Batch 4 merge panel: keyed read store, four tabs, local overlays, localized errors. */
2
2
  import { type ReactNode } from 'react';
3
3
  import type { MergeStore } from './MergeStore.ts';
4
- import type { ConfigFormLike, SettingsFace } from './seam.ts';
4
+ import type { ConfigFormLike, SettingsFace } from '@lmzhen/dsh-evolution-client-kit';
5
5
  export type Translate = (key: string, values?: Readonly<Record<string, string | number>>) => string;
6
6
  export interface MergeFace {
7
7
  store: MergeStore;
@@ -0,0 +1,3 @@
1
+ export declare const PANEL_ID = "merge";
2
+ export declare const PANEL_ORDER = 45;
3
+ //# sourceMappingURL=ids.d.ts.map
@@ -1,5 +1,9 @@
1
1
  /** Browser half: one sidebar row and the read-only Batch 4 panel. */
2
2
  import type { Context as ClientContext } from '@deepseek-ai/cordis';
3
3
  export declare const inject: string[];
4
+ /**
5
+ * Register the merge row and its keyed main body through the shared panel lifecycle.
6
+ * @param ctx - the client context.
7
+ */
4
8
  export declare function apply(ctx: ClientContext): void;
5
9
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The one seam onto the platform's menu material and rows.
3
+ *
4
+ * The family bundle keeps `@deepseek-ai/*` external, so the platform components are reached through
5
+ * the loader-provided `require` (the same door the Markdown seam uses). A deployment without the
6
+ * row gets the panel's own menu fallback; the platform path is not a hard dependency.
7
+ * @module dsh-evolution-merge-ui/client
8
+ */
9
+ import { type ReactNode } from 'react';
10
+ /** The platform's menu surface: a styled container that accepts div props. */
11
+ export type MenuSurfaceComponent = (props: Record<string, unknown> & {
12
+ children?: ReactNode;
13
+ }) => ReactNode;
14
+ /** The platform's menu row: role=menuitem plus selected/disabled/danger semantics. */
15
+ export type MenuItemButtonComponent = (props: {
16
+ children: ReactNode;
17
+ current?: boolean;
18
+ disabled?: boolean;
19
+ danger?: boolean;
20
+ separatorBefore?: boolean;
21
+ onSelect: () => void;
22
+ }) => ReactNode;
23
+ /** The two components this panel consumes from one platform module row. */
24
+ export interface MenuPrimitives {
25
+ MenuSurface: MenuSurfaceComponent;
26
+ MenuItemButton: MenuItemButtonComponent;
27
+ }
28
+ /** One row of the coordinate menu, independent of the renderer. */
29
+ export interface RowMenuAction {
30
+ readonly id: string;
31
+ readonly label: string;
32
+ readonly onSelect: () => void;
33
+ readonly separatorBefore?: boolean;
34
+ }
35
+ /**
36
+ * Render the coordinate menu through the platform primitives.
37
+ * @param primitives - the platform MenuSurface/MenuItemButton pair.
38
+ * @param actions - rows in display order.
39
+ * @param label - accessible menu name.
40
+ * @param style - fixed position computed from the pointer.
41
+ * @returns the menu element.
42
+ */
43
+ export declare function renderPlatformMenu(primitives: MenuPrimitives, actions: readonly RowMenuAction[], label: string, style: Record<string, string | number>): ReactNode;
44
+ /**
45
+ * Accept only the two component functions; a namespace row without them is not a menu.
46
+ * @param row - the module row's exports.
47
+ * @returns the two components, or undefined.
48
+ */
49
+ export declare function menuPrimitivesFrom(row: Record<string, unknown>): MenuPrimitives | undefined;
50
+ /** The module-table row, when this deployment carries it. */
51
+ export declare const PLATFORM_MENU: MenuPrimitives | undefined;
52
+ //# sourceMappingURL=platform-menu.d.ts.map
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  ]
12
12
  }
13
13
  },
14
- "version": "0.30.25",
14
+ "version": "0.30.28",
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
@@ -50,7 +50,10 @@
50
50
  "react": "^18.2.0",
51
51
  "react-dom": "^18.2.0"
52
52
  },
53
+ "dependencies": {
54
+ "@lmzhen/dsh-evolution-client-kit": "^0.30.28"
55
+ },
53
56
  "engines": {
54
- "dsh": ">=0.2.1-rc.1 <0.2.2-0"
57
+ "dsh": ">=0.2.1-rc.2 <0.2.2-0"
55
58
  }
56
59
  }
@@ -1,37 +0,0 @@
1
- /**
2
- * Literal mirror of the frozen Host diagnostics contract (W1 §2.8 / core diagnostics.ts). The browser
3
- * build keeps every @deepseek-ai/* specifier external, so the client CANNOT import the host type — the
4
- * shape is mirrored mechanically here instead. The key unions are rendered from core diagnostics.ts by
5
- * the generator, so a key change regenerates all three copies (a stale copy fails --check).
6
- */
7
- export type DiagnosticsSchemaVersion = 2;
8
- export type DiagnosticsFactKey = 'platform-line' | 'family-version' | 'install-form' | 'preset-ids' | 'readonly-contract' | 'upgrade-order' | 'fallback-map';
9
- export type DiagnosticsRuntimeKey = 'subagent-channel' | 'restricted-preset' | 'host-surface' | 'session-fold' | 'platform-services' | 'runs' | 'platform-pairing' | 'install-form-detected';
10
- export type DiagnosticStatus = 'ok' | 'warn' | 'fail' | 'unknown';
11
- export interface DocFactRow {
12
- readonly key: DiagnosticsFactKey;
13
- readonly label: string;
14
- readonly value: string;
15
- readonly home: string;
16
- }
17
- export interface DiagnosticRow {
18
- readonly key: DiagnosticsRuntimeKey;
19
- readonly label: string;
20
- readonly status: DiagnosticStatus;
21
- readonly detail?: string;
22
- readonly remedy?: string;
23
- }
24
- export interface DiagnosticsView {
25
- readonly schemaVersion: DiagnosticsSchemaVersion;
26
- readonly generatedAt: string;
27
- readonly facts: readonly DocFactRow[];
28
- readonly runtime: readonly DiagnosticRow[];
29
- }
30
- /** The installation form the doctor reports (W8 install-form-detected row). */
31
- export type InstallFormId = 'M1' | 'M2' | 'M3' | 'M4';
32
- /** One surface's command-face path(s) — the client `fallbacks.generated.ts` table's row type. */
33
- export interface FallbackHint {
34
- readonly command: string;
35
- readonly platformCli?: string;
36
- }
37
- //# sourceMappingURL=contracts.generated.d.ts.map
@@ -1,8 +0,0 @@
1
- import type { FallbackHint } from './contracts.generated.ts';
2
- /**
3
- * The command-face fallback for every Host surface, generated from evolution-commands'
4
- * COMMAND_FALLBACKS (the ONE home). When the platform's connection carrier is absent (E-325) the
5
- * panels render this hint instead of a bare HTTP failure — same use case, command face.
6
- */
7
- export declare const FALLBACKS: Readonly<Record<'approval' | 'skill-history' | 'skill-health' | 'merge' | 'diagnostics', FallbackHint>>;
8
- //# sourceMappingURL=fallbacks.generated.d.ts.map
@@ -1,45 +0,0 @@
1
- /**
2
- * The four-state transport classifier every family client shares (W7 §2). The platform owns
3
- * admission (401/403/404 are its answers, not ours), so the client reads the STATUS only for those
4
- * three and never tries to interpret a platform body. Everything the family route itself answers
5
- * keeps its business envelope: 2xx + {ok:true,data} or 2xx + {ok:false,code,message}.
6
- */
7
- export type RouteFailure = {
8
- readonly kind: 'unauthenticated';
9
- readonly status: 401;
10
- } | {
11
- readonly kind: 'forbidden';
12
- readonly status: 403;
13
- } | {
14
- readonly kind: 'unmounted';
15
- readonly status: 404;
16
- } | {
17
- readonly kind: 'server';
18
- readonly status: number;
19
- readonly detail?: string;
20
- } | {
21
- readonly kind: 'refused';
22
- readonly code: string;
23
- readonly message: string;
24
- };
25
- /** One route answer: the data, or the classified failure. */
26
- export type RouteAnswer<T> = {
27
- readonly ok: true;
28
- readonly data: T;
29
- } | {
30
- readonly ok: false;
31
- readonly failure: RouteFailure;
32
- };
33
- /** Classify a non-2xx status: 401/403/404 keep their own kind, everything else is a server answer. */
34
- export declare function classify(status: number): RouteFailure;
35
- /**
36
- * One request, no retries and no body parsing for the platform's admission answers.
37
- * @param doFetch - the fetch in use (the browser's, or a spec's stub).
38
- * @param path - the exact route path from the generated ROUTES table.
39
- * @param init - standard RequestInit.
40
- * @returns the data, or the classified failure (network/parse failures read as 'server').
41
- */
42
- export declare function requestJson<T>(doFetch: typeof fetch, path: string, init?: RequestInit): Promise<RouteAnswer<T>>;
43
- /** The one-sentence rendering legacy callers attach to a classified failure. */
44
- export declare function failureMessage(failure: RouteFailure): string;
45
- //# sourceMappingURL=route-client.generated.d.ts.map
@@ -1,39 +0,0 @@
1
- /** One host data-plane surface the browser half can call. */
2
- export type SurfaceId = 'approval' | 'skill-history' | 'skill-health' | 'merge' | 'diagnostics';
3
- /**
4
- * Every family host path, generated from evolution-core's HOST_ROUTES (the ONE declaration).
5
- * A browser half cannot import the host package at runtime (client bundles keep @deepseek-ai/*
6
- * external), so the table is mirrored here mechanically; a rename in core regenerates all three
7
- * client copies, and the generator's --check makes a stale copy red.
8
- */
9
- export declare const ROUTES: {
10
- readonly approval: {
11
- readonly pending: "/api/dsh-evolution/approval/pending";
12
- readonly preview: "/api/dsh-evolution/approval/preview";
13
- readonly approve: "/api/dsh-evolution/approval/approve";
14
- readonly reject: "/api/dsh-evolution/approval/reject";
15
- };
16
- readonly 'skill-history': {
17
- readonly skills: "/api/dsh-evolution/skill-history/skills";
18
- readonly versions: "/api/dsh-evolution/skill-history/versions";
19
- readonly diff: "/api/dsh-evolution/skill-history/versions/diff";
20
- readonly body: "/api/dsh-evolution/skill-history/versions/body";
21
- readonly undo: "/api/dsh-evolution/skill-history/undo";
22
- readonly health: "/api/dsh-evolution/skill-history/health";
23
- };
24
- readonly 'skill-health': {
25
- readonly rows: "/api/dsh-evolution/skill-health/rows";
26
- };
27
- readonly merge: {
28
- readonly view: "/api/dsh-evolution/merge/view";
29
- readonly rows: "/api/dsh-evolution/merge/rows";
30
- readonly run: "/api/dsh-evolution/merge/run";
31
- readonly runs: "/api/dsh-evolution/merge/runs";
32
- readonly body: "/api/dsh-evolution/merge/body";
33
- readonly history: "/api/dsh-evolution/merge/history";
34
- };
35
- readonly diagnostics: {
36
- readonly view: "/api/dsh-evolution/diagnostics";
37
- };
38
- };
39
- //# sourceMappingURL=routes.generated.d.ts.map
@@ -1,54 +0,0 @@
1
- /**
2
- * Structural view of the client seams this bundle consumes. The package ships outside the
3
- * platform repository, so it declares the seats instead of importing platform client sources.
4
- */
5
- import type { ReactNode } from 'react';
6
- export declare const PANEL_ID = "merge";
7
- export declare const PANEL_ORDER = 45;
8
- export interface PanelRowOptions {
9
- name: 'sidebar.panellist';
10
- id: string;
11
- order: number;
12
- label: () => string;
13
- }
14
- export interface PanelBodyOptions {
15
- name: 'main';
16
- key: string;
17
- inject: () => unknown;
18
- }
19
- export interface LocaleSeat {
20
- register(namespace: string, dictionaries: {
21
- zh: Record<string, string>;
22
- en: Record<string, string>;
23
- }): () => void;
24
- bind(namespace: string): (key: string) => string;
25
- }
26
- export interface SlotsSeat {
27
- inject(name: string, body: () => Generator<() => void, void, void>): void;
28
- register(options: PanelRowOptions | PanelBodyOptions, component: (props: never) => ReactNode): () => void;
29
- }
30
- export interface ClientSeam {
31
- slots: SlotsSeat;
32
- locale: LocaleSeat;
33
- }
34
- /** One client settings row's readable/writable face (platform configForms). */
35
- export interface ConfigFormSnapshotLike {
36
- status: 'loading' | 'ready' | 'unavailable';
37
- value: Record<string, unknown> | undefined;
38
- writable: boolean;
39
- revision?: number;
40
- }
41
- export interface ConfigFormLike {
42
- getSnapshot(): ConfigFormSnapshotLike;
43
- subscribe(listener: () => void): () => void;
44
- set(field: string, value: unknown): Promise<boolean>;
45
- unset(field: string): Promise<boolean>;
46
- }
47
- export interface ConfigFormsSeat {
48
- get(entryId: string): ConfigFormLike;
49
- }
50
- export interface SettingsFace {
51
- merge?: ConfigFormLike;
52
- platform?: ConfigFormLike;
53
- }
54
- //# sourceMappingURL=seam.d.ts.map
@@ -1,43 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import type { RouteAnswer, RouteFailure } from './route-client.generated.ts';
3
- import type { FallbackHint } from './contracts.generated.ts';
4
- /**
5
- * The four-state base of every family card (W7 §2). Load states are read from the generated
6
- * route-client's answer — a card owns no HTTP vocabulary and no second state machine.
7
- */
8
- export type LoadState<T> = {
9
- readonly phase: 'loading';
10
- } | {
11
- readonly phase: 'ready';
12
- readonly data: T;
13
- } | {
14
- readonly phase: 'empty';
15
- } | {
16
- readonly phase: 'failed';
17
- readonly failure: RouteFailure;
18
- };
19
- /** Map one classified answer onto the card's four states. */
20
- export declare function loadStateOf<T>(answer: RouteAnswer<T>, isEmpty: (data: T) => boolean): LoadState<T>;
21
- /** The locale lookup every block calls (the platform's own `t`). */
22
- export interface Translate {
23
- (key: string, values?: Readonly<Record<string, string | number>>): string;
24
- }
25
- export type BlockTone = 'neutral' | 'warn' | 'fail';
26
- export interface BlockProps {
27
- readonly tone?: BlockTone;
28
- readonly title?: string;
29
- readonly children?: ReactNode;
30
- }
31
- /** A neutral/ warn/ fail block; a fail block is role=alert so assistive tech announces it. */
32
- export declare function Block(props: BlockProps): ReactNode;
33
- export interface FailureBlockProps {
34
- readonly failure: RouteFailure;
35
- readonly t: Translate;
36
- /** The command-face fallback for this surface (rendered on unmounted/failed answers). */
37
- readonly fallback?: FallbackHint | undefined;
38
- }
39
- /** One classified failure as a reader-facing sentence. */
40
- export declare function failureText(failure: RouteFailure, t: Translate): string;
41
- /** The failed-state block: sentence + (when the surface exists but is unreachable) the command fallback. */
42
- export declare function FailureBlock(props: FailureBlockProps): ReactNode;
43
- //# sourceMappingURL=states.generated.d.ts.map
@@ -1,25 +0,0 @@
1
- /**
2
- * The family client scale - GENERATED from packages/scripts/client-tokens.json. Do not edit.
3
- *
4
- * Both browser halves of the family carry this file with identical bytes, because the scale is one
5
- * fact: `verify-client-tokens.mjs` (a gate step) fails when either copy drifts from the source. The
6
- * scale cannot be shared at runtime - a browser half may not import evolution-core, since every
7
- * `@deepseek-ai/*` specifier stays external in the client build and the platform module table has no
8
- * row for it - so the values are generated into each package instead.
9
- *
10
- * Usage: put `tokenVars(...)` for your root class in the package stylesheet, then read
11
- * `var(--evo-group-name)` in its rules.
12
- * Regenerate with: node packages/scripts/gen-client-tokens.mjs packages
13
- * @module @deepseek-ai/dsh-evolution-client-scale
14
- */
15
- /** Every custom property of the scale, in the source order. */
16
- export declare const TOKENS: Readonly<Record<string, string>>;
17
- /** The declarations, without a selector. */
18
- export declare const TOKEN_CSS: string;
19
- /**
20
- * The scale, declared on one element so it never leaks into the host shell.
21
- * @param scope - the selector the custom properties are declared on.
22
- * @returns the declaration block to put in the stylesheet.
23
- */
24
- export declare function tokenVars(scope: string): string;
25
- //# sourceMappingURL=tokens.d.ts.map