@webskill/sdk 0.0.4 → 0.0.6

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,8 +1,8 @@
1
- import { Ct as buildRenderResult, Q as RenderResultRequest, T as InteractionResponse, Z as RenderBlock, vt as UiBridge, w as InteractionRequest } from "./index-CqDIreSE.js";
1
+ import { Et as UiBridge, M as InteractionResponse, Mt as buildRenderResult, _ as ChartSpec, at as RenderBlock, j as InteractionRequest, ot as RenderResultRequest } from "./index-DCifjtJx.js";
2
2
  //#region ../ui/dist/index.d.ts
3
3
  //#region src/model/formModel.d.ts
4
4
  interface FormModel {
5
- kind: 'ask' | 'confirm' | 'form' | 'select';
5
+ kind: 'ask' | 'confirm' | 'form' | 'select' | 'authorize';
6
6
  title?: string;
7
7
  message?: string;
8
8
  controls: ControlModel[];
@@ -23,7 +23,7 @@ interface ControlModel {
23
23
  }
24
24
  /** 提交值按请求类型归形(WebFormBridge 与框架组件库共享单一来源) */
25
25
  declare function shapeInteractionValue(model: FormModel, values: Record<string, unknown>): unknown;
26
- /** 四类 InteractionRequest → 统一中间模型(框架无关) */
26
+ /** 五类 InteractionRequest → 统一中间模型(框架无关) */
27
27
  declare function interactionToFormModel(request: InteractionRequest): FormModel;
28
28
  //#endregion
29
29
  //#region src/model/collectValues.d.ts
@@ -47,6 +47,18 @@ declare function collectValues(controls: ControlModel[], container: ParentNode):
47
47
  */
48
48
  declare function renderMiniMarkdown(text: string, doc: Document): HTMLElement;
49
49
  //#endregion
50
+ //#region src/chart/miniChart.d.ts
51
+ /** 固定 8 色循环调色板 */
52
+ declare const CHART_PALETTE: readonly ['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f', '#edc948', '#b07aa1', '#ff9da7'];
53
+ /** ChartSpec → SVG(bar 等宽柱 + 值标签;line 折线 + 点;pie 扇形 + 图例;空数据容错) */
54
+ declare function renderMiniChart(chart: ChartSpec, doc: Document): SVGSVGElement;
55
+ /** A2UI/OpenUI 降级:chart → table(labels 为首列,series 各为一列) */
56
+ declare function chartToTable(chart: ChartSpec): {
57
+ type: 'table';
58
+ columns: string[];
59
+ rows: unknown[][];
60
+ };
61
+ //#endregion
50
62
  //#region src/web/webFormBridge.d.ts
51
63
  /**
52
64
  * 框架无关原生 DOM 的 UiBridge:request 渲染表单并返回 Promise
@@ -70,7 +82,7 @@ declare class WebFormBridge implements UiBridge {
70
82
  }
71
83
  //#endregion
72
84
  //#region src/web/resultRenderer.d.ts
73
- /** RenderBlock → DOM(markdown/json/table/image/file 五种) */
85
+ /** RenderBlock → DOM(markdown/json/table/image/file/chart 六种) */
74
86
  declare function renderBlocks(container: HTMLElement, blocks: RenderBlock[], doc: Document): void;
75
87
  /** 完整 RenderResultRequest → DOM(summary 头 + blocks) */
76
88
  declare function renderRenderResult(request: RenderResultRequest, doc: Document): HTMLElement;
@@ -168,4 +180,4 @@ declare class LitRendererBridge implements UiBridge {
168
180
  request(input: InteractionRequest): Promise<InteractionResponse>;
169
181
  }
170
182
  //#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 };
183
+ 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 { w as buildRenderResult } from "./dist-COsE72Ct.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-RcqvzAGF.js";
1
+ import { T as buildRenderResult } from "./dist-nXiR40hi.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-BQruQ9Hv.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.4",
3
+ "version": "0.0.6",
4
4
  "description": "WebSkill — browser/Node agent skill runtime (skills, tools, MCP, governance, UI)",
5
5
  "license": "MIT",
6
6
  "type": "module",