@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/README.md +180 -46
- package/dist/browser.d.ts +37 -2
- package/dist/browser.js +112 -3
- package/dist/{dist-D405AlPD.js → dist-CiYRkm71.js} +840 -1291
- package/dist/{dist-Ixnb-hNR.js → dist-DfKKj86A.js} +84 -2
- package/dist/{dist-BM-VcQ90.js → dist-Dv4a1Jkm.js} +226 -4
- package/dist/governance.d.ts +5 -3
- package/dist/governance.js +13 -4
- package/dist/{index-aEple804.d.ts → index-DuodMfQw.d.ts} +7 -1
- package/dist/{index-BQDc-U1x.d.ts → index-S8uza3ld.d.ts} +65 -540
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/mcp.d.ts +3 -1
- package/dist/mcp.js +3 -1
- package/dist/memoryArtifactStore-C9lFVqPF-U8nXvqL9.js +637 -0
- package/dist/node.d.ts +4 -3
- package/dist/node.js +3 -2
- package/dist/testing-pn3NhXSV.js +117 -0
- package/dist/testing.d.ts +73 -0
- package/dist/testing.js +4 -0
- package/dist/types-CgNC-oQu-DCklnS0h.d.ts +539 -0
- package/dist/ui-react.d.ts +2 -2
- package/dist/ui-react.js +12 -2
- package/dist/ui-vue.d.ts +2 -2
- package/dist/ui-vue.js +9 -2
- package/dist/ui.d.ts +30 -5
- package/dist/ui.js +3 -3
- package/package.json +5 -1
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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 {
|
|
2
|
-
import { C as toOpenUiLang, S as toA2uiMessages, _ as
|
|
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
|
|
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": [
|