@webskill/sdk 0.2.8 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +42 -0
  2. package/dist/browser.d.ts +2 -2
  3. package/dist/browser.js +4 -9
  4. package/dist/{catalogComponents-C_V39rbF-BOHveMWa.js → catalogComponents-KsujmL4b-Clx1kCnU.js} +278 -122
  5. package/dist/client-BCM6Z3yq-qUQNkKrK.js +7787 -0
  6. package/dist/{dist-BQzncxXg.js → dist-8oQRa8Xz.js} +212 -13
  7. package/dist/{dist-B9VLwOME.js → dist-C-Sh0MDU.js} +1019 -317
  8. package/dist/{dist-CtBLBbEz.js → dist-D9Lcn5Pp.js} +528 -838
  9. package/dist/governance.d.ts +46 -11
  10. package/dist/governance.js +152 -25
  11. package/dist/{index-7DVaZJU7.d.ts → index-CHXxDccV.d.ts} +62 -144
  12. package/dist/{index-QrHtAudz.d.ts → index-DLfR2Y6I.d.ts} +412 -21
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +4 -3
  15. package/dist/mcp.d.ts +2 -2
  16. package/dist/mcp.js +2 -2
  17. package/dist/memoryArtifactStore-BtOeB_hm-tj3fC5ip.js +78 -0
  18. package/dist/node.d.ts +297 -4
  19. package/dist/node.js +281 -7
  20. package/dist/{openUiLibrary-B8-Cvou9-D3RsU2EB.js → openUiLibrary-YLS-cxyT-C96jWDQq.js} +6 -5
  21. package/dist/skillVersionStore-uyefLPR1-DXOzbksv.d.ts +158 -0
  22. package/dist/stdio-CFMoANJJ-BxrTeXh7.js +31 -0
  23. package/dist/{testing-BUoXvm1u.js → testing-DDCJWvgA.js} +8 -6
  24. package/dist/testing.d.ts +1 -1
  25. package/dist/testing.js +2 -2
  26. package/dist/{types-AmKCKJn_-BogJPQHU.d.ts → types-7Wcg--Vh-1YlQ4jF9.d.ts} +219 -70
  27. package/dist/types-WovEf4ED-CZSDiiBU.js +6215 -0
  28. package/dist/ui-react.d.ts +329 -18
  29. package/dist/ui-react.js +3715 -3464
  30. package/dist/ui-vue.d.ts +1 -1
  31. package/dist/ui-vue.js +1 -1
  32. package/dist/ui.d.ts +4 -3
  33. package/dist/ui.js +3 -3
  34. package/dist/{webskillLitCatalog-CNaUpasU-CfSRvqCZ.js → webskillLitCatalog-CSTbhBe_-CYIs5BX8.js} +312 -122
  35. package/package.json +4 -7
  36. package/dist/jsonRenderRegistry-9GrWP_hE-CQY8bT9w.js +0 -2468
  37. package/dist/memoryArtifactStore-C9lFVqPF-yFz6yJj0.js +0 -48
  38. package/dist/skillVersionStore-B7rGjtMi-BgnQho9v.d.ts +0 -365
package/dist/mcp.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as messageOf, d as assertRemoteUrlAllowed, u as WebSkillError } from "./dist-BQzncxXg.js";
2
- import { I as normalizeToolContent, M as mergeCatalogEntries } from "./dist-B9VLwOME.js";
1
+ import { O as messageOf, h as assertRemoteUrlAllowed, m as WebSkillError } from "./dist-8oQRa8Xz.js";
2
+ import { H as normalizeToolContent, R as mergeCatalogEntries } from "./dist-C-Sh0MDU.js";
3
3
 
4
4
  //#region ../mcp/dist/index.js
5
5
  /**
@@ -0,0 +1,78 @@
1
+ import { m as WebSkillError } from "./dist-8oQRa8Xz.js";
2
+
3
+ //#region ../runtime/dist/memoryArtifactStore-BtOeB_hm.js
4
+ /** 纯文本消息内容的构造快捷方式(引擎内部绝大多数消息仍是纯文本) */
5
+ const textParts = (text) => [{
6
+ type: "text",
7
+ text
8
+ }];
9
+ /** 取出 parts 中的文本(非文本分片在纯文本语境下无法表达,此处按丢弃处理——调用方须先校验) */
10
+ const partsToText = (parts) => (parts ?? []).reduce((acc, part) => part.type === "text" ? acc + part.text : acc, "");
11
+ const isContentPart = (value) => {
12
+ if (typeof value !== "object" || value === null) return false;
13
+ const part = value;
14
+ if (part["type"] === "text") return typeof part["text"] === "string";
15
+ if (part["type"] === "image" || part["type"] === "file") return typeof part["mimeType"] === "string" && typeof part["data"] === "string";
16
+ return false;
17
+ };
18
+ /**
19
+ * 0.4.0 起 `content` 是 parts 数组。旧的 `string` content 一律拒绝,不做静默转换:
20
+ * 转换会让「模型看到的输入」与「历史记录的输入」悄悄分叉。
21
+ */
22
+ function validateLlmMessages(messages) {
23
+ messages.forEach((message, index) => {
24
+ if (typeof message.content === "string") throw new WebSkillError("VALIDATION_FAILED", `messages[${index}].content is a string; since schema version 2 it must be an array of content parts. Legacy data is not converted automatically.`);
25
+ if (!Array.isArray(message.content) || !message.content.every(isContentPart)) throw new WebSkillError("VALIDATION_FAILED", `messages[${index}].content is not a valid array of content parts`);
26
+ });
27
+ }
28
+ /** provider 不支持某类分片时的统一拒绝:静默丢弃会让模型回答一个它没看见的附件 */
29
+ function rejectUnsupportedPart(part, provider, where) {
30
+ throw new WebSkillError("VALIDATION_FAILED", `${provider} does not support ${part.type} content in ${where} messages`);
31
+ }
32
+ /** 内存 ArtifactStore:测试与浏览器降级用;索引随进程生命周期存在 */
33
+ var MemoryArtifactStore = class {
34
+ #byRun = /* @__PURE__ */ new Map();
35
+ #seq = 0;
36
+ async createTextArtifact(input) {
37
+ return this.#record({
38
+ runId: input.runId,
39
+ path: input.path,
40
+ type: "text",
41
+ size: new TextEncoder().encode(input.content).length,
42
+ mimeType: input.mimeType,
43
+ metadata: input.metadata
44
+ });
45
+ }
46
+ async createBinaryArtifact(input) {
47
+ return this.#record({
48
+ runId: input.runId,
49
+ path: input.path,
50
+ type: "binary",
51
+ size: input.content.length,
52
+ mimeType: input.mimeType,
53
+ metadata: input.metadata
54
+ });
55
+ }
56
+ async listArtifacts(runId) {
57
+ return [...this.#byRun.get(runId) ?? []];
58
+ }
59
+ #record(input) {
60
+ const artifact = {
61
+ id: `art-${++this.#seq}`,
62
+ runId: input.runId,
63
+ path: input.path,
64
+ type: input.type,
65
+ mimeType: input.mimeType,
66
+ size: input.size,
67
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
68
+ metadata: input.metadata
69
+ };
70
+ const list = this.#byRun.get(input.runId) ?? [];
71
+ list.push(artifact);
72
+ this.#byRun.set(input.runId, list);
73
+ return artifact;
74
+ }
75
+ };
76
+
77
+ //#endregion
78
+ export { validateLlmMessages as a, textParts as i, partsToText as n, rejectUnsupportedPart as r, MemoryArtifactStore as t };
package/dist/node.d.ts CHANGED
@@ -1,7 +1,300 @@
1
- import { K as SkillInstallSource, L as SKILLS_LOCKFILE, N as FileSystemProvider, R as SKILL_MANIFEST_FILE, Y as SkillManifest, et as SkillsLockfile, nt as VerifyResult, v as UiBridge } from "./types-AmKCKJn_-BogJPQHU.js";
2
- import { Q as ScriptExecutor, dt as WebSkillRuntime, ft as WebSkillRuntimeDeps, ht as createScriptContext } from "./index-QrHtAudz.js";
1
+ import { D as ArchiveLimits, F as JsonSchema, H as SKILLS_LOCKFILE, J as SignatureAuditSink, M as FileStat, N as FileSystemProvider, U as SKILL_MANIFEST_FILE, et as SkillInstallSource, ft as TrustedKeyStore, gt as VerifyResult, it as SkillManifest, mt as UnsignedPolicy, o as InteractionRequest, rt as SkillManagerPort, s as InteractionResponse, ut as SkillsLockfile, v as RenderResultRequest, y as UiBridge } from "./types-7Wcg--Vh-1YlQ4jF9.js";
2
+ import { C as FsArtifactStore, Dt as ToolDefinition, Lt as WebSkillRuntime, Rt as WebSkillRuntimeDeps, V as NetworkPolicy, Vt as createScriptContext, d as ApprovalScope, f as BridgeCapabilities, gt as ScriptExecutor, ht as ScriptExecutionContext, kt as ToolResult, mt as SchemaInferer, w as FsMemoryStore } from "./index-DLfR2Y6I.js";
3
+ import { a as AuditLog, p as CandidateStore, r as ApprovalPolicy, u as CandidateSkill, v as SkillVersionStore } from "./skillVersionStore-uyefLPR1-DXOzbksv.js";
3
4
  import { n as LlmEnvConfig, s as probeLlmCapabilities, t as LlmCapabilities } from "./env-BPUBZCwJ-4jat_SVG.js";
4
- import { C as ProcessSandboxExecutor, D as SkillManager, E as SandboxedScriptExecutor, O as exportArchive, S as OxcSchemaInferer, T as SandboxOptions, _ as CliUiBridge, a as AuditLog, b as NodeFS, c as CandidateSkill, d as CandidateStore, h as SkillVersionStore, k as readArchiveManifest, r as ApprovalPolicy, v as FileArtifactStore, w as ProcessSandboxOptions, x as NodeScriptExecutor, y as FileMemoryStore } from "./skillVersionStore-B7rGjtMi-BgnQho9v.js";
5
+ import { Readable, Writable } from "node:stream";
6
+ //#region ../node/dist/index.d.ts
7
+ //#region src/fs/nodeFs.d.ts
8
+ /**
9
+ * 基于 node:fs/promises 的 FileSystemProvider;接受 `/` 风格路径,写入自动创建父目录。
10
+ * 可选 root 模式:构造传入 root 后,read/write 操作先做 realpath 包含校验
11
+ * (root 与目标都 realpath 后前缀比对),经符号链接逃逸 root → FS_PATH_OUTSIDE_ROOT。
12
+ */
13
+ declare class NodeFS implements FileSystemProvider {
14
+ #private;
15
+ readonly kind = "node";
16
+ constructor(deps?: {
17
+ root?: string;
18
+ });
19
+ /** root 模式:全部方法(read/write/exists/stat/list/mkdir/remove/rename)目标 realpath 必须落在 root realpath 前缀内 */
20
+ withRoot(root: string): NodeFS;
21
+ readText(p: string): Promise<string>;
22
+ writeText(p: string, content: string): Promise<void>;
23
+ appendText(p: string, content: string): Promise<void>;
24
+ readBinary(p: string): Promise<Uint8Array>;
25
+ writeBinary(p: string, content: Uint8Array): Promise<void>;
26
+ exists(p: string): Promise<boolean>;
27
+ stat(p: string): Promise<FileStat>;
28
+ list(p: string): Promise<FileStat[]>;
29
+ mkdir(p: string): Promise<void>;
30
+ remove(p: string, options?: {
31
+ recursive?: boolean;
32
+ }): Promise<void>;
33
+ rename(from: string, to: string): Promise<void>;
34
+ }
35
+ //#endregion
36
+ //#region src/executor/nodeScriptExecutor.d.ts
37
+ /**
38
+ * 进程内脚本执行器。接口按沙箱语义设计(context 无隐式宿主访问),
39
+ * worker_threads 沙箱见 deferred-items D1。
40
+ */
41
+ declare class NodeScriptExecutor implements ScriptExecutor {
42
+ #private;
43
+ constructor(fs: FileSystemProvider);
44
+ loadDefinition(skillRoot: string, scriptName: string): Promise<ToolDefinition>;
45
+ execute(input: {
46
+ skillRoot: string;
47
+ scriptName: string;
48
+ args: Record<string, unknown>;
49
+ context: Parameters<ScriptExecutor['execute']>[0]['context'];
50
+ timeoutMs: number;
51
+ }): Promise<ToolResult>;
52
+ }
53
+ //#endregion
54
+ //#region src/executor/sandboxedScriptExecutor.d.ts
55
+ interface SandboxOptions {
56
+ /** 默认 { maxOldGenerationSizeMb: 64, maxYoungGenerationSizeMb: 16 } */
57
+ resourceLimits?: {
58
+ maxOldGenerationSizeMb?: number;
59
+ maxYoungGenerationSizeMb?: number;
60
+ };
61
+ /** env 白名单(仅这些变量传入 Worker;默认空) */
62
+ envWhitelist?: string[];
63
+ capabilities?: BridgeCapabilities;
64
+ /** 网络策略:默认 'deny-all'(白名单见 runtime/sandbox/networkPolicy) */
65
+ networkPolicy?: NetworkPolicy;
66
+ /** 裸模块 allowlist(默认 []:一切 node: 内置模块全禁;按需放行如 ['node:path']) */
67
+ allowedModules?: string[];
68
+ /** require-approval 模式的授权询问出口(缺失时 require-approval 一律拒绝) */
69
+ uiBridge?: UiBridge;
70
+ /** 授权粒度:默认 'once-per-run' */
71
+ approvalScope?: ApprovalScope;
72
+ }
73
+ /**
74
+ * D1:worker_threads 沙箱脚本执行器。
75
+ * 每次执行独立 Worker(resourceLimits + env 白名单),loadDefinition 同样在
76
+ * Worker 内完成(禁止主进程 import 不可信脚本);超时 terminate(可杀同步死循环)。
77
+ * 能力桥协议与浏览器同一来源(runtime/sandbox/bridgeProtocol)。
78
+ *
79
+ * 诚实标注:本执行器做的是**能力面收敛**(网络策略、模块 allowlist、资源限额、
80
+ * 超时强杀),**不是安全边界**——Worker 内脚本与宿主共享进程;
81
+ * 已知主动逃逸面(process.binding/_linkedBinding/dlopen/openStdin/reallyExit/abort)
82
+ * 已在入口删除(0.2.3),常规 import 拦截之外不承诺防御其它宿主共享面;
83
+ * 禁止假定其可隔离不可信脚本(隔离级需求用 ProcessSandboxExecutor)。
84
+ */
85
+ declare class SandboxedScriptExecutor implements ScriptExecutor {
86
+ #private;
87
+ constructor(fs: FileSystemProvider, options?: SandboxOptions);
88
+ loadDefinition(skillRoot: string, scriptName: string): Promise<ToolDefinition>;
89
+ execute(input: {
90
+ skillRoot: string;
91
+ scriptName: string;
92
+ args: Record<string, unknown>;
93
+ context: ScriptExecutionContext;
94
+ timeoutMs: number;
95
+ }): Promise<ToolResult>;
96
+ }
97
+ //#endregion
98
+ //#region src/executor/processSandboxExecutor.d.ts
99
+ interface ProcessSandboxOptions {
100
+ /** 温池大小(并发上限;执行后 kill 并补位重生),默认 2 */
101
+ poolSize?: number;
102
+ /** 透传给子进程的环境变量白名单(默认 []:子进程 env 为空,防密钥泄露) */
103
+ envWhitelist?: string[];
104
+ capabilities?: BridgeCapabilities;
105
+ /** 网络策略:默认 'deny-all'(权限模型无网络维度,补丁兜底;node:net 裸模块为已知残余面) */
106
+ networkPolicy?: NetworkPolicy;
107
+ /** require-approval 模式的授权询问出口 */
108
+ uiBridge?: UiBridge;
109
+ /** 授权粒度:默认 'once-per-run' */
110
+ approvalScope?: ApprovalScope;
111
+ /** 池维护告警出口(recycle 重生失败等;默认 console.warn) */
112
+ onWarning?: (message: string) => void;
113
+ }
114
+ /**
115
+ * child_process.fork + --permission 进程沙箱(真实进程隔离)。
116
+ * 每个子进程以 `--permission --allow-fs-read=<入口目录> --allow-fs-read=<skillRoot>
117
+ * --allow-fs-write=<artifactDir>` 启动:fs 维度由权限模型管控(experimental),
118
+ * 子进程/Worker/addons 默认禁;网络无权限维度仍靠 fetch/WebSocket patch。
119
+ * 能力桥协议与 worker_threads 沙箱同一形态(readReference/writeArtifact/confirm + 授权)。
120
+ * 温池(默认 2):同 skillRoot 复用子进程;执行后 kill 并补位重生;并发上限即池大小。
121
+ * 超时 kill(同步死循环可杀);非零退出码 → TOOL_EXECUTION_FAILED。
122
+ */
123
+ declare class ProcessSandboxExecutor implements ScriptExecutor {
124
+ #private;
125
+ constructor(fs: FileSystemProvider, options?: ProcessSandboxOptions);
126
+ get poolSize(): number;
127
+ /** 池全部子进程销毁(测试收尾/进程退出前调用);排队中的 acquire 一律 reject(不悬挂) */
128
+ dispose(): Promise<void>;
129
+ loadDefinition(skillRoot: string, scriptName: string): Promise<ToolDefinition>;
130
+ execute(input: {
131
+ skillRoot: string;
132
+ scriptName: string;
133
+ args: Record<string, unknown>;
134
+ context: ScriptExecutionContext;
135
+ timeoutMs: number;
136
+ }): Promise<ToolResult>;
137
+ }
138
+ //#endregion
139
+ //#region src/schema/oxcSchemaInferer.d.ts
140
+ /**
141
+ * D2 Schema 推导(OXC 静态文本分析,宿主侧执行,不进沙箱)。
142
+ * TS 类型标注为主路径,JSDoc @param 为辅路径;不支持类型降级 string 并标 'x-inferred'。
143
+ */
144
+ declare class OxcSchemaInferer implements SchemaInferer {
145
+ inferSchemaFromSource(source: string, options?: {
146
+ fileName?: string;
147
+ }): JsonSchema | undefined;
148
+ }
149
+ //#endregion
150
+ //#region src/artifacts/fileArtifactStore.d.ts
151
+ /**
152
+ * FileArtifactStore:兼容别名,语义同阶段 2-4。
153
+ * 实现已上移到 runtime 的 FsArtifactStore;node 侧保留 NodeFS 默认值。
154
+ */
155
+ declare class FileArtifactStore extends FsArtifactStore {
156
+ constructor(deps: {
157
+ root: string;
158
+ fs?: FileSystemProvider;
159
+ });
160
+ }
161
+ //#endregion
162
+ //#region src/memory/fileMemoryStore.d.ts
163
+ /**
164
+ * FileMemoryStore:兼容别名,语义同阶段 3。
165
+ * 实现已上移到 runtime 的 FsMemoryStore;node 侧保留 NodeFS 默认值。
166
+ */
167
+ declare class FileMemoryStore extends FsMemoryStore {
168
+ constructor(deps: {
169
+ root: string;
170
+ fs?: FileSystemProvider;
171
+ });
172
+ }
173
+ //#endregion
174
+ //#region src/ui/cliUiBridge.d.ts
175
+ /**
176
+ * 命令行 UiBridge:ask→问答,confirm→y/n(带默认值),
177
+ * form→逐字段提示(显示默认值与必填标记),select→编号列表,
178
+ * authorize→授权询问(默认拒绝,仅显式 y/yes 批准)。
179
+ * 输入/输出流可注入(测试用 PassThrough)。
180
+ */
181
+ declare class CliUiBridge implements UiBridge {
182
+ #private;
183
+ constructor(deps?: {
184
+ input?: Readable;
185
+ output?: Writable;
186
+ });
187
+ request(input: InteractionRequest): Promise<InteractionResponse>;
188
+ progress(input: {
189
+ runId: string;
190
+ message: string;
191
+ value?: number;
192
+ }): Promise<void>;
193
+ renderResult(input: RenderResultRequest): Promise<void>;
194
+ }
195
+ //#endregion
196
+ //#region src/skillManagement/skillManager.d.ts
197
+ /**
198
+ * 技能管理门面:统一安装管线(staging → 解析 name → 校验 → 拷贝 → manifest → lockfile),
199
+ * 任何失败清理现场抛 INSTALL_FAILED。
200
+ * @stable
201
+ */
202
+ declare class SkillManager implements SkillManagerPort {
203
+ #private;
204
+ constructor(deps: {
205
+ managedRoot: string;
206
+ fs?: FileSystemProvider;
207
+ fetchImpl?: typeof fetch;
208
+ /** D2 安装期 schema 预推导(默认 true,可关) */
209
+ schemaInference?: boolean;
210
+ /** 归档体积三重上限(缺省 DEFAULT_ARCHIVE_LIMITS) */
211
+ archiveLimits?: ArchiveLimits;
212
+ /** install/uninstall 成功后的变更回调(宿主接线缓存失效,如 WebSkillRuntime.invalidate) */
213
+ onChanged?: () => void;
214
+ /**
215
+ * 供应链信任(design 03 §5.1)。未注入时仍会验签,只是信任库为空——
216
+ * 未签名的包不受影响(默认策略 warn),带着不受信公钥的包则装不上。
217
+ */
218
+ signature?: {
219
+ trustedKeys?: TrustedKeyStore;
220
+ /**
221
+ * 未签名包的处置,默认 `warn`(0.4.0 D2 复核后维持)。
222
+ * 收成 `deny` 必须同时注入 `trustedKeys`:空信任库 + deny 的接受集为空,
223
+ * 任何包都装不上。
224
+ */
225
+ unsigned?: UnsignedPolicy;
226
+ /** 验签结论落审计(governance 的 FsAuditLog 结构上兼容) */
227
+ audit?: SignatureAuditSink;
228
+ };
229
+ /** 安装期告警(当前仅未签名放行);宿主接线日志/UI */
230
+ onWarning?: (warning: {
231
+ skill: string;
232
+ message: string;
233
+ }) => void;
234
+ });
235
+ /** 托管根目录(治理发布归档捕获等只读场景) */
236
+ get managedRoot(): string;
237
+ install(source: SkillInstallSource, options?: {
238
+ expectedSha256?: string;
239
+ }): Promise<SkillManifest>;
240
+ uninstall(name: string): Promise<void>;
241
+ verifyIntegrity(name: string): Promise<VerifyResult>;
242
+ listInstalled(): Promise<SkillsLockfile>;
243
+ exportArchive(name: string, options: {
244
+ format: 'zip' | 'tar';
245
+ outPath: string;
246
+ }): Promise<string>;
247
+ /** 多技能包集导出(webskill.skill-pack.json + 各技能目录含 manifest),写 outPath 并返回 */
248
+ exportPack(names: string[], options: {
249
+ outPath: string;
250
+ }): Promise<string>;
251
+ }
252
+ //#endregion
253
+ //#region src/mcp/connectStdioEndpoint.d.ts
254
+ interface StdioEndpointConfig {
255
+ /** registry 中的名字(endpoint:tool 引用) */
256
+ endpoint: string;
257
+ /**
258
+ * 可执行文件。**只能来自宿主配置**:从技能 frontmatter / manifest 到这里没有任何代码路径。
259
+ * 因为 env 不继承父进程,PATH 默认为空——请传绝对路径,或在 env 里显式给出 PATH。
260
+ */
261
+ command: string;
262
+ args?: readonly string[];
263
+ cwd?: string;
264
+ /** 子进程环境变量。**不默认继承 process.env**:MCP server 是宿主机上的任意程序 */
265
+ env?: Record<string, string>;
266
+ /** 连接与调用超时;0/缺省 = 不超时 */
267
+ timeoutMs?: number;
268
+ /** 子进程 stderr 观测(默认丢弃,仅保留尾部用于错误消息) */
269
+ onStderr?: (chunk: string) => void;
270
+ }
271
+ /**
272
+ * stdio MCP endpoint 装配:spawn 宿主配置的可执行程序,经 stdin/stdout 说 MCP,
273
+ * 注册进 EndpointRegistry——endpoint:tool 解析、TTL+版本缓存、临时技能消费自动生效。
274
+ * 返回 close 句柄:断开后 unregister 并确保子进程真的退出(不留僵尸)。
275
+ *
276
+ * registry 参数写成结构型而非 `EndpointRegistry<McpClientLike>`:只要从 `@webskill/mcp`
277
+ * `import type`,tsdown 就会把整个 mcp 的 d.ts chunk 拖进 `@webskill/sdk/node`,
278
+ * 把 optional peer `@modelcontextprotocol/sdk` 变成 node 子路径的类型硬依赖
279
+ * (install-smoke 的消费方 typecheck 探针会因此变红)。结构类型保证真实的
280
+ * `EndpointRegistry<McpClientLike>` 仍可直接传入。
281
+ */
282
+ declare function connectStdioEndpoint<TClient>(registry: {
283
+ register(endpoint: string, client: TClient): void;
284
+ unregister(endpoint: string): void;
285
+ }, config: StdioEndpointConfig): Promise<{
286
+ close(): Promise<void>;
287
+ }>;
288
+ //#endregion
289
+ //#region src/skillManagement/export/archiveExporter.d.ts
290
+ /** 导出技能目录全部文件(含 manifest)为 zip/tar 归档,返回 outPath */
291
+ declare function exportArchive(fs: FileSystemProvider, skillRoot: string, options: {
292
+ format: 'zip' | 'tar';
293
+ outPath: string;
294
+ }): Promise<string>;
295
+ /** 只解出归档中的 webskill.skill-manifest.json 条目(安装前预览) */
296
+ declare function readArchiveManifest(fs: FileSystemProvider, archivePath: string): Promise<SkillManifest>;
297
+ //#endregion
5
298
  //#region ../governance/dist/node.d.ts
6
299
  //#region src/approval/approvalWorkflow.d.ts
7
300
  /** 审批工作流:review(UiBridge confirm 真实接线)/ publish(校验→安装→版本→审计) */
@@ -47,4 +340,4 @@ declare function createEvaluationRuntime(deps: WebSkillRuntimeDeps & {
47
340
  executor?: ScriptExecutor;
48
341
  }): WebSkillRuntime;
49
342
  //#endregion
50
- export { ApprovalWorkflow, CliUiBridge, FileArtifactStore, FileMemoryStore, type LlmCapabilities, type LlmEnvConfig, NodeFS, NodeScriptExecutor, OxcSchemaInferer, ProcessSandboxExecutor, type ProcessSandboxOptions, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, type SandboxOptions, SandboxedScriptExecutor, type SkillInstallSource, SkillManager, type SkillManifest, type SkillsLockfile, type VerifyResult, createEvaluationRuntime, createScriptContext, exportArchive, probeLlmCapabilities, readArchiveManifest };
343
+ export { ApprovalWorkflow, CliUiBridge, FileArtifactStore, FileMemoryStore, type LlmCapabilities, type LlmEnvConfig, NodeFS, NodeScriptExecutor, OxcSchemaInferer, ProcessSandboxExecutor, type ProcessSandboxOptions, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, type SandboxOptions, SandboxedScriptExecutor, type SkillInstallSource, SkillManager, type SkillManifest, type SkillsLockfile, type StdioEndpointConfig, type VerifyResult, connectStdioEndpoint, createEvaluationRuntime, createScriptContext, exportArchive, probeLlmCapabilities, readArchiveManifest };