@webskill/sdk 0.27.1 → 0.29.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 -3
- package/dist/agent.js +901 -120
- package/dist/{approval-BSwffz8P.js → approval-DnUytrkq.js} +7 -2
- package/dist/browser.d.ts +12 -12
- package/dist/browser.js +527 -69
- package/dist/{geometry-BXMPNuM6.js → geometry-QmrkJw1_.js} +13 -2
- package/dist/governance.d.ts +3 -3
- package/dist/{index--GvzV6Lq.d.ts → index-B5zHZDNA.d.ts} +91 -6
- package/dist/{index-C8-9-8zo.d.ts → index-C3t1jKAs.d.ts} +41 -13
- package/dist/{index-D6eSrEi5.d.ts → index-Cngzg2WS.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -7
- package/dist/{linkedDocument-0iiVPd5t.js → linkedDocument-GE-VV_Gj.js} +112 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/{miniChart-D0nYMzz8.js → miniChart-k95Dpy0q.js} +82 -4
- package/dist/node.d.ts +4 -3
- package/dist/node.js +19 -2
- package/dist/{openUiLibrary-CxtrnX54.js → openUiLibrary-BnhYUlqY.js} +1 -1
- package/dist/{openUiSpecLang-DIcLcybq.js → openUiSpecLang-C8qNOxzA.js} +432 -19
- package/dist/{renderResult-D9Q-Vu2x.js → renderResult-2v3WQzs_.js} +5 -2
- package/dist/{skillVersionStore-S4_HJ_Fl-Ds97pwm5.d.ts → skillVersionStore-S4_HJ_Fl-AiNsSSdO.d.ts} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-CpDRZ0rA-CFQ-vdKz.d.ts → types-wKp3YBSM-D7w-ZbsB.d.ts} +8 -3
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +5767 -793
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +13 -7
- package/dist/{webSkillApi-C_7CTwtB.js → webSkillApi-TeWPPFDn.js} +1 -1
- package/dist/{webskillLitCatalog-BPyjYuRT.js → webskillLitCatalog-MfiLE5aq.js} +41 -2
- package/package.json +3 -1
- package/dist/kind-Dc8x0HWz.js +0 -110
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-
|
|
1
|
+
import { S as UiBridge, b as RenderResultRequest, c as InteractionResponse, s as InteractionRequest } from "./types-wKp3YBSM-D7w-ZbsB.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 { a as applySuggestion, c as DEFAULT_SURFACE_FORM_TEXTS, i as renderMiniMarkdown, m as shapeInteractionValue, o as collectValues, r as renderMiniChart, u as interactionToFormModel } from "./miniChart-
|
|
1
|
+
import { a as applySuggestion, c as DEFAULT_SURFACE_FORM_TEXTS, i as renderMiniMarkdown, m as shapeInteractionValue, o as collectValues, r as renderMiniChart, u as interactionToFormModel } from "./miniChart-k95Dpy0q.js";
|
|
2
2
|
import { defineComponent, h, reactive, ref } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region ../ui-vue/src/bridgeState.ts
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Nt as UiSpecNode } from "./types-
|
|
2
|
-
import { Cr as buildRenderResult } from "./index-
|
|
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, 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, type EchartHandle, 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 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, 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, normalizeFieldOptions, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, resolveChartColors, resolveChartFontSizes, resolveColumnWidths, resolveInteractionTexts, resolveSurfaceFormTexts, resolveSurfaceHostControlTexts, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toEchartsOption, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
|
1
|
+
import { Nt as UiSpecNode } from "./types-wKp3YBSM-D7w-ZbsB.js";
|
|
2
|
+
import { Cr as buildRenderResult } from "./index-Cngzg2WS.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-C3t1jKAs.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, 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
2
|
-
import { t as buildRenderResult } from "./renderResult-
|
|
3
|
-
import { a as applySuggestion, c as DEFAULT_SURFACE_FORM_TEXTS, d as resolveInteractionTexts, f as resolveSurfaceFormTexts, i as renderMiniMarkdown, l as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, m as shapeInteractionValue, n as chartToTable, o as collectValues, p as resolveSurfaceHostControlTexts, r as renderMiniChart, s as DEFAULT_INTERACTION_TEXTS, t as CHART_PALETTE, u as interactionToFormModel } from "./miniChart-
|
|
4
|
-
import {
|
|
2
|
+
import { t as buildRenderResult } from "./renderResult-2v3WQzs_.js";
|
|
3
|
+
import { a as applySuggestion, c as DEFAULT_SURFACE_FORM_TEXTS, d as resolveInteractionTexts, f as resolveSurfaceFormTexts, i as renderMiniMarkdown, l as DEFAULT_SURFACE_HOST_CONTROL_TEXTS, m as shapeInteractionValue, n as chartToTable, o as collectValues, p as resolveSurfaceHostControlTexts, r as renderMiniChart, s as DEFAULT_INTERACTION_TEXTS, t as CHART_PALETTE, u as interactionToFormModel } from "./miniChart-k95Dpy0q.js";
|
|
4
|
+
import { A as DEFAULT_CHART_COLORS, C as applyEchartTheme, D as sanitizeEchartOption, E as echartOptionFromProps, F as resolveChartFontSizes, I as toEchartsOption, M as chartSpecFromProps, N as mountEchart, O as chartSpecFromEchartsOption, P as resolveChartColors, S as gaugePercent, T as ECHART_SERIES_TYPES, _ as defineUiCatalog, a as SPEC_TABLE_MIN_COLUMN_VAR, b as CATALOG_SCHEMA_MAX, c as resolveColumnWidths, d as collectFormScopes, f as collectScopedValues, g as uiCatalog, h as UI_CATALOG_PROMPT_BUDGET_BYTES, i as normalizeFieldOptions, j as DEFAULT_CHART_FONT_SIZES, k as renderEchartFallback, l as MAX_CONDITION_DEPTH, m as UI_CATALOG_GROUPS, n as interactionToUiSpec, o as SPEC_TABLE_MIN_COLUMN_WIDTH, p as qualifyFieldName, r as toJsonRenderSpec, s as normalizeColumnWidths, t as toOpenUiSpecLang, u as evaluateFieldCondition, v as CATALOG_BUDGET_STAGE, w as mountEchartOption, x as PLANNED_INCREMENT, y as CATALOG_PROMPT_MAX } from "./openUiSpecLang-C8qNOxzA.js";
|
|
5
5
|
|
|
6
6
|
//#region ../ui/src/web/resultRenderer.ts
|
|
7
7
|
/** RenderBlock → DOM(markdown/json/table/image/file/chart 六种) */
|
|
@@ -104,6 +104,7 @@ const VIEWER_FALLBACK_ATTR = "data-webskill-fallback";
|
|
|
104
104
|
/** 文档面可用的组件白名单(FR-19.3)。字面量数组——不接受任何按名动态加载 */
|
|
105
105
|
const DOCUMENT_COMPONENTS = [
|
|
106
106
|
"Chart",
|
|
107
|
+
"EChart",
|
|
107
108
|
"Table",
|
|
108
109
|
"Metric",
|
|
109
110
|
"Gauge",
|
|
@@ -179,6 +180,11 @@ function render(element, name, props, options) {
|
|
|
179
180
|
handle.setChart(chartSpecFromProps(props), options?.fontSizes, options?.colors);
|
|
180
181
|
return handle;
|
|
181
182
|
}
|
|
183
|
+
case "EChart": {
|
|
184
|
+
const handle = mountEchartOption(element);
|
|
185
|
+
handle.setOption(props["option"] ?? {}, options?.fontSizes, options?.colors, props["fallback"] === "table" ? "table" : "auto");
|
|
186
|
+
return handle;
|
|
187
|
+
}
|
|
182
188
|
case "Table":
|
|
183
189
|
renderBlocks(element, [{
|
|
184
190
|
type: "table",
|
|
@@ -504,8 +510,8 @@ const charts = {
|
|
|
504
510
|
summary: "One question, one chart, with the takeaway spelled out above it.",
|
|
505
511
|
guidance: [
|
|
506
512
|
"Layout: `Card` → `Heading` (the takeaway, not \"Chart\") → `Chart` → optional `Text` for the caveat.",
|
|
507
|
-
"Pick the chart type from the question: `line` / `area` for time, `bar` for comparison, `pie` for shares.",
|
|
508
|
-
"Every series needs a name; labels and values must be the same length.",
|
|
513
|
+
"Pick the chart type from the question: `line` / `area` for time, `bar` for comparison, `pie` for shares. For a bar-and-line overlay, use `bar-line` and set each series `type` explicitly (`bar` or `line`).",
|
|
514
|
+
"Every series needs a name; labels and values must be the same length. For mixed series types, multiple axes or rich labels, use `EChart` with a declarative `option` and no functions or event handlers.",
|
|
509
515
|
"Never repeat the same numbers in a `Table` right under the chart."
|
|
510
516
|
].join("\n"),
|
|
511
517
|
example: {
|
|
@@ -1234,7 +1240,7 @@ function fromA2uiSpecAction(event) {
|
|
|
1234
1240
|
*/
|
|
1235
1241
|
async function loadWebSkillLitCatalog() {
|
|
1236
1242
|
try {
|
|
1237
|
-
const { webskillLitCatalog } = await import("./webskillLitCatalog-
|
|
1243
|
+
const { webskillLitCatalog } = await import("./webskillLitCatalog-MfiLE5aq.js");
|
|
1238
1244
|
return webskillLitCatalog();
|
|
1239
1245
|
} catch (cause) {
|
|
1240
1246
|
throw new WebSkillError("UI_UNAVAILABLE", "The WebSkill A2UI catalog is unavailable; install @a2ui/lit, @a2ui/web_core and lit to render catalog surfaces with A2UI", cause);
|
|
@@ -1262,4 +1268,4 @@ async function loadOpenUiPeers() {
|
|
|
1262
1268
|
}
|
|
1263
1269
|
|
|
1264
1270
|
//#endregion
|
|
1265
|
-
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_CHART_COLORS, DEFAULT_CHART_FONT_SIZES, DEFAULT_INTERACTION_TEXTS, DEFAULT_SURFACE_FORM_TEXTS, DEFAULT_SURFACE_HOST_CONTROL_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, normalizeFieldOptions, qualifyFieldName, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, resolveChartColors, resolveChartFontSizes, resolveColumnWidths, resolveInteractionTexts, resolveSurfaceFormTexts, resolveSurfaceHostControlTexts, shapeInteractionValue, A2UI_CHILDREN_PROP as t, toA2uiSpecMessages, toA2uiSurfaceAction, toEchartsOption, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
|
1271
|
+
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_CHART_COLORS, DEFAULT_CHART_FONT_SIZES, DEFAULT_INTERACTION_TEXTS, DEFAULT_SURFACE_FORM_TEXTS, DEFAULT_SURFACE_HOST_CONTROL_TEXTS, DESCRIBE_UI_PRESET_TOOL, DOCUMENT_COMPONENTS, ECHART_SERIES_TYPES, 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, 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, A2UI_CHILDREN_PROP as t, toA2uiSpecMessages, toA2uiSurfaceAction, toEchartsOption, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog, uiPreset };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
2
2
|
import { b as parseSkillMarkdown, i as buildCatalog, n as SkillDiscovery, t as validateSkills } from "./skill-WSUDp6A1.js";
|
|
3
|
-
import { f as WebSkillRuntime } from "./approval-
|
|
3
|
+
import { f as WebSkillRuntime } from "./approval-DnUytrkq.js";
|
|
4
4
|
|
|
5
5
|
//#region ../runtime/src/facade/webSkillApi.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as DEFAULT_SURFACE_FORM_TEXTS, i as renderMiniMarkdown } from "./miniChart-
|
|
2
|
-
import {
|
|
1
|
+
import { c as DEFAULT_SURFACE_FORM_TEXTS, i as renderMiniMarkdown } from "./miniChart-k95Dpy0q.js";
|
|
2
|
+
import { M as chartSpecFromProps, N as mountEchart, g as uiCatalog, i as normalizeFieldOptions, w as mountEchartOption } from "./openUiSpecLang-C8qNOxzA.js";
|
|
3
3
|
import { WEBSKILL_A2UI_CATALOG_ID, a2uiComponentShapes, t as A2UI_CHILDREN_PROP } from "./ui.js";
|
|
4
4
|
import { A2uiController, A2uiLitElement } from "@a2ui/lit/v0_9";
|
|
5
5
|
import { Catalog } from "@a2ui/web_core/v0_9";
|
|
@@ -1460,6 +1460,41 @@ var EchartDirective = class extends f {
|
|
|
1460
1460
|
}
|
|
1461
1461
|
};
|
|
1462
1462
|
const echart = e(EchartDirective);
|
|
1463
|
+
var EchartOptionDirective = class extends f {
|
|
1464
|
+
#element;
|
|
1465
|
+
#handle;
|
|
1466
|
+
#option;
|
|
1467
|
+
#fallback = "auto";
|
|
1468
|
+
constructor(partInfo) {
|
|
1469
|
+
super(partInfo);
|
|
1470
|
+
if (partInfo.type !== t.ELEMENT) throw new Error("echartOption() must be used as an element directive");
|
|
1471
|
+
}
|
|
1472
|
+
render(_option, _fallback) {
|
|
1473
|
+
return A;
|
|
1474
|
+
}
|
|
1475
|
+
update(part, [option, fallback = "auto"]) {
|
|
1476
|
+
const element = part.element;
|
|
1477
|
+
if (this.#element !== element) {
|
|
1478
|
+
this.#handle?.dispose();
|
|
1479
|
+
this.#element = element;
|
|
1480
|
+
this.#handle = mountEchartOption(element);
|
|
1481
|
+
}
|
|
1482
|
+
this.#option = option;
|
|
1483
|
+
this.#fallback = fallback;
|
|
1484
|
+
this.#handle?.setOption(option, void 0, void 0, fallback);
|
|
1485
|
+
return A;
|
|
1486
|
+
}
|
|
1487
|
+
disconnected() {
|
|
1488
|
+
this.#handle?.dispose();
|
|
1489
|
+
this.#handle = void 0;
|
|
1490
|
+
}
|
|
1491
|
+
reconnected() {
|
|
1492
|
+
if (!this.#element || !this.#option) return;
|
|
1493
|
+
this.#handle = mountEchartOption(this.#element);
|
|
1494
|
+
this.#handle.setOption(this.#option, void 0, void 0, this.#fallback);
|
|
1495
|
+
}
|
|
1496
|
+
};
|
|
1497
|
+
const echartOption = e(EchartOptionDirective);
|
|
1463
1498
|
|
|
1464
1499
|
//#endregion
|
|
1465
1500
|
//#region ../ui/src/a2uiRuntime/webskillLitCatalog.ts
|
|
@@ -1778,6 +1813,10 @@ const renderers = {
|
|
|
1778
1813
|
</div>
|
|
1779
1814
|
`,
|
|
1780
1815
|
Chart: (props) => T`<div class="chart" ${echart(chartSpecFromProps(props))}></div>`,
|
|
1816
|
+
EChart: (props) => T`<div
|
|
1817
|
+
class="chart"
|
|
1818
|
+
${echartOption(props["option"] ?? {}, props["fallback"] === "table" ? "table" : "auto")}
|
|
1819
|
+
></div>`,
|
|
1781
1820
|
Icon: (props) => T`<span class="icon" role="img" aria-label=${str(props, "name")} data-palette=${str(props, "palette")}
|
|
1782
1821
|
>${ICON_GLYPH[str(props, "name")] ?? str(props, "name")}</span
|
|
1783
1822
|
>`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webskill/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "WebSkill — browser/Node agent skill runtime (skills, tools, MCP, governance, UI)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -63,7 +63,9 @@
|
|
|
63
63
|
"typecheck": "tsc --noEmit"
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
+
"@e965/xlsx": "0.20.3",
|
|
66
67
|
"fflate": "0.8.3",
|
|
68
|
+
"saxes": "6.0.0",
|
|
67
69
|
"write-excel-file": "^4.1.1",
|
|
68
70
|
"yaml": "^2.9.0",
|
|
69
71
|
"zod": "^4.0.0"
|
package/dist/kind-Dc8x0HWz.js
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
//#region ../core/src/attachment/kind.ts
|
|
2
|
-
/** 可作为图片分片外发的 MIME 类型 @experimental */
|
|
3
|
-
const IMAGE_MIME_TYPES = [
|
|
4
|
-
"image/png",
|
|
5
|
-
"image/jpeg",
|
|
6
|
-
"image/webp",
|
|
7
|
-
"image/gif"
|
|
8
|
-
];
|
|
9
|
-
/**
|
|
10
|
-
* 可按文本读取的扩展名。accept 白名单与判定白名单共用这一份——
|
|
11
|
-
* 0.5.x 两处不一致,`log`/`yaml`/`yml` 能通过判定却在文件选择器里选不到。
|
|
12
|
-
*/
|
|
13
|
-
const TEXT_EXTENSIONS = [
|
|
14
|
-
"txt",
|
|
15
|
-
"md",
|
|
16
|
-
"csv",
|
|
17
|
-
"json",
|
|
18
|
-
"log",
|
|
19
|
-
"yaml",
|
|
20
|
-
"yml"
|
|
21
|
-
];
|
|
22
|
-
/** 非文本非图片但仍可整体外发的类型(provider 的 file 分片) @experimental */
|
|
23
|
-
const FILE_MIME_TYPES = ["application/pdf"];
|
|
24
|
-
/**
|
|
25
|
-
* 需要**客户端先抽取成文本**才能外发的类型(FR-23.9 / 0.13.0 FR-12.5 / 0.22.0 分册 18)。
|
|
26
|
-
* 不走直通的 `file`:docx / xlsx / pptx 发给 provider 会被当成二进制垃圾。
|
|
27
|
-
*/
|
|
28
|
-
const DOCX_MIME = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
29
|
-
const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
30
|
-
const PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
31
|
-
/** 文本类附件进模型上下文的字符上限(0.6.0) @experimental */
|
|
32
|
-
const ATTACHMENT_TEXT_LIMIT = 32 * 1024;
|
|
33
|
-
/**
|
|
34
|
-
* DWG 图纸的 MIME。没有官方注册值,各家各发一套,浏览器上传时更常见的是空串。
|
|
35
|
-
* @experimental
|
|
36
|
-
*/
|
|
37
|
-
const DWG_MIME_TYPES = [
|
|
38
|
-
"image/vnd.dwg",
|
|
39
|
-
"application/acad",
|
|
40
|
-
"application/x-acad",
|
|
41
|
-
"application/dwg",
|
|
42
|
-
"application/x-dwg",
|
|
43
|
-
"drawing/dwg"
|
|
44
|
-
];
|
|
45
|
-
/**
|
|
46
|
-
* 只存字节、不进上下文的扩展名。仍然是**白名单制**:
|
|
47
|
-
* 新增 `binary` 类别不等于任意二进制放行(AC-19.18)。
|
|
48
|
-
* @experimental
|
|
49
|
-
*/
|
|
50
|
-
const BINARY_EXTENSIONS = ["dwg"];
|
|
51
|
-
const TEXT_EXTENSION_SET = new Set(TEXT_EXTENSIONS);
|
|
52
|
-
const IMAGE_MIME_SET = new Set(IMAGE_MIME_TYPES);
|
|
53
|
-
const FILE_MIME_SET = new Set(FILE_MIME_TYPES);
|
|
54
|
-
const EXTRACTED_MIME_SET = /* @__PURE__ */ new Set([
|
|
55
|
-
DOCX_MIME,
|
|
56
|
-
XLSX_MIME,
|
|
57
|
-
PPTX_MIME
|
|
58
|
-
]);
|
|
59
|
-
const EXTRACTED_EXTENSION_SET = /* @__PURE__ */ new Set([
|
|
60
|
-
"docx",
|
|
61
|
-
"xlsx",
|
|
62
|
-
"pptx"
|
|
63
|
-
]);
|
|
64
|
-
const BINARY_MIME_SET = new Set(DWG_MIME_TYPES);
|
|
65
|
-
const BINARY_EXTENSION_SET = new Set(BINARY_EXTENSIONS);
|
|
66
|
-
/** 下载与上传都常把认不出的类型标成它,此时只能看扩展名 */
|
|
67
|
-
const OPAQUE_MIME = "application/octet-stream";
|
|
68
|
-
function extensionOf(fileName) {
|
|
69
|
-
return fileName.split(".").pop()?.toLowerCase() ?? "";
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* 三种待抽取格式共用 `document-text` 这一种 kind,选抽取器时要按格式再分一次。
|
|
73
|
-
* 下载列表与上传入口必须得出同一结论(AC-20.17),所以只能在这里一份。
|
|
74
|
-
* @experimental
|
|
75
|
-
*/
|
|
76
|
-
function extractedDocumentFormat(contentType, fileName) {
|
|
77
|
-
const type = contentType.toLowerCase();
|
|
78
|
-
if (type !== "") {
|
|
79
|
-
if (type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") return "xlsx";
|
|
80
|
-
if (type === "application/vnd.openxmlformats-officedocument.presentationml.presentation") return "pptx";
|
|
81
|
-
return "docx";
|
|
82
|
-
}
|
|
83
|
-
const ext = extensionOf(fileName);
|
|
84
|
-
return ext === "xlsx" ? "xlsx" : ext === "pptx" ? "pptx" : "docx";
|
|
85
|
-
}
|
|
86
|
-
/** 分类集中一处,不散落在各 UI 分支里 @experimental */ function classifyAttachment(contentType, fileName) {
|
|
87
|
-
const type = contentType.toLowerCase();
|
|
88
|
-
if (IMAGE_MIME_SET.has(type)) return "image";
|
|
89
|
-
if (BINARY_MIME_SET.has(type)) return "binary";
|
|
90
|
-
if (EXTRACTED_MIME_SET.has(type)) return "document-text";
|
|
91
|
-
if (FILE_MIME_SET.has(type)) return "file";
|
|
92
|
-
if (type.startsWith("text/") || type === "application/json") return "text";
|
|
93
|
-
if (type === "" && TEXT_EXTENSION_SET.has(extensionOf(fileName))) return "text";
|
|
94
|
-
if (type === "" && EXTRACTED_EXTENSION_SET.has(extensionOf(fileName))) return "document-text";
|
|
95
|
-
if ((type === "" || type === OPAQUE_MIME) && BINARY_EXTENSION_SET.has(extensionOf(fileName))) return "binary";
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* 文本类附件进模型上下文的最终形态。两条入口共用,差别只有出处那一段(0.14.0 D-20-6)。
|
|
99
|
-
* @experimental
|
|
100
|
-
*/
|
|
101
|
-
function formatAttachmentText(input) {
|
|
102
|
-
const limit = input.limit ?? 32768;
|
|
103
|
-
const clipped = input.body.length > limit ? `${input.body.slice(0, limit)}\n[truncated]` : input.body;
|
|
104
|
-
const bodyOnly = input.kind === "document-text" ? ", body text only" : "";
|
|
105
|
-
const from = input.origin === "download" ? ", from this device's downloads" : "";
|
|
106
|
-
return `--- Attachment: ${input.name} (${input.contentType}${bodyOnly}${from}) ---\n${clipped}`;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
//#endregion
|
|
110
|
-
export { FILE_MIME_TYPES as a, TEXT_EXTENSIONS as c, extractedDocumentFormat as d, formatAttachmentText as f, DWG_MIME_TYPES as i, XLSX_MIME as l, BINARY_EXTENSIONS as n, IMAGE_MIME_TYPES as o, DOCX_MIME as r, PPTX_MIME as s, ATTACHMENT_TEXT_LIMIT as t, classifyAttachment as u };
|