@webskill/sdk 0.1.5 → 0.2.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/browser.d.ts +3 -2
- package/dist/browser.js +10 -5
- package/dist/{dist-CfBOjJ4p.js → dist-BJobG0i-.js} +30 -7
- package/dist/{dist-DuGN5x0v.js → dist-BS5OpedX.js} +181 -50
- package/dist/{dist-fZFZaf43.js → dist-D0saNPi_.js} +22 -4
- package/dist/{dist-LIFS3ZjI.js → dist-Dj6QjHBn.js} +55 -151
- package/dist/env--jJB-TSX-04klhTYi.js +143 -0
- package/dist/env-BPUBZCwJ-4jat_SVG.d.ts +38 -0
- package/dist/governance.d.ts +32 -6
- package/dist/governance.js +155 -10
- package/dist/{index-COuOu6gw.d.ts → index-CySxIvRz.d.ts} +51 -3
- package/dist/{index-Bun1aEf4.d.ts → index-Vn63HJRO.d.ts} +11 -38
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +3 -3
- package/dist/mcp.js +28 -8
- package/dist/node.d.ts +5 -4
- package/dist/node.js +5 -4
- package/dist/{testing-BmR48Pn1.js → testing-B4pq6JYa.js} +1 -1
- package/dist/testing.d.ts +3 -2
- package/dist/testing.js +3 -2
- package/dist/{types-CgNC-oQu-DEcIBJKG.d.ts → types-CKm5G_eQ-8W8FnP4u.d.ts} +13 -2
- package/dist/ui-react.d.ts +4 -2
- package/dist/ui-react.js +25 -4
- package/dist/ui-vue.d.ts +3 -2
- package/dist/ui-vue.js +44 -15
- package/dist/ui.d.ts +5 -3
- package/dist/ui.js +2 -2
- package/package.json +21 -9
|
@@ -127,6 +127,8 @@ interface FileSystemProvider {
|
|
|
127
127
|
remove(path: string, options?: {
|
|
128
128
|
recursive?: boolean;
|
|
129
129
|
}): Promise<void>;
|
|
130
|
+
/** 原子重命名(lockfile 等先写临时文件再 rename 的场景;实现侧无原生 rename 时 copy+remove 兜底) */
|
|
131
|
+
rename(from: string, to: string): Promise<void>;
|
|
130
132
|
}
|
|
131
133
|
//#endregion
|
|
132
134
|
//#region src/fs/memoryFs.d.ts
|
|
@@ -146,8 +148,13 @@ declare class MemoryFS implements FileSystemProvider {
|
|
|
146
148
|
remove(path: string, options?: {
|
|
147
149
|
recursive?: boolean;
|
|
148
150
|
}): Promise<void>;
|
|
151
|
+
rename(from: string, to: string): Promise<void>;
|
|
149
152
|
}
|
|
150
153
|
//#endregion
|
|
154
|
+
//#region src/fs/atomicWrite.d.ts
|
|
155
|
+
/** 原子写文本:先写临时文件再 rename(进程崩溃不留下半写文件;lockfile 等账本场景) */
|
|
156
|
+
declare function atomicWriteText(fs: FileSystemProvider, path: string, content: string): Promise<void>;
|
|
157
|
+
//#endregion
|
|
151
158
|
//#region src/fs/pathSecurity.d.ts
|
|
152
159
|
/** 统一分隔符为 `/`,去除 `.` 段与重复分隔符(不解析 `..`) */
|
|
153
160
|
declare function normalizePath(path: string): string;
|
|
@@ -365,7 +372,7 @@ declare function escapeXml(text: string): string;
|
|
|
365
372
|
declare function renderAvailableSkillsXml(catalog: SkillCatalog): string;
|
|
366
373
|
declare const xmlRenderer: CatalogRenderer;
|
|
367
374
|
//#endregion
|
|
368
|
-
//#region ../runtime/dist/types-
|
|
375
|
+
//#region ../runtime/dist/types-CKm5G_eQ.d.ts
|
|
369
376
|
//#region src/llm/streamTypes.d.ts
|
|
370
377
|
/** 流式 LLM 事件(OpenAI SSE / Vercel fullStream 统一映射) */
|
|
371
378
|
type LlmStreamEvent = {
|
|
@@ -528,6 +535,8 @@ interface RenderResultRequest {
|
|
|
528
535
|
/** @stable */
|
|
529
536
|
interface UiBridge {
|
|
530
537
|
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
538
|
+
/** 尽力取消等待中的 request(如交互超时后清理遗留表单/提示;可选实现) */
|
|
539
|
+
cancel?(id: string): void | Promise<void>;
|
|
531
540
|
progress?(input: {
|
|
532
541
|
runId: string;
|
|
533
542
|
message: string;
|
|
@@ -570,6 +579,8 @@ interface MemoryStore {
|
|
|
570
579
|
value: unknown;
|
|
571
580
|
}>>;
|
|
572
581
|
clear(scope?: string): Promise<void>;
|
|
582
|
+
/** 可选:scope 级原子段(read-modify-write 全段串行;fn 收到底层 store,禁止重入装饰器自身) */
|
|
583
|
+
transaction?<T>(scope: string, fn: (inner: MemoryStore) => Promise<T>): Promise<T>;
|
|
573
584
|
}
|
|
574
585
|
//#endregion
|
|
575
|
-
export {
|
|
586
|
+
export { checkDependencyCycles as $, SKILL_NAME_PATTERN as A, SkillMetadata as B, FileStat as C, SKILLS_LOCKFILE as D, MemoryFS as E, SkillDocument as F, ValidationReport as G, SkillReader as H, SkillInstallSource as I, WebSkillErrorCode as J, VerifyResult as K, SkillIssue as L, SkillCatalog as M, SkillCatalogEntry as N, SKILL_MANIFEST_FILE as O, SkillDiscovery as P, buildManifest as Q, SkillLocation as R, DiscoveryResult as S, JsonSchema as T, SkillSource as U, SkillPackManifest as V, SkillsLockfile as W, atomicWriteText as X, assertSafePathSegment as Y, buildCatalog as Z, RenderResultRequest as _, xmlRenderer as _t, InteractionPolicy as a, jsonRenderer as at, CatalogRenderer as b, LlmClient as c, parseSkillPackManifest as ct, LlmResponse as d, renderCatalogJson as dt, checkSkillRules as et, LlmStreamEvent as f, resolveArchiveLimits as ft, RenderBlock as g, verifyManifest as gt, MemoryStore as h, validateSkills as ht, FormField as i, isValidSkillName as it, SKILL_PACK_FILE as j, SKILL_NAME_MAX_LENGTH as k, LlmCompleteInput as l, readResponseWithLimit as lt, LlmToolSpec as m, unzipWithLimits as mt, ArtifactStore as n, escapeXml as nt, InteractionRequest as o, normalizePath as ot, LlmToolCall as p, resolveInsideRoot as pt, WebSkillError as q, ChartSpec as r, exportSkills as rt, InteractionResponse as s, parseSkillMarkdown as st, Artifact as t, computeDigest as tt, LlmMessage as u, renderAvailableSkillsXml as ut, UiBridge as v, FileSystemProvider as w, DEFAULT_ARCHIVE_LIMITS as x, ArchiveLimits as y, SkillManifest as z };
|
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as RenderResultRequest, o as InteractionRequest, s as InteractionResponse, v as UiBridge } from "./types-
|
|
1
|
+
import { _ as RenderResultRequest, o as InteractionRequest, s as InteractionResponse, v as UiBridge } from "./types-CKm5G_eQ-8W8FnP4u.js";
|
|
2
2
|
//#region ../ui-react/dist/index.d.ts
|
|
3
3
|
//#region src/bridgeState.d.ts
|
|
4
4
|
/**
|
|
@@ -9,6 +9,8 @@ declare class ReactBridgeState implements UiBridge {
|
|
|
9
9
|
#private;
|
|
10
10
|
pending: InteractionRequest | null;
|
|
11
11
|
latestResult: RenderResultRequest | null;
|
|
12
|
+
/** 当前流式 runId(并发 run 隔离:新 runId 重置文本) */
|
|
13
|
+
streamingRunId: string | null;
|
|
12
14
|
streamingText: string;
|
|
13
15
|
/** React useSyncExternalStore 兼容订阅 */
|
|
14
16
|
subscribe: (listener: () => void) => (() => void);
|
|
@@ -16,7 +18,7 @@ declare class ReactBridgeState implements UiBridge {
|
|
|
16
18
|
/** 组件提交/取消回调 */
|
|
17
19
|
resolve(response: InteractionResponse): void;
|
|
18
20
|
renderResult(input: RenderResultRequest): Promise<void>;
|
|
19
|
-
onTextDelta(
|
|
21
|
+
onTextDelta(runId: string, delta: string): Promise<void>;
|
|
20
22
|
}
|
|
21
23
|
//#endregion
|
|
22
24
|
//#region src/components/InteractionForm.d.ts
|
package/dist/ui-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-
|
|
1
|
+
import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BJobG0i-.js";
|
|
2
2
|
import { useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
|
|
@@ -10,6 +10,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
10
10
|
var ReactBridgeState = class {
|
|
11
11
|
pending = null;
|
|
12
12
|
latestResult = null;
|
|
13
|
+
/** 当前流式 runId(并发 run 隔离:新 runId 重置文本) */
|
|
14
|
+
streamingRunId = null;
|
|
13
15
|
streamingText = "";
|
|
14
16
|
#listeners = /* @__PURE__ */ new Set();
|
|
15
17
|
#resolvers = /* @__PURE__ */ new Map();
|
|
@@ -41,14 +43,20 @@ var ReactBridgeState = class {
|
|
|
41
43
|
this.latestResult = input;
|
|
42
44
|
this.#emit();
|
|
43
45
|
}
|
|
44
|
-
async onTextDelta(
|
|
46
|
+
async onTextDelta(runId, delta) {
|
|
47
|
+
if (this.streamingRunId !== runId) {
|
|
48
|
+
this.streamingRunId = runId;
|
|
49
|
+
this.streamingText = "";
|
|
50
|
+
}
|
|
45
51
|
this.streamingText += delta;
|
|
46
52
|
this.#emit();
|
|
47
53
|
}
|
|
48
54
|
};
|
|
49
|
-
function Control({ control }) {
|
|
55
|
+
function Control({ control, invalid }) {
|
|
56
|
+
const controlId = `webskill-field-${control.name}`;
|
|
50
57
|
const label = /* @__PURE__ */ jsxs("label", {
|
|
51
58
|
className: "webskill-form__label",
|
|
59
|
+
htmlFor: controlId,
|
|
52
60
|
children: [control.label, control.required ? " *" : ""]
|
|
53
61
|
});
|
|
54
62
|
const description = control.description ? /* @__PURE__ */ jsx("div", {
|
|
@@ -64,6 +72,8 @@ function Control({ control }) {
|
|
|
64
72
|
description,
|
|
65
73
|
/* @__PURE__ */ jsx("input", {
|
|
66
74
|
type: "checkbox",
|
|
75
|
+
id: controlId,
|
|
76
|
+
"aria-invalid": invalid || void 0,
|
|
67
77
|
className: "webskill-form__input",
|
|
68
78
|
"data-webskill-control": control.name,
|
|
69
79
|
defaultChecked: control.defaultValue === true
|
|
@@ -77,6 +87,8 @@ function Control({ control }) {
|
|
|
77
87
|
label,
|
|
78
88
|
description,
|
|
79
89
|
/* @__PURE__ */ jsx("select", {
|
|
90
|
+
id: controlId,
|
|
91
|
+
"aria-invalid": invalid || void 0,
|
|
80
92
|
className: "webskill-form__input",
|
|
81
93
|
"data-webskill-control": control.name,
|
|
82
94
|
children: (control.options ?? []).map((option, i) => /* @__PURE__ */ jsx("option", {
|
|
@@ -94,6 +106,8 @@ function Control({ control }) {
|
|
|
94
106
|
label,
|
|
95
107
|
description,
|
|
96
108
|
/* @__PURE__ */ jsx("textarea", {
|
|
109
|
+
id: controlId,
|
|
110
|
+
"aria-invalid": invalid || void 0,
|
|
97
111
|
className: "webskill-form__input",
|
|
98
112
|
"data-webskill-control": control.name,
|
|
99
113
|
defaultValue: control.defaultValue !== void 0 ? String(control.defaultValue) : ""
|
|
@@ -108,6 +122,8 @@ function Control({ control }) {
|
|
|
108
122
|
description,
|
|
109
123
|
/* @__PURE__ */ jsx("input", {
|
|
110
124
|
type: control.control === "number" ? "number" : "text",
|
|
125
|
+
id: controlId,
|
|
126
|
+
"aria-invalid": invalid || void 0,
|
|
111
127
|
className: "webskill-form__input",
|
|
112
128
|
"data-webskill-control": control.name,
|
|
113
129
|
defaultValue: control.defaultValue !== void 0 ? String(control.defaultValue) : ""
|
|
@@ -151,7 +167,12 @@ function InteractionForm({ bridge }) {
|
|
|
151
167
|
}) : null,
|
|
152
168
|
model.controls.map((control) => /* @__PURE__ */ jsxs("div", {
|
|
153
169
|
className: invalid.includes(control.name) ? "webskill-form__control--invalid" : void 0,
|
|
154
|
-
children: [/* @__PURE__ */ jsx(Control, {
|
|
170
|
+
children: [/* @__PURE__ */ jsx(Control, {
|
|
171
|
+
control,
|
|
172
|
+
invalid: invalid.includes(control.name)
|
|
173
|
+
}), invalid.includes(control.name) ? /* @__PURE__ */ jsx("div", {
|
|
174
|
+
id: `webskill-error-${control.name}`,
|
|
175
|
+
role: "alert",
|
|
155
176
|
className: "webskill-form__error",
|
|
156
177
|
children: "This field is required"
|
|
157
178
|
}) : null]
|
package/dist/ui-vue.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { _ as RenderResultRequest, o as InteractionRequest, s as InteractionResponse, v as UiBridge } from "./types-
|
|
1
|
+
import { _ as RenderResultRequest, o as InteractionRequest, s as InteractionResponse, v as UiBridge } from "./types-CKm5G_eQ-8W8FnP4u.js";
|
|
2
2
|
import { PropType } from "vue";
|
|
3
3
|
//#region ../ui-vue/dist/index.d.ts
|
|
4
4
|
//#region src/bridgeState.d.ts
|
|
5
5
|
interface VueBridgeSnapshot {
|
|
6
6
|
pending: InteractionRequest | null;
|
|
7
7
|
latestResult: RenderResultRequest | null;
|
|
8
|
+
streamingRunId: string | null;
|
|
8
9
|
streamingText: string;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
@@ -18,7 +19,7 @@ declare class VueBridgeState implements UiBridge {
|
|
|
18
19
|
/** 组件提交/取消回调 */
|
|
19
20
|
resolve(response: InteractionResponse): void;
|
|
20
21
|
renderResult(input: RenderResultRequest): Promise<void>;
|
|
21
|
-
onTextDelta(
|
|
22
|
+
onTextDelta(runId: string, delta: string): Promise<void>;
|
|
22
23
|
}
|
|
23
24
|
//#endregion
|
|
24
25
|
//#region src/components/interactionForm.d.ts
|
package/dist/ui-vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-
|
|
1
|
+
import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BJobG0i-.js";
|
|
2
2
|
import { defineComponent, h, reactive, ref } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region ../ui-vue/dist/index.js
|
|
@@ -10,6 +10,7 @@ var VueBridgeState = class {
|
|
|
10
10
|
state = reactive({
|
|
11
11
|
pending: null,
|
|
12
12
|
latestResult: null,
|
|
13
|
+
streamingRunId: null,
|
|
13
14
|
streamingText: ""
|
|
14
15
|
});
|
|
15
16
|
#resolvers = /* @__PURE__ */ new Map();
|
|
@@ -30,18 +31,28 @@ var VueBridgeState = class {
|
|
|
30
31
|
async renderResult(input) {
|
|
31
32
|
this.state.latestResult = input;
|
|
32
33
|
}
|
|
33
|
-
async onTextDelta(
|
|
34
|
+
async onTextDelta(runId, delta) {
|
|
35
|
+
if (this.state.streamingRunId !== runId) {
|
|
36
|
+
this.state.streamingRunId = runId;
|
|
37
|
+
this.state.streamingText = "";
|
|
38
|
+
}
|
|
34
39
|
this.state.streamingText += delta;
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
|
-
function renderControl(control) {
|
|
38
|
-
const
|
|
42
|
+
function renderControl(control, invalid) {
|
|
43
|
+
const controlId = `webskill-field-${control.name}`;
|
|
44
|
+
const label = h("label", {
|
|
45
|
+
class: "webskill-form__label",
|
|
46
|
+
for: controlId
|
|
47
|
+
}, [control.label, ...control.required ? [" *"] : []]);
|
|
39
48
|
const description = control.description ? h("div", { class: "webskill-form__description" }, control.description) : null;
|
|
40
49
|
let input;
|
|
41
50
|
switch (control.control) {
|
|
42
51
|
case "boolean":
|
|
43
52
|
input = h("input", {
|
|
44
53
|
type: "checkbox",
|
|
54
|
+
id: controlId,
|
|
55
|
+
"aria-invalid": invalid || void 0,
|
|
45
56
|
class: "webskill-form__input",
|
|
46
57
|
"data-webskill-control": control.name,
|
|
47
58
|
checked: control.defaultValue === true
|
|
@@ -49,6 +60,8 @@ function renderControl(control) {
|
|
|
49
60
|
break;
|
|
50
61
|
case "select":
|
|
51
62
|
input = h("select", {
|
|
63
|
+
id: controlId,
|
|
64
|
+
"aria-invalid": invalid || void 0,
|
|
52
65
|
class: "webskill-form__input",
|
|
53
66
|
"data-webskill-control": control.name
|
|
54
67
|
}, (control.options ?? []).map((option) => h("option", {
|
|
@@ -58,6 +71,8 @@ function renderControl(control) {
|
|
|
58
71
|
break;
|
|
59
72
|
case "textarea":
|
|
60
73
|
input = h("textarea", {
|
|
74
|
+
id: controlId,
|
|
75
|
+
"aria-invalid": invalid || void 0,
|
|
61
76
|
class: "webskill-form__input",
|
|
62
77
|
"data-webskill-control": control.name,
|
|
63
78
|
value: control.defaultValue !== void 0 ? String(control.defaultValue) : ""
|
|
@@ -65,6 +80,8 @@ function renderControl(control) {
|
|
|
65
80
|
break;
|
|
66
81
|
default: input = h("input", {
|
|
67
82
|
type: control.control === "number" ? "number" : "text",
|
|
83
|
+
id: controlId,
|
|
84
|
+
"aria-invalid": invalid || void 0,
|
|
68
85
|
class: "webskill-form__input",
|
|
69
86
|
"data-webskill-control": control.name,
|
|
70
87
|
value: control.defaultValue !== void 0 ? String(control.defaultValue) : ""
|
|
@@ -113,7 +130,11 @@ const InteractionForm = defineComponent({
|
|
|
113
130
|
}, [
|
|
114
131
|
model.title ? h("div", { class: "webskill-form__title" }, model.title) : null,
|
|
115
132
|
model.message && (model.kind === "form" || model.kind === "authorize") ? h("p", { class: "webskill-form__message" }, model.message) : null,
|
|
116
|
-
...model.controls.map((control) => h("div", { key: control.name }, [renderControl(control), invalid.value.includes(control.name) ? h("div", {
|
|
133
|
+
...model.controls.map((control) => h("div", { key: control.name }, [renderControl(control, invalid.value.includes(control.name)), invalid.value.includes(control.name) ? h("div", {
|
|
134
|
+
id: `webskill-error-${control.name}`,
|
|
135
|
+
role: "alert",
|
|
136
|
+
class: "webskill-form__error"
|
|
137
|
+
}, "This field is required") : null])),
|
|
117
138
|
h("div", { class: "webskill-form__actions" }, [h("button", {
|
|
118
139
|
type: "submit",
|
|
119
140
|
class: "webskill-form__button webskill-form__button--primary"
|
|
@@ -132,20 +153,28 @@ const InteractionForm = defineComponent({
|
|
|
132
153
|
});
|
|
133
154
|
function renderBlock(block, key) {
|
|
134
155
|
switch (block.type) {
|
|
135
|
-
case "chart":
|
|
136
|
-
|
|
137
|
-
onVnodeMounted: (vnode) => {
|
|
156
|
+
case "chart": {
|
|
157
|
+
const renderChart = (vnode) => {
|
|
138
158
|
const el = vnode.el;
|
|
139
159
|
if (el) el.replaceChildren(renderMiniChart(block.chart, el.ownerDocument));
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
160
|
+
};
|
|
161
|
+
return h("div", {
|
|
162
|
+
key,
|
|
163
|
+
onVnodeMounted: renderChart,
|
|
164
|
+
onVnodeUpdated: renderChart
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
case "markdown": {
|
|
168
|
+
const renderMd = (vnode) => {
|
|
145
169
|
const el = vnode.el;
|
|
146
170
|
if (el) el.replaceChildren(renderMiniMarkdown(block.text, el.ownerDocument));
|
|
147
|
-
}
|
|
148
|
-
|
|
171
|
+
};
|
|
172
|
+
return h("div", {
|
|
173
|
+
key,
|
|
174
|
+
onVnodeMounted: renderMd,
|
|
175
|
+
onVnodeUpdated: renderMd
|
|
176
|
+
});
|
|
177
|
+
}
|
|
149
178
|
case "json": return h("pre", {
|
|
150
179
|
key,
|
|
151
180
|
class: "webskill-result__json"
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as RenderResultRequest, g as RenderBlock, o as InteractionRequest, r as ChartSpec, s as InteractionResponse, v as UiBridge } from "./types-
|
|
2
|
-
import {
|
|
1
|
+
import { _ as RenderResultRequest, g as RenderBlock, o as InteractionRequest, r as ChartSpec, s as InteractionResponse, v as UiBridge } from "./types-CKm5G_eQ-8W8FnP4u.js";
|
|
2
|
+
import { mt as buildRenderResult } from "./index-CySxIvRz.js";
|
|
3
3
|
//#region ../ui/dist/index.d.ts
|
|
4
4
|
//#region src/model/formModel.d.ts
|
|
5
5
|
interface FormModel {
|
|
@@ -50,7 +50,7 @@ declare function renderMiniMarkdown(text: string, doc: Document): HTMLElement;
|
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/chart/miniChart.d.ts
|
|
52
52
|
/** 固定 8 色循环调色板 */
|
|
53
|
-
declare const CHART_PALETTE: readonly [
|
|
53
|
+
declare const CHART_PALETTE: readonly ["#4e79a7", "#f28e2b", "#e15759", "#76b7b2", "#59a14f", "#edc948", "#b07aa1", "#ff9da7"];
|
|
54
54
|
/**
|
|
55
55
|
* ChartSpec → SVG(bar 等宽柱 + 值标签;line 折线 + 点;pie 扇形 + 图例;空数据容错)
|
|
56
56
|
* @stable
|
|
@@ -77,6 +77,8 @@ declare class WebFormBridge implements UiBridge {
|
|
|
77
77
|
styles?: boolean;
|
|
78
78
|
});
|
|
79
79
|
request(input: InteractionRequest): Promise<InteractionResponse>;
|
|
80
|
+
/** 尽力取消等待中的 request(超时后清理遗留表单) */
|
|
81
|
+
cancel(id: string): void;
|
|
80
82
|
renderResult(input: RenderResultRequest): Promise<void>;
|
|
81
83
|
progress(input: {
|
|
82
84
|
runId: string;
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
1
|
+
import { w as buildRenderResult } from "./dist-BS5OpedX.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-BJobG0i-.js";
|
|
3
3
|
|
|
4
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webskill/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "WebSkill
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "WebSkill \u2014 browser/Node agent skill runtime (skills, tools, MCP, governance, UI)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"typecheck": "tsc --noEmit"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
62
61
|
"fflate": "0.8.3",
|
|
63
|
-
"
|
|
64
|
-
"tar": "7.5.21",
|
|
65
|
-
"yaml": "^2.9.0",
|
|
66
|
-
"zod": "^4.4.3"
|
|
62
|
+
"yaml": "^2.9.0"
|
|
67
63
|
},
|
|
68
64
|
"peerDependencies": {
|
|
69
65
|
"react": ">=19.0.0",
|
|
70
66
|
"react-dom": ">=19.0.0",
|
|
71
|
-
"vue": ">=3.5.0"
|
|
67
|
+
"vue": ">=3.5.0",
|
|
68
|
+
"@modelcontextprotocol/sdk": ">=1.29.0",
|
|
69
|
+
"oxc-parser": ">=0.141.0",
|
|
70
|
+
"tar": ">=7.5.0",
|
|
71
|
+
"zod": ">=4.0.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependenciesMeta": {
|
|
74
74
|
"react": {
|
|
@@ -79,6 +79,18 @@
|
|
|
79
79
|
},
|
|
80
80
|
"vue": {
|
|
81
81
|
"optional": true
|
|
82
|
+
},
|
|
83
|
+
"@modelcontextprotocol/sdk": {
|
|
84
|
+
"optional": true
|
|
85
|
+
},
|
|
86
|
+
"oxc-parser": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
89
|
+
"tar": {
|
|
90
|
+
"optional": true
|
|
91
|
+
},
|
|
92
|
+
"zod": {
|
|
93
|
+
"optional": true
|
|
82
94
|
}
|
|
83
95
|
},
|
|
84
96
|
"devDependencies": {
|
|
@@ -93,6 +105,6 @@
|
|
|
93
105
|
"@webskill/ui-react": "workspace:*",
|
|
94
106
|
"@webskill/ui-vue": "workspace:*",
|
|
95
107
|
"tsdown": "0.22.13",
|
|
96
|
-
"typescript": "
|
|
108
|
+
"typescript": "6.0.3"
|
|
97
109
|
}
|
|
98
110
|
}
|