@webskill/sdk 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.d.ts +67 -2
- package/dist/browser.js +275 -4
- package/dist/{dist-BMioPPri.js → dist-C1p26Ap9.js} +13 -31
- package/dist/{dist-BbyIk4vG.js → dist-hMMxARXK.js} +36 -1
- package/dist/governance.d.ts +2 -2
- package/dist/governance.js +2 -2
- package/dist/{index-DF5ea732.d.ts → index-D65Jk0ju.d.ts} +3 -53
- package/dist/{index-j3Z3hbDk.d.ts → index-DnI0BTEp.d.ts} +71 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +1 -1
- package/dist/node.d.ts +3 -3
- package/dist/node.js +2 -2
- package/dist/ui-react.d.ts +1 -1
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as InteractionRequest, M as LlmResponse, Mt as FileStat, N as LlmStreamEvent, Nt as FileSystemProvider, S as InteractionPolicy, Tt as parseBridgeRequest, X as RenderResultRequest, at as ScriptExecutor, d as BridgeResponse, it as ScriptExecutionContext, k as LlmClient, l as BridgeCapabilities, lt as ToolResult, m as ExternalToolSource, mt as UiBridge, p as ExternalSkillProvider, st as ToolDefinition, u as BridgeRequest, vt as bridgeError, w as InteractionResponse } from "./index-
|
|
1
|
+
import { $t as VerifyResult, C as InteractionRequest, M as LlmResponse, Mt as FileStat, N as LlmStreamEvent, Nt as FileSystemProvider, S as InteractionPolicy, Tt as parseBridgeRequest, Wt as SkillInstallSource, X as RenderResultRequest, Zt as SkillsLockfile, at as ScriptExecutor, d as BridgeResponse, it as ScriptExecutionContext, k as LlmClient, l as BridgeCapabilities, lt as ToolResult, m as ExternalToolSource, mt as UiBridge, p as ExternalSkillProvider, qt as SkillManifest, st as ToolDefinition, u as BridgeRequest, vt as bridgeError, w as InteractionResponse } from "./index-DnI0BTEp.js";
|
|
2
2
|
//#region ../browser/dist/index.d.ts
|
|
3
3
|
//#region src/fs/featureDetection.d.ts
|
|
4
4
|
/** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
|
|
@@ -42,6 +42,60 @@ declare class OpfsProvider implements FileSystemProvider {
|
|
|
42
42
|
*/
|
|
43
43
|
declare const WORKER_BOOTSTRAP_SOURCE: string;
|
|
44
44
|
//#endregion
|
|
45
|
+
//#region src/executor/tsTranspiler.d.ts
|
|
46
|
+
interface TypeScriptSupportOptions {
|
|
47
|
+
/** 应用托管的 esbuild-wasm JS(browser build)URL;Node/vitest 可传 'esbuild-wasm' specifier */
|
|
48
|
+
esbuildUrl: string;
|
|
49
|
+
/** 应用托管的 esbuild.wasm URL;Node 下可省略(自动加载) */
|
|
50
|
+
wasmUrl?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* D4:宿主侧 .ts → JS 纯类型擦除转译(静态无执行,Worker 永远只见 JS)。
|
|
54
|
+
* OPFS 缓存:键 = 源码 sha256,跨执行/跨 Worker 只转一次。
|
|
55
|
+
*/
|
|
56
|
+
declare class TsTranspiler {
|
|
57
|
+
#private;
|
|
58
|
+
constructor(deps: {
|
|
59
|
+
fs: FileSystemProvider;
|
|
60
|
+
options: TypeScriptSupportOptions;
|
|
61
|
+
cacheDir?: string;
|
|
62
|
+
});
|
|
63
|
+
/** 返回 JS 源码;转译失败 → TOOL_EXECUTION_FAILED(带 esbuild 诊断) */
|
|
64
|
+
transpile(scriptPath: string, source: string): Promise<string>;
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/skillManagement/browserSkillManager.d.ts
|
|
68
|
+
/**
|
|
69
|
+
* D5:浏览器技能安装(http(s) zip / ArrayBuffer;tar/git/npm → TOOL_UNSUPPORTED)。
|
|
70
|
+
* 流程与 Node 对齐:staging → 解析 name → validateSkills(失败零残留)→ managed root →
|
|
71
|
+
* manifest(WebCrypto sha256)→ skills.lock.json;zip-slip 防护;manifest/lockfile 与 Node 同格式。
|
|
72
|
+
*/
|
|
73
|
+
declare class BrowserSkillManager {
|
|
74
|
+
#private;
|
|
75
|
+
constructor(deps: {
|
|
76
|
+
fs: FileSystemProvider;
|
|
77
|
+
managedRoot: string;
|
|
78
|
+
fetchImpl?: typeof fetch;
|
|
79
|
+
});
|
|
80
|
+
install(source: SkillInstallSource, options?: {
|
|
81
|
+
expectedSha256?: string;
|
|
82
|
+
}): Promise<SkillManifest>;
|
|
83
|
+
uninstall(name: string): Promise<void>;
|
|
84
|
+
verifyIntegrity(name: string): Promise<VerifyResult>;
|
|
85
|
+
listInstalled(): Promise<SkillsLockfile>;
|
|
86
|
+
}
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region src/skillManagement/zipExtract.d.ts
|
|
89
|
+
/**
|
|
90
|
+
* zip 解包(fflate,浏览器无依赖)。
|
|
91
|
+
* 每个条目路径过 resolveInsideRoot:拒绝 `..` 段、绝对路径、反斜杠穿越(与 node 规则一致)。
|
|
92
|
+
*/
|
|
93
|
+
declare function extractZipWeb(fs: FileSystemProvider, data: Uint8Array, destRoot: string): Promise<void>;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/skillManagement/checksumWeb.d.ts
|
|
96
|
+
/** WebCrypto sha256(浏览器/Worker 通用;Node 20+ 全局 crypto 同样可用) */
|
|
97
|
+
declare function sha256HexWeb(data: Uint8Array | string): Promise<string>;
|
|
98
|
+
//#endregion
|
|
45
99
|
//#region src/executor/workerScriptExecutor.d.ts
|
|
46
100
|
/** 主线程持有的 Worker 最小接口(vitest 可用 loopback 替身) */
|
|
47
101
|
interface WorkerLike {
|
|
@@ -62,6 +116,8 @@ declare class BrowserWorkerScriptExecutor implements ScriptExecutor {
|
|
|
62
116
|
fs: FileSystemProvider;
|
|
63
117
|
workerFactory?: WorkerFactory;
|
|
64
118
|
capabilities?: BridgeCapabilities;
|
|
119
|
+
/** D4 opt-in:配置 esbuild-wasm 资产 URL 后 .ts 经宿主侧转译执行(未配置 .ts → TOOL_UNSUPPORTED) */
|
|
120
|
+
typescript?: TypeScriptSupportOptions;
|
|
65
121
|
});
|
|
66
122
|
loadDefinition(skillRoot: string, scriptName: string): Promise<ToolDefinition>;
|
|
67
123
|
execute(input: {
|
|
@@ -94,6 +150,11 @@ type WorkerRequest = {
|
|
|
94
150
|
roots?: string[];
|
|
95
151
|
/** OPFS 根目录名(默认 'webskill');测试隔离用 */
|
|
96
152
|
opfsRootName?: string;
|
|
153
|
+
/** D4 opt-in:esbuild-wasm 资产 URL(启用 .ts 脚本宿主侧转译) */
|
|
154
|
+
typescript?: {
|
|
155
|
+
esbuildUrl: string;
|
|
156
|
+
wasmUrl?: string;
|
|
157
|
+
};
|
|
97
158
|
};
|
|
98
159
|
} | {
|
|
99
160
|
type: 'run';
|
|
@@ -191,6 +252,10 @@ declare class WorkerRuntimeClient {
|
|
|
191
252
|
interaction?: InteractionPolicy;
|
|
192
253
|
roots?: string[];
|
|
193
254
|
opfsRootName?: string;
|
|
255
|
+
typescript?: {
|
|
256
|
+
esbuildUrl: string;
|
|
257
|
+
wasmUrl?: string;
|
|
258
|
+
};
|
|
194
259
|
}): Promise<WorkerEvent>;
|
|
195
260
|
run(prompt: string, runId?: string): Promise<WorkerEvent>;
|
|
196
261
|
status(runId: string): Promise<WorkerEvent>;
|
|
@@ -216,4 +281,4 @@ declare class WorkerUiBridge implements UiBridge {
|
|
|
216
281
|
onTextDelta(runId: string, delta: string): Promise<void>;
|
|
217
282
|
}
|
|
218
283
|
//#endregion
|
|
219
|
-
export { type BridgeCapabilities, type BridgeRequest, type BridgeResponse, BrowserWorkerScriptExecutor, type LlmClientConfig, type MainToWorkerMessage, OpfsProvider, type SerializedError, WORKER_BOOTSTRAP_SOURCE, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, bridgeError, isOpfsAvailable, parseBridgeRequest, parseMainMessage, parseWorkerEvent, startWorkerRuntimeHost };
|
|
284
|
+
export { type BridgeCapabilities, type BridgeRequest, type BridgeResponse, BrowserSkillManager, BrowserWorkerScriptExecutor, type LlmClientConfig, type MainToWorkerMessage, OpfsProvider, type SerializedError, TsTranspiler, type TypeScriptSupportOptions, WORKER_BOOTSTRAP_SOURCE, type WorkerEvent, type WorkerFactory, type WorkerLike, type WorkerRequest, WorkerRuntimeClient, type WorkerRuntimeClientDeps, type WorkerRuntimeHostOverrides, type WorkerScopeLike, WorkerUiBridge, bridgeError, extractZipWeb, isOpfsAvailable, parseBridgeRequest, parseMainMessage, parseWorkerEvent, sha256HexWeb, startWorkerRuntimeHost };
|
package/dist/browser.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { D as normalizeToolContent, E as mergeCatalogEntries,
|
|
1
|
+
import { $ as validateSkills, B as WebSkillError, D as normalizeToolContent, E as mergeCatalogEntries, F as SKILL_MANIFEST_FILE, H as buildManifest, K as isValidSkillName, O as parseBridgeRequest, P as SKILLS_LOCKFILE, Q as resolveInsideRoot, R as SkillDiscovery, V as buildCatalog, Y as parseSkillMarkdown, et as verifyManifest, f as MockLlmClient, h as ProgressiveRouter, i as AgentLoop, m as OpenAiCompatibleClient, o as FsArtifactStore, s as FsMemoryStore, x as bridgeError } from "./dist-hMMxARXK.js";
|
|
2
|
+
import { unzipSync } from "fflate";
|
|
2
3
|
|
|
3
4
|
//#region ../browser/dist/index.js
|
|
4
5
|
/** 检测当前环境是否可用 OPFS(navigator.storage.getDirectory) */
|
|
@@ -267,6 +268,264 @@ self.onmessage = async function (event) {
|
|
|
267
268
|
}
|
|
268
269
|
};
|
|
269
270
|
`;
|
|
271
|
+
let esbuildPromise;
|
|
272
|
+
async function loadEsbuild(options) {
|
|
273
|
+
esbuildPromise ??= (async () => {
|
|
274
|
+
const mod = await import(
|
|
275
|
+
/* @vite-ignore */
|
|
276
|
+
options.esbuildUrl
|
|
277
|
+
);
|
|
278
|
+
await mod.initialize(options.wasmUrl ? { wasmURL: options.wasmUrl } : {});
|
|
279
|
+
return mod;
|
|
280
|
+
})();
|
|
281
|
+
return esbuildPromise;
|
|
282
|
+
}
|
|
283
|
+
async function sha256Hex(data) {
|
|
284
|
+
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(data));
|
|
285
|
+
return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* D4:宿主侧 .ts → JS 纯类型擦除转译(静态无执行,Worker 永远只见 JS)。
|
|
289
|
+
* OPFS 缓存:键 = 源码 sha256,跨执行/跨 Worker 只转一次。
|
|
290
|
+
*/
|
|
291
|
+
var TsTranspiler = class {
|
|
292
|
+
#fs;
|
|
293
|
+
#options;
|
|
294
|
+
#cacheDir;
|
|
295
|
+
constructor(deps) {
|
|
296
|
+
this.#fs = deps.fs;
|
|
297
|
+
this.#options = deps.options;
|
|
298
|
+
this.#cacheDir = deps.cacheDir ?? ".webskill/ts-cache";
|
|
299
|
+
}
|
|
300
|
+
/** 返回 JS 源码;转译失败 → TOOL_EXECUTION_FAILED(带 esbuild 诊断) */
|
|
301
|
+
async transpile(scriptPath, source) {
|
|
302
|
+
const cacheKey = `${this.#cacheDir}/${await sha256Hex(`${scriptPath}\n${source}`)}.js`;
|
|
303
|
+
if (await this.#fs.exists(cacheKey)) return this.#fs.readText(cacheKey);
|
|
304
|
+
let code;
|
|
305
|
+
try {
|
|
306
|
+
code = (await (await loadEsbuild(this.#options)).transform(source, {
|
|
307
|
+
loader: "ts",
|
|
308
|
+
target: "es2022",
|
|
309
|
+
format: "esm"
|
|
310
|
+
})).code;
|
|
311
|
+
} catch (e) {
|
|
312
|
+
throw new WebSkillError("TOOL_EXECUTION_FAILED", `Failed to transpile ${scriptPath}: ${e instanceof Error ? e.message : String(e)}`, e);
|
|
313
|
+
}
|
|
314
|
+
await this.#fs.writeText(cacheKey, code);
|
|
315
|
+
return code;
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
/** WebCrypto sha256(浏览器/Worker 通用;Node 20+ 全局 crypto 同样可用) */
|
|
319
|
+
async function sha256HexWeb(data) {
|
|
320
|
+
const bytes = typeof data === "string" ? new TextEncoder().encode(data) : data;
|
|
321
|
+
const digest = await crypto.subtle.digest("SHA-256", bytes);
|
|
322
|
+
return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, "0")).join("");
|
|
323
|
+
}
|
|
324
|
+
/** 递归拷贝目录(含子目录与二进制文件) */
|
|
325
|
+
async function copyDir(fs, from, to) {
|
|
326
|
+
await fs.mkdir(to);
|
|
327
|
+
for (const entry of await fs.list(from)) {
|
|
328
|
+
const name = entry.path.split("/").pop() ?? "";
|
|
329
|
+
if (entry.type === "directory") await copyDir(fs, entry.path, `${to}/${name}`);
|
|
330
|
+
else await fs.writeBinary(`${to}/${name}`, await fs.readBinary(entry.path));
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
/** 递归列出目录内全部文件(相对路径,posix 分隔) */
|
|
334
|
+
async function listFiles(fs, root, prefix = "") {
|
|
335
|
+
const out = [];
|
|
336
|
+
for (const entry of await fs.list(root)) {
|
|
337
|
+
const name = entry.path.split("/").pop() ?? "";
|
|
338
|
+
const rel = prefix === "" ? name : `${prefix}/${name}`;
|
|
339
|
+
if (entry.type === "directory") out.push(...await listFiles(fs, entry.path, rel));
|
|
340
|
+
else out.push(rel);
|
|
341
|
+
}
|
|
342
|
+
return out;
|
|
343
|
+
}
|
|
344
|
+
/** 删除目录(不存在时静默) */
|
|
345
|
+
async function removeDirQuiet(fs, dir) {
|
|
346
|
+
try {
|
|
347
|
+
if (await fs.exists(dir)) await fs.remove(dir, { recursive: true });
|
|
348
|
+
} catch {}
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* zip 解包(fflate,浏览器无依赖)。
|
|
352
|
+
* 每个条目路径过 resolveInsideRoot:拒绝 `..` 段、绝对路径、反斜杠穿越(与 node 规则一致)。
|
|
353
|
+
*/
|
|
354
|
+
async function extractZipWeb(fs, data, destRoot) {
|
|
355
|
+
let entries;
|
|
356
|
+
try {
|
|
357
|
+
entries = unzipSync(data);
|
|
358
|
+
} catch (e) {
|
|
359
|
+
throw new WebSkillError("INSTALL_FAILED", `Failed to read zip archive: ${e instanceof Error ? e.message : String(e)}`, e);
|
|
360
|
+
}
|
|
361
|
+
for (const [entryPath, content] of Object.entries(entries)) {
|
|
362
|
+
const target = resolveInsideRoot(destRoot, entryPath);
|
|
363
|
+
if (entryPath.endsWith("/")) await fs.mkdir(target);
|
|
364
|
+
else await fs.writeBinary(target, content);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const messageOf$1 = (e) => e instanceof Error ? e.message : String(e);
|
|
368
|
+
const asInstallFailed = (e) => e instanceof WebSkillError && (e.code === "INSTALL_FAILED" || e.code === "TOOL_UNSUPPORTED") ? e : new WebSkillError("INSTALL_FAILED", `Install failed: ${messageOf$1(e)}`, e);
|
|
369
|
+
const lockfilePath = (root) => `${root}/${SKILLS_LOCKFILE}`;
|
|
370
|
+
/**
|
|
371
|
+
* D5:浏览器技能安装(http(s) zip / ArrayBuffer;tar/git/npm → TOOL_UNSUPPORTED)。
|
|
372
|
+
* 流程与 Node 对齐:staging → 解析 name → validateSkills(失败零残留)→ managed root →
|
|
373
|
+
* manifest(WebCrypto sha256)→ skills.lock.json;zip-slip 防护;manifest/lockfile 与 Node 同格式。
|
|
374
|
+
*/
|
|
375
|
+
var BrowserSkillManager = class {
|
|
376
|
+
#fs;
|
|
377
|
+
#managedRoot;
|
|
378
|
+
#fetchImpl;
|
|
379
|
+
constructor(deps) {
|
|
380
|
+
this.#fs = deps.fs;
|
|
381
|
+
this.#managedRoot = deps.managedRoot.replace(/\/+$/, "");
|
|
382
|
+
this.#fetchImpl = deps.fetchImpl;
|
|
383
|
+
}
|
|
384
|
+
async install(source, options) {
|
|
385
|
+
const fs = this.#fs;
|
|
386
|
+
const stagingRoot = `${this.#managedRoot}/.staging-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
387
|
+
let targetDir;
|
|
388
|
+
try {
|
|
389
|
+
if (source.type !== "http" && source.type !== "archive") throw new WebSkillError("TOOL_UNSUPPORTED", `Install source "${source.type}" is not supported in the browser (http zip / archive only)`);
|
|
390
|
+
let data;
|
|
391
|
+
if (source.type === "http") {
|
|
392
|
+
let res;
|
|
393
|
+
try {
|
|
394
|
+
res = await (this.#fetchImpl ?? fetch)(source.url);
|
|
395
|
+
} catch (e) {
|
|
396
|
+
throw new WebSkillError("INSTALL_FAILED", `Download failed: ${messageOf$1(e)}`, e);
|
|
397
|
+
}
|
|
398
|
+
if (!res.ok) throw new WebSkillError("INSTALL_FAILED", `Download failed with HTTP ${res.status}`);
|
|
399
|
+
data = new Uint8Array(await res.arrayBuffer());
|
|
400
|
+
} else data = new Uint8Array(source.data);
|
|
401
|
+
if (options?.expectedSha256 !== void 0) {
|
|
402
|
+
const actual = await sha256HexWeb(data);
|
|
403
|
+
if (actual !== options.expectedSha256) throw new WebSkillError("INSTALL_FAILED", `Archive checksum mismatch: expected ${options.expectedSha256}, got ${actual}`);
|
|
404
|
+
}
|
|
405
|
+
const contentDir = `${stagingRoot}/content`;
|
|
406
|
+
await fs.mkdir(contentDir);
|
|
407
|
+
await extractZipWeb(fs, data, contentDir);
|
|
408
|
+
let skillDir = contentDir;
|
|
409
|
+
if (!await fs.exists(`${contentDir}/SKILL.md`)) {
|
|
410
|
+
const dirs = (await fs.list(contentDir)).filter((e) => e.type === "directory");
|
|
411
|
+
if (dirs.length === 1 && await fs.exists(`${dirs[0]?.path}/SKILL.md`)) skillDir = dirs[0].path;
|
|
412
|
+
else throw new WebSkillError("INSTALL_FAILED", "Archive does not contain a SKILL.md at its root or in a single top-level directory");
|
|
413
|
+
}
|
|
414
|
+
let name;
|
|
415
|
+
let version;
|
|
416
|
+
try {
|
|
417
|
+
const { metadata } = parseSkillMarkdown(await fs.readText(`${skillDir}/SKILL.md`));
|
|
418
|
+
name = metadata.name;
|
|
419
|
+
version = typeof metadata["version"] === "string" ? metadata["version"] : void 0;
|
|
420
|
+
} catch (e) {
|
|
421
|
+
throw new WebSkillError("INSTALL_FAILED", `Failed to read skill name from SKILL.md: ${messageOf$1(e)}`, e);
|
|
422
|
+
}
|
|
423
|
+
const finalRoot = `${stagingRoot}/final`;
|
|
424
|
+
const finalDir = `${finalRoot}/${name}`;
|
|
425
|
+
await copyDir(fs, skillDir, finalDir);
|
|
426
|
+
const report = await validateSkills(fs, [finalRoot]);
|
|
427
|
+
if (!report.ok) {
|
|
428
|
+
const errors = report.issues.filter((i) => i.severity === "error");
|
|
429
|
+
throw new WebSkillError("INSTALL_FAILED", `Skill "${name}" failed validation: ${errors.map((i) => i.message).join("; ")}`, errors);
|
|
430
|
+
}
|
|
431
|
+
targetDir = `${this.#managedRoot}/${name}`;
|
|
432
|
+
if (await fs.exists(targetDir)) await fs.remove(targetDir, { recursive: true });
|
|
433
|
+
await copyDir(fs, finalDir, targetDir);
|
|
434
|
+
const manifest = await this.#createManifest(targetDir, {
|
|
435
|
+
name,
|
|
436
|
+
...version ? { version } : {},
|
|
437
|
+
source
|
|
438
|
+
});
|
|
439
|
+
await this.#upsertLockEntry(name, {
|
|
440
|
+
digest: manifest.integrity.digest,
|
|
441
|
+
installedAt: manifest.installedAt,
|
|
442
|
+
source
|
|
443
|
+
});
|
|
444
|
+
targetDir = void 0;
|
|
445
|
+
return manifest;
|
|
446
|
+
} catch (e) {
|
|
447
|
+
if (targetDir) await removeDirQuiet(fs, targetDir);
|
|
448
|
+
throw asInstallFailed(e);
|
|
449
|
+
} finally {
|
|
450
|
+
await removeDirQuiet(fs, stagingRoot);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
async uninstall(name) {
|
|
454
|
+
if (!isValidSkillName(name)) throw new WebSkillError("UNINSTALL_FAILED", `Invalid skill name (path traversal rejected): ${JSON.stringify(name)}`);
|
|
455
|
+
const targetDir = `${this.#managedRoot}/${name}`;
|
|
456
|
+
if (!await this.#fs.exists(targetDir)) throw new WebSkillError("UNINSTALL_FAILED", `Skill "${name}" is not installed`);
|
|
457
|
+
try {
|
|
458
|
+
await this.#fs.remove(targetDir, { recursive: true });
|
|
459
|
+
await this.#removeLockEntry(name);
|
|
460
|
+
} catch (e) {
|
|
461
|
+
throw new WebSkillError("UNINSTALL_FAILED", `Failed to uninstall "${name}": ${messageOf$1(e)}`, e);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
async verifyIntegrity(name) {
|
|
465
|
+
if (!isValidSkillName(name)) throw new WebSkillError("INTEGRITY_FAILED", `Invalid skill name (path traversal rejected): ${JSON.stringify(name)}`);
|
|
466
|
+
const manifest = await this.#readManifest(`${this.#managedRoot}/${name}`);
|
|
467
|
+
const actualHashes = /* @__PURE__ */ new Map();
|
|
468
|
+
for (const file of manifest.files) {
|
|
469
|
+
const path = `${this.#managedRoot}/${name}/${file.path}`;
|
|
470
|
+
if (await this.#fs.exists(path)) actualHashes.set(file.path, await sha256HexWeb(await this.#fs.readBinary(path)));
|
|
471
|
+
}
|
|
472
|
+
return verifyManifest(manifest, actualHashes);
|
|
473
|
+
}
|
|
474
|
+
async listInstalled() {
|
|
475
|
+
const path = lockfilePath(this.#managedRoot);
|
|
476
|
+
if (!await this.#fs.exists(path)) return {
|
|
477
|
+
schemaVersion: 1,
|
|
478
|
+
skills: {}
|
|
479
|
+
};
|
|
480
|
+
try {
|
|
481
|
+
return JSON.parse(await this.#fs.readText(path));
|
|
482
|
+
} catch (e) {
|
|
483
|
+
throw new WebSkillError("INTEGRITY_FAILED", `Skills lockfile at ${path} is corrupted: ${messageOf$1(e)}`, e);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
async #createManifest(skillRoot, input) {
|
|
487
|
+
const excluded = /* @__PURE__ */ new Set([SKILL_MANIFEST_FILE, SKILLS_LOCKFILE]);
|
|
488
|
+
const files = [];
|
|
489
|
+
for (const rel of (await listFiles(this.#fs, skillRoot)).sort()) {
|
|
490
|
+
if (excluded.has(rel.split("/").pop() ?? "")) continue;
|
|
491
|
+
const content = await this.#fs.readBinary(`${skillRoot}/${rel}`);
|
|
492
|
+
files.push({
|
|
493
|
+
path: rel,
|
|
494
|
+
size: content.length,
|
|
495
|
+
sha256: await sha256HexWeb(content)
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
const manifest = await buildManifest({
|
|
499
|
+
name: input.name,
|
|
500
|
+
...input.version !== void 0 ? { version: input.version } : {},
|
|
501
|
+
source: input.source,
|
|
502
|
+
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
503
|
+
files,
|
|
504
|
+
sha256: sha256HexWeb
|
|
505
|
+
});
|
|
506
|
+
await this.#fs.writeText(`${skillRoot}/${SKILL_MANIFEST_FILE}`, JSON.stringify(manifest, null, 2));
|
|
507
|
+
return manifest;
|
|
508
|
+
}
|
|
509
|
+
async #readManifest(skillRoot) {
|
|
510
|
+
const path = `${skillRoot}/${SKILL_MANIFEST_FILE}`;
|
|
511
|
+
if (!await this.#fs.exists(path)) throw new WebSkillError("INTEGRITY_FAILED", `Skill manifest not found at ${path} (was the skill installed via BrowserSkillManager?)`);
|
|
512
|
+
try {
|
|
513
|
+
return JSON.parse(await this.#fs.readText(path));
|
|
514
|
+
} catch (e) {
|
|
515
|
+
throw new WebSkillError("INTEGRITY_FAILED", `Skill manifest at ${path} is corrupted: ${messageOf$1(e)}`, e);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
async #upsertLockEntry(name, entry) {
|
|
519
|
+
const lockfile = await this.listInstalled();
|
|
520
|
+
lockfile.skills[name] = entry;
|
|
521
|
+
await this.#fs.writeText(lockfilePath(this.#managedRoot), JSON.stringify(lockfile, null, 2));
|
|
522
|
+
}
|
|
523
|
+
async #removeLockEntry(name) {
|
|
524
|
+
const lockfile = await this.listInstalled();
|
|
525
|
+
delete lockfile.skills[name];
|
|
526
|
+
await this.#fs.writeText(lockfilePath(this.#managedRoot), JSON.stringify(lockfile, null, 2));
|
|
527
|
+
}
|
|
528
|
+
};
|
|
270
529
|
const defaultWorkerFactory = () => {
|
|
271
530
|
const blob = new Blob([WORKER_BOOTSTRAP_SOURCE], { type: "text/javascript" });
|
|
272
531
|
const url = URL.createObjectURL(blob);
|
|
@@ -284,9 +543,14 @@ var BrowserWorkerScriptExecutor = class {
|
|
|
284
543
|
#fs;
|
|
285
544
|
#workerFactory;
|
|
286
545
|
#capabilities;
|
|
546
|
+
#transpiler;
|
|
287
547
|
constructor(deps) {
|
|
288
548
|
this.#fs = deps.fs;
|
|
289
549
|
this.#workerFactory = deps.workerFactory ?? defaultWorkerFactory;
|
|
550
|
+
this.#transpiler = deps.typescript ? new TsTranspiler({
|
|
551
|
+
fs: deps.fs,
|
|
552
|
+
options: deps.typescript
|
|
553
|
+
}) : void 0;
|
|
290
554
|
this.#capabilities = {
|
|
291
555
|
readReference: deps.capabilities?.readReference ?? true,
|
|
292
556
|
writeArtifact: deps.capabilities?.writeArtifact ?? true,
|
|
@@ -299,7 +563,13 @@ var BrowserWorkerScriptExecutor = class {
|
|
|
299
563
|
const tsPath = `${skillRoot}/scripts/${scriptName}.ts`;
|
|
300
564
|
const [hasJs, hasTs] = await Promise.all([this.#fs.exists(jsPath), this.#fs.exists(tsPath)]);
|
|
301
565
|
if (hasJs && hasTs) throw new WebSkillError("TOOL_EXECUTION_FAILED", `Script "${scriptName}" is ambiguous: both .ts and .js exist under ${skillRoot}/scripts`);
|
|
302
|
-
if (hasTs)
|
|
566
|
+
if (hasTs) {
|
|
567
|
+
if (!this.#transpiler) throw new WebSkillError("TOOL_UNSUPPORTED", `Browser sandbox executes .js only unless TypeScript support is configured ("${scriptName}.ts")`);
|
|
568
|
+
return {
|
|
569
|
+
path: tsPath,
|
|
570
|
+
source: await this.#transpiler.transpile(tsPath, await this.#fs.readText(tsPath))
|
|
571
|
+
};
|
|
572
|
+
}
|
|
303
573
|
if (!hasJs) throw new WebSkillError("TOOL_NOT_FOUND", `Script "${scriptName}" not found under ${skillRoot}/scripts`);
|
|
304
574
|
return {
|
|
305
575
|
path: jsPath,
|
|
@@ -616,7 +886,8 @@ function startWorkerRuntimeHost(scope, overrides = {}) {
|
|
|
616
886
|
llm: (overrides.createLlm ?? defaultCreateLlm)(config.llm),
|
|
617
887
|
executor: new BrowserWorkerScriptExecutor({
|
|
618
888
|
fs,
|
|
619
|
-
...overrides.workerFactory ? { workerFactory: overrides.workerFactory } : {}
|
|
889
|
+
...overrides.workerFactory ? { workerFactory: overrides.workerFactory } : {},
|
|
890
|
+
...config.typescript ? { typescript: config.typescript } : {}
|
|
620
891
|
}),
|
|
621
892
|
...config.interaction ? { interaction: config.interaction } : {},
|
|
622
893
|
roots: config.roots ?? ["/skills"]
|
|
@@ -853,4 +1124,4 @@ var WorkerRuntimeClient = class {
|
|
|
853
1124
|
};
|
|
854
1125
|
|
|
855
1126
|
//#endregion
|
|
856
|
-
export { BrowserWorkerScriptExecutor, OpfsProvider, WORKER_BOOTSTRAP_SOURCE, WorkerRuntimeClient, WorkerUiBridge, bridgeError, isOpfsAvailable, parseBridgeRequest, parseMainMessage, parseWorkerEvent, startWorkerRuntimeHost };
|
|
1127
|
+
export { BrowserSkillManager, BrowserWorkerScriptExecutor, OpfsProvider, TsTranspiler, WORKER_BOOTSTRAP_SOURCE, WorkerRuntimeClient, WorkerUiBridge, bridgeError, extractZipWeb, isOpfsAvailable, parseBridgeRequest, parseMainMessage, parseWorkerEvent, sha256HexWeb, startWorkerRuntimeHost };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as normalizeToolContent,
|
|
1
|
+
import { $ as validateSkills, B as WebSkillError, D as normalizeToolContent, F as SKILL_MANIFEST_FILE, H as buildManifest, K as isValidSkillName, O as parseBridgeRequest, P as SKILLS_LOCKFILE, Q as resolveInsideRoot, Y as parseSkillMarkdown, et as verifyManifest, o as FsArtifactStore, s as FsMemoryStore, x as bridgeError } from "./dist-hMMxARXK.js";
|
|
2
2
|
import { existsSync, promises, readFileSync } from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -796,10 +796,6 @@ async function removeDirQuiet(fs, dir) {
|
|
|
796
796
|
if (await fs.exists(dir)) await fs.remove(dir, { recursive: true });
|
|
797
797
|
} catch {}
|
|
798
798
|
}
|
|
799
|
-
/** 技能目录内的安装清单文件名(不参与 files 列表与 digest) */
|
|
800
|
-
const SKILL_MANIFEST_FILE = "webskill.skill-manifest.json";
|
|
801
|
-
/** managed root 下的锁定文件名(不参与 files 列表与 digest) */
|
|
802
|
-
const SKILLS_LOCKFILE = "skills.lock.json";
|
|
803
799
|
const messageOf$3 = (e) => e instanceof Error ? e.message : String(e);
|
|
804
800
|
/** 导出技能目录全部文件(含 manifest)为 zip/tar 归档,返回 outPath */
|
|
805
801
|
async function exportArchive(fs, skillRoot, options) {
|
|
@@ -824,7 +820,7 @@ async function readArchiveManifest(fs, archivePath) {
|
|
|
824
820
|
const data = await fs.readBinary(archivePath);
|
|
825
821
|
if (isZipArchive(data)) {
|
|
826
822
|
const entries = unzipSync(data);
|
|
827
|
-
const key = Object.keys(entries).find((k) => k === "webskill.skill-manifest.json" || k.endsWith(
|
|
823
|
+
const key = Object.keys(entries).find((k) => k === "webskill.skill-manifest.json" || k.endsWith(`/${"webskill.skill-manifest.json"}`));
|
|
828
824
|
if (!key) throw notFound();
|
|
829
825
|
return JSON.parse(new TextDecoder().decode(entries[key]));
|
|
830
826
|
}
|
|
@@ -833,7 +829,7 @@ async function readArchiveManifest(fs, archivePath) {
|
|
|
833
829
|
await tar.t({
|
|
834
830
|
file: toPlatform(archivePath),
|
|
835
831
|
onentry: (entry) => {
|
|
836
|
-
if (entry.path === "webskill.skill-manifest.json" || entry.path.endsWith(
|
|
832
|
+
if (entry.path === "webskill.skill-manifest.json" || entry.path.endsWith(`/${"webskill.skill-manifest.json"}`)) {
|
|
837
833
|
const chunks = [];
|
|
838
834
|
entry.on("data", (chunk) => chunks.push(chunk));
|
|
839
835
|
entry.on("end", () => {
|
|
@@ -903,10 +899,6 @@ async function stageGit(source, ctx) {
|
|
|
903
899
|
function sha256Hex(data) {
|
|
904
900
|
return createHash("sha256").update(data).digest("hex");
|
|
905
901
|
}
|
|
906
|
-
/** 整体 digest:逐文件 "<path>:<sha256>\n" 拼接串(文件按 path 排序)的 sha256 */
|
|
907
|
-
function computeDigest(files) {
|
|
908
|
-
return sha256Hex([...files].sort((a, b) => a.path.localeCompare(b.path)).map((f) => `${f.path}:${f.sha256}\n`).join(""));
|
|
909
|
-
}
|
|
910
902
|
const messageOf$1 = (e) => e instanceof Error ? e.message : String(e);
|
|
911
903
|
/** http 源:下载归档(可选 expectedSha256 校验包体)→ 解包 → 定位技能根 */
|
|
912
904
|
async function stageHttp(source, ctx, expectedSha256) {
|
|
@@ -1041,18 +1033,14 @@ async function createManifest(fs, skillRoot, input) {
|
|
|
1041
1033
|
sha256: sha256Hex(content)
|
|
1042
1034
|
});
|
|
1043
1035
|
}
|
|
1044
|
-
const manifest = {
|
|
1045
|
-
schemaVersion: 1,
|
|
1036
|
+
const manifest = await buildManifest({
|
|
1046
1037
|
name: input.name,
|
|
1047
1038
|
...input.version !== void 0 ? { version: input.version } : {},
|
|
1048
1039
|
source: input.source,
|
|
1049
1040
|
installedAt: input.installedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
},
|
|
1054
|
-
files
|
|
1055
|
-
};
|
|
1041
|
+
files,
|
|
1042
|
+
sha256: sha256Hex
|
|
1043
|
+
});
|
|
1056
1044
|
await fs.writeText(`${skillRoot}/${SKILL_MANIFEST_FILE}`, JSON.stringify(manifest, null, 2));
|
|
1057
1045
|
return manifest;
|
|
1058
1046
|
}
|
|
@@ -1066,22 +1054,15 @@ async function readManifest(fs, skillRoot) {
|
|
|
1066
1054
|
throw new WebSkillError("INTEGRITY_FAILED", `Skill manifest at ${path} is corrupted: ${e instanceof Error ? e.message : String(e)}`, e);
|
|
1067
1055
|
}
|
|
1068
1056
|
}
|
|
1069
|
-
/** 按 manifest.files 逐文件重算 sha256
|
|
1057
|
+
/** 按 manifest.files 逐文件重算 sha256 比对(core 纯逻辑校验) */
|
|
1070
1058
|
async function verifyIntegrity(fs, skillRoot) {
|
|
1071
1059
|
const manifest = await readManifest(fs, skillRoot);
|
|
1072
|
-
const
|
|
1060
|
+
const actualHashes = /* @__PURE__ */ new Map();
|
|
1073
1061
|
for (const file of manifest.files) {
|
|
1074
1062
|
const path = `${skillRoot}/${file.path}`;
|
|
1075
|
-
if (
|
|
1076
|
-
mismatches.push(file.path);
|
|
1077
|
-
continue;
|
|
1078
|
-
}
|
|
1079
|
-
if (sha256Hex(await fs.readBinary(path)) !== file.sha256) mismatches.push(file.path);
|
|
1063
|
+
if (await fs.exists(path)) actualHashes.set(file.path, sha256Hex(await fs.readBinary(path)));
|
|
1080
1064
|
}
|
|
1081
|
-
return
|
|
1082
|
-
ok: mismatches.length === 0,
|
|
1083
|
-
mismatches
|
|
1084
|
-
};
|
|
1065
|
+
return verifyManifest(manifest, actualHashes);
|
|
1085
1066
|
}
|
|
1086
1067
|
const messageOf = (e) => e instanceof Error ? e.message : String(e);
|
|
1087
1068
|
const asInstallFailed = (e) => e instanceof WebSkillError && e.code === "INSTALL_FAILED" ? e : new WebSkillError("INSTALL_FAILED", `Install failed: ${messageOf(e)}`, e);
|
|
@@ -1126,6 +1107,7 @@ var SkillManager = class {
|
|
|
1126
1107
|
case "npm":
|
|
1127
1108
|
staged = await stageNpm(source, ctx);
|
|
1128
1109
|
break;
|
|
1110
|
+
case "archive": throw new WebSkillError("TOOL_UNSUPPORTED", "The \"archive\" install source is only supported by the browser skill manager");
|
|
1129
1111
|
}
|
|
1130
1112
|
let name;
|
|
1131
1113
|
let version;
|
|
@@ -1319,4 +1301,4 @@ async function doProbeLlmCapabilities(config) {
|
|
|
1319
1301
|
}
|
|
1320
1302
|
|
|
1321
1303
|
//#endregion
|
|
1322
|
-
export { NodeScriptExecutor as a,
|
|
1304
|
+
export { NodeScriptExecutor as a, SkillManager as c, readArchiveManifest as d, NodeFS as i, loadLlmConfigFromEnv as l, FileArtifactStore as n, OxcSchemaInferer as o, FileMemoryStore as r, SandboxedScriptExecutor as s, CliUiBridge as t, probeLlmCapabilities as u };
|
|
@@ -12,6 +12,41 @@ var WebSkillError = class extends Error {
|
|
|
12
12
|
this.details = details;
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
+
/** 技能目录内的安装清单文件名(不参与 files 列表与 digest) */
|
|
16
|
+
const SKILL_MANIFEST_FILE = "webskill.skill-manifest.json";
|
|
17
|
+
/** managed root 下的锁定文件名(不参与 files 列表与 digest) */
|
|
18
|
+
const SKILLS_LOCKFILE = "skills.lock.json";
|
|
19
|
+
/** 整体 digest:逐文件 "<path>:<sha256>\n" 拼接串(文件按 path 排序)的 sha256(hash 由调用方提供,可为 WebCrypto 异步实现) */
|
|
20
|
+
async function computeDigest(files, sha256) {
|
|
21
|
+
return sha256([...files].sort((a, b) => a.path.localeCompare(b.path)).map((f) => `${f.path}:${f.sha256}\n`).join(""));
|
|
22
|
+
}
|
|
23
|
+
/** 由逐文件清单构建 manifest(digest 由 computeDigest 计算) */
|
|
24
|
+
async function buildManifest(input) {
|
|
25
|
+
return {
|
|
26
|
+
schemaVersion: 1,
|
|
27
|
+
name: input.name,
|
|
28
|
+
...input.version !== void 0 ? { version: input.version } : {},
|
|
29
|
+
source: input.source,
|
|
30
|
+
installedAt: input.installedAt,
|
|
31
|
+
integrity: {
|
|
32
|
+
algorithm: "sha256",
|
|
33
|
+
digest: await computeDigest(input.files, input.sha256)
|
|
34
|
+
},
|
|
35
|
+
files: input.files
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** 按 manifest.files 比对实际 hash(调用方负责计算 actualHashes) */
|
|
39
|
+
function verifyManifest(manifest, actualHashes) {
|
|
40
|
+
const mismatches = [];
|
|
41
|
+
for (const file of manifest.files) {
|
|
42
|
+
const actual = actualHashes.get(file.path);
|
|
43
|
+
if (actual === void 0 || actual !== file.sha256) mismatches.push(file.path);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
ok: mismatches.length === 0,
|
|
47
|
+
mismatches
|
|
48
|
+
};
|
|
49
|
+
}
|
|
15
50
|
const ROOT = "/";
|
|
16
51
|
/** 内存文件系统:路径一律规范化为 `/` 分隔,写入自动创建父目录 */
|
|
17
52
|
var MemoryFS = class {
|
|
@@ -2005,4 +2040,4 @@ var WebSkillRuntime = class {
|
|
|
2005
2040
|
};
|
|
2006
2041
|
|
|
2007
2042
|
//#endregion
|
|
2008
|
-
export { schemaToForm as A,
|
|
2043
|
+
export { validateSkills as $, schemaToForm as A, WebSkillError as B, createScriptContext as C, normalizeToolContent as D, mergeCatalogEntries as E, SKILL_MANIFEST_FILE as F, escapeXml as G, buildManifest as H, SKILL_NAME_MAX_LENGTH as I, normalizePath as J, isValidSkillName as K, SKILL_NAME_PATTERN as L, toVercelToolSpecs as M, MemoryFS as N, parseBridgeRequest as O, SKILLS_LOCKFILE as P, resolveInsideRoot as Q, SkillDiscovery as R, buildRenderResult as S, fromVercelStreamPart as T, checkSkillRules as U, buildCatalog as V, computeDigest as W, renderAvailableSkillsXml as X, parseSkillMarkdown as Y, renderCatalogJson as Z, READ_SKILL_FILE_TOOL as _, EventBus as a, WebSkillRuntime as b, FullDisclosureRouter as c, MemoryArtifactStore as d, verifyManifest as et, MockLlmClient as f, READ_SKILL_FILE_INPUT_SCHEMA as g, ProgressiveRouter as h, AgentLoop as i, toLlmToolSpec as j, resolveToolName as k, HookRunner as l, OpenAiCompatibleClient as m, ASK_USER_TOOL as n, FsArtifactStore as o, MockUiBridge as p, jsonRenderer as q, ASK_USER_TOOL_NAME as r, FsMemoryStore as s, ASK_USER_INPUT_SCHEMA as t, xmlRenderer as tt, InMemoryStore as u, READ_SKILL_FILE_TOOL_NAME as v, fromVercelResult as w, bridgeError as x, TraceRecorder as y, SkillReader as z };
|
package/dist/governance.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Nt as FileSystemProvider, gt as WebSkillRuntime, j as LlmMessage, k as LlmClient, mt as UiBridge,
|
|
2
|
-
import {
|
|
1
|
+
import { Nt as FileSystemProvider, Vt as SkillCatalogEntry, gt as WebSkillRuntime, j as LlmMessage, k as LlmClient, mt as UiBridge, qt as SkillManifest, tt as RuntimeRun } from "./index-DnI0BTEp.js";
|
|
2
|
+
import { d as SkillManager } from "./index-D65Jk0ju.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';
|
package/dist/governance.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as NodeFS } from "./dist-
|
|
1
|
+
import { $ as validateSkills, B as WebSkillError, K as isValidSkillName, Q as resolveInsideRoot } from "./dist-hMMxARXK.js";
|
|
2
|
+
import { i as NodeFS } from "./dist-C1p26Ap9.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { mkdtemp } from "node:fs/promises";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as InteractionRequest, Mt as FileStat, Nt as FileSystemProvider, Pt as JsonSchema, X as RenderResultRequest, _ as FsMemoryStore, at as ScriptExecutor, g as FsArtifactStore, it as ScriptExecutionContext, l as BridgeCapabilities, lt as ToolResult, mt as UiBridge, rt as SchemaInferer, st as ToolDefinition, w as InteractionResponse } from "./index-
|
|
1
|
+
import { $t as VerifyResult, C as InteractionRequest, Mt as FileStat, Nt as FileSystemProvider, Pt as JsonSchema, Wt as SkillInstallSource, X as RenderResultRequest, Zt as SkillsLockfile, _ as FsMemoryStore, at as ScriptExecutor, g as FsArtifactStore, it as ScriptExecutionContext, l as BridgeCapabilities, lt as ToolResult, mt as UiBridge, qt as SkillManifest, rt as SchemaInferer, st as ToolDefinition, w as InteractionResponse } from "./index-DnI0BTEp.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
|
|
@@ -123,56 +123,6 @@ declare class CliUiBridge implements UiBridge {
|
|
|
123
123
|
renderResult(input: RenderResultRequest): Promise<void>;
|
|
124
124
|
}
|
|
125
125
|
//#endregion
|
|
126
|
-
//#region src/skillManagement/types.d.ts
|
|
127
|
-
type SkillSource = {
|
|
128
|
-
type: 'local';
|
|
129
|
-
path: string;
|
|
130
|
-
} | {
|
|
131
|
-
type: 'http';
|
|
132
|
-
url: string;
|
|
133
|
-
} | {
|
|
134
|
-
type: 'git';
|
|
135
|
-
url: string;
|
|
136
|
-
ref?: string;
|
|
137
|
-
commit?: string;
|
|
138
|
-
} | {
|
|
139
|
-
type: 'npm';
|
|
140
|
-
packageName: string;
|
|
141
|
-
version?: string;
|
|
142
|
-
};
|
|
143
|
-
interface SkillManifest {
|
|
144
|
-
schemaVersion: 1;
|
|
145
|
-
name: string;
|
|
146
|
-
version?: string;
|
|
147
|
-
source: SkillSource;
|
|
148
|
-
installedAt: string;
|
|
149
|
-
integrity: {
|
|
150
|
-
algorithm: 'sha256';
|
|
151
|
-
digest: string;
|
|
152
|
-
};
|
|
153
|
-
files: Array<{
|
|
154
|
-
path: string;
|
|
155
|
-
size: number;
|
|
156
|
-
sha256: string;
|
|
157
|
-
}>;
|
|
158
|
-
}
|
|
159
|
-
interface SkillsLockfile {
|
|
160
|
-
schemaVersion: 1;
|
|
161
|
-
skills: Record<string, {
|
|
162
|
-
digest: string;
|
|
163
|
-
installedAt: string;
|
|
164
|
-
source: SkillSource;
|
|
165
|
-
}>;
|
|
166
|
-
}
|
|
167
|
-
interface VerifyResult {
|
|
168
|
-
ok: boolean;
|
|
169
|
-
mismatches: string[];
|
|
170
|
-
}
|
|
171
|
-
/** 技能目录内的安装清单文件名(不参与 files 列表与 digest) */
|
|
172
|
-
declare const SKILL_MANIFEST_FILE = "webskill.skill-manifest.json";
|
|
173
|
-
/** managed root 下的锁定文件名(不参与 files 列表与 digest) */
|
|
174
|
-
declare const SKILLS_LOCKFILE = "skills.lock.json";
|
|
175
|
-
//#endregion
|
|
176
126
|
//#region src/skillManagement/skillManager.d.ts
|
|
177
127
|
/**
|
|
178
128
|
* 技能管理门面:统一安装管线(staging → 解析 name → 校验 → 拷贝 → manifest → lockfile),
|
|
@@ -187,7 +137,7 @@ declare class SkillManager {
|
|
|
187
137
|
/** D2 安装期 schema 预推导(默认 true,可关) */
|
|
188
138
|
schemaInference?: boolean;
|
|
189
139
|
});
|
|
190
|
-
install(source:
|
|
140
|
+
install(source: SkillInstallSource, options?: {
|
|
191
141
|
expectedSha256?: string;
|
|
192
142
|
}): Promise<SkillManifest>;
|
|
193
143
|
uninstall(name: string): Promise<void>;
|
|
@@ -229,4 +179,4 @@ interface LlmCapabilities {
|
|
|
229
179
|
*/
|
|
230
180
|
declare function probeLlmCapabilities(config: LlmEnvConfig): Promise<LlmCapabilities>;
|
|
231
181
|
//#endregion
|
|
232
|
-
export {
|
|
182
|
+
export { LlmEnvConfig as a, OxcSchemaInferer as c, SkillManager as d, loadLlmConfigFromEnv as f, LlmCapabilities as i, SandboxOptions as l, readArchiveManifest as m, FileArtifactStore as n, NodeFS as o, probeLlmCapabilities as p, FileMemoryStore as r, NodeScriptExecutor as s, CliUiBridge as t, SandboxedScriptExecutor as u };
|
|
@@ -24,6 +24,76 @@ interface JsonSchema {
|
|
|
24
24
|
[key: string]: unknown;
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
+
//#region src/skill/manifest.d.ts
|
|
28
|
+
type SkillInstallSource = {
|
|
29
|
+
type: 'local';
|
|
30
|
+
path: string;
|
|
31
|
+
} | {
|
|
32
|
+
type: 'http';
|
|
33
|
+
url: string;
|
|
34
|
+
} | {
|
|
35
|
+
type: 'archive';
|
|
36
|
+
data: ArrayBuffer;
|
|
37
|
+
} | {
|
|
38
|
+
type: 'git';
|
|
39
|
+
url: string;
|
|
40
|
+
ref?: string;
|
|
41
|
+
commit?: string;
|
|
42
|
+
} | {
|
|
43
|
+
type: 'npm';
|
|
44
|
+
packageName: string;
|
|
45
|
+
version?: string;
|
|
46
|
+
};
|
|
47
|
+
interface SkillManifest {
|
|
48
|
+
schemaVersion: 1;
|
|
49
|
+
name: string;
|
|
50
|
+
version?: string;
|
|
51
|
+
source: SkillInstallSource;
|
|
52
|
+
installedAt: string;
|
|
53
|
+
integrity: {
|
|
54
|
+
algorithm: 'sha256';
|
|
55
|
+
digest: string;
|
|
56
|
+
};
|
|
57
|
+
files: Array<{
|
|
58
|
+
path: string;
|
|
59
|
+
size: number;
|
|
60
|
+
sha256: string;
|
|
61
|
+
}>;
|
|
62
|
+
}
|
|
63
|
+
interface SkillsLockfile {
|
|
64
|
+
schemaVersion: 1;
|
|
65
|
+
skills: Record<string, {
|
|
66
|
+
digest: string;
|
|
67
|
+
installedAt: string;
|
|
68
|
+
source: SkillInstallSource;
|
|
69
|
+
}>;
|
|
70
|
+
}
|
|
71
|
+
interface VerifyResult {
|
|
72
|
+
ok: boolean;
|
|
73
|
+
mismatches: string[];
|
|
74
|
+
}
|
|
75
|
+
/** 技能目录内的安装清单文件名(不参与 files 列表与 digest) */
|
|
76
|
+
declare const SKILL_MANIFEST_FILE = "webskill.skill-manifest.json";
|
|
77
|
+
/** managed root 下的锁定文件名(不参与 files 列表与 digest) */
|
|
78
|
+
declare const SKILLS_LOCKFILE = "skills.lock.json";
|
|
79
|
+
type Sha256Fn = (data: Uint8Array | string) => string | Promise<string>;
|
|
80
|
+
/** 整体 digest:逐文件 "<path>:<sha256>\n" 拼接串(文件按 path 排序)的 sha256(hash 由调用方提供,可为 WebCrypto 异步实现) */
|
|
81
|
+
declare function computeDigest(files: Array<{
|
|
82
|
+
path: string;
|
|
83
|
+
sha256: string;
|
|
84
|
+
}>, sha256: Sha256Fn): Promise<string>;
|
|
85
|
+
/** 由逐文件清单构建 manifest(digest 由 computeDigest 计算) */
|
|
86
|
+
declare function buildManifest(input: {
|
|
87
|
+
name: string;
|
|
88
|
+
version?: string;
|
|
89
|
+
source: SkillInstallSource;
|
|
90
|
+
installedAt: string;
|
|
91
|
+
files: SkillManifest['files'];
|
|
92
|
+
sha256: Sha256Fn;
|
|
93
|
+
}): Promise<SkillManifest>;
|
|
94
|
+
/** 按 manifest.files 比对实际 hash(调用方负责计算 actualHashes) */
|
|
95
|
+
declare function verifyManifest(manifest: SkillManifest, actualHashes: Map<string, string>): VerifyResult;
|
|
96
|
+
//#endregion
|
|
27
97
|
//#region src/fs/types.d.ts
|
|
28
98
|
interface FileStat {
|
|
29
99
|
path: string;
|
|
@@ -966,4 +1036,4 @@ declare class WebSkillRuntime {
|
|
|
966
1036
|
run(userPrompt: string): Promise<RunResult>;
|
|
967
1037
|
}
|
|
968
1038
|
//#endregion
|
|
969
|
-
export { RunTerminationReason as $,
|
|
1039
|
+
export { RunTerminationReason as $, VerifyResult as $t, LlmCompleteInput as A, CatalogRenderer as At, MockLlmQueueItem as B, SkillCatalog as Bt, InteractionRequest as C, mergeCatalogEntries as Ct, LifecycleHookContext as D, schemaToForm as Dt, LifecycleHook as E, resolveToolName as Et, LlmToolSpec as F, MemoryFS as Ft, ProgressiveRouter as G, SkillIssue as Gt, MockUiBridge as H, SkillDiscovery as Ht, MemoryArtifactStore as I, SKILLS_LOCKFILE as It, READ_SKILL_FILE_TOOL_NAME as J, SkillMetadata as Jt, READ_SKILL_FILE_INPUT_SCHEMA as K, SkillLocation as Kt, MemoryStore as L, SKILL_MANIFEST_FILE as Lt, LlmResponse as M, FileStat as Mt, LlmStreamEvent as N, FileSystemProvider as Nt, LifecycleListener as O, toLlmToolSpec as Ot, LlmToolCall as P, JsonSchema as Pt, RunResult as Q, ValidationReport as Qt, MockLlmClient as R, SKILL_NAME_MAX_LENGTH as Rt, InteractionPolicy as S, fromVercelStreamPart as St, LifecycleEvent as T, parseBridgeRequest as Tt, OpenAiCompatibleClient as U, SkillDocument as Ut, MockUiAnswer as V, SkillCatalogEntry as Vt, OpenAiCompatibleClientConfig as W, SkillInstallSource as Wt, RenderResultRequest as X, SkillSource as Xt, RenderBlock as Y, SkillReader as Yt, RouteResult as Z, SkillsLockfile as Zt, FsMemoryStore as _, WebSkillRuntimeDeps as _t, AgentLoopConfig as a, computeDigest as an, ScriptExecutor as at, HookRunnerOptions as b, createScriptContext as bt, ArtifactStore as c, jsonRenderer as cn, ToolResolution as ct, BridgeResponse as d, renderAvailableSkillsXml as dn, TraceEvent as dt, WebSkillError as en, RuntimePhase as et, EventBus as f, renderCatalogJson as fn, TraceEventType as ft, FsArtifactStore as g, xmlRenderer as gn, WebSkillRuntime as gt, FormField as h, verifyManifest as hn, VercelToolSpec as ht, AgentLoop as i, checkSkillRules as in, ScriptExecutionContext as it, LlmMessage as j, DiscoveryResult as jt, LlmClient as k, toVercelToolSpecs as kt, BridgeCapabilities as l, normalizePath as ln, ToolResult as lt, ExternalToolSource as m, validateSkills as mn, UiBridge as mt, ASK_USER_TOOL as n, buildCatalog as nn, RuntimeSession as nt, AgentLoopDeps as o, escapeXml as on, SkillRouter as ot, ExternalSkillProvider as p, resolveInsideRoot as pn, TraceRecorder as pt, READ_SKILL_FILE_TOOL as q, SkillManifest as qt, ASK_USER_TOOL_NAME as r, buildManifest as rn, SchemaInferer as rt, Artifact as s, isValidSkillName as sn, ToolDefinition as st, ASK_USER_INPUT_SCHEMA as t, WebSkillErrorCode as tn, RuntimeRun as tt, BridgeRequest as u, parseSkillMarkdown as un, TraceClock as ut, FullDisclosureRouter as v, bridgeError as vt, InteractionResponse as w, normalizeToolContent as wt, InMemoryStore as x, fromVercelResult as xt, HookRunner as y, buildRenderResult as yt, MockLlmHandler as z, SKILL_NAME_PATTERN as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as RunTerminationReason, $t as
|
|
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, 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, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, type RunTerminationReason, type RuntimePhase, type RuntimeRun, type RuntimeSession, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, type SchemaInferer, type ScriptExecutionContext, type ScriptExecutor, type SkillCatalog, type SkillCatalogEntry, SkillDiscovery, type SkillDocument, type SkillIssue, type SkillLocation, type SkillMetadata, SkillReader, type SkillRouter, type SkillSource, type ToolDefinition, type ToolResolution, type ToolResult, type TraceClock, type TraceEvent, type TraceEventType, TraceRecorder, type UiBridge, type ValidationReport, type VercelToolSpec, WebSkillError, type WebSkillErrorCode, WebSkillRuntime, type WebSkillRuntimeDeps, bridgeError, buildCatalog, buildRenderResult, checkSkillRules, createScriptContext, escapeXml, fromVercelResult, fromVercelStreamPart, isValidSkillName, jsonRenderer, mergeCatalogEntries, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, xmlRenderer };
|
|
1
|
+
import { $ as RunTerminationReason, $t as VerifyResult, A as LlmCompleteInput, At as CatalogRenderer, B as MockLlmQueueItem, Bt as SkillCatalog, C as InteractionRequest, Ct as mergeCatalogEntries, D as LifecycleHookContext, Dt as schemaToForm, E as LifecycleHook, Et as resolveToolName, F as LlmToolSpec, Ft as MemoryFS, G as ProgressiveRouter, Gt as SkillIssue, H as MockUiBridge, Ht as SkillDiscovery, I as MemoryArtifactStore, It as SKILLS_LOCKFILE, J as READ_SKILL_FILE_TOOL_NAME, Jt as SkillMetadata, K as READ_SKILL_FILE_INPUT_SCHEMA, Kt as SkillLocation, L as MemoryStore, Lt as SKILL_MANIFEST_FILE, M as LlmResponse, Mt as FileStat, N as LlmStreamEvent, Nt as FileSystemProvider, O as LifecycleListener, Ot as toLlmToolSpec, P as LlmToolCall, Pt as JsonSchema, Q as RunResult, Qt as ValidationReport, R as MockLlmClient, Rt as SKILL_NAME_MAX_LENGTH, S as InteractionPolicy, St as fromVercelStreamPart, T as LifecycleEvent, Tt as parseBridgeRequest, U as OpenAiCompatibleClient, Ut as SkillDocument, V as MockUiAnswer, Vt as SkillCatalogEntry, W as OpenAiCompatibleClientConfig, Wt as SkillInstallSource, X as RenderResultRequest, Xt as SkillSource, Y as RenderBlock, Yt as SkillReader, Z as RouteResult, Zt as SkillsLockfile, _ as FsMemoryStore, _t as WebSkillRuntimeDeps, a as AgentLoopConfig, an as computeDigest, at as ScriptExecutor, b as HookRunnerOptions, bt as createScriptContext, c as ArtifactStore, cn as jsonRenderer, ct as ToolResolution, d as BridgeResponse, dn as renderAvailableSkillsXml, dt as TraceEvent, en as WebSkillError, et as RuntimePhase, f as EventBus, fn as renderCatalogJson, ft as TraceEventType, g as FsArtifactStore, gn as xmlRenderer, gt as WebSkillRuntime, h as FormField, hn as verifyManifest, ht as VercelToolSpec, i as AgentLoop, in as checkSkillRules, it as ScriptExecutionContext, j as LlmMessage, jt as DiscoveryResult, k as LlmClient, kt as toVercelToolSpecs, l as BridgeCapabilities, ln as normalizePath, lt as ToolResult, m as ExternalToolSource, mn as validateSkills, mt as UiBridge, n as ASK_USER_TOOL, nn as buildCatalog, nt as RuntimeSession, o as AgentLoopDeps, on as escapeXml, ot as SkillRouter, p as ExternalSkillProvider, pn as resolveInsideRoot, pt as TraceRecorder, q as READ_SKILL_FILE_TOOL, qt as SkillManifest, r as ASK_USER_TOOL_NAME, rn as buildManifest, rt as SchemaInferer, s as Artifact, sn as isValidSkillName, st as ToolDefinition, t as ASK_USER_INPUT_SCHEMA, tn as WebSkillErrorCode, tt as RuntimeRun, u as BridgeRequest, un as parseSkillMarkdown, ut as TraceClock, v as FullDisclosureRouter, vt as bridgeError, w as InteractionResponse, wt as normalizeToolContent, x as InMemoryStore, xt as fromVercelResult, y as HookRunner, yt as buildRenderResult, z as MockLlmHandler, zt as SKILL_NAME_PATTERN } from "./index-DnI0BTEp.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, 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, type RenderBlock, type RenderResultRequest, type RouteResult, type RunResult, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as schemaToForm, B as
|
|
1
|
+
import { $ as validateSkills, A as schemaToForm, B as WebSkillError, C as createScriptContext, D as normalizeToolContent, E as mergeCatalogEntries, F as SKILL_MANIFEST_FILE, G as escapeXml, H as buildManifest, I as SKILL_NAME_MAX_LENGTH, J as normalizePath, K as isValidSkillName, L as SKILL_NAME_PATTERN, M as toVercelToolSpecs, N as MemoryFS, O as parseBridgeRequest, P as SKILLS_LOCKFILE, Q as resolveInsideRoot, R as SkillDiscovery, S as buildRenderResult, T as fromVercelStreamPart, U as checkSkillRules, V as buildCatalog, W as computeDigest, X as renderAvailableSkillsXml, Y as parseSkillMarkdown, Z as renderCatalogJson, _ as READ_SKILL_FILE_TOOL, a as EventBus, b as WebSkillRuntime, c as FullDisclosureRouter, d as MemoryArtifactStore, et as verifyManifest, f as MockLlmClient, g as READ_SKILL_FILE_INPUT_SCHEMA, h as ProgressiveRouter, i as AgentLoop, j as toLlmToolSpec, k as resolveToolName, l as HookRunner, m as OpenAiCompatibleClient, n as ASK_USER_TOOL, o as FsArtifactStore, p as MockUiBridge, q as jsonRenderer, r as ASK_USER_TOOL_NAME, s as FsMemoryStore, t as ASK_USER_INPUT_SCHEMA, tt as xmlRenderer, u as InMemoryStore, v as READ_SKILL_FILE_TOOL_NAME, w as fromVercelResult, x as bridgeError, y as TraceRecorder, z as SkillReader } from "./dist-hMMxARXK.js";
|
|
2
2
|
|
|
3
|
-
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, EventBus, FsArtifactStore, FsMemoryStore, FullDisclosureRouter, HookRunner, InMemoryStore, MemoryArtifactStore, MemoryFS, MockLlmClient, MockUiBridge, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SkillDiscovery, SkillReader, TraceRecorder, WebSkillError, WebSkillRuntime, bridgeError, buildCatalog, buildRenderResult, checkSkillRules, createScriptContext, escapeXml, fromVercelResult, fromVercelStreamPart, isValidSkillName, jsonRenderer, mergeCatalogEntries, normalizePath, normalizeToolContent, parseBridgeRequest, parseSkillMarkdown, renderAvailableSkillsXml, renderCatalogJson, resolveInsideRoot, resolveToolName, schemaToForm, toLlmToolSpec, toVercelToolSpecs, validateSkills, xmlRenderer };
|
|
3
|
+
export { ASK_USER_INPUT_SCHEMA, ASK_USER_TOOL, ASK_USER_TOOL_NAME, AgentLoop, EventBus, FsArtifactStore, FsMemoryStore, FullDisclosureRouter, HookRunner, InMemoryStore, MemoryArtifactStore, MemoryFS, MockLlmClient, MockUiBridge, OpenAiCompatibleClient, ProgressiveRouter, READ_SKILL_FILE_INPUT_SCHEMA, READ_SKILL_FILE_TOOL, READ_SKILL_FILE_TOOL_NAME, 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 };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ct as mergeCatalogEntries, F as LlmToolSpec, Pt as JsonSchema,
|
|
1
|
+
import { Ct as mergeCatalogEntries, F as LlmToolSpec, Pt as JsonSchema, Ut as SkillDocument, Vt as SkillCatalogEntry, lt as ToolResult, m as ExternalToolSource, p as ExternalSkillProvider } from "./index-DnI0BTEp.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 {
|
|
1
|
+
import { B as WebSkillError, D as normalizeToolContent, E as mergeCatalogEntries } from "./dist-hMMxARXK.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 createScriptContext } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
export { CliUiBridge, FileArtifactStore, FileMemoryStore, type LlmCapabilities, type LlmEnvConfig, NodeFS, NodeScriptExecutor, OxcSchemaInferer, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, type SandboxOptions, SandboxedScriptExecutor, SkillManager, type SkillManifest, type SkillSource, type SkillsLockfile, type VerifyResult, createScriptContext, loadLlmConfigFromEnv, probeLlmCapabilities, readArchiveManifest };
|
|
1
|
+
import { $t as VerifyResult, It as SKILLS_LOCKFILE, Lt as SKILL_MANIFEST_FILE, Wt as SkillInstallSource, Zt as SkillsLockfile, bt as createScriptContext, qt as SkillManifest } from "./index-DnI0BTEp.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-D65Jk0ju.js";
|
|
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 { C as createScriptContext } from "./dist-
|
|
2
|
-
import { a as NodeScriptExecutor, c as
|
|
1
|
+
import { C as createScriptContext, F as SKILL_MANIFEST_FILE, P as SKILLS_LOCKFILE } from "./dist-hMMxARXK.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-C1p26Ap9.js";
|
|
3
3
|
|
|
4
4
|
export { CliUiBridge, FileArtifactStore, FileMemoryStore, NodeFS, NodeScriptExecutor, OxcSchemaInferer, SKILLS_LOCKFILE, SKILL_MANIFEST_FILE, SandboxedScriptExecutor, SkillManager, createScriptContext, loadLlmConfigFromEnv, probeLlmCapabilities, readArchiveManifest };
|
package/dist/ui-react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as InteractionRequest, X as RenderResultRequest, mt as UiBridge, w as InteractionResponse } from "./index-
|
|
1
|
+
import { C as InteractionRequest, X as RenderResultRequest, mt as UiBridge, w as InteractionResponse } from "./index-DnI0BTEp.js";
|
|
2
2
|
//#region ../ui-react/dist/index.d.ts
|
|
3
3
|
//#region src/bridgeState.d.ts
|
|
4
4
|
/**
|
package/dist/ui-vue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as InteractionRequest, X as RenderResultRequest, mt as UiBridge, w as InteractionResponse } from "./index-
|
|
1
|
+
import { C as InteractionRequest, X as RenderResultRequest, mt as UiBridge, w as InteractionResponse } from "./index-DnI0BTEp.js";
|
|
2
2
|
import { PropType } from "vue";
|
|
3
3
|
//#region ../ui-vue/dist/index.d.ts
|
|
4
4
|
//#region src/bridgeState.d.ts
|
package/dist/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as InteractionRequest, X as RenderResultRequest, Y as RenderBlock, mt as UiBridge, w as InteractionResponse, yt as buildRenderResult } from "./index-
|
|
1
|
+
import { C as InteractionRequest, X as RenderResultRequest, Y as RenderBlock, mt as UiBridge, w as InteractionResponse, yt as buildRenderResult } from "./index-DnI0BTEp.js";
|
|
2
2
|
//#region ../ui/dist/index.d.ts
|
|
3
3
|
//#region src/model/formModel.d.ts
|
|
4
4
|
interface FormModel {
|
package/dist/ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as buildRenderResult } from "./dist-
|
|
1
|
+
import { S as buildRenderResult } from "./dist-hMMxARXK.js";
|
|
2
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-RcqvzAGF.js";
|
|
3
3
|
|
|
4
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 };
|