@webskill/sdk 0.22.0 → 0.24.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.
Files changed (32) hide show
  1. package/dist/agent.d.ts +3 -3
  2. package/dist/agent.js +200 -54
  3. package/dist/{approval-DWQlDPbY.js → approval-7CuZS3Z4.js} +3 -3
  4. package/dist/browser.d.ts +52 -7
  5. package/dist/browser.js +615 -59
  6. package/dist/{geometry-wx5ZTYzi.js → geometry-CRhuySKV.js} +8 -1
  7. package/dist/governance.d.ts +22 -4
  8. package/dist/governance.js +112 -12
  9. package/dist/{index-CjwdZQOS.d.ts → index-B3rMAUWB.d.ts} +138 -19
  10. package/dist/{index-YPd8ZSEa.d.ts → index-Bq299VnF.d.ts} +6 -3
  11. package/dist/{index-BiO9_XRk.d.ts → index-mKgZU7cG.d.ts} +62 -5
  12. package/dist/index.d.ts +4 -4
  13. package/dist/index.js +10 -8
  14. package/dist/{linkedDocument-CIuh_Yp0.js → linkedDocument-CZZOl9cO.js} +44 -4
  15. package/dist/mcp.d.ts +2 -2
  16. package/dist/node.d.ts +3 -3
  17. package/dist/node.js +12 -5
  18. package/dist/{openUiLibrary-B7j3rLrm.js → openUiLibrary-CxtrnX54.js} +1 -1
  19. package/dist/{openUiSpecLang-BSYYnjay.js → openUiSpecLang-DIcLcybq.js} +148 -13
  20. package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
  21. package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
  22. package/dist/{skillVersionStore-B24Jjjry-BY1H7Krp.d.ts → skillVersionStore-S4_HJ_Fl-Ds97pwm5.d.ts} +35 -4
  23. package/dist/testing.d.ts +1 -1
  24. package/dist/{types-CpDRZ0rA-BM5FI9oN.d.ts → types-CpDRZ0rA-CFQ-vdKz.d.ts} +12 -1
  25. package/dist/ui-react.d.ts +11 -4
  26. package/dist/ui-react.js +76 -25
  27. package/dist/ui-vue.d.ts +1 -1
  28. package/dist/ui.d.ts +4 -4
  29. package/dist/ui.js +6 -6
  30. package/dist/{webSkillApi-Dy-Zjv0y.js → webSkillApi-D5VMUnrv.js} +2 -2
  31. package/dist/{webskillLitCatalog-D5BCiMCU.js → webskillLitCatalog-BPyjYuRT.js} +1 -1
  32. package/package.json +1 -1
@@ -45,6 +45,88 @@ function resolveChartFontSizes(sizes) {
45
45
  ...sizes
46
46
  };
47
47
  }
48
+ /**
49
+ * 颜色回落值的**全仓唯一来源**:逐项照抄 echarts 6 的现行默认
50
+ * (primary `#3c3c41`、secondary/axisLabel `#54555a`、axisSplitLine `#dbdee4`)。
51
+ *
52
+ * 照抄而不是另调一套,是为了让「读不到计算样式」这条路径与 0.24.0 之前逐像素相同。
53
+ */
54
+ const DEFAULT_CHART_COLORS = {
55
+ title: "#3c3c41",
56
+ axisLabel: "#54555a",
57
+ legend: "#54555a",
58
+ axisLine: "#54555a",
59
+ splitLine: "#dbdee4"
60
+ };
61
+ /** 逐字段兜底:宿主通常只想改其中一两项 */
62
+ function resolveChartColors(colors) {
63
+ return {
64
+ ...DEFAULT_CHART_COLORS,
65
+ ...colors
66
+ };
67
+ }
68
+ /**
69
+ * 两个 alpha 不是拍的,是从 echarts 默认反推的:黑字浅底下
70
+ * 0.65 合成 `#595959`(对 `#54555a`)、0.15 合成 `#d9d9d9`(对 `#dbdee4`)。
71
+ * 取这两个值,浅色宿主上的轴线与网格线几乎与以往一样,深色宿主上自动变成同色低透明度。
72
+ */
73
+ const AXIS_LINE_ALPHA = .65;
74
+ const SPLIT_LINE_ALPHA = .15;
75
+ /** 计算值是 `rgb()` / `rgba()` 时的快路径;认不出返回 undefined,**不猜** */
76
+ function parseRgb(value) {
77
+ if (typeof value !== "string") return void 0;
78
+ const match = /^rgba?\(([^)]+)\)$/.exec(value.trim());
79
+ if (!match) return void 0;
80
+ const parts = match[1].split(/[,\s/]+/).map((part) => part.trim()).filter((part) => part !== "");
81
+ if (parts.length < 3) return void 0;
82
+ const channels = parts.slice(0, 3).map((part) => Number.parseFloat(part));
83
+ if (channels.some((channel) => !Number.isFinite(channel))) return void 0;
84
+ return channels;
85
+ }
86
+ /**
87
+ * 计算值不是 `rgb()` 写法时的慢路径:让浏览器自己画一个像素再读回来。
88
+ *
89
+ * CSSOM 早年确实只吐 `rgb()`,但主题变量现在普遍是 `oklch()`(Tailwind v4 即是),
90
+ * 计算值会**原样保留**那种写法。只认 `rgb()` 的话,暗色主题下整张图会悄悄回落到
91
+ * 浅灰默认色——正是分册 14 要修的「看不清」。
92
+ * 这里不自己写色彩空间换算:换算表抄错一位没人看得出来,而 canvas 用的就是
93
+ * 浏览器那份实现,认得出的颜色它都认得。
94
+ */
95
+ function probeRgb(container, value) {
96
+ if (typeof value !== "string" || value.trim() === "") return void 0;
97
+ const view = container.ownerDocument?.defaultView;
98
+ if (typeof view?.CSS?.supports === "function" && !view.CSS.supports("color", value)) return void 0;
99
+ const canvas = container.ownerDocument?.createElement("canvas");
100
+ if (!canvas) return void 0;
101
+ canvas.width = 1;
102
+ canvas.height = 1;
103
+ const ctx = canvas.getContext("2d");
104
+ if (!ctx) return void 0;
105
+ ctx.fillStyle = value;
106
+ ctx.fillRect(0, 0, 1, 1);
107
+ const pixel = ctx.getImageData(0, 0, 1, 1).data;
108
+ if (pixel[3] === 0) return void 0;
109
+ return [
110
+ pixel[0],
111
+ pixel[1],
112
+ pixel[2]
113
+ ];
114
+ }
115
+ /** 画布够不到 CSS,所以把容器的计算 `color` 当作这张图的取色依据(需求 14 §2.1) */
116
+ function chartColorsFromContainer(container) {
117
+ const computed = container.ownerDocument?.defaultView?.getComputedStyle(container);
118
+ const rgb = parseRgb(computed?.color) ?? probeRgb(container, computed?.color);
119
+ if (!rgb) return void 0;
120
+ const [r, g, b] = rgb;
121
+ const at = (alpha) => `rgba(${r}, ${g}, ${b}, ${alpha})`;
122
+ return {
123
+ title: at(1),
124
+ legend: at(1),
125
+ axisLabel: at(1),
126
+ axisLine: at(AXIS_LINE_ALPHA),
127
+ splitLine: at(SPLIT_LINE_ALPHA)
128
+ };
129
+ }
48
130
  /** echarts 的图例条目来源:饼图按标签分项,其余按系列名 */
49
131
  const legendEntries = (chart) => chart.kind === "pie" ? chart.labels : seriesNames(chart);
50
132
  /**
@@ -68,32 +150,52 @@ const SERIES_SHAPE = {
68
150
  const FALLBACK_KIND = "bar";
69
151
  const fallbackNotice = (kind) => kind === "" ? `Missing chart type; rendered as a ${FALLBACK_KIND} chart.` : `Unsupported chart type "${kind}"; rendered as a ${FALLBACK_KIND} chart.`;
70
152
  /** `ChartSpec` → ECharts option:图表类型、数据系列、图例的唯一定义处 */
71
- function toEchartsOption(chart, fontSizes) {
153
+ function toEchartsOption(chart, fontSizes, colors) {
72
154
  const font = resolveChartFontSizes(fontSizes);
155
+ const color = resolveChartColors(colors);
73
156
  const known = KINDS.has(chart.kind);
74
157
  const shape = SERIES_SHAPE[known ? chart.kind : FALLBACK_KIND];
75
158
  const notice = known ? void 0 : fallbackNotice(chart.kind);
76
159
  const valueAxis = {
77
160
  type: "value",
78
- axisLabel: { fontSize: font.axisLabel }
161
+ axisLabel: {
162
+ fontSize: font.axisLabel,
163
+ color: color.axisLabel
164
+ },
165
+ axisLine: { lineStyle: { color: color.axisLine } },
166
+ splitLine: { lineStyle: { color: color.splitLine } }
79
167
  };
80
168
  return {
81
169
  animation: false,
82
170
  title: chart.title || notice ? {
83
171
  text: chart.title ?? "",
84
172
  left: "center",
85
- textStyle: { fontSize: font.title },
86
- ...notice ? { subtext: notice } : {}
173
+ textStyle: {
174
+ fontSize: font.title,
175
+ color: color.title
176
+ },
177
+ ...notice ? {
178
+ subtext: notice,
179
+ subtextStyle: { color: color.axisLabel }
180
+ } : {}
87
181
  } : void 0,
88
182
  tooltip: { trigger: chart.kind === "pie" ? "item" : "axis" },
89
183
  legend: {
90
184
  bottom: 0,
91
- textStyle: { fontSize: font.legend }
185
+ textStyle: {
186
+ fontSize: font.legend,
187
+ color: color.legend
188
+ }
92
189
  },
93
190
  xAxis: chart.kind === "pie" ? void 0 : {
94
191
  type: "category",
95
192
  data: chart.labels,
96
- axisLabel: { fontSize: font.axisLabel }
193
+ axisLabel: {
194
+ fontSize: font.axisLabel,
195
+ color: color.axisLabel
196
+ },
197
+ axisLine: { lineStyle: { color: color.axisLine } },
198
+ splitLine: { lineStyle: { color: color.splitLine } }
97
199
  },
98
200
  yAxis: chart.kind === "pie" ? void 0 : chart.kind === "dual-axis" ? [valueAxis, { ...valueAxis }] : valueAxis,
99
201
  series: chart.kind === "pie" ? chart.series.map((series) => ({
@@ -128,6 +230,7 @@ function applyChartDomContract(container, chart) {
128
230
  */
129
231
  let echartsModule;
130
232
  const loadEcharts = () => echartsModule ??= import("./echarts-BE7oV_Dl.js");
233
+ const sameColors = (a, b) => a === b || a !== void 0 && b !== void 0 && a.title === b.title && a.axisLabel === b.axisLabel && a.legend === b.legend && a.axisLine === b.axisLine && a.splitLine === b.splitLine;
131
234
  /**
132
235
  * 框架无关的 echarts 挂载点:三档的 React 组件与 A2UI 档的 Lit 元素共用同一实现,
133
236
  * 图表不再因档位而异。echarts 走动态 import,不打进首屏。
@@ -137,12 +240,40 @@ function mountEchart(container) {
137
240
  let instance;
138
241
  let queued;
139
242
  let observer;
140
- const apply = (chart, fontSizes) => {
141
- instance?.setOption(toEchartsOption(chart, fontSizes), {
243
+ let themeObserver;
244
+ let inherited;
245
+ const apply = (chart, fontSizes, colors) => {
246
+ inherited = chartColorsFromContainer(container);
247
+ const effective = colors ? {
248
+ ...inherited,
249
+ ...colors
250
+ } : inherited;
251
+ instance?.setOption(toEchartsOption(chart, fontSizes, effective), {
142
252
  notMerge: true,
143
253
  lazyUpdate: true
144
254
  });
145
255
  };
256
+ /**
257
+ * 主题切换改的是祖先链上的 class(ThemeScope)或根节点属性(扩展 viewer),
258
+ * 两者都表现为祖先的属性变更。观察一条从容器到 documentElement 的链,
259
+ * 命中就重算一次颜色;颜色没变则什么都不做(避免无谓重绘)。
260
+ */
261
+ const watchAncestors = () => {
262
+ if (typeof MutationObserver === "undefined") return;
263
+ themeObserver = new MutationObserver(() => {
264
+ if (disposed || queued === void 0) return;
265
+ if (sameColors(chartColorsFromContainer(container), inherited)) return;
266
+ apply(queued.chart, queued.fontSizes, queued.colors);
267
+ });
268
+ for (let node = container; node; node = node.parentElement) themeObserver.observe(node, {
269
+ attributes: true,
270
+ attributeFilter: [
271
+ "class",
272
+ "style",
273
+ "data-theme"
274
+ ]
275
+ });
276
+ };
146
277
  loadEcharts().then((echarts) => {
147
278
  if (disposed) return;
148
279
  instance = echarts.init(container);
@@ -150,21 +281,25 @@ function mountEchart(container) {
150
281
  observer = new ResizeObserver(() => instance?.resize());
151
282
  observer.observe(container);
152
283
  }
153
- if (queued) apply(queued.chart, queued.fontSizes);
284
+ watchAncestors();
285
+ if (queued) apply(queued.chart, queued.fontSizes, queued.colors);
154
286
  });
155
287
  return {
156
- setChart(chart, fontSizes) {
288
+ setChart(chart, fontSizes, colors) {
157
289
  applyChartDomContract(container, chart);
158
290
  queued = {
159
291
  chart,
160
- ...fontSizes ? { fontSizes } : {}
292
+ ...fontSizes ? { fontSizes } : {},
293
+ ...colors ? { colors } : {}
161
294
  };
162
- apply(chart, fontSizes);
295
+ apply(chart, fontSizes, colors);
163
296
  },
164
297
  dispose() {
165
298
  disposed = true;
166
299
  observer?.disconnect();
167
300
  observer = void 0;
301
+ themeObserver?.disconnect();
302
+ themeObserver = void 0;
168
303
  instance?.dispose();
169
304
  instance = void 0;
170
305
  }
@@ -1900,4 +2035,4 @@ function toOpenUiSpecLang(spec, catalog = uiCatalog) {
1900
2035
  }
1901
2036
 
1902
2037
  //#endregion
1903
- export { DEFAULT_CHART_FONT_SIZES as C, toEchartsOption as D, resolveChartFontSizes as E, gaugePercent as S, mountEchart as T, defineUiCatalog as _, SPEC_TABLE_MIN_COLUMN_VAR as a, CATALOG_SCHEMA_MAX as b, resolveColumnWidths as c, collectFormScopes as d, collectScopedValues as f, uiCatalog as g, UI_CATALOG_PROMPT_BUDGET_BYTES as h, normalizeFieldOptions as i, MAX_CONDITION_DEPTH as l, UI_CATALOG_GROUPS as m, interactionToUiSpec as n, SPEC_TABLE_MIN_COLUMN_WIDTH as o, qualifyFieldName as p, toJsonRenderSpec as r, normalizeColumnWidths as s, toOpenUiSpecLang as t, evaluateFieldCondition as u, CATALOG_BUDGET_STAGE as v, chartSpecFromProps as w, PLANNED_INCREMENT as x, CATALOG_PROMPT_MAX as y };
2038
+ export { DEFAULT_CHART_COLORS as C, resolveChartColors as D, mountEchart as E, resolveChartFontSizes as O, gaugePercent as S, chartSpecFromProps as T, defineUiCatalog as _, SPEC_TABLE_MIN_COLUMN_VAR as a, CATALOG_SCHEMA_MAX as b, resolveColumnWidths as c, collectFormScopes as d, collectScopedValues as f, uiCatalog as g, UI_CATALOG_PROMPT_BUDGET_BYTES as h, normalizeFieldOptions as i, toEchartsOption as k, MAX_CONDITION_DEPTH as l, UI_CATALOG_GROUPS as m, interactionToUiSpec as n, SPEC_TABLE_MIN_COLUMN_WIDTH as o, qualifyFieldName as p, toJsonRenderSpec as r, normalizeColumnWidths as s, toOpenUiSpecLang as t, evaluateFieldCondition as u, CATALOG_BUDGET_STAGE as v, DEFAULT_CHART_FONT_SIZES as w, PLANNED_INCREMENT as x, CATALOG_PROMPT_MAX as y };
@@ -20,6 +20,17 @@ async function atomicWriteText(fs, path, content) {
20
20
  await fs.writeText(tmp, content);
21
21
  await fs.rename(tmp, path);
22
22
  }
23
+ /**
24
+ * 原子写二进制:与 `atomicWriteText` 逐字对称,只换写入方法(0.23.0 分册 20)。
25
+ *
26
+ * 临时名必须沿用同一条 `ATOMIC_TMP_SUFFIX_PATTERN` 形状——打包与列举侧靠那条正则
27
+ * 排除中断残留,另起一套命名会让残留的临时文件被打进技能包。
28
+ */
29
+ async function atomicWriteBinary(fs, path, content) {
30
+ const tmp = `${path}.tmp-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
31
+ await fs.writeBinary(tmp, content);
32
+ await fs.rename(tmp, path);
33
+ }
23
34
 
24
35
  //#endregion
25
36
  //#region ../core/src/fs/pathSecurity.ts
@@ -62,4 +73,4 @@ function resolveInsideRoot(root, relativePath) {
62
73
  }
63
74
 
64
75
  //#endregion
65
- export { atomicWriteText as a, ATOMIC_TMP_SUFFIX_PATTERN as i, normalizePath as n, isAtomicTempPath as o, resolveInsideRoot as r, assertSafePathSegment as t };
76
+ export { atomicWriteBinary as a, ATOMIC_TMP_SUFFIX_PATTERN as i, normalizePath as n, atomicWriteText as o, resolveInsideRoot as r, isAtomicTempPath as s, assertSafePathSegment as t };
@@ -1,5 +1,5 @@
1
1
  import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
2
- import { a as atomicWriteText, o as isAtomicTempPath, r as resolveInsideRoot } from "./pathSecurity-B1owvJAF.js";
2
+ import { o as atomicWriteText, r as resolveInsideRoot, s as isAtomicTempPath } from "./pathSecurity-CirkQwWP.js";
3
3
  import { parse } from "yaml";
4
4
  import { Unzip, UnzipInflate, zipSync } from "fflate";
5
5
 
@@ -1,5 +1,5 @@
1
- import { K as FileSystemProvider, St as SkillManifest, et as Page, ht as SkillCatalogEntry, tt as PageQuery } from "./types-CpDRZ0rA-BM5FI9oN.js";
2
- //#region ../governance/dist/skillVersionStore-B24Jjjry.d.ts
1
+ import { K as FileSystemProvider, St as SkillManifest, et as Page, ht as SkillCatalogEntry, tt as PageQuery } from "./types-CpDRZ0rA-CFQ-vdKz.js";
2
+ //#region ../governance/dist/skillVersionStore-S4_HJ_Fl.d.ts
3
3
  //#region src/types.d.ts
4
4
  type CandidateStatus = 'draft' | 'pending-review' | 'approved' | 'published' | 'rejected';
5
5
  /** `generated` 是 0.5.0 的技能自动生成来源(需求 12 号 AC-9.1) */
@@ -8,7 +8,29 @@ type CandidateRisk = 'low' | 'medium' | 'high';
8
8
  interface CandidateFile {
9
9
  path: string;
10
10
  kind: 'skill-md' | 'script' | 'reference' | 'asset';
11
+ /**
12
+ * 文件正文。二进制条目为空串——字节存在候选自己的旁路里,见 `binary`。
13
+ * 保持必填 `string`:它的消费方遍布审核 UI、发布链路与测试,
14
+ * 改成联合类型会让每一处都要分支,而其中大多数只关心文本。
15
+ */
11
16
  content: string;
17
+ /** 在场即本条目是二进制,正文在旁路文件里(0.23.0 分册 20) */
18
+ binary?: CandidateBinaryRef;
19
+ }
20
+ /**
21
+ * 候选二进制旁路里的一份字节(0.23.0 分册 20)。
22
+ *
23
+ * 字节**不内嵌进候选 JSON**:`CandidateStore.list()` 会把目录里每一个 JSON 全文读出来解析,
24
+ * 内嵌等于审批列表每翻一页都要把所有候选的二进制读进内存再做一次 base64 往返。
25
+ */
26
+ interface CandidateBinaryRef {
27
+ /** 候选二进制目录(`<id>.files/`)下的文件名,不是路径 */
28
+ file: string;
29
+ size: number;
30
+ /** sha-256,十六进制小写;AC-20.1 的「逐字节相同」靠它判 */
31
+ sha256: string;
32
+ /** 来源附件的原始文件名,供审核者辨认(FR-20.10) */
33
+ sourceName: string;
12
34
  }
13
35
  interface CandidateSkill {
14
36
  id: string;
@@ -97,7 +119,16 @@ declare class CandidateStore {
97
119
  /** 治理根下该技能是否仍装着;不注入则 published 一律拒删(见 `remove`) */
98
120
  isSkillInstalled?: (name: string) => Promise<boolean>;
99
121
  });
100
- save(candidate: CandidateSkill): Promise<void>;
122
+ /**
123
+ * 存候选。`binaries` 的键是 `CandidateFile.binary.file`,缺省即本候选全是文本。
124
+ *
125
+ * 落盘顺序是**先字节、后 JSON**(0.23.0 分册 20 §3.2):反过来的话,
126
+ * 崩溃会留下一条指向不存在字节的元数据,而那种候选要到审批安装那一步才暴露——
127
+ * 正是 FR-20.6 要避免的那类「延迟到审批才失败」。
128
+ */
129
+ save(candidate: CandidateSkill, binaries?: ReadonlyMap<string, Uint8Array>): Promise<void>;
130
+ /** 读回候选旁路里的一份字节(安装时按原样写进技能目录,0.23.0 分册 20 FR-20.8) */
131
+ readCandidateBinary(id: string, file: string): Promise<Uint8Array>;
101
132
  get(id: string): Promise<CandidateSkill>;
102
133
  /**
103
134
  * 候选(= 审批队列)分页。`status` 是端口参数而不是上层 `.filter()`:
@@ -182,4 +213,4 @@ declare class SkillVersionStore {
182
213
  }): Promise<SkillVersion>;
183
214
  }
184
215
  //#endregion
185
- export { SkillState as _, AuditLog as a, SkillVersionStore as b, CandidateFile as c, CandidateSkill as d, CandidateSource as f, SKILL_VERSION_PAGE_SIZE as g, CompositeApprovalPolicy as h, AuditEvent as i, CandidatePage as l, CandidateStore as m, ApprovalDecision as n, AuditQueryFilter as o, CandidateStatus as p, ApprovalPolicy as r, CANDIDATE_PAGE_SIZE as s, AlwaysHumanApprovalPolicy as t, CandidateRisk as u, SkillVersion as v, candidateToCatalogEntry as x, SkillVersionPage as y };
216
+ export { candidateToCatalogEntry as S, SKILL_VERSION_PAGE_SIZE as _, AuditLog as a, SkillVersionPage as b, CandidateBinaryRef as c, CandidateRisk as d, CandidateSkill as f, CompositeApprovalPolicy as g, CandidateStore as h, AuditEvent as i, CandidateFile as l, CandidateStatus as m, ApprovalDecision as n, AuditQueryFilter as o, CandidateSource as p, ApprovalPolicy as r, CANDIDATE_PAGE_SIZE as s, AlwaysHumanApprovalPolicy as t, CandidatePage as u, SkillState as v, SkillVersionStore as x, SkillVersion as y };
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as UiBridge, c as InteractionResponse, l as LlmClient, m as LlmStreamEvent, n as ArtifactStore, p as LlmResponse, s as InteractionRequest, t as Artifact, u as LlmCompleteInput, v as MemoryStore } from "./types-CpDRZ0rA-BM5FI9oN.js";
1
+ import { S as UiBridge, c as InteractionResponse, l as LlmClient, m as LlmStreamEvent, n as ArtifactStore, p as LlmResponse, s as InteractionRequest, t as Artifact, u as LlmCompleteInput, v as MemoryStore } from "./types-CpDRZ0rA-CFQ-vdKz.js";
2
2
  import { a as loadGoogleConfigFromEnv, i as loadAnthropicConfigFromEnv, n as LlmEnvConfig, o as loadLlmConfigFromEnv, r as ProviderEnvConfig } from "./env-AK3cSMEA-Dli6QU5E.js";
3
3
  //#region ../runtime/dist/testing.d.ts
4
4
  //#region src/llm/mockLlmClient.d.ts
@@ -46,6 +46,10 @@ type WebSkillErrorCode = 'FS_NOT_FOUND' | 'FS_PATH_OUTSIDE_ROOT' | 'SKILL_NOT_FO
46
46
  'TEMPLATE_ROW_INSERT_RANGE' |
47
47
  /** 目标格由模板的公式算出,写值会把它摧毁(FR-42.28) */
48
48
  'TEMPLATE_CELL_IS_FORMULA' |
49
+ /** 目标格落在合并区内且不是左上角:写进去 Excel 不显示(0.24.0 FR-17.6) */
50
+ 'TEMPLATE_CELL_IS_COVERED' |
51
+ /** 请求了若干格,一条都没写成——那不是部分成功,是整个填错了地方(0.24.0 FR-17.10) */
52
+ 'TEMPLATE_FILL_REJECTED' |
49
53
  /** 用户拒绝了这次工具调用(0.14.0 分册 20) */
50
54
  'TOOL_DENIED';
51
55
  /**
@@ -416,6 +420,13 @@ declare const isAtomicTempPath: (path: string) => boolean;
416
420
  * 对崩溃一致性要求极高的场景在浏览器侧需知悉此前提。
417
421
  */
418
422
  declare function atomicWriteText(fs: FileSystemProvider, path: string, content: string): Promise<void>;
423
+ /**
424
+ * 原子写二进制:与 `atomicWriteText` 逐字对称,只换写入方法(0.23.0 分册 20)。
425
+ *
426
+ * 临时名必须沿用同一条 `ATOMIC_TMP_SUFFIX_PATTERN` 形状——打包与列举侧靠那条正则
427
+ * 排除中断残留,另起一套命名会让残留的临时文件被打进技能包。
428
+ */
429
+ declare function atomicWriteBinary(fs: FileSystemProvider, path: string, content: Uint8Array): Promise<void>;
419
430
  //#endregion
420
431
  //#region src/fs/pathSecurity.d.ts
421
432
  /** 统一分隔符为 `/`,去除 `.` 段与重复分隔符(不解析 `..`) */
@@ -1261,4 +1272,4 @@ interface MemoryStore {
1261
1272
  transaction?<T>(scope: string, fn: (inner: MemoryStore) => Promise<T>): Promise<T>;
1262
1273
  }
1263
1274
  //#endregion
1264
- export { PPTX_MIME as $, extractedDocumentFormat as $t, extractSkillCandidate as A, TrustedKey as At, DOCX_MIME as B, assertRemoteUrlAllowed as Bt, UiSpecActionCapability as C, xmlRenderer as Cn, SkillMetadata as Ct, UiSpecSnapshot as D, SkillSource as Dt, UiSpecPatch as E, SkillSignature as Et, BINARY_EXTENSIONS as F, ValidationReport as Ft, FileStat as G, checkDependencyCycles as Gt, DiscoveryResult as H, atomicWriteText as Ht, CatalogRenderer as I, VerifyResult as It, FsTrustedKeyStore as J, computeDigest as Jt, FileSystemProvider as K, checkSkillRules as Kt, ChatAttachmentKind as L, WebSkillError as Lt, ATTACHMENT_TEXT_LIMIT as M, UNTRUSTED_LINE_LIMIT as Mt, ArchiveLimits as N, UiSpecNode as Nt, UiSurfaceActionRequest as O, SkillsLockfile as Ot, AttachmentTextInput as P, UnsignedPolicy as Pt, MemoryFS as Q, exportSkills as Qt, CryptoKeyLike as R, WebSkillErrorCode as Rt, UiBridge as S, verifySkillSignature as Sn, SkillManifest as St, UiSpecEvent as T, SkillReader as Tt, ExtractedDocumentFormat as U, buildCatalog as Ut, DWG_MIME_TYPES as V, assertSafePathSegment as Vt, FILE_MIME_TYPES as W, buildManifest as Wt, JsonSchema as X, detectSkillArchiveShapeFromFs as Xt, IMAGE_MIME_TYPES as Y, detectSkillArchiveShape as Yt, MANIFEST_EXCLUDED_FILES as Z, escapeXml as Zt, LlmToolSpec as _, signaturePayloadBytes as _n, SkillDocument as _t, InteractionOrigin as a, messageOf as an, SKILL_MANIFEST_FILE as at, RenderResultRequest as b, validateSkills as bn, SkillLocation as bt, InteractionResponse as c, parseSkillPackManifest as cn, SKILL_PACK_FILE as ct, LlmContentPart as d, renderAvailableSkillsXml as dn, SignatureVerdict as dt, formatAttachmentText as en, Page as et, LlmMessage as f, renderCatalogJson as fn, SkillArchiveDetection as ft, LlmToolCall as g, signSkill as gn, SkillDiscovery as gt, LlmTokenUsage as h, sanitizeUntrustedLine as hn, SkillCatalogEntry as ht, FormField as i, keyIdOf as in, SKILLS_LOCKFILE as it, ATOMIC_TMP_SUFFIX_PATTERN as j, TrustedKeyStore as jt, UiSurfaceActionResponse as k, TEXT_EXTENSIONS as kt, LlmClient as l, readResponseWithLimit as ln, SKILL_SIGNATURE_FILE as lt, LlmStreamEvent as m, resolveInsideRoot as mn, SkillCatalog as mt, ArtifactStore as n, isValidSkillName as nn, RemoteUrlPolicy as nt, InteractionPolicy as o, normalizePath as on, SKILL_NAME_MAX_LENGTH as ot, LlmResponse as p, resolveArchiveLimits as pn, SkillArchiveShape as pt, FileWriteStream as q, classifyAttachment as qt, ChartSpec as r, jsonRenderer as rn, SIGNATURE_SCHEMA_VERSION as rt, InteractionRequest as s, parseSkillMarkdown as sn, SKILL_NAME_PATTERN as st, Artifact as t, isAtomicTempPath as tn, PageQuery as tt, LlmCompleteInput as u, readSkillSignature as un, SignatureAuditSink as ut, MemoryStore as v, stripArchiveRoot as vn, SkillInstallSource as vt, UiSpecDrafts as w, SkillPackManifest as wt, SkillCandidateMarker as x, verifyManifest as xn, SkillManagerPort as xt, RenderBlock as y, unzipWithLimits as yn, SkillIssue as yt, DEFAULT_ARCHIVE_LIMITS as z, XLSX_MIME as zt };
1275
+ export { PPTX_MIME as $, exportSkills as $t, extractSkillCandidate as A, TrustedKey as At, DOCX_MIME as B, assertRemoteUrlAllowed as Bt, UiSpecActionCapability as C, verifySkillSignature as Cn, SkillMetadata as Ct, UiSpecSnapshot as D, SkillSource as Dt, UiSpecPatch as E, SkillSignature as Et, BINARY_EXTENSIONS as F, ValidationReport as Ft, FileStat as G, buildManifest as Gt, DiscoveryResult as H, atomicWriteBinary as Ht, CatalogRenderer as I, VerifyResult as It, FsTrustedKeyStore as J, classifyAttachment as Jt, FileSystemProvider as K, checkDependencyCycles as Kt, ChatAttachmentKind as L, WebSkillError as Lt, ATTACHMENT_TEXT_LIMIT as M, UNTRUSTED_LINE_LIMIT as Mt, ArchiveLimits as N, UiSpecNode as Nt, UiSurfaceActionRequest as O, SkillsLockfile as Ot, AttachmentTextInput as P, UnsignedPolicy as Pt, MemoryFS as Q, escapeXml as Qt, CryptoKeyLike as R, WebSkillErrorCode as Rt, UiBridge as S, verifyManifest as Sn, SkillManifest as St, UiSpecEvent as T, SkillReader as Tt, ExtractedDocumentFormat as U, atomicWriteText as Ut, DWG_MIME_TYPES as V, assertSafePathSegment as Vt, FILE_MIME_TYPES as W, buildCatalog as Wt, JsonSchema as X, detectSkillArchiveShape as Xt, IMAGE_MIME_TYPES as Y, computeDigest as Yt, MANIFEST_EXCLUDED_FILES as Z, detectSkillArchiveShapeFromFs as Zt, LlmToolSpec as _, signSkill as _n, SkillDocument as _t, InteractionOrigin as a, keyIdOf as an, SKILL_MANIFEST_FILE as at, RenderResultRequest as b, unzipWithLimits as bn, SkillLocation as bt, InteractionResponse as c, parseSkillMarkdown as cn, SKILL_PACK_FILE as ct, LlmContentPart as d, readSkillSignature as dn, SignatureVerdict as dt, extractedDocumentFormat as en, Page as et, LlmMessage as f, renderAvailableSkillsXml as fn, SkillArchiveDetection as ft, LlmToolCall as g, sanitizeUntrustedLine as gn, SkillDiscovery as gt, LlmTokenUsage as h, resolveInsideRoot as hn, SkillCatalogEntry as ht, FormField as i, jsonRenderer as in, SKILLS_LOCKFILE as it, ATOMIC_TMP_SUFFIX_PATTERN as j, TrustedKeyStore as jt, UiSurfaceActionResponse as k, TEXT_EXTENSIONS as kt, LlmClient as l, parseSkillPackManifest as ln, SKILL_SIGNATURE_FILE as lt, LlmStreamEvent as m, resolveArchiveLimits as mn, SkillCatalog as mt, ArtifactStore as n, isAtomicTempPath as nn, RemoteUrlPolicy as nt, InteractionPolicy as o, messageOf as on, SKILL_NAME_MAX_LENGTH as ot, LlmResponse as p, renderCatalogJson as pn, SkillArchiveShape as pt, FileWriteStream as q, checkSkillRules as qt, ChartSpec as r, isValidSkillName as rn, SIGNATURE_SCHEMA_VERSION as rt, InteractionRequest as s, normalizePath as sn, SKILL_NAME_PATTERN as st, Artifact as t, formatAttachmentText as tn, PageQuery as tt, LlmCompleteInput as u, readResponseWithLimit as un, SignatureAuditSink as ut, MemoryStore as v, signaturePayloadBytes as vn, SkillInstallSource as vt, UiSpecDrafts as w, xmlRenderer as wn, SkillPackManifest as wt, SkillCandidateMarker as x, validateSkills as xn, SkillManagerPort as xt, RenderBlock as y, stripArchiveRoot as yn, SkillIssue as yt, DEFAULT_ARCHIVE_LIMITS as z, XLSX_MIME as zt };
@@ -1,6 +1,6 @@
1
- import { C as UiSpecActionCapability, D as UiSpecSnapshot, Nt as UiSpecNode, O as UiSurfaceActionRequest, S as UiBridge, T as UiSpecEvent, b as RenderResultRequest, c as InteractionResponse, k as UiSurfaceActionResponse, s as InteractionRequest, w as UiSpecDrafts } from "./types-CpDRZ0rA-BM5FI9oN.js";
2
- import { P as DocumentSurfacePort } from "./index-YPd8ZSEa.js";
3
- import { F as InteractionSpecLabels, J as SurfaceFormTexts, Y as SurfaceHostControlTexts, v as ChartFontSizes } from "./index-BiO9_XRk.js";
1
+ import { C as UiSpecActionCapability, D as UiSpecSnapshot, Nt as UiSpecNode, O as UiSurfaceActionRequest, S as UiBridge, T as UiSpecEvent, b as RenderResultRequest, c as InteractionResponse, k as UiSurfaceActionResponse, s as InteractionRequest, w as UiSpecDrafts } from "./types-CpDRZ0rA-CFQ-vdKz.js";
2
+ import { P as DocumentSurfacePort } from "./index-Bq299VnF.js";
3
+ import { L as InteractionSpecLabels, X as SurfaceFormTexts, Z as SurfaceHostControlTexts, v as ChartColors, y as ChartFontSizes } from "./index-mKgZU7cG.js";
4
4
  import { z } from "zod";
5
5
  import React$1, { ComponentType, ReactNode } from "react";
6
6
  import "react/jsx-runtime";
@@ -555,4 +555,11 @@ declare function ChartFontSizesProvider({ sizes, children }: {
555
555
  children: ReactNode;
556
556
  }): import("react").JSX.Element;
557
557
  //#endregion
558
- export { type CatalogNodeProps, ChartFontSizesProvider, type CustomSurfaceActionEvent, type DroppedSurfaceActionWarning, InteractionForm, type JsonRenderActionDispatch, JsonRenderSpecSurface, type JsonRenderSpecSurfaceProps, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, type NativeSpecSurfaceProps, OpenUiSpecSurface, type OpenUiSpecSurfaceProps, ReactBridgeState, type ReactBridgeStateOptions, type RegisteredSurfaceProps, ResultBlocks, SpecInteractionChannel, type SpecInteractionSession, StreamingText, SurfaceFormTextsProvider, type SurfaceRegistration, SurfaceRegistry, type UiSurfaceActionEvent, UiSurfaceList, type UiSurfaceListProps, UiSurfaceSnapshotList, type UiSurfaceSnapshotListProps, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability, useChartFontSizes, useSurfaceFormTexts, useSurfaceHostControlTexts };
558
+ //#region src/components/chartColors.d.ts
559
+ declare function useChartColors(): Partial<ChartColors> | undefined;
560
+ declare function ChartColorsProvider({ colors, children }: {
561
+ colors?: Partial<ChartColors> | undefined;
562
+ children: ReactNode;
563
+ }): import("react").JSX.Element;
564
+ //#endregion
565
+ export { type CatalogNodeProps, ChartColorsProvider, ChartFontSizesProvider, type CustomSurfaceActionEvent, type DroppedSurfaceActionWarning, InteractionForm, type JsonRenderActionDispatch, JsonRenderSpecSurface, type JsonRenderSpecSurfaceProps, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, type NativeSpecSurfaceProps, OpenUiSpecSurface, type OpenUiSpecSurfaceProps, ReactBridgeState, type ReactBridgeStateOptions, type RegisteredSurfaceProps, ResultBlocks, SpecInteractionChannel, type SpecInteractionSession, StreamingText, SurfaceFormTextsProvider, type SurfaceRegistration, SurfaceRegistry, type UiSurfaceActionEvent, UiSurfaceList, type UiSurfaceListProps, UiSurfaceSnapshotList, type UiSurfaceSnapshotListProps, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability, useChartColors, useChartFontSizes, useSurfaceFormTexts, useSurfaceHostControlTexts };
package/dist/ui-react.js CHANGED
@@ -2,7 +2,7 @@ import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __
2
2
  import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
3
3
  import { n as validateUiSpecEvent, r as validateUiSpecNode } from "./surface-DVGiCmwq.js";
4
4
  import { a as applySuggestion, c as DEFAULT_SURFACE_FORM_TEXTS, f as resolveSurfaceFormTexts, i as renderMiniMarkdown, l as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, m as shapeInteractionValue, o as collectValues, p as resolveSurfaceHostControlTexts, r as renderMiniChart, u as interactionToFormModel } from "./miniChart-D0nYMzz8.js";
5
- import { C as DEFAULT_CHART_FONT_SIZES, E as resolveChartFontSizes, S as gaugePercent, T as mountEchart, c as resolveColumnWidths, d as collectFormScopes, f as collectScopedValues, g as uiCatalog, i as normalizeFieldOptions, n as interactionToUiSpec, p as qualifyFieldName, r as toJsonRenderSpec, s as normalizeColumnWidths, t as toOpenUiSpecLang, u as evaluateFieldCondition, w as chartSpecFromProps } from "./openUiSpecLang-BSYYnjay.js";
5
+ import { E as mountEchart, O as resolveChartFontSizes, S as gaugePercent, T as chartSpecFromProps, c as resolveColumnWidths, d as collectFormScopes, f as collectScopedValues, g as uiCatalog, i as normalizeFieldOptions, n as interactionToUiSpec, p as qualifyFieldName, r as toJsonRenderSpec, s as normalizeColumnWidths, t as toOpenUiSpecLang, u as evaluateFieldCondition, w as DEFAULT_CHART_FONT_SIZES } from "./openUiSpecLang-DIcLcybq.js";
6
6
  import minpath from "node:path";
7
7
  import { fileURLToPath as urlToPath } from "node:url";
8
8
  import { z } from "zod";
@@ -258,6 +258,8 @@ var ReactBridgeState = class {
258
258
  streamingRunId = null;
259
259
  streamingText = "";
260
260
  #listeners = /* @__PURE__ */ new Set();
261
+ /** 待决交互队列,队头即 `pending`(0.23.0 分册 19 FR-19.6) */
262
+ #queue = [];
261
263
  #resolvers = /* @__PURE__ */ new Map();
262
264
  #surfaceActionResolvers = /* @__PURE__ */ new Map();
263
265
  #processedSurfaceActionNonces = /* @__PURE__ */ new Set();
@@ -301,10 +303,11 @@ var ReactBridgeState = class {
301
303
  for (const listener of [...this.#listeners]) listener();
302
304
  }
303
305
  request(input) {
304
- this.pending = input;
305
- this.#emit();
306
306
  return new Promise((resolve) => {
307
307
  this.#resolvers.set(input.id, resolve);
308
+ this.#queue.push(input);
309
+ this.pending = this.#queue[0] ?? null;
310
+ this.#emit();
308
311
  });
309
312
  }
310
313
  /** 组件提交/取消回调 */
@@ -312,7 +315,8 @@ var ReactBridgeState = class {
312
315
  const resolver = this.#resolvers.get(response.id);
313
316
  if (!resolver) return;
314
317
  this.#resolvers.delete(response.id);
315
- this.pending = null;
318
+ this.#queue = this.#queue.filter((request) => request.id !== response.id);
319
+ this.pending = this.#queue[0] ?? null;
316
320
  this.#emit();
317
321
  resolver(response);
318
322
  }
@@ -124762,14 +124766,52 @@ function ChartFontSizesProvider({ sizes, children }) {
124762
124766
  });
124763
124767
  }
124764
124768
 
124769
+ //#endregion
124770
+ //#region ../ui-react/src/components/chartColors.tsx
124771
+ /**
124772
+ * 画布内取色的注入口(0.24.0 分册 14 FR-14.8)。与 `ChartFontSizesProvider` 同构,
124773
+ * 只有缺省来源不同:字号缺省是常量,颜色缺省是**不注入**——
124774
+ * 那样 `mountEchart` 会去读容器的计算 `color`,图表因此跟着宿主主题走。
124775
+ * 所以这里的 context 缺省值是 `undefined` 而不是 `DEFAULT_CHART_COLORS`:
124776
+ * 填上常量就等于把所有图表钉死在浅色默认上,正是本册要修的毛病。
124777
+ */
124778
+ const ChartColorsContext = createContext(void 0);
124779
+ function useChartColors() {
124780
+ return useContext(ChartColorsContext);
124781
+ }
124782
+ function ChartColorsProvider({ colors, children }) {
124783
+ const { title, axisLabel, legend, axisLine, splitLine } = colors ?? {};
124784
+ const absent = colors === void 0;
124785
+ const value = useMemo(() => absent ? void 0 : {
124786
+ title,
124787
+ axisLabel,
124788
+ legend,
124789
+ axisLine,
124790
+ splitLine
124791
+ }, [
124792
+ absent,
124793
+ title,
124794
+ axisLabel,
124795
+ legend,
124796
+ axisLine,
124797
+ splitLine
124798
+ ]);
124799
+ return /* @__PURE__ */ jsx(ChartColorsContext.Provider, {
124800
+ value,
124801
+ children
124802
+ });
124803
+ }
124804
+
124765
124805
  //#endregion
124766
124806
  //#region ../ui-react/src/components/EChart.tsx
124767
124807
  /** echarts 挂载点:surface 图表与 catalog 声明树的 Chart 节点共用,实现在 `@webskill/ui`,与 A2UI 档同一份 */
124768
- function EChart({ chart, fontSizes }) {
124808
+ function EChart({ chart, fontSizes, colors }) {
124769
124809
  const containerRef = useRef(null);
124770
124810
  const handleRef = useRef(void 0);
124771
124811
  const inherited = useChartFontSizes();
124772
124812
  const effective = fontSizes ?? inherited;
124813
+ const inheritedColors = useChartColors();
124814
+ const effectiveColors = colors ?? inheritedColors;
124773
124815
  useEffect(() => {
124774
124816
  const container = containerRef.current;
124775
124817
  if (!container) return;
@@ -124781,8 +124823,12 @@ function EChart({ chart, fontSizes }) {
124781
124823
  };
124782
124824
  }, []);
124783
124825
  useEffect(() => {
124784
- handleRef.current?.setChart(chart, effective);
124785
- }, [chart, effective]);
124826
+ handleRef.current?.setChart(chart, effective, effectiveColors);
124827
+ }, [
124828
+ chart,
124829
+ effective,
124830
+ effectiveColors
124831
+ ]);
124786
124832
  return /* @__PURE__ */ jsx("div", {
124787
124833
  className: "webskill-surface__chart",
124788
124834
  ref: containerRef
@@ -134885,7 +134931,14 @@ async function probeJsonRenderAvailability() {
134885
134931
  var SpecInteractionChannel = class {
134886
134932
  /** 宿主注入的界面文案(本地化);未设时用 FormModel 的英文默认值 */
134887
134933
  labelsFor = () => ({});
134888
- #current;
134934
+ /**
134935
+ * 待决交互队列,队头即 `current`(0.23.0 分册 19 FR-19.6)。
134936
+ *
134937
+ * 原本是单槽,新请求到来时把旧请求主动取消。并发子 agent 下那一句
134938
+ * 「正常路径 runtime 串行」不再成立,而主动取消比悬挂还糟:
134939
+ * 子 agent 会收到一个看似正常的 `cancelled: true`,然后把「用户拒绝了」写进结论。
134940
+ */
134941
+ #queue = [];
134889
134942
  #listeners = /* @__PURE__ */ new Set();
134890
134943
  #attached = 0;
134891
134944
  #failure;
@@ -134895,7 +134948,7 @@ var SpecInteractionChannel = class {
134895
134948
  return () => this.#listeners.delete(listener);
134896
134949
  };
134897
134950
  get current() {
134898
- return this.#current?.session;
134951
+ return this.#queue[0]?.session;
134899
134952
  }
134900
134953
  get isAttached() {
134901
134954
  return this.#attached > 0;
@@ -134911,26 +134964,22 @@ var SpecInteractionChannel = class {
134911
134964
  this.#attached = Math.max(0, this.#attached - 1);
134912
134965
  }
134913
134966
  request(input) {
134914
- if (this.#current) this.#settle({
134915
- id: this.#current.session.request.id,
134916
- cancelled: true
134917
- });
134918
134967
  return new Promise((resolve, reject) => {
134919
134968
  const session = {
134920
134969
  request: input,
134921
134970
  spec: interactionToUiSpec(input, this.labelsFor(input))
134922
134971
  };
134923
- this.#current = {
134972
+ this.#queue.push({
134924
134973
  session,
134925
134974
  resolve,
134926
134975
  reject
134927
- };
134976
+ });
134928
134977
  this.#emit();
134929
134978
  });
134930
134979
  }
134931
134980
  /** runtime 交互超时/取消:以 cancelled resolve 挂起的 request(防悬挂 + 残留) */
134932
134981
  cancel(id) {
134933
- if (this.#current?.session.request.id === id) this.#settle({
134982
+ if (this.#queue.some((entry) => entry.session.request.id === id)) this.#settle({
134934
134983
  id,
134935
134984
  cancelled: true
134936
134985
  });
@@ -134941,14 +134990,14 @@ var SpecInteractionChannel = class {
134941
134990
  * 本通道只提供入口:裸用本通道的宿主不调就维持原来的 cancelled 语义。
134942
134991
  */
134943
134992
  decline(id) {
134944
- if (this.#current?.session.request.id === id) this.#settle({
134993
+ if (this.#queue.some((entry) => entry.session.request.id === id)) this.#settle({
134945
134994
  id,
134946
134995
  value: false
134947
134996
  });
134948
134997
  }
134949
134998
  /** react 层动作回传:submit 归形提交值,其余意图(cancel)按取消收尾 */
134950
134999
  handleAction(event) {
134951
- const pending = this.#current;
135000
+ const pending = this.#queue[0];
134952
135001
  if (!pending) return;
134953
135002
  const { request } = pending.session;
134954
135003
  if (event.intent !== "submit") {
@@ -134967,14 +135016,16 @@ var SpecInteractionChannel = class {
134967
135016
  /** react 层初始化失败:挂起请求 reject 并记录原因(桥读取后降级 native) */
134968
135017
  fail(message) {
134969
135018
  this.#failure = message;
134970
- const pending = this.#current;
134971
- this.#current = void 0;
135019
+ const pendings = this.#queue;
135020
+ this.#queue = [];
134972
135021
  this.#emit();
134973
- pending?.reject(new Error(message));
135022
+ const error = new Error(message);
135023
+ for (const pending of pendings) pending.reject(error);
134974
135024
  }
134975
135025
  #settle(response) {
134976
- const pending = this.#current;
134977
- this.#current = void 0;
135026
+ const index = this.#queue.findIndex((entry) => entry.session.request.id === response.id);
135027
+ if (index < 0) return;
135028
+ const [pending] = this.#queue.splice(index, 1);
134978
135029
  this.#emit();
134979
135030
  pending?.resolve(response);
134980
135031
  }
@@ -134994,7 +135045,7 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
134994
135045
  const [unavailable, setUnavailable] = useState(false);
134995
135046
  useEffect(() => {
134996
135047
  let cancelled = false;
134997
- import("./openUiLibrary-B7j3rLrm.js").then((loaded) => {
135048
+ import("./openUiLibrary-CxtrnX54.js").then((loaded) => {
134998
135049
  if (!cancelled) setModule(loaded);
134999
135050
  }).catch(() => {
135000
135051
  if (!cancelled) setUnavailable(true);
@@ -135033,4 +135084,4 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
135033
135084
  }
135034
135085
 
135035
135086
  //#endregion
135036
- export { ChartFontSizesProvider, InteractionForm, JsonRenderSpecSurface, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, OpenUiSpecSurface, ReactBridgeState, ResultBlocks, SpecInteractionChannel, StreamingText, SurfaceFormTextsProvider, SurfaceRegistry, UiSurfaceList, UiSurfaceSnapshotList, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability, CatalogNode as t, useChartFontSizes, useSurfaceFormTexts, useSurfaceHostControlTexts };
135087
+ export { ChartColorsProvider, ChartFontSizesProvider, InteractionForm, JsonRenderSpecSurface, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, OpenUiSpecSurface, ReactBridgeState, ResultBlocks, SpecInteractionChannel, StreamingText, SurfaceFormTextsProvider, SurfaceRegistry, UiSurfaceList, UiSurfaceSnapshotList, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability, CatalogNode as t, useChartColors, useChartFontSizes, useSurfaceFormTexts, useSurfaceHostControlTexts };
package/dist/ui-vue.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as UiBridge, b as RenderResultRequest, c as InteractionResponse, s as InteractionRequest } from "./types-CpDRZ0rA-BM5FI9oN.js";
1
+ import { S as UiBridge, b as RenderResultRequest, c as InteractionResponse, s as InteractionRequest } from "./types-CpDRZ0rA-CFQ-vdKz.js";
2
2
  import { PropType } from "vue";
3
3
  //#region ../ui-vue/dist/index.d.ts
4
4
  //#region src/bridgeState.d.ts