@webskill/sdk 0.4.0 → 0.5.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 -0
- package/dist/agent.js +867 -0
- package/dist/browser.d.ts +137 -4
- package/dist/browser.js +457 -17
- package/dist/{catalogComponents-KsujmL4b-Clx1kCnU.js → catalogComponents-DV7cPpUm-C77AEEx9.js} +256 -92
- package/dist/{dist-C-Sh0MDU.js → dist-6C03DShK.js} +159 -19
- package/dist/{dist-D9Lcn5Pp.js → dist-bewtXYlO.js} +592 -28
- package/dist/governance.d.ts +46 -4
- package/dist/governance.js +44 -1
- package/dist/{index-CHXxDccV.d.ts → index-Bsqg4ftU.d.ts} +97 -7
- package/dist/index-D_7ZZjkl.d.ts +411 -0
- package/dist/{index-DLfR2Y6I.d.ts → index-vBz_FC9w.d.ts} +77 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +1 -1
- package/dist/{openUiLibrary-YLS-cxyT-C96jWDQq.js → openUiLibrary-W3Ce896k-ClFTRZFs.js} +3 -3
- package/dist/{skillVersionStore-uyefLPR1-DXOzbksv.d.ts → skillVersionStore-BzLbzFOL-CxwIewHJ.d.ts} +4 -3
- package/dist/testing.d.ts +1 -1
- package/dist/{types-7Wcg--Vh-1YlQ4jF9.d.ts → types-D_hoCri8-BnNPiZCi.d.ts} +29 -4
- package/dist/ui-react.d.ts +26 -5
- package/dist/ui-react.js +96 -21
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +25 -6
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +3 -3
- package/dist/{webskillLitCatalog-CSTbhBe_-CYIs5BX8.js → webskillLitCatalog-_mugzRHx-DiuJpCuf.js} +88 -2
- package/package.json +6 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as parseSkillMarkdown, B as unzipWithLimits, C as escapeXml, D as keyIdOf, E as jsonRenderer, F as renderCatalogJson, H as verifyManifest, I as resolveArchiveLimits, L as resolveInsideRoot, M as readResponseWithLimit, N as readSkillSignature, O as messageOf, P as renderAvailableSkillsXml, R as signSkill, S as computeDigest, T as isValidSkillName, U as verifySkillSignature, V as validateSkills, W as xmlRenderer, _ as atomicWriteText, a as SIGNATURE_SCHEMA_VERSION, b as checkDependencyCycles, c as SKILL_NAME_MAX_LENGTH, d as SKILL_SIGNATURE_FILE, f as SkillDiscovery, g as assertSafePathSegment, h as assertRemoteUrlAllowed, i as MemoryFS, j as parseSkillPackManifest, k as normalizePath, l as SKILL_NAME_PATTERN, m as WebSkillError, n as FsTrustedKeyStore, o as SKILLS_LOCKFILE, p as SkillReader, r as MANIFEST_EXCLUDED_FILES, s as SKILL_MANIFEST_FILE, t as DEFAULT_ARCHIVE_LIMITS, u as SKILL_PACK_FILE, v as buildCatalog, w as exportSkills, x as checkSkillRules, y as buildManifest, z as signaturePayloadBytes } from "./dist-8oQRa8Xz.js";
|
|
2
2
|
import { i as textParts, n as partsToText } from "./memoryArtifactStore-BtOeB_hm-tj3fC5ip.js";
|
|
3
|
-
import { A as
|
|
3
|
+
import { $ as schemaToForm, A as buildRenderResult, B as fromVercelStreamPart, C as RUN_SNAPSHOT_SCHEMA_VERSION, D as TraceRecorder, E as SerializingMemoryStore, F as extractChartSpec, G as networkUrlHost, H as isUnsupportedRunSnapshot, I as extractTodoTraceEvents, J as normalizeToolError, K as normalizeErrorCode, L as extractUiSpecEvents, M as clearStoredFormValues, N as createScriptContext, O as WebSkillRuntime, P as createWebSkillApi, Q as resolveToolName, R as formFieldKey, S as READ_SKILL_FILE_TOOL_NAME, T as SESSION_SCHEMA_VERSION, U as mergeCatalogEntries, V as isNetworkAllowed, W as networkPolicyLibSource, X as putFormValues, Y as parseBridgeRequest, Z as readFormValues, _ as HookRunner, a as AnthropicClient, b as READ_SKILL_FILE_INPUT_SCHEMA, c as FORM_VALUES_KEY, d as FsMemoryStore, et as summarizeToolCalls, f as FsRunSnapshotStore, g as GoogleGenAiClient, h as FullDisclosureRouter, i as AgentLoop, it as validateUiSpecNode, j as clearFormValues, k as bridgeError, l as FS_SESSION_PAGE_SIZE, m as FsSessionStore, n as ASK_USER_TOOL, nt as toVercelToolSpecs, o as CapabilityApproval, p as FsRunTraceStore, q as normalizeToolContent, r as ASK_USER_TOOL_NAME, rt as validateUiSpecEvent, s as EventBus, t as ASK_USER_INPUT_SCHEMA, tt as toLlmToolSpec, u as FsArtifactStore, v as OpenAiCompatibleClient, w as RUN_TRACE_SCHEMA_VERSION, x as READ_SKILL_FILE_TOOL, y as ProgressiveRouter, z as fromVercelResult } from "./dist-6C03DShK.js";
|
|
4
4
|
|
|
5
|
-
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, AnthropicClient, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, EventBus, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SerializingMemoryStore, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, extractUiSpecEvents, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, mergeCatalogEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, partsToText, readResponseWithLimit, readSkillSignature, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, signSkill, signaturePayloadBytes, summarizeToolCalls, textParts, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
|
5
|
+
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, AnthropicClient, CapabilityApproval, DEFAULT_ARCHIVE_LIMITS, EventBus, FORM_VALUES_KEY, FS_SESSION_PAGE_SIZE, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FsRunTraceStore, FsSessionStore, FsTrustedKeyStore, FullDisclosureRouter, GoogleGenAiClient, HookRunner, MANIFEST_EXCLUDED_FILES, MemoryFS, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, RUN_TRACE_SCHEMA_VERSION, SESSION_SCHEMA_VERSION, SIGNATURE_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SKILL_SIGNATURE_FILE, SerializingMemoryStore, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, assertRemoteUrlAllowed, assertSafePathSegment, atomicWriteText, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, clearFormValues, clearStoredFormValues, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, extractTodoTraceEvents, extractUiSpecEvents, formFieldKey, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isUnsupportedRunSnapshot, isValidSkillName, jsonRenderer, keyIdOf, mergeCatalogEntries, messageOf, networkPolicyLibSource, networkUrlHost, normalizeErrorCode, normalizePath, normalizeToolContent, normalizeToolError, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, partsToText, putFormValues, readFormValues, readResponseWithLimit, readSkillSignature, renderAvailableSkillsXml, renderCatalogJson, resolveArchiveLimits, resolveInsideRoot, resolveToolName, schemaToForm, signSkill, signaturePayloadBytes, summarizeToolCalls, textParts, toLlmToolSpec, toVercelToolSpecs, unzipWithLimits, validateSkills, validateUiSpecEvent, validateUiSpecNode, verifyManifest, verifySkillSignature, xmlRenderer };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { I as JsonSchema, Q as SkillCatalogEntry, et as SkillDocument, g as LlmToolSpec } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
|
+
import { Nt as ToolResult, b as ExternalSkillProvider, rn as mergeCatalogEntries, x as ExternalToolSource } from "./index-vBz_FC9w.js";
|
|
3
3
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
4
4
|
import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { O as messageOf, h as assertRemoteUrlAllowed, m as WebSkillError } from "./dist-8oQRa8Xz.js";
|
|
2
|
-
import {
|
|
2
|
+
import { U as mergeCatalogEntries, q as normalizeToolContent } from "./dist-6C03DShK.js";
|
|
3
3
|
|
|
4
4
|
//#region ../mcp/dist/index.js
|
|
5
5
|
/**
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as AuditLog, p as CandidateStore, r as ApprovalPolicy, u as CandidateSkill, v as SkillVersionStore } from "./skillVersionStore-
|
|
1
|
+
import { I as JsonSchema, N as FileStat, O as ArchiveLimits, P as FileSystemProvider, U as SKILLS_LOCKFILE, W as SKILL_MANIFEST_FILE, Y as SignatureAuditSink, _t as VerifyResult, at as SkillManifest, b as UiBridge, c as InteractionResponse, dt as SkillsLockfile, ht as UnsignedPolicy, it as SkillManagerPort, pt as TrustedKeyStore, s as InteractionRequest, tt as SkillInstallSource, y as RenderResultRequest } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
|
+
import { D as FsMemoryStore, E as FsArtifactStore, Ht as WebSkillRuntimeDeps, Nt as ToolResult, Vt as WebSkillRuntime, W as NetworkPolicy, _t as SchemaInferer, d as ApprovalScope, f as BridgeCapabilities, jt as ToolDefinition, qt as createScriptContext, vt as ScriptExecutionContext, yt as ScriptExecutor } from "./index-vBz_FC9w.js";
|
|
3
|
+
import { a as AuditLog, p as CandidateStore, r as ApprovalPolicy, u as CandidateSkill, v as SkillVersionStore } from "./skillVersionStore-BzLbzFOL-CxwIewHJ.js";
|
|
4
4
|
import { n as LlmEnvConfig, s as probeLlmCapabilities, t as LlmCapabilities } from "./env-BPUBZCwJ-4jat_SVG.js";
|
|
5
5
|
import { Readable, Writable } from "node:stream";
|
|
6
6
|
//#region ../node/dist/index.d.ts
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as parseSkillMarkdown, B as unzipWithLimits, H as verifyManifest, I as resolveArchiveLimits, L as resolveInsideRoot, M as readResponseWithLimit, N as readSkillSignature, O as messageOf, T as isValidSkillName, U as verifySkillSignature, V as validateSkills, _ as atomicWriteText, g as assertSafePathSegment, h as assertRemoteUrlAllowed, j as parseSkillPackManifest, m as WebSkillError, o as SKILLS_LOCKFILE, r as MANIFEST_EXCLUDED_FILES, s as SKILL_MANIFEST_FILE, u as SKILL_PACK_FILE, w as exportSkills, y as buildManifest } from "./dist-8oQRa8Xz.js";
|
|
2
|
-
import {
|
|
2
|
+
import { J as normalizeToolError, N as createScriptContext, O as WebSkillRuntime, W as networkPolicyLibSource, Y as parseBridgeRequest, d as FsMemoryStore, k as bridgeError, o as CapabilityApproval, q as normalizeToolContent, u as FsArtifactStore } from "./dist-6C03DShK.js";
|
|
3
3
|
import { i as probeLlmCapabilities } from "./env--jJB-TSX-04klhTYi.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { unzipSync, zipSync } from "fflate";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as CatalogNode } from "./catalogComponents-
|
|
1
|
+
import { nt as uiCatalog } from "./dist-bewtXYlO.js";
|
|
2
|
+
import { t as CatalogNode } from "./catalogComponents-DV7cPpUm-C77AEEx9.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Component, Fragment, createContext, useCallback, useContext, useEffect, useInsertionEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -3761,7 +3761,7 @@ function Renderer({ response, library, isStreaming = false, onAction, onStateUpd
|
|
|
3761
3761
|
const FormValidationContext = createContext(null);
|
|
3762
3762
|
|
|
3763
3763
|
//#endregion
|
|
3764
|
-
//#region ../ui-react/dist/openUiLibrary-
|
|
3764
|
+
//#region ../ui-react/dist/openUiLibrary-W3Ce896k.js
|
|
3765
3765
|
const propsFor = (props, container) => container ? props.extend({ children: z.array(z.any()).optional() }) : props;
|
|
3766
3766
|
/**
|
|
3767
3767
|
* catalog 的 OpenUI 投影:`defineComponent` 复用同一份 zod schema 与描述,
|
package/dist/{skillVersionStore-uyefLPR1-DXOzbksv.d.ts → skillVersionStore-BzLbzFOL-CxwIewHJ.d.ts}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region ../governance/dist/skillVersionStore-
|
|
1
|
+
import { B as PageQuery, P as FileSystemProvider, Q as SkillCatalogEntry, at as SkillManifest, z as Page } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
|
+
//#region ../governance/dist/skillVersionStore-BzLbzFOL.d.ts
|
|
3
3
|
//#region src/types.d.ts
|
|
4
4
|
type CandidateStatus = 'draft' | 'pending-review' | 'approved' | 'published' | 'rejected';
|
|
5
|
-
|
|
5
|
+
/** `generated` 是 0.5.0 的技能自动生成来源(需求 12 号 AC-9.1) */
|
|
6
|
+
type CandidateSource = 'runtime-miss' | 'document' | 'manual' | 'generated';
|
|
6
7
|
type CandidateRisk = 'low' | 'medium' | 'high';
|
|
7
8
|
interface CandidateFile {
|
|
8
9
|
path: string;
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as MemoryStore, b as UiBridge, c as InteractionResponse, l as LlmClient, m as LlmStreamEvent, n as ArtifactStore, p as LlmResponse, s as InteractionRequest, t as Artifact, u as LlmCompleteInput } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
2
|
import { a as loadGoogleConfigFromEnv, i as loadAnthropicConfigFromEnv, n as LlmEnvConfig, o as loadLlmConfigFromEnv, r as ProviderEnvConfig } from "./env-BPUBZCwJ-4jat_SVG.js";
|
|
3
3
|
//#region ../runtime/dist/testing.d.ts
|
|
4
4
|
//#region src/llm/mockLlmClient.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region ../core/dist/index.d.ts
|
|
2
2
|
//#region src/errors.d.ts
|
|
3
|
-
type WebSkillErrorCode = 'FS_NOT_FOUND' | 'FS_PATH_OUTSIDE_ROOT' | 'SKILL_NOT_FOUND' | 'SKILL_INVALID_METADATA' | 'SKILL_INVALID_NAME' | 'SKILL_DUPLICATE_NAME' | 'SKILL_UNSUPPORTED_SCRIPT' | 'VALIDATION_FAILED' | 'TOOL_NOT_FOUND' | 'TOOL_EXECUTION_FAILED' | 'NETWORK_BLOCKED' | 'TOOL_UNSUPPORTED' | 'TOOL_NOT_ALLOWED' | 'TOOL_SCHEMA_UNAVAILABLE' | 'RUN_TIMEOUT' | 'RUN_MAX_TURNS_EXCEEDED' | 'RUN_FAILED' | 'RUN_CANCELLED' | 'RUN_INTERACTION_TIMEOUT' | 'UI_UNAVAILABLE' | 'LLM_UNAVAILABLE' | 'LLM_REQUEST_FAILED' | 'INSTALL_FAILED' | 'UNINSTALL_FAILED' | 'EXPORT_FAILED' | 'INTEGRITY_FAILED' | 'FS_PERMISSION_DENIED' | 'MCP_ENDPOINT_UNAVAILABLE' | 'MCP_TOOL_NOT_FOUND' | 'CANDIDATE_INVALID' | 'APPROVAL_REQUIRED' | 'SKILL_QUARANTINED' | 'SKILL_DISABLED' | 'SKILL_UNKNOWN_ALLOWED_TOOL' | 'SKILL_UNKNOWN_DEPENDENCY' | 'SKILL_CIRCULAR_DEPENDENCY' | 'GOVERNANCE_FAILED' | 'RUN_SNAPSHOT_NOT_FOUND' | 'RUN_SNAPSHOT_EXPIRED' | 'RUN_SNAPSHOT_INCOMPATIBLE' | 'RUN_SNAPSHOT_SCHEMA_UNSUPPORTED' | 'RUN_TRACE_INCOMPATIBLE' | 'SESSION_INCOMPATIBLE' | 'SIGNATURE_MISSING' | 'SIGNATURE_MALFORMED' | 'SIGNATURE_UNTRUSTED_KEY' | 'SIGNATURE_MISMATCH' | 'SIGNATURE_UNSUPPORTED' | 'MCP_STDIO_SPAWN_FAILED' | 'MCP_STDIO_EXITED' | 'MCP_STDIO_TIMEOUT';
|
|
3
|
+
type WebSkillErrorCode = 'FS_NOT_FOUND' | 'FS_PATH_OUTSIDE_ROOT' | 'SKILL_NOT_FOUND' | 'SKILL_INVALID_METADATA' | 'SKILL_INVALID_NAME' | 'SKILL_DUPLICATE_NAME' | 'SKILL_UNSUPPORTED_SCRIPT' | 'VALIDATION_FAILED' | 'TOOL_NOT_FOUND' | 'TOOL_EXECUTION_FAILED' | 'NETWORK_BLOCKED' | 'TOOL_UNSUPPORTED' | 'TOOL_NOT_ALLOWED' | 'TOOL_SCHEMA_UNAVAILABLE' | 'RUN_TIMEOUT' | 'RUN_MAX_TURNS_EXCEEDED' | 'RUN_FAILED' | 'RUN_CANCELLED' | 'RUN_INTERACTION_TIMEOUT' | 'UI_UNAVAILABLE' | 'LLM_UNAVAILABLE' | 'LLM_REQUEST_FAILED' | 'INSTALL_FAILED' | 'UNINSTALL_FAILED' | 'EXPORT_FAILED' | 'INTEGRITY_FAILED' | 'FS_PERMISSION_DENIED' | 'MCP_ENDPOINT_UNAVAILABLE' | 'MCP_TOOL_NOT_FOUND' | 'CANDIDATE_INVALID' | 'APPROVAL_REQUIRED' | 'SKILL_QUARANTINED' | 'SKILL_DISABLED' | 'SKILL_UNKNOWN_ALLOWED_TOOL' | 'SKILL_UNKNOWN_DEPENDENCY' | 'SKILL_CIRCULAR_DEPENDENCY' | 'GOVERNANCE_FAILED' | 'RUN_SNAPSHOT_NOT_FOUND' | 'RUN_SNAPSHOT_EXPIRED' | 'RUN_SNAPSHOT_INCOMPATIBLE' | 'RUN_SNAPSHOT_SCHEMA_UNSUPPORTED' | 'RUN_TRACE_INCOMPATIBLE' | 'SESSION_INCOMPATIBLE' | 'SIGNATURE_MISSING' | 'SIGNATURE_MALFORMED' | 'SIGNATURE_UNTRUSTED_KEY' | 'SIGNATURE_MISMATCH' | 'SIGNATURE_UNSUPPORTED' | 'MCP_STDIO_SPAWN_FAILED' | 'MCP_STDIO_EXITED' | 'MCP_STDIO_TIMEOUT' | 'TS_RESOURCE_URL_REJECTED' | 'TS_TRANSPILER_UNAVAILABLE' | 'TS_TRANSPILE_FAILED' | 'TODO_LIST_INVALID' | 'TODO_ITEM_NOT_FOUND' | 'SKILL_GENERATION_DISABLED' | 'SKILL_GENERATION_LIMIT_EXCEEDED' | 'SKILL_GENERATION_VALIDATION_FAILED' | 'DELEGATION_UNAVAILABLE' | 'DELEGATION_IN_PROGRESS' | 'DELEGATION_BUDGET_EXCEEDED' | 'PREFERENCE_IMPORT_INVALID' | 'PREFERENCE_IMPORT_VERSION_UNSUPPORTED' | 'PREFERENCE_IMPORT_CREDENTIAL_REJECTED' | 'DICTATION_UNAVAILABLE' | 'DICTATION_PERMISSION_DENIED' | 'DICTATION_FAILED' | 'PERCEPTION_NOT_ENABLED' | 'PERCEPTION_FAILED';
|
|
4
4
|
/**
|
|
5
5
|
* 所有公开 API 抛出的结构化错误,code 供上层可编程处理
|
|
6
6
|
* @stable
|
|
@@ -582,7 +582,7 @@ declare function escapeXml(text: string): string;
|
|
|
582
582
|
declare function renderAvailableSkillsXml(catalog: SkillCatalog): string;
|
|
583
583
|
declare const xmlRenderer: CatalogRenderer;
|
|
584
584
|
//#endregion
|
|
585
|
-
//#region ../runtime/dist/types-
|
|
585
|
+
//#region ../runtime/dist/types-D_hoCri8.d.ts
|
|
586
586
|
//#region src/llm/streamTypes.d.ts
|
|
587
587
|
/** 流式 LLM 事件(OpenAI SSE / Vercel fullStream 统一映射) */
|
|
588
588
|
type LlmStreamEvent = {
|
|
@@ -682,7 +682,21 @@ interface ArtifactStore {
|
|
|
682
682
|
}
|
|
683
683
|
//#endregion
|
|
684
684
|
//#region src/interaction/types.d.ts
|
|
685
|
+
/**
|
|
686
|
+
* 交互的发起方标识(FR-11.6)。串行委派下父 agent 与子 agent 都能发起交互,
|
|
687
|
+
* 缺了这个标识用户无法判断弹出来的表单属于哪个子任务。
|
|
688
|
+
* 缺省即父 agent 自己发起。
|
|
689
|
+
* @experimental
|
|
690
|
+
*/
|
|
691
|
+
interface InteractionOrigin {
|
|
692
|
+
/** 展示用标签,通常是子任务标题 */
|
|
693
|
+
label: string;
|
|
694
|
+
/** 关联的待办条目 */
|
|
695
|
+
todoId?: string;
|
|
696
|
+
}
|
|
685
697
|
type InteractionRequest = {
|
|
698
|
+
origin?: InteractionOrigin;
|
|
699
|
+
} & ({
|
|
686
700
|
type: 'ask';
|
|
687
701
|
id: string;
|
|
688
702
|
message: string;
|
|
@@ -715,7 +729,7 @@ type InteractionRequest = {
|
|
|
715
729
|
capability: 'readReference' | 'writeArtifact' | 'confirm';
|
|
716
730
|
message: string;
|
|
717
731
|
details?: unknown;
|
|
718
|
-
};
|
|
732
|
+
});
|
|
719
733
|
interface InteractionResponse {
|
|
720
734
|
id: string;
|
|
721
735
|
value?: unknown;
|
|
@@ -867,6 +881,17 @@ interface FormField {
|
|
|
867
881
|
label: string;
|
|
868
882
|
value: unknown;
|
|
869
883
|
}>;
|
|
884
|
+
/** 跨会话稳定的字段标识 `<skillName>#<fieldName>`(FR-5.6);缺省表示该字段不参与召回 */
|
|
885
|
+
fieldKey?: string;
|
|
886
|
+
/**
|
|
887
|
+
* 上次填写值(FR-5.9)。**刻意不叫 defaultValue**:渲染器会把 defaultValue 直接填进控件,
|
|
888
|
+
* 而历史值可能是手机号、地址甚至凭据,必须由用户看到后主动采纳。
|
|
889
|
+
* @experimental
|
|
890
|
+
*/
|
|
891
|
+
suggestion?: {
|
|
892
|
+
value: unknown;
|
|
893
|
+
ts: number;
|
|
894
|
+
};
|
|
870
895
|
}
|
|
871
896
|
interface InteractionPolicy {
|
|
872
897
|
/** 缺必填参数策略:默认 'user'(表单问用户),'llm' 回喂自愈 */
|
|
@@ -892,4 +917,4 @@ interface MemoryStore {
|
|
|
892
917
|
transaction?<T>(scope: string, fn: (inner: MemoryStore) => Promise<T>): Promise<T>;
|
|
893
918
|
}
|
|
894
919
|
//#endregion
|
|
895
|
-
export {
|
|
920
|
+
export { SkillDiscovery as $, CryptoKeyLike as A, isValidSkillName as At, PageQuery as B, renderCatalogJson as Bt, UiSpecEvent as C, buildCatalog as Ct, UiSurfaceActionResponse as D, computeDigest as Dt, UiSurfaceActionRequest as E, checkSkillRules as Et, FsTrustedKeyStore as F, parseSkillMarkdown as Ft, SKILL_NAME_MAX_LENGTH as G, unzipWithLimits as Gt, SIGNATURE_SCHEMA_VERSION as H, resolveInsideRoot as Ht, JsonSchema as I, parseSkillPackManifest as It, SKILL_SIGNATURE_FILE as J, verifySkillSignature as Jt, SKILL_NAME_PATTERN as K, validateSkills as Kt, MANIFEST_EXCLUDED_FILES as L, readResponseWithLimit as Lt, DiscoveryResult as M, keyIdOf as Mt, FileStat as N, messageOf as Nt, ArchiveLimits as O, escapeXml as Ot, FileSystemProvider as P, normalizePath as Pt, SkillCatalogEntry as Q, MemoryFS as R, readSkillSignature as Rt, UiSpecDrafts as S, atomicWriteText as St, UiSpecSnapshot as T, checkDependencyCycles as Tt, SKILLS_LOCKFILE as U, signSkill as Ut, RemoteUrlPolicy as V, resolveArchiveLimits as Vt, SKILL_MANIFEST_FILE as W, signaturePayloadBytes as Wt, SignatureVerdict as X, SignatureAuditSink as Y, xmlRenderer as Yt, SkillCatalog as Z, MemoryStore as _, VerifyResult as _t, InteractionOrigin as a, SkillManifest as at, UiBridge as b, assertRemoteUrlAllowed as bt, InteractionResponse as c, SkillReader as ct, LlmContentPart as d, SkillsLockfile as dt, SkillDocument as et, LlmMessage as f, TrustedKey as ft, LlmToolSpec as g, ValidationReport as gt, LlmToolCall as h, UnsignedPolicy as ht, FormField as i, SkillManagerPort as it, DEFAULT_ARCHIVE_LIMITS as j, jsonRenderer as jt, CatalogRenderer as k, exportSkills as kt, LlmClient as l, SkillSignature as lt, LlmStreamEvent as m, UiSpecNode as mt, ArtifactStore as n, SkillIssue as nt, InteractionPolicy as o, SkillMetadata as ot, LlmResponse as p, TrustedKeyStore as pt, SKILL_PACK_FILE as q, verifyManifest as qt, ChartSpec as r, SkillLocation as rt, InteractionRequest as s, SkillPackManifest as st, Artifact as t, SkillInstallSource as tt, LlmCompleteInput as u, SkillSource as ut, RenderBlock as v, WebSkillError as vt, UiSpecPatch as w, buildManifest as wt, UiSpecActionCapability as x, assertSafePathSegment as xt, RenderResultRequest as y, WebSkillErrorCode as yt, Page as z, renderAvailableSkillsXml as zt };
|
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { C as UiSpecEvent, D as UiSurfaceActionResponse, E as UiSurfaceActionRequest, S as UiSpecDrafts, T as UiSpecSnapshot, b as UiBridge, c as InteractionResponse, mt as UiSpecNode, s as InteractionRequest, x as UiSpecActionCapability, y as RenderResultRequest } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
|
+
import { b as InteractionSpecLabels } from "./index-Bsqg4ftU.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ComponentType, ReactNode } from "react";
|
|
5
5
|
import "react/jsx-runtime";
|
|
@@ -256,8 +256,24 @@ declare class UiSurfaceStore {
|
|
|
256
256
|
}
|
|
257
257
|
//#endregion
|
|
258
258
|
//#region src/bridgeState.d.ts
|
|
259
|
+
/**
|
|
260
|
+
* 一次被丢弃的 surface action(FR-11.7)。
|
|
261
|
+
*
|
|
262
|
+
* 丢弃本身是对的(重放/串扰防护),但静默丢弃会让「点了没反应」变成无从排查的现象。
|
|
263
|
+
* @experimental
|
|
264
|
+
*/
|
|
265
|
+
interface DroppedSurfaceActionWarning {
|
|
266
|
+
/** duplicate:nonce 已被消费;no-pending:当前没有等待中的动作;mismatch:与待决动作不是同一个 */
|
|
267
|
+
reason: 'duplicate' | 'no-pending' | 'mismatch';
|
|
268
|
+
nonce: string;
|
|
269
|
+
message: string;
|
|
270
|
+
/** 丢弃发生时的待决状态,用于定位串扰 */
|
|
271
|
+
pending: UiSurfaceActionRequest | null;
|
|
272
|
+
}
|
|
259
273
|
interface ReactBridgeStateOptions {
|
|
260
274
|
onSurfaceDraftChange?(runId: string, surfaceId: string, value: Record<string, unknown>): Promise<void> | void;
|
|
275
|
+
/** 覆盖默认的 console.warn 上报(测试与宿主遥测用)。@experimental */
|
|
276
|
+
onDroppedSurfaceAction?(warning: DroppedSurfaceActionWarning): void;
|
|
261
277
|
}
|
|
262
278
|
/**
|
|
263
279
|
* React 桥接状态:UiBridge 实现 + useSyncExternalStore 兼容订阅。
|
|
@@ -287,7 +303,10 @@ declare class ReactBridgeState implements UiBridge {
|
|
|
287
303
|
renderResult(input: RenderResultRequest): Promise<void>;
|
|
288
304
|
renderSurface(event: UiSpecEvent): Promise<void>;
|
|
289
305
|
requestSurfaceAction(input: UiSurfaceActionRequest): Promise<UiSurfaceActionResponse>;
|
|
290
|
-
/**
|
|
306
|
+
/**
|
|
307
|
+
* Resolves exactly one pending action capability; stale or duplicate nonces are ignored.
|
|
308
|
+
* Every ignored response is reported through `onDroppedSurfaceAction` (FR-11.7).
|
|
309
|
+
*/
|
|
291
310
|
resolveSurfaceAction(response: UiSurfaceActionResponse): boolean;
|
|
292
311
|
cancelSurfaceAction(nonce: string): void;
|
|
293
312
|
onTextDelta(runId: string, delta: string): Promise<void>;
|
|
@@ -317,6 +336,8 @@ interface CustomSurfaceActionEvent {
|
|
|
317
336
|
actionId: string;
|
|
318
337
|
intent: UiSpecActionCapability['intent'];
|
|
319
338
|
nonce?: string;
|
|
339
|
+
/** 提交动作所属的表单容器;一张 surface 只有一个表单时省略 */
|
|
340
|
+
scopeId?: string;
|
|
320
341
|
value?: Record<string, unknown>;
|
|
321
342
|
}
|
|
322
343
|
interface RegisteredSurfaceProps<Props> {
|
|
@@ -482,10 +503,10 @@ type CatalogNodeProps = {
|
|
|
482
503
|
children?: ReactNode;
|
|
483
504
|
};
|
|
484
505
|
/**
|
|
485
|
-
* catalog
|
|
506
|
+
* catalog 展示类组件的实现:json-render 与 OpenUI 两档共用同一份,
|
|
486
507
|
* 避免"一个 catalog、多套 registry"退化成多套各自演进的视觉。
|
|
487
508
|
* 交互(表单值收集 / action 回传)由各档的宿主组件负责。
|
|
488
509
|
*/
|
|
489
510
|
declare const catalogComponentImpls: Record<string, (input: CatalogNodeProps) => ReactNode>;
|
|
490
511
|
//#endregion
|
|
491
|
-
export { type CatalogNodeProps, type CustomSurfaceActionEvent, InteractionForm, type JsonRenderActionDispatch, JsonRenderSpecSurface, type JsonRenderSpecSurfaceProps, NATIVE_SPEC_COMPONENTS, NativeSpecSurface, type NativeSpecSurfaceProps, OpenUiSpecSurface, type OpenUiSpecSurfaceProps, ReactBridgeState, type RegisteredSurfaceProps, ResultBlocks, SpecInteractionChannel, type SpecInteractionSession, StreamingText, type SurfaceRegistration, SurfaceRegistry, type UiSurfaceActionEvent, UiSurfaceList, type UiSurfaceListProps, UiSurfaceSnapshotList, type UiSurfaceSnapshotListProps, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability };
|
|
512
|
+
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, type SurfaceRegistration, SurfaceRegistry, type UiSurfaceActionEvent, UiSurfaceList, type UiSurfaceListProps, UiSurfaceSnapshotList, type UiSurfaceSnapshotListProps, UiSurfaceStore, catalogComponentImpls, createJsonRenderRegistry, probeJsonRenderAvailability };
|
package/dist/ui-react.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as __exportAll$1 } from "./rolldown-runtime-BOF7iYI8.js";
|
|
2
2
|
import { m as WebSkillError } from "./dist-8oQRa8Xz.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { _ as
|
|
3
|
+
import { it as validateUiSpecNode, rt as validateUiSpecEvent } from "./dist-6C03DShK.js";
|
|
4
|
+
import { B as toOpenUiSpecLang, I as shapeInteractionValue, O as interactionToFormModel, P as renderMiniChart, Q as chartSpecFromProps, g as applySuggestion, k as interactionToUiSpec, nt as uiCatalog, tt as renderMiniMarkdown, x as collectValues, z as toJsonRenderSpec } from "./dist-bewtXYlO.js";
|
|
5
|
+
import { C as Input, S as DropdownMenuTrigger, T as Separator, _ as Checkbox, a as SpecProgress, b as DropdownMenuCheckboxItem, c as SurfaceButton, d as catalogComponentImpls, f as str, g as Button, h as Badge, i as SpecGrid, l as SurfaceField, m as useSurfaceForm, n as CatalogSurfaceProvider, o as SpecTabs, p as useCatalogSurfaceForm, r as EChart, s as SpecTimeline, u as SurfaceFormButtons, v as DataTable, w as Markdown, x as DropdownMenuContent, y as DropdownMenu } from "./catalogComponents-DV7cPpUm-C77AEEx9.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";
|
|
@@ -6489,8 +6489,10 @@ var ReactBridgeState = class {
|
|
|
6489
6489
|
#processedSurfaceActionNonces = /* @__PURE__ */ new Set();
|
|
6490
6490
|
#surfaceDrafts = /* @__PURE__ */ new Map();
|
|
6491
6491
|
#onSurfaceDraftChange;
|
|
6492
|
+
#onDroppedSurfaceAction;
|
|
6492
6493
|
constructor(options = {}) {
|
|
6493
6494
|
this.#onSurfaceDraftChange = options.onSurfaceDraftChange;
|
|
6495
|
+
this.#onDroppedSurfaceAction = options.onDroppedSurfaceAction;
|
|
6494
6496
|
this.surfaceStore.subscribe(() => this.#emit());
|
|
6495
6497
|
}
|
|
6496
6498
|
get surfaceSnapshots() {
|
|
@@ -6559,12 +6561,25 @@ var ReactBridgeState = class {
|
|
|
6559
6561
|
this.#surfaceActionResolvers.set(input.nonce, resolve);
|
|
6560
6562
|
});
|
|
6561
6563
|
}
|
|
6562
|
-
/**
|
|
6564
|
+
/**
|
|
6565
|
+
* Resolves exactly one pending action capability; stale or duplicate nonces are ignored.
|
|
6566
|
+
* Every ignored response is reported through `onDroppedSurfaceAction` (FR-11.7).
|
|
6567
|
+
*/
|
|
6563
6568
|
resolveSurfaceAction(response) {
|
|
6564
|
-
if (this.#processedSurfaceActionNonces.has(response.nonce))
|
|
6569
|
+
if (this.#processedSurfaceActionNonces.has(response.nonce)) {
|
|
6570
|
+
this.#reportDropped("duplicate", response);
|
|
6571
|
+
return false;
|
|
6572
|
+
}
|
|
6565
6573
|
const resolver = this.#surfaceActionResolvers.get(response.nonce);
|
|
6566
6574
|
const pending = this.pendingSurfaceAction;
|
|
6567
|
-
if (!resolver || !pending
|
|
6575
|
+
if (!resolver || !pending) {
|
|
6576
|
+
this.#reportDropped("no-pending", response);
|
|
6577
|
+
return false;
|
|
6578
|
+
}
|
|
6579
|
+
if (pending.runId !== response.runId || pending.surfaceId !== response.surfaceId || pending.actionId !== response.actionId || pending.nonce !== response.nonce) {
|
|
6580
|
+
this.#reportDropped("mismatch", response);
|
|
6581
|
+
return false;
|
|
6582
|
+
}
|
|
6568
6583
|
this.#processedSurfaceActionNonces.add(response.nonce);
|
|
6569
6584
|
this.#surfaceActionResolvers.delete(response.nonce);
|
|
6570
6585
|
this.pendingSurfaceAction = null;
|
|
@@ -6585,6 +6600,21 @@ var ReactBridgeState = class {
|
|
|
6585
6600
|
cancelled: true
|
|
6586
6601
|
});
|
|
6587
6602
|
}
|
|
6603
|
+
#reportDropped(reason, response) {
|
|
6604
|
+
const pending = this.pendingSurfaceAction;
|
|
6605
|
+
const state = pending === null ? "no action is pending" : `pending action is ${pending.surfaceId}/${pending.actionId} (nonce ${pending.nonce}, run ${pending.runId})`;
|
|
6606
|
+
const warning = {
|
|
6607
|
+
reason,
|
|
6608
|
+
nonce: response.nonce,
|
|
6609
|
+
message: `Dropped UI surface action ${response.surfaceId}/${response.actionId} with nonce ${response.nonce}: ${reason}; ${state}`,
|
|
6610
|
+
pending
|
|
6611
|
+
};
|
|
6612
|
+
if (this.#onDroppedSurfaceAction) {
|
|
6613
|
+
this.#onDroppedSurfaceAction(warning);
|
|
6614
|
+
return;
|
|
6615
|
+
}
|
|
6616
|
+
console.warn(`[webskill] ${warning.message}`);
|
|
6617
|
+
}
|
|
6588
6618
|
async onTextDelta(runId, delta) {
|
|
6589
6619
|
if (this.streamingRunId !== runId) {
|
|
6590
6620
|
this.streamingRunId = runId;
|
|
@@ -6594,6 +6624,28 @@ var ReactBridgeState = class {
|
|
|
6594
6624
|
this.#emit();
|
|
6595
6625
|
}
|
|
6596
6626
|
};
|
|
6627
|
+
/**
|
|
6628
|
+
* 历史值以**建议**形态出现(FR-5.9):控件初始值仍为空,
|
|
6629
|
+
* 用户点「使用」才写入。切勿改成 defaultValue。
|
|
6630
|
+
*/
|
|
6631
|
+
function Suggestion({ control, onUse }) {
|
|
6632
|
+
if (control.suggestion === void 0) return null;
|
|
6633
|
+
const preview = String(control.suggestion.value);
|
|
6634
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6635
|
+
className: "webskill-form__suggestion",
|
|
6636
|
+
"data-webskill-suggestion": control.name,
|
|
6637
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
6638
|
+
className: "webskill-form__suggestion-value",
|
|
6639
|
+
children: ["Last entered: ", preview]
|
|
6640
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
6641
|
+
type: "button",
|
|
6642
|
+
className: "webskill-form__suggestion-use",
|
|
6643
|
+
"data-webskill-suggestion-use": control.name,
|
|
6644
|
+
onClick: onUse,
|
|
6645
|
+
children: "Use"
|
|
6646
|
+
})]
|
|
6647
|
+
});
|
|
6648
|
+
}
|
|
6597
6649
|
function Control({ control, invalid }) {
|
|
6598
6650
|
const controlId = `webskill-field-${control.name}`;
|
|
6599
6651
|
const label = /* @__PURE__ */ jsxs("label", {
|
|
@@ -6709,15 +6761,24 @@ function InteractionForm({ bridge }) {
|
|
|
6709
6761
|
}) : null,
|
|
6710
6762
|
model.controls.map((control) => /* @__PURE__ */ jsxs("div", {
|
|
6711
6763
|
className: invalid.includes(control.name) ? "webskill-form__control--invalid" : void 0,
|
|
6712
|
-
children: [
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6764
|
+
children: [
|
|
6765
|
+
/* @__PURE__ */ jsx(Control, {
|
|
6766
|
+
control,
|
|
6767
|
+
invalid: invalid.includes(control.name)
|
|
6768
|
+
}),
|
|
6769
|
+
/* @__PURE__ */ jsx(Suggestion, {
|
|
6770
|
+
control,
|
|
6771
|
+
onUse: () => {
|
|
6772
|
+
if (formRef.current) applySuggestion(control, formRef.current);
|
|
6773
|
+
}
|
|
6774
|
+
}),
|
|
6775
|
+
invalid.includes(control.name) ? /* @__PURE__ */ jsx("div", {
|
|
6776
|
+
id: `webskill-error-${control.name}`,
|
|
6777
|
+
role: "alert",
|
|
6778
|
+
className: "webskill-form__error",
|
|
6779
|
+
children: "This field is required"
|
|
6780
|
+
}) : null
|
|
6781
|
+
]
|
|
6721
6782
|
}, control.name)),
|
|
6722
6783
|
/* @__PURE__ */ jsxs("div", {
|
|
6723
6784
|
className: "webskill-form__actions",
|
|
@@ -6955,9 +7016,10 @@ const TONE_CLASS = {
|
|
|
6955
7016
|
info: "text-info",
|
|
6956
7017
|
destructive: "text-destructive"
|
|
6957
7018
|
};
|
|
6958
|
-
function renderNode(node, context, key) {
|
|
7019
|
+
function renderNode(node, context, key, scope) {
|
|
6959
7020
|
const props = node.props ?? {};
|
|
6960
|
-
const
|
|
7021
|
+
const nodeScope = node.component === "Form" ? context.scopeOfNode(node) : scope;
|
|
7022
|
+
const children = (node.children ?? []).map((child, index) => renderNode(child, context, `${key}.${index}`, nodeScope));
|
|
6961
7023
|
switch (node.component) {
|
|
6962
7024
|
case "Stack": return /* @__PURE__ */ jsx("div", {
|
|
6963
7025
|
className: `flex gap-3 ${str(props, "direction", "vertical") === "horizontal" ? "flex-row items-center" : "flex-col"}`,
|
|
@@ -7015,6 +7077,16 @@ function renderNode(node, context, key) {
|
|
|
7015
7077
|
label: str(props, "title", "Data")
|
|
7016
7078
|
}, key);
|
|
7017
7079
|
case "Chart": return /* @__PURE__ */ jsx(EChart, { chart: chartSpecFromProps(props) }, key);
|
|
7080
|
+
case "Tabs": return /* @__PURE__ */ jsx(SpecTabs, {
|
|
7081
|
+
props,
|
|
7082
|
+
children
|
|
7083
|
+
}, key);
|
|
7084
|
+
case "Grid": return /* @__PURE__ */ jsx(SpecGrid, {
|
|
7085
|
+
props,
|
|
7086
|
+
children
|
|
7087
|
+
}, key);
|
|
7088
|
+
case "Timeline": return /* @__PURE__ */ jsx(SpecTimeline, { props }, key);
|
|
7089
|
+
case "Progress": return /* @__PURE__ */ jsx(SpecProgress, { props }, key);
|
|
7018
7090
|
case "FileLink": return /* @__PURE__ */ jsxs("div", {
|
|
7019
7091
|
className: "flex items-center gap-2 text-sm",
|
|
7020
7092
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -7032,7 +7104,7 @@ function renderNode(node, context, key) {
|
|
|
7032
7104
|
className: "flex flex-col gap-3",
|
|
7033
7105
|
onSubmit: (event) => {
|
|
7034
7106
|
event.preventDefault();
|
|
7035
|
-
context.submit("submit");
|
|
7107
|
+
context.submit("submit", void 0, nodeScope);
|
|
7036
7108
|
},
|
|
7037
7109
|
noValidate: true,
|
|
7038
7110
|
children: [
|
|
@@ -7043,17 +7115,20 @@ function renderNode(node, context, key) {
|
|
|
7043
7115
|
children,
|
|
7044
7116
|
/* @__PURE__ */ jsx(SurfaceFormButtons, {
|
|
7045
7117
|
form: context,
|
|
7046
|
-
props
|
|
7118
|
+
props,
|
|
7119
|
+
scope: nodeScope
|
|
7047
7120
|
})
|
|
7048
7121
|
]
|
|
7049
7122
|
}, key);
|
|
7050
7123
|
case "Field": return /* @__PURE__ */ jsx(SurfaceField, {
|
|
7051
7124
|
form: context,
|
|
7052
|
-
props
|
|
7125
|
+
props,
|
|
7126
|
+
scope
|
|
7053
7127
|
}, key);
|
|
7054
7128
|
case "Button": return /* @__PURE__ */ jsx(SurfaceButton, {
|
|
7055
7129
|
form: context,
|
|
7056
7130
|
props,
|
|
7131
|
+
scope,
|
|
7057
7132
|
...node.id ? { nodeId: node.id } : {}
|
|
7058
7133
|
}, key);
|
|
7059
7134
|
case "Alert": return /* @__PURE__ */ jsxs("div", {
|
|
@@ -7418,7 +7493,7 @@ function OpenUiSpecSurface({ spec, surfaceId, actions, onAction }) {
|
|
|
7418
7493
|
const [unavailable, setUnavailable] = useState(false);
|
|
7419
7494
|
useEffect(() => {
|
|
7420
7495
|
let cancelled = false;
|
|
7421
|
-
import("./openUiLibrary-
|
|
7496
|
+
import("./openUiLibrary-W3Ce896k-ClFTRZFs.js").then((loaded) => {
|
|
7422
7497
|
if (!cancelled) setModule(loaded);
|
|
7423
7498
|
}).catch(() => {
|
|
7424
7499
|
if (!cancelled) setUnavailable(true);
|
package/dist/ui-vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as UiBridge, c as InteractionResponse, s as InteractionRequest, y as RenderResultRequest } from "./types-D_hoCri8-BnNPiZCi.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 { I as shapeInteractionValue, O as interactionToFormModel, P as renderMiniChart, g as applySuggestion, tt as renderMiniMarkdown, x as collectValues } from "./dist-bewtXYlO.js";
|
|
2
2
|
import { defineComponent, h, reactive, ref } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region ../ui-vue/dist/index.js
|
|
@@ -46,6 +46,19 @@ var VueBridgeState = class {
|
|
|
46
46
|
this.state.streamingText += delta;
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
+
/** 历史值以**建议**形态出现(FR-5.9):控件初始值仍为空,用户点「使用」才写入 */
|
|
50
|
+
function renderSuggestion(control, onUse) {
|
|
51
|
+
if (control.suggestion === void 0) return null;
|
|
52
|
+
return h("div", {
|
|
53
|
+
class: "webskill-form__suggestion",
|
|
54
|
+
"data-webskill-suggestion": control.name
|
|
55
|
+
}, [h("span", { class: "webskill-form__suggestion-value" }, `Last entered: ${String(control.suggestion.value)}`), h("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
class: "webskill-form__suggestion-use",
|
|
58
|
+
"data-webskill-suggestion-use": control.name,
|
|
59
|
+
onClick: onUse
|
|
60
|
+
}, "Use")]);
|
|
61
|
+
}
|
|
49
62
|
function renderControl(control, invalid) {
|
|
50
63
|
const controlId = `webskill-field-${control.name}`;
|
|
51
64
|
const label = h("label", {
|
|
@@ -137,11 +150,17 @@ const InteractionForm = defineComponent({
|
|
|
137
150
|
}, [
|
|
138
151
|
model.title ? h("div", { class: "webskill-form__title" }, model.title) : null,
|
|
139
152
|
model.message && (model.kind === "form" || model.kind === "authorize") ? h("p", { class: "webskill-form__message" }, model.message) : null,
|
|
140
|
-
...model.controls.map((control) => h("div", { key: control.name }, [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
153
|
+
...model.controls.map((control) => h("div", { key: control.name }, [
|
|
154
|
+
renderControl(control, invalid.value.includes(control.name)),
|
|
155
|
+
renderSuggestion(control, () => {
|
|
156
|
+
if (formRef.value) applySuggestion(control, formRef.value);
|
|
157
|
+
}),
|
|
158
|
+
invalid.value.includes(control.name) ? h("div", {
|
|
159
|
+
id: `webskill-error-${control.name}`,
|
|
160
|
+
role: "alert",
|
|
161
|
+
class: "webskill-form__error"
|
|
162
|
+
}, "This field is required") : null
|
|
163
|
+
])),
|
|
145
164
|
h("div", { class: "webskill-form__actions" }, [h("button", {
|
|
146
165
|
type: "submit",
|
|
147
166
|
class: "webskill-form__button webskill-form__button--primary"
|
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, type EchartHandle, type FormModel, type InteractionSpecLabels, type JsonRenderSpec, type LoadedOpenUiPeers, type OpenUiRendererProps, type OpenUiRuntime, RENDER_UI_TOOL, UI_CATALOG_GROUPS, type UiActionDef, type UiCatalog, type UiCatalogInput, type UiCatalogPromptOptions, type UiCatalogToolSourceOptions, type UiComponentDef, 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, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromProps, chartToTable, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, ensureStyles, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog };
|
|
1
|
+
import { mt as UiSpecNode } from "./types-D_hoCri8-BnNPiZCi.js";
|
|
2
|
+
import { Wt as buildRenderResult } from "./index-vBz_FC9w.js";
|
|
3
|
+
import { $ as buildA2uiCatalogDefinition, A as UiActionDef, At as uiCatalog, B as UiSpecValidation, C as OpenUiRendererProps, Ct as shapeInteractionValue, D as UI_CATALOG_PROMPT_BUDGET_BYTES, Dt as toOpenUiSpecLang, E as UI_CATALOG_GROUPS, Et as toJsonRenderSpec, F as UiComponentDef, G as WEBSKILL_A2UI_CATALOG_ID, H as VERCEL_INTERACTION_TOOL_NAME, I as UiFormScope, J as WebFormBridge, K as WEBSKILL_STYLES_CSS, L as UiPreset, M as UiCatalogInput, N as UiCatalogPromptOptions, O as UI_PRESETS, Ot as toUiSurfaceActionDispatch, P as UiCatalogToolSourceOptions, Q as applySuggestion, R as UiPresetName, S as LoadedOpenUiPeers, St as renderRenderResult, T as RENDER_UI_TOOL, Tt as toA2uiSurfaceAction, U as VercelToolInvocation, V as UiSurfaceActionDispatch, W as VercelUiBridge, X as a2uiComponentSchema, Y as ZodRuntime, Z as a2uiComponentShapes, _ as DESCRIBE_UI_PRESET_TOOL, _t as mountEchart, a as A2UI_SURFACE_ACTION, at as collectValues, b as InteractionSpecLabels, bt as renderMiniChart, c as A2uiCatalogDefinition, ct as ensureStyles, d as A2uiMessage, dt as fromUiSurfaceActionDispatch, et as chartSpecFromProps, f as A2uiSpecActionEvent, ft as fromVercelToolResult, g as ControlModel, gt as loadWebSkillLitCatalog, h as CollectedValues, ht as loadOpenUiPeers, i as A2UI_SPEC_FORM_PATH, it as collectSpecActions, j as UiCatalog, jt as uiPreset, k as UI_PRESET_NAMES, kt as toVercelToolInvocation, l as A2uiCatalogHandle, lt as fromA2uiSpecAction, m as CHART_PALETTE, mt as interactionToUiSpec, n as A2UI_COMMON_TYPES, nt as collectFormScopes, o as A2UI_VERSION, ot as createUiCatalogToolSource, p as A2uiSpecMessageOptions, pt as interactionToFormModel, q as WEBSKILL_SURFACE_ACTION, r as A2UI_SPEC_ACTION, rt as collectScopedValues, s as A2uiCatalogComponent, st as defineUiCatalog, t as A2UI_BASIC_CATALOG_ID, tt as chartToTable, u as A2uiComponentShape, ut as fromA2uiSurfaceAction, v as EchartHandle, vt as qualifyFieldName, w as OpenUiRuntime, wt as toA2uiSpecMessages, x as JsonRenderSpec, xt as renderMiniMarkdown, y as FormModel, yt as renderBlocks, z as UiSpecIssue } from "./index-Bsqg4ftU.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 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 };
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as
|
|
1
|
+
import { A as buildRenderResult } from "./dist-6C03DShK.js";
|
|
2
|
+
import { $ as defineUiCatalog, A as loadOpenUiPeers, B as toOpenUiSpecLang, C as ensureStyles, D as fromVercelToolResult, E as fromUiSurfaceActionDispatch, F as renderRenderResult, G as A2UI_COMMON_TYPES, H as toVercelToolInvocation, I as shapeInteractionValue, J as WEBSKILL_A2UI_CATALOG_ID, K as UI_CATALOG_GROUPS, L as toA2uiSpecMessages, M as qualifyFieldName, N as renderBlocks, O as interactionToFormModel, P as renderMiniChart, Q as chartSpecFromProps, R as toA2uiSurfaceAction, S as createUiCatalogToolSource, T as fromA2uiSurfaceAction, U as uiPreset, V as toUiSurfaceActionDispatch, X as a2uiComponentShapes, Y as a2uiComponentSchema, Z as buildA2uiCatalogDefinition, _ as chartToTable, a as A2UI_VERSION, b as collectSpecActions, c as RENDER_UI_TOOL, d as VERCEL_INTERACTION_TOOL_NAME, et as mountEchart, f as VercelUiBridge, g as applySuggestion, h as WebFormBridge, i as A2UI_SURFACE_ACTION, j as loadWebSkillLitCatalog, k as interactionToUiSpec, l as UI_PRESETS, m as WEBSKILL_SURFACE_ACTION, n as A2UI_SPEC_ACTION, nt as uiCatalog, o as CHART_PALETTE, p as WEBSKILL_STYLES_CSS, q as UI_CATALOG_PROMPT_BUDGET_BYTES, r as A2UI_SPEC_FORM_PATH, s as DESCRIBE_UI_PRESET_TOOL, t as A2UI_BASIC_CATALOG_ID, tt as renderMiniMarkdown, u as UI_PRESET_NAMES, v as collectFormScopes, w as fromA2uiSpecAction, x as collectValues, y as collectScopedValues, z as toJsonRenderSpec } from "./dist-bewtXYlO.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, RENDER_UI_TOOL, UI_CATALOG_GROUPS, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_A2UI_CATALOG_ID, WEBSKILL_STYLES_CSS, WEBSKILL_SURFACE_ACTION, WebFormBridge, a2uiComponentSchema, a2uiComponentShapes, buildA2uiCatalogDefinition, buildRenderResult, chartSpecFromProps, chartToTable, collectSpecActions, collectValues, createUiCatalogToolSource, defineUiCatalog, ensureStyles, fromA2uiSpecAction, fromA2uiSurfaceAction, fromUiSurfaceActionDispatch, fromVercelToolResult, interactionToFormModel, interactionToUiSpec, loadOpenUiPeers, loadWebSkillLitCatalog, mountEchart, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiSpecMessages, toA2uiSurfaceAction, toJsonRenderSpec, toOpenUiSpecLang, toUiSurfaceActionDispatch, toVercelToolInvocation, uiCatalog };
|
|
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 };
|