@webskill/sdk 0.29.0 → 0.30.0-next.1
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/agent.d.ts +2 -2
- package/dist/agent.js +27 -760
- package/dist/browser.d.ts +3 -3
- package/dist/browser.js +2 -1
- package/dist/controller.d.ts +88 -0
- package/dist/controller.js +3 -0
- package/dist/device-DMUgqNzr.js +1782 -0
- package/dist/{dist-CTsxblSD.js → dist-Ww6TChcf.js} +2 -2
- package/dist/{geometry-QmrkJw1_.js → geometry-1xQbK4hB.js} +1 -76
- package/dist/governance.d.ts +3 -3
- package/dist/{index-C3t1jKAs.d.ts → index-1ASrUwzn.d.ts} +2 -2
- package/dist/{index-B5zHZDNA.d.ts → index-Cj2HedfL.d.ts} +3 -2
- package/dist/{index-Cngzg2WS.d.ts → index-UbNuzd2a.d.ts} +3 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/node.d.ts +3 -3
- package/dist/{openUiLibrary-BnhYUlqY.js → openUiLibrary-BjRDYyTe.js} +1 -1
- package/dist/{skillVersionStore-S4_HJ_Fl-AiNsSSdO.d.ts → skillVersionStore-S4_HJ_Fl-5K8jrAg_.d.ts} +1 -1
- package/dist/testing.d.ts +88 -2
- package/dist/testing.js +1287 -1
- package/dist/toolSource-DMCTnSVg.js +743 -0
- package/dist/types-BXRIoabj.js +76 -0
- package/dist/types-DmcXN3qR-Dy7ZDstc.d.ts +265 -0
- package/dist/{types-wKp3YBSM-D7w-ZbsB.d.ts → types-wKp3YBSM-CSeFUL9R.d.ts} +1 -1
- package/dist/ui-react.css +2687 -0
- package/dist/ui-react.d.ts +1045 -5
- package/dist/ui-react.js +150 -30
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +1 -1
- package/package.json +17 -4
package/dist/ui-react.js
CHANGED
|
@@ -7,7 +7,7 @@ import minpath from "node:path";
|
|
|
7
7
|
import { fileURLToPath as urlToPath } from "node:url";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import * as React$10 from "react";
|
|
10
|
-
import React, { createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
10
|
+
import React, { createContext, createElement, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import * as ReactDOM from "react-dom";
|
|
13
13
|
import { flushSync } from "react-dom";
|
|
@@ -412,8 +412,8 @@ var ReactBridgeState = class {
|
|
|
412
412
|
/**
|
|
413
413
|
* 表单与宿主控件文案的注入口(FR-22.4 / 偏差 D-14 方向 A)。
|
|
414
414
|
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
415
|
+
* 嵌入套件是唯一持有文案的例外:它的宿主没有 chatbot 字典。
|
|
416
|
+
* 对照测试防止嵌入字典与 chatbot 的同名文案漂移;其它路径仍由宿主注入。
|
|
417
417
|
* 缺省值是英文,不注入时行为与改造前一致。
|
|
418
418
|
*/
|
|
419
419
|
const SurfaceFormTextsContext = createContext(DEFAULT_SURFACE_FORM_TEXTS);
|
|
@@ -747,6 +747,17 @@ function SurfaceDegradationNote({ degradations }) {
|
|
|
747
747
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SurfaceRejectionAlert, { degradations }), /* @__PURE__ */ jsx(SurfaceSimplifiedNote, { degradations })] });
|
|
748
748
|
}
|
|
749
749
|
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region ../ui-kit/src/i18n/createI18n.ts
|
|
752
|
+
const LocaleContext = createContext("en");
|
|
753
|
+
function LocaleProvider({ locale, children }) {
|
|
754
|
+
return createElement(LocaleContext.Provider, { value: locale }, children);
|
|
755
|
+
}
|
|
756
|
+
/** 当前 locale;未包 LocaleProvider 时默认 'en' */
|
|
757
|
+
function useLocale() {
|
|
758
|
+
return useContext(LocaleContext);
|
|
759
|
+
}
|
|
760
|
+
|
|
750
761
|
//#endregion
|
|
751
762
|
//#region ../../node_modules/.pnpm/lucide-react@1.27.0_react@19.2.8/node_modules/lucide-react/dist/cjs/lucide-react.js
|
|
752
763
|
/**
|
|
@@ -40767,6 +40778,32 @@ function useThemeValue() {
|
|
|
40767
40778
|
function usePortalContainer() {
|
|
40768
40779
|
return useContext(PortalContainerContext);
|
|
40769
40780
|
}
|
|
40781
|
+
/**
|
|
40782
|
+
* 渲染主题作用域容器。暗色下同时挂 `.dark` 与 `data-theme='dark'`:
|
|
40783
|
+
* 前者是 tailwind 变体的钩子,后者供不依赖 class 的消费方(图表、代码高亮)判定。
|
|
40784
|
+
* @experimental
|
|
40785
|
+
*/
|
|
40786
|
+
function ThemeScope({ theme, className = "", children, ref, ...props }) {
|
|
40787
|
+
const [portalContainer, setPortalContainer] = useState(void 0);
|
|
40788
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
40789
|
+
...props,
|
|
40790
|
+
ref,
|
|
40791
|
+
className: `${theme === "dark" ? "dark " : ""}${className}`,
|
|
40792
|
+
"data-webskill-theme": theme,
|
|
40793
|
+
"data-theme": theme,
|
|
40794
|
+
children: [/* @__PURE__ */ jsx(ThemeValueContext.Provider, {
|
|
40795
|
+
value: theme,
|
|
40796
|
+
children: /* @__PURE__ */ jsx(PortalContainerContext.Provider, {
|
|
40797
|
+
value: portalContainer,
|
|
40798
|
+
children
|
|
40799
|
+
})
|
|
40800
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
40801
|
+
ref: (node) => setPortalContainer(node ?? void 0),
|
|
40802
|
+
"data-webskill-portal-root": "",
|
|
40803
|
+
className: "fixed top-0 left-0 z-[var(--webskill-z-overlay)] h-0 w-0"
|
|
40804
|
+
})]
|
|
40805
|
+
});
|
|
40806
|
+
}
|
|
40770
40807
|
|
|
40771
40808
|
//#endregion
|
|
40772
40809
|
//#region ../../node_modules/.pnpm/@radix-ui+number@1.1.3/node_modules/@radix-ui/number/dist/index.mjs
|
|
@@ -135857,12 +135894,17 @@ function hasNoChoices(field) {
|
|
|
135857
135894
|
* `number` 那条不是可有可无的:数字框里打字母得到 `NaN`,而 `NaN` 不属于 `isBlank`,
|
|
135858
135895
|
* 过去能通过必填校验并原样提交出去。
|
|
135859
135896
|
*/
|
|
135860
|
-
|
|
135897
|
+
const REQUIRED_ERROR = "webskill.required";
|
|
135898
|
+
function validationMessage(message, texts) {
|
|
135899
|
+
if (typeof message !== "string") return void 0;
|
|
135900
|
+
return message === REQUIRED_ERROR ? texts.required : message;
|
|
135901
|
+
}
|
|
135902
|
+
function schemaOfField(field) {
|
|
135861
135903
|
const required = field["required"] === true;
|
|
135862
135904
|
const type = str(field, "type", "text");
|
|
135863
135905
|
if (hasNoChoices(field)) return z.unknown();
|
|
135864
135906
|
if (type === "number") {
|
|
135865
|
-
const base = z.number({ error:
|
|
135907
|
+
const base = z.number({ error: REQUIRED_ERROR }).refine((value) => !Number.isNaN(value), REQUIRED_ERROR);
|
|
135866
135908
|
return required ? base : z.union([
|
|
135867
135909
|
base,
|
|
135868
135910
|
z.undefined(),
|
|
@@ -135870,7 +135912,7 @@ function schemaOfField(field, texts) {
|
|
|
135870
135912
|
]);
|
|
135871
135913
|
}
|
|
135872
135914
|
if (type === "toggle") return z.unknown();
|
|
135873
|
-
const base = z.unknown().refine((value) => !isBlank(value),
|
|
135915
|
+
const base = z.unknown().refine((value) => !isBlank(value), REQUIRED_ERROR);
|
|
135874
135916
|
return required ? base : z.unknown();
|
|
135875
135917
|
}
|
|
135876
135918
|
/**
|
|
@@ -135949,11 +135991,10 @@ function useSurfaceForm({ surfaceId, spec, actions, runId, draft, onAction, onDr
|
|
|
135949
135991
|
scoping
|
|
135950
135992
|
]);
|
|
135951
135993
|
const schema = useMemo(() => z.object({
|
|
135952
|
-
...Object.fromEntries(registry.entries.map((entry) => [registry.nameOf.get(entry.key), schemaOfField(entry.field
|
|
135953
|
-
...Object.fromEntries(fieldArrays.map((array) => [arrayNames.get(array.key), z.array(z.object(Object.fromEntries(array.fields.map((f) => [String(f["name"]), schemaOfField(f
|
|
135994
|
+
...Object.fromEntries(registry.entries.map((entry) => [registry.nameOf.get(entry.key), schemaOfField(entry.field)])),
|
|
135995
|
+
...Object.fromEntries(fieldArrays.map((array) => [arrayNames.get(array.key), z.array(z.object(Object.fromEntries(array.fields.map((f) => [String(f["name"]), schemaOfField(f)]))))]))
|
|
135954
135996
|
}), [
|
|
135955
135997
|
registry,
|
|
135956
|
-
texts,
|
|
135957
135998
|
fieldArrays,
|
|
135958
135999
|
arrayNames
|
|
135959
136000
|
]);
|
|
@@ -136003,10 +136044,15 @@ function useSurfaceForm({ surfaceId, spec, actions, runId, draft, onAction, onDr
|
|
|
136003
136044
|
const out = {};
|
|
136004
136045
|
for (const [name, issue] of Object.entries(rhf.formState.errors)) {
|
|
136005
136046
|
const key = registry.keyOf.get(name);
|
|
136006
|
-
|
|
136047
|
+
const message = validationMessage(issue?.message, texts);
|
|
136048
|
+
if (key !== void 0 && message !== void 0) out[key] = message;
|
|
136007
136049
|
}
|
|
136008
136050
|
return out;
|
|
136009
|
-
}, [
|
|
136051
|
+
}, [
|
|
136052
|
+
registry,
|
|
136053
|
+
rhf.formState.errors,
|
|
136054
|
+
texts
|
|
136055
|
+
]);
|
|
136010
136056
|
/**
|
|
136011
136057
|
* `visibleWhen` 求值(FR-23.1)。条件里的字段名按同一作用域限定,
|
|
136012
136058
|
* 否则两个 Form 里的同名字段会互相控制对方的显隐。
|
|
@@ -136099,8 +136145,7 @@ function useSurfaceForm({ surfaceId, spec, actions, runId, draft, onAction, onDr
|
|
|
136099
136145
|
rhf.clearErrors(name);
|
|
136100
136146
|
},
|
|
136101
136147
|
errorAt: (name) => {
|
|
136102
|
-
|
|
136103
|
-
return typeof message === "string" ? message : void 0;
|
|
136148
|
+
return validationMessage(name.split(".").reduce((current, part) => current?.[part], rhf.formState.errors)?.message, texts);
|
|
136104
136149
|
},
|
|
136105
136150
|
fieldArray: (key) => fieldArrays.find((array) => array.key === key),
|
|
136106
136151
|
resolveActionId,
|
|
@@ -136357,6 +136402,7 @@ function SurfaceFieldArray({ form, props, scope }) {
|
|
|
136357
136402
|
function SurfaceFormButtons({ form, props, scope }) {
|
|
136358
136403
|
const submitId = scope ? scope.submitActionId : form.resolveActionId("submit");
|
|
136359
136404
|
const cancelId = scope ? scope.cancelActionId : form.resolveActionId("cancel");
|
|
136405
|
+
const texts = useSurfaceFormTexts();
|
|
136360
136406
|
return /* @__PURE__ */ jsxs("div", {
|
|
136361
136407
|
className: "flex flex-wrap items-center justify-end gap-2",
|
|
136362
136408
|
children: [props["cancelLabel"] ? /* @__PURE__ */ jsx(Button, {
|
|
@@ -136370,7 +136416,7 @@ function SurfaceFormButtons({ form, props, scope }) {
|
|
|
136370
136416
|
type: "submit",
|
|
136371
136417
|
size: "sm",
|
|
136372
136418
|
"data-webskill-surface-action": submitId,
|
|
136373
|
-
children: str(props, "submitLabel",
|
|
136419
|
+
children: str(props, "submitLabel", texts.submit)
|
|
136374
136420
|
})]
|
|
136375
136421
|
});
|
|
136376
136422
|
}
|
|
@@ -136493,6 +136539,7 @@ function SpecTimeline({ props }) {
|
|
|
136493
136539
|
function SpecProgress({ props }) {
|
|
136494
136540
|
const value = Math.max(0, Math.min(100, num(props, "value", 0)));
|
|
136495
136541
|
const label = str(props, "label");
|
|
136542
|
+
const locale = useLocale();
|
|
136496
136543
|
return /* @__PURE__ */ jsxs("div", {
|
|
136497
136544
|
className: "flex flex-col gap-1",
|
|
136498
136545
|
children: [label ? /* @__PURE__ */ jsx("span", {
|
|
@@ -136500,7 +136547,7 @@ function SpecProgress({ props }) {
|
|
|
136500
136547
|
children: label
|
|
136501
136548
|
}) : null, /* @__PURE__ */ jsx("div", {
|
|
136502
136549
|
role: "progressbar",
|
|
136503
|
-
"aria-label": label || "Progress",
|
|
136550
|
+
"aria-label": label || (locale === "zh" ? "进度" : "Progress"),
|
|
136504
136551
|
"aria-valuenow": value,
|
|
136505
136552
|
"aria-valuemin": 0,
|
|
136506
136553
|
"aria-valuemax": 100,
|
|
@@ -136612,6 +136659,7 @@ function SpecKeyValue({ props }) {
|
|
|
136612
136659
|
});
|
|
136613
136660
|
}
|
|
136614
136661
|
function SpecGauge({ props }) {
|
|
136662
|
+
const locale = useLocale();
|
|
136615
136663
|
const min = num(props, "min", 0);
|
|
136616
136664
|
const max = num(props, "max", 100);
|
|
136617
136665
|
const value = num(props, "value", min);
|
|
@@ -136627,7 +136675,7 @@ function SpecGauge({ props }) {
|
|
|
136627
136675
|
}) : null,
|
|
136628
136676
|
/* @__PURE__ */ jsx("div", {
|
|
136629
136677
|
role: "meter",
|
|
136630
|
-
"aria-label": label || "Gauge",
|
|
136678
|
+
"aria-label": label || (locale === "zh" ? "仪表" : "Gauge"),
|
|
136631
136679
|
"aria-valuenow": value,
|
|
136632
136680
|
"aria-valuemin": min,
|
|
136633
136681
|
"aria-valuemax": max,
|
|
@@ -136751,6 +136799,10 @@ const TONE_CLASS = {
|
|
|
136751
136799
|
info: "text-info",
|
|
136752
136800
|
destructive: "text-destructive"
|
|
136753
136801
|
};
|
|
136802
|
+
const FILE_LINK_TEXTS = {
|
|
136803
|
+
en: "Download",
|
|
136804
|
+
zh: "下载"
|
|
136805
|
+
};
|
|
136754
136806
|
function renderNode(node, context, key, scope) {
|
|
136755
136807
|
const props = node.props ?? {};
|
|
136756
136808
|
const nodeScope = node.component === "Form" ? context.scopeOfNode(node) : scope;
|
|
@@ -136813,7 +136865,7 @@ function renderNode(node, context, key, scope) {
|
|
|
136813
136865
|
return /* @__PURE__ */ jsx(SpecTable, {
|
|
136814
136866
|
columns,
|
|
136815
136867
|
rows,
|
|
136816
|
-
label: str(props, "title", "Data"),
|
|
136868
|
+
label: str(props, "title", context.locale === "zh" ? "数据" : "Data"),
|
|
136817
136869
|
...columnWidths ? { columnWidths } : {}
|
|
136818
136870
|
}, key);
|
|
136819
136871
|
}
|
|
@@ -136851,7 +136903,7 @@ function renderNode(node, context, key, scope) {
|
|
|
136851
136903
|
variant: "secondary",
|
|
136852
136904
|
"data-webskill-surface-action": context.resolveActionId("download", node.id),
|
|
136853
136905
|
onClick: () => context.emit(context.resolveActionId("download", node.id)),
|
|
136854
|
-
children: str(props, "label",
|
|
136906
|
+
children: str(props, "label", FILE_LINK_TEXTS[context.locale])
|
|
136855
136907
|
})]
|
|
136856
136908
|
}, key);
|
|
136857
136909
|
case "Form": return /* @__PURE__ */ jsxs("form", {
|
|
@@ -136958,6 +137010,7 @@ function NativeSpecSurface({ surfaceId, spec, actions, registry, runId, draft, o
|
|
|
136958
137010
|
});
|
|
136959
137011
|
const context = {
|
|
136960
137012
|
...form,
|
|
137013
|
+
locale: useLocale(),
|
|
136961
137014
|
registry,
|
|
136962
137015
|
onAction,
|
|
136963
137016
|
documentSurface,
|
|
@@ -137080,11 +137133,16 @@ const CatalogSurfaceContext = createContext(void 0);
|
|
|
137080
137133
|
/**
|
|
137081
137134
|
* 文档投放面在 json-render / openui 两档里的能力缺失说明(0.15.0 分册 13 §3.3)。
|
|
137082
137135
|
*
|
|
137083
|
-
*
|
|
137084
|
-
*
|
|
137085
|
-
* AC-13.9 要求双语的是按钮文案,那一条走 `SurfaceFormTexts`,两者不冲突。
|
|
137136
|
+
* 嵌入套件内按宿主语言显示;其它组件缺依赖的诊断仍保持英文。
|
|
137137
|
+
* AC-13.9 的按钮文案走 `SurfaceFormTexts`,两者不冲突。
|
|
137086
137138
|
*/
|
|
137087
|
-
|
|
137139
|
+
function CatalogOpenDocument() {
|
|
137140
|
+
return /* @__PURE__ */ jsx("div", {
|
|
137141
|
+
role: "alert",
|
|
137142
|
+
className: "text-sm text-destructive",
|
|
137143
|
+
children: useLocale() === "zh" ? "当前渲染器不支持文档投放" : "Document surface is not supported by this renderer"
|
|
137144
|
+
});
|
|
137145
|
+
}
|
|
137088
137146
|
function useCatalogSurfaceForm() {
|
|
137089
137147
|
const form = useContext(CatalogSurfaceContext);
|
|
137090
137148
|
if (!form) throw new WebSkillError("UI_UNAVAILABLE", "Catalog surface components must be rendered inside a CatalogSurfaceProvider");
|
|
@@ -137257,7 +137315,7 @@ const catalogComponentImpls = {
|
|
|
137257
137315
|
const columns = Array.isArray(props["columns"]) ? props["columns"] : [];
|
|
137258
137316
|
const rows = Array.isArray(props["rows"]) ? props["rows"] : [];
|
|
137259
137317
|
return /* @__PURE__ */ jsxs(DataTable, {
|
|
137260
|
-
"aria-label": str(props, "title", "Data"),
|
|
137318
|
+
"aria-label": str(props, "title", useLocale() === "zh" ? "数据" : "Data"),
|
|
137261
137319
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
137262
137320
|
className: "webskill-surface__table-header",
|
|
137263
137321
|
children: /* @__PURE__ */ jsx("tr", { children: columns.map((column) => /* @__PURE__ */ jsx("th", {
|
|
@@ -137315,11 +137373,7 @@ const catalogComponentImpls = {
|
|
|
137315
137373
|
className: "text-sm text-destructive",
|
|
137316
137374
|
children: ["Unsupported registered surface: ", str(props, "name")]
|
|
137317
137375
|
}),
|
|
137318
|
-
OpenDocument:
|
|
137319
|
-
role: "alert",
|
|
137320
|
-
className: "text-sm text-destructive",
|
|
137321
|
-
children: DOCUMENT_SURFACE_UNSUPPORTED
|
|
137322
|
-
})
|
|
137376
|
+
OpenDocument: CatalogOpenDocument
|
|
137323
137377
|
};
|
|
137324
137378
|
|
|
137325
137379
|
//#endregion
|
|
@@ -140019,7 +140073,7 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
140019
140073
|
const [unavailable, setUnavailable] = useState(false);
|
|
140020
140074
|
useEffect(() => {
|
|
140021
140075
|
let cancelled = false;
|
|
140022
|
-
import("./openUiLibrary-
|
|
140076
|
+
import("./openUiLibrary-BjRDYyTe.js").then((loaded) => {
|
|
140023
140077
|
if (!cancelled) setModule(loaded);
|
|
140024
140078
|
}).catch(() => {
|
|
140025
140079
|
if (!cancelled) setUnavailable(true);
|
|
@@ -140058,4 +140112,70 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
140058
140112
|
}
|
|
140059
140113
|
|
|
140060
140114
|
//#endregion
|
|
140061
|
-
|
|
140115
|
+
//#region ../ui-react/src/embed/texts.ts
|
|
140116
|
+
const EMBED_FORM_TEXTS = {
|
|
140117
|
+
en: {
|
|
140118
|
+
required: "This field is required",
|
|
140119
|
+
submit: "Submit",
|
|
140120
|
+
cancel: "Cancel",
|
|
140121
|
+
addItem: "Add",
|
|
140122
|
+
removeItem: "Remove",
|
|
140123
|
+
arrayFirstItemOnly: "This renderer shows only the first item of a repeatable group.",
|
|
140124
|
+
readOnlySnapshot: "This is a saved record — its actions are no longer available.",
|
|
140125
|
+
suggested: "Suggested:",
|
|
140126
|
+
useSuggestion: "Use",
|
|
140127
|
+
openDocument: "Open document",
|
|
140128
|
+
noOptions: "No options are available for this field."
|
|
140129
|
+
},
|
|
140130
|
+
zh: {
|
|
140131
|
+
required: "该字段为必填项",
|
|
140132
|
+
submit: "提交",
|
|
140133
|
+
cancel: "取消",
|
|
140134
|
+
addItem: "添加",
|
|
140135
|
+
removeItem: "移除",
|
|
140136
|
+
arrayFirstItemOnly: "当前渲染档只显示重复组的第一项。",
|
|
140137
|
+
readOnlySnapshot: "这是已保存的记录,其中的操作已不可用。",
|
|
140138
|
+
suggested: "建议:",
|
|
140139
|
+
useSuggestion: "使用",
|
|
140140
|
+
openDocument: "打开文档",
|
|
140141
|
+
noOptions: "该字段没有可选项。"
|
|
140142
|
+
}
|
|
140143
|
+
};
|
|
140144
|
+
const EMBED_CONTROL_TEXTS = {
|
|
140145
|
+
en: {
|
|
140146
|
+
previousPage: "Previous page",
|
|
140147
|
+
previous: "Previous",
|
|
140148
|
+
nextPage: "Next page",
|
|
140149
|
+
next: "Next",
|
|
140150
|
+
carousel: "Carousel"
|
|
140151
|
+
},
|
|
140152
|
+
zh: {
|
|
140153
|
+
previousPage: "上一页",
|
|
140154
|
+
previous: "上一页",
|
|
140155
|
+
nextPage: "下一页",
|
|
140156
|
+
next: "下一页",
|
|
140157
|
+
carousel: "轮播"
|
|
140158
|
+
}
|
|
140159
|
+
};
|
|
140160
|
+
|
|
140161
|
+
//#endregion
|
|
140162
|
+
//#region ../ui-react/src/embed/EmbedScope.tsx
|
|
140163
|
+
/** @experimental */
|
|
140164
|
+
function EmbedScope({ theme, locale, className, children }) {
|
|
140165
|
+
return /* @__PURE__ */ jsx(ThemeScope, {
|
|
140166
|
+
theme,
|
|
140167
|
+
className,
|
|
140168
|
+
"data-webskill-embed": "",
|
|
140169
|
+
children: /* @__PURE__ */ jsx(LocaleProvider, {
|
|
140170
|
+
locale,
|
|
140171
|
+
children: /* @__PURE__ */ jsx(SurfaceFormTextsProvider, {
|
|
140172
|
+
texts: EMBED_FORM_TEXTS[locale],
|
|
140173
|
+
hostControlTexts: EMBED_CONTROL_TEXTS[locale],
|
|
140174
|
+
children
|
|
140175
|
+
})
|
|
140176
|
+
})
|
|
140177
|
+
});
|
|
140178
|
+
}
|
|
140179
|
+
|
|
140180
|
+
//#endregion
|
|
140181
|
+
export { ChartColorsProvider, ChartFontSizesProvider, EmbedScope, InteractionForm, JsonRenderSpecSurface, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, OpenUiSpecSurface, ReactBridgeState, ResultBlocks, SpecInteractionChannel, StreamingText, SurfaceFormTextsProvider, SurfaceRegistry, UiSurfaceList, UiSurfaceSnapshotList, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability, CatalogNode as t, useChartColors, useChartFontSizes, usePortalContainer, 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-wKp3YBSM-
|
|
1
|
+
import { S as UiBridge, b as RenderResultRequest, c as InteractionResponse, s as InteractionRequest } from "./types-wKp3YBSM-CSeFUL9R.js";
|
|
2
2
|
import { PropType } from "vue";
|
|
3
3
|
//#region ../ui-vue/dist/index.d.ts
|
|
4
4
|
//#region src/bridgeState.d.ts
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nt as UiSpecNode } from "./types-wKp3YBSM-
|
|
2
|
-
import { Cr as buildRenderResult } from "./index-
|
|
3
|
-
import { $ as SPEC_TABLE_MIN_COLUMN_WIDTH, $t as fromA2uiSpecAction, A as DocumentComponentName, An as toJsonRenderSpec, At as ViewerComponentsOptions, B as FieldOption, Bt as buildA2uiCatalogDefinition, C as DEFAULT_CHART_COLORS, Cn as resolveSurfaceFormTexts, Ct as VERCEL_INTERACTION_TOOL_NAME, D as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, Dn as toA2uiSpecMessages, Dt as VercelToolInvocation, E as DEFAULT_SURFACE_FORM_TEXTS, En as shapeInteractionValue, Et as VIEWER_PROPS_ATTR, F as EchartOptionDegradation, Fn as uiPreset, Ft as ZodRuntime, G as LoadedOpenUiPeers, Gt as collectScopedValues, H as InteractionSpecLabels, Ht as chartSpecFromProps, I as EchartOptionHandle, It as a2uiComponentSchema, J as OpenUiRendererProps, Jt as createUiCatalogToolSource, K as MAX_CONDITION_DEPTH, Kt as collectSpecActions, L as EvaluateFieldConditionOptions, Lt as a2uiComponentShapes, M as EchartFallback, Mn as toUiSurfaceActionDispatch, Mt as WEBSKILL_STYLES_CSS, N as EchartHandle, Nn as toVercelToolInvocation, Nt as WEBSKILL_SURFACE_ACTION, O as DESCRIBE_UI_PRESET_TOOL, On as toA2uiSurfaceAction, Ot as VercelUiBridge, P as EchartOption, Pn as uiCatalog, Pt as WebFormBridge, Q as SPEC_TABLE_MIN_COLUMN_VAR, Qt as evaluateFieldCondition, R as FieldCondition, Rt as applyEchartTheme, S as ControlModel, Sn as resolveInteractionTexts, St as UiSurfaceActionDispatch, T as DEFAULT_INTERACTION_TEXTS, Tn as sanitizeEchartOption, Tt as VIEWER_FALLBACK_ATTR, U as InteractionTexts, Ut as chartToTable, V as FormModel, Vt as chartSpecFromEchartsOption, W as JsonRenderSpec, Wt as collectFormScopes, X as PLANNED_INCREMENT, Xt as echartOptionFromProps, Y as OpenUiRuntime, Yt as defineUiCatalog, Z as RENDER_UI_TOOL, Zt as ensureStyles, _ as CHART_PALETTE, _n as renderMiniMarkdown, _t as UiSpecDegradation, a as A2UI_SURFACE_ACTION, an as interactionToUiSpec, at as UI_CATALOG_PROMPT_BUDGET_BYTES, b as CollectedValues, bn as resolveChartFontSizes, bt as UiSpecSanitization, c as A2uiCatalogDefinition, cn as mountEchart, ct as UiActionDef, d as A2uiMessage, dn as normalizeColumnWidths, dt as UiCatalogPromptOptions, en as fromA2uiSurfaceAction, et as SanitizedEchartOption, f as A2uiSpecActionEvent, fn as normalizeFieldOptions, ft as UiCatalogToolSourceOptions, g as CATALOG_SCHEMA_MAX, gn as renderMiniChart, gt as UiPresetName, h as CATALOG_PROMPT_MAX, hn as renderEchartFallback, ht as UiPreset, i as A2UI_SPEC_FORM_PATH, in as interactionToFormModel, it as UI_CATALOG_GROUPS, j as ECHART_SERIES_TYPES, jn as toOpenUiSpecLang, jt as WEBSKILL_A2UI_CATALOG_ID, k as DOCUMENT_COMPONENTS, kn as toEchartsOption, kt as ViewerComponentsHandle, l as A2uiCatalogHandle, ln as mountEchartOption, lt as UiCatalog, m as CATALOG_BUDGET_STAGE, mn as renderBlocks, mt as UiFormScope, n as A2UI_COMMON_TYPES, nn as fromVercelToolResult, nt as SurfaceFormTexts, o as A2UI_VERSION, on as loadOpenUiPeers, ot as UI_PRESETS, p as A2uiSpecMessageOptions, pn as qualifyFieldName, pt as UiComponentDef, q as NormalizedColumnWidths, qt as collectValues, r as A2UI_SPEC_ACTION, rn as gaugePercent, rt as SurfaceHostControlTexts, s as A2uiCatalogComponent, sn as loadWebSkillLitCatalog, st as UI_PRESET_NAMES, t as A2UI_BASIC_CATALOG_ID, tn as fromUiSurfaceActionDispatch, tt as SpecColumnMeta, u as A2uiComponentShape, un as mountViewerComponents, ut as UiCatalogInput, v as ChartColors, vn as renderRenderResult, vt as UiSpecDegradationCode, w as DEFAULT_CHART_FONT_SIZES, wn as resolveSurfaceHostControlTexts, wt as VIEWER_COMPONENT_ATTR, x as ColumnWidthsRejection, xn as resolveColumnWidths, xt as UiSpecValidation, y as ChartFontSizes, yn as resolveChartColors, yt as UiSpecIssue, z as FieldConditionResult, zt as applySuggestion } from "./index-
|
|
1
|
+
import { Nt as UiSpecNode } from "./types-wKp3YBSM-CSeFUL9R.js";
|
|
2
|
+
import { Cr as buildRenderResult } from "./index-UbNuzd2a.js";
|
|
3
|
+
import { $ as SPEC_TABLE_MIN_COLUMN_WIDTH, $t as fromA2uiSpecAction, A as DocumentComponentName, An as toJsonRenderSpec, At as ViewerComponentsOptions, B as FieldOption, Bt as buildA2uiCatalogDefinition, C as DEFAULT_CHART_COLORS, Cn as resolveSurfaceFormTexts, Ct as VERCEL_INTERACTION_TOOL_NAME, D as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, Dn as toA2uiSpecMessages, Dt as VercelToolInvocation, E as DEFAULT_SURFACE_FORM_TEXTS, En as shapeInteractionValue, Et as VIEWER_PROPS_ATTR, F as EchartOptionDegradation, Fn as uiPreset, Ft as ZodRuntime, G as LoadedOpenUiPeers, Gt as collectScopedValues, H as InteractionSpecLabels, Ht as chartSpecFromProps, I as EchartOptionHandle, It as a2uiComponentSchema, J as OpenUiRendererProps, Jt as createUiCatalogToolSource, K as MAX_CONDITION_DEPTH, Kt as collectSpecActions, L as EvaluateFieldConditionOptions, Lt as a2uiComponentShapes, M as EchartFallback, Mn as toUiSurfaceActionDispatch, Mt as WEBSKILL_STYLES_CSS, N as EchartHandle, Nn as toVercelToolInvocation, Nt as WEBSKILL_SURFACE_ACTION, O as DESCRIBE_UI_PRESET_TOOL, On as toA2uiSurfaceAction, Ot as VercelUiBridge, P as EchartOption, Pn as uiCatalog, Pt as WebFormBridge, Q as SPEC_TABLE_MIN_COLUMN_VAR, Qt as evaluateFieldCondition, R as FieldCondition, Rt as applyEchartTheme, S as ControlModel, Sn as resolveInteractionTexts, St as UiSurfaceActionDispatch, T as DEFAULT_INTERACTION_TEXTS, Tn as sanitizeEchartOption, Tt as VIEWER_FALLBACK_ATTR, U as InteractionTexts, Ut as chartToTable, V as FormModel, Vt as chartSpecFromEchartsOption, W as JsonRenderSpec, Wt as collectFormScopes, X as PLANNED_INCREMENT, Xt as echartOptionFromProps, Y as OpenUiRuntime, Yt as defineUiCatalog, Z as RENDER_UI_TOOL, Zt as ensureStyles, _ as CHART_PALETTE, _n as renderMiniMarkdown, _t as UiSpecDegradation, a as A2UI_SURFACE_ACTION, an as interactionToUiSpec, at as UI_CATALOG_PROMPT_BUDGET_BYTES, b as CollectedValues, bn as resolveChartFontSizes, bt as UiSpecSanitization, c as A2uiCatalogDefinition, cn as mountEchart, ct as UiActionDef, d as A2uiMessage, dn as normalizeColumnWidths, dt as UiCatalogPromptOptions, en as fromA2uiSurfaceAction, et as SanitizedEchartOption, f as A2uiSpecActionEvent, fn as normalizeFieldOptions, ft as UiCatalogToolSourceOptions, g as CATALOG_SCHEMA_MAX, gn as renderMiniChart, gt as UiPresetName, h as CATALOG_PROMPT_MAX, hn as renderEchartFallback, ht as UiPreset, i as A2UI_SPEC_FORM_PATH, in as interactionToFormModel, it as UI_CATALOG_GROUPS, j as ECHART_SERIES_TYPES, jn as toOpenUiSpecLang, jt as WEBSKILL_A2UI_CATALOG_ID, k as DOCUMENT_COMPONENTS, kn as toEchartsOption, kt as ViewerComponentsHandle, l as A2uiCatalogHandle, ln as mountEchartOption, lt as UiCatalog, m as CATALOG_BUDGET_STAGE, mn as renderBlocks, mt as UiFormScope, n as A2UI_COMMON_TYPES, nn as fromVercelToolResult, nt as SurfaceFormTexts, o as A2UI_VERSION, on as loadOpenUiPeers, ot as UI_PRESETS, p as A2uiSpecMessageOptions, pn as qualifyFieldName, pt as UiComponentDef, q as NormalizedColumnWidths, qt as collectValues, r as A2UI_SPEC_ACTION, rn as gaugePercent, rt as SurfaceHostControlTexts, s as A2uiCatalogComponent, sn as loadWebSkillLitCatalog, st as UI_PRESET_NAMES, t as A2UI_BASIC_CATALOG_ID, tn as fromUiSurfaceActionDispatch, tt as SpecColumnMeta, u as A2uiComponentShape, un as mountViewerComponents, ut as UiCatalogInput, v as ChartColors, vn as renderRenderResult, vt as UiSpecDegradationCode, w as DEFAULT_CHART_FONT_SIZES, wn as resolveSurfaceHostControlTexts, wt as VIEWER_COMPONENT_ATTR, x as ColumnWidthsRejection, xn as resolveColumnWidths, xt as UiSpecValidation, y as ChartFontSizes, yn as resolveChartColors, yt as UiSpecIssue, z as FieldConditionResult, zt as applySuggestion } from "./index-1ASrUwzn.js";
|
|
4
4
|
export { A2UI_BASIC_CATALOG_ID, A2UI_COMMON_TYPES, A2UI_SPEC_ACTION, A2UI_SPEC_FORM_PATH, A2UI_SURFACE_ACTION, A2UI_VERSION, type A2uiCatalogComponent, type A2uiCatalogDefinition, type A2uiCatalogHandle, type A2uiComponentShape, type A2uiMessage, type A2uiSpecActionEvent, type A2uiSpecMessageOptions, CATALOG_BUDGET_STAGE, CATALOG_PROMPT_MAX, CATALOG_SCHEMA_MAX, CHART_PALETTE, type ChartColors, type ChartFontSizes, type CollectedValues, type ColumnWidthsRejection, type ControlModel, DEFAULT_CHART_COLORS, DEFAULT_CHART_FONT_SIZES, DEFAULT_INTERACTION_TEXTS, DEFAULT_SURFACE_FORM_TEXTS, DEFAULT_SURFACE_HOST_CONTROL_TEXTS, DESCRIBE_UI_PRESET_TOOL, DOCUMENT_COMPONENTS, type DocumentComponentName, ECHART_SERIES_TYPES, type EchartFallback, type EchartHandle, type EchartOption, type EchartOptionDegradation, type EchartOptionHandle, type EvaluateFieldConditionOptions, type FieldCondition, type FieldConditionResult, type FieldOption, type FormModel, type InteractionSpecLabels, type InteractionTexts, type JsonRenderSpec, type LoadedOpenUiPeers, MAX_CONDITION_DEPTH, type NormalizedColumnWidths, type OpenUiRendererProps, type OpenUiRuntime, PLANNED_INCREMENT, RENDER_UI_TOOL, SPEC_TABLE_MIN_COLUMN_VAR, SPEC_TABLE_MIN_COLUMN_WIDTH, type SanitizedEchartOption, type SpecColumnMeta, type SurfaceFormTexts, type SurfaceHostControlTexts, UI_CATALOG_GROUPS, UI_CATALOG_PROMPT_BUDGET_BYTES, UI_PRESETS, UI_PRESET_NAMES, type UiActionDef, type UiCatalog, type UiCatalogInput, type UiCatalogPromptOptions, type UiCatalogToolSourceOptions, type UiComponentDef, type UiFormScope, type UiPreset, type UiPresetName, type UiSpecDegradation, type UiSpecDegradationCode, type UiSpecIssue, type UiSpecNode, type UiSpecSanitization, type UiSpecValidation, type UiSurfaceActionDispatch, VERCEL_INTERACTION_TOOL_NAME, VIEWER_COMPONENT_ATTR, VIEWER_FALLBACK_ATTR, VIEWER_PROPS_ATTR, type VercelToolInvocation, VercelUiBridge, type ViewerComponentsHandle, type ViewerComponentsOptions, WEBSKILL_A2UI_CATALOG_ID, WEBSKILL_STYLES_CSS, WEBSKILL_SURFACE_ACTION, WebFormBridge, type ZodRuntime, a2uiComponentSchema, a2uiComponentShapes, applyEchartTheme, applySuggestion, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromEchartsOption, chartSpecFromProps, chartToTable, collectFormScopes, collectScopedValues, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, echartOptionFromProps, ensureStyles, evaluateFieldCondition, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, gaugePercent, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, mountEchartOption, mountViewerComponents, normalizeColumnWidths, normalizeFieldOptions, qualifyFieldName, renderBlocks, renderEchartFallback, renderMiniChart, renderMiniMarkdown, renderRenderResult, resolveChartColors, resolveChartFontSizes, resolveColumnWidths, resolveInteractionTexts, resolveSurfaceFormTexts, resolveSurfaceHostControlTexts, sanitizeEchartOption, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toEchartsOption, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
package/dist/ui.js
CHANGED
|
@@ -1257,7 +1257,7 @@ async function loadWebSkillLitCatalog() {
|
|
|
1257
1257
|
*/
|
|
1258
1258
|
async function loadOpenUiPeers() {
|
|
1259
1259
|
try {
|
|
1260
|
-
const [openuiModule, zodModule] = await Promise.all([import("./dist-
|
|
1260
|
+
const [openuiModule, zodModule] = await Promise.all([import("./dist-Ww6TChcf.js"), import("zod")]);
|
|
1261
1261
|
return {
|
|
1262
1262
|
openui: openuiModule,
|
|
1263
1263
|
z: zodModule.z
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webskill/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0-next.1",
|
|
4
4
|
"description": "WebSkill — browser/Node agent skill runtime (skills, tools, MCP, governance, UI)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -48,6 +48,11 @@
|
|
|
48
48
|
"types": "./dist/testing.d.ts",
|
|
49
49
|
"import": "./dist/testing.js"
|
|
50
50
|
},
|
|
51
|
+
"./controller": {
|
|
52
|
+
"types": "./dist/controller.d.ts",
|
|
53
|
+
"import": "./dist/controller.js"
|
|
54
|
+
},
|
|
55
|
+
"./ui-react.css": "./dist/ui-react.css",
|
|
51
56
|
"./package.json": "./package.json"
|
|
52
57
|
},
|
|
53
58
|
"files": [
|
|
@@ -56,13 +61,14 @@
|
|
|
56
61
|
"publishConfig": {
|
|
57
62
|
"access": "public"
|
|
58
63
|
},
|
|
59
|
-
"sideEffects":
|
|
64
|
+
"sideEffects": ["*.css"],
|
|
60
65
|
"scripts": {
|
|
61
66
|
"prebuild": "node ../../scripts/syncVersionConstant.mjs sdk",
|
|
62
|
-
"build": "tsdown",
|
|
67
|
+
"build": "tsdown && tailwindcss -i ../ui-react/src/embed.css -o dist/ui-react.raw.css && node ../../scripts/scopeEmbedCss.mjs dist/ui-react.raw.css dist/ui-react.css",
|
|
63
68
|
"typecheck": "tsc --noEmit"
|
|
64
69
|
},
|
|
65
70
|
"dependencies": {
|
|
71
|
+
"@cfworker/json-schema": "4.1.6",
|
|
66
72
|
"@e965/xlsx": "0.20.3",
|
|
67
73
|
"fflate": "0.8.3",
|
|
68
74
|
"saxes": "6.0.0",
|
|
@@ -76,7 +82,8 @@
|
|
|
76
82
|
"react": ">=19.0.0",
|
|
77
83
|
"react-dom": ">=19.0.0",
|
|
78
84
|
"tar": ">=7.5.0",
|
|
79
|
-
"vue": ">=3.5.0"
|
|
85
|
+
"vue": ">=3.5.0",
|
|
86
|
+
"ws": ">=8.0.0"
|
|
80
87
|
},
|
|
81
88
|
"peerDependenciesMeta": {
|
|
82
89
|
"react": {
|
|
@@ -96,12 +103,17 @@
|
|
|
96
103
|
},
|
|
97
104
|
"tar": {
|
|
98
105
|
"optional": true
|
|
106
|
+
},
|
|
107
|
+
"ws": {
|
|
108
|
+
"optional": true
|
|
99
109
|
}
|
|
100
110
|
},
|
|
101
111
|
"devDependencies": {
|
|
112
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
102
113
|
"@types/node": "24.13.3",
|
|
103
114
|
"@webskill/agent": "workspace:*",
|
|
104
115
|
"@webskill/browser": "workspace:*",
|
|
116
|
+
"@webskill/controller": "workspace:*",
|
|
105
117
|
"@webskill/core": "workspace:*",
|
|
106
118
|
"@webskill/governance": "workspace:*",
|
|
107
119
|
"@webskill/mcp": "workspace:*",
|
|
@@ -111,6 +123,7 @@
|
|
|
111
123
|
"@webskill/ui-kit": "workspace:*",
|
|
112
124
|
"@webskill/ui-react": "workspace:*",
|
|
113
125
|
"@webskill/ui-vue": "workspace:*",
|
|
126
|
+
"tailwindcss": "^4.3.3",
|
|
114
127
|
"tsdown": "0.22.13",
|
|
115
128
|
"typescript": "6.0.3"
|
|
116
129
|
}
|