@webskill/sdk 0.6.0 → 0.8.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/agent.d.ts +2 -2
- package/dist/agent.js +218 -28
- package/dist/browser.d.ts +177 -4
- package/dist/browser.js +444 -35
- package/dist/{catalogComponents-Dr5dFMAb-Dacibl1e.js → catalogComponents-DfxxfUvn-D55Gbb2l.js} +4016 -1226
- package/dist/{dist-8oQRa8Xz.js → dist-59XlqDuv.js} +93 -6
- package/dist/{dist-DnYG2-eY.js → dist-CJqQsIm9.js} +498 -118
- package/dist/{dist-DusANsrn.js → dist-DmI5SBBF.js} +437 -55
- package/dist/eventTypes-g1BXL6x5-CibcOftR.js +37 -0
- package/dist/governance.d.ts +91 -11
- package/dist/governance.js +194 -52
- package/dist/{index-C-KFAZoF.d.ts → index-K-eewlGL.d.ts} +176 -75
- package/dist/{index-BMocOEi0.d.ts → index-P9J2LTfU.d.ts} +163 -6
- package/dist/{index-BuTpBMzr.d.ts → index-fLskQfAS.d.ts} +156 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/mcp.d.ts +129 -6
- package/dist/mcp.js +235 -28
- package/dist/{memoryArtifactStore-52Zn9npI-BMPYwvoy.js → memoryArtifactStore-52Zn9npI-upv5OWYf.js} +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +4 -3
- package/dist/{openUiLibrary-Bdrji9qK-DzAxRlTY.js → openUiLibrary-DURlAxjk-CU6AzfSW.js} +3 -3
- package/dist/{skillVersionStore-BzLbzFOL-CxdAFWO2.d.ts → skillVersionStore-Bl-ElD45-gRfSaAby.d.ts} +8 -2
- package/dist/{testing-CYTFqkDm.js → testing-BCUO5gZR.js} +2 -2
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +2 -2
- package/dist/{types-4pg-qp_I-Gq63X8Oa.d.ts → types-B3n0cMZu-BdcqQ35O.d.ts} +74 -7
- package/dist/ui-react.d.ts +16 -7
- package/dist/ui-react.js +159 -108
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +2 -2
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +3 -3
- package/dist/{webskillLitCatalog-_mugzRHx-B_54vxum.js → webskillLitCatalog-DwTwSBFt-DiXXpNZA.js} +22 -3
- package/package.json +2 -2
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import {
|
|
1
|
+
import { C as UiSpecDrafts, D as UiSurfaceActionRequest, E as UiSpecSnapshot, O as UiSurfaceActionResponse, S as UiSpecActionCapability, c as InteractionResponse, s as InteractionRequest, vt as UiSpecNode, w as UiSpecEvent, x as UiBridge, y as RenderResultRequest } from "./types-B3n0cMZu-BdcqQ35O.js";
|
|
2
|
+
import { E as InteractionSpecLabels, R as SurfaceFormTexts } from "./index-P9J2LTfU.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { ComponentType, ReactNode } from "react";
|
|
4
|
+
import React$1, { ComponentType, ReactNode } from "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
//#region ../../node_modules/.pnpm/@json-render+core@0.19.0_zod@4.4.3/node_modules/@json-render/core/dist/store-utils-D98Czbil.d.ts
|
|
7
7
|
/**
|
|
@@ -410,6 +410,8 @@ interface NativeSpecSurfaceProps {
|
|
|
410
410
|
surfaceId: string;
|
|
411
411
|
value: Record<string, unknown>;
|
|
412
412
|
}): void;
|
|
413
|
+
/** 宿主已提供卡片外壳时传 `'none'`,避免嵌套两层卡片。缺省 `'card'`。 */
|
|
414
|
+
shell?: 'card' | 'none';
|
|
413
415
|
}
|
|
414
416
|
/**
|
|
415
417
|
* Native 档的 catalog registry:把声明树渲染成 ui-kit 组件。
|
|
@@ -418,7 +420,7 @@ interface NativeSpecSurfaceProps {
|
|
|
418
420
|
* 表单行为(草稿跨刷新、必填拦截、默认值)由本组件承接——
|
|
419
421
|
* 节点树取代六类 surface 后,这里是 native 档唯一的渲染实现。
|
|
420
422
|
*/
|
|
421
|
-
declare function NativeSpecSurface({ surfaceId, spec, actions, registry, runId, draft, onAction, onDraftChange }: NativeSpecSurfaceProps): import("react").JSX.Element;
|
|
423
|
+
declare function NativeSpecSurface({ surfaceId, spec, actions, registry, runId, draft, onAction, onDraftChange, shell }: NativeSpecSurfaceProps): import("react").JSX.Element;
|
|
422
424
|
//#endregion
|
|
423
425
|
//#region src/catalog/JsonRenderSpecSurface.d.ts
|
|
424
426
|
interface JsonRenderSpecSurfaceProps {
|
|
@@ -431,7 +433,7 @@ interface JsonRenderSpecSurfaceProps {
|
|
|
431
433
|
* `vercel` 档:同一份 catalog 声明树交给 json-render 的 Registry 渲染。
|
|
432
434
|
* `@json-render/*` 是 optional peer,未安装时给出英文说明而不是空白。
|
|
433
435
|
*/
|
|
434
|
-
declare function JsonRenderSpecSurface({ spec, surfaceId, actions, onAction }: JsonRenderSpecSurfaceProps): import("react").JSX.Element
|
|
436
|
+
declare function JsonRenderSpecSurface({ spec, surfaceId, actions, onAction }: JsonRenderSpecSurfaceProps): import("react").JSX.Element;
|
|
435
437
|
//#endregion
|
|
436
438
|
//#region src/catalog/jsonRenderRegistry.d.ts
|
|
437
439
|
/** catalog 的 action 名与 `UiSpecActionCapability['intent']` 一一对应 */
|
|
@@ -495,7 +497,7 @@ interface OpenUiSpecSurfaceProps {
|
|
|
495
497
|
* `openui` 档:同一份 catalog 声明树经 openui-lang 交给 OpenUI 的 Renderer。
|
|
496
498
|
* `@openuidev/react-lang` 是 optional peer,未安装时给出英文说明而不是空白。
|
|
497
499
|
*/
|
|
498
|
-
declare function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }: OpenUiSpecSurfaceProps): import("react").JSX.Element
|
|
500
|
+
declare function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }: OpenUiSpecSurfaceProps): import("react").JSX.Element;
|
|
499
501
|
//#endregion
|
|
500
502
|
//#region src/catalog/catalogComponents.d.ts
|
|
501
503
|
type CatalogNodeProps = {
|
|
@@ -509,4 +511,11 @@ type CatalogNodeProps = {
|
|
|
509
511
|
*/
|
|
510
512
|
declare const catalogComponentImpls: Record<string, (input: CatalogNodeProps) => ReactNode>;
|
|
511
513
|
//#endregion
|
|
512
|
-
|
|
514
|
+
//#region src/catalog/surfaceFormTexts.d.ts
|
|
515
|
+
declare function useSurfaceFormTexts(): SurfaceFormTexts;
|
|
516
|
+
declare function SurfaceFormTextsProvider({ texts, children }: {
|
|
517
|
+
texts?: Partial<SurfaceFormTexts> | undefined;
|
|
518
|
+
children: ReactNode;
|
|
519
|
+
}): import("react").JSX.Element;
|
|
520
|
+
//#endregion
|
|
521
|
+
export { type CatalogNodeProps, type CustomSurfaceActionEvent, type DroppedSurfaceActionWarning, InteractionForm, type JsonRenderActionDispatch, JsonRenderSpecSurface, type JsonRenderSpecSurfaceProps, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, type NativeSpecSurfaceProps, OpenUiSpecSurface, type OpenUiSpecSurfaceProps, ReactBridgeState, type ReactBridgeStateOptions, type RegisteredSurfaceProps, ResultBlocks, SpecInteractionChannel, type SpecInteractionSession, StreamingText, SurfaceFormTextsProvider, type SurfaceRegistration, SurfaceRegistry, type UiSurfaceActionEvent, UiSurfaceList, type UiSurfaceListProps, UiSurfaceSnapshotList, type UiSurfaceSnapshotListProps, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability, useSurfaceFormTexts };
|
package/dist/ui-react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as __exportAll$1 } from "./rolldown-runtime-BOF7iYI8.js";
|
|
2
|
-
import { m as WebSkillError } from "./dist-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { C as
|
|
2
|
+
import { m as WebSkillError } from "./dist-59XlqDuv.js";
|
|
3
|
+
import { Ot as validateUiSpecEvent, kt as validateUiSpecNode } from "./dist-DmI5SBBF.js";
|
|
4
|
+
import { F as normalizeColumnWidths, M as interactionToUiSpec, R as renderMiniChart, U as toJsonRenderSpec, W as toOpenUiSpecLang, Z as DEFAULT_SURFACE_FORM_TEXTS, ct as renderMiniMarkdown, dt as shapeInteractionValue, ft as uiCatalog, it as chartSpecFromProps, ot as interactionToFormModel, w as collectValues, y as applySuggestion } from "./dist-CJqQsIm9.js";
|
|
5
|
+
import { C as DropdownMenuContent, D as Separator, E as Markdown, S as DropdownMenuCheckboxItem, T as Input, _ as useSurfaceFormTexts, a as SpecProgress, b as DataTable, c as SurfaceButton, d as SurfaceFormButtons, f as SurfaceFormTextsProvider, g as useSurfaceForm, h as useCatalogSurfaceForm, i as SpecGrid, l as SurfaceField, m as str, n as CatalogSurfaceProvider, o as SpecTabs, p as catalogComponentImpls, r as EChart, s as SpecTimeline, u as SurfaceFieldArray, v as Badge, w as DropdownMenuTrigger, x as DropdownMenu, y as Button } from "./catalogComponents-DfxxfUvn-D55Gbb2l.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import * as React$1 from "react";
|
|
8
8
|
import React, { createContext, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
@@ -6819,7 +6819,7 @@ function InteractionForm({ bridge }) {
|
|
|
6819
6819
|
id: `webskill-error-${control.name}`,
|
|
6820
6820
|
role: "alert",
|
|
6821
6821
|
className: "webskill-form__error",
|
|
6822
|
-
children:
|
|
6822
|
+
children: DEFAULT_SURFACE_FORM_TEXTS.required
|
|
6823
6823
|
}) : null
|
|
6824
6824
|
]
|
|
6825
6825
|
}, control.name)),
|
|
@@ -6912,48 +6912,78 @@ function StreamingText({ bridge }) {
|
|
|
6912
6912
|
});
|
|
6913
6913
|
}
|
|
6914
6914
|
/**
|
|
6915
|
-
*
|
|
6915
|
+
* 渲染前的逐节点降级(FR-23.3)。
|
|
6916
|
+
*
|
|
6917
|
+
* 三档过去都是「整树 validate,失败即整块换成一行红字」——一个节点的一个 prop 不合法
|
|
6918
|
+
* 就让整个 surface 消失。到了渲染层这份 spec 可能来自快照重放或更早的语法版本,
|
|
6919
|
+
* 此刻整块拒绝而 run 还在等它的响应,正是 AC-G11 要防的「整块消失」。
|
|
6920
|
+
*/
|
|
6921
|
+
function useSanitizedSpec(spec) {
|
|
6922
|
+
return useMemo(() => uiCatalog.sanitize(spec), [spec]);
|
|
6923
|
+
}
|
|
6924
|
+
const isOutOfCatalog = (degradation) => degradation.kind === "unknown-component";
|
|
6925
|
+
/**
|
|
6926
|
+
* 越界组件名的响亮拒绝。
|
|
6927
|
+
*
|
|
6928
|
+
* 它是**对 spec 本身**的判定,与渲染器装没装无关,所以要渲染在可选依赖的门禁之前——
|
|
6929
|
+
* 放到门禁后面,未安装该档时这条越界信号就消失了。
|
|
6930
|
+
*/
|
|
6931
|
+
function SurfaceRejectionAlert({ degradations }) {
|
|
6932
|
+
const rejected = degradations.filter(isOutOfCatalog);
|
|
6933
|
+
if (rejected.length === 0) return null;
|
|
6934
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6935
|
+
role: "alert",
|
|
6936
|
+
className: "webskill-surface--error text-sm text-destructive",
|
|
6937
|
+
children: ["Invalid UI spec: ", rejected.map((item) => `${item.path}: ${item.detail}`).join("; ")]
|
|
6938
|
+
});
|
|
6939
|
+
}
|
|
6940
|
+
/** 其余降级的中性说明(AC-23.8):不是错误,是「这个档 / 这份 spec 有一部分做不到」 */
|
|
6941
|
+
function SurfaceSimplifiedNote({ degradations }) {
|
|
6942
|
+
const simplified = degradations.filter((degradation) => !isOutOfCatalog(degradation));
|
|
6943
|
+
if (simplified.length === 0) return null;
|
|
6944
|
+
return /* @__PURE__ */ jsx("div", {
|
|
6945
|
+
role: "note",
|
|
6946
|
+
"data-webskill-degraded": simplified.length,
|
|
6947
|
+
className: "webskill-surface--unsupported text-xs text-muted",
|
|
6948
|
+
children: simplified.map((item) => `${item.path} (${item.kind})`).join("; ")
|
|
6949
|
+
});
|
|
6950
|
+
}
|
|
6951
|
+
/** 两级合并渲染;可选依赖有门禁的档要分开用上面两个 */
|
|
6952
|
+
function SurfaceDegradationNote({ degradations }) {
|
|
6953
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SurfaceRejectionAlert, { degradations }), /* @__PURE__ */ jsx(SurfaceSimplifiedNote, { degradations })] });
|
|
6954
|
+
}
|
|
6955
|
+
/**
|
|
6956
|
+
* catalog `Table` 节点的渲染实现:排序 / 筛选 / 分页 / 列显隐 / 虚拟滚动。
|
|
6916
6957
|
* 这些是宿主侧的呈现能力,不进 catalog props——模型只声明 columns 与 rows。
|
|
6917
6958
|
* 它们都带 `data-webskill-host-control`,跨渲染器语义对括据此排除宿主控件。
|
|
6918
6959
|
*/
|
|
6919
|
-
function SpecTable({ columns, rows, label }) {
|
|
6960
|
+
function SpecTable({ columns, rows, label, columnWidths, onDegraded }) {
|
|
6920
6961
|
const [sorting, setSorting] = useState([]);
|
|
6921
6962
|
const [globalFilter, setGlobalFilter] = useState("");
|
|
6922
6963
|
const [columnVisibility, setColumnVisibility] = useState({});
|
|
6923
|
-
const [rowSelection, setRowSelection] = useState({});
|
|
6924
6964
|
const scrollRef = useRef(null);
|
|
6965
|
+
const normalized = normalizeColumnWidths(columnWidths, columns.length);
|
|
6966
|
+
const weightTotal = normalized.weights.reduce((sum, weight) => sum + weight, 0);
|
|
6967
|
+
const widthPercents = normalized.weights.map((weight) => weightTotal > 0 ? weight / weightTotal * 100 : 0);
|
|
6968
|
+
const rejected = normalized.rejected;
|
|
6969
|
+
useEffect(() => {
|
|
6970
|
+
if (rejected !== void 0) onDegraded?.(rejected);
|
|
6971
|
+
}, [rejected, onDegraded]);
|
|
6925
6972
|
const table = useReactTable({
|
|
6926
6973
|
data: rows,
|
|
6927
|
-
columns:
|
|
6928
|
-
id: "selection",
|
|
6929
|
-
header: ({ table }) => /* @__PURE__ */ jsx(Checkbox, {
|
|
6930
|
-
"aria-label": "Select all rows",
|
|
6931
|
-
checked: table.getIsSomePageRowsSelected() ? "indeterminate" : table.getIsAllPageRowsSelected(),
|
|
6932
|
-
onCheckedChange: (checked) => table.toggleAllPageRowsSelected(checked === true)
|
|
6933
|
-
}),
|
|
6934
|
-
cell: ({ row }) => /* @__PURE__ */ jsx(Checkbox, {
|
|
6935
|
-
"aria-label": `Select row ${row.index + 1}`,
|
|
6936
|
-
checked: row.getIsSelected(),
|
|
6937
|
-
onCheckedChange: (checked) => row.toggleSelected(checked === true)
|
|
6938
|
-
}),
|
|
6939
|
-
enableSorting: false,
|
|
6940
|
-
enableHiding: false
|
|
6941
|
-
}, ...columns.map((header, index) => ({
|
|
6974
|
+
columns: columns.map((header, index) => ({
|
|
6942
6975
|
id: `column-${index}`,
|
|
6943
6976
|
header,
|
|
6944
6977
|
accessorFn: (row) => row[index]
|
|
6945
|
-
}))
|
|
6978
|
+
})),
|
|
6946
6979
|
state: {
|
|
6947
6980
|
sorting,
|
|
6948
6981
|
globalFilter,
|
|
6949
|
-
columnVisibility
|
|
6950
|
-
rowSelection
|
|
6982
|
+
columnVisibility
|
|
6951
6983
|
},
|
|
6952
6984
|
onSortingChange: setSorting,
|
|
6953
6985
|
onGlobalFilterChange: setGlobalFilter,
|
|
6954
6986
|
onColumnVisibilityChange: setColumnVisibility,
|
|
6955
|
-
onRowSelectionChange: setRowSelection,
|
|
6956
|
-
enableRowSelection: true,
|
|
6957
6987
|
globalFilterFn: (row, _columnId, filterValue) => row.original.some((cell) => String(cell ?? "").toLocaleLowerCase().includes(String(filterValue).toLocaleLowerCase())),
|
|
6958
6988
|
getCoreRowModel: getCoreRowModel(),
|
|
6959
6989
|
getFilteredRowModel: getFilteredRowModel(),
|
|
@@ -7001,30 +7031,34 @@ function SpecTable({ columns, rows, label }) {
|
|
|
7001
7031
|
/* @__PURE__ */ jsxs(DataTable, {
|
|
7002
7032
|
"aria-label": label,
|
|
7003
7033
|
containerClassName: "webskill-surface__table-scroll",
|
|
7004
|
-
children: [
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7034
|
+
children: [
|
|
7035
|
+
/* @__PURE__ */ jsx("colgroup", { children: widthPercents.map((percent, index) => /* @__PURE__ */ jsx("col", { style: { width: `${percent}%` } }, index)) }),
|
|
7036
|
+
/* @__PURE__ */ jsx("thead", {
|
|
7037
|
+
className: "webskill-surface__table-header",
|
|
7038
|
+
children: /* @__PURE__ */ jsx("tr", { children: table.getFlatHeaders().map((header) => /* @__PURE__ */ jsx("th", {
|
|
7039
|
+
scope: "col",
|
|
7040
|
+
...header.column.id === "selection" ? { "data-webskill-host-control": "" } : {},
|
|
7041
|
+
"aria-sort": header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none",
|
|
7042
|
+
children: header.column.getCanSort() ? /* @__PURE__ */ jsx("button", {
|
|
7043
|
+
type: "button",
|
|
7044
|
+
"data-webskill-host-control": "",
|
|
7045
|
+
onClick: header.column.getToggleSortingHandler(),
|
|
7046
|
+
children: flexRender(header.column.columnDef.header, header.getContext())
|
|
7047
|
+
}) : flexRender(header.column.columnDef.header, header.getContext())
|
|
7048
|
+
}, header.id)) })
|
|
7049
|
+
}),
|
|
7050
|
+
/* @__PURE__ */ jsx("tbody", {
|
|
7051
|
+
ref: scrollRef,
|
|
7052
|
+
className: "webskill-surface__table-body",
|
|
7053
|
+
children: renderedRows.map((virtualRow) => {
|
|
7054
|
+
const row = modelRows[virtualRow.index];
|
|
7055
|
+
return /* @__PURE__ */ jsx("tr", { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx("td", {
|
|
7056
|
+
...cell.column.id === "selection" ? { "data-webskill-host-control": "" } : {},
|
|
7057
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
7058
|
+
}, cell.id)) }, row.id);
|
|
7059
|
+
})
|
|
7026
7060
|
})
|
|
7027
|
-
|
|
7061
|
+
]
|
|
7028
7062
|
}),
|
|
7029
7063
|
/* @__PURE__ */ jsxs("div", {
|
|
7030
7064
|
className: "webskill-surface__table-pagination",
|
|
@@ -7114,11 +7148,17 @@ function renderNode(node, context, key, scope) {
|
|
|
7114
7148
|
}) : null
|
|
7115
7149
|
]
|
|
7116
7150
|
}, key);
|
|
7117
|
-
case "Table":
|
|
7118
|
-
columns
|
|
7119
|
-
rows
|
|
7120
|
-
|
|
7121
|
-
|
|
7151
|
+
case "Table": {
|
|
7152
|
+
const columns = Array.isArray(props["columns"]) ? props["columns"] : [];
|
|
7153
|
+
const rows = Array.isArray(props["rows"]) ? props["rows"] : [];
|
|
7154
|
+
const columnWidths = Array.isArray(props["columnWidths"]) ? props["columnWidths"] : void 0;
|
|
7155
|
+
return /* @__PURE__ */ jsx(SpecTable, {
|
|
7156
|
+
columns,
|
|
7157
|
+
rows,
|
|
7158
|
+
label: str(props, "title", "Data"),
|
|
7159
|
+
...columnWidths ? { columnWidths } : {}
|
|
7160
|
+
}, key);
|
|
7161
|
+
}
|
|
7122
7162
|
case "Chart": return /* @__PURE__ */ jsx(EChart, { chart: chartSpecFromProps(props) }, key);
|
|
7123
7163
|
case "Tabs": return /* @__PURE__ */ jsx(SpecTabs, {
|
|
7124
7164
|
props,
|
|
@@ -7135,7 +7175,7 @@ function renderNode(node, context, key, scope) {
|
|
|
7135
7175
|
children: [/* @__PURE__ */ jsx("span", {
|
|
7136
7176
|
className: "text-ink",
|
|
7137
7177
|
children: str(props, "label", str(props, "path"))
|
|
7138
|
-
}), /* @__PURE__ */ jsx(Button, {
|
|
7178
|
+
}), context.readOnly ? null : /* @__PURE__ */ jsx(Button, {
|
|
7139
7179
|
size: "sm",
|
|
7140
7180
|
variant: "secondary",
|
|
7141
7181
|
"data-webskill-surface-action": context.resolveActionId("download", node.id),
|
|
@@ -7168,6 +7208,11 @@ function renderNode(node, context, key, scope) {
|
|
|
7168
7208
|
props,
|
|
7169
7209
|
scope
|
|
7170
7210
|
}, key);
|
|
7211
|
+
case "FieldArray": return /* @__PURE__ */ jsx(SurfaceFieldArray, {
|
|
7212
|
+
form: context,
|
|
7213
|
+
props,
|
|
7214
|
+
scope
|
|
7215
|
+
}, key);
|
|
7171
7216
|
case "Button": return /* @__PURE__ */ jsx(SurfaceButton, {
|
|
7172
7217
|
form: context,
|
|
7173
7218
|
props,
|
|
@@ -7221,30 +7266,36 @@ function renderNode(node, context, key, scope) {
|
|
|
7221
7266
|
* 表单行为(草稿跨刷新、必填拦截、默认值)由本组件承接——
|
|
7222
7267
|
* 节点树取代六类 surface 后,这里是 native 档唯一的渲染实现。
|
|
7223
7268
|
*/
|
|
7224
|
-
function NativeSpecSurface({ surfaceId, spec, actions, registry, runId, draft, onAction, onDraftChange }) {
|
|
7269
|
+
function NativeSpecSurface({ surfaceId, spec, actions, registry, runId, draft, onAction, onDraftChange, shell = "card" }) {
|
|
7270
|
+
const sanitized = useSanitizedSpec(spec);
|
|
7271
|
+
const form = useSurfaceForm({
|
|
7272
|
+
surfaceId,
|
|
7273
|
+
spec: sanitized.node ?? spec,
|
|
7274
|
+
actions,
|
|
7275
|
+
runId,
|
|
7276
|
+
draft,
|
|
7277
|
+
onAction,
|
|
7278
|
+
onDraftChange
|
|
7279
|
+
});
|
|
7225
7280
|
const context = {
|
|
7226
|
-
...
|
|
7227
|
-
surfaceId,
|
|
7228
|
-
spec,
|
|
7229
|
-
actions,
|
|
7230
|
-
runId,
|
|
7231
|
-
draft,
|
|
7232
|
-
onAction,
|
|
7233
|
-
onDraftChange
|
|
7234
|
-
}),
|
|
7281
|
+
...form,
|
|
7235
7282
|
registry,
|
|
7236
7283
|
onAction
|
|
7237
7284
|
};
|
|
7238
|
-
const
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
className: "webskill-surface--
|
|
7242
|
-
children: ["Invalid UI spec: ", validation.issues.map((issue) => `${issue.path}: ${issue.message}`).join("; ")]
|
|
7243
|
-
});
|
|
7244
|
-
return /* @__PURE__ */ jsx("div", {
|
|
7245
|
-
className: "webskill-surface webskill-surface--spec",
|
|
7285
|
+
const texts = useSurfaceFormTexts();
|
|
7286
|
+
const { node, degradations } = sanitized;
|
|
7287
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
7288
|
+
className: shell === "none" ? "webskill-surface--spec" : "webskill-surface webskill-surface--spec",
|
|
7246
7289
|
"data-testid": "native-spec-surface",
|
|
7247
|
-
children:
|
|
7290
|
+
children: [
|
|
7291
|
+
node ? renderNode(node, context, "root") : null,
|
|
7292
|
+
form.readOnly && actions.length > 0 ? /* @__PURE__ */ jsx("p", {
|
|
7293
|
+
"data-testid": "surface-readonly-note",
|
|
7294
|
+
className: "mt-2 text-xs text-muted",
|
|
7295
|
+
children: texts.readOnlySnapshot
|
|
7296
|
+
}) : null,
|
|
7297
|
+
/* @__PURE__ */ jsx(SurfaceDegradationNote, { degradations })
|
|
7298
|
+
]
|
|
7248
7299
|
});
|
|
7249
7300
|
}
|
|
7250
7301
|
function Surface({ snapshot, registry, onAction, drafts, onDraftChange }) {
|
|
@@ -7342,27 +7393,27 @@ function JsonRenderSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
7342
7393
|
cancelled = true;
|
|
7343
7394
|
};
|
|
7344
7395
|
}, []);
|
|
7345
|
-
const
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
className: "webskill-surface--error text-sm text-destructive",
|
|
7349
|
-
children: ["Invalid UI spec: ", validation.issues.map((issue) => `${issue.path}: ${issue.message}`).join("; ")]
|
|
7350
|
-
});
|
|
7351
|
-
if (unavailable) return /* @__PURE__ */ jsx("div", {
|
|
7396
|
+
const sanitized = useSanitizedSpec(spec);
|
|
7397
|
+
const rejection = /* @__PURE__ */ jsx(SurfaceRejectionAlert, { degradations: sanitized.degradations });
|
|
7398
|
+
if (unavailable) return /* @__PURE__ */ jsxs(Fragment$1, { children: [rejection, /* @__PURE__ */ jsx("div", {
|
|
7352
7399
|
role: "alert",
|
|
7353
7400
|
className: "webskill-surface--unsupported text-sm text-muted",
|
|
7354
7401
|
children: "The json-render renderer is not installed: add @json-render/core and @json-render/react to this host."
|
|
7355
|
-
});
|
|
7356
|
-
if (!module) return
|
|
7357
|
-
return /* @__PURE__ */
|
|
7402
|
+
})] });
|
|
7403
|
+
if (!module) return rejection;
|
|
7404
|
+
return /* @__PURE__ */ jsxs(CatalogSurfaceProvider, {
|
|
7358
7405
|
surfaceId,
|
|
7359
|
-
spec,
|
|
7406
|
+
spec: sanitized.node ?? spec,
|
|
7360
7407
|
actions: actions ?? [],
|
|
7361
7408
|
...onAction ? { onAction } : {},
|
|
7362
|
-
children:
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7409
|
+
children: [
|
|
7410
|
+
rejection,
|
|
7411
|
+
sanitized.node ? /* @__PURE__ */ jsx(JsonRenderBody, {
|
|
7412
|
+
spec: sanitized.node,
|
|
7413
|
+
module
|
|
7414
|
+
}) : null,
|
|
7415
|
+
/* @__PURE__ */ jsx(SurfaceSimplifiedNote, { degradations: sanitized.degradations })
|
|
7416
|
+
]
|
|
7366
7417
|
});
|
|
7367
7418
|
}
|
|
7368
7419
|
/** registry 的 action 出口绑定到本 surface:json-render 派发的动作与组件内点击回传同一份载荷 */
|
|
@@ -7536,7 +7587,7 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
7536
7587
|
const [unavailable, setUnavailable] = useState(false);
|
|
7537
7588
|
useEffect(() => {
|
|
7538
7589
|
let cancelled = false;
|
|
7539
|
-
import("./openUiLibrary-
|
|
7590
|
+
import("./openUiLibrary-DURlAxjk-CU6AzfSW.js").then((loaded) => {
|
|
7540
7591
|
if (!cancelled) setModule(loaded);
|
|
7541
7592
|
}).catch(() => {
|
|
7542
7593
|
if (!cancelled) setUnavailable(true);
|
|
@@ -7545,34 +7596,34 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
7545
7596
|
cancelled = true;
|
|
7546
7597
|
};
|
|
7547
7598
|
}, []);
|
|
7548
|
-
const
|
|
7549
|
-
|
|
7550
|
-
|
|
7551
|
-
className: "webskill-surface--error text-sm text-destructive",
|
|
7552
|
-
children: ["Invalid UI spec: ", validation.issues.map((issue) => `${issue.path}: ${issue.message}`).join("; ")]
|
|
7553
|
-
});
|
|
7554
|
-
if (unavailable) return /* @__PURE__ */ jsx("div", {
|
|
7599
|
+
const sanitized = useSanitizedSpec(spec);
|
|
7600
|
+
const rejection = /* @__PURE__ */ jsx(SurfaceRejectionAlert, { degradations: sanitized.degradations });
|
|
7601
|
+
if (unavailable) return /* @__PURE__ */ jsxs(Fragment$1, { children: [rejection, /* @__PURE__ */ jsx("div", {
|
|
7555
7602
|
role: "alert",
|
|
7556
7603
|
className: "webskill-surface--unsupported text-sm text-muted",
|
|
7557
7604
|
children: "The OpenUI renderer is not installed: add @openuidev/react-lang to this host."
|
|
7558
|
-
});
|
|
7559
|
-
if (!module) return
|
|
7605
|
+
})] });
|
|
7606
|
+
if (!module) return rejection;
|
|
7560
7607
|
const { Renderer, webskillOpenUiLibrary } = module;
|
|
7561
7608
|
return /* @__PURE__ */ jsx(CatalogSurfaceProvider, {
|
|
7562
7609
|
surfaceId,
|
|
7563
|
-
spec,
|
|
7610
|
+
spec: sanitized.node ?? spec,
|
|
7564
7611
|
actions: actions ?? [],
|
|
7565
7612
|
...onAction ? { onAction } : {},
|
|
7566
|
-
children: /* @__PURE__ */
|
|
7613
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
7567
7614
|
className: "webskill-surface webskill-surface--spec",
|
|
7568
7615
|
"data-testid": "openui-spec-surface",
|
|
7569
|
-
children:
|
|
7570
|
-
|
|
7571
|
-
|
|
7572
|
-
|
|
7616
|
+
children: [
|
|
7617
|
+
sanitized.node ? /* @__PURE__ */ jsx(Renderer, {
|
|
7618
|
+
response: toOpenUiSpecLang(sanitized.node),
|
|
7619
|
+
library: webskillOpenUiLibrary
|
|
7620
|
+
}) : null,
|
|
7621
|
+
rejection,
|
|
7622
|
+
/* @__PURE__ */ jsx(SurfaceSimplifiedNote, { degradations: sanitized.degradations })
|
|
7623
|
+
]
|
|
7573
7624
|
})
|
|
7574
7625
|
});
|
|
7575
7626
|
}
|
|
7576
7627
|
|
|
7577
7628
|
//#endregion
|
|
7578
|
-
export { InteractionForm, JsonRenderSpecSurface, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, OpenUiSpecSurface, ReactBridgeState, ResultBlocks, SpecInteractionChannel, StreamingText, SurfaceRegistry, UiSurfaceList, UiSurfaceSnapshotList, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability };
|
|
7629
|
+
export { InteractionForm, JsonRenderSpecSurface, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, OpenUiSpecSurface, ReactBridgeState, ResultBlocks, SpecInteractionChannel, StreamingText, SurfaceFormTextsProvider, SurfaceRegistry, UiSurfaceList, UiSurfaceSnapshotList, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability, useSurfaceFormTexts };
|
package/dist/ui-vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as InteractionResponse, s as InteractionRequest, x as UiBridge, y as RenderResultRequest } from "./types-B3n0cMZu-BdcqQ35O.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-vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as renderMiniChart, Z as DEFAULT_SURFACE_FORM_TEXTS, ct as renderMiniMarkdown, dt as shapeInteractionValue, ot as interactionToFormModel, w as collectValues, y as applySuggestion } from "./dist-CJqQsIm9.js";
|
|
2
2
|
import { defineComponent, h, reactive, ref } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region ../ui-vue/dist/index.js
|
|
@@ -164,7 +164,7 @@ const InteractionForm = defineComponent({
|
|
|
164
164
|
id: `webskill-error-${control.name}`,
|
|
165
165
|
role: "alert",
|
|
166
166
|
class: "webskill-form__error"
|
|
167
|
-
},
|
|
167
|
+
}, DEFAULT_SURFACE_FORM_TEXTS.required) : null
|
|
168
168
|
])),
|
|
169
169
|
h("div", { class: "webskill-form__actions" }, [h("button", {
|
|
170
170
|
type: "submit",
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { $ as
|
|
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, CHART_PALETTE, type CollectedValues, type ControlModel, DESCRIBE_UI_PRESET_TOOL, type EchartHandle, type FormModel, type InteractionSpecLabels, type JsonRenderSpec, type LoadedOpenUiPeers, type OpenUiRendererProps, type OpenUiRuntime, RENDER_UI_TOOL, 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 UiSpecIssue, type UiSpecNode, type UiSpecValidation, type UiSurfaceActionDispatch, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_A2UI_CATALOG_ID, WEBSKILL_STYLES_CSS, WEBSKILL_SURFACE_ACTION, WebFormBridge, type ZodRuntime, a2uiComponentSchema, a2uiComponentShapes, applySuggestion, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromProps, chartToTable, collectFormScopes, collectScopedValues, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, ensureStyles, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
|
1
|
+
import { vt as UiSpecNode } from "./types-B3n0cMZu-BdcqQ35O.js";
|
|
2
|
+
import { vn as buildRenderResult } from "./index-K-eewlGL.js";
|
|
3
|
+
import { $ as UiSpecIssue, A as MAX_CONDITION_DEPTH, At as interactionToUiSpec, B as UI_CATALOG_PROMPT_BUDGET_BYTES, Bt as resolveColumnWidths, C as FieldCondition, Ct as ensureStyles, D as InteractionTexts, Dt as fromUiSurfaceActionDispatch, E as InteractionSpecLabels, Et as fromA2uiSurfaceAction, F as SPEC_TABLE_MIN_COLUMN_VAR, Ft as qualifyFieldName, G as UiCatalogInput, Gt as toA2uiSurfaceAction, H as UI_PRESET_NAMES, Ht as resolveSurfaceFormTexts, I as SPEC_TABLE_MIN_COLUMN_WIDTH, It as renderBlocks, J as UiComponentDef, Jt as toUiSurfaceActionDispatch, K as UiCatalogPromptOptions, Kt as toJsonRenderSpec, L as SpecColumnMeta, Lt as renderMiniChart, M as OpenUiRendererProps, Mt as loadWebSkillLitCatalog, N as OpenUiRuntime, Nt as mountEchart, O as JsonRenderSpec, Ot as fromVercelToolResult, P as RENDER_UI_TOOL, Pt as normalizeColumnWidths, Q as UiSpecDegradation, R as SurfaceFormTexts, Rt as renderMiniMarkdown, S as EvaluateFieldConditionOptions, St as defineUiCatalog, T as FormModel, Tt as fromA2uiSpecAction, U as UiActionDef, Ut as shapeInteractionValue, V as UI_PRESETS, Vt as resolveInteractionTexts, W as UiCatalog, Wt as toA2uiSpecMessages, X as UiPreset, Xt as uiCatalog, Y as UiFormScope, Yt as toVercelToolInvocation, Z as UiPresetName, Zt as uiPreset, _ as ControlModel, _t as collectFormScopes, a as A2UI_SURFACE_ACTION, at as VercelUiBridge, b as DESCRIBE_UI_PRESET_TOOL, bt as collectValues, c as A2uiCatalogDefinition, ct as WEBSKILL_SURFACE_ACTION, d as A2uiMessage, dt as a2uiComponentSchema, et as UiSpecSanitization, f as A2uiSpecActionEvent, ft as a2uiComponentShapes, g as ColumnWidthsRejection, gt as chartToTable, h as CollectedValues, ht as chartSpecFromProps, i as A2UI_SPEC_FORM_PATH, it as VercelToolInvocation, j as NormalizedColumnWidths, jt as loadOpenUiPeers, k as LoadedOpenUiPeers, kt as interactionToFormModel, l as A2uiCatalogHandle, lt as WebFormBridge, m as CHART_PALETTE, mt as buildA2uiCatalogDefinition, n as A2UI_COMMON_TYPES, nt as UiSurfaceActionDispatch, o as A2UI_VERSION, ot as WEBSKILL_A2UI_CATALOG_ID, p as A2uiSpecMessageOptions, pt as applySuggestion, q as UiCatalogToolSourceOptions, qt as toOpenUiSpecLang, r as A2UI_SPEC_ACTION, rt as VERCEL_INTERACTION_TOOL_NAME, s as A2uiCatalogComponent, st as WEBSKILL_STYLES_CSS, t as A2UI_BASIC_CATALOG_ID, tt as UiSpecValidation, u as A2uiComponentShape, ut as ZodRuntime, v as DEFAULT_INTERACTION_TEXTS, vt as collectScopedValues, w as FieldConditionResult, wt as evaluateFieldCondition, x as EchartHandle, xt as createUiCatalogToolSource, y as DEFAULT_SURFACE_FORM_TEXTS, yt as collectSpecActions, z as UI_CATALOG_GROUPS, zt as renderRenderResult } from "./index-P9J2LTfU.js";
|
|
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, CHART_PALETTE, type CollectedValues, type ColumnWidthsRejection, type ControlModel, DEFAULT_INTERACTION_TEXTS, DEFAULT_SURFACE_FORM_TEXTS, DESCRIBE_UI_PRESET_TOOL, type EchartHandle, type EvaluateFieldConditionOptions, type FieldCondition, type FieldConditionResult, type FormModel, type InteractionSpecLabels, type InteractionTexts, type JsonRenderSpec, type LoadedOpenUiPeers, MAX_CONDITION_DEPTH, type NormalizedColumnWidths, type OpenUiRendererProps, type OpenUiRuntime, RENDER_UI_TOOL, SPEC_TABLE_MIN_COLUMN_VAR, SPEC_TABLE_MIN_COLUMN_WIDTH, type SpecColumnMeta, type SurfaceFormTexts, 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 UiSpecIssue, type UiSpecNode, type UiSpecSanitization, type UiSpecValidation, type UiSurfaceActionDispatch, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_A2UI_CATALOG_ID, WEBSKILL_STYLES_CSS, WEBSKILL_SURFACE_ACTION, WebFormBridge, type ZodRuntime, a2uiComponentSchema, a2uiComponentShapes, applySuggestion, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromProps, chartToTable, collectFormScopes, collectScopedValues, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, ensureStyles, evaluateFieldCondition, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, normalizeColumnWidths, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, resolveColumnWidths, resolveInteractionTexts, resolveSurfaceFormTexts, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
1
|
+
import { V as buildRenderResult } from "./dist-DmI5SBBF.js";
|
|
2
|
+
import { $ as UI_CATALOG_PROMPT_BUDGET_BYTES, A as fromUiSurfaceActionDispatch, B as resolveColumnWidths, C as collectSpecActions, D as evaluateFieldCondition, E as ensureStyles, F as normalizeColumnWidths, G as toUiSurfaceActionDispatch, H as toA2uiSurfaceAction, I as qualifyFieldName, K as toVercelToolInvocation, L as renderBlocks, M as interactionToUiSpec, N as loadOpenUiPeers, O as fromA2uiSpecAction, P as loadWebSkillLitCatalog, Q as UI_CATALOG_GROUPS, R as renderMiniChart, S as collectScopedValues, T as createUiCatalogToolSource, U as toJsonRenderSpec, V as toA2uiSpecMessages, W as toOpenUiSpecLang, X as DEFAULT_INTERACTION_TEXTS, Y as A2UI_COMMON_TYPES, Z as DEFAULT_SURFACE_FORM_TEXTS, _ as WEBSKILL_SURFACE_ACTION, a as A2UI_VERSION, at as defineUiCatalog, b as chartToTable, c as MAX_CONDITION_DEPTH, ct as renderMiniMarkdown, d as SPEC_TABLE_MIN_COLUMN_WIDTH, dt as shapeInteractionValue, et as WEBSKILL_A2UI_CATALOG_ID, f as UI_PRESETS, ft as uiCatalog, g as WEBSKILL_STYLES_CSS, h as VercelUiBridge, i as A2UI_SURFACE_ACTION, it as chartSpecFromProps, j as fromVercelToolResult, k as fromA2uiSurfaceAction, l as RENDER_UI_TOOL, lt as resolveInteractionTexts, m as VERCEL_INTERACTION_TOOL_NAME, n as A2UI_SPEC_ACTION, nt as a2uiComponentShapes, o as CHART_PALETTE, ot as interactionToFormModel, p as UI_PRESET_NAMES, q as uiPreset, r as A2UI_SPEC_FORM_PATH, rt as buildA2uiCatalogDefinition, s as DESCRIBE_UI_PRESET_TOOL, st as mountEchart, t as A2UI_BASIC_CATALOG_ID, tt as a2uiComponentSchema, u as SPEC_TABLE_MIN_COLUMN_VAR, ut as resolveSurfaceFormTexts, v as WebFormBridge, w as collectValues, x as collectFormScopes, y as applySuggestion, z as renderRenderResult } from "./dist-CJqQsIm9.js";
|
|
3
3
|
|
|
4
|
-
export { A2UI_BASIC_CATALOG_ID, A2UI_COMMON_TYPES, A2UI_SPEC_ACTION, A2UI_SPEC_FORM_PATH, A2UI_SURFACE_ACTION, A2UI_VERSION, CHART_PALETTE, DESCRIBE_UI_PRESET_TOOL, RENDER_UI_TOOL, UI_CATALOG_GROUPS, UI_CATALOG_PROMPT_BUDGET_BYTES, UI_PRESETS, UI_PRESET_NAMES, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_A2UI_CATALOG_ID, WEBSKILL_STYLES_CSS, WEBSKILL_SURFACE_ACTION, WebFormBridge, a2uiComponentSchema, a2uiComponentShapes, applySuggestion, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromProps, chartToTable, collectFormScopes, collectScopedValues, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, ensureStyles, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
|
4
|
+
export { A2UI_BASIC_CATALOG_ID, A2UI_COMMON_TYPES, A2UI_SPEC_ACTION, A2UI_SPEC_FORM_PATH, A2UI_SURFACE_ACTION, A2UI_VERSION, CHART_PALETTE, DEFAULT_INTERACTION_TEXTS, DEFAULT_SURFACE_FORM_TEXTS, DESCRIBE_UI_PRESET_TOOL, MAX_CONDITION_DEPTH, RENDER_UI_TOOL, SPEC_TABLE_MIN_COLUMN_VAR, SPEC_TABLE_MIN_COLUMN_WIDTH, UI_CATALOG_GROUPS, UI_CATALOG_PROMPT_BUDGET_BYTES, UI_PRESETS, UI_PRESET_NAMES, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_A2UI_CATALOG_ID, WEBSKILL_STYLES_CSS, WEBSKILL_SURFACE_ACTION, WebFormBridge, a2uiComponentSchema, a2uiComponentShapes, applySuggestion, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromProps, chartToTable, collectFormScopes, collectScopedValues, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, ensureStyles, evaluateFieldCondition, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, normalizeColumnWidths, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, resolveColumnWidths, resolveInteractionTexts, resolveSurfaceFormTexts, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
package/dist/{webskillLitCatalog-_mugzRHx-B_54vxum.js → webskillLitCatalog-DwTwSBFt-DiXXpNZA.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as
|
|
1
|
+
import { J as A2UI_CHILDREN_PROP, Z as DEFAULT_SURFACE_FORM_TEXTS, ct as renderMiniMarkdown, et as WEBSKILL_A2UI_CATALOG_ID, ft as uiCatalog, it as chartSpecFromProps, nt as a2uiComponentShapes, st as mountEchart } from "./dist-CJqQsIm9.js";
|
|
2
2
|
import { A2uiController, A2uiLitElement } from "@a2ui/lit/v0_9";
|
|
3
3
|
import { Catalog } from "@a2ui/web_core/v0_9";
|
|
4
4
|
import { z } from "zod/v3";
|
|
@@ -1419,7 +1419,7 @@ var f = class extends i {
|
|
|
1419
1419
|
};
|
|
1420
1420
|
|
|
1421
1421
|
//#endregion
|
|
1422
|
-
//#region ../ui/dist/webskillLitCatalog-
|
|
1422
|
+
//#region ../ui/dist/webskillLitCatalog-DwTwSBFt.js
|
|
1423
1423
|
/**
|
|
1424
1424
|
* Lit 元素上的 echarts 挂载指令。
|
|
1425
1425
|
* A2UI 档的 catalog `Chart` 渲染在 shadow root 里,实例必须随元素断开而 dispose,
|
|
@@ -1539,6 +1539,16 @@ const sharedStyles = i$4`
|
|
|
1539
1539
|
overflow: auto;
|
|
1540
1540
|
border: 1px solid var(--border);
|
|
1541
1541
|
border-radius: var(--radius);
|
|
1542
|
+
container-type: inline-size;
|
|
1543
|
+
container-name: webskill-table;
|
|
1544
|
+
}
|
|
1545
|
+
/* 窄档降到 SPEC_TABLE_MIN_COLUMN_WIDTH.mobile。native 档的同名规则在 surfaces.css,
|
|
1546
|
+
那边的选择器进不了 shadow root,所以两侧各写一遍——变量名与取值必须同步(T-25-F) */
|
|
1547
|
+
@container webskill-table (width < 30rem) {
|
|
1548
|
+
th,
|
|
1549
|
+
td {
|
|
1550
|
+
--webskill-table-min-col: 5rem;
|
|
1551
|
+
}
|
|
1542
1552
|
}
|
|
1543
1553
|
table {
|
|
1544
1554
|
width: max-content;
|
|
@@ -1548,7 +1558,7 @@ const sharedStyles = i$4`
|
|
|
1548
1558
|
}
|
|
1549
1559
|
th,
|
|
1550
1560
|
td {
|
|
1551
|
-
min-width: 8rem;
|
|
1561
|
+
min-width: var(--webskill-table-min-col, 8rem);
|
|
1552
1562
|
border-bottom: 1px solid var(--border);
|
|
1553
1563
|
padding: 0.375rem 0.5rem;
|
|
1554
1564
|
text-align: left;
|
|
@@ -1738,6 +1748,15 @@ const renderers = {
|
|
|
1738
1748
|
<form @submit=${(event) => event.preventDefault()}>
|
|
1739
1749
|
${props["title"] ? T`<h3>${str(props, "title")}</h3>` : A} ${children(props, host)}
|
|
1740
1750
|
</form>
|
|
1751
|
+
`,
|
|
1752
|
+
FieldArray: (props, host) => T`
|
|
1753
|
+
<fieldset data-webskill-surface-array=${str(props, "name")}>
|
|
1754
|
+
<legend>${str(props, "label", str(props, "name"))}</legend>
|
|
1755
|
+
${children(props, host)}
|
|
1756
|
+
<p role="note" data-webskill-degraded="field-array">
|
|
1757
|
+
${str(props, "degradedNote", DEFAULT_SURFACE_FORM_TEXTS.arrayFirstItemOnly)}
|
|
1758
|
+
</p>
|
|
1759
|
+
</fieldset>
|
|
1741
1760
|
`,
|
|
1742
1761
|
Field: (props) => {
|
|
1743
1762
|
const name = str(props, "name");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webskill/sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "WebSkill
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "WebSkill — browser/Node agent skill runtime (skills, tools, MCP, governance, UI)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|