@probelabs/probe 0.6.0-rc145 → 0.6.0-rc146

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/cjs/index.cjs CHANGED
@@ -33,6 +33,364 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
+ // node_modules/dotenv/package.json
37
+ var require_package = __commonJS({
38
+ "node_modules/dotenv/package.json"(exports2, module2) {
39
+ module2.exports = {
40
+ name: "dotenv",
41
+ version: "16.6.1",
42
+ description: "Loads environment variables from .env file",
43
+ main: "lib/main.js",
44
+ types: "lib/main.d.ts",
45
+ exports: {
46
+ ".": {
47
+ types: "./lib/main.d.ts",
48
+ require: "./lib/main.js",
49
+ default: "./lib/main.js"
50
+ },
51
+ "./config": "./config.js",
52
+ "./config.js": "./config.js",
53
+ "./lib/env-options": "./lib/env-options.js",
54
+ "./lib/env-options.js": "./lib/env-options.js",
55
+ "./lib/cli-options": "./lib/cli-options.js",
56
+ "./lib/cli-options.js": "./lib/cli-options.js",
57
+ "./package.json": "./package.json"
58
+ },
59
+ scripts: {
60
+ "dts-check": "tsc --project tests/types/tsconfig.json",
61
+ lint: "standard",
62
+ pretest: "npm run lint && npm run dts-check",
63
+ test: "tap run --allow-empty-coverage --disable-coverage --timeout=60000",
64
+ "test:coverage": "tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",
65
+ prerelease: "npm test",
66
+ release: "standard-version"
67
+ },
68
+ repository: {
69
+ type: "git",
70
+ url: "git://github.com/motdotla/dotenv.git"
71
+ },
72
+ homepage: "https://github.com/motdotla/dotenv#readme",
73
+ funding: "https://dotenvx.com",
74
+ keywords: [
75
+ "dotenv",
76
+ "env",
77
+ ".env",
78
+ "environment",
79
+ "variables",
80
+ "config",
81
+ "settings"
82
+ ],
83
+ readmeFilename: "README.md",
84
+ license: "BSD-2-Clause",
85
+ devDependencies: {
86
+ "@types/node": "^18.11.3",
87
+ decache: "^4.6.2",
88
+ sinon: "^14.0.1",
89
+ standard: "^17.0.0",
90
+ "standard-version": "^9.5.0",
91
+ tap: "^19.2.0",
92
+ typescript: "^4.8.4"
93
+ },
94
+ engines: {
95
+ node: ">=12"
96
+ },
97
+ browser: {
98
+ fs: false
99
+ }
100
+ };
101
+ }
102
+ });
103
+
104
+ // node_modules/dotenv/lib/main.js
105
+ var require_main = __commonJS({
106
+ "node_modules/dotenv/lib/main.js"(exports2, module2) {
107
+ var fs6 = require("fs");
108
+ var path7 = require("path");
109
+ var os3 = require("os");
110
+ var crypto2 = require("crypto");
111
+ var packageJson = require_package();
112
+ var version = packageJson.version;
113
+ var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
114
+ function parse6(src) {
115
+ const obj = {};
116
+ let lines = src.toString();
117
+ lines = lines.replace(/\r\n?/mg, "\n");
118
+ let match2;
119
+ while ((match2 = LINE.exec(lines)) != null) {
120
+ const key = match2[1];
121
+ let value = match2[2] || "";
122
+ value = value.trim();
123
+ const maybeQuote = value[0];
124
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
125
+ if (maybeQuote === '"') {
126
+ value = value.replace(/\\n/g, "\n");
127
+ value = value.replace(/\\r/g, "\r");
128
+ }
129
+ obj[key] = value;
130
+ }
131
+ return obj;
132
+ }
133
+ function _parseVault(options) {
134
+ options = options || {};
135
+ const vaultPath = _vaultPath(options);
136
+ options.path = vaultPath;
137
+ const result = DotenvModule.configDotenv(options);
138
+ if (!result.parsed) {
139
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
140
+ err.code = "MISSING_DATA";
141
+ throw err;
142
+ }
143
+ const keys2 = _dotenvKey(options).split(",");
144
+ const length = keys2.length;
145
+ let decrypted;
146
+ for (let i3 = 0; i3 < length; i3++) {
147
+ try {
148
+ const key = keys2[i3].trim();
149
+ const attrs = _instructions(result, key);
150
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
151
+ break;
152
+ } catch (error2) {
153
+ if (i3 + 1 >= length) {
154
+ throw error2;
155
+ }
156
+ }
157
+ }
158
+ return DotenvModule.parse(decrypted);
159
+ }
160
+ function _warn(message) {
161
+ console.log(`[dotenv@${version}][WARN] ${message}`);
162
+ }
163
+ function _debug(message) {
164
+ console.log(`[dotenv@${version}][DEBUG] ${message}`);
165
+ }
166
+ function _log(message) {
167
+ console.log(`[dotenv@${version}] ${message}`);
168
+ }
169
+ function _dotenvKey(options) {
170
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
171
+ return options.DOTENV_KEY;
172
+ }
173
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
174
+ return process.env.DOTENV_KEY;
175
+ }
176
+ return "";
177
+ }
178
+ function _instructions(result, dotenvKey) {
179
+ let uri;
180
+ try {
181
+ uri = new URL(dotenvKey);
182
+ } catch (error2) {
183
+ if (error2.code === "ERR_INVALID_URL") {
184
+ const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
185
+ err.code = "INVALID_DOTENV_KEY";
186
+ throw err;
187
+ }
188
+ throw error2;
189
+ }
190
+ const key = uri.password;
191
+ if (!key) {
192
+ const err = new Error("INVALID_DOTENV_KEY: Missing key part");
193
+ err.code = "INVALID_DOTENV_KEY";
194
+ throw err;
195
+ }
196
+ const environment = uri.searchParams.get("environment");
197
+ if (!environment) {
198
+ const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
199
+ err.code = "INVALID_DOTENV_KEY";
200
+ throw err;
201
+ }
202
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
203
+ const ciphertext = result.parsed[environmentKey];
204
+ if (!ciphertext) {
205
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
206
+ err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
207
+ throw err;
208
+ }
209
+ return { ciphertext, key };
210
+ }
211
+ function _vaultPath(options) {
212
+ let possibleVaultPath = null;
213
+ if (options && options.path && options.path.length > 0) {
214
+ if (Array.isArray(options.path)) {
215
+ for (const filepath of options.path) {
216
+ if (fs6.existsSync(filepath)) {
217
+ possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
218
+ }
219
+ }
220
+ } else {
221
+ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
222
+ }
223
+ } else {
224
+ possibleVaultPath = path7.resolve(process.cwd(), ".env.vault");
225
+ }
226
+ if (fs6.existsSync(possibleVaultPath)) {
227
+ return possibleVaultPath;
228
+ }
229
+ return null;
230
+ }
231
+ function _resolveHome(envPath) {
232
+ return envPath[0] === "~" ? path7.join(os3.homedir(), envPath.slice(1)) : envPath;
233
+ }
234
+ function _configVault(options) {
235
+ const debug = Boolean(options && options.debug);
236
+ const quiet = options && "quiet" in options ? options.quiet : true;
237
+ if (debug || !quiet) {
238
+ _log("Loading env from encrypted .env.vault");
239
+ }
240
+ const parsed = DotenvModule._parseVault(options);
241
+ let processEnv = process.env;
242
+ if (options && options.processEnv != null) {
243
+ processEnv = options.processEnv;
244
+ }
245
+ DotenvModule.populate(processEnv, parsed, options);
246
+ return { parsed };
247
+ }
248
+ function configDotenv(options) {
249
+ const dotenvPath = path7.resolve(process.cwd(), ".env");
250
+ let encoding = "utf8";
251
+ const debug = Boolean(options && options.debug);
252
+ const quiet = options && "quiet" in options ? options.quiet : true;
253
+ if (options && options.encoding) {
254
+ encoding = options.encoding;
255
+ } else {
256
+ if (debug) {
257
+ _debug("No encoding is specified. UTF-8 is used by default");
258
+ }
259
+ }
260
+ let optionPaths = [dotenvPath];
261
+ if (options && options.path) {
262
+ if (!Array.isArray(options.path)) {
263
+ optionPaths = [_resolveHome(options.path)];
264
+ } else {
265
+ optionPaths = [];
266
+ for (const filepath of options.path) {
267
+ optionPaths.push(_resolveHome(filepath));
268
+ }
269
+ }
270
+ }
271
+ let lastError;
272
+ const parsedAll = {};
273
+ for (const path8 of optionPaths) {
274
+ try {
275
+ const parsed = DotenvModule.parse(fs6.readFileSync(path8, { encoding }));
276
+ DotenvModule.populate(parsedAll, parsed, options);
277
+ } catch (e3) {
278
+ if (debug) {
279
+ _debug(`Failed to load ${path8} ${e3.message}`);
280
+ }
281
+ lastError = e3;
282
+ }
283
+ }
284
+ let processEnv = process.env;
285
+ if (options && options.processEnv != null) {
286
+ processEnv = options.processEnv;
287
+ }
288
+ DotenvModule.populate(processEnv, parsedAll, options);
289
+ if (debug || !quiet) {
290
+ const keysCount = Object.keys(parsedAll).length;
291
+ const shortPaths = [];
292
+ for (const filePath of optionPaths) {
293
+ try {
294
+ const relative = path7.relative(process.cwd(), filePath);
295
+ shortPaths.push(relative);
296
+ } catch (e3) {
297
+ if (debug) {
298
+ _debug(`Failed to load ${filePath} ${e3.message}`);
299
+ }
300
+ lastError = e3;
301
+ }
302
+ }
303
+ _log(`injecting env (${keysCount}) from ${shortPaths.join(",")}`);
304
+ }
305
+ if (lastError) {
306
+ return { parsed: parsedAll, error: lastError };
307
+ } else {
308
+ return { parsed: parsedAll };
309
+ }
310
+ }
311
+ function config(options) {
312
+ if (_dotenvKey(options).length === 0) {
313
+ return DotenvModule.configDotenv(options);
314
+ }
315
+ const vaultPath = _vaultPath(options);
316
+ if (!vaultPath) {
317
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
318
+ return DotenvModule.configDotenv(options);
319
+ }
320
+ return DotenvModule._configVault(options);
321
+ }
322
+ function decrypt(encrypted, keyStr) {
323
+ const key = Buffer.from(keyStr.slice(-64), "hex");
324
+ let ciphertext = Buffer.from(encrypted, "base64");
325
+ const nonce = ciphertext.subarray(0, 12);
326
+ const authTag = ciphertext.subarray(-16);
327
+ ciphertext = ciphertext.subarray(12, -16);
328
+ try {
329
+ const aesgcm = crypto2.createDecipheriv("aes-256-gcm", key, nonce);
330
+ aesgcm.setAuthTag(authTag);
331
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
332
+ } catch (error2) {
333
+ const isRange = error2 instanceof RangeError;
334
+ const invalidKeyLength = error2.message === "Invalid key length";
335
+ const decryptionFailed = error2.message === "Unsupported state or unable to authenticate data";
336
+ if (isRange || invalidKeyLength) {
337
+ const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
338
+ err.code = "INVALID_DOTENV_KEY";
339
+ throw err;
340
+ } else if (decryptionFailed) {
341
+ const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
342
+ err.code = "DECRYPTION_FAILED";
343
+ throw err;
344
+ } else {
345
+ throw error2;
346
+ }
347
+ }
348
+ }
349
+ function populate(processEnv, parsed, options = {}) {
350
+ const debug = Boolean(options && options.debug);
351
+ const override = Boolean(options && options.override);
352
+ if (typeof parsed !== "object") {
353
+ const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
354
+ err.code = "OBJECT_REQUIRED";
355
+ throw err;
356
+ }
357
+ for (const key of Object.keys(parsed)) {
358
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
359
+ if (override === true) {
360
+ processEnv[key] = parsed[key];
361
+ }
362
+ if (debug) {
363
+ if (override === true) {
364
+ _debug(`"${key}" is already defined and WAS overwritten`);
365
+ } else {
366
+ _debug(`"${key}" is already defined and was NOT overwritten`);
367
+ }
368
+ }
369
+ } else {
370
+ processEnv[key] = parsed[key];
371
+ }
372
+ }
373
+ }
374
+ var DotenvModule = {
375
+ configDotenv,
376
+ _configVault,
377
+ _parseVault,
378
+ config,
379
+ decrypt,
380
+ parse: parse6,
381
+ populate
382
+ };
383
+ module2.exports.configDotenv = DotenvModule.configDotenv;
384
+ module2.exports._configVault = DotenvModule._configVault;
385
+ module2.exports._parseVault = DotenvModule._parseVault;
386
+ module2.exports.config = DotenvModule.config;
387
+ module2.exports.decrypt = DotenvModule.decrypt;
388
+ module2.exports.parse = DotenvModule.parse;
389
+ module2.exports.populate = DotenvModule.populate;
390
+ module2.exports = DotenvModule;
391
+ }
392
+ });
393
+
36
394
  // src/directory-resolver.js
37
395
  async function getPackageBinDir() {
38
396
  const debug = process.env.DEBUG === "1" || process.env.VERBOSE === "1";
@@ -21499,7 +21857,7 @@ var require_uint32ArrayFrom = __commonJS({
21499
21857
  });
21500
21858
 
21501
21859
  // node_modules/@aws-crypto/util/build/main/index.js
21502
- var require_main = __commonJS({
21860
+ var require_main2 = __commonJS({
21503
21861
  "node_modules/@aws-crypto/util/build/main/index.js"(exports2) {
21504
21862
  "use strict";
21505
21863
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -21530,8 +21888,8 @@ var require_aws_crc32 = __commonJS({
21530
21888
  Object.defineProperty(exports2, "__esModule", { value: true });
21531
21889
  exports2.AwsCrc32 = void 0;
21532
21890
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
21533
- var util_1 = require_main();
21534
- var index_1 = require_main2();
21891
+ var util_1 = require_main2();
21892
+ var index_1 = require_main3();
21535
21893
  var AwsCrc32 = (
21536
21894
  /** @class */
21537
21895
  (function() {
@@ -21561,13 +21919,13 @@ var require_aws_crc32 = __commonJS({
21561
21919
  });
21562
21920
 
21563
21921
  // node_modules/@aws-crypto/crc32/build/main/index.js
21564
- var require_main2 = __commonJS({
21922
+ var require_main3 = __commonJS({
21565
21923
  "node_modules/@aws-crypto/crc32/build/main/index.js"(exports2) {
21566
21924
  "use strict";
21567
21925
  Object.defineProperty(exports2, "__esModule", { value: true });
21568
21926
  exports2.AwsCrc32 = exports2.Crc32 = exports2.crc32 = void 0;
21569
21927
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
21570
- var util_1 = require_main();
21928
+ var util_1 = require_main2();
21571
21929
  function crc32(data2) {
21572
21930
  return new Crc32().update(data2).digest();
21573
21931
  }
@@ -21873,7 +22231,7 @@ var require_main2 = __commonJS({
21873
22231
  var require_dist_cjs33 = __commonJS({
21874
22232
  "node_modules/@smithy/eventstream-codec/dist-cjs/index.js"(exports2) {
21875
22233
  "use strict";
21876
- var crc32 = require_main2();
22234
+ var crc32 = require_main3();
21877
22235
  var utilHexEncoding = require_dist_cjs17();
21878
22236
  var Int64 = class _Int64 {
21879
22237
  bytes;
@@ -24423,12 +24781,12 @@ var require_httpAuthSchemeProvider = __commonJS({
24423
24781
  });
24424
24782
 
24425
24783
  // node_modules/@aws-sdk/client-bedrock-runtime/package.json
24426
- var require_package = __commonJS({
24784
+ var require_package2 = __commonJS({
24427
24785
  "node_modules/@aws-sdk/client-bedrock-runtime/package.json"(exports2, module2) {
24428
24786
  module2.exports = {
24429
24787
  name: "@aws-sdk/client-bedrock-runtime",
24430
24788
  description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
24431
- version: "3.911.0",
24789
+ version: "3.913.0",
24432
24790
  scripts: {
24433
24791
  build: "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
24434
24792
  "build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
@@ -24448,7 +24806,7 @@ var require_package = __commonJS({
24448
24806
  "@aws-crypto/sha256-browser": "5.2.0",
24449
24807
  "@aws-crypto/sha256-js": "5.2.0",
24450
24808
  "@aws-sdk/core": "3.911.0",
24451
- "@aws-sdk/credential-provider-node": "3.911.0",
24809
+ "@aws-sdk/credential-provider-node": "3.913.0",
24452
24810
  "@aws-sdk/eventstream-handler-node": "3.910.0",
24453
24811
  "@aws-sdk/middleware-eventstream": "3.910.0",
24454
24812
  "@aws-sdk/middleware-host-header": "3.910.0",
@@ -26657,7 +27015,7 @@ var require_httpAuthSchemeProvider2 = __commonJS({
26657
27015
  });
26658
27016
 
26659
27017
  // node_modules/@aws-sdk/client-sso/package.json
26660
- var require_package2 = __commonJS({
27018
+ var require_package3 = __commonJS({
26661
27019
  "node_modules/@aws-sdk/client-sso/package.json"(exports2, module2) {
26662
27020
  module2.exports = {
26663
27021
  name: "@aws-sdk/client-sso",
@@ -26872,7 +27230,7 @@ var require_runtimeConfig = __commonJS({
26872
27230
  Object.defineProperty(exports2, "__esModule", { value: true });
26873
27231
  exports2.getRuntimeConfig = void 0;
26874
27232
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
26875
- var package_json_1 = tslib_1.__importDefault(require_package2());
27233
+ var package_json_1 = tslib_1.__importDefault(require_package3());
26876
27234
  var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2));
26877
27235
  var util_user_agent_node_1 = require_dist_cjs51();
26878
27236
  var config_resolver_1 = require_dist_cjs39();
@@ -29106,7 +29464,7 @@ var require_dist_cjs61 = __commonJS({
29106
29464
  }
29107
29465
  return withProviderProfile;
29108
29466
  };
29109
- var resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}) => {
29467
+ var resolveAssumeRoleCredentials = async (profileName, profiles, options, visitedProfiles = {}, resolveProfileData2) => {
29110
29468
  options.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");
29111
29469
  const profileData = profiles[profileName];
29112
29470
  const { source_profile, region } = profileData;
@@ -29125,7 +29483,7 @@ var require_dist_cjs61 = __commonJS({
29125
29483
  throw new propertyProvider.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${sharedIniFileLoader.getProfileName(options)}. Profiles visited: ` + Object.keys(visitedProfiles).join(", "), { logger: options.logger });
29126
29484
  }
29127
29485
  options.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${source_profile ? `source_profile=[${source_profile}]` : `profile=[${profileName}]`}`);
29128
- const sourceCredsProvider = source_profile ? resolveProfileData(source_profile, profiles, options, {
29486
+ const sourceCredsProvider = source_profile ? resolveProfileData2(source_profile, profiles, options, {
29129
29487
  ...visitedProfiles,
29130
29488
  [source_profile]: true
29131
29489
  }, isCredentialSourceWithoutRoleArn(profiles[source_profile] ?? {})) : (await resolveCredentialSource(profileData.credential_source, profileName, options.logger)(options))();
@@ -29201,7 +29559,7 @@ var require_dist_cjs61 = __commonJS({
29201
29559
  return resolveStaticCredentials(data2, options);
29202
29560
  }
29203
29561
  if (isAssumeRoleRecursiveCall || isAssumeRoleProfile(data2, { profile: profileName, logger: options.logger })) {
29204
- return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles);
29562
+ return resolveAssumeRoleCredentials(profileName, profiles, options, visitedProfiles, resolveProfileData);
29205
29563
  }
29206
29564
  if (isStaticCredsProfile(data2)) {
29207
29565
  return resolveStaticCredentials(data2, options);
@@ -29593,7 +29951,7 @@ var require_runtimeConfig2 = __commonJS({
29593
29951
  Object.defineProperty(exports2, "__esModule", { value: true });
29594
29952
  exports2.getRuntimeConfig = void 0;
29595
29953
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
29596
- var package_json_1 = tslib_1.__importDefault(require_package());
29954
+ var package_json_1 = tslib_1.__importDefault(require_package2());
29597
29955
  var core_1 = (init_dist_es2(), __toCommonJS(dist_es_exports2));
29598
29956
  var credential_provider_node_1 = require_dist_cjs62();
29599
29957
  var eventstream_handler_node_1 = require_dist_cjs63();
@@ -54087,8 +54445,8 @@ var init_parser2 = __esm({
54087
54445
  { ALT: () => this.CONSUME(Identifier) },
54088
54446
  { ALT: () => this.CONSUME(Text) },
54089
54447
  { ALT: () => this.CONSUME(NumberLiteral) },
54090
- { ALT: () => this.CONSUME(RoundOpen) },
54091
- { ALT: () => this.CONSUME(RoundClose) },
54448
+ // Note: RoundOpen and RoundClose (parentheses) are NOT allowed in unquoted labels
54449
+ // to match Mermaid's behavior - use quoted labels like ["text (with parens)"] instead
54092
54450
  // Allow HTML-like tags (e.g., <br/>) inside labels
54093
54451
  { ALT: () => this.CONSUME(AngleLess) },
54094
54452
  { ALT: () => this.CONSUME(AngleOpen) },
@@ -54177,7 +54535,17 @@ var init_parser2 = __esm({
54177
54535
  this.OR([
54178
54536
  { ALT: () => this.CONSUME(Identifier) },
54179
54537
  { ALT: () => this.CONSUME(Text) },
54180
- { ALT: () => this.CONSUME(NumberLiteral) }
54538
+ { ALT: () => this.CONSUME(NumberLiteral) },
54539
+ // Allow HTML-like angle brackets and slashes for <br/>, <i>, etc.
54540
+ { ALT: () => this.CONSUME(AngleLess) },
54541
+ { ALT: () => this.CONSUME(AngleOpen) },
54542
+ { ALT: () => this.CONSUME(ForwardSlash) },
54543
+ { ALT: () => this.CONSUME(Backslash) },
54544
+ // Allow common punctuation seen in labels
54545
+ { ALT: () => this.CONSUME(Comma) },
54546
+ { ALT: () => this.CONSUME(Colon) },
54547
+ { ALT: () => this.CONSUME(Ampersand) },
54548
+ { ALT: () => this.CONSUME(Semicolon) }
54181
54549
  ]);
54182
54550
  });
54183
54551
  });
@@ -54789,7 +55157,7 @@ var init_semantics = __esm({
54789
55157
  this.ctx.errors.push({
54790
55158
  line: q3.startLine ?? 1,
54791
55159
  column: col,
54792
- severity: "warning",
55160
+ severity: "error",
54793
55161
  code: "FL-LABEL-CURLY-IN-QUOTED",
54794
55162
  message: "Curly braces inside quoted label text may be parsed as a shape by Mermaid. Replace { and } with HTML entities.",
54795
55163
  hint: 'Use &#123; and &#125; for { and } inside quoted text, e.g., "tyk-trace-&#123;id&#125;".',
@@ -54919,6 +55287,8 @@ var init_semantics = __esm({
54919
55287
  this.ctx.errors.push({
54920
55288
  line: tk.startLine ?? 1,
54921
55289
  column: col,
55290
+ // Treat backticks in quoted labels as errors (CLI rejects in many cases);
55291
+ // outside quotes, surface as a warning.
54922
55292
  severity: inQuoted ? "error" : "warning",
54923
55293
  code: "FL-LABEL-BACKTICK",
54924
55294
  message: "Backticks (`\u2026`) inside node labels are not supported by Mermaid.",
@@ -56203,7 +56573,7 @@ function validateFlowchart(text, options = {}) {
56203
56573
  code: "FL-LABEL-ESCAPED-QUOTE",
56204
56574
  message: 'Escaped quotes (\\") in node labels are accepted by Mermaid, but using &quot; is preferred for portability.',
56205
56575
  hint: 'Prefer &quot; inside quoted labels, e.g., A["He said &quot;Hi&quot;"]'
56206
- }).map((e3) => ({ ...e3, severity: "warning" }));
56576
+ }).map((e3) => ({ ...e3, severity: "error" }));
56207
56577
  const seenDoubleLines = new Set(prevErrors.filter((e3) => e3.code === "FL-LABEL-DOUBLE-IN-DOUBLE").map((e3) => e3.line));
56208
56578
  const escapedLinesAll = new Set(detectEscapedQuotes(tokens, { code: "x" }).map((e3) => e3.line));
56209
56579
  const dbl = detectDoubleInDouble(tokens, {
@@ -58482,11 +58852,85 @@ function computeFixes(text, errors, level = "safe") {
58482
58852
  const patchedLines = /* @__PURE__ */ new Set();
58483
58853
  const seen = /* @__PURE__ */ new Set();
58484
58854
  const piQuoteClosedLines = /* @__PURE__ */ new Set();
58855
+ function sanitizeAllQuotedSegmentsInShapes(lineText, lineNo) {
58856
+ const shapes = [
58857
+ { open: "[[", close: "]]" },
58858
+ { open: "((", close: "))" },
58859
+ { open: "{{", close: "}}" },
58860
+ { open: "[(", close: ")]" },
58861
+ { open: "([", close: "])" },
58862
+ { open: "{", close: "}" },
58863
+ { open: "[", close: "]" },
58864
+ { open: "(", close: ")" }
58865
+ ];
58866
+ let idx = 0;
58867
+ let produced = 0;
58868
+ while (idx < lineText.length) {
58869
+ let found = null;
58870
+ for (const s3 of shapes) {
58871
+ const i3 = lineText.indexOf(s3.open, idx);
58872
+ if (i3 !== -1 && (found === null || i3 < found.i))
58873
+ found = { ...s3, i: i3 };
58874
+ }
58875
+ if (!found)
58876
+ break;
58877
+ const contentStart = found.i + found.open.length;
58878
+ const closeIdx = lineText.indexOf(found.close, contentStart);
58879
+ if (closeIdx === -1) {
58880
+ idx = contentStart;
58881
+ continue;
58882
+ }
58883
+ let q1 = -1;
58884
+ for (let i3 = contentStart; i3 < closeIdx; i3++) {
58885
+ if (lineText[i3] === '"' && lineText[i3 - 1] !== "\\") {
58886
+ q1 = i3;
58887
+ break;
58888
+ }
58889
+ }
58890
+ if (q1 !== -1) {
58891
+ let q22 = -1;
58892
+ for (let j3 = closeIdx - 1; j3 > q1; j3--) {
58893
+ if (lineText[j3] === '"' && lineText[j3 - 1] !== "\\") {
58894
+ q22 = j3;
58895
+ break;
58896
+ }
58897
+ }
58898
+ if (q22 !== -1) {
58899
+ const inner = lineText.slice(q1 + 1, q22);
58900
+ const replaced = sanitizeQuotedInner(inner);
58901
+ if (replaced !== inner) {
58902
+ edits.push({ start: { line: lineNo, column: q1 + 2 }, end: { line: lineNo, column: q22 + 1 }, newText: replaced });
58903
+ produced++;
58904
+ }
58905
+ }
58906
+ }
58907
+ idx = closeIdx + found.close.length;
58908
+ }
58909
+ return produced;
58910
+ }
58911
+ function sanitizeQuotedInner(inner) {
58912
+ const SENT_Q = "\0__Q__";
58913
+ let out = inner.split("&quot;").join(SENT_Q);
58914
+ out = out.replace(/`/g, "");
58915
+ out = out.replace(/\\\"/g, "&quot;");
58916
+ out = out.replace(/\"/g, "&quot;");
58917
+ out = out.replace(/"/g, "&quot;");
58918
+ out = out.split(SENT_Q).join("&quot;");
58919
+ return out;
58920
+ }
58485
58921
  for (const e3 of errors) {
58486
58922
  const key = `${e3.code}@${e3.line}:${e3.column}:${e3.length ?? 1}`;
58487
58923
  if (seen.has(key))
58488
58924
  continue;
58489
58925
  seen.add(key);
58926
+ if ((e3.code === "FL-LABEL-ESCAPED-QUOTE" || e3.code === "FL-LABEL-CURLY-IN-QUOTED" || e3.code === "FL-LABEL-DOUBLE-IN-DOUBLE" || e3.code === "FL-LABEL-BACKTICK") && !patchedLines.has(e3.line)) {
58927
+ const lineText = lineTextAt(text, e3.line);
58928
+ const produced = sanitizeAllQuotedSegmentsInShapes(lineText, e3.line);
58929
+ patchedLines.add(e3.line);
58930
+ if (produced > 0) {
58931
+ continue;
58932
+ }
58933
+ }
58490
58934
  if (is("FL-ARROW-INVALID", e3)) {
58491
58935
  edits.push(replaceRange(text, at(e3), e3.length ?? 2, "-->"));
58492
58936
  continue;
@@ -58591,6 +59035,8 @@ function computeFixes(text, errors, level = "safe") {
58591
59035
  continue;
58592
59036
  }
58593
59037
  if (is("FL-LABEL-ESCAPED-QUOTE", e3)) {
59038
+ if (patchedLines.has(e3.line))
59039
+ continue;
58594
59040
  const lineText = lineTextAt(text, e3.line);
58595
59041
  const caret0 = Math.max(0, e3.column - 1);
58596
59042
  const opens = [
@@ -58613,17 +59059,10 @@ function computeFixes(text, errors, level = "safe") {
58613
59059
  const q22 = lineText.lastIndexOf('"', closeIdx - 1);
58614
59060
  if (q1 !== -1 && q22 !== -1 && q22 > q1) {
58615
59061
  const inner = lineText.slice(q1 + 1, q22);
58616
- if (inner.includes('\\"')) {
58617
- const replaced = inner.split('\\"').join("&quot;");
59062
+ const replaced = sanitizeQuotedInner(inner);
59063
+ if (replaced !== inner) {
58618
59064
  edits.push({ start: { line: e3.line, column: q1 + 2 }, end: { line: e3.line, column: q22 + 1 }, newText: replaced });
58619
59065
  continue;
58620
- if (is("FL-META-UNSUPPORTED", e3)) {
58621
- if (level === "all") {
58622
- const lineText2 = lineTextAt(text, e3.line);
58623
- edits.push({ start: { line: e3.line, column: 1 }, end: { line: e3.line + 1, column: 1 }, newText: "" });
58624
- }
58625
- continue;
58626
- }
58627
59066
  }
58628
59067
  }
58629
59068
  }
@@ -58633,11 +59072,12 @@ function computeFixes(text, errors, level = "safe") {
58633
59072
  }
58634
59073
  if (is("FL-META-UNSUPPORTED", e3)) {
58635
59074
  if (level === "all") {
59075
+ const lineText = lineTextAt(text, e3.line);
58636
59076
  edits.push({ start: { line: e3.line, column: 1 }, end: { line: e3.line + 1, column: 1 }, newText: "" });
58637
59077
  }
58638
59078
  continue;
58639
59079
  }
58640
- if (is("FL-LABEL-BACKTICK", e3)) {
59080
+ if (is("FL-LABEL-BACKTICK", e3) && e3.severity === "warning") {
58641
59081
  edits.push(replaceRange(text, at(e3), e3.length ?? 1, ""));
58642
59082
  continue;
58643
59083
  }
@@ -58647,13 +59087,13 @@ function computeFixes(text, errors, level = "safe") {
58647
59087
  let qOpenIdx = -1;
58648
59088
  let qChar = null;
58649
59089
  for (let i3 = caret0; i3 >= 0; i3--) {
58650
- const ch2 = lineText[i3];
58651
- const code = ch2 ? ch2.charCodeAt(0) : -1;
59090
+ const ch = lineText[i3];
59091
+ const code = ch ? ch.charCodeAt(0) : -1;
58652
59092
  if (code === 34 || code === 39) {
58653
59093
  const bs = i3 > 0 && lineText[i3 - 1] === "\\";
58654
59094
  if (!bs) {
58655
59095
  qOpenIdx = i3;
58656
- qChar = ch2;
59096
+ qChar = ch;
58657
59097
  break;
58658
59098
  }
58659
59099
  }
@@ -58661,8 +59101,8 @@ function computeFixes(text, errors, level = "safe") {
58661
59101
  if (qOpenIdx !== -1 && qChar) {
58662
59102
  let qCloseIdx = -1;
58663
59103
  for (let j3 = qOpenIdx + 1; j3 < lineText.length; j3++) {
58664
- const ch2 = lineText[j3];
58665
- const code = ch2 ? ch2.charCodeAt(0) : -1;
59104
+ const ch = lineText[j3];
59105
+ const code = ch ? ch.charCodeAt(0) : -1;
58666
59106
  if (code === (qChar ? qChar.charCodeAt(0) : -1)) {
58667
59107
  const bs = lineText[j3 - 1] === "\\";
58668
59108
  if (!bs) {
@@ -58673,17 +59113,13 @@ function computeFixes(text, errors, level = "safe") {
58673
59113
  }
58674
59114
  if (qCloseIdx > qOpenIdx) {
58675
59115
  const inner = lineText.slice(qOpenIdx + 1, qCloseIdx);
58676
- const replaced = inner.replace(/\{/g, "&#123;").replace(/\}/g, "&#125;");
59116
+ const replaced = sanitizeQuotedInner(inner);
58677
59117
  if (replaced !== inner) {
58678
59118
  edits.push({ start: { line: e3.line, column: qOpenIdx + 2 }, end: { line: e3.line, column: qCloseIdx + 1 }, newText: replaced });
58679
59119
  continue;
58680
59120
  }
58681
59121
  }
58682
59122
  }
58683
- const ch = lineText[caret0] || "";
58684
- const rep = ch === "{" ? "&#123;" : ch === "}" ? "&#125;" : ch;
58685
- if (rep !== ch)
58686
- edits.push(replaceRange(text, at(e3), e3.length ?? 1, rep));
58687
59123
  continue;
58688
59124
  }
58689
59125
  if (is("FL-END-WITHOUT-SUBGRAPH", e3)) {
@@ -58695,6 +59131,11 @@ function computeFixes(text, errors, level = "safe") {
58695
59131
  if (is("FL-LABEL-DOUBLE-IN-DOUBLE", e3)) {
58696
59132
  const lineText = lineTextAt(text, e3.line);
58697
59133
  const caret0 = Math.max(0, e3.column - 1);
59134
+ const rawDqCount = (lineText.match(/\"/g) || []).length;
59135
+ const unescapedDqCount = (lineText.replace(/\\\"/g, "").match(/\"/g) || []).length;
59136
+ if (rawDqCount + unescapedDqCount > 8 && level !== "all") {
59137
+ continue;
59138
+ }
58698
59139
  const opens = [
58699
59140
  { tok: "[[", idx: lineText.lastIndexOf("[[", caret0) },
58700
59141
  { tok: "((", idx: lineText.lastIndexOf("((", caret0) },
@@ -58718,7 +59159,7 @@ function computeFixes(text, errors, level = "safe") {
58718
59159
  const q22 = lineText.lastIndexOf('"', closeIdx - 1);
58719
59160
  if (q1 !== -1 && q22 !== -1 && q22 > q1) {
58720
59161
  const inner = lineText.slice(q1 + 1, q22);
58721
- const replaced = inner.split("&quot;").join("\0").split('"').join("&quot;").split("\0").join("&quot;");
59162
+ const replaced = sanitizeQuotedInner(inner);
58722
59163
  if (replaced !== inner) {
58723
59164
  const start = { line: e3.line, column: q1 + 2 };
58724
59165
  const end = { line: e3.line, column: q22 + 1 };
@@ -59080,6 +59521,10 @@ function computeFixes(text, errors, level = "safe") {
59080
59521
  if (level === "safe" || level === "all") {
59081
59522
  const lineText = lineTextAt(text, e3.line);
59082
59523
  const caret0 = Math.max(0, e3.column - 1);
59524
+ const dq = (lineText.replace(/\\\"/g, "").match(/\"/g) || []).length;
59525
+ if (lineText.length > 600 || dq > 8) {
59526
+ continue;
59527
+ }
59083
59528
  const openPairs = [
59084
59529
  { open: "[[", close: "]]", idx: lineText.lastIndexOf("[[", caret0), delta: 2 },
59085
59530
  { open: "((", close: "))", idx: lineText.lastIndexOf("((", caret0), delta: 2 },
@@ -59130,6 +59575,24 @@ function computeFixes(text, errors, level = "safe") {
59130
59575
  { open: "[", close: "]" },
59131
59576
  { open: "(", close: ")" }
59132
59577
  ];
59578
+ const findMatchingCloser = (text2, openIdx, opener, closer) => {
59579
+ let pos = openIdx + opener.length;
59580
+ let depth = 1;
59581
+ while (pos < text2.length && depth > 0) {
59582
+ if (text2.slice(pos, pos + opener.length) === opener) {
59583
+ depth++;
59584
+ pos += opener.length;
59585
+ } else if (text2.slice(pos, pos + closer.length) === closer) {
59586
+ depth--;
59587
+ if (depth === 0)
59588
+ return pos;
59589
+ pos += closer.length;
59590
+ } else {
59591
+ pos++;
59592
+ }
59593
+ }
59594
+ return -1;
59595
+ };
59133
59596
  for (const shape of shapes) {
59134
59597
  let searchStart = 0;
59135
59598
  while (true) {
@@ -59137,7 +59600,7 @@ function computeFixes(text, errors, level = "safe") {
59137
59600
  if (openIdx === -1)
59138
59601
  break;
59139
59602
  const contentStart = openIdx + shape.open.length;
59140
- const closeIdx = lineText.indexOf(shape.close, contentStart);
59603
+ const closeIdx = shape.open === "(" && shape.close === ")" ? findMatchingCloser(lineText, openIdx, shape.open, shape.close) : lineText.indexOf(shape.close, contentStart);
59141
59604
  if (closeIdx === -1)
59142
59605
  break;
59143
59606
  if (openIdx <= caret0 && caret0 < closeIdx) {
@@ -59155,10 +59618,11 @@ function computeFixes(text, errors, level = "safe") {
59155
59618
  const left = core.slice(0, 1);
59156
59619
  const right = core.slice(-1);
59157
59620
  const isSlashPair = (l3, r3) => l3 === "/" && r3 === "/" || l3 === "\\" && r3 === "\\" || l3 === "/" && r3 === "\\" || l3 === "\\" && r3 === "/";
59158
- if (core.length >= 2 && isSlashPair(left, right)) {
59159
- break;
59621
+ const isParallelogramShape = core.length >= 2 && isSlashPair(left, right);
59622
+ let replaced = inner.replace(/\(/g, "&#40;").replace(/\)/g, "&#41;");
59623
+ if (isParallelogramShape) {
59624
+ replaced = replaced.replace(/"/g, "&quot;");
59160
59625
  }
59161
- const replaced = inner.replace(/\(/g, "&#40;").replace(/\)/g, "&#41;");
59162
59626
  if (replaced !== inner) {
59163
59627
  edits.push({ start: { line: e3.line, column: contentStart + 1 }, end: { line: e3.line, column: closeIdx + 1 }, newText: replaced });
59164
59628
  patchedLines.add(e3.line);
@@ -69278,7 +69742,7 @@ ${baseGroup}
69278
69742
  return out;
69279
69743
  }
69280
69744
  htmlDecode(s3) {
69281
- return s3.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&#39;/g, "'");
69745
+ return s3.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&#96;/g, "`").replace(/&#123;/g, "{").replace(/&#125;/g, "}").replace(/&#40;/g, "(").replace(/&#41;/g, ")");
69282
69746
  }
69283
69747
  generateEdge(edge, padX, padY, nodeMap) {
69284
69748
  if (!edge.points || edge.points.length < 2) {
@@ -73987,10 +74451,11 @@ var ProbeAgent_exports = {};
73987
74451
  __export(ProbeAgent_exports, {
73988
74452
  ProbeAgent: () => ProbeAgent
73989
74453
  });
73990
- var import_anthropic, import_openai, import_google, import_ai3, import_crypto5, import_events2, import_fs7, import_promises2, import_path9, MAX_TOOL_ITERATIONS, MAX_HISTORY_MESSAGES, SUPPORTED_IMAGE_EXTENSIONS, MAX_IMAGE_FILE_SIZE, ProbeAgent;
74454
+ var import_dotenv, import_anthropic, import_openai, import_google, import_ai3, import_crypto5, import_events2, import_fs7, import_promises2, import_path9, MAX_TOOL_ITERATIONS, MAX_HISTORY_MESSAGES, SUPPORTED_IMAGE_EXTENSIONS, MAX_IMAGE_FILE_SIZE, ProbeAgent;
73991
74455
  var init_ProbeAgent = __esm({
73992
74456
  "src/agent/ProbeAgent.js"() {
73993
74457
  "use strict";
74458
+ import_dotenv = __toESM(require_main(), 1);
73994
74459
  import_anthropic = require("@ai-sdk/anthropic");
73995
74460
  import_openai = require("@ai-sdk/openai");
73996
74461
  import_google = require("@ai-sdk/google");
@@ -74012,6 +74477,7 @@ var init_ProbeAgent = __esm({
74012
74477
  init_schemaUtils();
74013
74478
  init_xmlParsingUtils();
74014
74479
  init_mcp();
74480
+ import_dotenv.default.config();
74015
74481
  MAX_TOOL_ITERATIONS = parseInt(process.env.MAX_TOOL_ITERATIONS || "30", 10);
74016
74482
  MAX_HISTORY_MESSAGES = 100;
74017
74483
  SUPPORTED_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "webp", "gif", "bmp", "svg"];
@@ -76860,8 +77326,10 @@ __export(index_exports, {
76860
77326
  tools: () => tools_exports
76861
77327
  });
76862
77328
  module.exports = __toCommonJS(index_exports);
77329
+ var import_dotenv2;
76863
77330
  var init_index = __esm({
76864
77331
  "src/index.js"() {
77332
+ import_dotenv2 = __toESM(require_main(), 1);
76865
77333
  init_search();
76866
77334
  init_query();
76867
77335
  init_extract();
@@ -76881,6 +77349,7 @@ var init_index = __esm({
76881
77349
  init_probeTool();
76882
77350
  init_storage();
76883
77351
  init_hooks();
77352
+ import_dotenv2.default.config();
76884
77353
  }
76885
77354
  });
76886
77355
  init_index();