@webskill/sdk 0.0.4 → 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 { A as LlmClient, Gt as SkillCatalogEntry, Lt as FileSystemProvider, M as LlmMessage, Zt as SkillManifest, at as RuntimeRun, bt as WebSkillRuntime, vt as UiBridge } from "./index-CqDIreSE.js";
2
- import { d as SkillManager } from "./index-BsbfEiaC.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 { H as WebSkillError, J as isValidSkillName, et as resolveInsideRoot, tt as validateSkills } from "./dist-COsE72Ct.js";
2
- import { i as NodeFS } from "./dist-Bvhbxrrt.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
  }
@@ -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' | 'TOOL_UNSUPPORTED' | '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' | 'GOVERNANCE_FAILED' | 'RUN_SNAPSHOT_NOT_FOUND' | 'RUN_SNAPSHOT_EXPIRED' | 'RUN_SNAPSHOT_INCOMPATIBLE';
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_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' | 'GOVERNANCE_FAILED' | 'RUN_SNAPSHOT_NOT_FOUND' | 'RUN_SNAPSHOT_EXPIRED' | 'RUN_SNAPSHOT_INCOMPATIBLE';
4
4
  /** 所有公开 API 抛出的结构化错误,code 供上层可编程处理 */
5
5
  declare class WebSkillError extends Error {
6
6
  readonly code: WebSkillErrorCode;
@@ -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 {
@@ -472,6 +513,8 @@ interface ScriptExecutionContext {
472
513
  }): Promise<Artifact>;
473
514
  /** 脚本主动请求人在环确认;策略见 InteractionPolicy.confirmations */
474
515
  confirm?(message: string): Promise<boolean>;
516
+ /** 宿主侧降级 warning 出口(网络阻断等;引擎接线到 run.warning trace) */
517
+ onWarning?(message: string): void;
475
518
  }
476
519
  /** Schema 推导 port:纯文本静态分析脚本源码 → JSON Schema(best-effort) */
477
520
  interface SchemaInferer {
@@ -547,6 +590,8 @@ declare function createScriptContext(deps: {
547
590
  runId: string;
548
591
  /** 提供时暴露 context.confirm(由引擎按交互策略实现) */
549
592
  confirm?: (message: string) => Promise<boolean>;
593
+ /** 宿主侧降级 warning 出口(网络阻断等;引擎接线到 run.warning trace) */
594
+ onWarning?: (message: string) => void;
550
595
  }): ScriptExecutionContext;
551
596
  //#endregion
552
597
  //#region src/interaction/types.d.ts
@@ -573,12 +618,29 @@ type InteractionRequest = {
573
618
  label: string;
574
619
  value: unknown;
575
620
  }>;
621
+ } | {
622
+ /** 能力强制授权(require-approval):与脚本自发 confirm 区分,UI 渲染为授权样式 */
623
+ type: 'authorize';
624
+ id: string;
625
+ capability: 'readReference' | 'writeArtifact' | 'confirm';
626
+ message: string;
627
+ details?: unknown;
576
628
  };
577
629
  interface InteractionResponse {
578
630
  id: string;
579
631
  value?: unknown;
580
632
  cancelled?: boolean;
581
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
+ }
582
644
  type RenderBlock = {
583
645
  type: 'markdown';
584
646
  text: string;
@@ -598,6 +660,9 @@ type RenderBlock = {
598
660
  path: string;
599
661
  mimeType?: string;
600
662
  size?: number;
663
+ } | {
664
+ type: 'chart';
665
+ chart: ChartSpec;
601
666
  };
602
667
  interface RenderResultRequest {
603
668
  runId: string;
@@ -706,10 +771,15 @@ interface RunResult {
706
771
  //#endregion
707
772
  //#region src/interaction/renderResult.d.ts
708
773
  /**
709
- * 默认的结果渲染构造:LLM 最终输出markdown block,
710
- * run.artifacts file blocks;summary terminationReason。
774
+ * $chart 约定的形状校验:JSON content 的 data 含 $chart 键且形状合法 ChartSpec;
775
+ * 任何畸形(kind 非法 / labels 非字符串数组 / series 项缺数值 data)→ undefined(忽略不炸)。
711
776
  */
712
- declare function buildRenderResult(run: RuntimeRun, output: string): RenderResultRequest;
777
+ declare function extractChartSpec(data: unknown): ChartSpec | undefined;
778
+ /**
779
+ * 默认的结果渲染构造:run 内收集的 renderBlocks(chart 等)在前,
780
+ * LLM 最终输出 → markdown block,run.artifacts → file blocks 在后;summary 取 terminationReason。
781
+ */
782
+ declare function buildRenderResult(run: RuntimeRun, output: string, renderBlocks?: RenderBlock[]): RenderResultRequest;
713
783
  //#endregion
714
784
  //#region src/interaction/schemaToForm.d.ts
715
785
  /**
@@ -734,6 +804,48 @@ declare class MockUiBridge implements UiBridge {
734
804
  request(input: InteractionRequest): Promise<InteractionResponse>;
735
805
  }
736
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
737
849
  //#region src/lifecycle/eventBus.d.ts
738
850
  type LifecycleListener = (event: LifecycleEvent) => void;
739
851
  /** 生命周期事件总线:只读观测,支持按阶段或通配订阅 */
@@ -891,16 +1003,72 @@ interface BridgeResponse {
891
1003
  message: string;
892
1004
  };
893
1005
  }
1006
+ /**
1007
+ * 能力模式:true 直通 / false 关闭(TOOL_UNSUPPORTED)/ 'require-approval' 调用前强制授权
1008
+ * (布尔语义与现状完全兼容)
1009
+ */
1010
+ type CapabilityMode = boolean | 'require-approval';
1011
+ /** 授权粒度:'once-per-run'(默认,run 内同类能力批准一次)/ 'every-call'(每次调用都问) */
1012
+ type ApprovalScope = 'once-per-run' | 'every-call';
894
1013
  /** 三能力独立开关;缺省全开,显式 false 即关闭(TOOL_UNSUPPORTED) */
895
1014
  interface BridgeCapabilities {
896
- readReference?: boolean;
897
- writeArtifact?: boolean;
898
- confirm?: boolean;
1015
+ readReference?: CapabilityMode;
1016
+ writeArtifact?: CapabilityMode;
1017
+ confirm?: CapabilityMode;
899
1018
  }
900
1019
  /** 入站校验:非法 kind / 缺 id / 缺字段 → undefined(调用方忽略并记 warning) */
901
1020
  declare function parseBridgeRequest(data: unknown): BridgeRequest | undefined;
902
1021
  declare function bridgeError(id: string, code: string, message: string): BridgeResponse;
903
1022
  //#endregion
1023
+ //#region src/sandbox/networkPolicy.d.ts
1024
+ /**
1025
+ * 网络策略类型 + 匹配逻辑(单一来源:browser worker 经函数字符串注入、
1026
+ * node worker 直接 import,禁止各自重复实现)。
1027
+ *
1028
+ * 注意:isNetworkAllowed 会被 toString() 内嵌进浏览器 Worker bootstrap,
1029
+ * 函数体必须自包含(不引用模块内其它符号),且不得使用模板字符串/反引号。
1030
+ */
1031
+ type NetworkPolicy = 'deny-all' | 'allow-all' | {
1032
+ allow: string[];
1033
+ };
1034
+ /**
1035
+ * 判定 URL 是否被策略放行:
1036
+ * - 'deny-all'(默认)全拒;'allow-all' 全放
1037
+ * - { allow } 条目支持三种写法:
1038
+ * - 精确域名 'api.example.com'(忽略端口与路径)
1039
+ * - 通配 '*.example.com'(含 apex 与任意深度子域)
1040
+ * - 源 'http://localhost:3000'(协议 + host + port 全等)
1041
+ * - URL 解析失败一律拒绝
1042
+ */
1043
+ declare function isNetworkAllowed(policy: NetworkPolicy, url: string): boolean;
1044
+ /** 阻断 trace 用的脱敏 host(解析失败返回占位,不记录完整 URL) */
1045
+ declare function networkUrlHost(url: string): string;
1046
+ //#endregion
1047
+ //#region src/sandbox/approval.d.ts
1048
+ /** 桥消息对应的三类能力 */
1049
+ type BridgeCapability = 'readReference' | 'writeArtifact' | 'confirm';
1050
+ /** allowed 放行;denied 用户拒绝/无法询问;disabled 能力关闭(两者都回 TOOL_UNSUPPORTED,仅消息不同) */
1051
+ type ApprovalDecision = 'allowed' | 'denied' | 'disabled';
1052
+ /**
1053
+ * Per-capability 强制授权判定(宿主侧,browser/node 执行器共用单一来源)。
1054
+ * 'require-approval' 模式下经注入的 UiBridge 发 authorize 交互;
1055
+ * once-per-run(默认)在 run 内记忆已批准能力,every-call 每次调用都问。
1056
+ */
1057
+ declare class CapabilityApproval {
1058
+ #private;
1059
+ constructor(deps?: {
1060
+ uiBridge?: UiBridge;
1061
+ scope?: ApprovalScope;
1062
+ });
1063
+ authorize(input: {
1064
+ runId: string;
1065
+ capability: BridgeCapability;
1066
+ mode: CapabilityMode;
1067
+ message: string;
1068
+ details?: unknown;
1069
+ }): Promise<ApprovalDecision>;
1070
+ }
1071
+ //#endregion
904
1072
  //#region src/trace/traceRecorder.d.ts
905
1073
  interface TraceClock {
906
1074
  now?: () => string;
@@ -1103,4 +1271,4 @@ declare class WebSkillRuntime {
1103
1271
  resumeRun(runId: string): Promise<RunResult>;
1104
1272
  }
1105
1273
  //#endregion
1106
- export { RouteResult as $, SkillReader as $t, LlmClient as A, resolveToolName as At, MockLlmHandler as B, SKILLS_LOCKFILE as Bt, InteractionPolicy as C, buildRenderResult as Ct, LifecycleHook as D, mergeCatalogEntries as Dt, LifecycleEvent as E, fromVercelStreamPart as Et, LlmToolCall as F, DiscoveryResult as Ft, OpenAiCompatibleClientConfig as G, SkillCatalogEntry as Gt, MockUiAnswer as H, SKILL_NAME_MAX_LENGTH as Ht, LlmToolSpec as I, FileStat as It, READ_SKILL_FILE_TOOL as J, SkillInstallSource as Jt, ProgressiveRouter as K, SkillDiscovery as Kt, MemoryArtifactStore as L, FileSystemProvider as Lt, LlmMessage as M, toLlmToolSpec as Mt, LlmResponse as N, toVercelToolSpecs as Nt, LifecycleHookContext as O, normalizeToolContent as Ot, LlmStreamEvent as P, CatalogRenderer as Pt, RenderResultRequest as Q, SkillMetadata as Qt, MemoryStore as R, JsonSchema as Rt, InMemoryStore as S, bridgeError as St, InteractionResponse as T, fromVercelResult as Tt, MockUiBridge as U, SKILL_NAME_PATTERN as Ut, MockLlmQueueItem as V, SKILL_MANIFEST_FILE as Vt, OpenAiCompatibleClient as W, SkillCatalog as Wt, RUN_SNAPSHOT_SCHEMA_VERSION as X, SkillLocation as Xt, READ_SKILL_FILE_TOOL_NAME as Y, SkillIssue as Yt, RenderBlock as Z, SkillManifest as Zt, FsMemoryStore as _, resolveInsideRoot as _n, TraceRecorder as _t, AgentLoopConfig as a, WebSkillErrorCode as an, RuntimeRun as at, HookRunner as b, xmlRenderer as bn, WebSkillRuntime as bt, ArtifactStore as c, checkSkillRules as cn, ScriptExecutionContext as ct, BridgeResponse as d, isValidSkillName as dn, ToolDefinition as dt, SkillSource as en, RunResult as et, EventBus as f, jsonRenderer as fn, ToolResolution as ft, FsArtifactStore as g, renderCatalogJson as gn, TraceEventType as gt, FormField as h, renderAvailableSkillsXml as hn, TraceEvent as ht, AgentLoop as i, WebSkillError as in, RuntimePhase as it, LlmCompleteInput as j, schemaToForm as jt, LifecycleListener as k, parseBridgeRequest as kt, BridgeCapabilities as l, computeDigest as ln, ScriptExecutor as lt, ExternalToolSource as m, parseSkillMarkdown as mn, TraceClock as mt, ASK_USER_TOOL as n, ValidationReport as nn, RunSnapshotStore as nt, AgentLoopDeps as o, buildCatalog as on, RuntimeSession as ot, ExternalSkillProvider as p, normalizePath as pn, ToolResult as pt, READ_SKILL_FILE_INPUT_SCHEMA as q, SkillDocument as qt, ASK_USER_TOOL_NAME as r, VerifyResult as rn, RunTerminationReason as rt, Artifact as s, buildManifest as sn, SchemaInferer as st, ASK_USER_INPUT_SCHEMA as t, SkillsLockfile as tn, RunSnapshot as tt, BridgeRequest as u, escapeXml as un, SkillRouter as ut, FsRunSnapshotStore as v, validateSkills as vn, UiBridge as vt, InteractionRequest as w, createScriptContext as wt, HookRunnerOptions as x, WebSkillRuntimeDeps as xt, FullDisclosureRouter as y, verifyManifest as yn, VercelToolSpec as yt, MockLlmClient as z, MemoryFS 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 { It as FileStat, Jt as SkillInstallSource, Lt as FileSystemProvider, Q as RenderResultRequest, Rt as JsonSchema, T as InteractionResponse, Zt as SkillManifest, _ as FsMemoryStore, ct as ScriptExecutionContext, dt as ToolDefinition, g as FsArtifactStore, l as BridgeCapabilities, lt as ScriptExecutor, pt as ToolResult, rn as VerifyResult, st as SchemaInferer, tn as SkillsLockfile, vt as UiBridge, w as InteractionRequest } from "./index-CqDIreSE.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
@@ -47,6 +47,12 @@ interface SandboxOptions {
47
47
  /** env 白名单(仅这些变量传入 Worker;默认空) */
48
48
  envWhitelist?: string[];
49
49
  capabilities?: BridgeCapabilities;
50
+ /** 网络策略:默认 'deny-all'(白名单见 runtime/sandbox/networkPolicy) */
51
+ networkPolicy?: NetworkPolicy;
52
+ /** require-approval 模式的授权询问出口(缺失时 require-approval 一律拒绝) */
53
+ uiBridge?: UiBridge;
54
+ /** 授权粒度:默认 'once-per-run' */
55
+ approvalScope?: ApprovalScope;
50
56
  }
51
57
  /**
52
58
  * D1:worker_threads 沙箱脚本执行器。
@@ -105,7 +111,8 @@ declare class FileMemoryStore extends FsMemoryStore {
105
111
  //#region src/ui/cliUiBridge.d.ts
106
112
  /**
107
113
  * 命令行 UiBridge:ask→问答,confirm→y/n(带默认值),
108
- * form→逐字段提示(显示默认值与必填标记),select→编号列表。
114
+ * form→逐字段提示(显示默认值与必填标记),select→编号列表,
115
+ * authorize→授权询问(默认拒绝,仅显式 y/yes 批准)。
109
116
  * 输入/输出流可注入(测试用 PassThrough)。
110
117
  */
111
118
  declare class CliUiBridge implements UiBridge {
@@ -147,6 +154,10 @@ declare class SkillManager {
147
154
  format: 'zip' | 'tar';
148
155
  outPath: string;
149
156
  }): Promise<string>;
157
+ /** 多技能包集导出(webskill.skill-pack.json + 各技能目录含 manifest),写 outPath 并返回 */
158
+ exportPack(names: string[], options: {
159
+ outPath: string;
160
+ }): Promise<string>;
150
161
  }
151
162
  //#endregion
152
163
  //#region src/skillManagement/export/archiveExporter.d.ts
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as RouteResult, $t as SkillReader, A as LlmClient, At as resolveToolName, B as MockLlmHandler, Bt as SKILLS_LOCKFILE, C as InteractionPolicy, Ct as buildRenderResult, D as LifecycleHook, Dt as mergeCatalogEntries, E as LifecycleEvent, Et as fromVercelStreamPart, F as LlmToolCall, Ft as DiscoveryResult, G as OpenAiCompatibleClientConfig, Gt as SkillCatalogEntry, H as MockUiAnswer, Ht as SKILL_NAME_MAX_LENGTH, I as LlmToolSpec, It as FileStat, J as READ_SKILL_FILE_TOOL, Jt as SkillInstallSource, K as ProgressiveRouter, Kt as SkillDiscovery, L as MemoryArtifactStore, Lt as FileSystemProvider, M as LlmMessage, Mt as toLlmToolSpec, N as LlmResponse, Nt as toVercelToolSpecs, O as LifecycleHookContext, Ot as normalizeToolContent, P as LlmStreamEvent, Pt as CatalogRenderer, Q as RenderResultRequest, Qt as SkillMetadata, R as MemoryStore, Rt as JsonSchema, S as InMemoryStore, St as bridgeError, T as InteractionResponse, Tt as fromVercelResult, U as MockUiBridge, Ut as SKILL_NAME_PATTERN, V as MockLlmQueueItem, Vt as SKILL_MANIFEST_FILE, W as OpenAiCompatibleClient, Wt as SkillCatalog, X as RUN_SNAPSHOT_SCHEMA_VERSION, Xt as SkillLocation, Y as READ_SKILL_FILE_TOOL_NAME, Yt as SkillIssue, Z as RenderBlock, Zt as SkillManifest, _ as FsMemoryStore, _n as resolveInsideRoot, _t as TraceRecorder, a as AgentLoopConfig, an as WebSkillErrorCode, at as RuntimeRun, b as HookRunner, bn as xmlRenderer, bt as WebSkillRuntime, c as ArtifactStore, cn as checkSkillRules, ct as ScriptExecutionContext, d as BridgeResponse, dn as isValidSkillName, dt as ToolDefinition, en as SkillSource, et as RunResult, f as EventBus, fn as jsonRenderer, ft as ToolResolution, g as FsArtifactStore, gn as renderCatalogJson, gt as TraceEventType, h as FormField, hn as renderAvailableSkillsXml, ht as TraceEvent, i as AgentLoop, in as WebSkillError, it as RuntimePhase, j as LlmCompleteInput, jt as schemaToForm, k as LifecycleListener, kt as parseBridgeRequest, l as BridgeCapabilities, ln as computeDigest, lt as ScriptExecutor, m as ExternalToolSource, mn as parseSkillMarkdown, mt as TraceClock, n as ASK_USER_TOOL, nn as ValidationReport, nt as RunSnapshotStore, o as AgentLoopDeps, on as buildCatalog, ot as RuntimeSession, p as ExternalSkillProvider, pn as normalizePath, pt as ToolResult, q as READ_SKILL_FILE_INPUT_SCHEMA, qt as SkillDocument, r as ASK_USER_TOOL_NAME, rn as VerifyResult, rt as RunTerminationReason, s as Artifact, sn as buildManifest, st as SchemaInferer, t as ASK_USER_INPUT_SCHEMA, tn as SkillsLockfile, tt as RunSnapshot, u as BridgeRequest, un as escapeXml, ut as SkillRouter, v as FsRunSnapshotStore, vn as validateSkills, vt as UiBridge, w as InteractionRequest, wt as createScriptContext, x as HookRunnerOptions, xt as WebSkillRuntimeDeps, y as FullDisclosureRouter, yn as verifyManifest, yt as VercelToolSpec, z as MockLlmClient, zt as MemoryFS } from "./index-CqDIreSE.js";
2
- export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, type AgentLoopConfig, type AgentLoopDeps, type Artifact, type ArtifactStore, type BridgeCapabilities, type BridgeRequest, type BridgeResponse, 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, 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, isValidSkillName, jsonRenderer, mergeCatalogEntries, 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 renderCatalogJson, A as parseBridgeRequest, B as SkillDiscovery, C as bridgeError, D as fromVercelStreamPart, E as fromVercelResult, F as MemoryFS, G as checkSkillRules, H as WebSkillError, I as SKILLS_LOCKFILE, J as isValidSkillName, K as computeDigest, L as SKILL_MANIFEST_FILE, M as schemaToForm, N as toLlmToolSpec, O as mergeCatalogEntries, P as toVercelToolSpecs, Q as renderAvailableSkillsXml, R as SKILL_NAME_MAX_LENGTH, S as WebSkillRuntime, T as createScriptContext, U as buildCatalog, V as SkillReader, W as buildManifest, X as normalizePath, Y as jsonRenderer, Z as parseSkillMarkdown, _ as READ_SKILL_FILE_INPUT_SCHEMA, a as EventBus, b as RUN_SNAPSHOT_SCHEMA_VERSION, c as FsRunSnapshotStore, d as InMemoryStore, et as resolveInsideRoot, f as MemoryArtifactStore, g as ProgressiveRouter, h as OpenAiCompatibleClient, i as AgentLoop, j as resolveToolName, k as normalizeToolContent, l as FullDisclosureRouter, m as MockUiBridge, n as ASK_USER_TOOL, nt as verifyManifest, o as FsArtifactStore, p as MockLlmClient, q as escapeXml, r as ASK_USER_TOOL_NAME, rt as xmlRenderer, s as FsMemoryStore, t as ASK_USER_INPUT_SCHEMA, tt as validateSkills, u as HookRunner, v as READ_SKILL_FILE_TOOL, w as buildRenderResult, x as TraceRecorder, y as READ_SKILL_FILE_TOOL_NAME, z as SKILL_NAME_PATTERN } from "./dist-COsE72Ct.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, 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, isValidSkillName, jsonRenderer, mergeCatalogEntries, 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 { Dt as mergeCatalogEntries, Gt as SkillCatalogEntry, I as LlmToolSpec, Rt as JsonSchema, m as ExternalToolSource, p as ExternalSkillProvider, pt as ToolResult, qt as SkillDocument } from "./index-CqDIreSE.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 { H as WebSkillError, O as mergeCatalogEntries, k as normalizeToolContent } from "./dist-COsE72Ct.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 { Bt as SKILLS_LOCKFILE, Jt as SkillInstallSource, Vt as SKILL_MANIFEST_FILE, Zt as SkillManifest, rn as VerifyResult, tn as SkillsLockfile, wt as createScriptContext } from "./index-CqDIreSE.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-BsbfEiaC.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 { I as SKILLS_LOCKFILE, L as SKILL_MANIFEST_FILE, T as createScriptContext } from "./dist-COsE72Ct.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-Bvhbxrrt.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 { Q as RenderResultRequest, T as InteractionResponse, vt as UiBridge, w as InteractionRequest } from "./index-CqDIreSE.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-RcqvzAGF.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
 
@@ -145,7 +145,7 @@ function InteractionForm({ bridge }) {
145
145
  className: "webskill-form__title",
146
146
  children: model.title
147
147
  }) : null,
148
- model.message && model.kind === "form" ? /* @__PURE__ */ jsx("p", {
148
+ model.message && (model.kind === "form" || model.kind === "authorize") ? /* @__PURE__ */ jsx("p", {
149
149
  className: "webskill-form__message",
150
150
  children: model.message
151
151
  }) : null,
@@ -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 { Q as RenderResultRequest, T as InteractionResponse, vt as UiBridge, w as InteractionRequest } from "./index-CqDIreSE.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-RcqvzAGF.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
@@ -112,7 +112,7 @@ const InteractionForm = defineComponent({
112
112
  }
113
113
  }, [
114
114
  model.title ? h("div", { class: "webskill-form__title" }, model.title) : null,
115
- model.message && model.kind === "form" ? h("p", { class: "webskill-form__message" }, model.message) : null,
115
+ model.message && (model.kind === "form" || model.kind === "authorize") ? h("p", { class: "webskill-form__message" }, model.message) : null,
116
116
  ...model.controls.map((control) => h("div", { key: control.name }, [renderControl(control), invalid.value.includes(control.name) ? h("div", { class: "webskill-form__error" }, "This field is required") : null])),
117
117
  h("div", { class: "webskill-form__actions" }, [h("button", {
118
118
  type: "submit",
@@ -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: {