@webskill/sdk 0.10.0 → 0.11.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 +3 -2
- package/dist/agent.js +3 -1102
- package/dist/browser.d.ts +258 -11
- package/dist/browser.js +758 -46
- package/dist/{catalogComponents-DTcYfpLQ-CcoOaz-Z.js → catalogComponents-BFoqpT1v-CjUBZ3bc.js} +253 -14
- package/dist/{dist-BViUeszk.js → dist-B-cOu08W.js} +526 -76
- package/dist/{dist-1OFC-zax.js → dist-DTHZS2k1.js} +520 -28
- package/dist/dist-qnlI2Iup.js +1280 -0
- package/dist/{eventTypes-s2uwAcLG-Go3l_dUe.js → eventTypes-FllCrX-Z-DNDeHWoG.js} +6 -2
- package/dist/governance.d.ts +7 -3
- package/dist/governance.js +1 -1
- package/dist/{index-DtFdMKBX.d.ts → index-D3mONFHD.d.ts} +220 -7
- package/dist/{index-B0QPLWPZ.d.ts → index-DACk2_XZ.d.ts} +110 -7
- package/dist/{index-BF4E1a9j.d.ts → index-DWbs58LF.d.ts} +227 -14
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/mcp.d.ts +35 -7
- package/dist/mcp.js +88 -21
- package/dist/node.d.ts +3 -3
- package/dist/node.js +52 -2
- package/dist/{openUiLibrary-CIrV--Ad-B8zG_91e.js → openUiLibrary-D5u8oIvx-BLOAQCho.js} +3 -3
- package/dist/processSandboxEntry.js +6 -0
- package/dist/sandboxWorkerEntry.js +6 -0
- package/dist/{skillVersionStore-D-qHk9ZE-DBsYYCWn.d.ts → skillVersionStore-D-qHk9ZE-BcmFLykd.d.ts} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-CrRcT-LM-DZAp8sWv.d.ts → types-C26b05fW-CdrRCRDb.d.ts} +20 -4
- package/dist/ui-react.d.ts +2 -2
- package/dist/ui-react.js +28 -10
- 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-BJrphK0y-SGmRXaaO.js → webskillLitCatalog-DME6PBkV-CmYNLlIT.js} +135 -16
- package/package.json +1 -1
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
1
|
+
import { Z as buildRenderResult } from "./dist-B-cOu08W.js";
|
|
2
|
+
import { $ as uiPreset, A as ensureStyles, B as mountViewerComponents, C as applySuggestion, D as collectSpecActions, E as collectScopedValues, F as fromVercelToolResult, G as renderRenderResult, H as qualifyFieldName, I as gaugePercent, J as toA2uiSurfaceAction, K as resolveColumnWidths, L as interactionToUiSpec, M as fromA2uiSpecAction, N as fromA2uiSurfaceAction, O as collectValues, P as fromUiSurfaceActionDispatch, Q as toVercelToolInvocation, R as loadOpenUiPeers, S as WebFormBridge, St as uiCatalog, T as collectFormScopes, U as renderBlocks, V as normalizeColumnWidths, W as renderMiniChart, X as toOpenUiSpecLang, Y as toJsonRenderSpec, Z as toUiSurfaceActionDispatch, _ as VIEWER_FALLBACK_ATTR, _t as mountEchart, a as A2UI_VERSION, at as DEFAULT_INTERACTION_TEXTS, b as WEBSKILL_STYLES_CSS, bt as resolveSurfaceFormTexts, c as DOCUMENT_COMPONENTS, ct as UI_CATALOG_GROUPS, d as SPEC_TABLE_MIN_COLUMN_VAR, dt as a2uiComponentSchema, f as SPEC_TABLE_MIN_COLUMN_WIDTH, ft as a2uiComponentShapes, g as VIEWER_COMPONENT_ATTR, gt as interactionToFormModel, h as VERCEL_INTERACTION_TOOL_NAME, ht as defineUiCatalog, i as A2UI_SURFACE_ACTION, it as CATALOG_SCHEMA_MAX, j as evaluateFieldCondition, k as createUiCatalogToolSource, l as MAX_CONDITION_DEPTH, lt as UI_CATALOG_PROMPT_BUDGET_BYTES, m as UI_PRESET_NAMES, mt as chartSpecFromProps, n as A2UI_SPEC_ACTION, nt as CATALOG_BUDGET_STAGE, o as CHART_PALETTE, ot as DEFAULT_SURFACE_FORM_TEXTS, p as UI_PRESETS, pt as buildA2uiCatalogDefinition, q as toA2uiSpecMessages, r as A2UI_SPEC_FORM_PATH, rt as CATALOG_PROMPT_MAX, s as DESCRIBE_UI_PRESET_TOOL, st as PLANNED_INCREMENT, t as A2UI_BASIC_CATALOG_ID, tt as A2UI_COMMON_TYPES, u as RENDER_UI_TOOL, ut as WEBSKILL_A2UI_CATALOG_ID, v as VIEWER_PROPS_ATTR, vt as renderMiniMarkdown, w as chartToTable, x as WEBSKILL_SURFACE_ACTION, xt as shapeInteractionValue, y as VercelUiBridge, yt as resolveInteractionTexts, z as loadWebSkillLitCatalog } from "./dist-DTHZS2k1.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, 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 };
|
|
4
|
+
export { A2UI_BASIC_CATALOG_ID, A2UI_COMMON_TYPES, A2UI_SPEC_ACTION, A2UI_SPEC_FORM_PATH, A2UI_SURFACE_ACTION, A2UI_VERSION, CATALOG_BUDGET_STAGE, CATALOG_PROMPT_MAX, CATALOG_SCHEMA_MAX, CHART_PALETTE, DEFAULT_INTERACTION_TEXTS, DEFAULT_SURFACE_FORM_TEXTS, DESCRIBE_UI_PRESET_TOOL, DOCUMENT_COMPONENTS, MAX_CONDITION_DEPTH, PLANNED_INCREMENT, 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, VIEWER_COMPONENT_ATTR, VIEWER_FALLBACK_ATTR, VIEWER_PROPS_ATTR, 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, gaugePercent, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, mountViewerComponents, normalizeColumnWidths, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, resolveColumnWidths, resolveInteractionTexts, resolveSurfaceFormTexts, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
package/dist/{webskillLitCatalog-BJrphK0y-SGmRXaaO.js → webskillLitCatalog-DME6PBkV-CmYNLlIT.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { St as uiCatalog, _t as mountEchart, et as A2UI_CHILDREN_PROP, ft as a2uiComponentShapes, mt as chartSpecFromProps, ot as DEFAULT_SURFACE_FORM_TEXTS, ut as WEBSKILL_A2UI_CATALOG_ID, vt as renderMiniMarkdown } from "./dist-DTHZS2k1.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-DME6PBkV.js
|
|
1423
1423
|
/**
|
|
1424
1424
|
* Lit 元素上的 echarts 挂载指令。
|
|
1425
1425
|
* A2UI 档的 catalog `Chart` 渲染在 shadow root 里,实例必须随元素断开而 dispose,
|
|
@@ -1460,6 +1460,37 @@ var EchartDirective = class extends f {
|
|
|
1460
1460
|
const echart = e(EchartDirective);
|
|
1461
1461
|
/** 自定义元素 tag 前缀(同一文档里与 A2UI Basic Catalog 的 `a2ui-basic-*` 互不冲突) */
|
|
1462
1462
|
const WEBSKILL_A2UI_TAG_PREFIX = "webskill-a2ui";
|
|
1463
|
+
/** 与 React 档 `specLayout.tsx` 同一组取值:语义档最小列宽与主次分栏比例 */
|
|
1464
|
+
const MIN_COLUMN_WIDTH = {
|
|
1465
|
+
sm: "12rem",
|
|
1466
|
+
md: "16rem",
|
|
1467
|
+
lg: "22rem"
|
|
1468
|
+
};
|
|
1469
|
+
const SPLIT_RATIO = {
|
|
1470
|
+
"1:1": "1fr 1fr",
|
|
1471
|
+
"2:1": "2fr 1fr",
|
|
1472
|
+
"3:1": "3fr 1fr",
|
|
1473
|
+
"1:2": "1fr 2fr"
|
|
1474
|
+
};
|
|
1475
|
+
/** 与 React 档 `specLayout.tsx` 同一组字形:白名单外的名字降级为可读文本 */
|
|
1476
|
+
const ICON_GLYPH = {
|
|
1477
|
+
info: "ℹ",
|
|
1478
|
+
check: "✓",
|
|
1479
|
+
alert: "⚠",
|
|
1480
|
+
x: "✕",
|
|
1481
|
+
clock: "◷",
|
|
1482
|
+
calendar: "▤",
|
|
1483
|
+
user: "☺",
|
|
1484
|
+
star: "★",
|
|
1485
|
+
search: "⌕",
|
|
1486
|
+
settings: "⚙",
|
|
1487
|
+
download: "↓",
|
|
1488
|
+
link: "🔗",
|
|
1489
|
+
chart: "▥",
|
|
1490
|
+
file: "▢",
|
|
1491
|
+
folder: "▤",
|
|
1492
|
+
mail: "✉"
|
|
1493
|
+
};
|
|
1463
1494
|
/**
|
|
1464
1495
|
* ui-kit 设计 token 是 `:root` 上的 CSS 自定义属性,CSS 变量天然继承进 shadow root,
|
|
1465
1496
|
* 因此这些元素直接消费 `var(--border)` 等 token,亮暗切换随宿主 `.dark` 生效。
|
|
@@ -1617,6 +1648,25 @@ const sharedStyles = i$4`
|
|
|
1617
1648
|
display: grid;
|
|
1618
1649
|
gap: 0.75rem;
|
|
1619
1650
|
}
|
|
1651
|
+
.split {
|
|
1652
|
+
display: grid;
|
|
1653
|
+
gap: 0.75rem;
|
|
1654
|
+
}
|
|
1655
|
+
/* 与 ui-kit 的 .webskill-spec-form__fields 同一判据(FR-11.6) */
|
|
1656
|
+
.webskill-spec-form__fields {
|
|
1657
|
+
display: grid;
|
|
1658
|
+
gap: 0.75rem;
|
|
1659
|
+
container-type: inline-size;
|
|
1660
|
+
}
|
|
1661
|
+
.webskill-spec-form__fields:has(> :nth-child(6)) {
|
|
1662
|
+
grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
|
|
1663
|
+
}
|
|
1664
|
+
/* 窄容器降级为纵向堆叠:surface 可能被塞进任意宽度的宿主容器 */
|
|
1665
|
+
@container (max-width: 30rem) {
|
|
1666
|
+
.split {
|
|
1667
|
+
grid-template-columns: 1fr !important;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1620
1670
|
ol.timeline {
|
|
1621
1671
|
display: flex;
|
|
1622
1672
|
flex-direction: column;
|
|
@@ -1663,23 +1713,30 @@ const renderers = {
|
|
|
1663
1713
|
<div class="stack" data-direction="vertical">
|
|
1664
1714
|
<div class="tabs" role="tablist">
|
|
1665
1715
|
${labels.map((label, index) => T`<button
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1716
|
+
type="button"
|
|
1717
|
+
role="tab"
|
|
1718
|
+
aria-selected=${index === active ? "true" : "false"}
|
|
1719
|
+
@click=${() => {
|
|
1670
1720
|
host.view["tab"] = index;
|
|
1671
1721
|
host.refresh();
|
|
1672
1722
|
}}
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1723
|
+
>
|
|
1724
|
+
${label}
|
|
1725
|
+
</button>`)}
|
|
1676
1726
|
</div>
|
|
1677
1727
|
${panels[active] ? host.renderChild(panels[active]) : A}
|
|
1678
1728
|
</div>
|
|
1679
1729
|
`;
|
|
1680
1730
|
},
|
|
1681
|
-
Grid: (props, host) =>
|
|
1682
|
-
|
|
1731
|
+
Grid: (props, host) => {
|
|
1732
|
+
const min = MIN_COLUMN_WIDTH[str(props, "minColumnWidth", "md")] ?? MIN_COLUMN_WIDTH["md"];
|
|
1733
|
+
return T`<div class="grid" style=${`grid-template-columns: ${props["columns"] === "auto" ? `repeat(auto-fit, minmax(${min}, 1fr))` : `repeat(${Number(props["columns"] ?? 2)}, minmax(0, 1fr))`}`}>${children(props, host)}</div>`;
|
|
1734
|
+
},
|
|
1735
|
+
Split: (props, host) => T`
|
|
1736
|
+
<div
|
|
1737
|
+
class="split"
|
|
1738
|
+
style=${`grid-template-columns: ${SPLIT_RATIO[str(props, "ratio", "1:1")] ?? SPLIT_RATIO["1:1"]}`}
|
|
1739
|
+
>
|
|
1683
1740
|
${children(props, host)}
|
|
1684
1741
|
</div>
|
|
1685
1742
|
`,
|
|
@@ -1716,13 +1773,74 @@ const renderers = {
|
|
|
1716
1773
|
</div>
|
|
1717
1774
|
`,
|
|
1718
1775
|
Chart: (props) => T`<div class="chart" ${echart(chartSpecFromProps(props))}></div>`,
|
|
1776
|
+
Icon: (props) => T`<span class="icon" role="img" aria-label=${str(props, "name")} data-palette=${str(props, "palette")}
|
|
1777
|
+
>${ICON_GLYPH[str(props, "name")] ?? str(props, "name")}</span
|
|
1778
|
+
>`,
|
|
1779
|
+
Image: (props) => T`<img class="image" src=${str(props, "src")} alt=${str(props, "alt")} />`,
|
|
1780
|
+
Quote: (props) => T`
|
|
1781
|
+
<blockquote class="quote">
|
|
1782
|
+
${str(props, "text")}${props["by"] ? T`<footer class="muted">— ${str(props, "by")}</footer>` : A}
|
|
1783
|
+
</blockquote>
|
|
1784
|
+
`,
|
|
1785
|
+
Callout: (props) => T`
|
|
1786
|
+
<aside class="callout" data-palette=${str(props, "palette")}>
|
|
1787
|
+
${props["title"] ? T`<strong>${str(props, "title")}</strong>` : A}
|
|
1788
|
+
<p>${str(props, "text")}</p>
|
|
1789
|
+
</aside>
|
|
1790
|
+
`,
|
|
1791
|
+
KeyValue: (props) => T`
|
|
1792
|
+
<dl class="keyvalue">
|
|
1793
|
+
${list(props["items"]).map((item) => T`<dt class="muted">${String(item["label"] ?? "")}</dt>
|
|
1794
|
+
<dd>${String(item["value"] ?? "")}</dd>`)}
|
|
1795
|
+
</dl>
|
|
1796
|
+
`,
|
|
1797
|
+
Gauge: (props) => {
|
|
1798
|
+
const min = Number(props["min"] ?? 0);
|
|
1799
|
+
const max = Number(props["max"] ?? 100);
|
|
1800
|
+
const value = Number(props["value"] ?? min);
|
|
1801
|
+
const span = max - min;
|
|
1802
|
+
const percent = span > 0 ? Math.max(0, Math.min(100, (value - min) / span * 100)) : 0;
|
|
1803
|
+
return T`
|
|
1804
|
+
<div class="metric">
|
|
1805
|
+
${props["label"] ? T`<span class="muted">${str(props, "label")}</span>` : A}
|
|
1806
|
+
<div
|
|
1807
|
+
class="bar"
|
|
1808
|
+
role="meter"
|
|
1809
|
+
aria-valuenow=${value}
|
|
1810
|
+
aria-valuemin=${min}
|
|
1811
|
+
aria-valuemax=${max}
|
|
1812
|
+
aria-label=${str(props, "label", "Gauge")}
|
|
1813
|
+
>
|
|
1814
|
+
<span style=${`width: ${percent}%`}></span>
|
|
1815
|
+
</div>
|
|
1816
|
+
<strong>${value}</strong>
|
|
1817
|
+
</div>
|
|
1818
|
+
`;
|
|
1819
|
+
},
|
|
1820
|
+
Accordion: (props) => T`
|
|
1821
|
+
<div class="accordion">
|
|
1822
|
+
${list(props["items"]).map((item) => T`<details>
|
|
1823
|
+
<summary>${String(item["title"] ?? "")}</summary>
|
|
1824
|
+
<p>${String(item["text"] ?? "")}</p>
|
|
1825
|
+
</details>`)}
|
|
1826
|
+
</div>
|
|
1827
|
+
`,
|
|
1828
|
+
Carousel: (props) => T`
|
|
1829
|
+
<div class="carousel" role="group" aria-label="Carousel">
|
|
1830
|
+
${list(props["items"]).map((item) => T`<figure>
|
|
1831
|
+
${item["src"] ? T`<img src=${String(item["src"])} alt=${String(item["title"] ?? "")} />` : A}
|
|
1832
|
+
<figcaption>${String(item["title"] ?? "")}</figcaption>
|
|
1833
|
+
${item["text"] ? T`<p class="muted">${String(item["text"])}</p>` : A}
|
|
1834
|
+
</figure>`)}
|
|
1835
|
+
</div>
|
|
1836
|
+
`,
|
|
1719
1837
|
Timeline: (props) => T`
|
|
1720
1838
|
<ol class="timeline">
|
|
1721
1839
|
${list(props["items"]).map((item) => T`<li>
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1840
|
+
<strong>${String(item["title"] ?? "")}</strong>
|
|
1841
|
+
${item["time"] ? T`<p class="muted">${String(item["time"])}</p>` : A}
|
|
1842
|
+
${item["description"] ? T`<p>${String(item["description"])}</p>` : A}
|
|
1843
|
+
</li>`)}
|
|
1726
1844
|
</ol>
|
|
1727
1845
|
`,
|
|
1728
1846
|
Progress: (props) => {
|
|
@@ -1746,7 +1864,8 @@ const renderers = {
|
|
|
1746
1864
|
FileLink: (props) => T`<p>${str(props, "label", str(props, "path"))}</p>`,
|
|
1747
1865
|
Form: (props, host) => T`
|
|
1748
1866
|
<form @submit=${(event) => event.preventDefault()}>
|
|
1749
|
-
${props["title"] ? T`<h3>${str(props, "title")}</h3>` : A}
|
|
1867
|
+
${props["title"] ? T`<h3>${str(props, "title")}</h3>` : A}
|
|
1868
|
+
<div class="webskill-spec-form__fields">${children(props, host)}</div>
|
|
1750
1869
|
</form>
|
|
1751
1870
|
`,
|
|
1752
1871
|
FieldArray: (props, host) => T`
|