@webskill/sdk 0.0.5 → 0.0.6

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.
@@ -1,5 +1,5 @@
1
- import { $t as SkillCatalogEntry, Et as WebSkillRuntime, F as LlmClient, Gt as FileSystemProvider, L as LlmMessage, an as SkillManifest, dt as RuntimeRun, wt as UiBridge } from "./index-BQDc-U1x.js";
2
- import { d as SkillManager } from "./index-aEple804.js";
1
+ import { Et as UiBridge, L as LlmClient, Xt as FileSystemProvider, an as SkillCatalogEntry, dn as SkillManifest, kt as WebSkillRuntime, pt as RuntimeRun, sn as SkillDocument, z as LlmMessage } from "./index-DCifjtJx.js";
2
+ import { d as SkillManager } from "./index-vi7GPemR.js";
3
3
  //#region ../governance/dist/index.d.ts
4
4
  //#region src/types.d.ts
5
5
  type CandidateStatus = 'draft' | 'pending-review' | 'approved' | 'published' | 'rejected';
@@ -374,10 +374,11 @@ declare class SimilarityDetector {
374
374
  }
375
375
  //#endregion
376
376
  //#region src/scoring/dependencyGraph.d.ts
377
- /** 技能引用依赖图(references/ 中引用其他技能的声明关系) */
378
377
  declare class DependencyGraph {
379
378
  #private;
380
379
  addDependency(from: string, to: string): void;
380
+ /** 从 frontmatter dependencies 声明建图(0.0.6 装配函数;只收录 Catalog 内技能之间的边) */
381
+ static buildFromCatalog(entries: SkillCatalogEntry[], documents: SkillDocument[]): DependencyGraph;
381
382
  dependenciesOf(name: string): string[];
382
383
  dependentsOf(name: string): string[];
383
384
  }
@@ -1,5 +1,5 @@
1
- import { G as WebSkillError, Z as isValidSkillName, it as validateSkills, rt as resolveInsideRoot } from "./dist-D405AlPD.js";
2
- import { i as NodeFS } from "./dist-Ixnb-hNR.js";
1
+ import { J as WebSkillError, lt as resolveInsideRoot, nt as isValidSkillName, ut as validateSkills } from "./dist-nXiR40hi.js";
2
+ import { i as NodeFS } from "./dist-33_zuOCm.js";
3
3
  import path from "node:path";
4
4
  import { mkdtemp } from "node:fs/promises";
5
5
  import { tmpdir } from "node:os";
@@ -731,8 +731,7 @@ var SimilarityDetector = class {
731
731
  for (const skill of existing) if (jaccardSimilarity(description, skill.description) >= this.#threshold) return skill.name;
732
732
  }
733
733
  };
734
- /** 技能引用依赖图(references/ 中引用其他技能的声明关系) */
735
- var DependencyGraph = class {
734
+ var DependencyGraph = class DependencyGraph {
736
735
  #edges = /* @__PURE__ */ new Map();
737
736
  addDependency(from, to) {
738
737
  if (from === to) return;
@@ -740,6 +739,16 @@ var DependencyGraph = class {
740
739
  set.add(to);
741
740
  this.#edges.set(from, set);
742
741
  }
742
+ /** 从 frontmatter dependencies 声明建图(0.0.6 装配函数;只收录 Catalog 内技能之间的边) */
743
+ static buildFromCatalog(entries, documents) {
744
+ const names = new Set(entries.map((e) => e.name));
745
+ const graph = new DependencyGraph();
746
+ for (const doc of documents) {
747
+ if (!names.has(doc.metadata.name)) continue;
748
+ for (const dep of doc.metadata.dependencies ?? []) if (names.has(dep)) graph.addDependency(doc.metadata.name, dep);
749
+ }
750
+ return graph;
751
+ }
743
752
  dependenciesOf(name) {
744
753
  return [...this.#edges.get(name) ?? []].sort();
745
754
  }
@@ -156,6 +156,8 @@ interface SkillMetadata {
156
156
  description: string;
157
157
  license?: string;
158
158
  version?: string;
159
+ /** 声明式依赖:精确技能名列表(无版本约束);缺依赖/循环依赖 → error 级校验 */
160
+ dependencies?: string[];
159
161
  [key: string]: unknown;
160
162
  }
161
163
  interface SkillLocation {
@@ -215,7 +217,46 @@ declare function checkSkillRules(input: {
215
217
  parseError?: WebSkillError;
216
218
  scriptFileNames?: string[];
217
219
  existingNames?: Set<string>;
220
+ /** 全库技能名集合(两趟扫描提供);提供时启用 dependencies 存在性校验 */
221
+ knownSkillNames?: Set<string>;
218
222
  }): SkillIssue[];
223
+ /**
224
+ * 循环依赖检测(全量邻接表,discovery 两趟扫描第二趟调用)。
225
+ * 每个环只报一次(error 级,阻断进 Catalog);自引用视为长度 1 的环。
226
+ */
227
+ declare function checkDependencyCycles(adjacency: Map<string, string[]>): {
228
+ issues: SkillIssue[];
229
+ /** 处于环上的技能名(调用方将其排除出 Catalog) */
230
+ involved: Set<string>;
231
+ };
232
+ //#endregion
233
+ //#region src/skill/skillPack.d.ts
234
+ /**
235
+ * 技能包集(skill pack)格式与打包逻辑(node/browser 共用单一来源):
236
+ * webskill.skill-pack.json { schemaVersion: 1, skills: [{ name, digest }] }
237
+ * <skill-a>/SKILL.md … webskill.skill-manifest.json
238
+ * <skill-b>/SKILL.md …
239
+ * fflate 环境无关;文件读取经 FileSystemProvider 抽象。
240
+ */
241
+ /** 包级清单文件名(位于 zip 根,不参与各技能 digest) */
242
+ declare const SKILL_PACK_FILE = "webskill.skill-pack.json";
243
+ interface SkillPackManifest {
244
+ schemaVersion: 1;
245
+ skills: Array<{
246
+ name: string;
247
+ digest: string;
248
+ }>;
249
+ }
250
+ /**
251
+ * 多技能打包为单一 zip(包级清单 + 各技能目录含自身 manifest)。
252
+ * manifestBuilder 负责确保技能目录内 manifest 文件存在并返回之(digest 入包级清单)。
253
+ */
254
+ declare function exportSkills(fs: FileSystemProvider, input: {
255
+ roots: string[];
256
+ manifestBuilder: (skillRoot: string) => Promise<SkillManifest>;
257
+ }): Promise<Uint8Array>;
258
+ /** 包级清单解析 + 形状校验;损坏 → INSTALL_FAILED(安装侧保证零残留) */
259
+ declare function parseSkillPackManifest(text: string): SkillPackManifest;
219
260
  //#endregion
220
261
  //#region src/skill/discovery.d.ts
221
262
  interface DiscoveryResult {
@@ -590,6 +631,16 @@ interface InteractionResponse {
590
631
  value?: unknown;
591
632
  cancelled?: boolean;
592
633
  }
634
+ /** 图表规格($chart 约定的校验后形态;渲染单一来源在 ui/chart/miniChart) */
635
+ interface ChartSpec {
636
+ kind: 'bar' | 'line' | 'pie';
637
+ title?: string;
638
+ labels: string[];
639
+ series: Array<{
640
+ name?: string;
641
+ data: number[];
642
+ }>;
643
+ }
593
644
  type RenderBlock = {
594
645
  type: 'markdown';
595
646
  text: string;
@@ -609,6 +660,9 @@ type RenderBlock = {
609
660
  path: string;
610
661
  mimeType?: string;
611
662
  size?: number;
663
+ } | {
664
+ type: 'chart';
665
+ chart: ChartSpec;
612
666
  };
613
667
  interface RenderResultRequest {
614
668
  runId: string;
@@ -717,10 +771,15 @@ interface RunResult {
717
771
  //#endregion
718
772
  //#region src/interaction/renderResult.d.ts
719
773
  /**
720
- * 默认的结果渲染构造:LLM 最终输出markdown block,
721
- * run.artifacts file blocks;summary terminationReason。
774
+ * $chart 约定的形状校验:JSON content 的 data 含 $chart 键且形状合法 ChartSpec;
775
+ * 任何畸形(kind 非法 / labels 非字符串数组 / series 项缺数值 data)→ undefined(忽略不炸)。
776
+ */
777
+ declare function extractChartSpec(data: unknown): ChartSpec | undefined;
778
+ /**
779
+ * 默认的结果渲染构造:run 内收集的 renderBlocks(chart 等)在前,
780
+ * LLM 最终输出 → markdown block,run.artifacts → file blocks 在后;summary 取 terminationReason。
722
781
  */
723
- declare function buildRenderResult(run: RuntimeRun, output: string): RenderResultRequest;
782
+ declare function buildRenderResult(run: RuntimeRun, output: string, renderBlocks?: RenderBlock[]): RenderResultRequest;
724
783
  //#endregion
725
784
  //#region src/interaction/schemaToForm.d.ts
726
785
  /**
@@ -745,6 +804,48 @@ declare class MockUiBridge implements UiBridge {
745
804
  request(input: InteractionRequest): Promise<InteractionResponse>;
746
805
  }
747
806
  //#endregion
807
+ //#region src/facade/types.d.ts
808
+ /** 安装结果清单(对齐 README IDL 命名;SkillManifest 的精简投影) */
809
+ interface InstalledSkillManifest {
810
+ name: string;
811
+ version?: string;
812
+ installedAt: string;
813
+ integrity: {
814
+ algorithm: 'sha256';
815
+ digest: string;
816
+ };
817
+ }
818
+ /** navigator.webskill 统一门面(环境无关;浏览器挂载见 browser/navigator.ts) */
819
+ interface WebSkillApi {
820
+ discover(path: string): Promise<SkillCatalog>;
821
+ read(name: string): Promise<SkillDocument>;
822
+ validate(path: string): Promise<ValidationReport>;
823
+ run(prompt: string): Promise<RuntimeRun>;
824
+ install(url: string): Promise<InstalledSkillManifest>;
825
+ uninstall(name: string): Promise<void>;
826
+ }
827
+ //#endregion
828
+ //#region src/facade/webSkillApi.d.ts
829
+ /**
830
+ * navigator.webskill 门面装配层:零新业务逻辑,全部直转
831
+ * SkillDiscovery / validateSkills / WebSkillRuntime / SkillManager。
832
+ */
833
+ declare function createWebSkillApi(deps: {
834
+ fs: FileSystemProvider;
835
+ roots: string[];
836
+ llm: LlmClient;
837
+ executor?: ScriptExecutor;
838
+ artifactStore?: ArtifactStore;
839
+ /** 技能安装门面(Node SkillManager / BrowserSkillManager 均结构兼容);缺失时 install/uninstall 抛 TOOL_UNSUPPORTED */
840
+ skillManager?: {
841
+ install(source: SkillInstallSource, options?: {
842
+ expectedSha256?: string;
843
+ }): Promise<SkillManifest>;
844
+ uninstall(name: string): Promise<void>;
845
+ };
846
+ loopConfig?: AgentLoopConfig;
847
+ }): WebSkillApi;
848
+ //#endregion
748
849
  //#region src/lifecycle/eventBus.d.ts
749
850
  type LifecycleListener = (event: LifecycleEvent) => void;
750
851
  /** 生命周期事件总线:只读观测,支持按阶段或通配订阅 */
@@ -1170,4 +1271,4 @@ declare class WebSkillRuntime {
1170
1271
  resumeRun(runId: string): Promise<RunResult>;
1171
1272
  }
1172
1273
  //#endregion
1173
- export { READ_SKILL_FILE_INPUT_SCHEMA as $, SkillCatalogEntry as $t, InteractionResponse as A, createScriptContext as At, LlmToolCall as B, toLlmToolSpec as Bt, FsRunSnapshotStore as C, renderAvailableSkillsXml as Cn, TraceRecorder as Ct, InMemoryStore as D, verifyManifest as Dn, WebSkillRuntimeDeps as Dt, HookRunnerOptions as E, validateSkills as En, WebSkillRuntime as Et, LlmClient as F, networkUrlHost as Ft, MockLlmHandler as G, FileSystemProvider as Gt, MemoryArtifactStore as H, CatalogRenderer as Ht, LlmCompleteInput as I, normalizeToolContent as It, MockUiBridge as J, SKILLS_LOCKFILE as Jt, MockLlmQueueItem as K, JsonSchema as Kt, LlmMessage as L, parseBridgeRequest as Lt, LifecycleHook as M, fromVercelStreamPart as Mt, LifecycleHookContext as N, isNetworkAllowed as Nt, InteractionPolicy as O, xmlRenderer as On, bridgeError as Ot, LifecycleListener as P, mergeCatalogEntries as Pt, ProgressiveRouter as Q, SkillCatalog as Qt, LlmResponse as R, resolveToolName as Rt, FsMemoryStore as S, parseSkillMarkdown as Sn, TraceEventType as St, HookRunner as T, resolveInsideRoot as Tn, VercelToolSpec as Tt, MemoryStore as U, DiscoveryResult as Ut, LlmToolSpec as V, toVercelToolSpecs as Vt, MockLlmClient as W, FileStat as Wt, OpenAiCompatibleClient as X, SKILL_NAME_MAX_LENGTH as Xt, NetworkPolicy as Y, SKILL_MANIFEST_FILE as Yt, OpenAiCompatibleClientConfig as Z, SKILL_NAME_PATTERN as Zt, EventBus as _, computeDigest as _n, ToolDefinition as _t, AgentLoopConfig as a, SkillManifest as an, RouteResult as at, FormField as b, jsonRenderer as bn, TraceClock as bt, ApprovalScope as c, SkillSource as cn, RunSnapshotStore as ct, BridgeCapabilities as d, VerifyResult as dn, RuntimeRun as dt, SkillDiscovery as en, READ_SKILL_FILE_TOOL as et, BridgeCapability as f, WebSkillError as fn, RuntimeSession as ft, CapabilityMode as g, checkSkillRules as gn, SkillRouter as gt, CapabilityApproval as h, buildManifest as hn, ScriptExecutor as ht, AgentLoop as i, SkillLocation as in, RenderResultRequest as it, LifecycleEvent as j, fromVercelResult as jt, InteractionRequest as k, buildRenderResult as kt, Artifact as l, SkillsLockfile as ln, RunTerminationReason as lt, BridgeResponse as m, buildCatalog as mn, ScriptExecutionContext as mt, ASK_USER_TOOL as n, SkillInstallSource as nn, RUN_SNAPSHOT_SCHEMA_VERSION as nt, AgentLoopDeps as o, SkillMetadata as on, RunResult as ot, BridgeRequest as p, WebSkillErrorCode as pn, SchemaInferer as pt, MockUiAnswer as q, MemoryFS as qt, ASK_USER_TOOL_NAME as r, SkillIssue as rn, RenderBlock as rt, ApprovalDecision as s, SkillReader as sn, RunSnapshot as st, ASK_USER_INPUT_SCHEMA as t, SkillDocument as tn, READ_SKILL_FILE_TOOL_NAME as tt, ArtifactStore as u, ValidationReport as un, RuntimePhase as ut, ExternalSkillProvider as v, escapeXml as vn, ToolResolution as vt, FullDisclosureRouter as w, renderCatalogJson as wn, UiBridge as wt, FsArtifactStore as x, normalizePath as xn, TraceEvent as xt, ExternalToolSource as y, isValidSkillName as yn, ToolResult as yt, LlmStreamEvent as z, schemaToForm as zt };
1274
+ export { OpenAiCompatibleClientConfig as $, SKILLS_LOCKFILE as $t, InteractionPolicy as A, normalizePath as An, WebSkillRuntimeDeps as At, LlmResponse as B, networkUrlHost as Bt, FsMemoryStore as C, checkDependencyCycles as Cn, TraceEvent as Ct, HookRunnerOptions as D, exportSkills as Dn, VercelToolSpec as Dt, HookRunner as E, escapeXml as En, UiBridge as Et, LifecycleHookContext as F, resolveInsideRoot as Fn, extractChartSpec as Ft, MemoryStore as G, toLlmToolSpec as Gt, LlmToolCall as H, parseBridgeRequest as Ht, LifecycleListener as I, validateSkills as In, fromVercelResult as It, MockLlmQueueItem as J, DiscoveryResult as Jt, MockLlmClient as K, toVercelToolSpecs as Kt, LlmClient as L, verifyManifest as Ln, fromVercelStreamPart as Lt, InteractionResponse as M, parseSkillPackManifest as Mn, buildRenderResult as Mt, LifecycleEvent as N, renderAvailableSkillsXml as Nn, createScriptContext as Nt, InMemoryStore as O, isValidSkillName as On, WebSkillApi as Ot, LifecycleHook as P, renderCatalogJson as Pn, createWebSkillApi as Pt, OpenAiCompatibleClient as Q, MemoryFS as Qt, LlmCompleteInput as R, xmlRenderer as Rn, isNetworkAllowed as Rt, FsArtifactStore as S, buildManifest as Sn, TraceClock as St, FullDisclosureRouter as T, computeDigest as Tn, TraceRecorder as Tt, LlmToolSpec as U, resolveToolName as Ut, LlmStreamEvent as V, normalizeToolContent as Vt, MemoryArtifactStore as W, schemaToForm as Wt, MockUiBridge as X, FileSystemProvider as Xt, MockUiAnswer as Y, FileStat as Yt, NetworkPolicy as Z, JsonSchema as Zt, ChartSpec as _, ValidationReport as _n, ScriptExecutor as _t, AgentLoopConfig as a, SkillCatalogEntry as an, RenderBlock as at, ExternalToolSource as b, WebSkillErrorCode as bn, ToolResolution as bt, ApprovalScope as c, SkillInstallSource as cn, RunResult as ct, BridgeCapabilities as d, SkillManifest as dn, RunTerminationReason as dt, SKILL_MANIFEST_FILE as en, ProgressiveRouter as et, BridgeCapability as f, SkillMetadata as fn, RuntimePhase as ft, CapabilityMode as g, SkillsLockfile as gn, ScriptExecutionContext as gt, CapabilityApproval as h, SkillSource as hn, SchemaInferer as ht, AgentLoop as i, SkillCatalog as in, RUN_SNAPSHOT_SCHEMA_VERSION as it, InteractionRequest as j, parseSkillMarkdown as jn, bridgeError as jt, InstalledSkillManifest as k, jsonRenderer as kn, WebSkillRuntime as kt, Artifact as l, SkillIssue as ln, RunSnapshot as lt, BridgeResponse as m, SkillReader as mn, RuntimeSession as mt, ASK_USER_TOOL as n, SKILL_NAME_PATTERN as nn, READ_SKILL_FILE_TOOL as nt, AgentLoopDeps as o, SkillDiscovery as on, RenderResultRequest as ot, BridgeRequest as p, SkillPackManifest as pn, RuntimeRun as pt, MockLlmHandler as q, CatalogRenderer as qt, ASK_USER_TOOL_NAME as r, SKILL_PACK_FILE as rn, READ_SKILL_FILE_TOOL_NAME as rt, ApprovalDecision as s, SkillDocument as sn, RouteResult as st, ASK_USER_INPUT_SCHEMA as t, SKILL_NAME_MAX_LENGTH as tn, READ_SKILL_FILE_INPUT_SCHEMA as tt, ArtifactStore as u, SkillLocation as un, RunSnapshotStore as ut, EventBus as v, VerifyResult as vn, SkillRouter as vt, FsRunSnapshotStore as w, checkSkillRules as wn, TraceEventType as wt, FormField as x, buildCatalog as xn, ToolResult as xt, ExternalSkillProvider as y, WebSkillError as yn, ToolDefinition as yt, LlmMessage as z, mergeCatalogEntries as zt };
@@ -1,4 +1,4 @@
1
- import { A as InteractionResponse, Gt as FileSystemProvider, Kt as JsonSchema, S as FsMemoryStore, Wt as FileStat, Y as NetworkPolicy, _t as ToolDefinition, an as SkillManifest, c as ApprovalScope, d as BridgeCapabilities, dn as VerifyResult, ht as ScriptExecutor, it as RenderResultRequest, k as InteractionRequest, ln as SkillsLockfile, mt as ScriptExecutionContext, nn as SkillInstallSource, pt as SchemaInferer, wt as UiBridge, x as FsArtifactStore, yt as ToolResult } from "./index-BQDc-U1x.js";
1
+ import { C as FsMemoryStore, Et as UiBridge, M as InteractionResponse, S as FsArtifactStore, Xt as FileSystemProvider, Yt as FileStat, Z as NetworkPolicy, Zt as JsonSchema, _t as ScriptExecutor, c as ApprovalScope, cn as SkillInstallSource, d as BridgeCapabilities, dn as SkillManifest, gn as SkillsLockfile, gt as ScriptExecutionContext, ht as SchemaInferer, j as InteractionRequest, ot as RenderResultRequest, vn as VerifyResult, xt as ToolResult, yt as ToolDefinition } from "./index-DCifjtJx.js";
2
2
  import { Readable, Writable } from "node:stream";
3
3
  //#region ../node/dist/index.d.ts
4
4
  //#region src/fs/nodeFs.d.ts
@@ -154,6 +154,10 @@ declare class SkillManager {
154
154
  format: 'zip' | 'tar';
155
155
  outPath: string;
156
156
  }): Promise<string>;
157
+ /** 多技能包集导出(webskill.skill-pack.json + 各技能目录含 manifest),写 outPath 并返回 */
158
+ exportPack(names: string[], options: {
159
+ outPath: string;
160
+ }): Promise<string>;
157
161
  }
158
162
  //#endregion
159
163
  //#region src/skillManagement/export/archiveExporter.d.ts
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as READ_SKILL_FILE_INPUT_SCHEMA, $t as SkillCatalogEntry, A as InteractionResponse, At as createScriptContext, B as LlmToolCall, Bt as toLlmToolSpec, C as FsRunSnapshotStore, Cn as renderAvailableSkillsXml, Ct as TraceRecorder, D as InMemoryStore, Dn as verifyManifest, Dt as WebSkillRuntimeDeps, E as HookRunnerOptions, En as validateSkills, Et as WebSkillRuntime, F as LlmClient, Ft as networkUrlHost, G as MockLlmHandler, Gt as FileSystemProvider, H as MemoryArtifactStore, Ht as CatalogRenderer, I as LlmCompleteInput, It as normalizeToolContent, J as MockUiBridge, Jt as SKILLS_LOCKFILE, K as MockLlmQueueItem, Kt as JsonSchema, L as LlmMessage, Lt as parseBridgeRequest, M as LifecycleHook, Mt as fromVercelStreamPart, N as LifecycleHookContext, Nt as isNetworkAllowed, O as InteractionPolicy, On as xmlRenderer, Ot as bridgeError, P as LifecycleListener, Pt as mergeCatalogEntries, Q as ProgressiveRouter, Qt as SkillCatalog, R as LlmResponse, Rt as resolveToolName, S as FsMemoryStore, Sn as parseSkillMarkdown, St as TraceEventType, T as HookRunner, Tn as resolveInsideRoot, Tt as VercelToolSpec, U as MemoryStore, Ut as DiscoveryResult, V as LlmToolSpec, Vt as toVercelToolSpecs, W as MockLlmClient, Wt as FileStat, X as OpenAiCompatibleClient, Xt as SKILL_NAME_MAX_LENGTH, Y as NetworkPolicy, Yt as SKILL_MANIFEST_FILE, Z as OpenAiCompatibleClientConfig, Zt as SKILL_NAME_PATTERN, _ as EventBus, _n as computeDigest, _t as ToolDefinition, a as AgentLoopConfig, an as SkillManifest, at as RouteResult, b as FormField, bn as jsonRenderer, bt as TraceClock, c as ApprovalScope, cn as SkillSource, ct as RunSnapshotStore, d as BridgeCapabilities, dn as VerifyResult, dt as RuntimeRun, en as SkillDiscovery, et as READ_SKILL_FILE_TOOL, f as BridgeCapability, fn as WebSkillError, ft as RuntimeSession, g as CapabilityMode, gn as checkSkillRules, gt as SkillRouter, h as CapabilityApproval, hn as buildManifest, ht as ScriptExecutor, i as AgentLoop, in as SkillLocation, it as RenderResultRequest, j as LifecycleEvent, jt as fromVercelResult, k as InteractionRequest, kt as buildRenderResult, l as Artifact, ln as SkillsLockfile, lt as RunTerminationReason, m as BridgeResponse, mn as buildCatalog, mt as ScriptExecutionContext, n as ASK_USER_TOOL, nn as SkillInstallSource, nt as RUN_SNAPSHOT_SCHEMA_VERSION, o as AgentLoopDeps, on as SkillMetadata, ot as RunResult, p as BridgeRequest, pn as WebSkillErrorCode, pt as SchemaInferer, q as MockUiAnswer, qt as MemoryFS, r as ASK_USER_TOOL_NAME, rn as SkillIssue, rt as RenderBlock, s as ApprovalDecision, sn as SkillReader, st as RunSnapshot, t as ASK_USER_INPUT_SCHEMA, tn as SkillDocument, tt as READ_SKILL_FILE_TOOL_NAME, u as ArtifactStore, un as ValidationReport, ut as RuntimePhase, v as ExternalSkillProvider, vn as escapeXml, vt as ToolResolution, w as FullDisclosureRouter, wn as renderCatalogJson, wt as UiBridge, x as FsArtifactStore, xn as normalizePath, xt as TraceEvent, y as ExternalToolSource, yn as isValidSkillName, yt as ToolResult, z as LlmStreamEvent, zt as schemaToForm } from "./index-BQDc-U1x.js";
2
- export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, type ApprovalDecision, type ApprovalScope, type Artifact, type ArtifactStore, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type DiscoveryResult, EventBus, type ExternalSkillProvider, type ExternalToolSource, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, type HookRunnerOptions, InMemoryStore, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MemoryArtifactStore, MemoryFS, type MemoryStore, MockLlmClient, type MockLlmHandler, type MockLlmQueueItem, type MockUiAnswer, MockUiBridge, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotStore, type RunTerminationReason, type RuntimePhase, type RuntimeRun, type RuntimeSession, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillInstallSource, type SkillIssue, type SkillLocation, type SkillManifest, type SkillMetadata, SkillReader, type SkillRouter, type SkillSource, type SkillsLockfile, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type UiBridge, type ValidationReport, type VercelToolSpec, type VerifyResult, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkSkillRules, computeDigest, createScriptContext, escapeXml, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
1
+ import { $ as OpenAiCompatibleClientConfig, $t as SKILLS_LOCKFILE, A as InteractionPolicy, An as normalizePath, At as WebSkillRuntimeDeps, B as LlmResponse, Bt as networkUrlHost, C as FsMemoryStore, Cn as checkDependencyCycles, Ct as TraceEvent, D as HookRunnerOptions, Dn as exportSkills, Dt as VercelToolSpec, E as HookRunner, En as escapeXml, Et as UiBridge, F as LifecycleHookContext, Fn as resolveInsideRoot, Ft as extractChartSpec, G as MemoryStore, Gt as toLlmToolSpec, H as LlmToolCall, Ht as parseBridgeRequest, I as LifecycleListener, In as validateSkills, It as fromVercelResult, J as MockLlmQueueItem, Jt as DiscoveryResult, K as MockLlmClient, Kt as toVercelToolSpecs, L as LlmClient, Ln as verifyManifest, Lt as fromVercelStreamPart, M as InteractionResponse, Mn as parseSkillPackManifest, Mt as buildRenderResult, N as LifecycleEvent, Nn as renderAvailableSkillsXml, Nt as createScriptContext, O as InMemoryStore, On as isValidSkillName, Ot as WebSkillApi, P as LifecycleHook, Pn as renderCatalogJson, Pt as createWebSkillApi, Q as OpenAiCompatibleClient, Qt as MemoryFS, R as LlmCompleteInput, Rn as xmlRenderer, Rt as isNetworkAllowed, S as FsArtifactStore, Sn as buildManifest, St as TraceClock, T as FullDisclosureRouter, Tn as computeDigest, Tt as TraceRecorder, U as LlmToolSpec, Ut as resolveToolName, V as LlmStreamEvent, Vt as normalizeToolContent, W as MemoryArtifactStore, Wt as schemaToForm, X as MockUiBridge, Xt as FileSystemProvider, Y as MockUiAnswer, Yt as FileStat, Z as NetworkPolicy, Zt as JsonSchema, _ as ChartSpec, _n as ValidationReport, _t as ScriptExecutor, a as AgentLoopConfig, an as SkillCatalogEntry, at as RenderBlock, b as ExternalToolSource, bn as WebSkillErrorCode, bt as ToolResolution, c as ApprovalScope, cn as SkillInstallSource, ct as RunResult, d as BridgeCapabilities, dn as SkillManifest, dt as RunTerminationReason, en as SKILL_MANIFEST_FILE, et as ProgressiveRouter, f as BridgeCapability, fn as SkillMetadata, ft as RuntimePhase, g as CapabilityMode, gn as SkillsLockfile, gt as ScriptExecutionContext, h as CapabilityApproval, hn as SkillSource, ht as SchemaInferer, i as AgentLoop, in as SkillCatalog, it as RUN_SNAPSHOT_SCHEMA_VERSION, j as InteractionRequest, jn as parseSkillMarkdown, jt as bridgeError, k as InstalledSkillManifest, kn as jsonRenderer, kt as WebSkillRuntime, l as Artifact, ln as SkillIssue, lt as RunSnapshot, m as BridgeResponse, mn as SkillReader, mt as RuntimeSession, n as ASK_USER_TOOL, nn as SKILL_NAME_PATTERN, nt as READ_SKILL_FILE_TOOL, o as AgentLoopDeps, on as SkillDiscovery, ot as RenderResultRequest, p as BridgeRequest, pn as SkillPackManifest, pt as RuntimeRun, q as MockLlmHandler, qt as CatalogRenderer, r as ASK_USER_TOOL_NAME, rn as SKILL_PACK_FILE, rt as READ_SKILL_FILE_TOOL_NAME, s as ApprovalDecision, sn as SkillDocument, st as RouteResult, t as ASK_USER_INPUT_SCHEMA, tn as SKILL_NAME_MAX_LENGTH, tt as READ_SKILL_FILE_INPUT_SCHEMA, u as ArtifactStore, un as SkillLocation, ut as RunSnapshotStore, v as EventBus, vn as VerifyResult, vt as SkillRouter, w as FsRunSnapshotStore, wn as checkSkillRules, wt as TraceEventType, x as FormField, xn as buildCatalog, xt as ToolResult, y as ExternalSkillProvider, yn as WebSkillError, yt as ToolDefinition, z as LlmMessage, zt as mergeCatalogEntries } from "./index-DCifjtJx.js";
2
+ export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, type ApprovalDecision, type ApprovalScope, type Artifact, type ArtifactStore, type BridgeCapabilities, type BridgeCapability, type BridgeRequest, type BridgeResponse, CapabilityApproval, type CapabilityMode, type CatalogRenderer, type ChartSpec, type DiscoveryResult, EventBus, type ExternalSkillProvider, type ExternalToolSource, type FileStat, type FileSystemProvider, type FormField, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, type HookRunnerOptions, InMemoryStore, type InstalledSkillManifest, type InteractionPolicy, type InteractionRequest, type InteractionResponse, type JsonSchema, type LifecycleEvent, type LifecycleHook, type LifecycleHookContext, type LifecycleListener, type LlmClient, type LlmCompleteInput, type LlmMessage, type LlmResponse, type LlmStreamEvent, type LlmToolCall, type LlmToolSpec, MemoryArtifactStore, MemoryFS, type MemoryStore, MockLlmClient, type MockLlmHandler, type MockLlmQueueItem, type MockUiAnswer, MockUiBridge, type NetworkPolicy, OpenAiCompatibleClient, type OpenAiCompatibleClientConfig, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, type RunSnapshot, type RunSnapshotStore, type RunTerminationReason, type RuntimePhase, type RuntimeRun, type RuntimeSession, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillInstallSource, type SkillIssue, type SkillLocation, type SkillManifest, type SkillMetadata, type SkillPackManifest, SkillReader, type SkillRouter, type SkillSource, type SkillsLockfile, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type UiBridge, type ValidationReport, type VercelToolSpec, type VerifyResult, type WebSkillApi, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as normalizePath, A as mergeCatalogEntries, B as SKILL_MANIFEST_FILE, C as WebSkillRuntime, D as fromVercelResult, E as createScriptContext, F as schemaToForm, G as WebSkillError, H as SKILL_NAME_PATTERN, I as toLlmToolSpec, J as checkSkillRules, K as buildCatalog, L as toVercelToolSpecs, M as normalizeToolContent, N as parseBridgeRequest, O as fromVercelStreamPart, P as resolveToolName, Q as jsonRenderer, R as MemoryFS, S as TraceRecorder, T as buildRenderResult, U as SkillDiscovery, V as SKILL_NAME_MAX_LENGTH, W as SkillReader, X as escapeXml, Y as computeDigest, Z as isValidSkillName, _ as ProgressiveRouter, a as CapabilityApproval, at as verifyManifest, b as READ_SKILL_FILE_TOOL_NAME, c as FsMemoryStore, d as HookRunner, et as parseSkillMarkdown, f as InMemoryStore, g as OpenAiCompatibleClient, h as MockUiBridge, i as AgentLoop, it as validateSkills, j as networkUrlHost, k as isNetworkAllowed, l as FsRunSnapshotStore, m as MockLlmClient, n as ASK_USER_TOOL, nt as renderCatalogJson, o as EventBus, ot as xmlRenderer, p as MemoryArtifactStore, q as buildManifest, r as ASK_USER_TOOL_NAME, rt as resolveInsideRoot, s as FsArtifactStore, t as ASK_USER_INPUT_SCHEMA, tt as renderAvailableSkillsXml, u as FullDisclosureRouter, v as READ_SKILL_FILE_INPUT_SCHEMA, w as bridgeError, x as RUN_SNAPSHOT_SCHEMA_VERSION, y as READ_SKILL_FILE_TOOL, z as SKILLS_LOCKFILE } from "./dist-D405AlPD.js";
1
+ import { $ as computeDigest, A as fromVercelStreamPart, B as MemoryFS, C as WebSkillRuntime, D as createWebSkillApi, E as createScriptContext, F as parseBridgeRequest, G as SKILL_PACK_FILE, H as SKILL_MANIFEST_FILE, I as resolveToolName, J as WebSkillError, K as SkillDiscovery, L as schemaToForm, M as mergeCatalogEntries, N as networkUrlHost, O as extractChartSpec, P as normalizeToolContent, Q as checkSkillRules, R as toLlmToolSpec, S as TraceRecorder, T as buildRenderResult, U as SKILL_NAME_MAX_LENGTH, V as SKILLS_LOCKFILE, W as SKILL_NAME_PATTERN, X as buildManifest, Y as buildCatalog, Z as checkDependencyCycles, _ as ProgressiveRouter, a as CapabilityApproval, at as parseSkillMarkdown, b as READ_SKILL_FILE_TOOL_NAME, c as FsMemoryStore, ct as renderCatalogJson, d as HookRunner, dt as verifyManifest, et as escapeXml, f as InMemoryStore, ft as xmlRenderer, g as OpenAiCompatibleClient, h as MockUiBridge, i as AgentLoop, it as normalizePath, j as isNetworkAllowed, k as fromVercelResult, l as FsRunSnapshotStore, lt as resolveInsideRoot, m as MockLlmClient, n as ASK_USER_TOOL, nt as isValidSkillName, o as EventBus, ot as parseSkillPackManifest, p as MemoryArtifactStore, q as SkillReader, r as ASK_USER_TOOL_NAME, rt as jsonRenderer, s as FsArtifactStore, st as renderAvailableSkillsXml, t as ASK_USER_INPUT_SCHEMA, tt as exportSkills, u as FullDisclosureRouter, ut as validateSkills, v as READ_SKILL_FILE_INPUT_SCHEMA, w as bridgeError, x as RUN_SNAPSHOT_SCHEMA_VERSION, y as READ_SKILL_FILE_TOOL, z as toVercelToolSpecs } from "./dist-nXiR40hi.js";
2
2
 
3
- export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, CapabilityApproval, EventBus, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, InMemoryStore, MemoryArtifactStore, MemoryFS, MockLlmClient, MockUiBridge, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkSkillRules, computeDigest, createScriptContext, escapeXml, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
3
+ export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, CapabilityApproval, EventBus, FsArtifactStore, FsMemoryStore, FsRunSnapshotStore, FullDisclosureRouter, HookRunner, InMemoryStore, MemoryArtifactStore, MemoryFS, MockLlmClient, MockUiBridge, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, RUN_SNAPSHOT_SCHEMA_VERSION, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_PACK_FILE, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, bridgeError, buildCatalog, buildManifest, buildRenderResult, checkDependencyCycles, checkSkillRules, computeDigest, createScriptContext, createWebSkillApi, escapeXml, exportSkills, extractChartSpec, fromVercelResult, fromVercelStreamPart, isNetworkAllowed, isValidSkillName, jsonRenderer, mergeCatalogEntries, networkUrlHost, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, parseSkillPackManifest, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, verifyManifest, xmlRenderer };
package/dist/mcp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { $t as SkillCatalogEntry, Kt as JsonSchema, Pt as mergeCatalogEntries, V as LlmToolSpec, tn as SkillDocument, v as ExternalSkillProvider, y as ExternalToolSource, yt as ToolResult } from "./index-BQDc-U1x.js";
1
+ import { U as LlmToolSpec, Zt as JsonSchema, an as SkillCatalogEntry, b as ExternalToolSource, sn as SkillDocument, xt as ToolResult, y as ExternalSkillProvider, zt as mergeCatalogEntries } from "./index-DCifjtJx.js";
2
2
  import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
3
3
  import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
4
4
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
package/dist/mcp.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as mergeCatalogEntries, G as WebSkillError, M as normalizeToolContent } from "./dist-D405AlPD.js";
1
+ import { J as WebSkillError, M as mergeCatalogEntries, P as normalizeToolContent } from "./dist-nXiR40hi.js";
2
2
  import { fromJSONSchema } from "zod";
3
3
 
4
4
  //#region ../mcp/dist/index.js
package/dist/node.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { At as createScriptContext, Jt as SKILLS_LOCKFILE, Yt as SKILL_MANIFEST_FILE, an as SkillManifest, dn as VerifyResult, ln as SkillsLockfile, nn as SkillInstallSource } from "./index-BQDc-U1x.js";
2
- import { a as LlmEnvConfig, c as OxcSchemaInferer, d as SkillManager, f as loadLlmConfigFromEnv, i as LlmCapabilities, l as SandboxOptions, m as readArchiveManifest, n as FileArtifactStore, o as NodeFS, p as probeLlmCapabilities, r as FileMemoryStore, s as NodeScriptExecutor, t as CliUiBridge, u as SandboxedScriptExecutor } from "./index-aEple804.js";
1
+ import { $t as SKILLS_LOCKFILE, Nt as createScriptContext, cn as SkillInstallSource, dn as SkillManifest, en as SKILL_MANIFEST_FILE, gn as SkillsLockfile, vn as VerifyResult } from "./index-DCifjtJx.js";
2
+ import { a as LlmEnvConfig, c as OxcSchemaInferer, d as SkillManager, f as loadLlmConfigFromEnv, i as LlmCapabilities, l as SandboxOptions, m as readArchiveManifest, n as FileArtifactStore, o as NodeFS, p as probeLlmCapabilities, r as FileMemoryStore, s as NodeScriptExecutor, t as CliUiBridge, u as SandboxedScriptExecutor } from "./index-vi7GPemR.js";
3
3
  export { CliUiBridge, FileArtifactStore, FileMemoryStore, type LlmCapabilities, type LlmEnvConfig, NodeFS, NodeScriptExecutor, OxcSchemaInferer, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, type SandboxOptions, SandboxedScriptExecutor, SkillManager, type SkillManifest, type SkillInstallSource as SkillSource, type SkillsLockfile, type VerifyResult, createScriptContext, loadLlmConfigFromEnv, probeLlmCapabilities, readArchiveManifest };
package/dist/node.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as SKILL_MANIFEST_FILE, E as createScriptContext, z as SKILLS_LOCKFILE } from "./dist-D405AlPD.js";
2
- import { a as NodeScriptExecutor, c as SkillManager, d as readArchiveManifest, i as NodeFS, l as loadLlmConfigFromEnv, n as FileArtifactStore, o as OxcSchemaInferer, r as FileMemoryStore, s as SandboxedScriptExecutor, t as CliUiBridge, u as probeLlmCapabilities } from "./dist-Ixnb-hNR.js";
1
+ import { E as createScriptContext, H as SKILL_MANIFEST_FILE, V as SKILLS_LOCKFILE } from "./dist-nXiR40hi.js";
2
+ import { a as NodeScriptExecutor, c as SkillManager, d as readArchiveManifest, i as NodeFS, l as loadLlmConfigFromEnv, n as FileArtifactStore, o as OxcSchemaInferer, r as FileMemoryStore, s as SandboxedScriptExecutor, t as CliUiBridge, u as probeLlmCapabilities } from "./dist-33_zuOCm.js";
3
3
 
4
4
  export { CliUiBridge, FileArtifactStore, FileMemoryStore, NodeFS, NodeScriptExecutor, OxcSchemaInferer, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SandboxedScriptExecutor, SkillManager, createScriptContext, loadLlmConfigFromEnv, probeLlmCapabilities, readArchiveManifest };
@@ -1,4 +1,4 @@
1
- import { A as InteractionResponse, it as RenderResultRequest, k as InteractionRequest, wt as UiBridge } from "./index-BQDc-U1x.js";
1
+ import { Et as UiBridge, M as InteractionResponse, j as InteractionRequest, ot as RenderResultRequest } from "./index-DCifjtJx.js";
2
2
  //#region ../ui-react/dist/index.d.ts
3
3
  //#region src/bridgeState.d.ts
4
4
  /**
@@ -26,7 +26,7 @@ declare function InteractionForm({ bridge }: {
26
26
  }): import("react").JSX.Element | null;
27
27
  //#endregion
28
28
  //#region src/components/ResultBlocks.d.ts
29
- /** 订阅 bridge.latestResult 渲染五种 RenderBlock */
29
+ /** 订阅 bridge.latestResult 渲染六种 RenderBlock */
30
30
  declare function ResultBlocks({ bridge }: {
31
31
  bridge: ReactBridgeState;
32
32
  }): import("react").JSX.Element | null;
package/dist/ui-react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as interactionToFormModel, f as collectValues, x as shapeInteractionValue, y as renderMiniMarkdown } from "./dist-BM-VcQ90.js";
1
+ import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BQruQ9Hv.js";
2
2
  import { useLayoutEffect, useRef, useState, useSyncExternalStore } from "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
 
@@ -185,8 +185,18 @@ function MarkdownBlock({ text }) {
185
185
  }, [text]);
186
186
  return /* @__PURE__ */ jsx("div", { ref });
187
187
  }
188
+ function ChartBlock({ chart }) {
189
+ const ref = useRef(null);
190
+ useLayoutEffect(() => {
191
+ const el = ref.current;
192
+ if (!el) return;
193
+ el.replaceChildren(renderMiniChart(chart, el.ownerDocument));
194
+ }, [chart]);
195
+ return /* @__PURE__ */ jsx("div", { ref });
196
+ }
188
197
  function Block({ block }) {
189
198
  switch (block.type) {
199
+ case "chart": return /* @__PURE__ */ jsx(ChartBlock, { chart: block.chart });
190
200
  case "markdown": return /* @__PURE__ */ jsx(MarkdownBlock, { text: block.text });
191
201
  case "json": return /* @__PURE__ */ jsx("pre", {
192
202
  className: "webskill-result__json",
@@ -206,7 +216,7 @@ function Block({ block }) {
206
216
  }
207
217
  }
208
218
  }
209
- /** 订阅 bridge.latestResult 渲染五种 RenderBlock */
219
+ /** 订阅 bridge.latestResult 渲染六种 RenderBlock */
210
220
  function ResultBlocks({ bridge }) {
211
221
  const result = useSyncExternalStore(bridge.subscribe, () => bridge.latestResult);
212
222
  if (!result) return null;
package/dist/ui-vue.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as InteractionResponse, it as RenderResultRequest, k as InteractionRequest, wt as UiBridge } from "./index-BQDc-U1x.js";
1
+ import { Et as UiBridge, M as InteractionResponse, j as InteractionRequest, ot as RenderResultRequest } from "./index-DCifjtJx.js";
2
2
  import { PropType } from "vue";
3
3
  //#region ../ui-vue/dist/index.d.ts
4
4
  //#region src/bridgeState.d.ts
@@ -38,7 +38,7 @@ declare const InteractionForm: import("vue").DefineComponent<import("vue").Extra
38
38
  }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
39
39
  //#endregion
40
40
  //#region src/components/resultBlocks.d.ts
41
- /** 订阅 bridge.state.latestResult 渲染五种 RenderBlock */
41
+ /** 订阅 bridge.state.latestResult 渲染六种 RenderBlock */
42
42
  declare const ResultBlocks: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
43
43
  bridge: {
44
44
  type: PropType<VueBridgeState>;
package/dist/ui-vue.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as interactionToFormModel, f as collectValues, x as shapeInteractionValue, y as renderMiniMarkdown } from "./dist-BM-VcQ90.js";
1
+ import { S as renderMiniMarkdown, m as collectValues, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BQruQ9Hv.js";
2
2
  import { defineComponent, h, reactive, ref } from "vue";
3
3
 
4
4
  //#region ../ui-vue/dist/index.js
@@ -132,6 +132,13 @@ const InteractionForm = defineComponent({
132
132
  });
133
133
  function renderBlock(block, key) {
134
134
  switch (block.type) {
135
+ case "chart": return h("div", {
136
+ key,
137
+ onVnodeMounted: (vnode) => {
138
+ const el = vnode.el;
139
+ if (el) el.replaceChildren(renderMiniChart(block.chart, el.ownerDocument));
140
+ }
141
+ });
135
142
  case "markdown": return h("div", {
136
143
  key,
137
144
  onVnodeMounted: (vnode) => {
@@ -158,7 +165,7 @@ function renderBlock(block, key) {
158
165
  }
159
166
  }
160
167
  }
161
- /** 订阅 bridge.state.latestResult 渲染五种 RenderBlock */
168
+ /** 订阅 bridge.state.latestResult 渲染六种 RenderBlock */
162
169
  const ResultBlocks = defineComponent({
163
170
  name: "WebSkillResultBlocks",
164
171
  props: { bridge: {
package/dist/ui.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as InteractionResponse, it as RenderResultRequest, k as InteractionRequest, kt as buildRenderResult, rt as RenderBlock, wt as UiBridge } from "./index-BQDc-U1x.js";
1
+ import { Et as UiBridge, M as InteractionResponse, Mt as buildRenderResult, _ as ChartSpec, at as RenderBlock, j as InteractionRequest, ot as RenderResultRequest } from "./index-DCifjtJx.js";
2
2
  //#region ../ui/dist/index.d.ts
3
3
  //#region src/model/formModel.d.ts
4
4
  interface FormModel {
@@ -47,6 +47,18 @@ declare function collectValues(controls: ControlModel[], container: ParentNode):
47
47
  */
48
48
  declare function renderMiniMarkdown(text: string, doc: Document): HTMLElement;
49
49
  //#endregion
50
+ //#region src/chart/miniChart.d.ts
51
+ /** 固定 8 色循环调色板 */
52
+ declare const CHART_PALETTE: readonly ['#4e79a7', '#f28e2b', '#e15759', '#76b7b2', '#59a14f', '#edc948', '#b07aa1', '#ff9da7'];
53
+ /** ChartSpec → SVG(bar 等宽柱 + 值标签;line 折线 + 点;pie 扇形 + 图例;空数据容错) */
54
+ declare function renderMiniChart(chart: ChartSpec, doc: Document): SVGSVGElement;
55
+ /** A2UI/OpenUI 降级:chart → table(labels 为首列,series 各为一列) */
56
+ declare function chartToTable(chart: ChartSpec): {
57
+ type: 'table';
58
+ columns: string[];
59
+ rows: unknown[][];
60
+ };
61
+ //#endregion
50
62
  //#region src/web/webFormBridge.d.ts
51
63
  /**
52
64
  * 框架无关原生 DOM 的 UiBridge:request 渲染表单并返回 Promise
@@ -70,7 +82,7 @@ declare class WebFormBridge implements UiBridge {
70
82
  }
71
83
  //#endregion
72
84
  //#region src/web/resultRenderer.d.ts
73
- /** RenderBlock → DOM(markdown/json/table/image/file 五种) */
85
+ /** RenderBlock → DOM(markdown/json/table/image/file/chart 六种) */
74
86
  declare function renderBlocks(container: HTMLElement, blocks: RenderBlock[], doc: Document): void;
75
87
  /** 完整 RenderResultRequest → DOM(summary 头 + blocks) */
76
88
  declare function renderRenderResult(request: RenderResultRequest, doc: Document): HTMLElement;
@@ -168,4 +180,4 @@ declare class LitRendererBridge implements UiBridge {
168
180
  request(input: InteractionRequest): Promise<InteractionResponse>;
169
181
  }
170
182
  //#endregion
171
- export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, type A2uiMessage, type CollectedValues, type ControlModel, type FormModel, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
183
+ export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, type A2uiMessage, CHART_PALETTE, type CollectedValues, type ControlModel, type FormModel, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, type VercelToolInvocation, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, chartToTable, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { T as buildRenderResult } from "./dist-D405AlPD.js";
2
- import { C as toOpenUiLang, S as toA2uiMessages, _ as interactionToFormModel, a as LitRendererBridge, b as renderRenderResult, c as VERCEL_INTERACTION_TOOL_NAME, d as WebFormBridge, f as collectValues, g as fromVercelToolResult, h as fromOpenUiAction, i as A2UI_VERSION, l as VercelUiBridge, m as fromA2uiAction, n as A2UI_CANCEL_ACTION, o as OPENUI_CANCEL_ACTION, p as ensureStyles, r as A2UI_SUBMIT_ACTION, s as OPENUI_SUBMIT_ACTION, t as A2UI_BASIC_CATALOG_ID, u as WEBSKILL_STYLES_CSS, v as renderBlocks, w as toVercelToolInvocation, x as shapeInteractionValue, y as renderMiniMarkdown } from "./dist-BM-VcQ90.js";
1
+ import { T as buildRenderResult } from "./dist-nXiR40hi.js";
2
+ import { C as renderRenderResult, D as toVercelToolInvocation, E as toOpenUiLang, S as renderMiniMarkdown, T as toA2uiMessages, _ as fromOpenUiAction, a as CHART_PALETTE, b as renderBlocks, c as OPENUI_SUBMIT_ACTION, d as WEBSKILL_STYLES_CSS, f as WebFormBridge, g as fromA2uiAction, h as ensureStyles, i as A2UI_VERSION, l as VERCEL_INTERACTION_TOOL_NAME, m as collectValues, n as A2UI_CANCEL_ACTION, o as LitRendererBridge, p as chartToTable, r as A2UI_SUBMIT_ACTION, s as OPENUI_CANCEL_ACTION, t as A2UI_BASIC_CATALOG_ID, u as VercelUiBridge, v as fromVercelToolResult, w as shapeInteractionValue, x as renderMiniChart, y as interactionToFormModel } from "./dist-BQruQ9Hv.js";
3
3
 
4
- export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
4
+ export { A2UI_BASIC_CATALOG_ID, A2UI_CANCEL_ACTION, A2UI_SUBMIT_ACTION, A2UI_VERSION, CHART_PALETTE, LitRendererBridge, OPENUI_CANCEL_ACTION, OPENUI_SUBMIT_ACTION, VERCEL_INTERACTION_TOOL_NAME, VercelUiBridge, WEBSKILL_STYLES_CSS, WebFormBridge, buildRenderResult, chartToTable, collectValues, ensureStyles, fromA2uiAction, fromOpenUiAction, fromVercelToolResult, interactionToFormModel, renderBlocks, renderMiniChart, renderMiniMarkdown, renderRenderResult, shapeInteractionValue, toA2uiMessages, toOpenUiLang, toVercelToolInvocation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webskill/sdk",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "WebSkill — browser/Node agent skill runtime (skills, tools, MCP, governance, UI)",
5
5
  "license": "MIT",
6
6
  "type": "module",