@webskill/sdk 0.0.5 → 0.1.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/dist/ui.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { A as InteractionResponse, it as RenderResultRequest, k as InteractionRequest, kt as buildRenderResult, rt as RenderBlock, wt as UiBridge } from "./index-BQDc-U1x.js";
1
+ import { _ as RenderResultRequest, g as RenderBlock, o as InteractionRequest, r as ChartSpec, s as InteractionResponse, v as UiBridge } from "./types-CgNC-oQu-DCklnS0h.js";
2
+ import { st as buildRenderResult } from "./index-S8uza3ld.js";
2
3
  //#region ../ui/dist/index.d.ts
3
4
  //#region src/model/formModel.d.ts
4
5
  interface FormModel {
@@ -47,6 +48,21 @@ declare function collectValues(controls: ControlModel[], container: ParentNode):
47
48
  */
48
49
  declare function renderMiniMarkdown(text: string, doc: Document): HTMLElement;
49
50
  //#endregion
51
+ //#region src/chart/miniChart.d.ts
52
+ /** 固定 8 色循环调色板 */
53
+ declare const CHART_PALETTE: readonly ['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f', '#edc948', '#b07aa1', '#ff9da7'];
54
+ /**
55
+ * ChartSpec → SVG(bar 等宽柱 + 值标签;line 折线 + 点;pie 扇形 + 图例;空数据容错)
56
+ * @stable
57
+ */
58
+ declare function renderMiniChart(chart: ChartSpec, doc: Document): SVGSVGElement;
59
+ /** A2UI/OpenUI 降级:chart → table(labels 为首列,series 各为一列) */
60
+ declare function chartToTable(chart: ChartSpec): {
61
+ type: 'table';
62
+ columns: string[];
63
+ rows: unknown[][];
64
+ };
65
+ //#endregion
50
66
  //#region src/web/webFormBridge.d.ts
51
67
  /**
52
68
  * 框架无关原生 DOM 的 UiBridge:request 渲染表单并返回 Promise
@@ -70,7 +86,7 @@ declare class WebFormBridge implements UiBridge {
70
86
  }
71
87
  //#endregion
72
88
  //#region src/web/resultRenderer.d.ts
73
- /** RenderBlock → DOM(markdown/json/table/image/file 五种) */
89
+ /** RenderBlock → DOM(markdown/json/table/image/file/chart 六种) */
74
90
  declare function renderBlocks(container: HTMLElement, blocks: RenderBlock[], doc: Document): void;
75
91
  /** 完整 RenderResultRequest → DOM(summary 头 + blocks) */
76
92
  declare function renderRenderResult(request: RenderResultRequest, doc: Document): HTMLElement;
@@ -121,8 +137,12 @@ declare class VercelUiBridge implements UiBridge {
121
137
  */
122
138
  declare const OPENUI_SUBMIT_ACTION = "webskill:submit";
123
139
  declare const OPENUI_CANCEL_ACTION = "webskill:cancel";
140
+ /** @experimental */
124
141
  declare function toOpenUiLang(request: InteractionRequest): string;
125
- /** OpenUI ActionEvent → InteractionResponse(formState 优先,取消单独分支) */
142
+ /**
143
+ * OpenUI ActionEvent → InteractionResponse(formState 优先,取消单独分支)
144
+ * @experimental
145
+ */
126
146
  declare function fromOpenUiAction(action: unknown): InteractionResponse;
127
147
  //#endregion
128
148
  //#region src/adapters/a2ui/a2uiMessages.d.ts
@@ -145,8 +165,12 @@ interface A2uiMessage {
145
165
  version: string;
146
166
  [key: string]: unknown;
147
167
  }
168
+ /** @experimental */
148
169
  declare function toA2uiMessages(request: InteractionRequest): A2uiMessage[];
149
- /** A2UI client→server action 事件 → InteractionResponse */
170
+ /**
171
+ * A2UI client→server action 事件 → InteractionResponse
172
+ * @experimental
173
+ */
150
174
  declare function fromA2uiAction(event: unknown): InteractionResponse;
151
175
  //#endregion
152
176
  //#region src/a2uiRuntime/litRendererBridge.d.ts
@@ -158,6 +182,7 @@ declare function fromA2uiAction(event: unknown): InteractionResponse;
158
182
  *
159
183
  * 版本对齐:渲染器 @a2ui/lit@0.10.x 经 v0_9 入口同时接受 v0.9 / v0.9.1 消息
160
184
  * (schema 枚举 ['v0.9','v0.9.1']),与 7A v0.9.1 转换产物直接兼容。
185
+ * @experimental
161
186
  */
162
187
  declare class LitRendererBridge implements UiBridge {
163
188
  #private;
@@ -168,4 +193,4 @@ declare class LitRendererBridge implements UiBridge {
168
193
  request(input: InteractionRequest): Promise<InteractionResponse>;
169
194
  }
170
195
  //#endregion
171
- export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, type A2uiMessage, type CollectedValues, type ControlModel, type FormModel, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
196
+ export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, type A2uiMessage, CHART_PALETTE, type CollectedValues, type ControlModel, type FormModel, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, chartToTable, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as buildRenderResult } from "./dist-D405AlPD.js";
2
- import { C as toOpenUiLang, S as toA2uiMessages, _ as interactionToFormModel, a as LitRendererBridge, b as renderRenderResult, c as VERCEL_INTERACTION_TOOL_NAME, d as WebFormBridge, f as collectValues, g as fromVercelToolResult, h as fromOpenUiAction, i as A2UI_VERSION, l as VercelUiBridge, m as fromA2uiAction, n as A2UI_CANCEL_ACTION, o as OPENUI_CANCEL_ACTION, p as ensureStyles, r as A2UI_SUBMIT_ACTION, s as OPENUI_SUBMIT_ACTION, t as A2UI_BASIC_CATALOG_ID, u as WEBSKILL_STYLES_CSS, v as renderBlocks, w as toVercelToolInvocation, x as shapeInteractionValue, y as renderMiniMarkdown } from "./dist-BM-VcQ90.js";
1
+ import { x as buildRenderResult } from "./dist-CiYRkm71.js";
2
+ import { C as renderRenderResult, D as toVercelToolInvocation, E as toOpenUiLang, S as renderMiniMarkdown, T as toA2uiMessages, _ as fromOpenUiAction, a as CHART_PALETTE, b as renderBlocks, c as OPENUI_SUBMIT_ACTION, d as WEBSKILL_STYLES_CSS, f as WebFormBridge, g as fromA2uiAction, h as ensureStyles, i as A2UI_VERSION, l as VERCEL_INTERACTION_TOOL_NAME, m as collectValues, n as A2UI_CANCEL_ACTION, o as LitRendererBridge, p as chartToTable, r as A2UI_SUBMIT_ACTION, s as OPENUI_CANCEL_ACTION, t as A2UI_BASIC_CATALOG_ID, u as VercelUiBridge, v as fromVercelToolResult, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-Dv4a1Jkm.js";
3
3
 
4
- export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
4
+ export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, CHART_PALETTE, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, chartToTable, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webskill/sdk",
3
- "version": "0.0.5",
3
+ "version": "0.1.0",
4
4
  "description": "WebSkill — browser/Node agent skill runtime (skills, tools, MCP, governance, UI)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,6 +40,10 @@
40
40
  "types": "./dist/governance.d.ts",
41
41
  "import": "./dist/governance.js"
42
42
  },
43
+ "./testing": {
44
+ "types": "./dist/testing.d.ts",
45
+ "import": "./dist/testing.js"
46
+ },
43
47
  "./package.json": "./package.json"
44
48
  },
45
49
  "files": [