@webskill/sdk 0.20.0 → 0.22.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.
Files changed (139) hide show
  1. package/dist/abnfDiagram-O67JEVCF-DtYFjfqO.js +109 -0
  2. package/dist/agent.d.ts +3 -3
  3. package/dist/agent.js +1171 -73
  4. package/dist/{approval-Bbh_Apwg.js → approval-DWQlDPbY.js} +527 -29
  5. package/dist/arc-8U_6NQWm.js +130 -0
  6. package/dist/architecture-7GRP2DOG-RTw1wpAq.js +4 -0
  7. package/dist/architectureDiagram-NJMV4G6O-XmmXrJAK.js +7473 -0
  8. package/dist/array-DQfpQNY8.js +8 -0
  9. package/dist/blockDiagram-BEXU5L5S-D4yjnCD1.js +2582 -0
  10. package/dist/browser.d.ts +1129 -48
  11. package/dist/browser.js +3562 -278
  12. package/dist/c4Diagram-YGBWAQC7-BLmA_JSd.js +3668 -0
  13. package/dist/channel-CZxxLrG7.js +9 -0
  14. package/dist/chunk-2Q5K7J3B-Ck03gkFR.js +21 -0
  15. package/dist/chunk-3FUC2YCW-tr6jmbQf.js +530 -0
  16. package/dist/chunk-5DYCD2WN-Bt97YGTd.js +58 -0
  17. package/dist/chunk-5VM5RSS4-BBxa48HL.js +21 -0
  18. package/dist/chunk-6AEJRKK7-JXK89I-O.js +14 -0
  19. package/dist/chunk-742MDFTN-CPmgCGwC.js +466 -0
  20. package/dist/chunk-7INBJB4K-C9jq9o66.js +6552 -0
  21. package/dist/chunk-7M6MHVWA-BrKCWcR1.js +4894 -0
  22. package/dist/chunk-7PRAP22T-BHED6GVs.js +95 -0
  23. package/dist/chunk-DUW6YSOI-DoZj78PO.js +19 -0
  24. package/dist/chunk-FOHPRMQF-Dkbp819z.js +27189 -0
  25. package/dist/chunk-GNY47TPC-Bpvq1T49.js +87 -0
  26. package/dist/chunk-GTNCS2PH-CLmh4I2c.js +686 -0
  27. package/dist/chunk-GWA4HPMP-B6vN3fkL.js +95 -0
  28. package/dist/chunk-J5ZVWO5B-Bi_Pcobw.js +26 -0
  29. package/dist/chunk-JWPE2WC7-D1rC79GS.js +12 -0
  30. package/dist/chunk-LNGE3PJU-D5OIoe3Z.js +2582 -0
  31. package/dist/chunk-MBY4JIJT-C34L7a4f.js +2276 -0
  32. package/dist/chunk-NETBCI7D-Cg84k8N8.js +321 -0
  33. package/dist/chunk-O7XYJQB3-B6K0KOSL.js +8846 -0
  34. package/dist/chunk-UA2S7LBM-DxHM29_K.js +612 -0
  35. package/dist/chunk-WEXAMYUT-Ba6jFWhB.js +33 -0
  36. package/dist/chunk-XXDRQBXY-DPbSy4kg.js +12 -0
  37. package/dist/chunk-Y2CYZVJY-U3QOMqrW.js +15 -0
  38. package/dist/chunk-Z7XXMR3K-oLg1h8F3.js +1038 -0
  39. package/dist/chunk-ZIGJFQKS-DqEFBuHR.js +2215 -0
  40. package/dist/classDiagram-v2-NBCMYWYE-BqnOWIUt.js +3845 -0
  41. package/dist/cose-bilkent-JH36ORCC-C0dTAHVK.js +4270 -0
  42. package/dist/cynefin-OW5HDTMX-B2QvgEQj.js +4 -0
  43. package/dist/cynefinDiagram-VND7K2PF-yAWc6Z3W.js +479 -0
  44. package/dist/cytoscape.esm-C64mRh9B.js +28325 -0
  45. package/dist/dagre-6A5THRUB-D0w2W27v.js +4816 -0
  46. package/dist/defaultLocale-B_EoOkSF.js +249 -0
  47. package/dist/diagram-22UHCM2B-DvgzhUzP.js +6115 -0
  48. package/dist/diagram-3UASUU5V-DWgUB-ef.js +795 -0
  49. package/dist/diagram-ATOU4E4O-P1olqwIs.js +553 -0
  50. package/dist/diagram-CDSNMT55-BUlZuLUe.js +402 -0
  51. package/dist/diagram-MLGK6HIB-6w5qmkGt.js +186 -0
  52. package/dist/diagram-MPIPVDR6-DEFiSo8o.js +289 -0
  53. package/dist/dist-UajCDt3n.js +92 -0
  54. package/dist/ebnfDiagram-ZINNZB2B-CI8liCfR.js +123 -0
  55. package/dist/elk-276RUBZZ-3SvW6OAK.js +90034 -0
  56. package/dist/erDiagram-OPXOYQCR-CPTbKhwP.js +2301 -0
  57. package/dist/{eventTypes-CwciaqCU.js → eventTypes-DcTQXSV1.js} +7 -1
  58. package/dist/eventmodeling-NTZA5JFV-BlyuqGp0.js +4 -0
  59. package/dist/flowDiagram-KWPJA3E3-CcUJ6HbV.js +18 -0
  60. package/dist/ganttDiagram-FUAMR5RP-31UjY0KK.js +3939 -0
  61. package/dist/geometry-wx5ZTYzi.js +715 -0
  62. package/dist/gitGraph-4MIJSDKK-ChdVlrk7.js +4 -0
  63. package/dist/gitGraphDiagram-X574FWY7-DKuxJymB.js +1153 -0
  64. package/dist/governance.d.ts +9 -3
  65. package/dist/governance.js +1 -1
  66. package/dist/graphlib-tk9gQYuN.js +4194 -0
  67. package/dist/{index-ad11wflI.d.ts → index-BiO9_XRk.d.ts} +2 -2
  68. package/dist/{index-DQ3-6GFu.d.ts → index-CjwdZQOS.d.ts} +945 -8
  69. package/dist/{index-BDyXe-a5.d.ts → index-YPd8ZSEa.d.ts} +413 -7
  70. package/dist/index.d.ts +4 -4
  71. package/dist/index.js +47 -41
  72. package/dist/info-A6RAGUB7-CxRAt9S9.js +4 -0
  73. package/dist/infoDiagram-VRGFBTTK-pRspGfjZ.js +25 -0
  74. package/dist/init-CMOIWdg-.js +16 -0
  75. package/dist/ishikawaDiagram-OU5B5YK6-DKerAPAg.js +975 -0
  76. package/dist/journeyDiagram-ZHPQQLJL-C4MK-YO5.js +1227 -0
  77. package/dist/kanban-definition-PNTS6WVX-BqsZpMXx.js +1244 -0
  78. package/dist/katex-BcRRvyh_.js +26465 -0
  79. package/dist/kind-Dc8x0HWz.js +110 -0
  80. package/dist/line-LgV8iVMV.js +48 -0
  81. package/dist/linear-BWKR0Tqd.js +393 -0
  82. package/dist/linkedDocument-CIuh_Yp0.js +416 -0
  83. package/dist/mcp.d.ts +2 -2
  84. package/dist/{memoryArtifactStore-D6dLeY55.js → memoryArtifactStore-Bs7glPqm.js} +14 -0
  85. package/dist/mermaid-parser.core-pYR5siSx.js +754 -0
  86. package/dist/mermaid.core-DMtwGCHy.js +1756 -0
  87. package/dist/mindmap-definition-NLK3R4M7-CXbD-myG.js +1312 -0
  88. package/dist/node.d.ts +8 -3
  89. package/dist/node.js +79 -4
  90. package/dist/{openUiLibrary-b0i7F_oZ.js → openUiLibrary-B7j3rLrm.js} +1 -1
  91. package/dist/{openUiSpecLang-CLXJEeRU.js → openUiSpecLang-BSYYnjay.js} +1 -1
  92. package/dist/ordinal-CxA6GHQS.js +84 -0
  93. package/dist/packet-AYTQ26CC-BOm08cxl.js +4 -0
  94. package/dist/path-C27Z2Bjv.js +106 -0
  95. package/dist/pegDiagram-GJSIUBJH-BLGJOewQ.js +115 -0
  96. package/dist/pie-WAS4IAKB-Dvg7glpk.js +4 -0
  97. package/dist/pieDiagram-5QR66LMP-laoaV_PB.js +298 -0
  98. package/dist/processSandboxEntry.js +5 -0
  99. package/dist/quadrantDiagram-O4NWA36T-Db_wFBkT.js +2236 -0
  100. package/dist/radar-RG4KPBEZ-BZDaTu06.js +4 -0
  101. package/dist/railroad-74A4TZTK-C-UhjkOy.js +4 -0
  102. package/dist/railroad-abnf-HS5TGJTU-dUKVA4OS.js +4 -0
  103. package/dist/railroad-ebnf-LZEXJU2U-DzQumk18.js +4 -0
  104. package/dist/railroad-peg-WCYAUIDC-B3vvTWed.js +4 -0
  105. package/dist/railroadDiagram-XR7U4H2S-BY0sTM4X.js +89 -0
  106. package/dist/requirementDiagram-PLB6GJNP-3rkQfEhs.js +2474 -0
  107. package/dist/rough.cjs-AmDd_NQk.js +1395 -0
  108. package/dist/sandboxWorkerEntry.js +5 -0
  109. package/dist/sankeyDiagram-IPEJSGJF-CGAJhyG2.js +3578 -0
  110. package/dist/sequenceDiagram-PO4LG4MO-9FJjFX06.js +5522 -0
  111. package/dist/sizeCapture-INFHLROL-D8PWxdOn.js +56 -0
  112. package/dist/{skillVersionStore-B24Jjjry-v2CCU0Xo.d.ts → skillVersionStore-B24Jjjry-BY1H7Krp.d.ts} +1 -1
  113. package/dist/src-NkhI3UMl.js +2653 -0
  114. package/dist/stateDiagram-v2-GCMORJYK-B0O3wc1-.js +2715 -0
  115. package/dist/swimlanes-2SLR337P-D4EOnrpu.js +6637 -0
  116. package/dist/swimlanesDiagram-TC7HE7FX-BUx29EJ9.js +30 -0
  117. package/dist/testing.d.ts +2 -1
  118. package/dist/testing.js +1 -1
  119. package/dist/timeline-definition-EJHVYXUP-CrgiiB4C.js +1513 -0
  120. package/dist/treeView-Q6P3EWNA-C1by-Gzc.js +4 -0
  121. package/dist/treemap-WGGIJYW6-mC2NZ6ad.js +4 -0
  122. package/dist/{types-Btpdd1y--BcxQ10Fa.d.ts → types-CpDRZ0rA-BM5FI9oN.d.ts} +111 -9
  123. package/dist/ui-react.d.ts +3 -3
  124. package/dist/ui-react.js +3718 -77
  125. package/dist/ui-vue.d.ts +1 -1
  126. package/dist/ui.d.ts +3 -3
  127. package/dist/ui.js +2 -2
  128. package/dist/untrustedText-BIaRvPZK.js +16 -0
  129. package/dist/usecaseDiagram-POWQR4AR-BUt_TQOY.js +14397 -0
  130. package/dist/vennDiagram-UO4OBE2U-CwXr0wjA.js +2808 -0
  131. package/dist/wardley-WFR3VGLG-CVSYjq_S.js +4 -0
  132. package/dist/wardleyDiagram-VNRHLVJA-Cpfd47dQ.js +874 -0
  133. package/dist/{webSkillApi-CsvA69qk.js → webSkillApi-Dy-Zjv0y.js} +1 -1
  134. package/dist/{webskillLitCatalog-W06npwej.js → webskillLitCatalog-D5BCiMCU.js} +1 -1
  135. package/dist/xychartDiagram-PMCCYNJV-e1TeVoc6.js +2704 -0
  136. package/package.json +6 -5
  137. package/dist/kind-DxgS8LM-.js +0 -77
  138. package/dist/linkedDocument-xNXF-z8n.js +0 -94
  139. package/dist/types-DOJI5YC3.js +0 -90
package/dist/node.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as SKILLS_LOCKFILE, Ct as SkillsLockfile, Et as TrustedKeyStore, H as FileStat, K as JsonSchema, N as ArchiveLimits, S as UiBridge, U as FileSystemProvider, _t as SkillManifest, at as SignatureAuditSink, b as RenderResultRequest, c as InteractionResponse, et as SKILL_MANIFEST_FILE, gt as SkillManagerPort, jt as VerifyResult, kt as UnsignedPolicy, pt as SkillInstallSource, s as InteractionRequest } from "./types-Btpdd1y--BcxQ10Fa.js";
2
- import { Gn as WebSkillRuntimeDeps, Gt as SchemaInferer, H as FsMemoryStore, Kt as ScriptExecutionContext, V as FsArtifactStore, Wn as WebSkillRuntime, Zn as createScriptContext, ct as NetworkPolicy, gn as ToolDefinition, m as ApprovalScope, qt as ScriptExecutor, y as BridgeCapabilities, yn as ToolResult } from "./index-BDyXe-a5.js";
3
- import { a as AuditLog, b as SkillVersionStore, d as CandidateSkill, m as CandidateStore, r as ApprovalPolicy } from "./skillVersionStore-B24Jjjry-v2CCU0Xo.js";
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-BM5FI9oN.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-YPd8ZSEa.js";
3
+ import { a as AuditLog, b as SkillVersionStore, d as CandidateSkill, m as CandidateStore, r as ApprovalPolicy } from "./skillVersionStore-B24Jjjry-BY1H7Krp.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
@@ -23,6 +23,11 @@ declare class NodeFS implements FileSystemProvider {
23
23
  appendText(p: string, content: string): Promise<void>;
24
24
  readBinary(p: string): Promise<Uint8Array>;
25
25
  writeBinary(p: string, content: Uint8Array): Promise<void>;
26
+ /**
27
+ * 分块写入(FR-18.2c)。先写同目录临时文件,`close()` 时 rename 到位:
28
+ * 中途失败只会留下临时文件(随即删掉),目标路径要么没有、要么是完整内容(FR-18.2e)。
29
+ */
30
+ createWriteStream(p: string): Promise<FileWriteStream>;
26
31
  exists(p: string): Promise<boolean>;
27
32
  stat(p: string): Promise<FileStat>;
28
33
  list(p: string): Promise<FileStat[]>;
package/dist/node.js CHANGED
@@ -2,10 +2,11 @@ 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-CAJMsLod.js";
3
3
  import { a as atomicWriteText, o as isAtomicTempPath, r as resolveInsideRoot, t as assertSafePathSegment } from "./pathSecurity-B1owvJAF.js";
4
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-Bbh_Apwg.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-DWQlDPbY.js";
6
+ import { f as SPREADSHEET_MIME_TYPE } from "./linkedDocument-CIuh_Yp0.js";
6
7
  import { n as normalizeToolContent } from "./external-_ZRQe-V9.js";
7
8
  import { i as probeLlmCapabilities } from "./env-Bj1MI2Ww.js";
8
- import { t as AUDIT_EVENT_TYPES } from "./eventTypes-CwciaqCU.js";
9
+ import { t as AUDIT_EVENT_TYPES } from "./eventTypes-DcTQXSV1.js";
9
10
  import { createRequire } from "node:module";
10
11
  import { unzipSync, zipSync } from "fflate";
11
12
  import { existsSync, promises, realpathSync } from "node:fs";
@@ -93,6 +94,50 @@ var NodeFS = class NodeFS {
93
94
  await promises.mkdir(path.dirname(target), { recursive: true });
94
95
  await promises.writeFile(target, content);
95
96
  }
97
+ /**
98
+ * 分块写入(FR-18.2c)。先写同目录临时文件,`close()` 时 rename 到位:
99
+ * 中途失败只会留下临时文件(随即删掉),目标路径要么没有、要么是完整内容(FR-18.2e)。
100
+ */
101
+ async createWriteStream(p) {
102
+ await this.#assertContained(p);
103
+ const target = toPlatform$4(p);
104
+ await promises.mkdir(path.dirname(target), { recursive: true });
105
+ const temp = `${target}.${Date.now().toString(36)}${Math.random().toString(36).slice(2, 8)}.part`;
106
+ const handle = await promises.open(temp, "wx");
107
+ let settled = false;
108
+ const discard = async () => {
109
+ await handle.close().catch(() => void 0);
110
+ await promises.rm(temp, { force: true }).catch(() => void 0);
111
+ };
112
+ return {
113
+ write: async (chunk) => {
114
+ if (settled) throw new WebSkillError("FS_PERMISSION_DENIED", `Cannot write to a finished write stream: ${p}`);
115
+ try {
116
+ await handle.write(chunk);
117
+ } catch (e) {
118
+ settled = true;
119
+ await discard();
120
+ throw this.#mapError(e, p);
121
+ }
122
+ },
123
+ close: async () => {
124
+ if (settled) throw new WebSkillError("FS_PERMISSION_DENIED", `Cannot close a finished write stream: ${p}`);
125
+ settled = true;
126
+ try {
127
+ await handle.close();
128
+ await promises.rename(temp, target);
129
+ } catch (e) {
130
+ await promises.rm(temp, { force: true }).catch(() => void 0);
131
+ throw this.#mapError(e, p);
132
+ }
133
+ },
134
+ abort: async () => {
135
+ if (settled) return;
136
+ settled = true;
137
+ await discard();
138
+ }
139
+ };
140
+ }
96
141
  async exists(p) {
97
142
  await this.#assertContained(p);
98
143
  try {
@@ -407,7 +452,8 @@ var SandboxedScriptExecutor = class {
407
452
  runId: context.runId,
408
453
  args,
409
454
  scriptSource: await this.#fs.readText(scriptPath),
410
- ...context.readUploadFile ? { uploadFiles: true } : {}
455
+ ...context.readUploadFile ? { uploadFiles: true } : {},
456
+ ...context.writeSpreadsheet ? { writeSpreadsheet: true } : {}
411
457
  }, timeoutMs, (request) => this.#handleBridge(request, context), (host) => context.onWarning?.(`Network request blocked by sandbox network policy: ${host}`));
412
458
  if (!result.ok) {
413
459
  const stderrSummary = result.stderr?.length ? ` | stderr: ${result.stderr.join(" | ").slice(0, 500)}` : "";
@@ -565,6 +611,20 @@ var SandboxedScriptExecutor = class {
565
611
  value: artifact
566
612
  };
567
613
  }
614
+ case "writeSpreadsheet": {
615
+ if (!context.writeSpreadsheet) return bridgeError(request.id, "TOOL_UNSUPPORTED", "Capability \"writeSpreadsheet\" is unavailable");
616
+ const denied = await gate("writeArtifact", `Script "${context.skillName}" wants to write artifact "${request.path}"`, {
617
+ path: request.path,
618
+ mimeType: SPREADSHEET_MIME_TYPE
619
+ });
620
+ if (denied) return denied;
621
+ const artifact = await context.writeSpreadsheet(request.path, request.spec, { ...request.metadata === void 0 ? {} : { metadata: request.metadata } });
622
+ return {
623
+ id: request.id,
624
+ ok: true,
625
+ value: artifact
626
+ };
627
+ }
568
628
  case "confirm": {
569
629
  if (!context.confirm) return bridgeError(request.id, "TOOL_UNSUPPORTED", "Capability \"confirm\" is disabled");
570
630
  const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}`, { question: request.message });
@@ -809,7 +869,8 @@ var ProcessSandboxExecutor = class {
809
869
  args,
810
870
  scriptSource: await this.#fs.readText(scriptPath),
811
871
  scratchDir: slot.artifactDir,
812
- ...context.readUploadFile ? { uploadFiles: true } : {}
872
+ ...context.readUploadFile ? { uploadFiles: true } : {},
873
+ ...context.writeSpreadsheet ? { writeSpreadsheet: true } : {}
813
874
  }, timeoutMs, (request) => this.#handleBridge(request, context), (host) => context.onWarning?.(`Network request blocked by sandbox network policy: ${host}`));
814
875
  if (!result.ok) {
815
876
  const stderrSummary = result.stderr?.length ? ` | stderr: ${result.stderr.join(" | ").slice(0, 500)}` : "";
@@ -963,6 +1024,20 @@ var ProcessSandboxExecutor = class {
963
1024
  value: artifact
964
1025
  };
965
1026
  }
1027
+ case "writeSpreadsheet": {
1028
+ if (!context.writeSpreadsheet) return bridgeError(request.id, "TOOL_UNSUPPORTED", "Capability \"writeSpreadsheet\" is unavailable");
1029
+ const denied = await gate("writeArtifact", `Script "${context.skillName}" wants to write artifact "${request.path}"`, {
1030
+ path: request.path,
1031
+ mimeType: SPREADSHEET_MIME_TYPE
1032
+ });
1033
+ if (denied) return denied;
1034
+ const artifact = await context.writeSpreadsheet(request.path, request.spec, { ...request.metadata === void 0 ? {} : { metadata: request.metadata } });
1035
+ return {
1036
+ id: request.id,
1037
+ ok: true,
1038
+ value: artifact
1039
+ };
1040
+ }
966
1041
  case "confirm": {
967
1042
  if (!context.confirm) return bridgeError(request.id, "TOOL_UNSUPPORTED", "Capability \"confirm\" is disabled");
968
1043
  const denied = await gate("confirm", `Script "${context.skillName}" asks for confirmation: ${request.message}`, { question: request.message });
@@ -1,4 +1,4 @@
1
- import { g as uiCatalog } from "./openUiSpecLang-CLXJEeRU.js";
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 remote URLs are rejected by policy, so never link to an image you found on the web. `alt` is required: it is what a screen reader and a later model read instead of the pixels.",
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,4 @@
1
+ import "./chunk-FOHPRMQF-Dkbp819z.js";
2
+ import { S as createPacketServices, x as PacketModule } from "./mermaid-parser.core-pYR5siSx.js";
3
+
4
+ export { createPacketServices };
@@ -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 };
@@ -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 };
@@ -0,0 +1,4 @@
1
+ import "./chunk-FOHPRMQF-Dkbp819z.js";
2
+ import { b as createPieServices, y as PieModule } from "./mermaid-parser.core-pYR5siSx.js";
3
+
4
+ export { createPieServices };