@webskill/sdk 0.27.1 → 0.29.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 +901 -120
- package/dist/{approval-BSwffz8P.js → approval-DnUytrkq.js} +7 -2
- package/dist/browser.d.ts +12 -12
- package/dist/browser.js +527 -69
- package/dist/{geometry-BXMPNuM6.js → geometry-QmrkJw1_.js} +13 -2
- package/dist/governance.d.ts +3 -3
- package/dist/{index--GvzV6Lq.d.ts → index-B5zHZDNA.d.ts} +91 -6
- package/dist/{index-C8-9-8zo.d.ts → index-C3t1jKAs.d.ts} +41 -13
- package/dist/{index-D6eSrEi5.d.ts → index-Cngzg2WS.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +12 -7
- package/dist/{linkedDocument-0iiVPd5t.js → linkedDocument-GE-VV_Gj.js} +112 -2
- package/dist/mcp.d.ts +2 -2
- package/dist/{miniChart-D0nYMzz8.js → miniChart-k95Dpy0q.js} +82 -4
- package/dist/node.d.ts +4 -3
- package/dist/node.js +19 -2
- package/dist/{openUiLibrary-CxtrnX54.js → openUiLibrary-BnhYUlqY.js} +1 -1
- package/dist/{openUiSpecLang-DIcLcybq.js → openUiSpecLang-C8qNOxzA.js} +432 -19
- package/dist/{renderResult-D9Q-Vu2x.js → renderResult-2v3WQzs_.js} +5 -2
- package/dist/{skillVersionStore-S4_HJ_Fl-Ds97pwm5.d.ts → skillVersionStore-S4_HJ_Fl-AiNsSSdO.d.ts} +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/{types-CpDRZ0rA-CFQ-vdKz.d.ts → types-wKp3YBSM-D7w-ZbsB.d.ts} +8 -3
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +5767 -793
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui-vue.js +1 -1
- package/dist/ui.d.ts +4 -4
- package/dist/ui.js +13 -7
- package/dist/{webSkillApi-C_7CTwtB.js → webSkillApi-TeWPPFDn.js} +1 -1
- package/dist/{webskillLitCatalog-BPyjYuRT.js → webskillLitCatalog-MfiLE5aq.js} +41 -2
- package/package.json +3 -1
- package/dist/kind-Dc8x0HWz.js +0 -110
|
@@ -2,6 +2,116 @@ import { t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
|
2
2
|
import { unzipSync, zipSync } from "fflate";
|
|
3
3
|
import writeXlsxFile from "write-excel-file/universal";
|
|
4
4
|
|
|
5
|
+
//#region ../core/src/attachment/kind.ts
|
|
6
|
+
/** 可作为图片分片外发的 MIME 类型 @experimental */
|
|
7
|
+
const IMAGE_MIME_TYPES = [
|
|
8
|
+
"image/png",
|
|
9
|
+
"image/jpeg",
|
|
10
|
+
"image/webp",
|
|
11
|
+
"image/gif"
|
|
12
|
+
];
|
|
13
|
+
/**
|
|
14
|
+
* 可按文本读取的扩展名。accept 白名单与判定白名单共用这一份——
|
|
15
|
+
* 0.5.x 两处不一致,`log`/`yaml`/`yml` 能通过判定却在文件选择器里选不到。
|
|
16
|
+
*/
|
|
17
|
+
const TEXT_EXTENSIONS = [
|
|
18
|
+
"txt",
|
|
19
|
+
"md",
|
|
20
|
+
"csv",
|
|
21
|
+
"json",
|
|
22
|
+
"log",
|
|
23
|
+
"yaml",
|
|
24
|
+
"yml"
|
|
25
|
+
];
|
|
26
|
+
/** 非文本非图片但仍可整体外发的类型(provider 的 file 分片) @experimental */
|
|
27
|
+
const FILE_MIME_TYPES = ["application/pdf"];
|
|
28
|
+
/**
|
|
29
|
+
* 需要**客户端先抽取成文本**才能外发的类型(FR-23.9 / 0.13.0 FR-12.5 / 0.22.0 分册 18)。
|
|
30
|
+
* 不走直通的 `file`:docx / xlsx / pptx 发给 provider 会被当成二进制垃圾。
|
|
31
|
+
*/
|
|
32
|
+
const DOCX_MIME = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
33
|
+
const XLS_MIME = "application/vnd.ms-excel";
|
|
34
|
+
const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
35
|
+
const PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
36
|
+
/** 文本类附件进模型上下文的字符上限(0.6.0) @experimental */
|
|
37
|
+
const ATTACHMENT_TEXT_LIMIT = 32 * 1024;
|
|
38
|
+
/**
|
|
39
|
+
* DWG 图纸的 MIME。没有官方注册值,各家各发一套,浏览器上传时更常见的是空串。
|
|
40
|
+
* @experimental
|
|
41
|
+
*/
|
|
42
|
+
const DWG_MIME_TYPES = [
|
|
43
|
+
"image/vnd.dwg",
|
|
44
|
+
"application/acad",
|
|
45
|
+
"application/x-acad",
|
|
46
|
+
"application/dwg",
|
|
47
|
+
"application/x-dwg",
|
|
48
|
+
"drawing/dwg"
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* 只存字节、不进上下文的扩展名。仍然是**白名单制**:
|
|
52
|
+
* 新增 `binary` 类别不等于任意二进制放行(AC-19.18)。
|
|
53
|
+
* @experimental
|
|
54
|
+
*/
|
|
55
|
+
const BINARY_EXTENSIONS = ["dwg"];
|
|
56
|
+
const TEXT_EXTENSION_SET = new Set(TEXT_EXTENSIONS);
|
|
57
|
+
const IMAGE_MIME_SET = new Set(IMAGE_MIME_TYPES);
|
|
58
|
+
const FILE_MIME_SET = new Set(FILE_MIME_TYPES);
|
|
59
|
+
const EXTRACTED_MIME_SET = /* @__PURE__ */ new Set([
|
|
60
|
+
DOCX_MIME,
|
|
61
|
+
XLS_MIME,
|
|
62
|
+
XLSX_MIME,
|
|
63
|
+
PPTX_MIME
|
|
64
|
+
]);
|
|
65
|
+
const EXTRACTED_EXTENSION_SET = /* @__PURE__ */ new Set([
|
|
66
|
+
"docx",
|
|
67
|
+
"xls",
|
|
68
|
+
"xlsx",
|
|
69
|
+
"pptx"
|
|
70
|
+
]);
|
|
71
|
+
const BINARY_MIME_SET = new Set(DWG_MIME_TYPES);
|
|
72
|
+
const BINARY_EXTENSION_SET = new Set(BINARY_EXTENSIONS);
|
|
73
|
+
/** 下载与上传都常把认不出的类型标成它,此时只能看扩展名 */
|
|
74
|
+
const OPAQUE_MIME = "application/octet-stream";
|
|
75
|
+
function extensionOf(fileName) {
|
|
76
|
+
return fileName.split(".").pop()?.toLowerCase() ?? "";
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 三种待抽取格式共用 `document-text` 这一种 kind,选抽取器时要按格式再分一次。
|
|
80
|
+
* 下载列表与上传入口必须得出同一结论(AC-20.17),所以只能在这里一份。
|
|
81
|
+
* @experimental
|
|
82
|
+
*/
|
|
83
|
+
function extractedDocumentFormat(contentType, fileName) {
|
|
84
|
+
const type = contentType.toLowerCase();
|
|
85
|
+
const ext = extensionOf(fileName);
|
|
86
|
+
if (type === "" || type === OPAQUE_MIME) return ext === "xls" || ext === "xlsx" ? "xlsx" : ext === "pptx" ? "pptx" : "docx";
|
|
87
|
+
if (type === "application/vnd.ms-excel" || type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") return "xlsx";
|
|
88
|
+
if (type === "application/vnd.openxmlformats-officedocument.presentationml.presentation") return "pptx";
|
|
89
|
+
return "docx";
|
|
90
|
+
}
|
|
91
|
+
/** 分类集中一处,不散落在各 UI 分支里 @experimental */ function classifyAttachment(contentType, fileName) {
|
|
92
|
+
const type = contentType.toLowerCase();
|
|
93
|
+
if (IMAGE_MIME_SET.has(type)) return "image";
|
|
94
|
+
if (BINARY_MIME_SET.has(type)) return "binary";
|
|
95
|
+
if (EXTRACTED_MIME_SET.has(type)) return "document-text";
|
|
96
|
+
if (FILE_MIME_SET.has(type)) return "file";
|
|
97
|
+
if (type.startsWith("text/") || type === "application/json") return "text";
|
|
98
|
+
if (type === "" && TEXT_EXTENSION_SET.has(extensionOf(fileName))) return "text";
|
|
99
|
+
if ((type === "" || type === OPAQUE_MIME) && EXTRACTED_EXTENSION_SET.has(extensionOf(fileName))) return "document-text";
|
|
100
|
+
if ((type === "" || type === OPAQUE_MIME) && BINARY_EXTENSION_SET.has(extensionOf(fileName))) return "binary";
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 文本类附件进模型上下文的最终形态。两条入口共用,差别只有出处那一段(0.14.0 D-20-6)。
|
|
104
|
+
* @experimental
|
|
105
|
+
*/
|
|
106
|
+
function formatAttachmentText(input) {
|
|
107
|
+
const limit = input.limit ?? 32768;
|
|
108
|
+
const clipped = input.body.length > limit ? `${input.body.slice(0, limit)}\n[truncated]` : input.body;
|
|
109
|
+
const bodyOnly = input.kind === "document-text" ? ", body text only" : "";
|
|
110
|
+
const from = input.origin === "download" ? ", from this device's downloads" : "";
|
|
111
|
+
return `--- Attachment: ${input.name} (${input.contentType}${bodyOnly}${from}) ---\n${clipped}`;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
5
115
|
//#region ../runtime/src/tools/types.ts
|
|
6
116
|
/**
|
|
7
117
|
* 参与 `toolResultMaxBytes` 截断的分片类型(FR-23.3)。**判据的单一来源。**
|
|
@@ -421,7 +531,7 @@ function isBytesOnlyDocument(mime, url) {
|
|
|
421
531
|
return ((url.split(/[?#]/)[0] ?? "").split(".").pop() ?? "").toLowerCase() === "dwg";
|
|
422
532
|
}
|
|
423
533
|
/** 引擎侧固定流程(§2.3)用到的错误文案,集中一处便于判据引用 */
|
|
424
|
-
const UNSUPPORTED_DOCUMENT_MESSAGE = `Only PDF (${SUPPORTED_DOCUMENT_MIME.pdf}), Word (${SUPPORTED_DOCUMENT_MIME.docx}), Excel (${SUPPORTED_DOCUMENT_MIME.xlsx}), PowerPoint (${SUPPORTED_DOCUMENT_MIME.pptx}) and plain text documents can be read.`;
|
|
534
|
+
const UNSUPPORTED_DOCUMENT_MESSAGE = `Only PDF (${SUPPORTED_DOCUMENT_MIME.pdf}), Word (${SUPPORTED_DOCUMENT_MIME.docx}), Excel (${SUPPORTED_DOCUMENT_MIME.xlsx} or ${XLS_MIME}), PowerPoint (${SUPPORTED_DOCUMENT_MIME.pptx}) and plain text documents can be read.`;
|
|
425
535
|
const READ_LINKED_DOCUMENT_INPUT_SCHEMA = {
|
|
426
536
|
type: "object",
|
|
427
537
|
properties: { url: {
|
|
@@ -455,4 +565,4 @@ function fromBase64(data) {
|
|
|
455
565
|
}
|
|
456
566
|
|
|
457
567
|
//#endregion
|
|
458
|
-
export { DEFAULT_MAX_UPLOAD_FILE_BYTES as _, UNSUPPORTED_DOCUMENT_MESSAGE as a, toBase64 as c, SPREADSHEET_LIMITS as d, SPREADSHEET_MIME_TYPE as f, DEFAULT_MAX_DOCUMENT_TEXT_BYTES as g, DEFAULT_MAX_DOCUMENT_BYTES as h, SUPPORTED_DOCUMENT_MIME as i, encodeSpreadsheet as l, DEFAULT_MAX_DATA_SOURCE_BYTES as m, READ_LINKED_DOCUMENT_TOOL as n, fromBase64 as o, XLSX_UNSUPPORTED as p, READ_LINKED_DOCUMENT_TOOL_NAME as r, isBytesOnlyDocument as s, BYTES_ONLY_DOCUMENT_MIME as t, SPREADSHEET_EXTENSION as u, TEXT_BUDGETED_CONTENT_TYPES as v };
|
|
568
|
+
export { extractedDocumentFormat as A, FILE_MIME_TYPES as C, XLSX_MIME as D, TEXT_EXTENSIONS as E, XLS_MIME as O, DWG_MIME_TYPES as S, PPTX_MIME as T, DEFAULT_MAX_UPLOAD_FILE_BYTES as _, UNSUPPORTED_DOCUMENT_MESSAGE as a, BINARY_EXTENSIONS as b, toBase64 as c, SPREADSHEET_LIMITS as d, SPREADSHEET_MIME_TYPE as f, DEFAULT_MAX_DOCUMENT_TEXT_BYTES as g, DEFAULT_MAX_DOCUMENT_BYTES as h, SUPPORTED_DOCUMENT_MIME as i, formatAttachmentText as j, classifyAttachment as k, encodeSpreadsheet as l, DEFAULT_MAX_DATA_SOURCE_BYTES as m, READ_LINKED_DOCUMENT_TOOL as n, fromBase64 as o, XLSX_UNSUPPORTED as p, READ_LINKED_DOCUMENT_TOOL_NAME as r, isBytesOnlyDocument as s, BYTES_ONLY_DOCUMENT_MIME as t, SPREADSHEET_EXTENSION as u, TEXT_BUDGETED_CONTENT_TYPES as v, IMAGE_MIME_TYPES as w, DOCX_MIME as x, ATTACHMENT_TEXT_LIMIT as y };
|
package/dist/mcp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as JsonSchema, _ as LlmToolSpec, _t as SkillDocument, ht as SkillCatalogEntry } from "./types-
|
|
2
|
-
import { B as ExternalToolSource, Hr as mergeCatalogEntries, Mn as ToolDisclosure, Pn as ToolResult, z as ExternalSkillProvider } from "./index-
|
|
1
|
+
import { X as JsonSchema, _ as LlmToolSpec, _t as SkillDocument, ht as SkillCatalogEntry } from "./types-wKp3YBSM-D7w-ZbsB.js";
|
|
2
|
+
import { B as ExternalToolSource, Hr as mergeCatalogEntries, Mn as ToolDisclosure, Pn as ToolResult, z as ExternalSkillProvider } from "./index-Cngzg2WS.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";
|
|
@@ -300,7 +300,7 @@ function renderMiniMarkdown(text, doc) {
|
|
|
300
300
|
//#endregion
|
|
301
301
|
//#region ../ui/src/chart/miniChart.ts
|
|
302
302
|
/**
|
|
303
|
-
* 轻量 SVG 图表自绘(bar/line/pie,零依赖,三端复用单一来源)。
|
|
303
|
+
* 轻量 SVG 图表自绘(bar/line/pie/bar-line,零依赖,三端复用单一来源)。
|
|
304
304
|
* 全部经 doc.createElementNS 构建(内容来自技能输出,不拼 innerHTML)。
|
|
305
305
|
*/
|
|
306
306
|
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
@@ -442,6 +442,81 @@ function renderLine(chart, svg, doc) {
|
|
|
442
442
|
svg.appendChild(text(doc, px(li), plot.y1 + 12, label, { "text-anchor": "middle" }));
|
|
443
443
|
});
|
|
444
444
|
}
|
|
445
|
+
function renderBarLine(chart, svg, doc) {
|
|
446
|
+
const plot = {
|
|
447
|
+
x0: 30,
|
|
448
|
+
y0: 24,
|
|
449
|
+
x1: 312,
|
|
450
|
+
y1: 164
|
|
451
|
+
};
|
|
452
|
+
const max = maxValue(chart);
|
|
453
|
+
svg.appendChild(el(doc, "line", {
|
|
454
|
+
x1: String(plot.x0),
|
|
455
|
+
y1: String(plot.y0),
|
|
456
|
+
x2: String(plot.x0),
|
|
457
|
+
y2: String(plot.y1),
|
|
458
|
+
stroke: "currentColor",
|
|
459
|
+
"stroke-opacity": "0.35"
|
|
460
|
+
}));
|
|
461
|
+
svg.appendChild(el(doc, "line", {
|
|
462
|
+
x1: String(plot.x0),
|
|
463
|
+
y1: String(plot.y1),
|
|
464
|
+
x2: String(plot.x1),
|
|
465
|
+
y2: String(plot.y1),
|
|
466
|
+
stroke: "currentColor",
|
|
467
|
+
"stroke-opacity": "0.35"
|
|
468
|
+
}));
|
|
469
|
+
if (max <= 0 || chart.labels.length === 0 || chart.series.length === 0) return;
|
|
470
|
+
const typed = chart.series.map((series, index) => ({
|
|
471
|
+
series,
|
|
472
|
+
index,
|
|
473
|
+
kind: series.type ?? (index === 0 ? "bar" : "line")
|
|
474
|
+
}));
|
|
475
|
+
const bars = typed.filter((entry) => entry.kind === "bar");
|
|
476
|
+
const groupWidth = (plot.x1 - plot.x0) / chart.labels.length;
|
|
477
|
+
const barWidth = Math.max(1, groupWidth / Math.max(1, bars.length) * .7);
|
|
478
|
+
for (const [barIndex, entry] of bars.entries()) {
|
|
479
|
+
const color = CHART_PALETTE[entry.index % CHART_PALETTE.length];
|
|
480
|
+
entry.series.data.forEach((value, labelIndex) => {
|
|
481
|
+
if (labelIndex >= chart.labels.length) return;
|
|
482
|
+
const height = (plot.y1 - plot.y0) * value / max;
|
|
483
|
+
const x = plot.x0 + labelIndex * groupWidth + (groupWidth - barWidth * bars.length) / 2 + barIndex * barWidth;
|
|
484
|
+
const y = plot.y1 - height;
|
|
485
|
+
svg.appendChild(el(doc, "rect", {
|
|
486
|
+
x: String(x),
|
|
487
|
+
y: String(y),
|
|
488
|
+
width: String(barWidth),
|
|
489
|
+
height: String(height),
|
|
490
|
+
fill: color,
|
|
491
|
+
"data-series": entry.series.name ?? String(entry.index)
|
|
492
|
+
}));
|
|
493
|
+
});
|
|
494
|
+
}
|
|
495
|
+
const step = chart.labels.length > 1 ? (plot.x1 - plot.x0) / (chart.labels.length - 1) : 0;
|
|
496
|
+
const px = (index) => chart.labels.length > 1 ? plot.x0 + index * step : (plot.x0 + plot.x1) / 2;
|
|
497
|
+
const py = (value) => plot.y1 - (plot.y1 - plot.y0) * value / max;
|
|
498
|
+
for (const entry of typed.filter((candidate) => candidate.kind === "line")) {
|
|
499
|
+
const color = CHART_PALETTE[entry.index % CHART_PALETTE.length];
|
|
500
|
+
const points = entry.series.data.slice(0, chart.labels.length).map((value, index) => `${px(index)},${py(value)}`).join(" ");
|
|
501
|
+
if (points !== "") svg.appendChild(el(doc, "polyline", {
|
|
502
|
+
points,
|
|
503
|
+
fill: "none",
|
|
504
|
+
stroke: color,
|
|
505
|
+
"stroke-width": "1.5"
|
|
506
|
+
}));
|
|
507
|
+
entry.series.data.slice(0, chart.labels.length).forEach((value, index) => {
|
|
508
|
+
svg.appendChild(el(doc, "circle", {
|
|
509
|
+
cx: String(px(index)),
|
|
510
|
+
cy: String(py(value)),
|
|
511
|
+
r: "2",
|
|
512
|
+
fill: color
|
|
513
|
+
}));
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
chart.labels.forEach((label, index) => {
|
|
517
|
+
svg.appendChild(text(doc, px(index), plot.y1 + 12, label, { "text-anchor": "middle" }));
|
|
518
|
+
});
|
|
519
|
+
}
|
|
445
520
|
function renderPie(chart, svg, doc) {
|
|
446
521
|
const data = (chart.series[0]?.data ?? []).slice(0, chart.labels.length);
|
|
447
522
|
const total = data.reduce((sum, v) => sum + (v > 0 ? v : 0), 0);
|
|
@@ -480,8 +555,8 @@ function renderPie(chart, svg, doc) {
|
|
|
480
555
|
});
|
|
481
556
|
}
|
|
482
557
|
/**
|
|
483
|
-
* ChartSpec → SVG(bar 等宽柱 + 值标签;line 折线 + 点;pie 扇形 +
|
|
484
|
-
* mini
|
|
558
|
+
* ChartSpec → SVG(bar 等宽柱 + 值标签;line 折线 + 点;pie 扇形 + 图例;bar-line 柱线叠加;空数据容错)。
|
|
559
|
+
* mini 档只有这四种画法,其余类型走最接近的一种并在图内注明是近似呈现。
|
|
485
560
|
* @stable
|
|
486
561
|
*/
|
|
487
562
|
function renderMiniChart(chart, doc) {
|
|
@@ -506,6 +581,9 @@ function renderMiniChart(chart, doc) {
|
|
|
506
581
|
case "line":
|
|
507
582
|
renderLine(chart, svg, doc);
|
|
508
583
|
break;
|
|
584
|
+
case "bar-line":
|
|
585
|
+
renderBarLine(chart, svg, doc);
|
|
586
|
+
break;
|
|
509
587
|
case "pie":
|
|
510
588
|
renderPie(chart, svg, doc);
|
|
511
589
|
break;
|
|
@@ -513,7 +591,7 @@ function renderMiniChart(chart, doc) {
|
|
|
513
591
|
renderLine(chart, svg, doc);
|
|
514
592
|
break;
|
|
515
593
|
}
|
|
516
|
-
if (chart.kind !== "bar" && chart.kind !== "line" && chart.kind !== "pie") svg.appendChild(text(doc, WIDTH / 2, HEIGHT - 4, `Approximate rendering of "${chart.kind}"`, { "text-anchor": "middle" }));
|
|
594
|
+
if (chart.kind !== "bar" && chart.kind !== "line" && chart.kind !== "pie" && chart.kind !== "bar-line") svg.appendChild(text(doc, WIDTH / 2, HEIGHT - 4, `Approximate rendering of "${chart.kind}"`, { "text-anchor": "middle" }));
|
|
517
595
|
return svg;
|
|
518
596
|
}
|
|
519
597
|
/** A2UI/OpenUI 降级:chart → table(labels 为首列,series 各为一列) */
|
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { G as FileStat, It as VerifyResult, K as FileSystemProvider, N as ArchiveLimits, Ot as SkillsLockfile, Pt as UnsignedPolicy, S as UiBridge, St as SkillManifest, X as JsonSchema, at as SKILL_MANIFEST_FILE, b as RenderResultRequest, c as InteractionResponse, it as SKILLS_LOCKFILE, jt as TrustedKeyStore, q as FileWriteStream, s as InteractionRequest, ut as SignatureAuditSink, vt as SkillInstallSource, xt as SkillManagerPort } from "./types-
|
|
2
|
-
import { $t as SchemaInferer, H as FsArtifactStore, Pn as ToolResult, Tr as createScriptContext, U as FsMemoryStore, b as BridgeCapabilities, en as ScriptExecutionContext, gr as WebSkillRuntimeDeps, hr as WebSkillRuntime, jn as ToolDefinition, m as ApprovalScope, tn as ScriptExecutor, ut as NetworkPolicy } from "./index-
|
|
3
|
-
import { a as AuditLog, f as CandidateSkill, h as CandidateStore, r as ApprovalPolicy, x as SkillVersionStore } from "./skillVersionStore-S4_HJ_Fl-
|
|
1
|
+
import { G as FileStat, It as VerifyResult, K as FileSystemProvider, N as ArchiveLimits, Ot as SkillsLockfile, Pt as UnsignedPolicy, S as UiBridge, St as SkillManifest, X as JsonSchema, at as SKILL_MANIFEST_FILE, b as RenderResultRequest, c as InteractionResponse, it as SKILLS_LOCKFILE, jt as TrustedKeyStore, q as FileWriteStream, s as InteractionRequest, ut as SignatureAuditSink, vt as SkillInstallSource, xt as SkillManagerPort } from "./types-wKp3YBSM-D7w-ZbsB.js";
|
|
2
|
+
import { $t as SchemaInferer, H as FsArtifactStore, Pn as ToolResult, Tr as createScriptContext, U as FsMemoryStore, b as BridgeCapabilities, en as ScriptExecutionContext, gr as WebSkillRuntimeDeps, hr as WebSkillRuntime, jn as ToolDefinition, m as ApprovalScope, tn as ScriptExecutor, ut as NetworkPolicy } from "./index-Cngzg2WS.js";
|
|
3
|
+
import { a as AuditLog, f as CandidateSkill, h as CandidateStore, r as ApprovalPolicy, x as SkillVersionStore } from "./skillVersionStore-S4_HJ_Fl-AiNsSSdO.js";
|
|
4
4
|
import { n as LlmEnvConfig, s as probeLlmCapabilities, t as LlmCapabilities } from "./env-AK3cSMEA-Dli6QU5E.js";
|
|
5
5
|
import { Readable, Writable } from "node:stream";
|
|
6
6
|
//#region ../node/dist/index.d.ts
|
|
@@ -22,6 +22,7 @@ declare class NodeFS implements FileSystemProvider {
|
|
|
22
22
|
writeText(p: string, content: string): Promise<void>;
|
|
23
23
|
appendText(p: string, content: string): Promise<void>;
|
|
24
24
|
readBinary(p: string): Promise<Uint8Array>;
|
|
25
|
+
createReadStream(p: string): Promise<AsyncIterable<Uint8Array>>;
|
|
25
26
|
writeBinary(p: string, content: Uint8Array): Promise<void>;
|
|
26
27
|
/**
|
|
27
28
|
* 分块写入(FR-18.2c)。先写同目录临时文件,`close()` 时 rename 到位:
|
package/dist/node.js
CHANGED
|
@@ -2,8 +2,8 @@ import { n as messageOf, t as WebSkillError } from "./errors-BDZNpC13.js";
|
|
|
2
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-WSUDp6A1.js";
|
|
3
3
|
import { a as atomicWriteBinary, o as atomicWriteText, r as resolveInsideRoot, s as isAtomicTempPath, t as assertSafePathSegment } from "./pathSecurity-CirkQwWP.js";
|
|
4
4
|
import { t as assertRemoteUrlAllowed } from "./urlSafety-CiSuCJvX.js";
|
|
5
|
-
import {
|
|
6
|
-
import { f as
|
|
5
|
+
import { f as SPREADSHEET_MIME_TYPE } from "./linkedDocument-GE-VV_Gj.js";
|
|
6
|
+
import { K 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-DnUytrkq.js";
|
|
7
7
|
import { n as normalizeToolContent } from "./external-_ZRQe-V9.js";
|
|
8
8
|
import { i as probeLlmCapabilities } from "./env-Bj1MI2Ww.js";
|
|
9
9
|
import { t as AUDIT_EVENT_TYPES } from "./eventTypes-DcTQXSV1.js";
|
|
@@ -88,6 +88,23 @@ var NodeFS = class NodeFS {
|
|
|
88
88
|
throw this.#mapError(e, p);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
+
async createReadStream(p) {
|
|
92
|
+
await this.#assertContained(p);
|
|
93
|
+
const handle = await promises.open(toPlatform$4(p), "r").catch((e) => {
|
|
94
|
+
throw this.#mapError(e, p);
|
|
95
|
+
});
|
|
96
|
+
const stream = handle.createReadStream({
|
|
97
|
+
highWaterMark: 1024 * 1024,
|
|
98
|
+
autoClose: false
|
|
99
|
+
});
|
|
100
|
+
return (async function* () {
|
|
101
|
+
try {
|
|
102
|
+
for await (const chunk of stream) yield chunk;
|
|
103
|
+
} finally {
|
|
104
|
+
await handle.close();
|
|
105
|
+
}
|
|
106
|
+
})();
|
|
107
|
+
}
|
|
91
108
|
async writeBinary(p, content) {
|
|
92
109
|
await this.#assertContained(p);
|
|
93
110
|
const target = toPlatform$4(p);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as uiCatalog } from "./openUiSpecLang-
|
|
1
|
+
import { g as uiCatalog } from "./openUiSpecLang-C8qNOxzA.js";
|
|
2
2
|
import { t as CatalogNode } from "./ui-react.js";
|
|
3
3
|
import { Renderer, createLibrary, defineComponent } from "./dist-CTsxblSD.js";
|
|
4
4
|
import { z } from "zod";
|