@webskill/sdk 0.14.0 → 0.15.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.
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +2442 -3
- package/dist/{dist-Bfga1TmS.js → approval-BnLLCOG0.js} +235 -2932
- package/dist/browser.d.ts +106 -5
- package/dist/browser.js +364 -10
- package/dist/{openUiLibrary-BKXW7Iwx-DjvEnMlJ.js → dist-CTsxblSD.js} +496 -28
- package/dist/{echarts-De78wXqV.js → echarts-BE7oV_Dl.js} +1 -1
- package/dist/{env-8cY40DXB-CGnEVZby.js → env-Bj1MI2Ww.js} +1 -1
- package/dist/errors-BDZNpC13.js +22 -0
- package/dist/{eventTypes-FllCrX-Z-DNDeHWoG.js → eventTypes-Y07N8IAC.js} +14 -2
- package/dist/external-_ZRQe-V9.js +53 -0
- package/dist/governance.d.ts +15 -3
- package/dist/governance.js +86 -4
- package/dist/{index-DQwGvHAI.d.ts → index-CQYo4tcT.d.ts} +85 -6
- package/dist/{index-sd-gVKey.d.ts → index-CU2md8R1.d.ts} +26 -18
- package/dist/{index-CWoKOFBP.d.ts → index-Oc3H89TJ.d.ts} +159 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1001 -5
- package/dist/kind-DxgS8LM-.js +77 -0
- package/dist/linkedDocument-xNXF-z8n.js +94 -0
- package/dist/llm-B7lLH0ZI.js +1767 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +41 -4
- package/dist/memoryArtifactStore-D6dLeY55.js +48 -0
- package/dist/miniChart-owdCdaw-.js +533 -0
- package/dist/node.d.ts +3 -3
- package/dist/node.js +106 -9
- package/dist/openUiLibrary-CY_ADoe0.js +30 -0
- package/dist/openUiSpecLang-DuOCdw9G.js +1849 -0
- package/dist/pathSecurity-B1owvJAF.js +65 -0
- package/dist/processSandboxEntry.js +5 -1
- package/dist/renderResult-D9Q-Vu2x.js +143 -0
- package/dist/{rolldown-runtime-BOF7iYI8.js → rolldown-runtime-BHkdefai.js} +1 -2
- package/dist/sandboxWorkerEntry.js +5 -1
- package/dist/{dist-D5YhlCdY.js → skill-CAJMsLod.js} +44 -372
- package/dist/{skillVersionStore-D-qHk9ZE-C0OFDTQY.d.ts → skillVersionStore-B24Jjjry-C4zomhMZ.d.ts} +14 -2
- package/dist/surface-DVGiCmwq.js +145 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +64 -3
- package/dist/{types-C3V6lAeO-BgeOvc1Y.d.ts → types-C3V6lAeO-BIf7UB2e.d.ts} +17 -1
- package/dist/types-TUydnxaj.js +78 -0
- package/dist/ui-react.d.ts +12 -5
- package/dist/ui-react.js +128548 -4729
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +11 -2
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +1254 -3
- package/dist/urlSafety-CiSuCJvX.js +65 -0
- package/dist/webSkillApi-DOOyz2G5.js +106 -0
- package/dist/{webskillLitCatalog-D_zCqeQF-swXsWoAe.js → webskillLitCatalog-DSqVFQjK.js} +11 -3
- package/package.json +1 -1
- package/dist/catalogComponents-BgAJN0p8-Cr55ouOg.js +0 -124384
- package/dist/client-BCM6Z3yq-qUQNkKrK.js +0 -7787
- package/dist/dist-BnqAkSS6.js +0 -2384
- package/dist/dist-CiaDIqkV.js +0 -3509
- package/dist/dist-DxyxmXPU-DGC-dpXf.js +0 -5621
- package/dist/memoryArtifactStore-52Zn9npI-BxtUkrgV.js +0 -86
- package/dist/stdio-CFMoANJJ-BxrTeXh7.js +0 -31
- package/dist/testing-Cm8MseLF.js +0 -142
- package/dist/types-WovEf4ED-CZSDiiBU.js +0 -6215
package/dist/node.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
1
|
+
import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
2
|
+
import { A as SKILL_MANIFEST_FILE, D as verifySkillSignature, M as buildManifest, O as MANIFEST_EXCLUDED_FILES, P as verifyManifest, b as parseSkillMarkdown, c as unzipWithLimits, f as SKILL_PACK_FILE, k as SKILLS_LOCKFILE, m as parseSkillPackManifest, o as readResponseWithLimit, p as exportSkills, s as resolveArchiveLimits, t as validateSkills, w as readSkillSignature, y as isValidSkillName } from "./skill-CAJMsLod.js";
|
|
3
|
+
import { a as atomicWriteText, o as isAtomicTempPath, r as resolveInsideRoot, t as assertSafePathSegment } from "./pathSecurity-B1owvJAF.js";
|
|
4
|
+
import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
|
|
5
|
+
import { B as createScriptContext, a as networkPolicyLibSource, c as bridgeError, d as FsMemoryStore, f as WebSkillRuntime, l as parseBridgeRequest, r as normalizeToolError, s as UPLOAD_FILES_UNAVAILABLE, t as CapabilityApproval, u as FsArtifactStore } from "./approval-BnLLCOG0.js";
|
|
6
|
+
import { n as normalizeToolContent } from "./external-_ZRQe-V9.js";
|
|
7
|
+
import { i as probeLlmCapabilities } from "./env-Bj1MI2Ww.js";
|
|
8
|
+
import { t as AUDIT_EVENT_TYPES } from "./eventTypes-Y07N8IAC.js";
|
|
5
9
|
import { createRequire } from "node:module";
|
|
6
10
|
import { unzipSync, zipSync } from "fflate";
|
|
7
11
|
import { existsSync, promises, realpathSync } from "node:fs";
|
|
@@ -15,7 +19,7 @@ import { execFile, fork, spawn } from "node:child_process";
|
|
|
15
19
|
import { createInterface } from "node:readline/promises";
|
|
16
20
|
import { createHash } from "node:crypto";
|
|
17
21
|
|
|
18
|
-
//#region ../node/
|
|
22
|
+
//#region ../node/src/fs/nodeFs.ts
|
|
19
23
|
const toPlatform$4 = (p) => p.split("/").join(path.sep);
|
|
20
24
|
const toPosix = (p) => p.split(path.sep).join("/");
|
|
21
25
|
const isEnoent = (e) => typeof e === "object" && e !== null && e.code === "ENOENT";
|
|
@@ -152,6 +156,9 @@ var NodeFS = class NodeFS {
|
|
|
152
156
|
return e;
|
|
153
157
|
}
|
|
154
158
|
};
|
|
159
|
+
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region ../node/src/executor/nodeScriptExecutor.ts
|
|
155
162
|
const baseName$2 = (p) => p.split("/").pop() ?? p;
|
|
156
163
|
/**
|
|
157
164
|
* 进程内脚本执行器。接口按沙箱语义设计(context 无隐式宿主访问),
|
|
@@ -295,6 +302,9 @@ var NodeScriptExecutor = class {
|
|
|
295
302
|
};
|
|
296
303
|
}
|
|
297
304
|
};
|
|
305
|
+
|
|
306
|
+
//#endregion
|
|
307
|
+
//#region ../node/src/executor/sandboxedScriptExecutor.ts
|
|
298
308
|
const baseName$1 = (p) => p.split("/").pop() ?? p;
|
|
299
309
|
const toPlatform$3 = (p) => p.split("/").join(path.sep);
|
|
300
310
|
/**
|
|
@@ -396,7 +406,8 @@ var SandboxedScriptExecutor = class {
|
|
|
396
406
|
skillName: context.skillName,
|
|
397
407
|
runId: context.runId,
|
|
398
408
|
args,
|
|
399
|
-
scriptSource: await this.#fs.readText(scriptPath)
|
|
409
|
+
scriptSource: await this.#fs.readText(scriptPath),
|
|
410
|
+
...context.readUploadFile ? { uploadFiles: true } : {}
|
|
400
411
|
}, timeoutMs, (request) => this.#handleBridge(request, context), (host) => context.onWarning?.(`Network request blocked by sandbox network policy: ${host}`));
|
|
401
412
|
if (!result.ok) {
|
|
402
413
|
const stderrSummary = result.stderr?.length ? ` | stderr: ${result.stderr.join(" | ").slice(0, 500)}` : "";
|
|
@@ -561,12 +572,29 @@ var SandboxedScriptExecutor = class {
|
|
|
561
572
|
value: await context.confirm(request.message)
|
|
562
573
|
};
|
|
563
574
|
}
|
|
575
|
+
case "listUploadFiles":
|
|
576
|
+
if (!context.listUploadFiles) return bridgeError(request.id, "TOOL_UNSUPPORTED", UPLOAD_FILES_UNAVAILABLE);
|
|
577
|
+
return {
|
|
578
|
+
id: request.id,
|
|
579
|
+
ok: true,
|
|
580
|
+
value: await context.listUploadFiles()
|
|
581
|
+
};
|
|
582
|
+
case "readUploadFile":
|
|
583
|
+
if (!context.readUploadFile) return bridgeError(request.id, "TOOL_UNSUPPORTED", UPLOAD_FILES_UNAVAILABLE);
|
|
584
|
+
return {
|
|
585
|
+
id: request.id,
|
|
586
|
+
ok: true,
|
|
587
|
+
value: Array.from(await context.readUploadFile(request.fileId))
|
|
588
|
+
};
|
|
564
589
|
}
|
|
565
590
|
} catch (e) {
|
|
566
591
|
return bridgeError(request.id, e instanceof WebSkillError ? e.code : "TOOL_EXECUTION_FAILED", messageOf(e));
|
|
567
592
|
}
|
|
568
593
|
}
|
|
569
594
|
};
|
|
595
|
+
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region ../node/src/executor/processSandboxExecutor.ts
|
|
570
598
|
const baseName = (p) => p.split("/").pop() ?? p;
|
|
571
599
|
const toPlatform$2 = (p) => p.split("/").join(path.sep);
|
|
572
600
|
const NETWORK_POLICY_LIB = networkPolicyLibSource();
|
|
@@ -777,7 +805,8 @@ var ProcessSandboxExecutor = class {
|
|
|
777
805
|
runId: context.runId,
|
|
778
806
|
args,
|
|
779
807
|
scriptSource: await this.#fs.readText(scriptPath),
|
|
780
|
-
scratchDir: slot.artifactDir
|
|
808
|
+
scratchDir: slot.artifactDir,
|
|
809
|
+
...context.readUploadFile ? { uploadFiles: true } : {}
|
|
781
810
|
}, timeoutMs, (request) => this.#handleBridge(request, context), (host) => context.onWarning?.(`Network request blocked by sandbox network policy: ${host}`));
|
|
782
811
|
if (!result.ok) {
|
|
783
812
|
const stderrSummary = result.stderr?.length ? ` | stderr: ${result.stderr.join(" | ").slice(0, 500)}` : "";
|
|
@@ -938,12 +967,29 @@ var ProcessSandboxExecutor = class {
|
|
|
938
967
|
value: await context.confirm(request.message)
|
|
939
968
|
};
|
|
940
969
|
}
|
|
970
|
+
case "listUploadFiles":
|
|
971
|
+
if (!context.listUploadFiles) return bridgeError(request.id, "TOOL_UNSUPPORTED", UPLOAD_FILES_UNAVAILABLE);
|
|
972
|
+
return {
|
|
973
|
+
id: request.id,
|
|
974
|
+
ok: true,
|
|
975
|
+
value: await context.listUploadFiles()
|
|
976
|
+
};
|
|
977
|
+
case "readUploadFile":
|
|
978
|
+
if (!context.readUploadFile) return bridgeError(request.id, "TOOL_UNSUPPORTED", UPLOAD_FILES_UNAVAILABLE);
|
|
979
|
+
return {
|
|
980
|
+
id: request.id,
|
|
981
|
+
ok: true,
|
|
982
|
+
value: Array.from(await context.readUploadFile(request.fileId))
|
|
983
|
+
};
|
|
941
984
|
}
|
|
942
985
|
} catch (e) {
|
|
943
986
|
return bridgeError(request.id, e instanceof WebSkillError ? e.code : "TOOL_EXECUTION_FAILED", messageOf(e));
|
|
944
987
|
}
|
|
945
988
|
}
|
|
946
989
|
};
|
|
990
|
+
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region ../node/src/schema/oxcSchemaInferer.ts
|
|
947
993
|
const require_ = createRequire(import.meta.url);
|
|
948
994
|
let parseSyncCache;
|
|
949
995
|
function loadParseSync() {
|
|
@@ -1126,6 +1172,9 @@ var OxcSchemaInferer = class {
|
|
|
1126
1172
|
return inferFromJsDoc(jsdoc.value, mapper, reparse);
|
|
1127
1173
|
}
|
|
1128
1174
|
};
|
|
1175
|
+
|
|
1176
|
+
//#endregion
|
|
1177
|
+
//#region ../node/src/artifacts/fileArtifactStore.ts
|
|
1129
1178
|
/**
|
|
1130
1179
|
* FileArtifactStore:兼容别名,语义同阶段 2-4。
|
|
1131
1180
|
* 实现已上移到 runtime 的 FsArtifactStore;node 侧保留 NodeFS 默认值。
|
|
@@ -1138,6 +1187,9 @@ var FileArtifactStore = class extends FsArtifactStore {
|
|
|
1138
1187
|
});
|
|
1139
1188
|
}
|
|
1140
1189
|
};
|
|
1190
|
+
|
|
1191
|
+
//#endregion
|
|
1192
|
+
//#region ../node/src/memory/fileMemoryStore.ts
|
|
1141
1193
|
/**
|
|
1142
1194
|
* FileMemoryStore:兼容别名,语义同阶段 3。
|
|
1143
1195
|
* 实现已上移到 runtime 的 FsMemoryStore;node 侧保留 NodeFS 默认值。
|
|
@@ -1150,6 +1202,9 @@ var FileMemoryStore = class extends FsMemoryStore {
|
|
|
1150
1202
|
});
|
|
1151
1203
|
}
|
|
1152
1204
|
};
|
|
1205
|
+
|
|
1206
|
+
//#endregion
|
|
1207
|
+
//#region ../node/src/ui/cliUiBridge.ts
|
|
1153
1208
|
/**
|
|
1154
1209
|
* 命令行 UiBridge:ask→问答,confirm→y/n(带默认值),
|
|
1155
1210
|
* form→逐字段提示(显示默认值与必填标记),select→编号列表,
|
|
@@ -1279,6 +1334,9 @@ var CliUiBridge = class {
|
|
|
1279
1334
|
return new Promise((resolve) => this.#waiters.push(resolve));
|
|
1280
1335
|
}
|
|
1281
1336
|
};
|
|
1337
|
+
|
|
1338
|
+
//#endregion
|
|
1339
|
+
//#region ../node/src/skillManagement/extract.ts
|
|
1282
1340
|
const toPlatform$1 = (p) => p.split("/").join(path.sep);
|
|
1283
1341
|
const isZipArchive = (data) => data.length > 1 && data[0] === 80 && data[1] === 75;
|
|
1284
1342
|
let tarModule$1;
|
|
@@ -1330,6 +1388,9 @@ async function extractTarFile(archivePath, destRoot, limits) {
|
|
|
1330
1388
|
throw new WebSkillError("INSTALL_FAILED", `Failed to extract tar archive: ${messageOf(e)}`, e);
|
|
1331
1389
|
}
|
|
1332
1390
|
}
|
|
1391
|
+
|
|
1392
|
+
//#endregion
|
|
1393
|
+
//#region ../node/src/skillManagement/fsUtils.ts
|
|
1333
1394
|
/** 递归列出目录内全部文件(相对路径,posix 分隔,不含目录条目;原子写中断残留的 `.tmp-*` 不计入) */
|
|
1334
1395
|
async function listFiles(fs, root, prefix = "") {
|
|
1335
1396
|
const out = [];
|
|
@@ -1373,6 +1434,9 @@ async function removeDirQuiet(fs, dir) {
|
|
|
1373
1434
|
if (await fs.exists(dir)) await fs.remove(dir, { recursive: true });
|
|
1374
1435
|
} catch {}
|
|
1375
1436
|
}
|
|
1437
|
+
|
|
1438
|
+
//#endregion
|
|
1439
|
+
//#region ../node/src/skillManagement/export/archiveExporter.ts
|
|
1376
1440
|
let tarModule;
|
|
1377
1441
|
async function loadTar() {
|
|
1378
1442
|
tarModule ??= await import("tar").catch((e) => {
|
|
@@ -1427,6 +1491,9 @@ async function readArchiveManifest(fs, archivePath) {
|
|
|
1427
1491
|
if (manifestText === void 0) throw notFound();
|
|
1428
1492
|
return JSON.parse(manifestText);
|
|
1429
1493
|
}
|
|
1494
|
+
|
|
1495
|
+
//#endregion
|
|
1496
|
+
//#region ../node/src/skillManagement/installers/exec.ts
|
|
1430
1497
|
const _execFileP = promisify(execFile);
|
|
1431
1498
|
/**
|
|
1432
1499
|
* 跨平台执行命令:Windows 下对 npm 等 cmd 包装的命令通过 cmd.exe 代理执行,
|
|
@@ -1445,6 +1512,9 @@ async function execFileP(command, args, options = {}) {
|
|
|
1445
1512
|
function commandFailed(command, e) {
|
|
1446
1513
|
return new WebSkillError("INSTALL_FAILED", `Failed to run ${command}: ${e?.code === "ENOENT" ? `command "${command}" not found on this system` : messageOf(e)}`, e);
|
|
1447
1514
|
}
|
|
1515
|
+
|
|
1516
|
+
//#endregion
|
|
1517
|
+
//#region ../node/src/skillManagement/installers/gitInstaller.ts
|
|
1448
1518
|
/** git url 协议白名单:https:// 与 git@ SCP 形式;无 scheme 的本地路径放行(dev 工作流);
|
|
1449
1519
|
* 其余显式协议(ext::/file:// 等)一律拒绝 */
|
|
1450
1520
|
function assertGitUrlSafe(url) {
|
|
@@ -1491,9 +1561,15 @@ async function stageGit(source, ctx) {
|
|
|
1491
1561
|
}
|
|
1492
1562
|
};
|
|
1493
1563
|
}
|
|
1564
|
+
|
|
1565
|
+
//#endregion
|
|
1566
|
+
//#region ../node/src/skillManagement/checksum.ts
|
|
1494
1567
|
function sha256Hex(data) {
|
|
1495
1568
|
return createHash("sha256").update(data).digest("hex");
|
|
1496
1569
|
}
|
|
1570
|
+
|
|
1571
|
+
//#endregion
|
|
1572
|
+
//#region ../node/src/skillManagement/installers/httpArchiveInstaller.ts
|
|
1497
1573
|
/** 重定向跳数上限(SSRF 防护:逐跳重新校验目标 URL) */
|
|
1498
1574
|
const MAX_REDIRECT_HOPS = 3;
|
|
1499
1575
|
/**
|
|
@@ -1561,6 +1637,9 @@ async function stageHttp(source, ctx, expectedSha256) {
|
|
|
1561
1637
|
};
|
|
1562
1638
|
throw new WebSkillError("INSTALL_FAILED", "Archive does not contain a SKILL.md at its root or in a single top-level directory");
|
|
1563
1639
|
}
|
|
1640
|
+
|
|
1641
|
+
//#endregion
|
|
1642
|
+
//#region ../node/src/skillManagement/installers/localInstaller.ts
|
|
1564
1643
|
/** local 源:校验源目录存在,拷贝到 staging */
|
|
1565
1644
|
async function stageLocal(source, ctx) {
|
|
1566
1645
|
if (!await ctx.fs.exists(source.path)) throw new WebSkillError("INSTALL_FAILED", `Local skill directory not found: ${source.path}`);
|
|
@@ -1571,6 +1650,9 @@ async function stageLocal(source, ctx) {
|
|
|
1571
1650
|
source
|
|
1572
1651
|
};
|
|
1573
1652
|
}
|
|
1653
|
+
|
|
1654
|
+
//#endregion
|
|
1655
|
+
//#region ../node/src/skillManagement/installers/npmInstaller.ts
|
|
1574
1656
|
/** npm 包名(@scope/name 或 name,小写字母数字 . _ - /)与版本(semver 或 dist-tag)正则 */
|
|
1575
1657
|
const PACKAGE_NAME_RE = /^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/;
|
|
1576
1658
|
const VERSION_RE = /^[a-z0-9._~^>=<x*+-]+$/i;
|
|
@@ -1629,6 +1711,9 @@ async function stageNpm(source, ctx) {
|
|
|
1629
1711
|
}
|
|
1630
1712
|
};
|
|
1631
1713
|
}
|
|
1714
|
+
|
|
1715
|
+
//#endregion
|
|
1716
|
+
//#region ../node/src/skillManagement/lockfile.ts
|
|
1632
1717
|
const emptyLockfile = () => ({
|
|
1633
1718
|
schemaVersion: 1,
|
|
1634
1719
|
skills: {}
|
|
@@ -1661,6 +1746,9 @@ async function removeLockEntry(fs, managedRoot, name) {
|
|
|
1661
1746
|
async function writeLockfileAtomic(fs, managedRoot, lockfile) {
|
|
1662
1747
|
await atomicWriteText(fs, `${managedRoot}/${SKILLS_LOCKFILE}`, JSON.stringify(lockfile, null, 2));
|
|
1663
1748
|
}
|
|
1749
|
+
|
|
1750
|
+
//#endregion
|
|
1751
|
+
//#region ../node/src/skillManagement/manifest.ts
|
|
1664
1752
|
/** 递归收集技能目录内的文件(相对路径,posix 分隔) */
|
|
1665
1753
|
async function walkFiles(fs, root, prefix = "") {
|
|
1666
1754
|
const out = [];
|
|
@@ -1712,6 +1800,9 @@ async function verifyIntegrity(fs, skillRoot) {
|
|
|
1712
1800
|
for (const rel of actualFiles) actualHashes.set(rel, sha256Hex(await fs.readBinary(`${skillRoot}/${rel}`)));
|
|
1713
1801
|
return verifyManifest(manifest, actualHashes, actualFiles);
|
|
1714
1802
|
}
|
|
1803
|
+
|
|
1804
|
+
//#endregion
|
|
1805
|
+
//#region ../node/src/skillManagement/skillManager.ts
|
|
1715
1806
|
/**
|
|
1716
1807
|
* 验签失败不能被折叠成 INSTALL_FAILED:四种失败的宿主处置完全不同
|
|
1717
1808
|
* (引导选策略 / 提示重下 / 引导添加密钥 / 安全事件),见 design 03 §3.1。
|
|
@@ -2020,9 +2111,12 @@ var SkillManager = class {
|
|
|
2020
2111
|
return options.outPath;
|
|
2021
2112
|
}
|
|
2022
2113
|
};
|
|
2114
|
+
|
|
2115
|
+
//#endregion
|
|
2116
|
+
//#region ../node/src/mcp/connectStdioEndpoint.ts
|
|
2023
2117
|
async function loadMcpSdk() {
|
|
2024
2118
|
try {
|
|
2025
|
-
const [client, stdio] = await Promise.all([import("
|
|
2119
|
+
const [client, stdio] = await Promise.all([import("@modelcontextprotocol/sdk/client/index.js"), import("@modelcontextprotocol/sdk/shared/stdio.js")]);
|
|
2026
2120
|
return {
|
|
2027
2121
|
Client: client.Client,
|
|
2028
2122
|
ReadBuffer: stdio.ReadBuffer,
|
|
@@ -2238,7 +2332,7 @@ async function connectStdioEndpoint(registry, config) {
|
|
|
2238
2332
|
}
|
|
2239
2333
|
|
|
2240
2334
|
//#endregion
|
|
2241
|
-
//#region ../governance/
|
|
2335
|
+
//#region ../governance/src/approval/approvalWorkflow.ts
|
|
2242
2336
|
/** 审批工作流:review(UiBridge confirm 真实接线)/ publish(校验→安装→版本→审计) */
|
|
2243
2337
|
var ApprovalWorkflow = class {
|
|
2244
2338
|
#policy;
|
|
@@ -2386,6 +2480,9 @@ var ApprovalWorkflow = class {
|
|
|
2386
2480
|
}
|
|
2387
2481
|
}
|
|
2388
2482
|
};
|
|
2483
|
+
|
|
2484
|
+
//#endregion
|
|
2485
|
+
//#region ../governance/src/evaluation/evaluationRuntime.ts
|
|
2389
2486
|
/**
|
|
2390
2487
|
* 治理评估专用 runtime 装配(不可信技能试用路径):
|
|
2391
2488
|
* 默认注入 ProcessSandboxExecutor(fork + --permission 真实进程隔离;子进程
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { h as uiCatalog } from "./openUiSpecLang-DuOCdw9G.js";
|
|
2
|
+
import { t as CatalogNode } from "./ui-react.js";
|
|
3
|
+
import { Renderer, createLibrary, defineComponent } from "./dist-CTsxblSD.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region ../ui-react/src/catalog/openUiLibrary.tsx
|
|
8
|
+
const propsFor = (props, container) => container ? props.extend({ children: z.array(z.any()).optional() }) : props;
|
|
9
|
+
const components = uiCatalog.components.map((def) => defineComponent({
|
|
10
|
+
name: def.name,
|
|
11
|
+
description: def.description,
|
|
12
|
+
props: propsFor(def.props, def.children !== void 0),
|
|
13
|
+
component: ((input) => /* @__PURE__ */ jsx(CatalogNode, {
|
|
14
|
+
name: def.name,
|
|
15
|
+
props: input.props,
|
|
16
|
+
children: input.renderNode(input.props["children"])
|
|
17
|
+
}))
|
|
18
|
+
}));
|
|
19
|
+
/**
|
|
20
|
+
* catalog 的 OpenUI 投影:`defineComponent` 复用同一份 zod schema 与描述,
|
|
21
|
+
* 渲染实现取自共享的 ui-kit 组件表,因此 OpenUI 档渲染的是我们的设计系统而不是 OpenUI 默认组件。
|
|
22
|
+
*/
|
|
23
|
+
const webskillOpenUiLibrary = createLibrary({
|
|
24
|
+
id: "webskill-shadcn",
|
|
25
|
+
components
|
|
26
|
+
});
|
|
27
|
+
const OPEN_UI_COMPONENTS = Object.keys(webskillOpenUiLibrary.components);
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
export { OPEN_UI_COMPONENTS, Renderer, webskillOpenUiLibrary };
|