@webskill/sdk 0.21.0 → 0.23.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/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
- package/dist/agent.d.ts +3 -3
- package/dist/agent.js +1174 -169
- package/dist/{approval-DwN2o2QG.js → approval-7CuZS3Z4.js} +104 -18
- package/dist/arc-8U_6NQWm.js +130 -0
- package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
- package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
- package/dist/array-DQfpQNY8.js +8 -0
- package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
- package/dist/browser.d.ts +455 -49
- package/dist/browser.js +2134 -138
- package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
- package/dist/channel-CZxxLrG7.js +9 -0
- package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
- package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
- package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
- package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
- package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
- package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
- package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
- package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
- package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
- package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
- package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
- package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
- package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
- package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
- package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
- package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
- package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
- package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
- package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
- package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
- package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
- package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
- package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
- package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
- package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
- package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
- package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
- package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
- package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
- package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
- package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
- package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
- package/dist/defaultLocale-B_EoOkSF.js +249 -0
- package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
- package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
- package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
- package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
- package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
- package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
- package/dist/dist-UajCDt3n.js +92 -0
- package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
- package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
- package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
- package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
- package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
- package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
- package/dist/{toolSource-C9oNuKmr.js → geometry-CRhuySKV.js} +169 -12
- package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
- package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
- package/dist/governance.d.ts +22 -4
- package/dist/governance.js +100 -10
- package/dist/graphlib-tk9gQYuN.js +4194 -0
- package/dist/{index-DHopiH_m.d.ts → index-7No55dRb.d.ts} +161 -11
- package/dist/{index-B8Tgmpwh.d.ts → index-ShvCB5I9.d.ts} +2 -2
- package/dist/{index-CYLt5u4L.d.ts → index-V76_OFj2.d.ts} +789 -21
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -9
- package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
- package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
- package/dist/init-CMOIWdg-.js +16 -0
- package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
- package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
- package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
- package/dist/katex-BcRRvyh_.js +26465 -0
- package/dist/{kind-DaKqLX2F.js → kind-Dc8x0HWz.js} +54 -7
- package/dist/line-LgV8iVMV.js +48 -0
- package/dist/linear-BWKR0Tqd.js +393 -0
- package/dist/linkedDocument-CZZOl9cO.js +456 -0
- package/dist/mcp.d.ts +2 -2
- package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
- package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
- package/dist/mermaid.core-DMtwGCHy.js +1756 -0
- package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
- package/dist/node.d.ts +3 -3
- package/dist/node.js +12 -5
- package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
- package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
- package/dist/ordinal-CxA6GHQS.js +84 -0
- package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
- package/dist/path-C27Z2Bjv.js +106 -0
- package/dist/{pathSecurity-B1owvJAF.js → pathSecurity-CirkQwWP.js} +12 -1
- package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
- package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
- package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
- package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
- package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
- package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
- package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
- package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
- package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
- package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
- package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
- package/dist/rough.cjs-AmDd_NQk.js +1395 -0
- package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
- package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
- package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
- package/dist/{skill-CAJMsLod.js → skill-WSUDp6A1.js} +1 -1
- package/dist/{skillVersionStore-B24Jjjry-BkOk9wI_.d.ts → skillVersionStore-S4_HJ_Fl-Cvy9LqVu.d.ts} +35 -4
- package/dist/src-NkhI3UMl.js +2653 -0
- package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
- package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
- package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -1
- package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
- package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
- package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
- package/dist/{types-BvTV_05--BW8zDuEk.d.ts → types-CpDRZ0rA-BiZBXGm4.d.ts} +66 -8
- package/dist/ui-react.d.ts +3 -3
- package/dist/ui-react.js +3746 -96
- package/dist/ui-vue.d.ts +1 -1
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +2 -2
- package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
- package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
- package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
- package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
- package/dist/{webSkillApi-Cib6G-94.js → webSkillApi-D5VMUnrv.js} +2 -2
- package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
- package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
- package/package.json +1 -1
- package/dist/linkedDocument-C0gj1sMq.js +0 -245
package/dist/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as AuditLog,
|
|
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-CpDRZ0rA-BiZBXGm4.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-7No55dRb.js";
|
|
3
|
+
import { a as AuditLog, f as CandidateSkill, h as CandidateStore, r as ApprovalPolicy, x as SkillVersionStore } from "./skillVersionStore-S4_HJ_Fl-Cvy9LqVu.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
|
package/dist/node.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
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-
|
|
3
|
-
import { a as
|
|
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
|
+
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 { 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-
|
|
6
|
-
import {
|
|
5
|
+
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-7CuZS3Z4.js";
|
|
6
|
+
import { f as SPREADSHEET_MIME_TYPE } from "./linkedDocument-CZZOl9cO.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";
|
|
@@ -2469,7 +2469,14 @@ var ApprovalWorkflow = class {
|
|
|
2469
2469
|
const stagingRoot = (await mkdtemp(path.join(tmpdir(), "webskill-candidate-"))).split(path.sep).join("/");
|
|
2470
2470
|
try {
|
|
2471
2471
|
const skillDir = `${stagingRoot}/${candidate.name}`;
|
|
2472
|
-
for (const file of candidate.files)
|
|
2472
|
+
for (const file of candidate.files) {
|
|
2473
|
+
const target = resolveInsideRoot(skillDir, file.path);
|
|
2474
|
+
if (file.binary === void 0) {
|
|
2475
|
+
await atomicWriteText(this.#fs, target, file.content);
|
|
2476
|
+
continue;
|
|
2477
|
+
}
|
|
2478
|
+
await atomicWriteBinary(this.#fs, target, await this.#store.readCandidateBinary(candidate.id, file.binary.file));
|
|
2479
|
+
}
|
|
2473
2480
|
const report = await validateSkills(this.#fs, [stagingRoot]);
|
|
2474
2481
|
if (!report.ok) {
|
|
2475
2482
|
const errors = report.issues.filter((i) => i.severity === "error");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as uiCatalog } from "./openUiSpecLang-
|
|
1
|
+
import { g as uiCatalog } from "./openUiSpecLang-BSYYnjay.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";
|
|
@@ -1286,7 +1286,7 @@ const uiCatalog = defineUiCatalog({
|
|
|
1286
1286
|
{
|
|
1287
1287
|
name: "Image",
|
|
1288
1288
|
group: "content",
|
|
1289
|
-
description: "An image the host already serves. `src` must be same-origin or a data URL
|
|
1289
|
+
description: "An image the host already serves. `src` must be same-origin or a data URL; a reference from an image tool (`artifact:…`) is not a path. To show an image you found on the web, write markdown in your reply instead of using this component. `alt` is required: a screen reader and a later model read it instead of the pixels, so describe only what you have actually seen.",
|
|
1290
1290
|
props: z.object({
|
|
1291
1291
|
src: imageSrc,
|
|
1292
1292
|
alt: z.string(),
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { t as initRange } from "./init-CMOIWdg-.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/internmap@2.0.3/node_modules/internmap/src/index.js
|
|
4
|
+
var InternMap = class extends Map {
|
|
5
|
+
constructor(entries, key = keyof) {
|
|
6
|
+
super();
|
|
7
|
+
Object.defineProperties(this, {
|
|
8
|
+
_intern: { value: /* @__PURE__ */ new Map() },
|
|
9
|
+
_key: { value: key }
|
|
10
|
+
});
|
|
11
|
+
if (entries != null) for (const [key, value] of entries) this.set(key, value);
|
|
12
|
+
}
|
|
13
|
+
get(key) {
|
|
14
|
+
return super.get(intern_get(this, key));
|
|
15
|
+
}
|
|
16
|
+
has(key) {
|
|
17
|
+
return super.has(intern_get(this, key));
|
|
18
|
+
}
|
|
19
|
+
set(key, value) {
|
|
20
|
+
return super.set(intern_set(this, key), value);
|
|
21
|
+
}
|
|
22
|
+
delete(key) {
|
|
23
|
+
return super.delete(intern_delete(this, key));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
function intern_get({ _intern, _key }, value) {
|
|
27
|
+
const key = _key(value);
|
|
28
|
+
return _intern.has(key) ? _intern.get(key) : value;
|
|
29
|
+
}
|
|
30
|
+
function intern_set({ _intern, _key }, value) {
|
|
31
|
+
const key = _key(value);
|
|
32
|
+
if (_intern.has(key)) return _intern.get(key);
|
|
33
|
+
_intern.set(key, value);
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
function intern_delete({ _intern, _key }, value) {
|
|
37
|
+
const key = _key(value);
|
|
38
|
+
if (_intern.has(key)) {
|
|
39
|
+
value = _intern.get(key);
|
|
40
|
+
_intern.delete(key);
|
|
41
|
+
}
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
function keyof(value) {
|
|
45
|
+
return value !== null && typeof value === "object" ? value.valueOf() : value;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region ../../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/ordinal.js
|
|
50
|
+
const implicit = Symbol("implicit");
|
|
51
|
+
function ordinal() {
|
|
52
|
+
var index = new InternMap(), domain = [], range = [], unknown = implicit;
|
|
53
|
+
function scale(d) {
|
|
54
|
+
let i = index.get(d);
|
|
55
|
+
if (i === void 0) {
|
|
56
|
+
if (unknown !== implicit) return unknown;
|
|
57
|
+
index.set(d, i = domain.push(d) - 1);
|
|
58
|
+
}
|
|
59
|
+
return range[i % range.length];
|
|
60
|
+
}
|
|
61
|
+
scale.domain = function(_) {
|
|
62
|
+
if (!arguments.length) return domain.slice();
|
|
63
|
+
domain = [], index = new InternMap();
|
|
64
|
+
for (const value of _) {
|
|
65
|
+
if (index.has(value)) continue;
|
|
66
|
+
index.set(value, domain.push(value) - 1);
|
|
67
|
+
}
|
|
68
|
+
return scale;
|
|
69
|
+
};
|
|
70
|
+
scale.range = function(_) {
|
|
71
|
+
return arguments.length ? (range = Array.from(_), scale) : range.slice();
|
|
72
|
+
};
|
|
73
|
+
scale.unknown = function(_) {
|
|
74
|
+
return arguments.length ? (unknown = _, scale) : unknown;
|
|
75
|
+
};
|
|
76
|
+
scale.copy = function() {
|
|
77
|
+
return ordinal(domain, range).unknown(unknown);
|
|
78
|
+
};
|
|
79
|
+
initRange.apply(scale, arguments);
|
|
80
|
+
return scale;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { ordinal as t };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/d3-path@3.1.0/node_modules/d3-path/src/path.js
|
|
2
|
+
const pi = Math.PI;
|
|
3
|
+
const tau = 2 * pi;
|
|
4
|
+
const epsilon = 1e-6;
|
|
5
|
+
const tauEpsilon = tau - epsilon;
|
|
6
|
+
function append(strings) {
|
|
7
|
+
this._ += strings[0];
|
|
8
|
+
for (let i = 1, n = strings.length; i < n; ++i) this._ += arguments[i] + strings[i];
|
|
9
|
+
}
|
|
10
|
+
function appendRound(digits) {
|
|
11
|
+
let d = Math.floor(digits);
|
|
12
|
+
if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);
|
|
13
|
+
if (d > 15) return append;
|
|
14
|
+
const k = 10 ** d;
|
|
15
|
+
return function(strings) {
|
|
16
|
+
this._ += strings[0];
|
|
17
|
+
for (let i = 1, n = strings.length; i < n; ++i) this._ += Math.round(arguments[i] * k) / k + strings[i];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var Path = class {
|
|
21
|
+
constructor(digits) {
|
|
22
|
+
this._x0 = this._y0 = this._x1 = this._y1 = null;
|
|
23
|
+
this._ = "";
|
|
24
|
+
this._append = digits == null ? append : appendRound(digits);
|
|
25
|
+
}
|
|
26
|
+
moveTo(x, y) {
|
|
27
|
+
this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;
|
|
28
|
+
}
|
|
29
|
+
closePath() {
|
|
30
|
+
if (this._x1 !== null) {
|
|
31
|
+
this._x1 = this._x0, this._y1 = this._y0;
|
|
32
|
+
this._append`Z`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
lineTo(x, y) {
|
|
36
|
+
this._append`L${this._x1 = +x},${this._y1 = +y}`;
|
|
37
|
+
}
|
|
38
|
+
quadraticCurveTo(x1, y1, x, y) {
|
|
39
|
+
this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;
|
|
40
|
+
}
|
|
41
|
+
bezierCurveTo(x1, y1, x2, y2, x, y) {
|
|
42
|
+
this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;
|
|
43
|
+
}
|
|
44
|
+
arcTo(x1, y1, x2, y2, r) {
|
|
45
|
+
x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
|
|
46
|
+
if (r < 0) throw new Error(`negative radius: ${r}`);
|
|
47
|
+
let x0 = this._x1, y0 = this._y1, x21 = x2 - x1, y21 = y2 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
|
|
48
|
+
if (this._x1 === null) this._append`M${this._x1 = x1},${this._y1 = y1}`;
|
|
49
|
+
else if (!(l01_2 > epsilon));
|
|
50
|
+
else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) this._append`L${this._x1 = x1},${this._y1 = y1}`;
|
|
51
|
+
else {
|
|
52
|
+
let x20 = x2 - x0, y20 = y2 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l / l01, t21 = l / l21;
|
|
53
|
+
if (Math.abs(t01 - 1) > epsilon) this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;
|
|
54
|
+
this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
arc(x, y, r, a0, a1, ccw) {
|
|
58
|
+
x = +x, y = +y, r = +r, ccw = !!ccw;
|
|
59
|
+
if (r < 0) throw new Error(`negative radius: ${r}`);
|
|
60
|
+
let dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x + dx, y0 = y + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
|
|
61
|
+
if (this._x1 === null) this._append`M${x0},${y0}`;
|
|
62
|
+
else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) this._append`L${x0},${y0}`;
|
|
63
|
+
if (!r) return;
|
|
64
|
+
if (da < 0) da = da % tau + tau;
|
|
65
|
+
if (da > tauEpsilon) this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;
|
|
66
|
+
else if (da > epsilon) this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;
|
|
67
|
+
}
|
|
68
|
+
rect(x, y, w, h) {
|
|
69
|
+
this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;
|
|
70
|
+
}
|
|
71
|
+
toString() {
|
|
72
|
+
return this._;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
function path() {
|
|
76
|
+
return new Path();
|
|
77
|
+
}
|
|
78
|
+
path.prototype = Path.prototype;
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/constant.js
|
|
82
|
+
function constant_default(x) {
|
|
83
|
+
return function constant() {
|
|
84
|
+
return x;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region ../../node_modules/.pnpm/d3-shape@3.2.0/node_modules/d3-shape/src/path.js
|
|
90
|
+
function withPath(shape) {
|
|
91
|
+
let digits = 3;
|
|
92
|
+
shape.digits = function(_) {
|
|
93
|
+
if (!arguments.length) return digits;
|
|
94
|
+
if (_ == null) digits = null;
|
|
95
|
+
else {
|
|
96
|
+
const d = Math.floor(_);
|
|
97
|
+
if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);
|
|
98
|
+
digits = d;
|
|
99
|
+
}
|
|
100
|
+
return shape;
|
|
101
|
+
};
|
|
102
|
+
return () => new Path(digits);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { constant_default as n, withPath as t };
|
|
@@ -20,6 +20,17 @@ async function atomicWriteText(fs, path, content) {
|
|
|
20
20
|
await fs.writeText(tmp, content);
|
|
21
21
|
await fs.rename(tmp, path);
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* 原子写二进制:与 `atomicWriteText` 逐字对称,只换写入方法(0.23.0 分册 20)。
|
|
25
|
+
*
|
|
26
|
+
* 临时名必须沿用同一条 `ATOMIC_TMP_SUFFIX_PATTERN` 形状——打包与列举侧靠那条正则
|
|
27
|
+
* 排除中断残留,另起一套命名会让残留的临时文件被打进技能包。
|
|
28
|
+
*/
|
|
29
|
+
async function atomicWriteBinary(fs, path, content) {
|
|
30
|
+
const tmp = `${path}.tmp-${Date.now()}-${Math.random().toString(36).slice(2, 6)}`;
|
|
31
|
+
await fs.writeBinary(tmp, content);
|
|
32
|
+
await fs.rename(tmp, path);
|
|
33
|
+
}
|
|
23
34
|
|
|
24
35
|
//#endregion
|
|
25
36
|
//#region ../core/src/fs/pathSecurity.ts
|
|
@@ -62,4 +73,4 @@ function resolveInsideRoot(root, relativePath) {
|
|
|
62
73
|
}
|
|
63
74
|
|
|
64
75
|
//#endregion
|
|
65
|
-
export {
|
|
76
|
+
export { atomicWriteBinary as a, ATOMIC_TMP_SUFFIX_PATTERN as i, normalizePath as n, atomicWriteText as o, resolveInsideRoot as r, isAtomicTempPath as s, assertSafePathSegment as t };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { t as MermaidParseError, u as createRailroadPegServices } from "./mermaid-parser.core-pYR5siSx.js";
|
|
2
|
+
import { n as __name } from "./chunk-Y2CYZVJY-U3QOMqrW.js";
|
|
3
|
+
import { m as log } from "./src-NkhI3UMl.js";
|
|
4
|
+
import "./chunk-O7XYJQB3-B6K0KOSL.js";
|
|
5
|
+
import "./chunk-6AEJRKK7-JXK89I-O.js";
|
|
6
|
+
import { n as getStyles, r as renderer, t as db } from "./chunk-GTNCS2PH-CLmh4I2c.js";
|
|
7
|
+
import { t as populateCommonDb } from "./chunk-JWPE2WC7-D1rC79GS.js";
|
|
8
|
+
|
|
9
|
+
//#region ../../node_modules/.pnpm/mermaid@12.0.0/node_modules/mermaid/dist/chunks/mermaid.core/pegDiagram-GJSIUBJH.mjs
|
|
10
|
+
var langiumParser = createRailroadPegServices().RailroadPeg.parser.LangiumParser;
|
|
11
|
+
var transformOrderedChoice = /* @__PURE__ */ __name((choice) => {
|
|
12
|
+
const alternatives = choice.alternatives.map(transformSequence);
|
|
13
|
+
if (alternatives.length === 1) return alternatives[0];
|
|
14
|
+
return {
|
|
15
|
+
type: "choice",
|
|
16
|
+
alternatives
|
|
17
|
+
};
|
|
18
|
+
}, "transformOrderedChoice");
|
|
19
|
+
var transformSequence = /* @__PURE__ */ __name((sequence) => {
|
|
20
|
+
const elements = sequence.elements.map(transformPrefix);
|
|
21
|
+
if (elements.length === 1) return elements[0];
|
|
22
|
+
return {
|
|
23
|
+
type: "sequence",
|
|
24
|
+
elements
|
|
25
|
+
};
|
|
26
|
+
}, "transformSequence");
|
|
27
|
+
var transformPrefix = /* @__PURE__ */ __name((prefix) => {
|
|
28
|
+
const inner = transformSuffix(prefix.suffix);
|
|
29
|
+
if (!prefix.operator) return inner;
|
|
30
|
+
return {
|
|
31
|
+
type: "special",
|
|
32
|
+
text: prefix.operator === "&" ? `&${nodeToLabel(inner)}` : `!${nodeToLabel(inner)}`
|
|
33
|
+
};
|
|
34
|
+
}, "transformPrefix");
|
|
35
|
+
var nodeToLabel = /* @__PURE__ */ __name((node) => {
|
|
36
|
+
switch (node.type) {
|
|
37
|
+
case "terminal": return `"${node.value}"`;
|
|
38
|
+
case "nonterminal": return node.name;
|
|
39
|
+
case "special": return node.text;
|
|
40
|
+
default: return "(...)";
|
|
41
|
+
}
|
|
42
|
+
}, "nodeToLabel");
|
|
43
|
+
var transformSuffix = /* @__PURE__ */ __name((suffix) => {
|
|
44
|
+
const inner = transformPrimary(suffix.primary);
|
|
45
|
+
if (!suffix.operator) return inner;
|
|
46
|
+
switch (suffix.operator) {
|
|
47
|
+
case "?": return {
|
|
48
|
+
type: "optional",
|
|
49
|
+
element: inner
|
|
50
|
+
};
|
|
51
|
+
case "*": return {
|
|
52
|
+
type: "repetition",
|
|
53
|
+
element: inner,
|
|
54
|
+
min: 0,
|
|
55
|
+
max: Infinity
|
|
56
|
+
};
|
|
57
|
+
case "+": return {
|
|
58
|
+
type: "repetition",
|
|
59
|
+
element: inner,
|
|
60
|
+
min: 1,
|
|
61
|
+
max: Infinity
|
|
62
|
+
};
|
|
63
|
+
default: throw new Error(`Unsupported PEG suffix operator: ${suffix.operator}`);
|
|
64
|
+
}
|
|
65
|
+
}, "transformSuffix");
|
|
66
|
+
var transformPrimary = /* @__PURE__ */ __name((primary) => {
|
|
67
|
+
switch (primary.$type) {
|
|
68
|
+
case "PegLiteral": return {
|
|
69
|
+
type: "terminal",
|
|
70
|
+
value: primary.value
|
|
71
|
+
};
|
|
72
|
+
case "PegIdentifier": return {
|
|
73
|
+
type: "nonterminal",
|
|
74
|
+
name: primary.name
|
|
75
|
+
};
|
|
76
|
+
case "PegGroup": return transformOrderedChoice(primary.element);
|
|
77
|
+
case "PegAny": return {
|
|
78
|
+
type: "special",
|
|
79
|
+
text: primary.dot
|
|
80
|
+
};
|
|
81
|
+
default: throw new Error(`Unsupported PEG primary node: ${primary.$type}`);
|
|
82
|
+
}
|
|
83
|
+
}, "transformPrimary");
|
|
84
|
+
var transformRule = /* @__PURE__ */ __name((rule) => {
|
|
85
|
+
return {
|
|
86
|
+
name: rule.name,
|
|
87
|
+
definition: transformOrderedChoice(rule.definition)
|
|
88
|
+
};
|
|
89
|
+
}, "transformRule");
|
|
90
|
+
var populateDb = /* @__PURE__ */ __name((ast) => {
|
|
91
|
+
populateCommonDb(ast, db);
|
|
92
|
+
if (ast.title) db.setTitle(ast.title);
|
|
93
|
+
ast.rules.map((rule) => db.addRule(transformRule(rule)));
|
|
94
|
+
}, "populateDb");
|
|
95
|
+
var diagram = {
|
|
96
|
+
parser: {
|
|
97
|
+
parse: /* @__PURE__ */ __name((input) => {
|
|
98
|
+
db.clear();
|
|
99
|
+
log.debug("[PEG Parser] Starting Langium parse");
|
|
100
|
+
const result = langiumParser.parse(input);
|
|
101
|
+
if (result.lexerErrors.length > 0 || result.parserErrors.length > 0) throw new MermaidParseError(result);
|
|
102
|
+
const ast = result.value;
|
|
103
|
+
log.debug("[PEG Parser] Parsed rules:", ast.rules.length);
|
|
104
|
+
populateDb(ast);
|
|
105
|
+
log.debug("[PEG Parser] Parse complete");
|
|
106
|
+
}, "parse"),
|
|
107
|
+
parser: { yy: db }
|
|
108
|
+
},
|
|
109
|
+
db,
|
|
110
|
+
renderer,
|
|
111
|
+
styles: getStyles
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
115
|
+
export { diagram };
|