@webskill/sdk 0.2.6 → 0.2.8
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 +13 -4
- package/dist/browser.js +16 -6
- package/dist/catalogComponents-C_V39rbF-BOHveMWa.js +120303 -0
- package/dist/{dist-BXpDDZpR.js → dist-B9VLwOME.js} +464 -29
- package/dist/{dist-DNSG9FqC.js → dist-CtBLBbEz.js} +1186 -123
- package/dist/dist-DxyxmXPU-DGC-dpXf.js +5621 -0
- package/dist/echarts-DhNm2ene.js +78816 -0
- package/dist/governance.d.ts +29 -196
- package/dist/governance.js +38 -199
- package/dist/index-7DVaZJU7.d.ts +597 -0
- package/dist/{index-DJOha4b6.d.ts → index-QrHtAudz.d.ts} +37 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/jsonRenderRegistry-9GrWP_hE-CQY8bT9w.js +2468 -0
- package/dist/mcp.d.ts +5 -3
- package/dist/mcp.js +9 -4
- package/dist/node.d.ts +49 -4
- package/dist/node.js +2064 -4
- package/dist/openUiLibrary-B8-Cvou9-D3RsU2EB.js +3785 -0
- package/dist/rolldown-runtime-BOF7iYI8.js +55 -0
- package/dist/sandboxWorkerEntry.js +12 -3
- package/dist/{index-DRlYzdr2.d.ts → skillVersionStore-B7rGjtMi-BgnQho9v.d.ts} +128 -3
- package/dist/testing.d.ts +1 -1
- package/dist/{types-CKm5G_eQ-krKWW8WV.d.ts → types-AmKCKJn_-BogJPQHU.d.ts} +129 -2
- package/dist/ui-react.d.ts +138 -2
- package/dist/ui-react.js +6935 -3
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +3 -203
- package/dist/ui.js +3 -3
- package/dist/webskillLitCatalog-CNaUpasU-CfSRvqCZ.js +1601 -0
- package/package.json +2 -1
- package/dist/dist-DWFDb1Ww.js +0 -1896
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { G as SkillDocument, P as JsonSchema, U as SkillCatalogEntry, m as LlmToolSpec } from "./types-AmKCKJn_-BogJPQHU.js";
|
|
2
|
+
import { St as mergeCatalogEntries, it as ToolResult, v as ExternalSkillProvider, y as ExternalToolSource } from "./index-QrHtAudz.js";
|
|
3
3
|
import { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
|
|
4
4
|
import { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -214,7 +214,7 @@ declare class ExperimentalWebMcpAdapter {
|
|
|
214
214
|
enabled?: boolean;
|
|
215
215
|
});
|
|
216
216
|
isAvailable(): boolean;
|
|
217
|
-
/** 工具清单(listTools
|
|
217
|
+
/** 工具清单(listTools 缺失时返回 undefined;调用失败时告警后返回 undefined) */
|
|
218
218
|
listTools(): Promise<WebMcpToolDescriptor[] | undefined>;
|
|
219
219
|
/** 工具名清单(listTools 缺失/失败时返回 undefined) */
|
|
220
220
|
listToolNames(): Promise<string[] | undefined>;
|
|
@@ -235,6 +235,8 @@ declare class McpRuntimePlugin implements ExternalToolSource {
|
|
|
235
235
|
resolver?: McpToolResolver;
|
|
236
236
|
/** 已知的 endpoint 名(注销后仍按 MCP_ENDPOINT_UNAVAILABLE 响应,而非 TOOL_NOT_FOUND) */
|
|
237
237
|
endpoints?: string[];
|
|
238
|
+
/** endpoint 不可用时的告警出口(默认 console.warn) */
|
|
239
|
+
onWarning?(message: string): void;
|
|
238
240
|
});
|
|
239
241
|
listToolSpecs(): Promise<LlmToolSpec[]>;
|
|
240
242
|
canHandle(llmToolName: string): boolean;
|
package/dist/mcp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as messageOf, d as assertRemoteUrlAllowed, u as WebSkillError } from "./dist-BQzncxXg.js";
|
|
2
|
-
import {
|
|
2
|
+
import { I as normalizeToolContent, M as mergeCatalogEntries } from "./dist-B9VLwOME.js";
|
|
3
3
|
|
|
4
4
|
//#region ../mcp/dist/index.js
|
|
5
5
|
/**
|
|
@@ -418,13 +418,14 @@ var ExperimentalWebMcpAdapter = class {
|
|
|
418
418
|
isAvailable() {
|
|
419
419
|
return this.#enabled && typeof this.#resolveApi()?.executeTool === "function";
|
|
420
420
|
}
|
|
421
|
-
/** 工具清单(listTools
|
|
421
|
+
/** 工具清单(listTools 缺失时返回 undefined;调用失败时告警后返回 undefined) */
|
|
422
422
|
async listTools() {
|
|
423
423
|
const api = this.#resolveApi();
|
|
424
424
|
if (typeof api?.listTools !== "function") return void 0;
|
|
425
425
|
try {
|
|
426
426
|
return extractToolDescriptors(await api.listTools());
|
|
427
|
-
} catch {
|
|
427
|
+
} catch (e) {
|
|
428
|
+
console.warn(`[webskill] navigator.modelContext.listTools() failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
428
429
|
return;
|
|
429
430
|
}
|
|
430
431
|
}
|
|
@@ -460,11 +461,13 @@ var McpRuntimePlugin = class {
|
|
|
460
461
|
#resolver;
|
|
461
462
|
#webMcp;
|
|
462
463
|
#configuredEndpoints;
|
|
464
|
+
#onWarning;
|
|
463
465
|
constructor(deps) {
|
|
464
466
|
this.#registry = deps.registry;
|
|
465
467
|
this.#resolver = deps.resolver ?? new McpToolResolver(deps.registry);
|
|
466
468
|
this.#webMcp = deps.webMcp;
|
|
467
469
|
this.#configuredEndpoints = deps.endpoints ?? [];
|
|
470
|
+
this.#onWarning = deps.onWarning ?? ((message) => console.warn(message));
|
|
468
471
|
}
|
|
469
472
|
#endpoints() {
|
|
470
473
|
return [.../* @__PURE__ */ new Set([...this.#configuredEndpoints, ...this.#registry.endpoints()])];
|
|
@@ -481,7 +484,9 @@ var McpRuntimePlugin = class {
|
|
|
481
484
|
properties: {}
|
|
482
485
|
}
|
|
483
486
|
});
|
|
484
|
-
} catch {
|
|
487
|
+
} catch (e) {
|
|
488
|
+
this.#onWarning(`[webskill] MCP endpoint "${endpoint}" is unavailable; its tools are omitted from this turn: ${e instanceof Error ? e.message : String(e)}`);
|
|
489
|
+
}
|
|
485
490
|
if (this.#webMcp?.isAvailable()) {
|
|
486
491
|
const tools = await this.#webMcp.listTools();
|
|
487
492
|
for (const tool of tools ?? []) specs.push({
|
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ht as createScriptContext } from "./index-
|
|
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";
|
|
3
3
|
import { n as LlmEnvConfig, s as probeLlmCapabilities, t as LlmCapabilities } from "./env-BPUBZCwJ-4jat_SVG.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
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
|
+
//#region ../governance/dist/node.d.ts
|
|
6
|
+
//#region src/approval/approvalWorkflow.d.ts
|
|
7
|
+
/** 审批工作流:review(UiBridge confirm 真实接线)/ publish(校验→安装→版本→审计) */
|
|
8
|
+
declare class ApprovalWorkflow {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(deps: {
|
|
11
|
+
policy: ApprovalPolicy;
|
|
12
|
+
audit: AuditLog;
|
|
13
|
+
store: CandidateStore;
|
|
14
|
+
skillManager: SkillManager;
|
|
15
|
+
versions: SkillVersionStore;
|
|
16
|
+
fs?: FileSystemProvider;
|
|
17
|
+
});
|
|
18
|
+
/** 策略评估;needs-human 时经 UiBridge confirm 真实询问,按应答迁移状态 */
|
|
19
|
+
review(candidateId: string, input: {
|
|
20
|
+
actor: string;
|
|
21
|
+
uiBridge?: UiBridge;
|
|
22
|
+
}): Promise<CandidateSkill>;
|
|
23
|
+
/** publish 全链路:approved 前置 → 写出 staging → validateSkills → install → 版本 → 审计 */
|
|
24
|
+
publish(candidateId: string, input: {
|
|
25
|
+
actor: string;
|
|
26
|
+
}): Promise<SkillManifest>;
|
|
27
|
+
/**
|
|
28
|
+
* 真实回滚(受审批保护:仅经显式 actor 调用并全程审计):
|
|
29
|
+
* 版本归档解包 → staging 校验 → 原子安装(复用安装管线 swap)→ 追加新版本 + 审计。
|
|
30
|
+
* RepairPlanner 的 rollback 选项(targetVersionId)经本方法执行。
|
|
31
|
+
*/
|
|
32
|
+
applyRollback(skillName: string, versionId: string, input: {
|
|
33
|
+
actor: string;
|
|
34
|
+
reason?: string;
|
|
35
|
+
}): Promise<SkillManifest>;
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/evaluation/evaluationRuntime.d.ts
|
|
39
|
+
/**
|
|
40
|
+
* 治理评估专用 runtime 装配(不可信技能试用路径):
|
|
41
|
+
* 默认注入 ProcessSandboxExecutor(fork + --permission 真实进程隔离;子进程
|
|
42
|
+
* env 默认清空防密钥泄露,需透传时经 ProcessSandboxOptions.envWhitelist 显式放行)。
|
|
43
|
+
* 可配置 executor 切回 SandboxedScriptExecutor(worker_threads 能力面收敛形态,
|
|
44
|
+
* 非安全边界;envWhitelist 同样适用于该执行器)。
|
|
45
|
+
*/
|
|
46
|
+
declare function createEvaluationRuntime(deps: WebSkillRuntimeDeps & {
|
|
47
|
+
executor?: ScriptExecutor;
|
|
48
|
+
}): WebSkillRuntime;
|
|
49
|
+
//#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 };
|