@buun_group/plotwork-mcp 0.1.0 → 0.2.0-beta.2

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/plotwork-mcp.mjs CHANGED
@@ -65,7 +65,7 @@ var init_icon_art_folder = __esm({
65
65
  var package_default;
66
66
  var init_package = __esm({
67
67
  "package.json"() {
68
- package_default = { version: "0.1.0" };
68
+ package_default = { version: "0.2.0-beta.2" };
69
69
  }
70
70
  });
71
71
 
@@ -609,7 +609,7 @@ var init_auto_icons = __esm({
609
609
  webhook: "lucide:webhook",
610
610
  webhooks: "lucide:webhook"
611
611
  };
612
- BRAND_SUFFIXES = /* @__PURE__ */ new Set(["api", "sdk", "service", "server", "cache", "db", "database", "cluster", "instance"]);
612
+ BRAND_SUFFIXES = /* @__PURE__ */ new Set(["api", "sdk", "service", "server", "cache", "db", "database", "cluster", "instance", "cmdb", "itsm", "tenant"]);
613
613
  ROLE_ICON_MAX_WORDS = 3;
614
614
  }
615
615
  });
@@ -722,7 +722,7 @@ var init_view_links = __esm({
722
722
  };
723
723
  CLI_RELEASE = {
724
724
  packageName: "@buun_group/plotwork",
725
- version: "0.1.0-beta.13",
725
+ version: "0.2.0-beta.1",
726
726
  onNpm: true
727
727
  };
728
728
  }
@@ -735,8 +735,8 @@ var init_action_release = __esm({
735
735
  "use strict";
736
736
  ACTION_REPOSITORY = "plotwork-official/plotwork-action";
737
737
  ACTION_RELEASE = {
738
- version: "1.0.0-beta.14",
739
- sha: "dcec4036897b73bd3ea724b3991f4fd0ac880757"
738
+ version: "1.1.0-beta.1",
739
+ sha: "062b0e14394df19772d7fdac44a384ff5d349d2c"
740
740
  };
741
741
  PINNED_ACTION_LINE = `uses: ${ACTION_REPOSITORY}@${ACTION_RELEASE.sha} # v${ACTION_RELEASE.version}`;
742
742
  }
@@ -755,7 +755,7 @@ var init_mcp_release = __esm({
755
755
  "use strict";
756
756
  MCP_RELEASE = {
757
757
  packageName: "@buun_group/plotwork-mcp",
758
- version: "0.1.0-beta.10"
758
+ version: "0.2.0-beta.1"
759
759
  };
760
760
  }
761
761
  });
@@ -801,6 +801,55 @@ var init_lint_limits = __esm({
801
801
  }
802
802
  });
803
803
 
804
+ // ../../packages/diagrams/src/constants/secret-scan.ts
805
+ function hostPatternProblem(pattern3) {
806
+ if (pattern3.length === 0 || pattern3.length > SECRET_SCAN_LIMITS.maxHostPatternLength) return `A hostname pattern is 1 to ${SECRET_SCAN_LIMITS.maxHostPatternLength} characters.`;
807
+ if (!HOST_PATTERN.test(pattern3)) return "A hostname pattern is a DNS name in lower case, such as corp.example or *.corp.example, with * only as its first label.";
808
+ return null;
809
+ }
810
+ var SECRET_SCAN_LIMITS, HOST_PATTERN, SECRET_KIND_NAMES;
811
+ var init_secret_scan = __esm({
812
+ "../../packages/diagrams/src/constants/secret-scan.ts"() {
813
+ "use strict";
814
+ SECRET_SCAN_LIMITS = {
815
+ /** A generic assigned value shorter than this is not reported: too short to be a key, and most short values are words. */
816
+ minAssignedLength: 10,
817
+ /** The Shannon entropy, in bits a character, a generic assigned value must reach. Ten different characters reach 3.32. */
818
+ minAssignedEntropy: 3.2,
819
+ /** How many characters of a finding a warning shows before the mask; a value shorter than four times this shows a quarter of itself. */
820
+ shownCharacters: 4,
821
+ /** What follows the shown characters, whatever the value's length, so the mask says nothing about it. */
822
+ mask: "********",
823
+ /** The most internal hostname patterns an organisation may give. */
824
+ maxHostPatterns: 20,
825
+ /** The longest internal hostname pattern, the length of a DNS name. */
826
+ maxHostPatternLength: 253,
827
+ /** A run of this many ascending characters (`123456`, `abcdef`) marks a made-up example value. */
828
+ ascendingRun: 6
829
+ };
830
+ HOST_PATTERN = /^(?:\*|[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)+$/;
831
+ SECRET_KIND_NAMES = {
832
+ "aws-access-key": "an AWS access key id",
833
+ "aws-secret-key": "an AWS secret access key",
834
+ "gcp-api-key": "a Google Cloud API key",
835
+ "gcp-service-account": "a Google Cloud service account key",
836
+ "azure-storage-key": "an Azure storage account key",
837
+ "azure-sas-token": "an Azure shared access signature",
838
+ "github-token": "a GitHub token",
839
+ "slack-token": "a Slack token",
840
+ "slack-webhook": "a Slack webhook address",
841
+ "stripe-key": "a Stripe secret key",
842
+ jwt: "a JSON Web Token",
843
+ "private-key": "a private key",
844
+ "assigned-secret": "a password or secret value",
845
+ "connection-string": "a connection string with a password",
846
+ "plotwork-key": "a Plotwork API key",
847
+ "private-ip": "a private IP address",
848
+ "internal-host": "an internal hostname"
849
+ };
850
+ }
851
+ });
852
+
804
853
  // ../../packages/diagrams/src/constants/style-rules.ts
805
854
  var STYLE_RULES, STYLE_RULE_LEVELS, SETTINGS_FILE;
806
855
  var init_style_rules = __esm({
@@ -3308,6 +3357,9 @@ var init_brand_aliases = __esm({
3308
3357
  // Business, payments, and collaboration
3309
3358
  "simple:googledrive": ["gdrive"],
3310
3359
  "simple:confluence": ["atlassian confluence"],
3360
+ // Jira Service Management is part of Jira and has no mark of its own in the bundled sets.
3361
+ "simple:jira": ["jira service management", "jira service desk", "jsm", "atlassian jira"],
3362
+ "simple:sap": ["sap erp", "sap s4hana"],
3311
3363
  // Analytics
3312
3364
  "simple:googleanalytics": ["ga4"],
3313
3365
  "simple:plausibleanalytics": ["plausible"],
@@ -3333,7 +3385,9 @@ var init_brand_aliases = __esm({
3333
3385
  // Security
3334
3386
  "simple:1password": ["one password"],
3335
3387
  "simple:sonarqubeserver": ["sonarqube"],
3388
+ "simple:okta": ["okta sso", "okta workforce identity"],
3336
3389
  // Developer tools, frameworks, and languages
3390
+ "simple:github": ["github app", "github apps", "github enterprise"],
3337
3391
  "simple:rollupdotjs": ["rollup"],
3338
3392
  "simple:alpinedotjs": ["alpine js", "alpinejs"],
3339
3393
  "simple:reactquery": ["tanstack query"],
@@ -3354,6 +3408,21 @@ var init_brand_aliases = __esm({
3354
3408
  }
3355
3409
  });
3356
3410
 
3411
+ // ../../packages/diagrams/src/constants/brand-stand-ins.ts
3412
+ var BRAND_STAND_INS, BRAND_STAND_IN_NAMES;
3413
+ var init_brand_stand_ins = __esm({
3414
+ "../../packages/diagrams/src/constants/brand-stand-ins.ts"() {
3415
+ "use strict";
3416
+ BRAND_STAND_INS = [
3417
+ { slug: "servicenow", title: "ServiceNow", glyph: "lucide:ticket", aliases: ["service now", "snow", "cmdb", "servicenow cmdb", "servicenow itsm", "now platform"] },
3418
+ { slug: "workday", title: "Workday", glyph: "lucide:id-card", aliases: ["workday hcm"] },
3419
+ { slug: "zscaler", title: "Zscaler", glyph: "lucide:shield-check", aliases: ["zscaler internet access", "zscaler private access"] },
3420
+ { slug: "crowdstrike", title: "CrowdStrike", glyph: "lucide:shield-alert", aliases: ["crowdstrike falcon", "crowd strike"] }
3421
+ ];
3422
+ BRAND_STAND_IN_NAMES = Object.fromEntries(BRAND_STAND_INS.map((brand) => [`simple:${brand.slug}`, brand.glyph]));
3423
+ }
3424
+ });
3425
+
3357
3426
  // ../../packages/diagrams/src/constants/icon-name-aliases.ts
3358
3427
  function aliasWords(alias) {
3359
3428
  return alias.slice(alias.indexOf(":") + 1).replace(/-/g, " ");
@@ -3482,6 +3551,10 @@ function withNameAliases() {
3482
3551
  const words2 = merged[ref] ??= [];
3483
3552
  if (!words2.includes(aliasWords(alias))) words2.push(aliasWords(alias));
3484
3553
  }
3554
+ for (const brand of BRAND_STAND_INS) {
3555
+ const words2 = merged[brand.glyph] ??= [];
3556
+ for (const word2 of [brand.slug, brand.title.toLowerCase(), ...brand.aliases]) if (!words2.includes(word2)) words2.push(word2);
3557
+ }
3485
3558
  return merged;
3486
3559
  }
3487
3560
  var WRITTEN_ALIASES, ICON_ALIASES;
@@ -3489,6 +3562,7 @@ var init_icon_aliases = __esm({
3489
3562
  "../../packages/diagrams/src/constants/icon-aliases.ts"() {
3490
3563
  "use strict";
3491
3564
  init_brand_aliases();
3565
+ init_brand_stand_ins();
3492
3566
  init_icon_name_aliases();
3493
3567
  WRITTEN_ALIASES = {
3494
3568
  ...BRAND_ALIASES,
@@ -3511,7 +3585,11 @@ var init_icon_aliases = __esm({
3511
3585
  "simple:elasticsearch": ["elk", "elastic search"],
3512
3586
  "lucide:mail": ["email", "e mail"],
3513
3587
  "lucide:database": ["db", "datastore"],
3514
- "lucide:key-round": ["api key"]
3588
+ "lucide:key-round": ["api key"],
3589
+ // Microsoft's own names for the Azure pack's security and device products, which the pack files under shorter titles.
3590
+ "azure:defender-for-cloud": ["microsoft defender", "defender", "microsoft defender for cloud"],
3591
+ "azure:sentinel": ["microsoft sentinel"],
3592
+ "azure:intune": ["microsoft intune"]
3515
3593
  };
3516
3594
  ICON_ALIASES = withNameAliases();
3517
3595
  }
@@ -3884,6 +3962,7 @@ var init_constants = __esm({
3884
3962
  init_mcp_release();
3885
3963
  init_layout_limits();
3886
3964
  init_lint_limits();
3965
+ init_secret_scan();
3887
3966
  init_style_rules();
3888
3967
  init_generate();
3889
3968
  init_workflow_limits();
@@ -3891,6 +3970,7 @@ var init_constants = __esm({
3891
3970
  init_vendor_icons();
3892
3971
  init_icon_catalog();
3893
3972
  init_brand_aliases();
3973
+ init_brand_stand_ins();
3894
3974
  init_icon_aliases();
3895
3975
  init_icon_name_aliases();
3896
3976
  init_icon_concepts();
@@ -3942,6 +4022,185 @@ var init_ids = __esm({
3942
4022
  }
3943
4023
  });
3944
4024
 
4025
+ // ../../packages/diagrams/src/secrets/placeholders.ts
4026
+ function hasAscendingRun(value) {
4027
+ let run3 = 1;
4028
+ for (let index2 = 1; index2 < value.length; index2 += 1) {
4029
+ run3 = value.charCodeAt(index2) === value.charCodeAt(index2 - 1) + 1 ? run3 + 1 : 1;
4030
+ if (run3 >= SECRET_SCAN_LIMITS.ascendingRun) return true;
4031
+ }
4032
+ return false;
4033
+ }
4034
+ function distinctCharacters(value) {
4035
+ return new Set(value).size;
4036
+ }
4037
+ function isPlaceholder(value) {
4038
+ if (PUBLISHED_EXAMPLES.has(value)) return true;
4039
+ const lower = value.toLowerCase();
4040
+ if (PLACEHOLDER_WORDS.some((word2) => lower.includes(word2))) return true;
4041
+ if (REFERENCE_MARKS.some((mark) => value.includes(mark))) return true;
4042
+ if (value.startsWith("$") || value.startsWith("@") || value.startsWith(":")) return true;
4043
+ if (distinctCharacters(value) <= Math.max(3, Math.floor(value.length / 8))) return true;
4044
+ return hasAscendingRun(lower);
4045
+ }
4046
+ function entropyOf(value) {
4047
+ const counts = /* @__PURE__ */ new Map();
4048
+ for (const char of value) counts.set(char, (counts.get(char) ?? 0) + 1);
4049
+ let bits = 0;
4050
+ for (const count3 of counts.values()) {
4051
+ const share = count3 / value.length;
4052
+ bits -= share * Math.log2(share);
4053
+ }
4054
+ return bits;
4055
+ }
4056
+ var PLACEHOLDER_WORDS, REFERENCE_MARKS, PUBLISHED_EXAMPLES;
4057
+ var init_placeholders = __esm({
4058
+ "../../packages/diagrams/src/secrets/placeholders.ts"() {
4059
+ "use strict";
4060
+ init_constants();
4061
+ PLACEHOLDER_WORDS = [
4062
+ "example",
4063
+ "sample",
4064
+ "placeholder",
4065
+ "dummy",
4066
+ "fake",
4067
+ "redacted",
4068
+ "changeme",
4069
+ "change_me",
4070
+ "change-me",
4071
+ "replace",
4072
+ "insert",
4073
+ "your_",
4074
+ "your-",
4075
+ "yourkey",
4076
+ "yourtoken",
4077
+ "yoursecret",
4078
+ "mysecret",
4079
+ "secret_here",
4080
+ "key_here",
4081
+ "token_here",
4082
+ "todo",
4083
+ "notreal",
4084
+ "not_real"
4085
+ ];
4086
+ REFERENCE_MARKS = ["${", "$(", "{{", "<", ">", "%", "***", "...", "\u2026", "[", "]"];
4087
+ PUBLISHED_EXAMPLES = /* @__PURE__ */ new Set(["SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"]);
4088
+ }
4089
+ });
4090
+
4091
+ // ../../packages/diagrams/src/secrets/detectors.ts
4092
+ function realAfter(prefixLength) {
4093
+ return (value) => !isPlaceholder(value.slice(prefixLength));
4094
+ }
4095
+ function isJwtHeader(segment) {
4096
+ try {
4097
+ const base643 = segment.replace(/-/g, "+").replace(/_/g, "/");
4098
+ const decoded = atob(base643 + "=".repeat((4 - base643.length % 4) % 4));
4099
+ const header = JSON.parse(decoded);
4100
+ return typeof header === "object" && header !== null && "alg" in header;
4101
+ } catch {
4102
+ return false;
4103
+ }
4104
+ }
4105
+ function isRealJwt(value) {
4106
+ const [header = "", , signature = ""] = value.split(".");
4107
+ return isJwtHeader(header) && !isPlaceholder(signature);
4108
+ }
4109
+ function isRealSas(value, line3) {
4110
+ if (!/[?&]sv=\d{4}-\d{2}-\d{2}/.test(line3)) return false;
4111
+ try {
4112
+ return !isPlaceholder(decodeURIComponent(value));
4113
+ } catch {
4114
+ return false;
4115
+ }
4116
+ }
4117
+ function isRealPassword(value) {
4118
+ return !STAND_IN_PASSWORDS.has(value.toLowerCase()) && !isPlaceholder(value);
4119
+ }
4120
+ function isRandomAssigned(value) {
4121
+ if (value.length < SECRET_SCAN_LIMITS.minAssignedLength) return false;
4122
+ if (!/[A-Za-z]/.test(value) || !/\d/.test(value)) return false;
4123
+ if (value.includes("://")) return false;
4124
+ return entropyOf(value) >= SECRET_SCAN_LIMITS.minAssignedEntropy && !isPlaceholder(value);
4125
+ }
4126
+ function isAddress(value) {
4127
+ return value.split(".").every((part) => Number(part) <= 255);
4128
+ }
4129
+ function internalHostDetector(patterns) {
4130
+ const usable = patterns.filter((pattern3) => hostPatternProblem(pattern3) === null).slice(0, SECRET_SCAN_LIMITS.maxHostPatterns);
4131
+ if (usable.length === 0) return null;
4132
+ const parts = usable.map((pattern3) => pattern3.split(".").map((label) => label === "*" ? "[a-z0-9-]{1,63}(?:\\.[a-z0-9-]{1,63}){0,8}" : label.replace(/-/g, "\\-")).join("\\."));
4133
+ return { kind: "internal-host", pattern: new RegExp(`()(?<![A-Za-z0-9.-])((?:${parts.join("|")}))(?![A-Za-z0-9-]|\\.[A-Za-z0-9])`, "gi") };
4134
+ }
4135
+ var STAND_IN_PASSWORDS, DETECTORS, PRIVATE_IP_DETECTOR;
4136
+ var init_detectors = __esm({
4137
+ "../../packages/diagrams/src/secrets/detectors.ts"() {
4138
+ "use strict";
4139
+ init_constants();
4140
+ init_placeholders();
4141
+ STAND_IN_PASSWORDS = /* @__PURE__ */ new Set(["password", "passwd", "pass", "pwd", "secret", "user", "username", "root", "admin"]);
4142
+ DETECTORS = [
4143
+ { kind: "plotwork-key", pattern: /()\b(pw_[0-9a-f]{64})(?![0-9a-z])/g },
4144
+ { kind: "aws-access-key", pattern: /()\b((?:AKIA|ASIA|ABIA|ACCA)[A-Z0-9]{16})(?![A-Z0-9])/g, accept: realAfter(4) },
4145
+ { kind: "aws-secret-key", pattern: /(\baws_?secret_?(?:access_?)?key\\?["']?\s{0,4}[:=]\s{0,4}\\?["']?)([A-Za-z0-9/+]{40})(?![A-Za-z0-9/+])/gi, accept: realAfter(0) },
4146
+ { kind: "gcp-api-key", pattern: /()\b(AIza[0-9A-Za-z_-]{35})(?![0-9A-Za-z_-])/g, accept: realAfter(4) },
4147
+ { kind: "gcp-service-account", pattern: /(\\?"private_key_id\\?"\s{0,4}:\s{0,4}\\?")([0-9a-f]{40})(?![0-9a-f])/g, accept: realAfter(0) },
4148
+ { kind: "azure-storage-key", pattern: /(\b(?:AccountKey|SharedAccessKey)=)([A-Za-z0-9+/]{40,120}={0,2})/g, accept: realAfter(0) },
4149
+ { kind: "azure-sas-token", pattern: /([?&]sig=)([A-Za-z0-9%+/]{30,200})/g, accept: isRealSas },
4150
+ { kind: "github-token", pattern: /()\b(gh[pousr]_[A-Za-z0-9]{36}|github_pat_[A-Za-z0-9]{22}_[A-Za-z0-9]{59})(?![A-Za-z0-9_])/g, accept: (value) => realAfter(value.startsWith("github_pat_") ? 11 : 4)(value) },
4151
+ { kind: "slack-token", pattern: /()\b(xox[abposr]-[0-9A-Za-z-]{10,250}|xapp-\d-[0-9A-Za-z-]{10,250})/g, accept: realAfter(5) },
4152
+ { kind: "slack-webhook", pattern: /()(https:\/\/hooks\.slack\.com\/(?:services|workflows|triggers)\/[A-Za-z0-9_/-]{20,200})/g, accept: realAfter(30) },
4153
+ { kind: "stripe-key", pattern: /()\b((?:sk|rk)_live_[0-9A-Za-z]{20,250}|whsec_[0-9A-Za-z]{24,250})(?![0-9A-Za-z])/g, accept: (value) => realAfter(value.indexOf("_", 3) + 1)(value) },
4154
+ { kind: "jwt", pattern: /()\b(eyJ[A-Za-z0-9_-]{8,2000}\.eyJ[A-Za-z0-9_-]{8,4000}\.[A-Za-z0-9_-]{16,1000})(?![A-Za-z0-9_-])/g, accept: isRealJwt },
4155
+ { kind: "private-key", pattern: /()(-----BEGIN (?:RSA |EC |DSA |OPENSSH |ENCRYPTED |PGP )?PRIVATE KEY(?: BLOCK)?-----)/g },
4156
+ {
4157
+ kind: "connection-string",
4158
+ pattern: /(\b[a-zA-Z][a-zA-Z0-9+.-]{1,30}:\/\/[^\s:/@"'<>]{1,100}:)([^\s@/"'<>]{1,200})(?=@[^\s"'@])/g,
4159
+ accept: isRealPassword
4160
+ },
4161
+ {
4162
+ kind: "assigned-secret",
4163
+ pattern: /((?<![A-Za-z0-9_.-])[A-Za-z0-9_.-]{0,40}(?:password|passwd|pwd|pass|secret(?:[_-]?key)?|client[_-]?secret|token|api[_-]?key|apikey|access[_-]?key|private[_-]?key|auth[_-]?key)\b\\?["']?\s{0,4}[:=]\s{0,4}\\?["']?)([^\s"'\\,;&]{1,500})/gi,
4164
+ accept: isRandomAssigned
4165
+ }
4166
+ ];
4167
+ PRIVATE_IP_DETECTOR = {
4168
+ kind: "private-ip",
4169
+ pattern: /()(?<![0-9.])((?:10\.\d{1,3}|172\.(?:1[6-9]|2\d|3[01])|192\.168)\.\d{1,3}\.\d{1,3})(?![0-9]|\.\d)/g,
4170
+ accept: isAddress
4171
+ };
4172
+ }
4173
+ });
4174
+
4175
+ // ../../packages/diagrams/src/secrets/find-spans.ts
4176
+ function secretSpans(text3, detectors = DETECTORS) {
4177
+ const found = [];
4178
+ for (const detector of detectors) {
4179
+ const pattern3 = new RegExp(detector.pattern.source, detector.pattern.flags);
4180
+ for (let match = pattern3.exec(text3); match !== null; match = pattern3.exec(text3)) {
4181
+ const value = match[2] ?? "";
4182
+ if (value === "") continue;
4183
+ const start2 = match.index + (match[1] ?? "").length;
4184
+ const end = start2 + value.length;
4185
+ if (found.some((other) => start2 < other.end && other.start < end)) continue;
4186
+ if (detector.accept !== void 0 && !detector.accept(value, text3)) continue;
4187
+ found.push({ kind: detector.kind, start: start2, end, value });
4188
+ }
4189
+ }
4190
+ return found.sort((a, b) => a.start - b.start);
4191
+ }
4192
+ function maskSecretSpans(text3) {
4193
+ let out = text3;
4194
+ for (const span of secretSpans(text3)) out = out.slice(0, span.start) + "*".repeat(span.end - span.start) + out.slice(span.end);
4195
+ return out;
4196
+ }
4197
+ var init_find_spans = __esm({
4198
+ "../../packages/diagrams/src/secrets/find-spans.ts"() {
4199
+ "use strict";
4200
+ init_detectors();
4201
+ }
4202
+ });
4203
+
3945
4204
  // ../../packages/diagrams/src/core/diagnostics.ts
3946
4205
  function severityOfCode(code) {
3947
4206
  return code.startsWith("W") || code.startsWith("M2") || code.startsWith("I2") || code.startsWith("S2") ? "warning" : "error";
@@ -3954,7 +4213,8 @@ function warningAt(code, message2, position, hint2 = null) {
3954
4213
  }
3955
4214
  function formatDiagnostic(diagnostic, source) {
3956
4215
  const lines = source.split("\n");
3957
- const sourceLine = lines[diagnostic.line - 1] ?? "";
4216
+ const shown = maskSecretSpans(lines[diagnostic.line - 1] ?? "");
4217
+ const sourceLine = diagnostic.code.startsWith("W7") ? shown.slice(0, diagnostic.column - 1) + "*".repeat(diagnostic.length) + shown.slice(diagnostic.column - 1 + diagnostic.length) : shown;
3958
4218
  const gutter = String(diagnostic.line).padStart(4, " ");
3959
4219
  const caret = `${" ".repeat(diagnostic.column - 1)}${"^".repeat(Math.max(1, diagnostic.length))}`;
3960
4220
  const parts = [
@@ -3969,6 +4229,7 @@ var DIAGNOSTIC_CODES, STYLE_HINT_CODES;
3969
4229
  var init_diagnostics = __esm({
3970
4230
  "../../packages/diagrams/src/core/diagnostics.ts"() {
3971
4231
  "use strict";
4232
+ init_find_spans();
3972
4233
  DIAGNOSTIC_CODES = {
3973
4234
  syntax: "E100",
3974
4235
  unterminatedString: "E101",
@@ -3976,7 +4237,6 @@ var init_diagnostics = __esm({
3976
4237
  missingHeader: "E111",
3977
4238
  unknownNodeType: "E120",
3978
4239
  unknownTone: "E121",
3979
- unknownIcon: "E122",
3980
4240
  unknownDirection: "E123",
3981
4241
  unknownGroupType: "E124",
3982
4242
  unknownProvider: "E125",
@@ -3999,9 +4259,32 @@ var init_diagnostics = __esm({
3999
4259
  suggestGroupType: "W205",
4000
4260
  overlayCovers: "W206",
4001
4261
  iconArtMissing: "W207",
4262
+ // An icon= name that is not bundled. A warning since 2026-10-20 (it was error E122): the item draws its default icon, so a missing
4263
+ // brand never stops a drawing, and the hint names the closest icons.
4264
+ unknownIcon: "W208",
4002
4265
  // Style suggestions. W5xx says how a valid diagram would look more finished; like W204 and W205 it is a suggestion, not a problem
4003
4266
  // (`isStyleHint`), so a check that fails on warnings passes it.
4004
4267
  suggestLineRole: "W500",
4268
+ // Hosted service. W6xx comes from the hosted service, never from the engine: W600 says an organisation's "Agents publish every
4269
+ // diagram they draw" could not keep this drawing (the library is at its limit, the diagram of that title is locked), which never
4270
+ // stops the drawing. W601 says the organisation's "Publishing needs approval" held the diagram until an approver decides: it is
4271
+ // stored, and only its publisher and the approvers can see it.
4272
+ notPublished: "W600",
4273
+ heldForApproval: "W601",
4274
+ // Secrets (src/secrets). W7xx says the source holds something that looks like a credential. It is a warning everywhere, so a
4275
+ // drawing is never stopped, and not a style hint, so a check that fails on warnings fails on it. An organisation may refuse a
4276
+ // publish that has one. W709 and W710 run only when asked for, because private addresses and internal names are often meant.
4277
+ secretCloudKey: "W700",
4278
+ secretSourceToken: "W701",
4279
+ secretChatToken: "W702",
4280
+ secretPaymentKey: "W703",
4281
+ secretJwt: "W704",
4282
+ secretPrivateKey: "W705",
4283
+ secretAssigned: "W706",
4284
+ secretConnectionString: "W707",
4285
+ secretPlotworkKey: "W708",
4286
+ secretPrivateIp: "W709",
4287
+ secretInternalHost: "W710",
4005
4288
  // Mermaid import. M1xx stops a conversion; M2xx reports something dropped or changed and never stops it.
4006
4289
  // They point into the Mermaid source that was submitted, not into the Plotwork source.
4007
4290
  mermaidNotDiagram: "M100",
@@ -4801,6 +5084,7 @@ var init_simple_catalog_generated = __esm({
4801
5084
  "xero": { viewBox: "0 0 24 24", brandHex: "13B5EA" },
4802
5085
  "hubspot": { viewBox: "0 0 24 24", brandHex: "FF7A59" },
4803
5086
  "zendesk": { viewBox: "0 0 24 24", brandHex: "03363D" },
5087
+ "sap": { viewBox: "0 0 24 24", brandHex: "0FAAFF" },
4804
5088
  "intercom": { viewBox: "0 0 24 24", brandHex: "6AFDEF" },
4805
5089
  "atlassian": { viewBox: "0 0 24 24", brandHex: "0052CC" },
4806
5090
  "confluence": { viewBox: "0 0 24 24", brandHex: "172B4D" },
@@ -4986,6 +5270,7 @@ var init_simple_catalog_generated = __esm({
4986
5270
  "springboot": '<path d="m23.693 10.7058-4.73-8.1844c-.4094-.7106-1.4166-1.2942-2.2402-1.2942H7.2725c-.819 0-1.8308.5836-2.2402 1.2942L.307 10.7058c-.4095.7106-.4095 1.873 0 2.5837l4.7252 8.189c.4094.7107 1.4166 1.2943 2.2402 1.2943h9.455c.819 0 1.826-.5836 2.2402-1.2942l4.7252-8.189c.4095-.7107.4095-1.8732 0-2.5838zM10.9763 5.7547c0-.5365.4377-.9742.9742-.9742s.9742.4377.9742.9742v5.8217c0 .5366-.4377.9742-.9742.9742s-.9742-.4376-.9742-.9742zm.9742 12.4294c-3.6427 0-6.6077-2.965-6.6077-6.6077.0047-2.0896.993-4.0521 2.6685-5.304a.8657.8657 0 0 1 1.2142.1788.8657.8657 0 0 1-.1788 1.2143c-2.1602 1.6048-2.612 4.6592-1.0072 6.8194 1.6049 2.1603 4.6593 2.612 6.8195 1.0072 1.2378-.9177 1.9673-2.372 1.9673-3.9157a4.8972 4.8972 0 0 0-1.9861-3.925c-.386-.2824-.466-.8284-.1836-1.2143.2824-.386.8283-.466 1.2143-.1835 1.6895 1.2471 2.6826 3.2238 2.6873 5.3228 0 3.6474-2.965 6.6077-6.6077 6.6077z"/>',
4987
5271
  "php": '<path d="M7.01 10.207h-.944l-.515 2.648h.838c.556 0 .97-.105 1.242-.314.272-.21.455-.559.55-1.049.092-.47.05-.802-.124-.995-.175-.193-.523-.29-1.047-.29zM12 5.688C5.373 5.688 0 8.514 0 12s5.373 6.313 12 6.313S24 15.486 24 12c0-3.486-5.373-6.312-12-6.312zm-3.26 7.451c-.261.25-.575.438-.917.551-.336.108-.765.164-1.285.164H5.357l-.327 1.681H3.652l1.23-6.326h2.65c.797 0 1.378.209 1.744.628.366.418.476 1.002.33 1.752a2.836 2.836 0 0 1-.305.847c-.143.255-.33.49-.561.703zm4.024.715l.543-2.799c.063-.318.039-.536-.068-.651-.107-.116-.336-.174-.687-.174H11.46l-.704 3.625H9.388l1.23-6.327h1.367l-.327 1.682h1.218c.767 0 1.295.134 1.586.401s.378.7.263 1.299l-.572 2.944h-1.389zm7.597-2.265a2.782 2.782 0 0 1-.305.847c-.143.255-.33.49-.561.703a2.44 2.44 0 0 1-.917.551c-.336.108-.765.164-1.286.164h-1.18l-.327 1.682h-1.378l1.23-6.326h2.649c.797 0 1.378.209 1.744.628.366.417.477 1.001.331 1.751zM17.766 10.207h-.943l-.516 2.648h.838c.557 0 .971-.105 1.242-.314.272-.21.455-.559.551-1.049.092-.47.049-.802-.125-.995s-.524-.29-1.047-.29z"/>',
4988
5272
  "opentelemetry": '<path d="M12.6974 13.1173c-1.0224 1.0224-1.0224 2.68 0 3.7024 1.0224 1.0224 2.68 1.0224 3.7024 0 1.0224-1.0223 1.0224-2.68 0-3.7024-1.0223-1.0223-2.68-1.0223-3.7024 0zm2.7677 2.7701c-.5063.5063-1.3267.5063-1.833 0s-.5063-1.3266 0-1.833c.5063-.5062 1.3267-.5062 1.833 0 .5063.504.5063 1.3267 0 1.833zM16.356.2355l-1.6041 1.6042c-.314.314-.314.83 0 1.144L21.015 9.247c.314.314.83.314 1.144 0l1.6042-1.6041c.314-.314.314-.83 0-1.144L17.4976.2354c-.314-.314-.8276-.314-1.1416 0zM5.1173 20.734c.2848-.2848.2848-.7497 0-1.0345l-.8155-.8155c-.2848-.2848-.7497-.2848-1.0345 0l-1.6845 1.6845-.0024.0024-.4625-.4625c-.2556-.2556-.6718-.2556-.925 0-.2556.2556-.2556.6718 0 .925l2.775 2.775c.2556.2556.6718.2556.925 0 .2532-.2556.2556-.6718 0-.925l-.4625-.4625.0024-.0024zm8.4856-15.893-3.5637 3.5637c-.3164.3164-.3164.8374 0 1.1538l2.2006 2.2005c1.5554-1.1197 3.7365-.981 5.1361.4187l1.7819-1.7818c.3164-.3165.3164-.8374 0-1.1538l-4.401-4.401c-.3165-.319-.8374-.319-1.1539 0zm-2.2881 7.8455-1.2999-1.2999c-.3043-.3043-.8033-.3043-1.1076 0l-4.5836 4.586c-.3042.3043-.3042.8033 0 1.1076l2.5973 2.5973c.3043.3043.8033.3043 1.1076 0l2.9478-2.9527c-.6231-1.2877-.5112-2.8431.3384-4.0383z"/>',
5273
+ "jira": '<path d="M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z"/>',
4989
5274
  "googlebigquery": '<path d="M5.676 10.595h2.052v5.244a5.892 5.892 0 0 1-2.052-2.088v-3.156zm18.179 10.836a.504.504 0 0 1 0 .708l-1.716 1.716a.504.504 0 0 1-.708 0l-4.248-4.248a.206.206 0 0 1-.007-.007c-.02-.02-.028-.045-.043-.066a10.736 10.736 0 0 1-6.334 2.065C4.835 21.599 0 16.764 0 10.799S4.835 0 10.8 0s10.799 4.835 10.799 10.8c0 2.369-.772 4.553-2.066 6.333.025.017.052.028.074.05l4.248 4.248zm-5.028-10.632a8.015 8.015 0 1 0-8.028 8.028h.024a8.016 8.016 0 0 0 8.004-8.028zm-4.86 4.98a6.002 6.002 0 0 0 2.04-2.184v-1.764h-2.04v3.948zm-4.5.948c.442.057.887.08 1.332.072.4.025.8.025 1.2 0V7.692H9.468v9.035z"/>',
4990
5275
  "googlebigtable": '<path d="M10.511.278s0-.4.456-.24c.267.094 3.728 2.243 5.88 3.533l.006.003.364.217c.004.003.007.009.011.011.322.2.656.42 1.006.673.27.165.43.463.42.78l-.06 7.566a.42.42 0 0 1-.192.396l-1.2.815V5.436c-.042-.034-.083-.07-.131-.098l-5.06-3.01c-.744-.466-1.5-1.642-1.5-2.05zm-2.89 12.171 4.39 2.614 4.388-2.566v-1.079L12.25 13.84a.78.78 0 0 1-.24.072.43.43 0 0 1-.24-.072l-4.149-2.47v1.08zm0 1.943c0 .17.086.327.228.42l3.933 2.398c.123.06.162.07.228.064.088-.003.173-.074.252-.112l3.933-2.398a.468.468 0 0 0 .228-.42v-.791L12.25 16.07a.432.432 0 0 1-.48 0L7.621 13.6v.79zm8.778-4.137v-.516a.467.467 0 0 0-.228-.408l-3.933-2.398a.444.444 0 0 0-.456 0L7.85 9.331a.492.492 0 0 0-.228.408v.516l4.39 2.614 4.388-2.614zm-4.473 11.332L6.95 18.625c-.041-.025-.06-.07-.096-.1v-8.63l-1.2.708a.491.491 0 0 0-.227.395v7.867a.9.9 0 0 0 .407.72l1.272.79c-.002 0-.003-.003-.005-.004l6.024 3.59a.216.216 0 0 0 .336-.216 3.262 3.262 0 0 0-1.535-2.158zM8.891 4.097a.845.845 0 0 1 .859.009L16.41 8.06V6.645a.444.444 0 0 0-.24-.371l-6.38-3.778a.81.81 0 0 0-.85-.012l-1.433.856C5.56 4.498 1.525 6.893 1.36 6.975a.276.276 0 0 0 0 .48 3.154 3.154 0 0 0 2.495-.312L8.89 4.097zM22.635 16.49a3.154 3.154 0 0 0-2.519.3l-5.036 2.986a.875.875 0 0 1-.887 0l-.018-.006-6.554-3.867v1.39c.021.152.093.292.204.397l6.356 3.765a.84.84 0 0 0 .887 0l1.415-.863h-.004l6.156-3.646a.252.252 0 0 0 0-.456zM10.967 6.13l-1.2-.708a.407.407 0 0 0-.431 0L3.688 8.756a.863.863 0 0 0-.456.767v8.862a.216.216 0 0 0 .36.156 3.297 3.297 0 0 0 1.043-2.398v-5.996a.9.9 0 0 1 .098-.367l6.234-3.65zm2.11 11.728 1.2.683a.42.42 0 0 0 .443 0l5.684-3.418c.335-.207.442-.408.442-.706l.002-.001V12.665c0 .006-.004.01-.004.017-.006-2.494-.013-6.831.004-7.104.024-.384-.372-.252-.372-.252a3.37 3.37 0 0 0-1.007 2.399v5.995a.97.97 0 0 1-.191.413l-6.2 3.725z"/>',
4991
5276
  "googlecloudspanner": '<path d="M12 9.06 7.944 6.864V2.388L10.38.924v3.66l1.62.744 1.62-.744V.924l2.436 1.464v4.476L12 9.06zm-8.124 4.752L0 16.056v2.988l3.228-1.86 1.404.912.096 1.632-3.24 1.872 2.616 1.476 3.828-2.268-.132-4.596-3.924-2.4zm9.732-.9V8.758l-1.37.742-.238.129-.238-.13-1.37-.741v4.154l-3.613 2.09 1.282.783.231.142.008.27.046 1.612L12 15.696l3.595 2.079.045-1.59.008-.27.231-.142 1.301-.795-3.572-2.066zm7.164 4.272L24 19.044v-2.988L20.064 13.8l-3.924 2.4-.132 4.596 3.888 2.244 2.616-1.44-3.24-1.836.096-1.668 1.404-.912z"/>',
@@ -5013,6 +5298,7 @@ var init_simple_catalog_generated = __esm({
5013
5298
  "flydotio": '<path d="M11.987 0c-2.45-.01-5.002.925-6.541 2.897-1.17 1.502-1.664 3.474-1.49 5.356.29 2.112 1.476 3.96 2.676 5.672a41.5 41.5 0 0 0 4.216 4.831c-1.063.832-1.943 2.286-1.357 3.644.821 2.32 4.665 2.05 5.122-.372.39-1.288-.694-2.533-1.428-3.309 2.388-2.431 4.706-5.036 6.17-8.145.595-1.32.902-2.802.614-4.24-.28-2.341-1.823-4.473-3.967-5.46C14.76.266 13.364.016 11.987 0m-.236 1.577v15.534C9.881 13.483 7.724 9.266 8.73 5.069c.35-1.539 1.253-3.309 3.02-3.492m1.996.04c1.534.357 3.031 1.096 3.906 2.48 1.3 1.93 1.318 4.55.1 6.521-1.268 2.395-3.06 4.463-4.916 6.415 1.472-2.974 3.074-6.106 3.182-9.5-.043-2.08-.438-4.612-2.272-5.916M11.97 20.103c.848.342 1.597 1.983.153 2.173-.664.15-1.367-.599-.995-1.222.213-.355.488-.73.842-.95"/>',
5014
5299
  "openstack": '<path d="M18.575 9.29h5.418v5.42h-5.418zM0 9.29h5.419v5.42H0zm18.575 7.827a1.207 1.207 0 0 1-1.206 1.206H6.623a1.207 1.207 0 0 1-1.205-1.206v-.858H0v5.252a2.236 2.236 0 0 0 2.229 2.23h19.53A2.237 2.237 0 0 0 24 21.512V16.26h-5.425zM21.763.258H2.233a2.236 2.236 0 0 0-2.23 2.23V7.74h5.419v-.858a1.206 1.206 0 0 1 1.205-1.206h10.746a1.206 1.206 0 0 1 1.205 1.206v.858H24V2.487A2.237 2.237 0 0 0 21.763.258Z"/>',
5015
5300
  "wordpress": '<path d="M21.469 6.825c.84 1.537 1.318 3.3 1.318 5.175 0 3.979-2.156 7.456-5.363 9.325l3.295-9.527c.615-1.54.82-2.771.82-3.864 0-.405-.026-.78-.07-1.11m-7.981.105c.647-.03 1.232-.105 1.232-.105.582-.075.514-.93-.067-.899 0 0-1.755.135-2.88.135-1.064 0-2.85-.15-2.85-.15-.585-.03-.661.855-.075.885 0 0 .54.061 1.125.09l1.68 4.605-2.37 7.08L5.354 6.9c.649-.03 1.234-.1 1.234-.1.585-.075.516-.93-.065-.896 0 0-1.746.138-2.874.138-.2 0-.438-.008-.69-.015C4.911 3.15 8.235 1.215 12 1.215c2.809 0 5.365 1.072 7.286 2.833-.046-.003-.091-.009-.141-.009-1.06 0-1.812.923-1.812 1.914 0 .89.513 1.643 1.06 2.531.411.72.89 1.643.89 2.977 0 .915-.354 1.994-.821 3.479l-1.075 3.585-3.9-11.61.001.014zM12 22.784c-1.059 0-2.081-.153-3.048-.437l3.237-9.406 3.315 9.087c.024.053.05.101.078.149-1.12.393-2.325.609-3.582.609M1.211 12c0-1.564.336-3.05.935-4.39L7.29 21.709C3.694 19.96 1.212 16.271 1.211 12M12 0C5.385 0 0 5.385 0 12s5.385 12 12 12 12-5.385 12-12S18.615 0 12 0"/>',
5301
+ "sap": '<path d="M0 6.064v11.872h12.13L24 6.064zm3.264 2.208h.005c.863.001 1.915.245 2.676.633l-.82 1.43c-.835-.404-1.255-.442-1.73-.467-.708-.038-1.064.215-1.069.488-.007.332.669.633 1.305.838.964.306 2.19.715 2.377 1.9L7.77 8.437h2.046l2.064 5.576-.007-5.575h2.37c2.257 0 3.318.764 3.318 2.519 0 1.575-1.09 2.514-2.936 2.514h-.763l-.01 2.094-3.588-.003-.25-.908c-.37.122-.787.189-1.23.189-.456 0-.885-.071-1.263-.2l-.358.919-2 .006.09-.462c-.029.025-.057.05-.087.074-.535.43-1.208.629-2.037.644l-.213.002a5.075 5.075 0 0 1-2.581-.675l.73-1.448c.79.467 1.286.572 1.956.558.347-.007.598-.07.761-.239a.557.557 0 0 0 .156-.369c.007-.376-.53-.553-1.185-.756-.531-.164-1.135-.389-1.606-.735-.559-.41-.825-.924-.812-1.65a1.99 1.99 0 0 1 .566-1.377c.519-.537 1.357-.863 2.363-.863zm10.597 1.67v1.904h.521c.694 0 1.247-.23 1.248-.964 0-.709-.554-.94-1.248-.94zm-5.087.767l-.748 2.362c.223.085.481.133.757.133.268 0 .52-.047.742-.126l-.736-2.37z"/>',
5016
5302
  "confluence": '<path d="M.87 18.257c-.248.382-.53.875-.763 1.245a.764.764 0 0 0 .255 1.04l4.965 3.054a.764.764 0 0 0 1.058-.26c.199-.332.454-.763.733-1.221 1.967-3.247 3.945-2.853 7.508-1.146l4.957 2.337a.764.764 0 0 0 1.028-.382l2.364-5.346a.764.764 0 0 0-.382-1 599.851 599.851 0 0 1-4.965-2.361C10.911 10.97 5.224 11.185.87 18.257zM23.131 5.743c.249-.405.531-.875.764-1.25a.764.764 0 0 0-.256-1.034L18.675.404a.764.764 0 0 0-1.058.26c-.195.335-.451.763-.734 1.225-1.966 3.246-3.945 2.85-7.508 1.146L4.437.694a.764.764 0 0 0-1.027.382L1.046 6.422a.764.764 0 0 0 .382 1c1.039.49 3.105 1.467 4.965 2.361 6.698 3.246 12.392 3.029 16.738-4.04z"/>',
5017
5303
  "zapier": '<path d="M4.157 0A4.151 4.151 0 0 0 0 4.161v15.678A4.151 4.151 0 0 0 4.157 24h15.682A4.152 4.152 0 0 0 24 19.839V4.161A4.152 4.152 0 0 0 19.839 0H4.157Zm10.61 8.761h.03a.577.577 0 0 1 .23.038.585.585 0 0 1 .201.124.63.63 0 0 1 .162.431.612.612 0 0 1-.162.435.58.58 0 0 1-.201.128.58.58 0 0 1-.23.042.529.529 0 0 1-.235-.042.585.585 0 0 1-.332-.328.559.559 0 0 1-.038-.235.613.613 0 0 1 .17-.431.59.59 0 0 1 .405-.162Zm2.853 1.572c.03.004.061.004.095.004.325-.011.646.064.937.219.238.144.431.355.552.609.128.279.189.582.185.888v.193a2 2 0 0 1 0 .219h-2.498c.003.227.075.45.204.642a.78.78 0 0 0 .646.265.714.714 0 0 0 .484-.136.642.642 0 0 0 .23-.318l.915.257a1.398 1.398 0 0 1-.28.537c-.14.159-.321.284-.521.355a2.234 2.234 0 0 1-.836.136 1.923 1.923 0 0 1-1.001-.245 1.618 1.618 0 0 1-.665-.703 2.221 2.221 0 0 1-.227-1.036 1.95 1.95 0 0 1 .48-1.398 1.9 1.9 0 0 1 1.3-.488Zm-9.607.023c.162.004.325.026.48.079.207.065.4.174.563.314.26.302.393.692.366 1.088v2.276H8.53l-.109-.711h-.065c-.064.163-.155.31-.272.439a1.122 1.122 0 0 1-.374.264 1.023 1.023 0 0 1-.453.083 1.334 1.334 0 0 1-.866-.264.965.965 0 0 1-.329-.801.993.993 0 0 1 .076-.431 1.02 1.02 0 0 1 .242-.363 1.478 1.478 0 0 1 1.043-.303h.952v-.181a.696.696 0 0 0-.136-.454.553.553 0 0 0-.438-.154.695.695 0 0 0-.378.086.48.48 0 0 0-.193.254l-.99-.144a1.26 1.26 0 0 1 .257-.563c.14-.174.321-.302.533-.378.261-.091.54-.136.82-.129.053-.003.106-.007.163-.007Zm4.384.007c.174 0 .347.038.506.114.182.083.34.211.458.374.257.423.377.911.351 1.406a2.53 2.53 0 0 1-.355 1.448 1.148 1.148 0 0 1-1.009.517c-.204 0-.401-.045-.582-.136a1.052 1.052 0 0 1-.48-.457 1.298 1.298 0 0 1-.114-.234h-.045l.004 1.784h-1.059v-4.713h.904l.117.805h.057c.068-.208.177-.401.328-.56a1.129 1.129 0 0 1 .843-.344h.076v-.004Zm7.559.084h.903l.113.805h.053a1.37 1.37 0 0 1 .235-.484.813.813 0 0 1 .313-.242.82.82 0 0 1 .39-.076h.234v1.051h-.401a.662.662 0 0 0-.313.008.623.623 0 0 0-.272.155.663.663 0 0 0-.174.26.683.683 0 0 0-.027.314v1.875h-1.054v-3.666Zm-17.515.003h3.262v.896L3.73 13.104l.034.113h1.973l.042.9H2.4v-.9l1.931-1.754-.045-.117H2.441v-.896Zm11.815 0h1.055v3.659h-1.055V10.45Zm3.443.684.019.016a.69.69 0 0 0-.351.045.756.756 0 0 0-.287.204c-.11.155-.174.336-.189.522h1.545c-.034-.526-.257-.787-.74-.787h.003Zm-5.718.163c-.026 0-.057 0-.083.004a.78.78 0 0 0-.31.053.746.746 0 0 0-.257.189 1.016 1.016 0 0 0-.204.695v.064c-.015.257.057.507.204.711a.634.634 0 0 0 .253.196.638.638 0 0 0 .314.061.644.644 0 0 0 .578-.265c.14-.223.204-.48.189-.74a1.216 1.216 0 0 0-.181-.711.677.677 0 0 0-.503-.257Zm-4.509 1.266a.464.464 0 0 0-.268.102.373.373 0 0 0-.114.276c0 .053.008.106.027.155a.375.375 0 0 0 .087.132.576.576 0 0 0 .397.11v.004a.863.863 0 0 0 .563-.182.573.573 0 0 0 .211-.457v-.14h-.903Z"/>',
5018
5304
  "googledrive": '<path d="M12.01 1.485c-2.082 0-3.754.02-3.743.047.01.02 1.708 3.001 3.774 6.62l3.76 6.574h3.76c2.081 0 3.753-.02 3.742-.047-.005-.02-1.708-3.001-3.775-6.62l-3.76-6.574zm-4.76 1.73a789.828 789.861 0 0 0-3.63 6.319L0 15.868l1.89 3.298 1.885 3.297 3.62-6.335 3.618-6.33-1.88-3.287C8.1 4.704 7.255 3.22 7.25 3.214zm2.259 12.653-.203.348c-.114.198-.96 1.672-1.88 3.287a423.93 423.948 0 0 1-1.698 2.97c-.01.026 3.24.042 7.222.042h7.244l1.796-3.157c.992-1.734 1.85-3.23 1.906-3.323l.104-.167h-7.249z"/>',
@@ -5203,6 +5489,7 @@ var init_core_art_generated = __esm({
5203
5489
  "712b426f54f0fc50d0816dc79df709daa7ac5f93ccaf4e9b3527f627f6e9ad97": '<svg id="bc93169a-24c4-4686-9f37-c7e4f53b3d34" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><radialGradient id="fb114c93-7c16-4540-899a-0796041629e6" cx="9" cy="9" r="8.5" gradientUnits="userSpaceOnUse"><stop offset="0.18" stop-color="#5ea0ef" /><stop offset="0.56" stop-color="#5c9fee" /><stop offset="0.69" stop-color="#559ced" /><stop offset="0.78" stop-color="#4a97e9" /><stop offset="0.86" stop-color="#3990e4" /><stop offset="0.93" stop-color="#2387de" /><stop offset="0.99" stop-color="#087bd6" /><stop offset="1" stop-color="#0078d4" /></radialGradient><radialGradient id="ec478bd3-5b38-4e7f-b661-11f355578bff" cx="38.95" cy="182.07" r="9.88" gradientTransform="translate(-28.71 -163.24) scale(0.94 0.94)" gradientUnits="userSpaceOnUse"><stop offset="0.27" stop-color="#ffd70f" /><stop offset="0.49" stop-color="#ffcb12" /><stop offset="0.88" stop-color="#feac19" /><stop offset="1" stop-color="#fea11b" /></radialGradient></defs><title>Icon-security-245</title><path id="aacf8311-a317-400f-b613-74bd00da5ce3" d="M9,.5A8.5,8.5,0,1,0,17.5,9,8.51,8.51,0,0,0,9,.5ZM9,16.34A7.34,7.34,0,1,1,16.34,9,7.34,7.34,0,0,1,9,16.34Z" fill="url(#fb114c93-7c16-4540-899a-0796041629e6)" /><circle cx="9" cy="9" r="7.34" fill="#fff" /><g><path id="bd983c41-db73-40ec-a4f4-da1213fc9924" d="M13.44,7.33a1.84,1.84,0,0,0,0-2.59h0L10.29,1.58a1.83,1.83,0,0,0-2.58,0h0L4.56,4.74a1.84,1.84,0,0,0,0,2.59L7.18,10a.51.51,0,0,1,.15.36v4.88a.63.63,0,0,0,.18.44l1.2,1.2a.41.41,0,0,0,.58,0l1.16-1.16h0l.68-.68a.25.25,0,0,0,0-.34l-.49-.49a.27.27,0,0,1,0-.37l.49-.49a.25.25,0,0,0,0-.34l-.49-.49a.27.27,0,0,1,0-.37l.49-.49a.25.25,0,0,0,0-.34l-.68-.69v-.25ZM9,2.35A1,1,0,0,1,9,4.42,1,1,0,1,1,9,2.35Z" fill="url(#ec478bd3-5b38-4e7f-b661-11f355578bff)" /><path id="ad2e7e44-9bfd-4775-8bf4-8ef26a544921" d="M8.18,15.3h0a.23.23,0,0,0,.38-.17v-4a.24.24,0,0,0-.11-.2h0a.22.22,0,0,0-.34.2v4A.28.28,0,0,0,8.18,15.3Z" fill="#ff9300" opacity="0.75" /><rect id="a996fbff-3936-4b24-b407-369336c143ba" x="6.48" y="5.79" width="5.17" height="0.61" rx="0.28" fill="#ff9300" opacity="0.75" /><rect id="bb12d31c-3352-4a18-87dd-a169a4a8721d" x="6.48" y="6.78" width="5.17" height="0.61" rx="0.28" fill="#ff9300" opacity="0.75" /></g></svg>',
5204
5490
  "7190d3bb14ce30ce74bd0af873915830fe821e8c5f6ef6f3149e6f7cfb2aa4f7": '<svg id="f2f04349-8aee-4413-84c9-a9053611b319" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="ad4c4f96-09aa-4f91-ba10-5cb8ad530f74" x1="9" y1="15.83" x2="9" y2="5.79" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#b3b3b3" /><stop offset="0.26" stop-color="#c1c1c1" /><stop offset="1" stop-color="#e6e6e6" /></linearGradient></defs><title>Icon-storage-86</title><path d="M.5,5.79h17a0,0,0,0,1,0,0v9.48a.57.57,0,0,1-.57.57H1.07a.57.57,0,0,1-.57-.57V5.79A0,0,0,0,1,.5,5.79Z" fill="url(#ad4c4f96-09aa-4f91-ba10-5cb8ad530f74)" /><path d="M1.07,2.17H16.93a.57.57,0,0,1,.57.57V5.79a0,0,0,0,1,0,0H.5a0,0,0,0,1,0,0V2.73A.57.57,0,0,1,1.07,2.17Z" fill="#37c2b1" /><path d="M2.81,6.89H15.18a.27.27,0,0,1,.26.27v1.4a.27.27,0,0,1-.26.27H2.81a.27.27,0,0,1-.26-.27V7.16A.27.27,0,0,1,2.81,6.89Z" fill="#fff" /><path d="M2.82,9.68H15.19a.27.27,0,0,1,.26.27v1.41a.27.27,0,0,1-.26.27H2.82a.27.27,0,0,1-.26-.27V10A.27.27,0,0,1,2.82,9.68Z" fill="#37c2b1" /><path d="M2.82,12.5H15.19a.27.27,0,0,1,.26.27v1.41a.27.27,0,0,1-.26.27H2.82a.27.27,0,0,1-.26-.27V12.77A.27.27,0,0,1,2.82,12.5Z" fill="#258277" /></svg>',
5205
5491
  "72c6104c5f2199f6eaebbc215c5cb78dea9c1d571b95f470341ca7f83eee5be8": '<svg id="b1cfe86c-f00b-4507-bce2-50d07e45fe96" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="b39dcf83-187e-4c64-98df-431bb60809d2" x1="0.5" y1="10.04" x2="13.18" y2="10.04" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#005ba1" /><stop offset="0.07" stop-color="#0060a9" /><stop offset="0.36" stop-color="#0071c8" /><stop offset="0.52" stop-color="#0078d4" /><stop offset="0.64" stop-color="#0074cd" /><stop offset="0.82" stop-color="#006abb" /><stop offset="1" stop-color="#005ba1" /></linearGradient></defs><title>Icon-databases-132</title><path d="M6.84,5.09c-3.5,0-6.34-1-6.34-2.3V15c0,1.26,2.79,2.28,6.25,2.3h.09c3.5,0,6.34-1,6.34-2.3V2.79C13.18,4.06,10.34,5.09,6.84,5.09Z" fill="url(#b39dcf83-187e-4c64-98df-431bb60809d2)" /><path d="M13.18,2.79c0,1.27-2.84,2.3-6.34,2.3S.5,4.06.5,2.79,3.34.49,6.84.49s6.34,1,6.34,2.3" fill="#e8e8e8" /><path d="M11.7,2.6c0,.81-2.18,1.46-4.86,1.46S2,3.41,2,2.6,4.16,1.14,6.84,1.14,11.7,1.8,11.7,2.6" fill="#50e6ff" /><path d="M6.84,2.94A12,12,0,0,0,3,3.49a11.25,11.25,0,0,0,3.85.57,11.25,11.25,0,0,0,3.85-.57A12,12,0,0,0,6.84,2.94Z" fill="#198ab3" /><path d="M10.74,11.1V7.72H9.81v4.14h2.46V11.1ZM3.59,9.43a1.92,1.92,0,0,1-.51-.31A.44.44,0,0,1,3,8.8a.38.38,0,0,1,.16-.31.72.72,0,0,1,.42-.11,1.67,1.67,0,0,1,1,.29V7.81a2.67,2.67,0,0,0-1-.16A1.74,1.74,0,0,0,2.38,8a1.13,1.13,0,0,0-.41.9c0,.51.32.91,1,1.21a2.9,2.9,0,0,1,.61.36.4.4,0,0,1,.16.32.38.38,0,0,1-.16.31.75.75,0,0,1-.45.12A1.6,1.6,0,0,1,2,10.77v.93a2.29,2.29,0,0,0,1.07.23,2,2,0,0,0,1.18-.32,1.1,1.1,0,0,0,.43-.92,1,1,0,0,0-.25-.7A2.42,2.42,0,0,0,3.59,9.43ZM8.79,11a2.4,2.4,0,0,0,.33-1.27,2.32,2.32,0,0,0-.25-1.1,1.81,1.81,0,0,0-.7-.75,2,2,0,0,0-1-.26,2.18,2.18,0,0,0-1.09.27,1.87,1.87,0,0,0-.73.77,2.41,2.41,0,0,0-.26,1.15,2.26,2.26,0,0,0,.24,1.05,1.83,1.83,0,0,0,.68.75,2,2,0,0,0,1,.29l.85,1H9.05l-1.2-1.11A1.81,1.81,0,0,0,8.79,11Zm-.93-.26a1,1,0,0,1-1.53,0,1.51,1.51,0,0,1-.28-1,1.48,1.48,0,0,1,.29-1,.92.92,0,0,1,.78-.37.89.89,0,0,1,.75.37,1.62,1.62,0,0,1,.27,1A1.46,1.46,0,0,1,7.86,10.77Z" fill="#f2f2f2" /><path d="M14.81,17.49l.24-.79.47-.27.81.36.52-.53V16.2l-.37-.71.22-.5.81-.29.09,0v-.73l-.1,0-.8-.24-.26-.46.35-.82-.53-.51H16.2l-.71.36L15,12l-.32-.89h-.74l0,.11-.24.79-.51.22-.87-.4-.51.53.05.1.38.74-.2.51L11.1,14v.74l.11,0,.79.24.22.51-.39.86.53.52.09-.05.74-.38.51.2.34.89h.73Zm-1.2-2.36a1.06,1.06,0,1,1,1.49-1.52,1.06,1.06,0,0,1-1.49,1.52Z" fill="#949494" /></svg>',
5492
+ "754537541da48fd4957180d452bd64dfc4a9bbe4de4cbfdfa833ef8af556d16f": '<svg id="a75e3f3a-2661-410b-82fb-d300d37dea2d" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="aff60ddf-eec1-40bf-8bf5-f3e3b50e8818" x1="9" y1="16.21" x2="9" y2="0.62" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1b93eb" /><stop offset="0.21" stop-color="#2095eb" /><stop offset="0.44" stop-color="#2e9ced" /><stop offset="0.69" stop-color="#45a7ef" /><stop offset="0.95" stop-color="#64b6f1" /><stop offset="1" stop-color="#6bb9f2" /></linearGradient></defs><title>Icon-security-248</title><path d="M16,8.44c0,4.57-5.53,8.25-6.73,9a.43.43,0,0,1-.46,0C7.57,16.69,2,13,2,8.44V2.94a.44.44,0,0,1,.43-.44C6.77,2.39,5.78.5,9,.5s2.23,1.89,6.53,2a.44.44,0,0,1,.43.44Z" fill="#1b93eb" /><path d="M15.38,8.48c0,4.2-5.07,7.57-6.17,8.25a.4.4,0,0,1-.42,0c-1.1-.68-6.17-4.05-6.17-8.25v-5A.41.41,0,0,1,3,3c3.94-.11,3-1.83,6-1.83S11.05,2.93,15,3a.41.41,0,0,1,.39.4Z" fill="url(#aff60ddf-eec1-40bf-8bf5-f3e3b50e8818)" /><path d="M9,6.53A2.88,2.88,0,0,1,11.84,9a.49.49,0,0,0,.49.4h1.4a.49.49,0,0,0,.5-.53,5.26,5.26,0,0,0-10.46,0,.49.49,0,0,0,.5.53h1.4A.49.49,0,0,0,6.16,9,2.88,2.88,0,0,1,9,6.53Z" fill="#c3f1ff" /><circle cx="9" cy="9.4" r="1.91" fill="#fff" /></svg>',
5206
5493
  "7602c24ecbcefe06bc16605f9ae2ba37aa1bca534cc2f1752a5b2926a1695d0a": '<svg id="b7c2a418-e983-45bb-8b22-a3ab53d9ffdb" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="ecfac9f9-2ace-451a-aef4-4aae90523bfb" x1="9" y1="15.83" x2="9" y2="5.79" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#32bedd" /><stop offset="0.18" stop-color="#32caea" /><stop offset="0.41" stop-color="#32d2f2" /><stop offset="0.78" stop-color="#32d4f5" /></linearGradient></defs><title>Icon-storage-96</title><path d="M.5,5.79h17a0,0,0,0,1,0,0v9.48a.57.57,0,0,1-.57.57H1.07a.57.57,0,0,1-.57-.57V5.79A0,0,0,0,1,.5,5.79Z" fill="url(#ecfac9f9-2ace-451a-aef4-4aae90523bfb)" /><path d="M1.07,2.17H16.93a.57.57,0,0,1,.57.57V5.79a0,0,0,0,1,0,0H.5a0,0,0,0,1,0,0V2.73A.57.57,0,0,1,1.07,2.17Z" fill="#198ab3" /><path d="M2.81,6.89H15.17a.27.27,0,0,1,.27.27v1.4a.27.27,0,0,1-.27.27H2.81a.27.27,0,0,1-.26-.27V7.16A.27.27,0,0,1,2.81,6.89Z" fill="#fff" /><path d="M2.82,9.68H15.18a.27.27,0,0,1,.27.27v1.41a.27.27,0,0,1-.27.27H2.82a.26.26,0,0,1-.26-.27V10A.26.26,0,0,1,2.82,9.68Z" fill="#9cebff" /><path d="M2.82,12.5H15.18a.27.27,0,0,1,.27.27v1.41a.27.27,0,0,1-.27.27H2.82a.26.26,0,0,1-.26-.27V12.77A.26.26,0,0,1,2.82,12.5Z" fill="#9cebff" /><path id="ae090ab3-6849-4f1b-8ada-ca4d90aafe4f" d="M5.11,7.86v5.59a.28.28,0,0,0,.28.28H7.74A.28.28,0,0,0,8,13.45V10.13a.27.27,0,0,1,.28-.28H9.69a.27.27,0,0,1,.28.28v3.32a.28.28,0,0,0,.29.28h2.35a.28.28,0,0,0,.28-.28V7.86a.28.28,0,0,0-.28-.28H5.39A.28.28,0,0,0,5.11,7.86Z" fill="#0078d4" /></svg>',
5207
5494
  "76763e2d29dc7315305c578af6f7ca19310670805749ca3b332a1e8cfe45ddd3": '<svg id="fca2105f-c039-4f34-bd65-8ab95d4ecdb9" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="a773af38-43e4-4fd2-9485-f8aac63ca91b" x1="5.57" y1="17.5" x2="5.57" y2="0.5" gradientUnits="userSpaceOnUse"><stop offset="0.05" stop-color="#949494" /><stop offset="0.36" stop-color="#979797" /><stop offset="0.54" stop-color="#9f9f9f" /><stop offset="0.69" stop-color="#adadad" /><stop offset="0.73" stop-color="#b3b3b3" /></linearGradient><linearGradient id="b4779ae6-74a5-486d-8aad-cd011859785a" x1="10.56" y1="6.02" x2="10.56" y2="19.71" gradientUnits="userSpaceOnUse"><stop offset="0.18" stop-color="#5ea0ef" /><stop offset="1" stop-color="#0078d4" /></linearGradient></defs><title>Icon-web-46</title><path d="M10.56,16.93a.56.56,0,0,1-.57.57H1.14a.56.56,0,0,1-.56-.57V1.07A.56.56,0,0,1,1.14.5H10a.56.56,0,0,1,.57.57Z" fill="url(#a773af38-43e4-4fd2-9485-f8aac63ca91b)" /><path d="M2,6.46A1.08,1.08,0,0,1,3.13,5.38h5A1.08,1.08,0,0,1,9.18,6.46h0A1.08,1.08,0,0,1,8.1,7.55h-5A1.09,1.09,0,0,1,2,6.46Z" fill="#003067" /><path d="M2,3.24A1.09,1.09,0,0,1,3.13,2.15h5A1.08,1.08,0,0,1,9.18,3.24h0A1.08,1.08,0,0,1,8.1,4.32h-5A1.08,1.08,0,0,1,2,3.24Z" fill="#003067" /><circle cx="3.17" cy="3.24" r="0.73" fill="#50e6ff" /><circle cx="3.17" cy="6.46" r="0.73" fill="#50e6ff" /><path d="M17.42,14.38a3.12,3.12,0,0,0-2.67-3,3.93,3.93,0,0,0-4-3.8,4,4,0,0,0-3.83,2.66A3.7,3.7,0,0,0,3.7,13.83,3.77,3.77,0,0,0,7.56,17.5l.34,0h6.26l.17,0A3.15,3.15,0,0,0,17.42,14.38Z" fill="url(#b4779ae6-74a5-486d-8aad-cd011859785a)" /><rect width="18" height="18" fill="none" /></svg>',
5208
5495
  "7a244a8d7260e84be5c904185db7b04994fe6ed345e2b224163bc5f7e3d97ce0": '<svg id="b388e944-5509-49c9-84d7-f38bffa995b2" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="a997e203-1d7d-4cb9-b131-5dc44e029b46" x1="5.23" y1="17.45" x2="5.23" y2="8.09" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1988d9" /><stop offset="0.9" stop-color="#54aef0" /></linearGradient><linearGradient id="e122e9d8-aee5-4f1a-a60e-b1eae355daa5" x1="11.5" y1="12.45" x2="11.5" y2="0.55" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#198ab3" /><stop offset="0.01" stop-color="#198bb4" /><stop offset="0.44" stop-color="#27b2d7" /><stop offset="0.79" stop-color="#2fcbed" /><stop offset="1" stop-color="#32d4f5" /></linearGradient></defs><title>Icon-manage-307</title><path d="M5.59,13.13H9.91v4.32H5.59ZM1.15,17.45H4.87V13.13H.55v3.72A.6.6,0,0,0,1.15,17.45Zm-.6-5H4.87V8.09H.55Z" fill="url(#a997e203-1d7d-4cb9-b131-5dc44e029b46)" /><path d="M11.5.55a5.89,5.89,0,0,1,5.95,6,5.89,5.89,0,0,1-5.95,5.95H5.55V6.5A5.89,5.89,0,0,1,11.5.55Z" fill-rule="evenodd" fill="url(#e122e9d8-aee5-4f1a-a60e-b1eae355daa5)" /><rect x="7.59" y="5.65" width="1.36" height="4.08" fill="#fff" /><rect x="10.31" y="7.01" width="1.36" height="2.72" fill="#fff" /><rect x="13.03" y="4.29" width="1.36" height="5.44" fill="#fff" /></svg>',
@@ -5226,6 +5513,7 @@ var init_core_art_generated = __esm({
5226
5513
  "a26124a2b188ccf910520c935c726f7364e0f5935d7a4319ebcab9c80a40e475": '<svg id="a96792b7-ce28-4ca3-9767-4e065ef4820f" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="ef16bf9d-a8b6-4181-b6cd-66fc5203f956" x1="2.59" y1="10.16" x2="15.41" y2="10.16" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#005ba1" /><stop offset="0.07" stop-color="#0060a9" /><stop offset="0.36" stop-color="#0071c8" /><stop offset="0.52" stop-color="#0078d4" /><stop offset="0.64" stop-color="#0074cd" /><stop offset="0.82" stop-color="#006abb" /><stop offset="1" stop-color="#005ba1" /></linearGradient><radialGradient id="bf3846c3-4d74-4743-ab9a-f334c248bd92" cx="9.36" cy="10.57" r="7.07" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f2f2f2" /><stop offset="0.58" stop-color="#eee" /><stop offset="1" stop-color="#e6e6e6" /></radialGradient></defs><title>Icon-databases-130</title><path d="M9,5.14c-3.54,0-6.41-1-6.41-2.32V15.18c0,1.27,2.82,2.3,6.32,2.32H9c3.54,0,6.41-1,6.41-2.32V2.82C15.41,4.11,12.54,5.14,9,5.14Z" fill="url(#ef16bf9d-a8b6-4181-b6cd-66fc5203f956)" /><path d="M15.41,2.82c0,1.29-2.87,2.32-6.41,2.32s-6.41-1-6.41-2.32S5.46.5,9,.5s6.41,1,6.41,2.32" fill="#e8e8e8" /><path d="M13.92,2.63c0,.82-2.21,1.48-4.92,1.48S4.08,3.45,4.08,2.63,6.29,1.16,9,1.16s4.92.66,4.92,1.47" fill="#50e6ff" /><path d="M9,3a11.55,11.55,0,0,0-3.89.57A11.42,11.42,0,0,0,9,4.11a11.15,11.15,0,0,0,3.89-.58A11.84,11.84,0,0,0,9,3Z" fill="#198ab3" /><path d="M12.9,11.4V8H12v4.13h2.46V11.4ZM5.76,9.73a1.83,1.83,0,0,1-.51-.31.44.44,0,0,1-.12-.32.34.34,0,0,1,.15-.3.68.68,0,0,1,.42-.12,1.62,1.62,0,0,1,1,.29V8.11a2.58,2.58,0,0,0-1-.16,1.64,1.64,0,0,0-1.09.34,1.08,1.08,0,0,0-.42.89c0,.51.32.91,1,1.21a2.88,2.88,0,0,1,.62.36.42.42,0,0,1,.15.32.38.38,0,0,1-.16.31.81.81,0,0,1-.45.11,1.66,1.66,0,0,1-1.09-.42V12a2.17,2.17,0,0,0,1.07.24,1.88,1.88,0,0,0,1.18-.33A1.08,1.08,0,0,0,6.84,11a1.05,1.05,0,0,0-.25-.7A2.42,2.42,0,0,0,5.76,9.73ZM11,11.32a2.34,2.34,0,0,0,.33-1.26A2.32,2.32,0,0,0,11,9a1.81,1.81,0,0,0-.7-.75,2,2,0,0,0-1-.26,2.11,2.11,0,0,0-1.08.27A1.86,1.86,0,0,0,7.49,9a2.46,2.46,0,0,0-.26,1.14,2.26,2.26,0,0,0,.24,1,1.76,1.76,0,0,0,.69.74,2.06,2.06,0,0,0,1,.3l.86,1h1.21L10,12.08A1.79,1.79,0,0,0,11,11.32ZM10,11.07a.94.94,0,0,1-.76.35.92.92,0,0,1-.76-.36,1.52,1.52,0,0,1-.29-1,1.53,1.53,0,0,1,.29-1,1,1,0,0,1,.78-.37.87.87,0,0,1,.75.37,1.62,1.62,0,0,1,.27,1A1.46,1.46,0,0,1,10,11.07Z" fill="url(#bf3846c3-4d74-4743-ab9a-f334c248bd92)" /></svg>',
5227
5514
  "a2b134ba1ea7e774a0e493b3e4e4a8d4b72e5dfc6e1b350960360e1f0c26243a": '<svg id="a12d75ea-cbb6-44fa-832a-e54cce009101" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="e2b13d81-97e0-465a-b9ed-b7f57e1b3f8c" x1="9" y1="16.79" x2="9" y2="1.21" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0078d4" /><stop offset="0.06" stop-color="#0a7cd7" /><stop offset="0.34" stop-color="#2e8ce1" /><stop offset="0.59" stop-color="#4897e9" /><stop offset="0.82" stop-color="#589eed" /><stop offset="1" stop-color="#5ea0ef" /></linearGradient></defs><title>Icon-identity-233</title><path d="M16.08,8.44c0,4.57-5.62,8.25-6.85,9a.43.43,0,0,1-.46,0c-1.23-.74-6.85-4.42-6.85-9V2.94a.44.44,0,0,1,.43-.44C6.73,2.39,5.72.5,9,.5s2.27,1.89,6.65,2a.44.44,0,0,1,.43.44Z" fill="#0078d4" /><path d="M15.5,8.48c0,4.2-5.16,7.57-6.29,8.25a.4.4,0,0,1-.42,0C7.66,16.05,2.5,12.68,2.5,8.48v-5A.41.41,0,0,1,2.9,3C6.92,2.93,6,1.21,9,1.21S11.08,2.93,15.1,3a.41.41,0,0,1,.4.4Z" fill="url(#e2b13d81-97e0-465a-b9ed-b7f57e1b3f8c)" /><path d="M11.85,7.66h-.4V6.24a2.62,2.62,0,0,0-.7-1.81,2.37,2.37,0,0,0-3.48,0,2.61,2.61,0,0,0-.7,1.81V7.66h-.4A.32.32,0,0,0,5.82,8v3.68a.32.32,0,0,0,.33.32h5.7a.32.32,0,0,0,.33-.32V8A.32.32,0,0,0,11.85,7.66Zm-1.55,0H7.7V6.22a1.43,1.43,0,0,1,.41-1,1.19,1.19,0,0,1,1.78,0,1.56,1.56,0,0,1,.16.2h0a1.4,1.4,0,0,1,.25.79Z" fill="#ffbd02" /><path d="M6.15,7.66h5.7a.32.32,0,0,1,.21.08L5.94,11.9a.33.33,0,0,1-.12-.24V8A.32.32,0,0,1,6.15,7.66Z" fill="#ffe452" /><path d="M11.85,7.66H6.15a.32.32,0,0,0-.21.08l6.12,4.16a.3.3,0,0,0,.12-.24V8A.32.32,0,0,0,11.85,7.66Z" fill="#ffd400" opacity="0.5" /></svg>',
5228
5515
  "a53772c07fe89cdbb876ce77e22dba0863c1459173b77a1eec73fbdd2048637f": '<svg id="a2157f88-f641-4f7d-abc7-f40ccf5cf69a" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="b816c8ea-05a2-41fb-ba99-96d84599c9f4" x1="12.74" y1="15.28" x2="12.74" y2="8.52" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0078d4" /><stop offset="0.82" stop-color="#5ea0ef" /></linearGradient><linearGradient id="ab373d88-41af-4fc3-b172-d4489f9107a0" x1="12.74" y1="17.89" x2="12.74" y2="15.28" gradientUnits="userSpaceOnUse"><stop offset="0.15" stop-color="#ccc" /><stop offset="1" stop-color="#707070" /></linearGradient></defs><title>Icon-compute-34</title><rect x="0.79" y="0.89" width="10.11" height="6.75" rx="0.34" fill="#005ba1" /><polygon points="7.53 3.28 7.53 5.25 5.85 6.23 5.85 4.27 7.53 3.28" fill="#50e6ff" /><polygon points="7.53 3.28 5.85 4.27 4.16 3.28 5.85 2.29 7.53 3.28" fill="#c3f1ff" /><polygon points="5.85 4.27 5.85 6.23 4.16 5.25 4.16 3.28 5.85 4.27" fill="#9cebff" /><rect x="4.76" y="4.76" width="10.11" height="6.75" rx="0.34" fill="#0078d4" /><polygon points="11.5 7.16 11.5 9.12 9.82 10.11 9.82 8.14 11.5 7.16" fill="#50e6ff" /><polygon points="11.5 7.16 9.82 8.14 8.13 7.16 9.82 6.17 11.5 7.16" fill="#c3f1ff" /><polygon points="9.82 8.14 9.82 10.11 8.13 9.12 8.13 7.16 9.82 8.14" fill="#9cebff" /><rect x="7.68" y="8.52" width="10.11" height="6.75" rx="0.34" fill="url(#b816c8ea-05a2-41fb-ba99-96d84599c9f4)" /><polygon points="14.42 10.92 14.42 12.88 12.74 13.87 12.74 11.9 14.42 10.92" fill="#50e6ff" /><polygon points="14.42 10.92 12.74 11.91 11.05 10.92 12.74 9.93 14.42 10.92" fill="#c3f1ff" /><polygon points="12.74 11.91 12.74 13.87 11.05 12.88 11.05 10.92 12.74 11.91" fill="#9cebff" /><polygon points="11.05 12.88 12.74 11.9 12.74 13.87 11.05 12.88" fill="#c3f1ff" /><polygon points="14.42 12.88 12.74 11.9 12.74 13.87 14.42 12.88" fill="#9cebff" /><path d="M14.76,17.32c-1-.16-1-.88-1-2h-2c0,1.16,0,1.88-1,2a.59.59,0,0,0-.5.57h5A.59.59,0,0,0,14.76,17.32Z" fill="url(#ab373d88-41af-4fc3-b172-d4489f9107a0)" /></svg>',
5516
+ "a90c553f57031340c6ef44e3773c0a49249f9783eb26d83a6590b95c5370fb04": '<svg id="a9ed4d43-c916-4b9a-b9ca-be76fbdc694c" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="aaede26b-698f-4a65-b6db-859d207e2da6" x1="8.05" y1="11.32" x2="8.05" y2="1.26" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0078d4" /><stop offset="0.82" stop-color="#5ea0ef" /></linearGradient><linearGradient id="bc54987f-34ba-4701-8ce4-6eca10aff9e9" x1="8.05" y1="15.21" x2="8.05" y2="11.32" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#1490df" /><stop offset="0.98" stop-color="#1f56a3" /></linearGradient><linearGradient id="a5434fd8-c18c-472c-be91-f2aa070858b7" x1="8.05" y1="7.87" x2="8.05" y2="4.94" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#d2ebff" /><stop offset="1" stop-color="#f0fffd" /></linearGradient></defs><title>Icon-intune-329</title><rect x="0.5" y="1.26" width="15.1" height="10.06" rx="0.5" fill="url(#aaede26b-698f-4a65-b6db-859d207e2da6)" /><rect x="1.34" y="2.1" width="13.42" height="8.39" rx="0.28" fill="#fff" /><path d="M11.08,14.37c-1.5-.23-1.56-1.31-1.55-3h-3c0,1.74-.06,2.82-1.55,3a.87.87,0,0,0-.74.84h7.54A.88.88,0,0,0,11.08,14.37Z" fill="url(#bc54987f-34ba-4701-8ce4-6eca10aff9e9)" /><path d="M17.17,5.91H10.29a2.31,2.31,0,1,0,0,.92H11v9.58a.33.33,0,0,0,.33.33h5.83a.33.33,0,0,0,.33-.33V6.24A.33.33,0,0,0,17.17,5.91Z" fill="#32bedd" /><rect x="11.62" y="6.82" width="5.27" height="8.7" rx="0.12" fill="#fff" /><circle cx="8.05" cy="6.41" r="1.46" opacity="0.9" fill="url(#a5434fd8-c18c-472c-be91-f2aa070858b7)" /><path d="M14.88,10.82,13.76,9.7a.06.06,0,0,0-.1.05v.68a.06.06,0,0,1-.06.06H11v.83H13.6a.06.06,0,0,1,.06.06v.69a.06.06,0,0,0,.1,0L14.88,11A.12.12,0,0,0,14.88,10.82Z" fill="#0078d4" /></svg>',
5229
5517
  "ab242068f3af6c01d88fcaeac7e029bcda39e9b062a415048c6f02f779052b57": '<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="fc9e0ce2-d7de-4412-bda8-f01e2cc4e66a" x1="9" y1="12.48" x2="9" y2="1.147" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#003067" /><stop offset="0.037" stop-color="#00346c" /><stop offset="0.239" stop-color="#004583" /><stop offset="0.456" stop-color="#005194" /><stop offset="0.695" stop-color="#00599e" /><stop offset="1" stop-color="#005ba1" /></linearGradient><linearGradient id="e9e87259-0875-41e6-886b-2024b496a772" x1="9" y1="684.663" x2="9" y2="689.036" gradientTransform="matrix(1, 0, 0, -1, 0, 701.516)" gradientUnits="userSpaceOnUse"><stop offset="0.15" stop-color="#ccc" /><stop offset="1" stop-color="#707070" /></linearGradient><linearGradient id="bf7ae98c-3eed-4cf6-9bb1-28dc4026a25b" x1="0.003" y1="-27.428" x2="0.003" y2="-28.757" gradientTransform="matrix(5, 0, 0, -5, 9.126, -133.758)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#00aeef" /><stop offset="0.212" stop-color="#0097dc" /><stop offset="0.519" stop-color="#007cc5" /><stop offset="0.792" stop-color="#006cb8" /><stop offset="1" stop-color="#0066b3" /></linearGradient></defs><g id="bc45d939-cf3c-4c56-98de-8197264505ae"><g><rect x="0.5" y="1.147" width="17" height="11.333" rx="0.567" fill="url(#fc9e0ce2-d7de-4412-bda8-f01e2cc4e66a)" /><path d="M12.409,15.909c-1.681-.265-1.747-1.474-1.747-3.429H7.328c0,1.955-.056,3.164-1.737,3.429a.944.944,0,0,0-.841.944h8.5A.944.944,0,0,0,12.409,15.909Z" fill="url(#e9e87259-0875-41e6-886b-2024b496a772)" /><g><path d="M2.427,10.028H9.215l6.643-6.644H2.427v6.644" fill-rule="evenodd" fill="url(#bf7ae98c-3eed-4cf6-9bb1-28dc4026a25b)" /><path d="M10.4,4.713H9.071l.005,3.119L7.921,4.711H6.775L5.79,7.318C5.685,6.654,5,6.426,4.46,6.254c-.357-.114-.735-.283-.731-.469,0-.152.2-.294.6-.273a2.171,2.171,0,0,1,.968.262l.459-.8a3.589,3.589,0,0,0-1.5-.354h0A1.822,1.822,0,0,0,2.931,5.1a1.119,1.119,0,0,0-.316.771,1.036,1.036,0,0,0,.454.923,3.107,3.107,0,0,0,.9.412c.367.113.667.212.663.423a.314.314,0,0,1-.087.206.581.581,0,0,1-.426.134,1.825,1.825,0,0,1-1.1-.313l-.408.811a2.842,2.842,0,0,0,1.444.377h.12a1.8,1.8,0,0,0,1.139-.36l.049-.041L5.316,8.7l1.12,0,.2-.514a2.287,2.287,0,0,0,1.4.006l.14.508,2.008,0,0-1.172h.427c1.033,0,1.644-.526,1.644-1.407,0-.982-.594-1.41-1.857-1.41ZM7.342,7.379a1.2,1.2,0,0,1-.423-.074l.419-1.322h.008l.412,1.326a1.251,1.251,0,0,1-.416.07Zm3.133-.759h-.291V5.554h.291c.389,0,.7.129.7.526s-.31.54-.7.54" fill="#fff" fill-rule="evenodd" /></g></g></g></svg>',
5230
5518
  "b1bdd74c980623b7524b6ef43f9c2f8704ec0ad84bb1ea35b235ee4aadf5c61e": '<svg id="e628f514-cf24-48e8-9bd9-b0847bc224d0" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="b01f2302-385e-4b49-a7e9-dac023c15293" x1="9" y1="11.84" x2="9" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0078d4" /><stop offset="0.16" stop-color="#1380da" /><stop offset="0.53" stop-color="#3c91e5" /><stop offset="0.82" stop-color="#559cec" /><stop offset="1" stop-color="#5ea0ef" /></linearGradient><linearGradient id="f7246c3f-62d1-41c6-a3d3-d69183d80ba0" x1="4.62" y1="13.54" x2="13.47" y2="13.54" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#32bedd" /><stop offset="0.06" stop-color="#37c5e3" /><stop offset="0.3" stop-color="#49ddf7" /><stop offset="0.45" stop-color="#50e6ff" /><stop offset="0.55" stop-color="#50e6ff" /><stop offset="0.7" stop-color="#49ddf7" /><stop offset="0.94" stop-color="#37c5e3" /><stop offset="1" stop-color="#32bedd" /></linearGradient></defs><title>Icon-databases-133</title><path d="M17.35,8.13a3.74,3.74,0,0,0-3.25-3.6A4.74,4.74,0,0,0,9.22,0,4.87,4.87,0,0,0,4.58,3.16,4.48,4.48,0,0,0,.65,7.47a4.54,4.54,0,0,0,4.7,4.37h8a1.2,1.2,0,0,0,.2,0A3.81,3.81,0,0,0,17.35,8.13Z" fill="url(#b01f2302-385e-4b49-a7e9-dac023c15293)" /><path d="M9.05,10.49c-2.45,0-4.43-.63-4.43-1.41v7.51c0,.77,2,1.4,4.37,1.41h.06c2.44,0,4.42-.63,4.42-1.41V9.08C13.47,9.86,11.49,10.49,9.05,10.49Z" fill="url(#f7246c3f-62d1-41c6-a3d3-d69183d80ba0)" /><path d="M13.47,9.08c0,.78-2,1.41-4.42,1.41S4.62,9.86,4.62,9.08s2-1.41,4.43-1.41,4.42.63,4.42,1.41" fill="#e8e8e8" /><path d="M12.44,9c0,.49-1.52.9-3.39.9s-3.4-.41-3.4-.9,1.52-.9,3.4-.9,3.39.4,3.39.9" fill="#50e6ff" /><path d="M9.05,9.18a9.13,9.13,0,0,0-2.69.34,9,9,0,0,0,2.69.35,9.09,9.09,0,0,0,2.69-.35A9.23,9.23,0,0,0,9.05,9.18Z" fill="#32bedd" /><path d="M6.29,5,8.88,2.38a.3.3,0,0,1,.43,0L11.9,5a.13.13,0,0,1-.1.23H10.21a.14.14,0,0,0-.14.14V8.58a.1.1,0,0,1-.11.11H8.22a.11.11,0,0,1-.11-.11V5.34A.13.13,0,0,0,8,5.2H6.38A.13.13,0,0,1,6.29,5Z" fill="#f2f2f2" /></svg>',
5231
5519
  "b2e9c9a8b091a0694532257354dea94bb8c65b33876826e44dbc9b2aae01cf17": '<svg id="b9c24df5-e0dd-4838-a385-7c11c2d34304" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><defs><linearGradient id="aa2ee697-e8d1-4da1-a8c5-64c8ebbb74cf" x1="9" y1="13.83" x2="9" y2="1.07" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#0078d4" /><stop offset="0.82" stop-color="#5ea0ef" /></linearGradient></defs><title>Icon-networking-73</title><path d="M18,9.83A4,4,0,0,0,14.49,6,5.1,5.1,0,0,0,9.24,1.07a5.23,5.23,0,0,0-5,3.41A4.83,4.83,0,0,0,0,9.12a4.9,4.9,0,0,0,5.07,4.71l.44,0h8.21a.78.78,0,0,0,.22,0A4.09,4.09,0,0,0,18,9.83Z" fill="url(#aa2ee697-e8d1-4da1-a8c5-64c8ebbb74cf)" /><path id="f0276135-0079-4897-a518-21eb63472c16" d="M6.63,6.82h5.06v7H6.63Z" fill="#f2f2f2" /><path id="e528878d-2ed7-4392-94e6-99c6fc971bcb" d="M12.61,6.37l-3.49-2a.25.25,0,0,0-.31.15s0,.06,0,.08V16.68a.25.25,0,0,0,.24.25h.08l3.49-2.06a.25.25,0,0,0,.17-.23v-8A.26.26,0,0,0,12.61,6.37Z" fill="#50e6ff" /></svg>',
@@ -5310,7 +5598,7 @@ var init_manifest_generated = __esm({
5310
5598
  aws: ["69da81b985927d64", "5282404e5c2d99f3", "173849580e0137b7", "401a550dc39d50cf", "32dd530bf1b2ffda", "9970bc0e154f7fa6", "fd381aeadf455c41", "b2fe0d79a4e5c5b3", "6cc34b07d2641648", "fef6457d55700680", "f492bb7f146528a5"],
5311
5599
  azure: ["57ba8eac0bfb7533", "856438a822c39df9", "2d8d2317e80dc9bd", "c39bff2b4ff90c6e", "f7d2aab6a79e32bf", "37258764cc0b855f", "d83610362ccf5cd7", "22e285c6f3a73de1"],
5312
5600
  gcp: ["a2cb5378fdc60c38"],
5313
- simple: ["942feade1a617706", "064605c4cd54fe1f", "599e4f55f34773c6", "eb01a5aab17c87e3"]
5601
+ simple: ["942feade1a617706", "064605c4cd54fe1f", "599e4f55f34773c6", "89462c0e565c9125"]
5314
5602
  };
5315
5603
  }
5316
5604
  });
@@ -5950,7 +6238,7 @@ function isColorIcon(ref) {
5950
6238
  }
5951
6239
  function iconAliasTarget(ref) {
5952
6240
  if (findIcon(ref) !== null) return null;
5953
- const target = ICON_NAME_ALIASES[ref];
6241
+ const target = ICON_NAME_ALIASES[ref] ?? BRAND_STAND_IN_NAMES[ref];
5954
6242
  return target !== void 0 && findIcon(target) !== null ? target : null;
5955
6243
  }
5956
6244
  function isKnownIcon(ref) {
@@ -26580,8 +26868,13 @@ function brandPhrases() {
26580
26868
  return [...phrases2].map((phrase2) => ({ phrase: phrase2, words: phrase2.split(" ").length, ref, set: "simple", isGeneric: false, isBrand: true }));
26581
26869
  });
26582
26870
  }
26871
+ function standInPhrases() {
26872
+ return BRAND_STAND_INS.flatMap(
26873
+ (brand) => [.../* @__PURE__ */ new Set([brand.slug, ...[brand.title, ...brand.aliases].map(normalizePhrase)])].map((phrase2) => ({ phrase: phrase2, words: phrase2.split(" ").length, ref: brand.glyph, set: "lucide", isGeneric: false, isBrand: true }))
26874
+ );
26875
+ }
26583
26876
  function listProductPhrases() {
26584
- cached2 ??= [...cloudPhrases(genericPhrases()), ...brandPhrases()];
26877
+ cached2 ??= [...cloudPhrases(genericPhrases()), ...brandPhrases(), ...standInPhrases()];
26585
26878
  return cached2;
26586
26879
  }
26587
26880
  function providerOf(ref) {
@@ -124777,6 +125070,235 @@ var init_suggest = __esm({
124777
125070
  }
124778
125071
  });
124779
125072
 
125073
+ // ../../packages/diagrams/src/parse/statement-helpers.ts
125074
+ function rejectTrailing(cursor, ctx, hint2) {
125075
+ const span = cursor.remainingSpan();
125076
+ if (span === null) return;
125077
+ ctx.report.push(errorAt(DIAGNOSTIC_CODES.syntax, "Unexpected text after the end of the statement", span, hint2));
125078
+ }
125079
+ function declareId(cursor, ctx, kind, line3) {
125080
+ const token = cursor.next();
125081
+ if (token?.kind !== "word") {
125082
+ ctx.report.push(
125083
+ errorAt(DIAGNOSTIC_CODES.syntax, `Expected an id after "${kind}"`, token ?? cursor.endPosition(line3), `Write: ${kind} my-id ...`)
125084
+ );
125085
+ return null;
125086
+ }
125087
+ if (!isValidId(token.text)) {
125088
+ ctx.report.push(
125089
+ errorAt(DIAGNOSTIC_CODES.syntax, `"${token.text}" is not a valid id`, token, 'Ids start with a letter or "_" and use letters, digits, "_" and "-".')
125090
+ );
125091
+ return null;
125092
+ }
125093
+ const previous = ctx.declared.get(token.text);
125094
+ if (previous !== void 0) {
125095
+ ctx.report.push(
125096
+ errorAt(DIAGNOSTIC_CODES.duplicateId, `Id "${token.text}" is already used by a ${previous.kind} on line ${previous.line}`, token, "Pick a different id.")
125097
+ );
125098
+ return null;
125099
+ }
125100
+ ctx.declared.set(token.text, { kind, line: line3 });
125101
+ return token;
125102
+ }
125103
+ function readLabel(cursor, ctx, line3, what, form) {
125104
+ const token = cursor.peek();
125105
+ if (token?.kind === "string") {
125106
+ cursor.next();
125107
+ return token.text;
125108
+ }
125109
+ if (!(token?.kind === "word" && cursor.peek(1)?.kind === "equals") && !(token?.kind === "lbrace")) cursor.next();
125110
+ const hint2 = `Labels are always in double quotes, for example "Auth server".${form === void 0 ? "" : ` The statement is: ${form}`}`;
125111
+ ctx.report.push(errorAt(DIAGNOSTIC_CODES.syntax, `Expected a quoted ${what}`, token ?? cursor.endPosition(line3), hint2));
125112
+ return null;
125113
+ }
125114
+ function resolveTone(option, fallback, ctx) {
125115
+ if (option === void 0) return fallback;
125116
+ const tone = TONES.find((candidate2) => candidate2 === option.value);
125117
+ if (tone !== void 0) return tone;
125118
+ ctx.report.push(errorAt(DIAGNOSTIC_CODES.unknownTone, `Unknown tone "${option.value}"`, option.valueToken, didYouMean(option.value, TONES)));
125119
+ return fallback;
125120
+ }
125121
+ function resolveIcon(option, fallback, _ctx) {
125122
+ if (option === void 0) return fallback;
125123
+ if (option.value === "none") return null;
125124
+ if (isKnownIcon(option.value)) return option.value;
125125
+ return iconAliasTarget(option.value) ?? fallback;
125126
+ }
125127
+ var init_statement_helpers = __esm({
125128
+ "../../packages/diagrams/src/parse/statement-helpers.ts"() {
125129
+ "use strict";
125130
+ init_constants();
125131
+ init_core();
125132
+ init_icons();
125133
+ init_suggest();
125134
+ }
125135
+ });
125136
+
125137
+ // ../../packages/diagrams/src/parse/lexer.ts
125138
+ function readWord(text3, start2) {
125139
+ let end = start2;
125140
+ while (end < text3.length) {
125141
+ const char = text3.charAt(end);
125142
+ const next = text3.charAt(end + 1);
125143
+ if (isWordPart(char)) end += 1;
125144
+ else if (char === "-" && isWordPart(next)) end += 1;
125145
+ else if (char === "." && isWordPart(next)) end += 1;
125146
+ else if (char === ":" && /[A-Za-z_]/.test(next)) end += 1;
125147
+ else break;
125148
+ }
125149
+ return text3.slice(start2, end);
125150
+ }
125151
+ function readString(text3, start2) {
125152
+ let value = "";
125153
+ let index2 = start2 + 1;
125154
+ while (index2 < text3.length) {
125155
+ const char = text3.charAt(index2);
125156
+ if (char === '"') return { value, end: index2 + 1 };
125157
+ if (char === "\\") {
125158
+ const escaped = STRING_ESCAPES[text3.charAt(index2 + 1)];
125159
+ value += escaped ?? text3.charAt(index2 + 1);
125160
+ index2 += 2;
125161
+ } else {
125162
+ value += char;
125163
+ index2 += 1;
125164
+ }
125165
+ }
125166
+ return null;
125167
+ }
125168
+ function matchArrow(text3, index2) {
125169
+ return ARROW_TOKENS.find((arrow) => text3.startsWith(arrow, index2)) ?? null;
125170
+ }
125171
+ function lexLine(text3, line3, diagnostics) {
125172
+ const tokens = [];
125173
+ let index2 = 0;
125174
+ while (index2 < text3.length) {
125175
+ const char = text3.charAt(index2);
125176
+ const column = index2 + 1;
125177
+ if (char === " " || char === " " || char === "\r") {
125178
+ index2 += 1;
125179
+ } else if (char === "#") {
125180
+ break;
125181
+ } else if (char === '"') {
125182
+ const read = readString(text3, index2);
125183
+ if (read === null) {
125184
+ diagnostics.push(
125185
+ errorAt(
125186
+ DIAGNOSTIC_CODES.unterminatedString,
125187
+ "String is missing its closing quote",
125188
+ { line: line3, column, length: text3.length - index2 },
125189
+ "Close the label with a double quote on the same line."
125190
+ )
125191
+ );
125192
+ break;
125193
+ }
125194
+ tokens.push({ kind: "string", text: read.value, line: line3, column, length: read.end - index2 });
125195
+ index2 = read.end;
125196
+ } else if (matchArrow(text3, index2) !== null) {
125197
+ const arrow = matchArrow(text3, index2);
125198
+ tokens.push({ kind: "arrow", text: arrow, line: line3, column, length: arrow.length });
125199
+ index2 += arrow.length;
125200
+ } else if (char === ":") {
125201
+ tokens.push({ kind: "colon", line: line3, column, length: 1 });
125202
+ index2 += 1;
125203
+ } else if (char === "=") {
125204
+ tokens.push({ kind: "equals", line: line3, column, length: 1 });
125205
+ index2 += 1;
125206
+ } else if (char === ",") {
125207
+ tokens.push({ kind: "comma", line: line3, column, length: 1 });
125208
+ index2 += 1;
125209
+ } else if (char === "{") {
125210
+ tokens.push({ kind: "lbrace", line: line3, column, length: 1 });
125211
+ index2 += 1;
125212
+ } else if (char === "}") {
125213
+ tokens.push({ kind: "rbrace", line: line3, column, length: 1 });
125214
+ index2 += 1;
125215
+ } else if (isWordStart(char)) {
125216
+ const word2 = readWord(text3, index2);
125217
+ tokens.push({ kind: "word", text: word2, line: line3, column, length: word2.length });
125218
+ index2 += word2.length;
125219
+ } else {
125220
+ diagnostics.push(errorAt(DIAGNOSTIC_CODES.syntax, `Unexpected character "${char}"`, { line: line3, column, length: 1 }, unexpectedCharacterHint(char, tokens[tokens.length - 1], text3[index2 + 1])));
125221
+ index2 += 1;
125222
+ }
125223
+ }
125224
+ return tokens;
125225
+ }
125226
+ function unexpectedCharacterHint(char, previous, following) {
125227
+ if (char === "\\" && following === '"') return 'The source has \\" where a plain " belongs: a label is written "Label" in the source. In JSON, escape that quote once, as \\", never as \\\\\\".';
125228
+ if (char === "\\" && following === "u" || char === "-" && following === "\\") return "The source has a JSON escape written out, such as \\u003e: write the character it stands for instead (\\u003e is >, \\u003c is <, \\u0026 is &), so an arrow is -> and not -\\u003e.";
125229
+ if (char === "\\" && following === "n") return "The source has a written \\n where a line should end: each statement goes on its own line. In JSON, write a line break inside the string as \\n, not \\\\n.";
125230
+ if (previous?.kind === "arrow" || char === ">" || char === "<") return ARROW_HINT;
125231
+ return 'Labels go in double quotes; ids use letters, digits, "_" and "-".';
125232
+ }
125233
+ function lex(source) {
125234
+ const diagnostics = [];
125235
+ const lines = [];
125236
+ source.split("\n").forEach((text3, offset) => {
125237
+ const line3 = offset + 1;
125238
+ const tokens = lexLine(text3, line3, diagnostics);
125239
+ if (tokens.length > 0) lines.push({ line: line3, tokens });
125240
+ });
125241
+ return { lines, diagnostics };
125242
+ }
125243
+ var STRING_ESCAPES, isWordStart, isWordPart, ARROW_HINT;
125244
+ var init_lexer = __esm({
125245
+ "../../packages/diagrams/src/parse/lexer.ts"() {
125246
+ "use strict";
125247
+ init_constants();
125248
+ init_core();
125249
+ STRING_ESCAPES = { '"': '"', "\\": "\\", n: "\n", t: " " };
125250
+ isWordStart = (char) => /[A-Za-z0-9_]/.test(char);
125251
+ isWordPart = (char) => /[A-Za-z0-9_]/.test(char);
125252
+ ARROW_HINT = "An arrow is one of ->, -->, ..>, <->, <-->, or --, written from the sender to the receiver (a -> b). Mermaid's ->> and -->> are -> and --> here, and a reply is b --> a, never a <-- b.";
125253
+ }
125254
+ });
125255
+
125256
+ // ../../packages/diagrams/src/parse/icon-alias-notes.ts
125257
+ function iconValues(tokens) {
125258
+ const values = [];
125259
+ for (let index2 = 0; index2 + 2 < tokens.length; index2 += 1) {
125260
+ const key = tokens[index2];
125261
+ if (key?.kind !== "word" || key.text !== "icon" && key.text !== "stack" || tokens[index2 + 1]?.kind !== "equals") continue;
125262
+ const option = key.text;
125263
+ let at3 = index2 + 2;
125264
+ for (let value = tokens[at3]; isValue(value); value = tokens[at3]) {
125265
+ values.push({ ...value, option });
125266
+ if (key.text !== "stack" || tokens[at3 + 1]?.kind !== "comma") break;
125267
+ at3 += 2;
125268
+ }
125269
+ }
125270
+ return values;
125271
+ }
125272
+ function iconAliasNotes(source) {
125273
+ const notes = [];
125274
+ for (const line3 of lex(source).lines) {
125275
+ for (const value of iconValues(line3.tokens)) {
125276
+ const target = iconAliasTarget(value.text);
125277
+ if (target === null) continue;
125278
+ notes.push({
125279
+ code: ICON_ALIAS_NOTE,
125280
+ severity: "info",
125281
+ message: `"${value.text}" is not a bundled icon name, so ${target} was drawn`,
125282
+ line: value.line,
125283
+ column: value.column,
125284
+ length: value.length,
125285
+ hint: `Write ${target} to say so in the source.`
125286
+ });
125287
+ }
125288
+ }
125289
+ return notes;
125290
+ }
125291
+ var ICON_ALIAS_NOTE, isValue;
125292
+ var init_icon_alias_notes = __esm({
125293
+ "../../packages/diagrams/src/parse/icon-alias-notes.ts"() {
125294
+ "use strict";
125295
+ init_icons();
125296
+ init_lexer();
125297
+ ICON_ALIAS_NOTE = "I122";
125298
+ isValue = (token) => token?.kind === "word" || token?.kind === "string";
125299
+ }
125300
+ });
125301
+
124780
125302
  // ../../packages/diagrams/src/parse/icon-hint.ts
124781
125303
  function providerSetFor(guess) {
124782
125304
  const lowered = guess.toLowerCase();
@@ -124845,73 +125367,47 @@ var init_icon_hint = __esm({
124845
125367
  }
124846
125368
  });
124847
125369
 
124848
- // ../../packages/diagrams/src/parse/statement-helpers.ts
124849
- function rejectTrailing(cursor, ctx, hint2) {
124850
- const span = cursor.remainingSpan();
124851
- if (span === null) return;
124852
- ctx.report.push(errorAt(DIAGNOSTIC_CODES.syntax, "Unexpected text after the end of the statement", span, hint2));
125370
+ // ../../packages/diagrams/src/parse/unknown-icons.ts
125371
+ function isUnknownIcon(value) {
125372
+ return value !== "none" && !isKnownIcon(value) && iconAliasTarget(value) === null;
124853
125373
  }
124854
- function declareId(cursor, ctx, kind, line3) {
124855
- const token = cursor.next();
124856
- if (token?.kind !== "word") {
124857
- ctx.report.push(
124858
- errorAt(DIAGNOSTIC_CODES.syntax, `Expected an id after "${kind}"`, token ?? cursor.endPosition(line3), `Write: ${kind} my-id ...`)
124859
- );
124860
- return null;
124861
- }
124862
- if (!isValidId(token.text)) {
124863
- ctx.report.push(
124864
- errorAt(DIAGNOSTIC_CODES.syntax, `"${token.text}" is not a valid id`, token, 'Ids start with a letter or "_" and use letters, digits, "_" and "-".')
124865
- );
124866
- return null;
124867
- }
124868
- const previous = ctx.declared.get(token.text);
124869
- if (previous !== void 0) {
124870
- ctx.report.push(
124871
- errorAt(DIAGNOSTIC_CODES.duplicateId, `Id "${token.text}" is already used by a ${previous.kind} on line ${previous.line}`, token, "Pick a different id.")
124872
- );
124873
- return null;
124874
- }
124875
- ctx.declared.set(token.text, { kind, line: line3 });
124876
- return token;
125374
+ function closestIcons(value) {
125375
+ const words2 = value.replace(/[:\-_]+/g, " ");
125376
+ const name2 = value.includes(":") ? value.slice(value.indexOf(":") + 1).replace(/[-_]+/g, " ") : words2;
125377
+ const found = [...searchIcons(name2, CLOSEST_SHOWN), ...searchIcons(words2, CLOSEST_SHOWN)];
125378
+ return [...new Set(found)].slice(0, CLOSEST_SHOWN);
124877
125379
  }
124878
- function readLabel(cursor, ctx, line3, what, form) {
124879
- const token = cursor.peek();
124880
- if (token?.kind === "string") {
124881
- cursor.next();
124882
- return token.text;
124883
- }
124884
- if (!(token?.kind === "word" && cursor.peek(1)?.kind === "equals") && !(token?.kind === "lbrace")) cursor.next();
124885
- const hint2 = `Labels are always in double quotes, for example "Auth server".${form === void 0 ? "" : ` The statement is: ${form}`}`;
124886
- ctx.report.push(errorAt(DIAGNOSTIC_CODES.syntax, `Expected a quoted ${what}`, token ?? cursor.endPosition(line3), hint2));
124887
- return null;
125380
+ function unknownIconHint(value, option = "icon") {
125381
+ const near3 = iconHint(value);
125382
+ const others = closestIcons(value).filter((ref) => !near3.includes(`"${ref}"`));
125383
+ const closest = others.length === 0 ? "" : ` Closest icons: ${others.join(", ")}.`;
125384
+ return `${near3}${closest} ${DRAWN_INSTEAD[option].hint}`;
124888
125385
  }
124889
- function resolveTone(option, fallback, ctx) {
124890
- if (option === void 0) return fallback;
124891
- const tone = TONES.find((candidate2) => candidate2 === option.value);
124892
- if (tone !== void 0) return tone;
124893
- ctx.report.push(errorAt(DIAGNOSTIC_CODES.unknownTone, `Unknown tone "${option.value}"`, option.valueToken, didYouMean(option.value, TONES)));
124894
- return fallback;
124895
- }
124896
- function resolveIcon(option, fallback, ctx) {
124897
- if (option === void 0) return fallback;
124898
- if (option.value === "none") return null;
124899
- if (isKnownIcon(option.value)) return option.value;
124900
- const alias = iconAliasTarget(option.value);
124901
- if (alias !== null) return alias;
124902
- ctx.report.push(
124903
- errorAt(DIAGNOSTIC_CODES.unknownIcon, `Unknown icon "${option.value}"`, option.valueToken, iconHint(option.value))
124904
- );
124905
- return fallback;
125386
+ function unknownIconWarnings(source) {
125387
+ const warnings = [];
125388
+ for (const line3 of lex(source).lines) {
125389
+ for (const value of iconValues(line3.tokens)) {
125390
+ if (!isUnknownIcon(value.text)) continue;
125391
+ const at3 = { line: value.line, column: value.column, length: value.length };
125392
+ warnings.push(warningAt(DIAGNOSTIC_CODES.unknownIcon, `Unknown icon "${value.text}", ${DRAWN_INSTEAD[value.option].message}`, at3, unknownIconHint(value.text, value.option)));
125393
+ }
125394
+ }
125395
+ return warnings;
124906
125396
  }
124907
- var init_statement_helpers = __esm({
124908
- "../../packages/diagrams/src/parse/statement-helpers.ts"() {
125397
+ var CLOSEST_SHOWN, DRAWN_INSTEAD;
125398
+ var init_unknown_icons = __esm({
125399
+ "../../packages/diagrams/src/parse/unknown-icons.ts"() {
124909
125400
  "use strict";
124910
- init_constants();
124911
125401
  init_core();
124912
125402
  init_icons();
125403
+ init_icon_alias_notes();
124913
125404
  init_icon_hint();
124914
- init_suggest();
125405
+ init_lexer();
125406
+ CLOSEST_SHOWN = 3;
125407
+ DRAWN_INSTEAD = {
125408
+ icon: { message: "so the item draws its default icon", hint: "Meanwhile the item draws its default icon (the one its label names, else its type's); icon=none keeps it plain." },
125409
+ stack: { message: "so the mark is left out", hint: "Meanwhile the mark is left out and the node draws without it." }
125410
+ };
124915
125411
  }
124916
125412
  });
124917
125413
 
@@ -124948,7 +125444,7 @@ function brandBeforeSuffix(normalized) {
124948
125444
  const name2 = words2.slice(0, -1).join(" ");
124949
125445
  if (PLAIN_WORD_NAMES.has(name2)) return null;
124950
125446
  const brand = iconNamedBy(name2, null);
124951
- return brand !== null && brand.startsWith("simple:") ? brand : null;
125447
+ return brand !== null && (brand.startsWith("simple:") || brand.startsWith("lucide:")) ? brand : null;
124952
125448
  }
124953
125449
  function roleIconFor(text3) {
124954
125450
  const words2 = normalizePhrase(text3).split(" ");
@@ -124982,8 +125478,9 @@ function iconsAreOff(ctx) {
124982
125478
  return (ctx.iconMode ?? DEFAULT_ICON_MODE) === "off";
124983
125479
  }
124984
125480
  function resolveAutoIcon(option, fallback, ctx, ask) {
124985
- if (option !== void 0 || iconsAreOff(ctx)) return resolveIcon(option, fallback, ctx);
124986
- return autoIconFor(ask) ?? fallback;
125481
+ if (iconsAreOff(ctx)) return resolveIcon(option, fallback, ctx);
125482
+ if (option === void 0 || isUnknownIcon(option.value)) return autoIconFor(ask) ?? fallback;
125483
+ return resolveIcon(option, fallback, ctx);
124987
125484
  }
124988
125485
  var doubtful;
124989
125486
  var init_auto_icon = __esm({
@@ -124994,6 +125491,7 @@ var init_auto_icon = __esm({
124994
125491
  init_icons();
124995
125492
  init_suggest_icons();
124996
125493
  init_statement_helpers();
125494
+ init_unknown_icons();
124997
125495
  }
124998
125496
  });
124999
125497
 
@@ -130349,9 +130847,8 @@ function resolveStack(option, ctx, canCarry) {
130349
130847
  const marks = [];
130350
130848
  for (const { text: written3, token } of optionValues(option)) {
130351
130849
  const text3 = iconAliasTarget(written3) ?? written3;
130352
- if (!isKnownIcon(text3)) {
130353
- ctx.report.push(errorAt(DIAGNOSTIC_CODES.unknownIcon, `Unknown icon "${text3}"`, token, iconHint(text3)));
130354
- } else if (marks.includes(text3)) {
130850
+ if (!isKnownIcon(text3)) continue;
130851
+ if (marks.includes(text3)) {
130355
130852
  ctx.report.push(errorAt(DIAGNOSTIC_CODES.badOptionValue, `The mark "${text3}" is listed twice`, token, "List each technology once."));
130356
130853
  } else if (marks.length >= STACK_LIMIT) {
130357
130854
  ctx.report.push(errorAt(DIAGNOSTIC_CODES.badOptionValue, `A node carries at most ${STACK_LIMIT} marks in stack=`, token, `Keep the ${STACK_LIMIT} that matter, or name the others in sub=.`));
@@ -130367,7 +130864,6 @@ var init_stack_option = __esm({
130367
130864
  init_constants();
130368
130865
  init_core();
130369
130866
  init_icons();
130370
- init_icon_hint();
130371
130867
  init_options();
130372
130868
  }
130373
130869
  });
@@ -131204,16 +131700,26 @@ function shortenedIds3(diagram) {
131204
131700
  const groups = diagram.groups.filter((group2) => sizeGroupTab(group2).isShortened).map((group2) => group2.id);
131205
131701
  return [...nodes, ...groups];
131206
131702
  }
131703
+ function widthHint(diagram) {
131704
+ const counts = /* @__PURE__ */ new Map();
131705
+ for (const node3 of diagram.nodes) if (node3.group !== null) counts.set(node3.group, (counts.get(node3.group) ?? 0) + 1);
131706
+ const [biggest] = [...counts].sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]));
131707
+ const split = biggest !== void 0 && biggest[1] >= SPLIT_GROUP_NODES ? `split group ${biggest[0]} (${biggest[1]} nodes) into its own diagram` : "split the diagram in two along a group";
131708
+ const sideways = diagram.direction === "right" || diagram.direction === "left";
131709
+ const fix = sideways ? `Add direction=down to the header line so the diagram grows downwards, ${split}, or shorten labels.` : `It is already as narrow as the layout can draw it, so ${split}, or shorten the longest labels.`;
131710
+ return `${fix} On a page wider than ${CANVAS_METRICS.targetWidth}px it draws at full size, so its text stays 12px there.`;
131711
+ }
131207
131712
  function lintFlow(diagram, measure) {
131208
131713
  const general = present([
131209
131714
  densityWarning3(diagram),
131210
131715
  numberedWarning(diagram),
131211
131716
  orphanWarning3(diagram),
131212
131717
  shortenedWarning(shortenedIds3(diagram)),
131213
- widthWarning(measure.size, "Use direction=down, shorten labels, or split the diagram.")
131718
+ widthWarning(measure.size, widthHint(diagram))
131214
131719
  ]);
131215
131720
  return [...general, ...overlayWarnings(diagram, measure.overlayCovers), ...suggestGroupTypes(diagram), ...suggestIcons(diagram), ...suggestLineRoles(diagram)];
131216
131721
  }
131722
+ var SPLIT_GROUP_NODES;
131217
131723
  var init_lint3 = __esm({
131218
131724
  "../../packages/diagrams/src/kinds/flow/lint.ts"() {
131219
131725
  "use strict";
@@ -131227,6 +131733,8 @@ var init_lint3 = __esm({
131227
131733
  init_suggest_group_types();
131228
131734
  init_suggest_icons();
131229
131735
  init_suggest_line_roles();
131736
+ init_theme();
131737
+ SPLIT_GROUP_NODES = 4;
131230
131738
  }
131231
131739
  });
131232
131740
 
@@ -135904,14 +136412,14 @@ function cutNames(diagram) {
135904
136412
  }
135905
136413
  function lintGit(diagram, measure) {
135906
136414
  const history = buildHistory(diagram);
135907
- const widthHint = diagram.direction === "down" ? "Shorten the commit messages and branch names, or split the history into parts." : "Set direction=down, which grows downward instead of sideways, shorten the commit messages, or split the history into parts.";
136415
+ const widthHint2 = diagram.direction === "down" ? "Shorten the commit messages and branch names, or split the history into parts." : "Set direction=down, which grows downward instead of sideways, shorten the commit messages, or split the history into parts.";
135908
136416
  return [
135909
136417
  ...redundantMerges(diagram),
135910
136418
  ...emptyBranches(diagram, history.commitsByBranch),
135911
136419
  ...repeatedTags(diagram),
135912
136420
  ...longLinks(diagram),
135913
136421
  ...densityWarnings(diagram),
135914
- ...present([shortenedWarning(cutNames(diagram)), widthWarning(measure.size, widthHint)])
136422
+ ...present([shortenedWarning(cutNames(diagram)), widthWarning(measure.size, widthHint2)])
135915
136423
  ];
135916
136424
  }
135917
136425
  var init_lint5 = __esm({
@@ -153623,7 +154131,7 @@ function cutText(diagram) {
153623
154131
  return cut.length <= MAX_LISTED ? cut : [...cut.slice(0, MAX_LISTED), `and ${cut.length - MAX_LISTED} more`];
153624
154132
  }
153625
154133
  function lintTimeline(diagram, measure) {
153626
- const widthHint = diagram.direction === "right" ? "Set direction=down, shorten the event labels, or split the timeline by era." : "Shorten the event labels, or split the timeline by era.";
154134
+ const widthHint2 = diagram.direction === "right" ? "Set direction=down, shorten the event labels, or split the timeline by era." : "Shorten the event labels, or split the timeline by era.";
153627
154135
  return [
153628
154136
  ...present([periodsWarning(diagram), eventsWarning(diagram)]),
153629
154137
  ...crowdedWarnings(diagram),
@@ -153631,7 +154139,7 @@ function lintTimeline(diagram, measure) {
153631
154139
  ...emptyWarnings(diagram),
153632
154140
  ...orderWarnings(diagram),
153633
154141
  ...duplicateWarnings2(diagram),
153634
- ...present([shortenedWarning(cutText(diagram)), widthWarning(measure.size, widthHint)])
154142
+ ...present([shortenedWarning(cutText(diagram)), widthWarning(measure.size, widthHint2)])
153635
154143
  ];
153636
154144
  }
153637
154145
  var MAX_LISTED, SPLIT_HINT4;
@@ -155164,11 +155672,11 @@ function duplicateWarnings3(flat3) {
155164
155672
  function lintTree(diagram, measure) {
155165
155673
  const flat3 = flattenTree(diagram);
155166
155674
  const { facts } = placeTree(diagram);
155167
- const widthHint = diagram.style === "org" && diagram.direction === "down" ? "Set direction=right, which grows the chart down the page instead of across it, or split the chart by branch." : "Shorten the names and notes, or split the tree by branch.";
155675
+ const widthHint2 = diagram.style === "org" && diagram.direction === "down" ? "Set direction=right, which grows the chart down the page instead of across it, or split the chart by branch." : "Shorten the names and notes, or split the tree by branch.";
155168
155676
  return [
155169
155677
  ...present([depthWarning2(depthOf3(flat3)), rowsWarning(facts.rows, diagram.style)]),
155170
155678
  ...diagram.style === "files" ? duplicateWarnings3(flat3) : [],
155171
- ...present([shortenedWarning(facts.cut), widthWarning(measure.size, widthHint)])
155679
+ ...present([shortenedWarning(facts.cut), widthWarning(measure.size, widthHint2)])
155172
155680
  ];
155173
155681
  }
155174
155682
  var init_lint18 = __esm({
@@ -159287,125 +159795,6 @@ var init_prose = __esm({
159287
159795
  }
159288
159796
  });
159289
159797
 
159290
- // ../../packages/diagrams/src/parse/lexer.ts
159291
- function readWord(text3, start2) {
159292
- let end = start2;
159293
- while (end < text3.length) {
159294
- const char = text3.charAt(end);
159295
- const next = text3.charAt(end + 1);
159296
- if (isWordPart(char)) end += 1;
159297
- else if (char === "-" && isWordPart(next)) end += 1;
159298
- else if (char === "." && isWordPart(next)) end += 1;
159299
- else if (char === ":" && /[A-Za-z_]/.test(next)) end += 1;
159300
- else break;
159301
- }
159302
- return text3.slice(start2, end);
159303
- }
159304
- function readString(text3, start2) {
159305
- let value = "";
159306
- let index2 = start2 + 1;
159307
- while (index2 < text3.length) {
159308
- const char = text3.charAt(index2);
159309
- if (char === '"') return { value, end: index2 + 1 };
159310
- if (char === "\\") {
159311
- const escaped = STRING_ESCAPES[text3.charAt(index2 + 1)];
159312
- value += escaped ?? text3.charAt(index2 + 1);
159313
- index2 += 2;
159314
- } else {
159315
- value += char;
159316
- index2 += 1;
159317
- }
159318
- }
159319
- return null;
159320
- }
159321
- function matchArrow(text3, index2) {
159322
- return ARROW_TOKENS.find((arrow) => text3.startsWith(arrow, index2)) ?? null;
159323
- }
159324
- function lexLine(text3, line3, diagnostics) {
159325
- const tokens = [];
159326
- let index2 = 0;
159327
- while (index2 < text3.length) {
159328
- const char = text3.charAt(index2);
159329
- const column = index2 + 1;
159330
- if (char === " " || char === " " || char === "\r") {
159331
- index2 += 1;
159332
- } else if (char === "#") {
159333
- break;
159334
- } else if (char === '"') {
159335
- const read = readString(text3, index2);
159336
- if (read === null) {
159337
- diagnostics.push(
159338
- errorAt(
159339
- DIAGNOSTIC_CODES.unterminatedString,
159340
- "String is missing its closing quote",
159341
- { line: line3, column, length: text3.length - index2 },
159342
- "Close the label with a double quote on the same line."
159343
- )
159344
- );
159345
- break;
159346
- }
159347
- tokens.push({ kind: "string", text: read.value, line: line3, column, length: read.end - index2 });
159348
- index2 = read.end;
159349
- } else if (matchArrow(text3, index2) !== null) {
159350
- const arrow = matchArrow(text3, index2);
159351
- tokens.push({ kind: "arrow", text: arrow, line: line3, column, length: arrow.length });
159352
- index2 += arrow.length;
159353
- } else if (char === ":") {
159354
- tokens.push({ kind: "colon", line: line3, column, length: 1 });
159355
- index2 += 1;
159356
- } else if (char === "=") {
159357
- tokens.push({ kind: "equals", line: line3, column, length: 1 });
159358
- index2 += 1;
159359
- } else if (char === ",") {
159360
- tokens.push({ kind: "comma", line: line3, column, length: 1 });
159361
- index2 += 1;
159362
- } else if (char === "{") {
159363
- tokens.push({ kind: "lbrace", line: line3, column, length: 1 });
159364
- index2 += 1;
159365
- } else if (char === "}") {
159366
- tokens.push({ kind: "rbrace", line: line3, column, length: 1 });
159367
- index2 += 1;
159368
- } else if (isWordStart(char)) {
159369
- const word2 = readWord(text3, index2);
159370
- tokens.push({ kind: "word", text: word2, line: line3, column, length: word2.length });
159371
- index2 += word2.length;
159372
- } else {
159373
- diagnostics.push(errorAt(DIAGNOSTIC_CODES.syntax, `Unexpected character "${char}"`, { line: line3, column, length: 1 }, unexpectedCharacterHint(char, tokens[tokens.length - 1], text3[index2 + 1])));
159374
- index2 += 1;
159375
- }
159376
- }
159377
- return tokens;
159378
- }
159379
- function unexpectedCharacterHint(char, previous, following) {
159380
- if (char === "\\" && following === '"') return 'The source has \\" where a plain " belongs: a label is written "Label" in the source. In JSON, escape that quote once, as \\", never as \\\\\\".';
159381
- if (char === "\\" && following === "u" || char === "-" && following === "\\") return "The source has a JSON escape written out, such as \\u003e: write the character it stands for instead (\\u003e is >, \\u003c is <, \\u0026 is &), so an arrow is -> and not -\\u003e.";
159382
- if (char === "\\" && following === "n") return "The source has a written \\n where a line should end: each statement goes on its own line. In JSON, write a line break inside the string as \\n, not \\\\n.";
159383
- if (previous?.kind === "arrow" || char === ">" || char === "<") return ARROW_HINT;
159384
- return 'Labels go in double quotes; ids use letters, digits, "_" and "-".';
159385
- }
159386
- function lex(source) {
159387
- const diagnostics = [];
159388
- const lines = [];
159389
- source.split("\n").forEach((text3, offset) => {
159390
- const line3 = offset + 1;
159391
- const tokens = lexLine(text3, line3, diagnostics);
159392
- if (tokens.length > 0) lines.push({ line: line3, tokens });
159393
- });
159394
- return { lines, diagnostics };
159395
- }
159396
- var STRING_ESCAPES, isWordStart, isWordPart, ARROW_HINT;
159397
- var init_lexer = __esm({
159398
- "../../packages/diagrams/src/parse/lexer.ts"() {
159399
- "use strict";
159400
- init_constants();
159401
- init_core();
159402
- STRING_ESCAPES = { '"': '"', "\\": "\\", n: "\n", t: " " };
159403
- isWordStart = (char) => /[A-Za-z0-9_]/.test(char);
159404
- isWordPart = (char) => /[A-Za-z0-9_]/.test(char);
159405
- ARROW_HINT = "An arrow is one of ->, -->, ..>, <->, <-->, or --, written from the sender to the receiver (a -> b). Mermaid's ->> and -->> are -> and --> here, and a reply is b --> a, never a <-- b.";
159406
- }
159407
- });
159408
-
159409
159798
  // ../../packages/diagrams/src/parse/parse-diagram.ts
159410
159799
  function parseDiagram(source) {
159411
159800
  const lexed = lex(source);
@@ -159451,6 +159840,7 @@ var init_parse20 = __esm({
159451
159840
  "../../packages/diagrams/src/parse/index.ts"() {
159452
159841
  "use strict";
159453
159842
  init_parse_diagram();
159843
+ init_unknown_icons();
159454
159844
  init_lexer();
159455
159845
  }
159456
159846
  });
@@ -160225,6 +160615,16 @@ var init_compare_diagrams2 = __esm({
160225
160615
  }
160226
160616
  });
160227
160617
 
160618
+ // ../../packages/diagrams/src/services/classification-stamp.ts
160619
+ var CLASSIFICATION_ATTRIBUTE, ELEMENT_PATTERN;
160620
+ var init_classification_stamp = __esm({
160621
+ "../../packages/diagrams/src/services/classification-stamp.ts"() {
160622
+ "use strict";
160623
+ CLASSIFICATION_ATTRIBUTE = "data-classification";
160624
+ ELEMENT_PATTERN = new RegExp(`<metadata ${CLASSIFICATION_ATTRIBUTE}="[^"]*"/>`, "g");
160625
+ }
160626
+ });
160627
+
160228
160628
  // ../../packages/diagrams/src/services/outline-diagram-source.ts
160229
160629
  function outlineDiagramSource(source) {
160230
160630
  const parsed = parseDiagram(source);
@@ -160447,6 +160847,84 @@ var init_render15 = __esm({
160447
160847
  }
160448
160848
  });
160449
160849
 
160850
+ // ../../packages/diagrams/src/secrets/scan-secrets.ts
160851
+ function maskSecret(value) {
160852
+ const shown = Math.min(SECRET_SCAN_LIMITS.shownCharacters, Math.floor(value.length / 4));
160853
+ return value.slice(0, shown) + SECRET_SCAN_LIMITS.mask;
160854
+ }
160855
+ function detectorsFor(options3) {
160856
+ const hosts = internalHostDetector(options3.internalHosts ?? []);
160857
+ return [...DETECTORS, ...options3.privateIps === true ? [PRIVATE_IP_DETECTOR] : [], ...hosts === null ? [] : [hosts]];
160858
+ }
160859
+ function scanLine(text3, line3, detectors) {
160860
+ return secretSpans(text3, detectors).map((span) => ({
160861
+ code: CODE_OF_KIND[span.kind],
160862
+ kind: span.kind,
160863
+ line: line3,
160864
+ column: span.start + 1,
160865
+ length: span.end - span.start,
160866
+ masked: maskSecret(span.value)
160867
+ }));
160868
+ }
160869
+ function scanSecrets(source, options3 = {}) {
160870
+ const detectors = detectorsFor(options3);
160871
+ return source.split("\n").flatMap((text3, index2) => scanLine(text3.endsWith("\r") ? text3.slice(0, -1) : text3, index2 + 1, detectors)).sort((a, b) => a.line - b.line || a.column - b.column);
160872
+ }
160873
+ function hintFor(kind) {
160874
+ if (kind === "private-ip" || kind === "internal-host") {
160875
+ return "Your organisation asked for these to be found. Name the part by its role (the database, the internal API) instead. The scan matches patterns, so it can miss one or name one that is fine.";
160876
+ }
160877
+ return `Put a placeholder such as <${kind}> or a reference such as \${NAME} in its place, and rotate the value if it was ever shared. The scan matches patterns, so it can miss a secret or name a value that is not one.`;
160878
+ }
160879
+ function secretWarning(finding2) {
160880
+ const at3 = { line: finding2.line, column: finding2.column, length: finding2.length };
160881
+ return warningAt(finding2.code, `This looks like ${SECRET_KIND_NAMES[finding2.kind]} (${finding2.masked}); remove it before you publish or commit.`, at3, hintFor(finding2.kind));
160882
+ }
160883
+ function secretWarnings(source, options3 = {}) {
160884
+ return scanSecrets(source, options3).map(secretWarning);
160885
+ }
160886
+ var CODE_OF_KIND, SECRET_CODES;
160887
+ var init_scan_secrets = __esm({
160888
+ "../../packages/diagrams/src/secrets/scan-secrets.ts"() {
160889
+ "use strict";
160890
+ init_constants();
160891
+ init_core();
160892
+ init_detectors();
160893
+ init_find_spans();
160894
+ CODE_OF_KIND = {
160895
+ "aws-access-key": DIAGNOSTIC_CODES.secretCloudKey,
160896
+ "aws-secret-key": DIAGNOSTIC_CODES.secretCloudKey,
160897
+ "gcp-api-key": DIAGNOSTIC_CODES.secretCloudKey,
160898
+ "gcp-service-account": DIAGNOSTIC_CODES.secretCloudKey,
160899
+ "azure-storage-key": DIAGNOSTIC_CODES.secretCloudKey,
160900
+ "azure-sas-token": DIAGNOSTIC_CODES.secretCloudKey,
160901
+ "github-token": DIAGNOSTIC_CODES.secretSourceToken,
160902
+ "slack-token": DIAGNOSTIC_CODES.secretChatToken,
160903
+ "slack-webhook": DIAGNOSTIC_CODES.secretChatToken,
160904
+ "stripe-key": DIAGNOSTIC_CODES.secretPaymentKey,
160905
+ jwt: DIAGNOSTIC_CODES.secretJwt,
160906
+ "private-key": DIAGNOSTIC_CODES.secretPrivateKey,
160907
+ "assigned-secret": DIAGNOSTIC_CODES.secretAssigned,
160908
+ "connection-string": DIAGNOSTIC_CODES.secretConnectionString,
160909
+ "plotwork-key": DIAGNOSTIC_CODES.secretPlotworkKey,
160910
+ "private-ip": DIAGNOSTIC_CODES.secretPrivateIp,
160911
+ "internal-host": DIAGNOSTIC_CODES.secretInternalHost
160912
+ };
160913
+ SECRET_CODES = new Set(Object.values(CODE_OF_KIND));
160914
+ }
160915
+ });
160916
+
160917
+ // ../../packages/diagrams/src/secrets/index.ts
160918
+ var init_secrets = __esm({
160919
+ "../../packages/diagrams/src/secrets/index.ts"() {
160920
+ "use strict";
160921
+ init_detectors();
160922
+ init_find_spans();
160923
+ init_placeholders();
160924
+ init_scan_secrets();
160925
+ }
160926
+ });
160927
+
160450
160928
  // ../../packages/diagrams/src/services/render-pair.ts
160451
160929
  async function renderPairDetailed(source, idPrefix, brand = null) {
160452
160930
  const parsed = parseDiagram(source);
@@ -160466,7 +160944,12 @@ async function renderPairDetailed(source, idPrefix, brand = null) {
160466
160944
  }
160467
160945
  },
160468
160946
  kind: parsed.value.kind,
160469
- warnings: [...lintDiagram(parsed.value, light.size, light.overlayCovers), ...iconArtWarnings([.../* @__PURE__ */ new Set([...light.missingIcons, ...dark.missingIcons])].sort(), source)]
160947
+ warnings: [
160948
+ ...unknownIconWarnings(source),
160949
+ ...secretWarnings(source),
160950
+ ...lintDiagram(parsed.value, light.size, light.overlayCovers),
160951
+ ...iconArtWarnings([.../* @__PURE__ */ new Set([...light.missingIcons, ...dark.missingIcons])].sort(), source)
160952
+ ]
160470
160953
  };
160471
160954
  }
160472
160955
  var init_render_pair = __esm({
@@ -160476,6 +160959,7 @@ var init_render_pair = __esm({
160476
160959
  init_outline18();
160477
160960
  init_parse20();
160478
160961
  init_render15();
160962
+ init_secrets();
160479
160963
  }
160480
160964
  });
160481
160965
 
@@ -160496,7 +160980,7 @@ async function renderDiagramSource(input2, brand = null) {
160496
160980
  ...input2.idPrefix === void 0 ? {} : { idPrefix: input2.idPrefix },
160497
160981
  ...input2.embedSource ? { source: input2.source } : {}
160498
160982
  });
160499
- return ok({ svg, theme: input2.theme, size, warnings: [...lintDiagram(parsed.value, size, overlayCovers), ...iconArtWarnings(missingIcons, input2.source)].map(diagnosticToDto) });
160983
+ return ok({ svg, theme: input2.theme, size, warnings: [...unknownIconWarnings(input2.source), ...secretWarnings(input2.source), ...lintDiagram(parsed.value, size, overlayCovers), ...iconArtWarnings(missingIcons, input2.source)].map(diagnosticToDto) });
160500
160984
  }
160501
160985
  var init_render_diagram_svg = __esm({
160502
160986
  "../../packages/diagrams/src/services/render-diagram-svg.ts"() {
@@ -160505,6 +160989,7 @@ var init_render_diagram_svg = __esm({
160505
160989
  init_lint21();
160506
160990
  init_parse20();
160507
160991
  init_render15();
160992
+ init_secrets();
160508
160993
  init_to_dto();
160509
160994
  }
160510
160995
  });
@@ -161563,68 +162048,40 @@ var init_layout18 = __esm({
161563
162048
  }
161564
162049
  });
161565
162050
 
161566
- // ../../packages/diagrams/src/parse/icon-alias-notes.ts
161567
- function iconValues(tokens) {
161568
- const values = [];
161569
- for (let index2 = 0; index2 + 2 < tokens.length; index2 += 1) {
161570
- const key = tokens[index2];
161571
- if (key?.kind !== "word" || key.text !== "icon" && key.text !== "stack" || tokens[index2 + 1]?.kind !== "equals") continue;
161572
- let at3 = index2 + 2;
161573
- for (let value = tokens[at3]; isValue(value); value = tokens[at3]) {
161574
- values.push(value);
161575
- if (key.text !== "stack" || tokens[at3 + 1]?.kind !== "comma") break;
161576
- at3 += 2;
161577
- }
161578
- }
161579
- return values;
161580
- }
161581
- function iconAliasNotes(source) {
161582
- const notes = [];
161583
- for (const line3 of lex(source).lines) {
161584
- for (const value of iconValues(line3.tokens)) {
161585
- const target = iconAliasTarget(value.text);
161586
- if (target === null) continue;
161587
- notes.push({
161588
- code: ICON_ALIAS_NOTE,
161589
- severity: "info",
161590
- message: `"${value.text}" is not a bundled icon name, so ${target} was drawn`,
161591
- line: value.line,
161592
- column: value.column,
161593
- length: value.length,
161594
- hint: `Write ${target} to say so in the source.`
161595
- });
161596
- }
161597
- }
161598
- return notes;
161599
- }
161600
- var ICON_ALIAS_NOTE, isValue;
161601
- var init_icon_alias_notes = __esm({
161602
- "../../packages/diagrams/src/parse/icon-alias-notes.ts"() {
161603
- "use strict";
161604
- init_icons();
161605
- init_lexer();
161606
- ICON_ALIAS_NOTE = "I122";
161607
- isValue = (token) => token?.kind === "word" || token?.kind === "string";
161608
- }
161609
- });
161610
-
161611
162051
  // ../../packages/diagrams/src/quality/findings.ts
161612
- function turnHint(direction, wantsTaller) {
162052
+ function turnOption(direction, wantsTaller) {
161613
162053
  if (direction === null) return null;
161614
162054
  const isAcross = direction === "right" || direction === "left";
161615
162055
  const isDown = direction === "down" || direction === "up";
161616
- if (wantsTaller && !isDown) return "add direction=down to the header line";
161617
- if (!wantsTaller && !isAcross) return "add direction=right to the header line";
162056
+ if (wantsTaller && !isDown) return "direction=down";
162057
+ if (!wantsTaller && !isAcross) return "direction=right";
161618
162058
  return null;
161619
162059
  }
162060
+ function turnHint(direction, wantsTaller) {
162061
+ const option = turnOption(direction, wantsTaller);
162062
+ return option === null ? null : `add ${option} to the header line`;
162063
+ }
161620
162064
  function quote2(text3) {
161621
162065
  return text3.length > 32 ? `"${text3.slice(0, 30)}.."` : `"${text3}"`;
161622
162066
  }
162067
+ function namedCrossing(pair2) {
162068
+ if (pair2 === null) return { lines: null, ends: null };
162069
+ const [a, b] = pair2;
162070
+ const named = (line3) => line3.from !== null && line3.from !== "" && line3.to !== null && line3.to !== "" ? `${line3.from} -> ${line3.to}` : null;
162071
+ const first = named(a);
162072
+ const second = named(b);
162073
+ const lines = first === null || second === null ? null : `${first} and ${second}`;
162074
+ const ends = a.to !== null && b.to !== null && a.to !== "" && b.to !== "" && a.to !== b.to ? [a.to, b.to] : null;
162075
+ return { lines, ends };
162076
+ }
161623
162077
  function crossingFinding(m, context) {
161624
162078
  if (m.crossings === 0) return null;
161625
- const turn = turnHint(context.direction, true) ?? turnHint(context.direction, false);
161626
- const fix = turn === null ? "declare the nodes of each path next to each other so the layout keeps them in order" : `${turn}, or declare connected nodes next to each other`;
161627
- return { measure: "crossings", penalty: cap(m.crossings * 5, 30), hint: `${m.crossings === 1 ? "Two lines cross" : `Lines cross ${m.crossings} times`}: ${fix}.` };
162079
+ const turn = turnOption(context.direction, true) ?? turnOption(context.direction, false);
162080
+ const { lines, ends } = namedCrossing(context.measured.crossingPair);
162081
+ const group2 = ends === null ? "declare connected nodes next to each other" : `put ${ends[0]} and ${ends[1]} in one group so they sit side by side`;
162082
+ const fix = turn === null ? ends === null ? "declare the nodes of each path next to each other so the layout keeps them in order" : group2 : `try ${turn} on the header line, or ${group2}`;
162083
+ const count3 = m.crossings === 1 ? "Two lines cross" : `Lines cross ${m.crossings} times`;
162084
+ return { measure: "crossings", penalty: cap(m.crossings * 5, 30), hint: `${count3}${lines === null ? "" : ` (first ${lines})`}: ${fix}.` };
161628
162085
  }
161629
162086
  function detourFinding(m, context) {
161630
162087
  if (m.detour <= DETOUR_LIMIT) return null;
@@ -161810,6 +162267,7 @@ function countCrossings(lines) {
161810
162267
  const bounds2 = lines.map((line3) => boundsOf2(line3.points));
161811
162268
  const segments = lines.map(segmentsOf2);
161812
162269
  let crossings2 = 0;
162270
+ let first = null;
161813
162271
  for (let i = 0; i < lines.length; i += 1) {
161814
162272
  for (let j = i + 1; j < lines.length; j += 1) {
161815
162273
  if (shareAnEnd(lines[i], lines[j])) continue;
@@ -161818,12 +162276,14 @@ function countCrossings(lines) {
161818
162276
  for (const [a, b] of segments[i]) {
161819
162277
  for (const [c, d] of segments[j]) {
161820
162278
  const at3 = segmentCrossing(a, b, c, d);
161821
- if (at3 !== null && !ends.some((end) => near2(end, at3, END_CLEARANCE_PX))) crossings2 += 1;
162279
+ if (at3 === null || ends.some((end) => near2(end, at3, END_CLEARANCE_PX))) continue;
162280
+ crossings2 += 1;
162281
+ first ??= [lines[i], lines[j]];
161822
162282
  }
161823
162283
  }
161824
162284
  }
161825
162285
  }
161826
- return crossings2;
162286
+ return { count: crossings2, first };
161827
162287
  }
161828
162288
  function solidBoxes(boxes2) {
161829
162289
  return boxes2.filter((box) => !boxes2.some((other) => other !== box && encloses(box.rect, other.rect)));
@@ -161915,10 +162375,11 @@ function measureScene(scene) {
161915
162375
  const boxes2 = solidBoxes(scene.boxes);
161916
162376
  const over = linesOverBoxes(scene.lines, boxes2);
161917
162377
  const overlaps8 = overlappingLabels(scene.labels, boxes2);
162378
+ const crossings2 = countCrossings(scene.lines);
161918
162379
  const biggest = [...scene.groups].sort((a, b) => b.boxes - a.boxes || a.id.localeCompare(b.id))[0];
161919
162380
  return {
161920
162381
  measures: {
161921
- crossings: countCrossings(scene.lines),
162382
+ crossings: crossings2.count,
161922
162383
  lineOverBox: over.count,
161923
162384
  labelOverlaps: overlaps8.count,
161924
162385
  smallestTextPx: round(smallestText(scene), 1),
@@ -161933,6 +162394,7 @@ function measureScene(scene) {
161933
162394
  slices: scene.slices
161934
162395
  },
161935
162396
  lineOverBox: over.first,
162397
+ crossingPair: crossings2.first,
161936
162398
  labelPair: overlaps8.first,
161937
162399
  biggestGroup: biggest === void 0 || biggest.boxes === 0 ? null : { id: biggest.id, boxes: biggest.boxes }
161938
162400
  };
@@ -162347,16 +162809,17 @@ function toQualityDto(report3) {
162347
162809
  async function validateDiagramSource(source) {
162348
162810
  const notes = iconAliasNotes(source);
162349
162811
  const withNotes = notes.length === 0 ? {} : { notices: notes.map((note) => ({ ...note })) };
162812
+ const unknownIcons = [...unknownIconWarnings(source), ...secretWarnings(source)].map(diagnosticToDto);
162350
162813
  const parsed = parseDiagram(source);
162351
162814
  if (!parsed.ok) {
162352
- return { valid: false, kind: guessKind(source), errors: parsed.error.map(diagnosticToDto), warnings: [], summary: null, size: null, ...withNotes };
162815
+ return { valid: false, kind: guessKind(source), errors: parsed.error.map(diagnosticToDto), warnings: unknownIcons, summary: null, size: null, ...withNotes };
162353
162816
  }
162354
162817
  const { size, overlayCovers } = await diagramMeasure(parsed.value);
162355
162818
  return {
162356
162819
  valid: true,
162357
162820
  kind: parsed.value.kind,
162358
162821
  errors: [],
162359
- warnings: lintDiagram(parsed.value, size, overlayCovers).map(diagnosticToDto),
162822
+ warnings: [...unknownIcons, ...lintDiagram(parsed.value, size, overlayCovers).map(diagnosticToDto)],
162360
162823
  summary: summarizeDiagram(parsed.value),
162361
162824
  size,
162362
162825
  quality: toQualityDto(await assessQuality(parsed.value)),
@@ -162373,6 +162836,7 @@ var init_validate_diagram = __esm({
162373
162836
  init_guess_kind();
162374
162837
  init_icon_alias_notes();
162375
162838
  init_quality();
162839
+ init_secrets();
162376
162840
  init_to_dto();
162377
162841
  }
162378
162842
  });
@@ -162384,6 +162848,7 @@ var init_services = __esm({
162384
162848
  init_build_vocabulary();
162385
162849
  init_compare_diagrams2();
162386
162850
  init_diagram_id();
162851
+ init_classification_stamp();
162387
162852
  init_to_dto();
162388
162853
  init_prose();
162389
162854
  init_registry2();
@@ -162398,6 +162863,7 @@ var init_services = __esm({
162398
162863
  init_search_icon_names();
162399
162864
  init_sync_document();
162400
162865
  init_validate_diagram();
162866
+ init_secrets();
162401
162867
  }
162402
162868
  });
162403
162869
 
@@ -162933,10 +163399,10 @@ var init_files = __esm({
162933
163399
  }
162934
163400
  });
162935
163401
 
162936
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
163402
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs
162937
163403
  var __create2, __defProp2, __getOwnPropDesc2, __getOwnPropNames2, __getProtoOf2, __hasOwnProp2, __commonJSMin, __exportAll, __copyProps2, __toESM2;
162938
163404
  var init_chunk_Br0eD_fh = __esm({
162939
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs"() {
163405
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/chunk-Br0eD_fh.mjs"() {
162940
163406
  __create2 = Object.create;
162941
163407
  __defProp2 = Object.defineProperty;
162942
163408
  __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
@@ -162978,7 +163444,7 @@ var init_chunk_Br0eD_fh = __esm({
162978
163444
  }
162979
163445
  });
162980
163446
 
162981
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs
163447
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs
162982
163448
  function declares2019Dialect($schema) {
162983
163449
  return typeof $schema === "string" && DRAFT_2019_09_URIS.has($schema.replace(/#$/, ""));
162984
163450
  }
@@ -162992,7 +163458,7 @@ function declaredDialect(schema, remedy) {
162992
163458
  }
162993
163459
  var DRAFT_2020_12_URIS, DRAFT_2019_09_URIS, DRAFT_07_URIS, DRAFT_06_URIS;
162994
163460
  var init_dialects_DoSzNhcb = __esm({
162995
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs"() {
163461
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/dialects-DoSzNhcb.mjs"() {
162996
163462
  DRAFT_2020_12_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2020-12/schema", "http://json-schema.org/draft/2020-12/schema"]);
162997
163463
  DRAFT_2019_09_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft/2019-09/schema", "http://json-schema.org/draft/2019-09/schema"]);
162998
163464
  DRAFT_07_URIS = /* @__PURE__ */ new Set(["https://json-schema.org/draft-07/schema", "http://json-schema.org/draft-07/schema"]);
@@ -163014,10 +163480,10 @@ var init_v4 = __esm({
163014
163480
  }
163015
163481
  });
163016
163482
 
163017
- // ../../node_modules/.pnpm/@modelcontextprotocol+core@2.2.0/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs
163483
+ // ../../node_modules/.pnpm/@modelcontextprotocol+core@2.3.1/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs
163018
163484
  var LATEST_PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, RELATED_TASK_META_KEY, PROTOCOL_VERSION_META_KEY, CLIENT_INFO_META_KEY, SERVER_INFO_META_KEY, CLIENT_CAPABILITIES_META_KEY, SUBSCRIPTION_ID_META_KEY, LOG_LEVEL_META_KEY, JSONRPC_VERSION, JSONValueSchema, JSONObjectSchema, JSONArraySchema, ProgressTokenSchema, CursorSchema, TaskMetadataSchema, RelatedTaskMetadataSchema, RequestMetaSchema, BaseRequestParamsSchema, TaskAugmentedRequestParamsSchema, RequestSchema, NotificationsParamsSchema, NotificationSchema, ResultMetaObjectSchema, ResultSchema, RequestIdSchema, JSONRPCRequestSchema, JSONRPCNotificationSchema, JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema, JSONRPCMessageSchema, JSONRPCResponseSchema, EmptyResultSchema, CancelledNotificationParamsSchema, CancelledNotificationSchema, IconSchema, IconsSchema, BaseMetadataSchema, ImplementationSchema, FormElicitationCapabilitySchema, ElicitationCapabilitySchema, ClientTasksCapabilitySchema, ServerTasksCapabilitySchema, ClientCapabilitiesSchema, InitializeRequestParamsSchema, InitializeRequestSchema, ServerCapabilitiesSchema, InitializeResultSchema, InitializedNotificationSchema, DiscoverRequestSchema, DiscoverResultSchema, PingRequestSchema, ProgressSchema, ProgressNotificationParamsSchema, ProgressNotificationSchema, PaginatedRequestParamsSchema, PaginatedRequestSchema, PaginatedResultSchema, ResourceContentsSchema, TextResourceContentsSchema, Base64Schema, BlobResourceContentsSchema, RoleSchema, AnnotationsSchema, ResourceSchema, ResourceTemplateSchema, ListResourcesRequestSchema, ListResourcesResultSchema, ListResourceTemplatesRequestSchema, ListResourceTemplatesResultSchema, ResourceRequestParamsSchema, ReadResourceRequestParamsSchema, ReadResourceRequestSchema, ReadResourceResultSchema, ResourceListChangedNotificationSchema, SubscribeRequestParamsSchema, SubscribeRequestSchema, UnsubscribeRequestParamsSchema, UnsubscribeRequestSchema, SubscriptionFilterSchema, SubscriptionsListenRequestParamsSchema, SubscriptionsListenRequestSchema, SubscriptionsAcknowledgedNotificationParamsSchema, SubscriptionsAcknowledgedNotificationSchema, SubscriptionsListenResultMetaSchema, SubscriptionsListenResultSchema, ResourceUpdatedNotificationParamsSchema, ResourceUpdatedNotificationSchema, PromptArgumentSchema, PromptSchema, ListPromptsRequestSchema, ListPromptsResultSchema, GetPromptRequestParamsSchema, GetPromptRequestSchema, TextContentSchema, ImageContentSchema, AudioContentSchema, ToolUseContentSchema, EmbeddedResourceSchema, ResourceLinkSchema, ContentBlockSchema, PromptMessageSchema, GetPromptResultSchema, PromptListChangedNotificationSchema, ToolAnnotationsSchema, ToolExecutionSchema, ToolSchema, ListToolsRequestSchema, ListToolsResultSchema, CallToolResultSchema, CompatibilityCallToolResultSchema, CallToolRequestParamsSchema, CallToolRequestSchema, ToolListChangedNotificationSchema, ListChangedOptionsBaseSchema, LoggingLevelSchema, SetLevelRequestParamsSchema, SetLevelRequestSchema, LoggingMessageNotificationParamsSchema, LoggingMessageNotificationSchema, ModelHintSchema, ModelPreferencesSchema, ToolChoiceSchema, ToolResultContentSchema, SamplingContentSchema, SamplingMessageContentBlockSchema, SamplingMessageSchema, CreateMessageRequestParamsSchema, CreateMessageRequestSchema, CreateMessageResultSchema, CreateMessageResultWithToolsSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema, UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema, LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema, EnumSchemaSchema, PrimitiveSchemaDefinitionSchema, ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema, ElicitRequestParamsSchema, ElicitRequestSchema, ElicitationCompleteNotificationParamsSchema, ElicitationCompleteNotificationSchema, ElicitResultSchema, ResourceTemplateReferenceSchema, PromptReferenceSchema, CompleteRequestParamsSchema, CompleteRequestSchema, CompleteResultSchema, RootSchema, ListRootsRequestSchema, ListRootsResultSchema, RootsListChangedNotificationSchema, TaskCreationParamsSchema, TaskStatusSchema, TaskSchema, CreateTaskResultSchema, TaskStatusNotificationParamsSchema, TaskStatusNotificationSchema, GetTaskRequestSchema, GetTaskResultSchema, GetTaskPayloadRequestSchema, GetTaskPayloadResultSchema, ListTasksRequestSchema, ListTasksResultSchema, CancelTaskRequestSchema, CancelTaskResultSchema, ClientRequestSchema, ClientNotificationSchema, ClientResultSchema, ServerRequestSchema, ServerNotificationSchema, ServerResultSchema, SafeUrlSchema, OAuthProtectedResourceMetadataSchema, OAuthMetadataSchema, OpenIdProviderMetadataSchema, OpenIdProviderDiscoveryMetadataSchema, OAuthTokensSchema, IdJagTokenExchangeResponseSchema, OAuthErrorResponseSchema, OptionalSafeUrlSchema, OAuthClientMetadataSchema, OAuthClientInformationSchema, OAuthClientInformationFullSchema, OAuthClientRegistrationErrorSchema, OAuthTokenRevocationRequestSchema;
163019
163485
  var init_auth_BNDyLTqp = __esm({
163020
- "../../node_modules/.pnpm/@modelcontextprotocol+core@2.2.0/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs"() {
163486
+ "../../node_modules/.pnpm/@modelcontextprotocol+core@2.3.1/node_modules/@modelcontextprotocol/core/dist/auth-BNDyLTqp.mjs"() {
163021
163487
  init_v4();
163022
163488
  LATEST_PROTOCOL_VERSION = "2025-11-25";
163023
163489
  SUPPORTED_PROTOCOL_VERSIONS = [
@@ -163961,14 +164427,14 @@ var init_auth_BNDyLTqp = __esm({
163961
164427
  }
163962
164428
  });
163963
164429
 
163964
- // ../../node_modules/.pnpm/@modelcontextprotocol+core@2.2.0/node_modules/@modelcontextprotocol/core/dist/internal.mjs
164430
+ // ../../node_modules/.pnpm/@modelcontextprotocol+core@2.3.1/node_modules/@modelcontextprotocol/core/dist/internal.mjs
163965
164431
  var init_internal = __esm({
163966
- "../../node_modules/.pnpm/@modelcontextprotocol+core@2.2.0/node_modules/@modelcontextprotocol/core/dist/internal.mjs"() {
164432
+ "../../node_modules/.pnpm/@modelcontextprotocol+core@2.3.1/node_modules/@modelcontextprotocol/core/dist/internal.mjs"() {
163967
164433
  init_auth_BNDyLTqp();
163968
164434
  }
163969
164435
  });
163970
164436
 
163971
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/src-BHSMhZ_W.mjs
164437
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs
163972
164438
  function stampErrorBrands(instance, ctor) {
163973
164439
  const brands = /* @__PURE__ */ new Set();
163974
164440
  let current = ctor;
@@ -165948,7 +166414,8 @@ function build() {
165948
166414
  ListResourceTemplatesResultResponseSchema: wireResultResponse(ListResourceTemplatesResultSchema$1),
165949
166415
  ReadResourceResultResponseSchema: wireResultResponse(union([ReadResourceResultSchema$1, InputRequiredResultSchema])),
165950
166416
  CompleteResultResponseSchema: wireResultResponse(CompleteResultSchema$1),
165951
- DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1)
166417
+ DiscoverResultResponseSchema: wireResultResponse(DiscoverResultSchema$1),
166418
+ SubscriptionsListenResultResponseSchema: wireResultResponse(SubscriptionsListenResultSchema$1)
165952
166419
  };
165953
166420
  }
165954
166421
  function buildSchemas2026() {
@@ -166167,6 +166634,9 @@ function isSpecRequestMethod(method) {
166167
166634
  function isSpecNotificationMethod(method) {
166168
166635
  return ALL_CODECS.some((codec2) => codec2.hasNotificationMethod(method));
166169
166636
  }
166637
+ function isExtensionReusedRequestMethod(method) {
166638
+ return method === "tasks/get" || method === "tasks/cancel";
166639
+ }
166170
166640
  function isPlainObject$3(value) {
166171
166641
  return value !== null && typeof value === "object" && !Array.isArray(value);
166172
166642
  }
@@ -166725,8 +167195,8 @@ function fromJsonSchema(schema, validator) {
166725
167195
  } };
166726
167196
  }
166727
167197
  var BRANDS, OAuthError, SdkErrorCode, SdkError, SdkHttpError, FIRST_MODERN_PROTOCOL_VERSION, SUPPORTED_MODERN_PROTOCOL_VERSIONS, TOOL_RESULT_FOREIGN_FAMILY_KEYS, memo$1, REF_REWRITE_DATA_POSITION_KEYS, REF_REWRITE_NAME_MAP_KEYS, requestMethodKeys$1, notificationMethodKeys$1, resultMethodKeys, maps$1, rev2025RequestMethods, rev2025NotificationMethods, NOT_IN_ERA$1, rev2025Codec, memo2, CACHEABLE_RESULT_METHODS, RESULT_CACHE_HINT_FALLBACK, ProtocolErrorCode, ProtocolError, ResourceNotFoundError, UrlElicitationRequiredError, UnsupportedProtocolVersionError, MissingRequiredClientCapabilityError, DEFAULT_CACHE_TTL_MS, DEFAULT_CACHE_SCOPE, EXTENDED_RESULT_TYPE_METHODS, INPUT_REQUEST_METHODS_2026, maps, requestMethodKeys, notificationMethodKeys, rev2026RequestMethods, rev2026NotificationMethods, NOT_IN_ERA, REQUIRED_ENVELOPE_KEYS, rev2026Codec, wireResultSchemasMemo, MODERN_WIRE_REVISION, ALL_CODECS, schemas_exports3, isJSONRPCRequest, isJSONRPCNotification, isJSONRPCResultResponse, isJSONRPCErrorResponse, isInputRequiredResult, X_MCP_HEADER_KEY, RFC9110_TOKEN, PERMITTED_X_MCP_HEADER_TYPES, NON_REACHABLE_SUBSCHEMA_KEYWORDS, OBJECT_VALUED_SUBSCHEMA_KEYWORDS, HEADER_MISMATCH_ERROR_CODE, INBOUND_VALIDATION_LADDER, LADDER_ERROR_HTTP_STATUS, warnedZodFallback, JSON_SCHEMA_CONVERSION_TARGET, DATETIME_FRACTION_DIGITS, ANNOTATION_ONLY_JSON_SCHEMA_KEYWORDS, ROOT_KEYS, PROPERTY_KEYS_BY_TYPE, SUPPORTED_STRING_FORMATS, inputRequired, REQUEST_STATE_ONLY_LEG_PACING_MS, SPEC_SCHEMA_KEYS, authSchemas, _specTypeSchemas, _isSpecType, specTypeSchemas, isSpecType, DEFAULT_REQUEST_TIMEOUT_MSEC, RESERVED_ENVELOPE_META_KEYS, RETRY_PARAMS_KEYS, NO_REQUEST_STATE, writeNegotiatedProtocolVersion, Protocol, require_content_type, import_content_type, STDIO_DEFAULT_MAX_BUFFER_SIZE, ReadBuffer, TOOL_NAME_REGEX;
166728
- var init_src_BHSMhZ_W = __esm({
166729
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/src-BHSMhZ_W.mjs"() {
167198
+ var init_src_Cqbh3MYc = __esm({
167199
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs"() {
166730
167200
  init_chunk_Br0eD_fh();
166731
167201
  init_dialects_DoSzNhcb();
166732
167202
  init_internal();
@@ -167826,6 +168296,8 @@ var init_src_BHSMhZ_W = __esm({
167826
168296
  _transport;
167827
168297
  _requestMessageId = 0;
167828
168298
  _requestHandlers = /* @__PURE__ */ new Map();
168299
+ /** Methods registered with an explicit schema; the era gate in `_onrequest` reads it for the Tasks extension names. */
168300
+ _customSchemaRequestMethods = /* @__PURE__ */ new Set();
167829
168301
  _requestHandlerAbortControllers = /* @__PURE__ */ new Map();
167830
168302
  _notificationHandlers = /* @__PURE__ */ new Map();
167831
168303
  _responseHandlers = /* @__PURE__ */ new Map();
@@ -168109,7 +168581,7 @@ var init_src_BHSMhZ_W = __esm({
168109
168581
  return;
168110
168582
  }
168111
168583
  }
168112
- if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method)) {
168584
+ if (isSpecRequestMethod(request.method) && !codec2.hasRequestMethod(request.method) && !(isExtensionReusedRequestMethod(request.method) && this._customSchemaRequestMethods.has(request.method))) {
168113
168585
  sendErrorResponse(ProtocolErrorCode.MethodNotFound, "Method not found");
168114
168586
  return;
168115
168587
  }
@@ -168242,8 +168714,11 @@ var init_src_BHSMhZ_W = __esm({
168242
168714
  }
168243
168715
  request(request, schemaOrOptions, maybeOptions) {
168244
168716
  const codec2 = this._resolveOutboundCodec(request.method);
168717
+ if (isStandardSchema(schemaOrOptions)) {
168718
+ if (!isExtensionReusedRequestMethod(request.method)) this._assertOutboundRequestInEra(codec2, request.method);
168719
+ return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
168720
+ }
168245
168721
  this._assertOutboundRequestInEra(codec2, request.method);
168246
- if (isStandardSchema(schemaOrOptions)) return this._requestWithSchemaViaCodec(codec2, request, schemaOrOptions, maybeOptions);
168247
168722
  const validate2 = codecResultValidator(codec2, request.method);
168248
168723
  if (validate2 === void 0) throw new TypeError(`'${request.method}' is not a spec method; pass a result schema as the second argument to request().`);
168249
168724
  return this._requestWithSchemaViaCodec(codec2, request, validate2, schemaOrOptions);
@@ -168487,6 +168962,8 @@ var init_src_BHSMhZ_W = __esm({
168487
168962
  return maybeHandler(parsed.data, ctx);
168488
168963
  };
168489
168964
  else throw new TypeError("setRequestHandler: handler is required");
168965
+ if (typeof schemasOrHandler === "function") this._customSchemaRequestMethods.delete(method);
168966
+ else this._customSchemaRequestMethods.add(method);
168490
168967
  this._requestHandlers.set(method, this._wrapHandler(method, stored));
168491
168968
  }
168492
168969
  /**
@@ -168516,6 +168993,7 @@ var init_src_BHSMhZ_W = __esm({
168516
168993
  */
168517
168994
  removeRequestHandler(method) {
168518
168995
  this._requestHandlers.delete(method);
168996
+ this._customSchemaRequestMethods.delete(method);
168519
168997
  }
168520
168998
  /**
168521
168999
  * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
@@ -168633,7 +169111,7 @@ var init_src_BHSMhZ_W = __esm({
168633
169111
  }
168634
169112
  });
168635
169113
 
168636
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs
169114
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs
168637
169115
  function createDefaultAjvInstance(engineClass) {
168638
169116
  const ajv = new engineClass({
168639
169117
  strict: false,
@@ -168646,7 +169124,7 @@ function createDefaultAjvInstance(engineClass) {
168646
169124
  }
168647
169125
  var require_code$1, require_scope, require_codegen, require_util, require_names, require_errors, require_boolSchema, require_rules, require_applicability, require_dataType, require_defaults, require_code, require_keyword, require_subschema, require_fast_deep_equal, require_json_schema_traverse, require_resolve, require_validate, require_validation_error, require_ref_error, require_compile, require_data, require_utils, require_schemes, require_fast_uri, require_uri, require_core$3, require_id, require_ref, require_core$2, require_limitNumber, require_multipleOf, require_ucs2length, require_limitLength, require_pattern, require_limitProperties, require_required, require_limitItems, require_equal, require_uniqueItems, require_const, require_enum, require_validation$2, require_additionalItems, require_items, require_prefixItems, require_items2020, require_contains, require_dependencies, require_propertyNames, require_additionalProperties, require_properties, require_patternProperties, require_not, require_anyOf, require_oneOf, require_allOf, require_if, require_thenElse, require_applicator$2, require_format$2, require_format$1, require_metadata, require_draft7, require_types, require_discriminator, require_json_schema_draft_07, require_ajv, require_dynamicAnchor, require_dynamicRef, require_recursiveAnchor, require_recursiveRef, require_dynamic, require_dependentRequired, require_dependentSchemas, require_limitContains, require_next, require_unevaluatedProperties, require_unevaluatedItems, require_unevaluated$1, require_schema$1, require_applicator$1, require_content$1, require_core$1, require_format, require_meta_data$1, require_validation$1, require_json_schema_2019_09, require__2019, require_draft2020, require_schema, require_applicator, require_unevaluated, require_content, require_core, require_format_annotation, require_meta_data, require_validation, require_json_schema_2020_12, require__2020, require_formats, require_limit, require_dist, import_ajv, import__2019, import__2020, import_dist, addFormats, AjvJsonSchemaValidator, Ajv;
168648
169126
  var init_ajvProvider_CEoC_sr = __esm({
168649
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs"() {
169127
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/ajvProvider-CEoC__sr.mjs"() {
168650
169128
  init_chunk_Br0eD_fh();
168651
169129
  init_dialects_DoSzNhcb();
168652
169130
  require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
@@ -175650,15 +176128,15 @@ var init_ajvProvider_CEoC_sr = __esm({
175650
176128
  }
175651
176129
  });
175652
176130
 
175653
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
176131
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs
175654
176132
  import process2 from "node:process";
175655
176133
  var init_shimsNode = __esm({
175656
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs"() {
176134
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/shimsNode.mjs"() {
175657
176135
  init_ajvProvider_CEoC_sr();
175658
176136
  }
175659
176137
  });
175660
176138
 
175661
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/mcp-DYuW2ZSs.mjs
176139
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs
175662
176140
  function isCompletable(schema) {
175663
176141
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
175664
176142
  }
@@ -175768,6 +176246,30 @@ function serverIdentityOf(server) {
175768
176246
  function discoverAdvertisedCapabilities(capabilities) {
175769
176247
  return { ...capabilities };
175770
176248
  }
176249
+ function toolInputElementCount(value, max) {
176250
+ let count3 = 0;
176251
+ const stack = [value];
176252
+ while (stack.length > 0) {
176253
+ const node3 = stack.pop();
176254
+ if (node3 === null || typeof node3 !== "object") continue;
176255
+ if (Array.isArray(node3)) for (const child of node3) {
176256
+ if (++count3 > max) return count3;
176257
+ if (child !== null && typeof child === "object") stack.push(child);
176258
+ }
176259
+ else for (const key in node3) {
176260
+ if (!Object.prototype.hasOwnProperty.call(node3, key)) continue;
176261
+ if (++count3 > max) return count3;
176262
+ const child = node3[key];
176263
+ if (child !== null && typeof child === "object") stack.push(child);
176264
+ }
176265
+ }
176266
+ return count3;
176267
+ }
176268
+ function resolveMaxToolInputElements(value) {
176269
+ if (value === void 0 || value === Infinity) return void 0;
176270
+ if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
176271
+ return value;
176272
+ }
175771
176273
  function createToolExecutor(inputSchema, handler) {
175772
176274
  if (inputSchema) {
175773
176275
  const callback$1 = handler;
@@ -175776,6 +176278,12 @@ function createToolExecutor(inputSchema, handler) {
175776
176278
  const callback = handler;
175777
176279
  return async (_args, ctx) => callback(ctx);
175778
176280
  }
176281
+ function convertListedInputSchema(name2, inputSchema) {
176282
+ const json2 = standardSchemaToJsonSchema(inputSchema, "input");
176283
+ const scan = scanXMcpHeaderDeclarations(json2);
176284
+ if (!scan.valid) console.warn(`[mcp-sdk] tool '${name2}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
176285
+ return json2;
176286
+ }
175779
176287
  function convertOutputSchemaJson(outputSchema) {
175780
176288
  if (outputSchema === void 0) return void 0;
175781
176289
  try {
@@ -175788,7 +176296,7 @@ function createPromptHandler(name2, argsSchema, callback) {
175788
176296
  if (argsSchema) {
175789
176297
  const typedCallback = callback;
175790
176298
  return async (args, ctx) => {
175791
- const parseResult = await validateStandardSchema(argsSchema, args);
176299
+ const parseResult = await validateStandardSchema(argsSchema, args ?? {});
175792
176300
  if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for prompt ${name2}: ${parseResult.error}`);
175793
176301
  return typedCallback(parseResult.data, ctx);
175794
176302
  };
@@ -175818,9 +176326,9 @@ function unwrapOptionalSchema(schema) {
175818
176326
  return schema.def?.innerType ?? schema;
175819
176327
  }
175820
176328
  var COMPLETABLE_SYMBOL, MAX_TIMER_DELAY_MS, DEFAULT_MAX_SUBSCRIPTIONS, CHANGE_NOTIFICATION_METHODS, StdioListenRouter, DEFAULT_LEGACY_SHIM_MAX_ROUNDS, DEFAULT_LEGACY_SHIM_ROUND_TIMEOUT_MS, LegacyInputRequiredShim, INPUT_REQUIRED_CAPABLE_METHODS, writeClientIdentity, installDiscoverHandler, readServerIdentity, Server, McpServer, EMPTY_OBJECT_JSON_SCHEMA, EMPTY_COMPLETION_RESULT;
175821
- var init_mcp_DYuW2ZSs = __esm({
175822
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/mcp-DYuW2ZSs.mjs"() {
175823
- init_src_BHSMhZ_W();
176329
+ var init_mcp_DIH4cS6P = __esm({
176330
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/mcp-DIH4cS6P.mjs"() {
176331
+ init_src_Cqbh3MYc();
175824
176332
  init_shimsNode();
175825
176333
  COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
175826
176334
  MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
@@ -175843,7 +176351,7 @@ var init_mcp_DYuW2ZSs = __esm({
175843
176351
  _serverCapabilities;
175844
176352
  /**
175845
176353
  * The serving instance's identity, stamped onto the graceful-close
175846
- * results' `_meta` (the spec's `SubscriptionsListenResultMeta` extends
176354
+ * results' `_meta` (the spec's `SubscriptionsListenResultMetaObject` extends
175847
176355
  * `ResultMetaObject`). Handed over together with the capabilities.
175848
176356
  */
175849
176357
  _serverInfo;
@@ -176109,6 +176617,11 @@ var init_mcp_DYuW2ZSs = __esm({
176109
176617
  if (modernProtocolVersions(this._supportedProtocolVersions).length > 0) this.setRequestHandler("server/discover", () => this._ondiscover());
176110
176618
  if (this._capabilities.logging) this._registerLoggingHandler();
176111
176619
  }
176620
+ /** Attaches to the given transport; rejects while this instance is connected to another one. */
176621
+ async connect(transport) {
176622
+ if (this.transport !== void 0) throw new SdkError(SdkErrorCode.AlreadyConnected, "Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");
176623
+ await super.connect(transport);
176624
+ }
176112
176625
  /**
176113
176626
  * Registers the built-in `logging/setLevel` request handler.
176114
176627
  *
@@ -176664,16 +177177,12 @@ var init_mcp_DYuW2ZSs = __esm({
176664
177177
  * The underlying {@linkcode Server} instance, useful for advanced operations like sending notifications.
176665
177178
  */
176666
177179
  server;
177180
+ _maxToolInputElements;
176667
177181
  _registeredResources = {};
176668
177182
  _registeredResourceTemplates = {};
176669
177183
  _registeredTools = {};
176670
177184
  _registeredPrompts = {};
176671
- /**
176672
- * Per-tool JSON-converted `inputSchema`, memoized so the SEP-2243
176673
- * registration-time scan and the pre-dispatch validation step share one
176674
- * conversion instead of paying it twice per request under the
176675
- * per-request-factory `createMcpHandler` model.
176676
- */
177185
+ /** Per-tool JSON-converted `inputSchema`, filled on first use by `toolInputSchemaJson()`. */
176677
177186
  _toolInputSchemaJson = {};
176678
177187
  /**
176679
177188
  * The JSON-serialized `inputSchema` of a registered tool, or `undefined`
@@ -176698,6 +177207,7 @@ var init_mcp_DYuW2ZSs = __esm({
176698
177207
  }
176699
177208
  constructor(serverInfo, options3) {
176700
177209
  this.server = new Server(serverInfo, options3);
177210
+ this._maxToolInputElements = resolveMaxToolInputElements(options3?.maxToolInputElements);
176701
177211
  if (options3?.capabilities?.tools) this.setToolRequestHandlers();
176702
177212
  if (options3?.capabilities?.resources) this.setResourceRequestHandlers();
176703
177213
  if (options3?.capabilities?.prompts) this.setPromptRequestHandlers();
@@ -176770,7 +177280,7 @@ var init_mcp_DYuW2ZSs = __esm({
176770
177280
  name: name2,
176771
177281
  title: tool.title,
176772
177282
  description: tool.description,
176773
- inputSchema: tool.inputSchema ? standardSchemaToJsonSchema(tool.inputSchema, "input") : EMPTY_OBJECT_JSON_SCHEMA,
177283
+ inputSchema: tool.inputSchema ? convertListedInputSchema(name2, tool.inputSchema) : EMPTY_OBJECT_JSON_SCHEMA,
176774
177284
  annotations: tool.annotations,
176775
177285
  icons: tool.icons,
176776
177286
  execution: tool.execution,
@@ -176815,6 +177325,7 @@ var init_mcp_DYuW2ZSs = __esm({
176815
177325
  * Validates tool input arguments against the tool's input schema.
176816
177326
  */
176817
177327
  async validateToolInput(tool, args, toolName) {
177328
+ if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
176818
177329
  if (!tool.inputSchema) return;
176819
177330
  const parseResult = await validateStandardSchema(tool.inputSchema, args ?? {});
176820
177331
  if (!parseResult.success) throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${parseResult.error}`);
@@ -177089,20 +177600,19 @@ var init_mcp_DYuW2ZSs = __esm({
177089
177600
  }
177090
177601
  _createRegisteredTool(name2, title, description, inputSchema, outputSchema, annotations, icons, execution, scopeChallenge, _meta, handler) {
177091
177602
  validateAndWarnToolName(name2);
177092
- if (inputSchema !== void 0) try {
177093
- const json2 = standardSchemaToJsonSchema(inputSchema, "input");
177094
- this._toolInputSchemaJson[name2] = json2;
177095
- const scan = scanXMcpHeaderDeclarations(json2);
177096
- if (!scan.valid) console.warn(`[mcp-sdk] tool '${name2}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${scan.reason}`);
177097
- } catch {
177098
- }
177099
177603
  let currentHandler = handler;
177604
+ let outputSchemaJson;
177100
177605
  const registeredTool = {
177101
177606
  title,
177102
177607
  description,
177103
177608
  inputSchema,
177104
177609
  outputSchema,
177105
- outputSchemaJson: convertOutputSchemaJson(outputSchema),
177610
+ get outputSchemaJson() {
177611
+ return outputSchemaJson ??= convertOutputSchemaJson(registeredTool.outputSchema);
177612
+ },
177613
+ set outputSchemaJson(value) {
177614
+ outputSchemaJson = value;
177615
+ },
177106
177616
  annotations,
177107
177617
  icons,
177108
177618
  execution,
@@ -177228,7 +177738,7 @@ var init_mcp_DYuW2ZSs = __esm({
177228
177738
  }
177229
177739
  });
177230
177740
 
177231
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/stdio.mjs
177741
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/stdio.mjs
177232
177742
  function classifyOpeningMessage(message2) {
177233
177743
  const params = message2.params;
177234
177744
  if (message2.method === "initialize" && !carriesValidModernEnvelopeClaim(params)) {
@@ -177545,9 +178055,9 @@ function toError(value) {
177545
178055
  }
177546
178056
  var swallowsErrorsAfterClose, StdioServerTransport, DISCARD_ANSWER_TIMEOUT_MS, StdioConnectionChannel;
177547
178057
  var init_stdio = __esm({
177548
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/stdio.mjs"() {
177549
- init_mcp_DYuW2ZSs();
177550
- init_src_BHSMhZ_W();
178058
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/stdio.mjs"() {
178059
+ init_mcp_DIH4cS6P();
178060
+ init_src_Cqbh3MYc();
177551
178061
  init_shimsNode();
177552
178062
  swallowsErrorsAfterClose = /* @__PURE__ */ Symbol("swallowsErrorsAfterClose");
177553
178063
  StdioServerTransport = class {
@@ -178055,7 +178565,7 @@ var init_workflows = __esm({
178055
178565
  why: external_exports.string().describe("Why they were left out, and what to do.")
178056
178566
  }).describe("Present only when pictures were left out because the answer would have been too big for an AI client to read in one piece.");
178057
178567
  ViewUrlSchema = external_exports.string().describe(
178058
- "A link that shows a valid diagram in a browser; give it to the person who wants to look. The source is in the part after #, never sent to a server, but anyone with the link can read it. Absent when too long; next says so."
178568
+ "A link that shows a valid diagram in a browser; give it to the person who wants to look. It holds the drawing itself: the source is in the part after #, never sent to a server, so nothing is saved on Plotwork and it appears in no Diagrams list; anyone with the link can read it. Absent when too long; next says so."
178059
178569
  );
178060
178570
  PngUrlSchema = external_exports.string().describe(
178061
178571
  "The viewUrl with &download=png: opening it in a browser saves the diagram as a PNG for Slack, email, or a wiki. The PNG is drawn in the person's browser, not on a server, so it is a link to open, not an image address to embed. Absent when too long."
@@ -178811,7 +179321,9 @@ var init_patterns2 = __esm({
178811
179321
  kind: KindNameSchema,
178812
179322
  tags: external_exports.array(external_exports.string()),
178813
179323
  providers: external_exports.array(FlavourSchema).describe("The flavours the pattern comes in."),
178814
- score: external_exports.number().describe("How well it matches; only the order of the results is meaningful.")
179324
+ score: external_exports.number().describe("How well it matches; only the order of the results is meaningful."),
179325
+ origin: external_exports.literal("organisation").optional().describe("Present on a pattern of your organisation's own, which it approved and which comes first. Absent on the built-in patterns."),
179326
+ label: external_exports.literal("Your organisation's pattern").optional().describe("Present, with origin, on a pattern of your organisation: the words to show beside it.")
178815
179327
  });
178816
179328
  FindPatternResponseSchema = external_exports.object({
178817
179329
  query: external_exports.string().describe("The query that was searched."),
@@ -180958,11 +181470,14 @@ function scoreOf(pattern3, query, phrase2) {
180958
181470
  return score;
180959
181471
  }
180960
181472
  function findPatterns(query, filters = {}) {
181473
+ return findPatternsIn(listPatterns(), query, filters);
181474
+ }
181475
+ function findPatternsIn(patterns, query, filters = {}) {
180961
181476
  const wanted2 = words(query);
180962
181477
  const phrase2 = wanted2.join(" ");
180963
181478
  const tags = (filters.tags ?? []).map((tag) => tag.toLowerCase());
180964
181479
  const limit = Math.max(1, Math.min(filters.limit ?? PATTERN_RESULT_LIMIT, 20));
180965
- return listPatterns().filter((pattern3) => filters.provider === void 0 || flavoursOf(pattern3).includes(filters.provider)).filter((pattern3) => filters.kind === void 0 || pattern3.kind === filters.kind).filter((pattern3) => tags.every((tag) => pattern3.tags.some((candidate2) => candidate2.toLowerCase() === tag))).map((pattern3, index2) => ({ pattern: pattern3, index: index2, score: scoreOf(pattern3, wanted2, phrase2) })).filter((entry2) => wanted2.length === 0 || entry2.score > 0).sort((a, b) => b.score - a.score || a.index - b.index).slice(0, limit).map(({ pattern: pattern3, score }) => ({
181480
+ return patterns.filter((pattern3) => filters.provider === void 0 || flavoursOf(pattern3).includes(filters.provider)).filter((pattern3) => filters.kind === void 0 || pattern3.kind === filters.kind).filter((pattern3) => tags.every((tag) => pattern3.tags.some((candidate2) => candidate2.toLowerCase() === tag))).map((pattern3, index2) => ({ pattern: pattern3, index: index2, score: scoreOf(pattern3, wanted2, phrase2) })).filter((entry2) => wanted2.length === 0 || entry2.score > 0).sort((a, b) => b.score - a.score || a.index - b.index).slice(0, limit).map(({ pattern: pattern3, score }) => ({
180966
181481
  id: pattern3.id,
180967
181482
  title: pattern3.title,
180968
181483
  summary: pattern3.summary,
@@ -181021,9 +181536,14 @@ var init_slots = __esm({
181021
181536
  // ../../packages/diagrams/src/patterns/fill-pattern.ts
181022
181537
  function fillPattern(id, flavour, values = {}) {
181023
181538
  const pattern3 = getPattern(id);
181024
- if (pattern3 === void 0) {
181025
- return err([{ code: "unknown-pattern", message: `Unknown pattern "${id}"`, hint: `${didYouMean(id, listPatternIds())} Search with find_pattern.` }]);
181026
- }
181539
+ if (pattern3 === void 0) return unknownPattern(id, listPatternIds());
181540
+ return fillPatternFrom(pattern3, flavour, values);
181541
+ }
181542
+ function unknownPattern(id, known3) {
181543
+ return err([{ code: "unknown-pattern", message: `Unknown pattern "${id}"`, hint: `${didYouMean(id, known3)} Search with find_pattern.` }]);
181544
+ }
181545
+ function fillPatternFrom(pattern3, flavour, values = {}) {
181546
+ const id = pattern3.id;
181027
181547
  const chosen = PATTERN_FLAVOURS.find((candidate2) => candidate2 === flavour);
181028
181548
  const template = chosen === void 0 ? void 0 : pattern3.templates[chosen];
181029
181549
  if (chosen === void 0 || template === void 0) {
@@ -181077,12 +181597,27 @@ var init_fill_pattern = __esm({
181077
181597
  }
181078
181598
  });
181079
181599
 
181600
+ // ../../packages/diagrams/src/patterns/org-patterns.ts
181601
+ var init_org_patterns = __esm({
181602
+ "../../packages/diagrams/src/patterns/org-patterns.ts"() {
181603
+ "use strict";
181604
+ init_core();
181605
+ init_parse20();
181606
+ init_fill_pattern();
181607
+ init_find_patterns();
181608
+ init_registry3();
181609
+ init_slots();
181610
+ init_types4();
181611
+ }
181612
+ });
181613
+
181080
181614
  // ../../packages/diagrams/src/patterns/index.ts
181081
181615
  var init_patterns3 = __esm({
181082
181616
  "../../packages/diagrams/src/patterns/index.ts"() {
181083
181617
  "use strict";
181084
181618
  init_find_patterns();
181085
181619
  init_fill_pattern();
181620
+ init_org_patterns();
181086
181621
  init_pattern_tree();
181087
181622
  init_registry3();
181088
181623
  init_slots();
@@ -197857,7 +198392,7 @@ var init_draw_diagram2 = __esm({
197857
198392
  drawDiagramWorkflow = defineWorkflow({
197858
198393
  name: "draw_diagram",
197859
198394
  title: "Draw diagram",
197860
- description: 'Workflow. Checks, describes, and draws a diagram. With errors it returns each one with line, column, and a fix hint and draws nothing: fix the source and call again. When valid it returns the quality warnings (take the icon and group-type suggestions), an outline to check the meaning, the size, and the SVG for light, dark, or both. The pictures are most of an answer and you cannot see them: pass svg "never" to check, and draw only to save, show, or publish. Give viewUrl to the person, even after svg "never"; pngUrl and svgUrl download it; saveCommand, when given, saves it in a repository. A big drawing (about 30 nodes) loses its SVGs, dark first, and picturesOmitted says so; svg "always" forces them. Set embedSource true to save an SVG in a repository or publish one to edit later, so read_diagram gives the source back (anyone with the file can read it). detail "full" adds the whole outline. To change an existing diagram use edit_diagram, or read_diagram for a picture. Saves no file; never throws on bad source. Replaces the validate_diagram, outline_diagram and render_diagram calls.',
198395
+ description: 'Workflow. Checks, describes, and draws a diagram. With errors it returns each one with line, column, and a fix hint and draws nothing: fix the source and call again. When valid it returns the quality warnings (take the icon and group-type suggestions), an outline to check the meaning, the size, and the SVG for light, dark, or both. The pictures are most of an answer and you cannot see them: pass svg "never" to check, and draw only to save, show, or publish. Give viewUrl to the person, even after svg "never": the drawing lives in the link and nothing is saved on Plotwork; pngUrl and svgUrl download it; saveCommand, when given, saves it in a repository. A big drawing (about 30 nodes) loses its SVGs, dark first, and picturesOmitted says so; svg "always" forces them. Set embedSource true to save an SVG in a repository or publish one to edit later, so read_diagram gives the source back (anyone with the file can read it). detail "full" adds the whole outline. To change an existing diagram use edit_diagram, or read_diagram for a picture. Saves no file; never throws on bad source. Replaces the validate_diagram, outline_diagram and render_diagram calls.',
197861
198396
  compact: {
197862
198397
  description: 'Checks diagram source and draws it in one call. Returns every error with line, column, and hint, and draws nothing until the source is valid, so fix each error and call again. svg "never" only checks and keeps the answer small; "always" returns the light and dark SVG to save.',
197863
198398
  inputs: { svg: "never: check only. always: return the SVGs.", themes: "", embedSource: "Write the source into the SVG, for a file saved in a repository." }
@@ -198048,11 +198583,12 @@ var init_edit_diagram2 = __esm({
198048
198583
  });
198049
198584
 
198050
198585
  // ../../packages/diagrams/src/tools/workflows/find-pattern.ts
198051
- function nextFor(count3, firstId) {
198586
+ function nextFor(count3, firstId, own2) {
198052
198587
  if (count3 === 0 || firstId === void 0) {
198053
198588
  return "Nothing fits. Try fewer or more general words, drop the provider or tag filter, or draw the diagram from nothing with get_diagram_syntax and draw_diagram.";
198054
198589
  }
198055
- return `Read the summaries and choose one. Call get_pattern with its id (the best match is ${firstId}) to see its source, slots, and advice, or draw_from_pattern to check and draw it in one call.`;
198590
+ const prefer = own2 === 0 ? "" : " The matches with origin organisation are your organisation's own approved patterns: prefer them.";
198591
+ return `Read the summaries and choose one. Call get_pattern with its id (the best match is ${firstId}) to see its source, slots, and advice, or draw_from_pattern to check and draw it in one call.${prefer}`;
198056
198592
  }
198057
198593
  async function findPattern(input2, ops = ENGINE_OPS) {
198058
198594
  const matches3 = ops.findPatterns(input2.query, {
@@ -198061,7 +198597,8 @@ async function findPattern(input2, ops = ENGINE_OPS) {
198061
198597
  ...input2.kind === void 0 ? {} : { kind: input2.kind },
198062
198598
  limit: input2.limit
198063
198599
  });
198064
- return { query: input2.query, matches: matches3.map((match) => ({ ...match, tags: [...match.tags], providers: [...match.providers] })), next: nextFor(matches3.length, matches3[0]?.id) };
198600
+ const own2 = matches3.filter((match) => match.origin === "organisation").length;
198601
+ return { query: input2.query, matches: matches3.map((match) => ({ ...match, tags: [...match.tags], providers: [...match.providers] })), next: nextFor(matches3.length, matches3[0]?.id, own2) };
198065
198602
  }
198066
198603
  var findPatternWorkflow;
198067
198604
  var init_find_pattern = __esm({
@@ -200403,7 +200940,7 @@ var init_profiles = __esm({
200403
200940
  "Draws flow, sequence, schema, state, class, and other diagrams from a small line-oriented text language.",
200404
200941
  'To draw: if unsure which kind fits, call suggest_diagram; call get_diagram_syntax once with kind set to the kind you draw; write the source and call draw_diagram with svg "never" to check it, fix every error by its line, column, and hint, and call again until it is valid; call draw_diagram with svg "always" only when the SVG will be saved.',
200405
200942
  "To change a diagram, call edit_diagram. From a file (SQL, OpenAPI, Terraform, docker-compose, Kubernetes, CSV, and more), call import_source; from Mermaid, convert_mermaid; for every diagram fence of a Markdown file, sync_markdown.",
200406
- "Save or hand over only source that a tool has said is valid, and check it again with draw_diagram after any change.",
200943
+ "Save or hand over only source that a tool has said is valid, and check it again with draw_diagram after any change. A viewUrl holds the drawing in the link: nothing is saved on Plotwork.",
200407
200944
  "Use map_icons for icon names and never invent one. Pass the arguments as one JSON object with the fields at the top level."
200408
200945
  ].join(" ");
200409
200946
  COMPACT_LEFT_OUT = /* @__PURE__ */ new Set(["description", "$schema", "title", "default", "examples", "minLength", "maxLength", "minItems", "maxItems", "pattern", "propertyNames"]);
@@ -200494,9 +201031,19 @@ var init_view2 = __esm({
200494
201031
  function isRecord6(value) {
200495
201032
  return typeof value === "object" && value !== null && !Array.isArray(value);
200496
201033
  }
200497
- function pictureFileName(source) {
201034
+ function drawnSourceOf(tool, args, answer) {
201035
+ const pick3 = SOURCE_OF[tool];
201036
+ if (pick3 === void 0 || !isRecord6(args) || !isRecord6(answer)) return null;
201037
+ const picked = pick3(args, answer);
201038
+ return typeof picked === "string" && picked.length > 0 ? picked : null;
201039
+ }
201040
+ function sourceTitle(source) {
200498
201041
  const header = source.split("\n").find((line3) => line3.trim() !== "" && !line3.trim().startsWith("#")) ?? "";
200499
- const title = /^\s*[a-z][\w-]*\s+"([^"]*)"/i.exec(header)?.[1] ?? "";
201042
+ const title = (/^\s*[a-z][\w-]*\s+"([^"]*)"/i.exec(header)?.[1] ?? "").trim();
201043
+ return title === "" ? null : title;
201044
+ }
201045
+ function pictureFileName(source) {
201046
+ const title = sourceTitle(source) ?? "";
200500
201047
  const slug = title.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60).replace(/-+$/, "");
200501
201048
  return `${slug === "" ? "diagram" : slug}.svg`;
200502
201049
  }
@@ -200514,10 +201061,8 @@ function savingSentence(hasCommand, release = CLI_RELEASE) {
200514
201061
  }
200515
201062
  async function attachViewUrl(tool, args, value, base, release = CLI_RELEASE) {
200516
201063
  if (tool === "sync_markdown") return rebaseFileLinks(value, base);
200517
- const pick3 = SOURCE_OF[tool];
200518
- if (pick3 === void 0 || !isRecord6(value) || !isRecord6(args)) return value;
200519
- const picked = pick3(args, value);
200520
- if (typeof picked !== "string" || picked.length === 0) return value;
201064
+ const picked = drawnSourceOf(tool, args, value);
201065
+ if (picked === null || !isRecord6(value) || !isRecord6(args)) return value;
200521
201066
  const settings = SettingsSchema.safeParse(args["settings"]);
200522
201067
  const source = settings.success ? applyDefaults(picked, settings.data.defaults).source : picked;
200523
201068
  const link2 = await viewLinkFor(source, base);
@@ -200532,7 +201077,7 @@ async function attachViewUrl(tool, args, value, base, release = CLI_RELEASE) {
200532
201077
  ...pngUrl.length <= VIEW_LINKS.maxLength ? { pngUrl } : {},
200533
201078
  ...svgUrl.length <= VIEW_LINKS.maxLength ? { svgUrl } : {},
200534
201079
  ...saveCommand === null ? {} : { saveCommand },
200535
- next: `${next}${savingSentence(saveCommand !== null, release)}`
201080
+ next: `${next}${VIEW_LINK_NOT_SAVED} ${savingSentence(saveCommand !== null, release)}`
200536
201081
  };
200537
201082
  }
200538
201083
  return { ...value, next: `${next}There is no viewUrl: the link would be ${link2.length} characters, over the ${VIEW_LINKS.maxLength} a link may have. ${savingSentence(false, release)}` };
@@ -200558,7 +201103,7 @@ function stripViewLinks(value) {
200558
201103
  }
200559
201104
  return kept2;
200560
201105
  }
200561
- var SOURCE_OF, VIEW_LINK_TOOLS, VIEW_LINK_FIELDS;
201106
+ var SOURCE_OF, VIEW_LINK_TOOLS, VIEW_LINK_NOT_SAVED, VIEW_LINK_FIELDS;
200562
201107
  var init_view_link = __esm({
200563
201108
  "../../packages/diagrams/src/tools/view-link.ts"() {
200564
201109
  "use strict";
@@ -200574,6 +201119,7 @@ var init_view_link = __esm({
200574
201119
  import_source: (_args, answer) => answer["validation"]?.["valid"] === true ? answer["source"] : null
200575
201120
  };
200576
201121
  VIEW_LINK_TOOLS = Object.keys(SOURCE_OF);
201122
+ VIEW_LINK_NOT_SAVED = "viewUrl holds the drawing itself in the link: nothing is saved on Plotwork, and it will not appear in any Diagrams list.";
200577
201123
  VIEW_LINK_FIELDS = ["viewUrl", "pngUrl", "svgUrl", "saveCommand"];
200578
201124
  }
200579
201125
  });
@@ -200645,15 +201191,15 @@ var init_audit = __esm({
200645
201191
  }
200646
201192
  });
200647
201193
 
200648
- // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/index.mjs
201194
+ // ../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/index.mjs
200649
201195
  function fromJsonSchema2(schema, validator) {
200650
201196
  return fromJsonSchema(schema, validator ?? (_defaultValidator ??= new AjvJsonSchemaValidator()));
200651
201197
  }
200652
201198
  var DEFAULT_MAX_REQUEST_BODY_SIZE, _defaultValidator;
200653
201199
  var init_dist = __esm({
200654
- "../../node_modules/.pnpm/@modelcontextprotocol+server@2.2.0/node_modules/@modelcontextprotocol/server/dist/index.mjs"() {
200655
- init_mcp_DYuW2ZSs();
200656
- init_src_BHSMhZ_W();
201200
+ "../../node_modules/.pnpm/@modelcontextprotocol+server@2.3.1/node_modules/@modelcontextprotocol/server/dist/index.mjs"() {
201201
+ init_mcp_DIH4cS6P();
201202
+ init_src_Cqbh3MYc();
200657
201203
  init_shimsNode();
200658
201204
  DEFAULT_MAX_REQUEST_BODY_SIZE = 4 * 1024 * 1024;
200659
201205
  }
@@ -200785,6 +201331,33 @@ var init_icon_scope = __esm({
200785
201331
  }
200786
201332
  });
200787
201333
 
201334
+ // src/constants.ts
201335
+ var MAX_BODY_BYTES2;
201336
+ var init_constants15 = __esm({
201337
+ "src/constants.ts"() {
201338
+ "use strict";
201339
+ MAX_BODY_BYTES2 = 10 * 1024 * 1024;
201340
+ }
201341
+ });
201342
+
201343
+ // src/org-patterns.ts
201344
+ function patternInstructions(library) {
201345
+ if (library.only) {
201346
+ return "This connection's organisation asks its agents to start from its approved patterns: call find_pattern first for every diagram a pattern could fit, and start from the one it returns with draw_from_pattern or get_pattern. find_pattern answers with the organisation's own patterns only. When none fits, draw the diagram from nothing with draw_diagram: that is allowed.";
201347
+ }
201348
+ return "This connection's organisation has its own approved patterns: find_pattern lists them first, each with origin organisation, and you should prefer them over the built-in ones.";
201349
+ }
201350
+ function findPatternNote(library) {
201351
+ return library.only ? " Through this connection it searches only your organisation's approved patterns (ids start with org:), which your organisation asks you to start from; when none fits, draw from nothing." : " Through this connection it lists your organisation's own patterns first (ids start with org:, origin organisation); prefer them.";
201352
+ }
201353
+ var init_org_patterns2 = __esm({
201354
+ "src/org-patterns.ts"() {
201355
+ "use strict";
201356
+ init_patterns3();
201357
+ init_constants15();
201358
+ }
201359
+ });
201360
+
200788
201361
  // src/engine-runner.ts
200789
201362
  var runInPlace, runLocally;
200790
201363
  var init_engine_runner = __esm({
@@ -200793,6 +201366,7 @@ var init_engine_runner = __esm({
200793
201366
  init_icons();
200794
201367
  init_tools();
200795
201368
  init_icon_scope();
201369
+ init_org_patterns2();
200796
201370
  runInPlace = (tool, args) => tool.run(args);
200797
201371
  runLocally = (tool, args) => tool.kind === "workflow" && "runWith" in tool ? tool.runWith(args, LOCAL_ENGINE_OPS) : tool.run(args);
200798
201372
  }
@@ -200955,7 +201529,7 @@ function libraryInstructions(library) {
200955
201529
  function librarySaveStep(library) {
200956
201530
  return `When the diagram is finished, save it to the private library of ${JSON.stringify(library.name)} with publish_diagram (no need to ask: only members can open it).`;
200957
201531
  }
200958
- var SERVER_INFO, SAVING_INSTRUCTIONS, SERVER_INSTRUCTIONS, HOSTED_INSTRUCTIONS;
201532
+ var SERVER_INFO, SAVING_INSTRUCTIONS, SERVER_INSTRUCTIONS, KEEP_IN_LIBRARY_STEP, HOSTED_INSTRUCTIONS;
200959
201533
  var init_server_info = __esm({
200960
201534
  "src/server-info.ts"() {
200961
201535
  "use strict";
@@ -200987,7 +201561,8 @@ var init_server_info = __esm({
200987
201561
  "Use validate_diagram, outline_diagram, render_diagram, and search_icons only for one fine-grained step.",
200988
201562
  "Choose node types and tones for meaning; colors are chosen by the theme and cannot be set."
200989
201563
  ].join(" ");
200990
- HOSTED_INSTRUCTIONS = "When the person asks to share a finished diagram or wants a link to it, call publish_diagram with the valid source: it returns a public link and a Markdown image to paste, and publishing the same diagram again returns the same link. Publish only when asked, because anyone with the link can see the picture. After you edit a published diagram, call publish_diagram again: an edited diagram is a new picture with a new link, so replace the old link wherever it is used. Set embedSource true on publish_diagram when someone may want to edit the diagram later, and tell the person that the source is then part of the public picture. A drawing too big to return in an answer is also the case for publish_diagram: it gives a link in place of the picture. To keep a diagram inside a team instead, pass organization with the slug or id of an organisation, but only when the person names an organisation or asks for a team diagram: it is stored in that organisation's private library and the answer has a viewUrl for members in place of a public link, so there is no Markdown image. Never guess an organisation, and if it is not found, ask the person which one they mean. An organisation can also send its members' diagrams to its library when organization is left out: the answer then names it and says why, and the person must be told the diagram is in that library, not at a public link. Pass personal true only when the person asks for a public link anyway; an organisation that requires its library refuses it, and then tell the person. An owner may restrict a folder, and a reader may not publish: when the answer says the folder is restricted or the role does not allow it, ask the person which folder they may use instead of trying others or publishing elsewhere. Call list_diagrams when the person asks what they have published or to get a diagram id; it changes nothing. Call delete_diagram only after the person has said which diagram to delete, by name, and tell them what you deleted; never delete on a guess, in bulk, or to make room for a publish unless they asked, and a locked diagram cannot be deleted until the owner unlocks it.";
201564
+ KEEP_IN_LIBRARY_STEP = "To keep it in an organisation's library, or in the person's own Diagrams, call publish_diagram when they ask.";
201565
+ HOSTED_INSTRUCTIONS = "A viewUrl from a drawing tool holds the drawing itself in the link: nothing is saved on Plotwork, and it will not appear in any Diagrams list; when the person wants a diagram kept in an organisation's library or their own Diagrams, call publish_diagram. When the person asks to share a finished diagram or wants a link to it, call publish_diagram with the valid source: it returns a public link and a Markdown image to paste, and publishing the same diagram again returns the same link. Publish only when asked, because anyone with the link can see the picture. After you edit a published diagram, call publish_diagram again: an edited diagram is a new picture with a new link, so replace the old link wherever it is used. Set embedSource true on publish_diagram when someone may want to edit the diagram later, and tell the person that the source is then part of the public picture. A drawing too big to return in an answer is also the case for publish_diagram: it gives a link in place of the picture. To keep a diagram inside a team instead, pass organization with the slug or id of an organisation, but only when the person names an organisation or asks for a team diagram: it is stored in that organisation's private library and the answer has a viewUrl for members in place of a public link, so there is no Markdown image. Never guess an organisation, and if it is not found, ask the person which one they mean. An organisation can also send its members' diagrams to its library when organization is left out: the answer then names it and says why, and the person must be told the diagram is in that library, not at a public link. Pass personal true only when the person asks for a public link anyway; an organisation that requires its library refuses it, and then tell the person. An organisation can also keep every diagram its agents draw: a drawing's answer then has autoPublished, and its next names the library; tell the person where the diagram is, and do not publish it again. An organisation can also hold a publish for approval: the answer then has approval and warning W601, held for approval by your organisation; tell the person it is stored and waits for an approver, and do not publish it again. An owner may restrict a folder, and a reader may not publish: when the answer says the folder is restricted or the role does not allow it, ask the person which folder they may use instead of trying others or publishing elsewhere. Call list_diagrams when the person asks what they have published or to get a diagram id; it changes nothing. Call delete_diagram only after the person has said which diagram to delete, by name, and tell them what you deleted; never delete on a guess, in bulk, or to make room for a publish unless they asked, and a locked diagram cannot be deleted until the owner unlocks it.";
200991
201566
  }
200992
201567
  });
200993
201568
 
@@ -201265,7 +201840,7 @@ async function callTool(tool, args, log, caller, activity, run3, budget2, answer
201265
201840
  }
201266
201841
  const ran = await run3(tool, args);
201267
201842
  const linked = !ran.ok ? null : answers2.viewLinks === false ? stripViewLinks(ran.value) : await attachViewUrl(tool.name, args, ran.value, answers2.viewBase);
201268
- const saving = linked === null || answers2.library === void 0 || answers2.library === null ? linked : withSaveStep(tool.name, linked, answers2.library);
201843
+ const saving = linked === null ? null : answers2.library !== void 0 && answers2.library !== null ? withSaveStep(tool.name, linked, answers2.library) : answers2.canPublish ? withKeepStep(tool.name, linked) : linked;
201269
201844
  const fitted = saving === null ? null : fitAnswer(saving, args, budget2);
201270
201845
  const shown = fitted === null || answers2.open === void 0 ? fitted : await answers2.open(tool.name, fitted);
201271
201846
  const outcome = ran.ok ? { ok: true, value: shown } : ran;
@@ -201280,13 +201855,24 @@ async function callTool(tool, args, log, caller, activity, run3, budget2, answer
201280
201855
  return internalErrorResult();
201281
201856
  }
201282
201857
  }
201858
+ function keptByPolicy(answer) {
201859
+ const kept2 = answer["autoPublished"];
201860
+ return typeof kept2 === "object" && kept2 !== null && kept2["published"] === true;
201861
+ }
201283
201862
  function withSaveStep(tool, value, library) {
201284
201863
  if (!SAVABLE_TOOLS.has(tool) || typeof value !== "object" || value === null) return value;
201285
201864
  const answer = value;
201286
- if (answer["valid"] === false) return value;
201865
+ if (answer["valid"] === false || keptByPolicy(answer)) return value;
201287
201866
  const next = typeof answer["next"] === "string" && answer["next"] !== "" ? `${answer["next"]} ` : "";
201288
201867
  return { ...answer, next: `${next}${librarySaveStep(library)}` };
201289
201868
  }
201869
+ function withKeepStep(tool, value) {
201870
+ if (!SAVABLE_TOOLS.has(tool) || typeof value !== "object" || value === null) return value;
201871
+ const answer = value;
201872
+ if (typeof answer["viewUrl"] !== "string" || keptByPolicy(answer)) return value;
201873
+ const next = typeof answer["next"] === "string" && answer["next"] !== "" ? `${answer["next"]} ` : "";
201874
+ return { ...answer, next: `${next}${KEEP_IN_LIBRARY_STEP}` };
201875
+ }
201290
201876
  async function callHostedTool(tool, args, log, caller) {
201291
201877
  const started = performance.now();
201292
201878
  const inputBytes = inputSize(args);
@@ -201323,7 +201909,7 @@ function wrapped(schema, validator) {
201323
201909
  return wrapper;
201324
201910
  }
201325
201911
  function createDiagramsServer(options3 = {}, log = logToConsole, caller, hostedTools = [], activity, run3 = runInPlace, budget2 = ANSWER_BUDGET_CHARACTERS, answers2 = {}, profile = "full") {
201326
- const finish = { ...answers2, viewBase: answers2.viewBase ?? viewBaseFor() };
201912
+ const finish = { ...answers2, viewBase: answers2.viewBase ?? viewBaseFor(), canPublish: hostedTools.some((tool) => tool.name === "publish_diagram") };
201327
201913
  const taken = new Set(TOOLS.map((tool) => tool.name));
201328
201914
  for (const tool of hostedTools) {
201329
201915
  if (taken.has(tool.name)) throw new TypeError(`A tool named ${tool.name} is already registered`);
@@ -201331,7 +201917,9 @@ function createDiagramsServer(options3 = {}, log = logToConsole, caller, hostedT
201331
201917
  }
201332
201918
  const base = profile === "core" ? CORE_INSTRUCTIONS : SERVER_INSTRUCTIONS;
201333
201919
  const hosted = hostedTools.length === 0 ? base : `${base} ${HOSTED_INSTRUCTIONS}`;
201334
- const instructions = hostedTools.length > 0 && answers2.library !== void 0 && answers2.library !== null ? `${hosted} ${libraryInstructions(answers2.library)}` : hosted;
201920
+ const saved = hostedTools.length > 0 && answers2.library !== void 0 && answers2.library !== null ? `${hosted} ${libraryInstructions(answers2.library)}` : hosted;
201921
+ const patterns = answers2.patterns ?? null;
201922
+ const instructions = patterns === null ? saved : `${saved} ${patternInstructions(patterns)}`;
201335
201923
  const server = new McpServer(SERVER_INFO, { instructions, ...options3 });
201336
201924
  for (const tool of hostedTools) {
201337
201925
  server.registerTool(
@@ -201352,7 +201940,7 @@ function createDiagramsServer(options3 = {}, log = logToConsole, caller, hostedT
201352
201940
  tool.name,
201353
201941
  {
201354
201942
  title: tool.title,
201355
- description: listed2.description,
201943
+ description: patterns !== null && tool.name === "find_pattern" ? `${listed2.description}${findPatternNote(patterns)}` : listed2.description,
201356
201944
  inputSchema: listedInput(listed2.inputSchema),
201357
201945
  ...listed2.withOutputSchema ? { outputSchema: wrapped(listedOutputJsonSchema(tool), options3.jsonSchemaValidator) } : {},
201358
201946
  annotations: tool.annotations,
@@ -201377,6 +201965,7 @@ var init_create_server = __esm({
201377
201965
  init_activity();
201378
201966
  init_audit();
201379
201967
  init_engine_runner();
201968
+ init_org_patterns2();
201380
201969
  init_prompts();
201381
201970
  init_server_info();
201382
201971
  init_tool_result();
@@ -201999,7 +202588,7 @@ async function main(args) {
201999
202588
  await main(process.argv.slice(2));
202000
202589
  /*! Bundled license information:
202001
202590
 
202002
- @modelcontextprotocol/server/dist/src-BHSMhZ_W.mjs:
202591
+ @modelcontextprotocol/server/dist/src-Cqbh3MYc.mjs:
202003
202592
  (*!
202004
202593
  * content-type
202005
202594
  * Copyright(c) 2015 Douglas Christopher Wilson