lazycodex-ai 5.0.0-beta.49 → 5.0.0-beta.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/cli/index.js +4682 -14969
  2. package/dist/cli-node/index.js +4727 -15014
  3. package/package.json +1 -1
  4. package/packages/lsp-daemon/dist/cli.js +181 -181
  5. package/packages/lsp-daemon/dist/client.js +232 -232
  6. package/packages/lsp-daemon/dist/index.js +132 -132
  7. package/packages/lsp-tools-mcp/dist/cli.js +103 -101
  8. package/packages/lsp-tools-mcp/dist/lsp/manager.js +14 -14
  9. package/packages/lsp-tools-mcp/dist/mcp.js +129 -129
  10. package/packages/lsp-tools-mcp/dist/tools.js +47 -47
  11. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  12. package/packages/omo-codex/plugin/README.md +4 -0
  13. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +151 -102
  14. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  15. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  16. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  17. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  18. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  19. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  20. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/AGENTS.md +2 -2
  21. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/directive.md +2 -0
  22. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +35 -24
  23. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +31 -21
  24. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.d.ts +3 -0
  25. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  26. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  27. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +31 -23
  28. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/types.ts +3 -0
  29. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/cli.test.ts +1 -1
  30. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +133 -7
  31. package/packages/omo-codex/plugin/components/lcx/skills/lcx-doctor/SKILL.md +3 -1
  32. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  33. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +298 -298
  34. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  35. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  36. package/packages/omo-codex/plugin/components/rules/README.md +2 -0
  37. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-6.md +123 -0
  38. package/packages/omo-codex/plugin/components/rules/dist/cli.js +38 -30
  39. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  40. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  41. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +6 -0
  42. package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +38 -2
  43. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +24 -0
  44. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  45. package/packages/omo-codex/plugin/components/teammode/package.json +2 -2
  46. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +66 -357
  47. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +66 -358
  48. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  49. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  50. package/packages/omo-codex/plugin/components/ultrawork/README.md +2 -0
  51. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
  52. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +1 -1
  53. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
  54. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
  55. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
  56. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
  57. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-low.toml +1 -1
  58. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +1 -1
  59. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +1 -1
  60. package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +1 -1
  61. package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +1 -1
  62. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  63. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  64. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  65. package/packages/omo-codex/plugin/components/ulw-execute-continuation/dist/cli.js +3 -3
  66. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  67. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  68. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +63 -63
  69. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  70. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  71. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  72. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  73. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  74. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  78. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  92. package/packages/omo-codex/plugin/model-catalog.json +16 -7
  93. package/packages/omo-codex/plugin/package-lock.json +16 -16
  94. package/packages/omo-codex/plugin/package.json +1 -1
  95. package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +16 -7
  96. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +8 -4
  97. package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +18 -90
  98. package/packages/omo-codex/plugin/scripts/migrate-codex-config/toml-section-editor.mjs +1 -1
  99. package/packages/omo-codex/plugin/shared/package.json +1 -1
  100. package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +3 -1
  101. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +12 -12
  102. package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +14 -4
  103. package/packages/omo-codex/plugin/test/auto-update.test.mjs +4 -4
  104. package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +25 -1
  105. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +35 -35
  106. package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +1 -1
  107. package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +107 -15
  108. package/packages/omo-codex/scripts/install-dist/install-local.mjs +318 -569
@@ -1,18 +1,4 @@
1
1
  #!/usr/bin/env node
2
- var __defProp = Object.defineProperty;
3
- var __returnValue = (v) => v;
4
- function __exportSetter(name, newValue) {
5
- this[name] = __returnValue.bind(null, newValue);
6
- }
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, {
10
- get: all[name],
11
- enumerable: true,
12
- configurable: true,
13
- set: __exportSetter.bind(all, name)
14
- });
15
- };
16
2
 
17
3
  // components/telemetry/src/cli.ts
18
4
  import { stdin as processStdin, stdout as processStdout } from "node:process";
@@ -385,8 +371,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname2(proce
385
371
  return decodedFile;
386
372
  };
387
373
  }
388
- function normalizeWindowsPath(path2) {
389
- return path2.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
374
+ function normalizeWindowsPath(path) {
375
+ return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
390
376
  }
391
377
 
392
378
  // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/featureFlagUtils.mjs
@@ -807,9 +793,6 @@ function isError(candidate) {
807
793
  return isInstanceOf(candidate, Error);
808
794
  }
809
795
  }
810
- function isErrorEvent(event) {
811
- return isBuiltin(event, "ErrorEvent");
812
- }
813
796
  function isEvent(candidate) {
814
797
  return typeof Event != "undefined" && isInstanceOf(candidate, Event);
815
798
  }
@@ -1548,14 +1531,14 @@ function newState() {
1548
1531
  remainingNodes: MAX_JSON_SAFE_VALUE_NODES
1549
1532
  };
1550
1533
  }
1551
- function toOtlpKeyValueList(attrs, logger2) {
1534
+ function toOtlpKeyValueList(attrs, logger) {
1552
1535
  try {
1553
- return encodeKeyValueList(attrs, logger2, newState(), 0);
1536
+ return encodeKeyValueList(attrs, logger, newState(), 0);
1554
1537
  } catch {
1555
1538
  return [];
1556
1539
  }
1557
1540
  }
1558
- function encodeAnyValue(value, logger2, state, depth) {
1541
+ function encodeAnyValue(value, logger, state, depth) {
1559
1542
  if (state.remainingNodes <= 0)
1560
1543
  return {
1561
1544
  stringValue: TRUNCATED_VALUE
@@ -1581,7 +1564,7 @@ function encodeAnyValue(value, logger2, state, depth) {
1581
1564
  };
1582
1565
  const decimal = BigInt(value).toString();
1583
1566
  if (value >= INT64_RANGE_LIMIT || value < -INT64_RANGE_LIMIT) {
1584
- logger2?.debug(`Attribute ${decimal} is outside the int64 range; encoding it as a string`);
1567
+ logger?.debug(`Attribute ${decimal} is outside the int64 range; encoding it as a string`);
1585
1568
  return {
1586
1569
  stringValue: decimal
1587
1570
  };
@@ -1627,17 +1610,17 @@ function encodeAnyValue(value, logger2, state, depth) {
1627
1610
  try {
1628
1611
  const toJSON = value.toJSON;
1629
1612
  if (typeof toJSON == "function")
1630
- return encodeAnyValue(toJSON.call(value), logger2, state, depth + 1);
1613
+ return encodeAnyValue(toJSON.call(value), logger, state, depth + 1);
1631
1614
  } catch {}
1632
1615
  if (isArray(value))
1633
1616
  return {
1634
1617
  arrayValue: {
1635
- values: encodeArrayValues(value, logger2, state, depth + 1)
1618
+ values: encodeArrayValues(value, logger, state, depth + 1)
1636
1619
  }
1637
1620
  };
1638
1621
  return {
1639
1622
  kvlistValue: {
1640
- values: encodeKeyValueList(value, logger2, state, depth + 1)
1623
+ values: encodeKeyValueList(value, logger, state, depth + 1)
1641
1624
  }
1642
1625
  };
1643
1626
  } finally {
@@ -1648,7 +1631,7 @@ function encodeAnyValue(value, logger2, state, depth) {
1648
1631
  stringValue: sanitizeString(String(value))
1649
1632
  };
1650
1633
  }
1651
- function encodeArrayValues(values, logger2, state, depth) {
1634
+ function encodeArrayValues(values, logger, state, depth) {
1652
1635
  const result = [];
1653
1636
  const itemCount = Math.min(values.length, MAX_JSON_SAFE_VALUE_ITEMS);
1654
1637
  let index = 0;
@@ -1657,7 +1640,7 @@ function encodeArrayValues(values, logger2, state, depth) {
1657
1640
  const element = index in values ? values[index] : undefined;
1658
1641
  if (isNullish(element))
1659
1642
  continue;
1660
- result.push(encodeAnyValue(element, logger2, state, depth));
1643
+ result.push(encodeAnyValue(element, logger, state, depth));
1661
1644
  } catch {
1662
1645
  result.push({
1663
1646
  stringValue: UNSERIALIZABLE_VALUE
@@ -1669,12 +1652,12 @@ function encodeArrayValues(values, logger2, state, depth) {
1669
1652
  });
1670
1653
  return result;
1671
1654
  }
1672
- function encodeKeyValueList(attrs, logger2, state, depth) {
1655
+ function encodeKeyValueList(attrs, logger, state, depth) {
1673
1656
  const result = [];
1674
1657
  for (const key in attrs)
1675
1658
  if (propertyIsEnumerable.call(attrs, key)) {
1676
1659
  if (result.length >= MAX_JSON_SAFE_VALUE_ITEMS || state.remainingNodes <= 0) {
1677
- logger2?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");
1660
+ logger?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");
1678
1661
  break;
1679
1662
  }
1680
1663
  try {
@@ -1683,7 +1666,7 @@ function encodeKeyValueList(attrs, logger2, state, depth) {
1683
1666
  continue;
1684
1667
  result.push({
1685
1668
  key: sanitizeString(key),
1686
- value: encodeAnyValue(value, logger2, state, depth)
1669
+ value: encodeAnyValue(value, logger, state, depth)
1687
1670
  });
1688
1671
  } catch {
1689
1672
  result.push({
@@ -2125,37 +2108,6 @@ class SimpleEventEmitter {
2125
2108
  }
2126
2109
  }
2127
2110
 
2128
- // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/index.mjs
2129
- var exports_error_tracking = {};
2130
- __export(exports_error_tracking, {
2131
- DEFAULT_EXCEPTION_STEPS_CONFIG: () => DEFAULT_EXCEPTION_STEPS_CONFIG,
2132
- DOMExceptionCoercer: () => DOMExceptionCoercer,
2133
- EXCEPTION_STEP_INTERNAL_FIELDS: () => EXCEPTION_STEP_INTERNAL_FIELDS,
2134
- ErrorCoercer: () => ErrorCoercer,
2135
- ErrorEventCoercer: () => ErrorEventCoercer,
2136
- ErrorPropertiesBuilder: () => ErrorPropertiesBuilder,
2137
- EventCoercer: () => EventCoercer,
2138
- ExceptionStepsBuffer: () => ExceptionStepsBuffer,
2139
- ObjectCoercer: () => ObjectCoercer,
2140
- PrimitiveCoercer: () => PrimitiveCoercer,
2141
- PromiseRejectionEventCoercer: () => PromiseRejectionEventCoercer,
2142
- ReduceableCache: () => ReduceableCache,
2143
- StringCoercer: () => StringCoercer,
2144
- chromeStackLineParser: () => chromeStackLineParser,
2145
- createDefaultStackParser: () => createDefaultStackParser,
2146
- createStackParser: () => createStackParser,
2147
- geckoStackLineParser: () => geckoStackLineParser,
2148
- getInjectedReleaseId: () => getInjectedReleaseId,
2149
- getUtf8ByteLength: () => getUtf8ByteLength,
2150
- nodeStackLineParser: () => nodeStackLineParser,
2151
- opera10StackLineParser: () => opera10StackLineParser,
2152
- opera11StackLineParser: () => opera11StackLineParser,
2153
- resolveExceptionStepsConfig: () => resolveExceptionStepsConfig,
2154
- reverseAndStripFrames: () => reverseAndStripFrames,
2155
- stripReservedExceptionStepFields: () => stripReservedExceptionStepFields,
2156
- winjsStackLineParser: () => winjsStackLineParser
2157
- });
2158
-
2159
2111
  // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
2160
2112
  var parsedStackResults;
2161
2113
  var lastKeysCount;
@@ -2299,11 +2251,11 @@ class ErrorPropertiesBuilder {
2299
2251
  return context;
2300
2252
  }
2301
2253
  buildCoercingContext(mechanism, hint, depth = 0) {
2302
- const coerce = (input, depth2) => {
2303
- if (!(depth2 <= MAX_CAUSE_RECURSION))
2254
+ const coerce = (input, depth) => {
2255
+ if (!(depth <= MAX_CAUSE_RECURSION))
2304
2256
  return;
2305
2257
  {
2306
- const ctx = this.buildCoercingContext(mechanism, hint, depth2);
2258
+ const ctx = this.buildCoercingContext(mechanism, hint, depth);
2307
2259
  return this.applyCoercers(input, ctx);
2308
2260
  }
2309
2261
  };
@@ -2355,8 +2307,8 @@ var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
2355
2307
  var chromeStackLineParser = (line, platform) => {
2356
2308
  const noFnParts = chromeRegexNoFnName.exec(line);
2357
2309
  if (noFnParts) {
2358
- const [, filename, line2, col] = noFnParts;
2359
- return createFrame(platform, filename, UNKNOWN_FUNCTION, +line2, +col);
2310
+ const [, filename, line, col] = noFnParts;
2311
+ return createFrame(platform, filename, UNKNOWN_FUNCTION, +line, +col);
2360
2312
  }
2361
2313
  const parts = chromeRegex.exec(line);
2362
2314
  if (parts) {
@@ -2397,25 +2349,6 @@ var geckoStackLineParser = (line, platform) => {
2397
2349
  }
2398
2350
  };
2399
2351
 
2400
- // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
2401
- var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
2402
- var winjsStackLineParser = (line, platform) => {
2403
- const parts = winjsRegex.exec(line);
2404
- return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) : undefined;
2405
- };
2406
-
2407
- // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
2408
- var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
2409
- var opera10StackLineParser = (line, platform) => {
2410
- const parts = opera10Regex.exec(line);
2411
- return parts ? createFrame(platform, parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;
2412
- };
2413
- var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;
2414
- var opera11StackLineParser = (line, platform) => {
2415
- const parts = opera11Regex.exec(line);
2416
- return parts ? createFrame(platform, parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
2417
- };
2418
-
2419
2352
  // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
2420
2353
  var FILENAME_MATCH = /^\s*[-]{4,}$/;
2421
2354
  var FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
@@ -2535,36 +2468,6 @@ function createStackParser(platform, ...parsers) {
2535
2468
  return reverseAndStripFrames(frames);
2536
2469
  };
2537
2470
  }
2538
- // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
2539
- class DOMExceptionCoercer {
2540
- match(err) {
2541
- return this.isDOMException(err) || this.isDOMError(err);
2542
- }
2543
- coerce(err, ctx) {
2544
- const hasStack = isString(err.stack);
2545
- return {
2546
- type: this.getType(err),
2547
- value: this.getValue(err),
2548
- stack: hasStack ? err.stack : undefined,
2549
- cause: err.cause ? ctx.next(err.cause) : undefined,
2550
- synthetic: false
2551
- };
2552
- }
2553
- getType(candidate) {
2554
- return this.isDOMError(candidate) ? "DOMError" : "DOMException";
2555
- }
2556
- getValue(err) {
2557
- const name = err.name || (this.isDOMError(err) ? "DOMError" : "DOMException");
2558
- const message = err.message ? `${name}: ${err.message}` : name;
2559
- return message;
2560
- }
2561
- isDOMException(err) {
2562
- return isBuiltin(err, "DOMException");
2563
- }
2564
- isDOMError(err) {
2565
- return isBuiltin(err, "DOMError");
2566
- }
2567
- }
2568
2471
  // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
2569
2472
  class ErrorCoercer {
2570
2473
  match(err) {
@@ -2594,40 +2497,6 @@ class ErrorCoercer {
2594
2497
  return err.stacktrace || err.stack || undefined;
2595
2498
  }
2596
2499
  }
2597
- // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
2598
- class ErrorEventCoercer {
2599
- constructor() {}
2600
- match(err) {
2601
- if (!isErrorEvent(err))
2602
- return false;
2603
- const errorEvent = err;
2604
- return errorEvent.error != null || this._hasUsableMessage(errorEvent);
2605
- }
2606
- coerce(err, ctx) {
2607
- if (err.error != null)
2608
- return ctx.apply(err.error);
2609
- const exceptionLike = ctx.apply(err.message);
2610
- return {
2611
- ...exceptionLike,
2612
- stack: this._buildLocationStack(err) ?? exceptionLike.stack,
2613
- synthetic: true
2614
- };
2615
- }
2616
- _hasUsableMessage(err) {
2617
- return isString(err.message) && err.message.length > 0;
2618
- }
2619
- _buildLocationStack(err) {
2620
- const location = err;
2621
- const lineno = location.lineno ?? 0;
2622
- const colno = location.colno ?? 0;
2623
- if (!isString(location.filename) || location.filename.length === 0)
2624
- return;
2625
- if (lineno === 0)
2626
- return;
2627
- return `Error
2628
- at ${location.filename}:${lineno}:${colno}`;
2629
- }
2630
- }
2631
2500
  // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
2632
2501
  var ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
2633
2502
 
@@ -2779,42 +2648,6 @@ class PrimitiveCoercer {
2779
2648
  };
2780
2649
  }
2781
2650
  }
2782
- // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
2783
- class PromiseRejectionEventCoercer {
2784
- match(err) {
2785
- return isBuiltin(err, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(err);
2786
- }
2787
- isCustomEventWrappingRejection(err) {
2788
- if (!isEvent(err))
2789
- return false;
2790
- try {
2791
- const detail = err.detail;
2792
- return detail != null && typeof detail == "object" && "reason" in detail;
2793
- } catch {
2794
- return false;
2795
- }
2796
- }
2797
- coerce(err, ctx) {
2798
- const reason = this.getUnhandledRejectionReason(err);
2799
- if (isPrimitive(reason))
2800
- return {
2801
- type: "UnhandledRejection",
2802
- value: `Non-Error promise rejection captured with value: ${String(reason)}`,
2803
- stack: ctx.syntheticException?.stack,
2804
- synthetic: true
2805
- };
2806
- return ctx.apply(reason);
2807
- }
2808
- getUnhandledRejectionReason(error) {
2809
- try {
2810
- if ("reason" in error)
2811
- return error.reason;
2812
- if ("detail" in error && error.detail != null && typeof error.detail == "object" && "reason" in error.detail)
2813
- return error.detail.reason;
2814
- } catch {}
2815
- return error;
2816
- }
2817
- }
2818
2651
  // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/utils.mjs
2819
2652
  class ReduceableCache {
2820
2653
  constructor(_maxSize) {
@@ -2849,130 +2682,6 @@ var RESERVED_EXCEPTION_STEP_KEYS = new Set([
2849
2682
  EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE,
2850
2683
  EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP
2851
2684
  ]);
2852
- var DEFAULT_EXCEPTION_STEPS_CONFIG = {
2853
- enabled: true,
2854
- max_bytes: 32768
2855
- };
2856
- function resolveExceptionStepsConfig(config) {
2857
- if (!config)
2858
- return {
2859
- ...DEFAULT_EXCEPTION_STEPS_CONFIG
2860
- };
2861
- return {
2862
- enabled: config.enabled ?? DEFAULT_EXCEPTION_STEPS_CONFIG.enabled,
2863
- max_bytes: normalizePositiveInteger(config.max_bytes, DEFAULT_EXCEPTION_STEPS_CONFIG.max_bytes)
2864
- };
2865
- }
2866
- function stripReservedExceptionStepFields(properties) {
2867
- if (!properties)
2868
- return {
2869
- sanitizedProperties: {},
2870
- droppedKeys: []
2871
- };
2872
- const droppedKeys = [];
2873
- const sanitizedProperties = Object.keys(properties).reduce((acc, key) => {
2874
- if (RESERVED_EXCEPTION_STEP_KEYS.has(key)) {
2875
- droppedKeys.push(key);
2876
- return acc;
2877
- }
2878
- acc[key] = properties[key];
2879
- return acc;
2880
- }, {});
2881
- return {
2882
- sanitizedProperties,
2883
- droppedKeys
2884
- };
2885
- }
2886
-
2887
- class ExceptionStepsBuffer {
2888
- constructor(config) {
2889
- this._entries = [];
2890
- this._totalBytes = 0;
2891
- this._config = resolveExceptionStepsConfig(config);
2892
- }
2893
- setConfig(config) {
2894
- this._config = resolveExceptionStepsConfig(config);
2895
- this._trimToMaxBytes();
2896
- }
2897
- add(step) {
2898
- const serialized = normalizeAndSerializeStep(step);
2899
- if (!serialized)
2900
- return;
2901
- const bytes = getUtf8ByteLength(serialized.json);
2902
- if (bytes > this._config.max_bytes)
2903
- return;
2904
- this._entries.push({
2905
- step: serialized.step,
2906
- bytes
2907
- });
2908
- this._totalBytes += bytes;
2909
- this._trimToMaxBytes();
2910
- }
2911
- getAttachable() {
2912
- return this._entries.map((e) => e.step);
2913
- }
2914
- clear() {
2915
- this._entries = [];
2916
- this._totalBytes = 0;
2917
- }
2918
- size() {
2919
- return this._entries.length;
2920
- }
2921
- _trimToMaxBytes() {
2922
- while (this._totalBytes > this._config.max_bytes && this._entries.length > 0) {
2923
- const evicted = this._entries.shift();
2924
- if (evicted)
2925
- this._totalBytes -= evicted.bytes;
2926
- }
2927
- }
2928
- }
2929
- function normalizePositiveInteger(input, fallback) {
2930
- if (!isNumber(input) || input === 1 / 0 || input === -1 / 0)
2931
- return fallback;
2932
- const normalized = Math.floor(input);
2933
- if (normalized < 0)
2934
- return fallback;
2935
- return normalized;
2936
- }
2937
- function normalizeAndSerializeStep(step) {
2938
- let json;
2939
- try {
2940
- json = safeJsonStringify(step);
2941
- } catch {
2942
- return;
2943
- }
2944
- try {
2945
- const parsed = JSON.parse(json);
2946
- if (!isObject(parsed))
2947
- return;
2948
- const parsedStep = parsed;
2949
- const message = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE];
2950
- const timestamp = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP];
2951
- if (!isString(message) || message.trim().length === 0)
2952
- return;
2953
- if (!isString(timestamp) && !isNumber(timestamp))
2954
- return;
2955
- return {
2956
- step: parsedStep,
2957
- json
2958
- };
2959
- } catch {
2960
- return;
2961
- }
2962
- }
2963
- function getUtf8ByteLength(value) {
2964
- if (typeof TextEncoder != "undefined")
2965
- return new TextEncoder().encode(value).length;
2966
- const encoded = encodeURIComponent(value);
2967
- let byteLength = 0;
2968
- for (let i = 0;i < encoded.length; i++)
2969
- if (encoded[i] === "%") {
2970
- byteLength += 1;
2971
- i += 2;
2972
- } else
2973
- byteLength += 1;
2974
- return byteLength;
2975
- }
2976
2685
  // ../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/release.mjs
2977
2686
  function getInjectedReleaseId() {
2978
2687
  const injected = globalThis._posthogReleaseId;
@@ -3507,15 +3216,15 @@ class PostHogCoreStateless {
3507
3216
  };
3508
3217
  const response = await this.fetchWithRetry(url, fetchOptions, {
3509
3218
  type: "required",
3510
- consume: (response2) => {
3511
- if (response2.status !== 200 || !response2.json) {
3512
- const msg = `Surveys API could not be loaded: ${response2.status}`;
3219
+ consume: (response) => {
3220
+ if (response.status !== 200 || !response.json) {
3221
+ const msg = `Surveys API could not be loaded: ${response.status}`;
3513
3222
  const error = new Error(msg);
3514
3223
  this._logger.error(error);
3515
3224
  this._events.emit("error", new Error(msg));
3516
3225
  return Promise.resolve(undefined);
3517
3226
  }
3518
- return response2.json();
3227
+ return response.json();
3519
3228
  }
3520
3229
  }).catch((error) => {
3521
3230
  this._logger.error("Surveys API could not be loaded", error);
@@ -4096,13 +3805,13 @@ import { constants as constants2 } from "node:fs";
4096
3805
  import { open as promises_open } from "node:fs/promises";
4097
3806
  import { isAbsolute } from "node:path";
4098
3807
  import { createInterface } from "node:readline";
4099
- var LRU_FILE_CONTENTS_CACHE = new exports_error_tracking.ReduceableCache(25);
4100
- var LRU_FILE_CONTENTS_FS_READ_FAILED = new exports_error_tracking.ReduceableCache(20);
3808
+ var LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
3809
+ var LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
4101
3810
  var DEFAULT_LINES_OF_CONTEXT = 7;
4102
3811
  var MAX_CONTEXTLINES_COLNO = 1000;
4103
3812
  var MAX_CONTEXTLINES_LINENO = 1e4;
4104
3813
  var MAX_CONTEXTLINES_FILE_SIZE = 10485760;
4105
- async function addSourceContext(frames, openSourceFile = promises_open, logger2) {
3814
+ async function addSourceContext(frames, openSourceFile = promises_open, logger) {
4106
3815
  const filesToLines = {};
4107
3816
  let basePath;
4108
3817
  try {
@@ -4138,7 +3847,7 @@ async function addSourceContext(frames, openSourceFile = promises_open, logger2)
4138
3847
  if (ranges.every((r) => rangeExistsInContentCache(cacheKey, r)))
4139
3848
  continue;
4140
3849
  const cache = emplace(LRU_FILE_CONTENTS_CACHE, cacheKey, {});
4141
- readlinePromises.push(getContextLinesFromFile(file, ranges, cache, cacheKey, openSourceFile, logger2));
3850
+ readlinePromises.push(getContextLinesFromFile(file, ranges, cache, cacheKey, openSourceFile, logger));
4142
3851
  }
4143
3852
  await Promise.all(readlinePromises).catch(() => {});
4144
3853
  if (frames && frames.length > 0)
@@ -4146,16 +3855,16 @@ async function addSourceContext(frames, openSourceFile = promises_open, logger2)
4146
3855
  LRU_FILE_CONTENTS_CACHE.reduce();
4147
3856
  return frames;
4148
3857
  }
4149
- async function openRegularSourceFile(path2, openSourceFile, logger2) {
3858
+ async function openRegularSourceFile(path, openSourceFile, logger) {
4150
3859
  let fileHandle;
4151
3860
  let isValid = false;
4152
3861
  try {
4153
- fileHandle = await openSourceFile(path2, constants2.O_RDONLY | constants2.O_NONBLOCK);
3862
+ fileHandle = await openSourceFile(path, constants2.O_RDONLY | constants2.O_NONBLOCK);
4154
3863
  const fileStat = await fileHandle.stat();
4155
3864
  if (!fileStat.isFile())
4156
3865
  return;
4157
3866
  if (fileStat.size > MAX_CONTEXTLINES_FILE_SIZE)
4158
- return void logger2?.debug(`Skipping source context for oversized file ${path2}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
3867
+ return void logger?.debug(`Skipping source context for oversized file ${path}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
4159
3868
  isValid = true;
4160
3869
  return fileHandle;
4161
3870
  } catch {
@@ -4165,18 +3874,18 @@ async function openRegularSourceFile(path2, openSourceFile, logger2) {
4165
3874
  await fileHandle.close().catch(() => {});
4166
3875
  }
4167
3876
  }
4168
- async function getContextLinesFromFile(path2, ranges, output, cacheKey, openSourceFile, logger2) {
4169
- const fileHandle = await openRegularSourceFile(path2, openSourceFile, logger2);
3877
+ async function getContextLinesFromFile(path, ranges, output, cacheKey, openSourceFile, logger) {
3878
+ const fileHandle = await openRegularSourceFile(path, openSourceFile, logger);
4170
3879
  if (fileHandle === undefined)
4171
3880
  return void LRU_FILE_CONTENTS_FS_READ_FAILED.set(cacheKey, 1);
4172
3881
  const openedFileHandle = fileHandle;
4173
3882
  return new Promise((resolve) => {
4174
3883
  let finished = false;
4175
- function destroyStreamAndResolve(stream2) {
3884
+ function destroyStreamAndResolve(stream) {
4176
3885
  if (finished)
4177
3886
  return;
4178
3887
  finished = true;
4179
- stream2?.destroy();
3888
+ stream?.destroy();
4180
3889
  openedFileHandle.close().then(resolve, resolve);
4181
3890
  }
4182
3891
  let stream;
@@ -4229,14 +3938,14 @@ async function getContextLinesFromFile(path2, ranges, output, cacheKey, openSour
4229
3938
  return;
4230
3939
  }
4231
3940
  currentRangeIndex++;
4232
- const range2 = ranges[currentRangeIndex];
4233
- if (range2 === undefined) {
3941
+ const range = ranges[currentRangeIndex];
3942
+ if (range === undefined) {
4234
3943
  lineReaded.close();
4235
3944
  lineReaded.removeAllListeners();
4236
3945
  return;
4237
3946
  }
4238
- rangeStart = range2[0];
4239
- rangeEnd = range2[1];
3947
+ rangeStart = range[0];
3948
+ rangeEnd = range[1];
4240
3949
  }
4241
3950
  });
4242
3951
  });
@@ -4278,8 +3987,8 @@ function clearLineContext(frame) {
4278
3987
  delete frame.context_line;
4279
3988
  delete frame.post_context;
4280
3989
  }
4281
- function shouldSkipContextLinesForFile(path2) {
4282
- return path2.startsWith("node:") || path2.endsWith(".min.js") || path2.endsWith(".min.cjs") || path2.endsWith(".min.mjs") || path2.startsWith("data:");
3990
+ function shouldSkipContextLinesForFile(path) {
3991
+ return path.startsWith("node:") || path.endsWith(".min.js") || path.endsWith(".min.cjs") || path.endsWith(".min.mjs") || path.startsWith("data:");
4283
3992
  }
4284
3993
  function shouldSkipContextLinesForFrame(frame) {
4285
3994
  if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO)
@@ -4288,15 +3997,15 @@ function shouldSkipContextLinesForFrame(frame) {
4288
3997
  return true;
4289
3998
  return false;
4290
3999
  }
4291
- function makeSourceCacheKey(path2, basePath) {
4292
- if (isAbsolute(path2))
4000
+ function makeSourceCacheKey(path, basePath) {
4001
+ if (isAbsolute(path))
4293
4002
  return JSON.stringify([
4294
4003
  null,
4295
- path2
4004
+ path
4296
4005
  ]);
4297
4006
  return basePath === undefined ? undefined : JSON.stringify([
4298
4007
  basePath,
4299
- path2
4008
+ path
4300
4009
  ]);
4301
4010
  }
4302
4011
  function rangeExistsInContentCache(cacheKey, range) {
@@ -5139,21 +4848,21 @@ function matchProperty(property, propertyValues, warnFunction) {
5139
4848
  warnFunction(`Property ${key} cannot have a value of null/undefined with the ${operator} operator`);
5140
4849
  return false;
5141
4850
  }
5142
- function computeExactMatch(value2, overrideValue2) {
5143
- if (Array.isArray(value2))
5144
- return value2.map((val) => String(val).toLowerCase()).includes(String(overrideValue2).toLowerCase());
5145
- return String(value2).toLowerCase() === String(overrideValue2).toLowerCase();
4851
+ function computeExactMatch(value, overrideValue) {
4852
+ if (Array.isArray(value))
4853
+ return value.map((val) => String(val).toLowerCase()).includes(String(overrideValue).toLowerCase());
4854
+ return String(value).toLowerCase() === String(overrideValue).toLowerCase();
5146
4855
  }
5147
- function compare(lhs, rhs, operator2) {
5148
- if (operator2 === "gt")
4856
+ function compare(lhs, rhs, operator) {
4857
+ if (operator === "gt")
5149
4858
  return lhs > rhs;
5150
- if (operator2 === "gte")
4859
+ if (operator === "gte")
5151
4860
  return lhs >= rhs;
5152
- if (operator2 === "lt")
4861
+ if (operator === "lt")
5153
4862
  return lhs < rhs;
5154
- if (operator2 === "lte")
4863
+ if (operator === "lte")
5155
4864
  return lhs <= rhs;
5156
- throw new Error(`Invalid operator: ${operator2}`);
4865
+ throw new Error(`Invalid operator: ${operator}`);
5157
4866
  }
5158
4867
  switch (operator) {
5159
4868
  case "exact":
@@ -5622,7 +5331,7 @@ class error_tracking_ErrorTracking {
5622
5331
  };
5623
5332
  const exceptionProperties = builder.buildFromUnknown(error, hint);
5624
5333
  exceptionProperties.$exception_list = await builder.modifyFrames(exceptionProperties.$exception_list);
5625
- const injectedReleaseId = exports_error_tracking.getInjectedReleaseId();
5334
+ const injectedReleaseId = getInjectedReleaseId();
5626
5335
  if (injectedReleaseId)
5627
5336
  properties.$release_id = injectedReleaseId;
5628
5337
  return {
@@ -5770,10 +5479,10 @@ function isRecord2(value) {
5770
5479
  }
5771
5480
  function toRfc3339(timestamp) {
5772
5481
  if (typeof timestamp == "string") {
5773
- const asDate2 = new Date(timestamp);
5774
- if (Number.isNaN(asDate2.getTime()))
5482
+ const asDate = new Date(timestamp);
5483
+ if (Number.isNaN(asDate.getTime()))
5775
5484
  return new Date().toISOString();
5776
- const normalized = asDate2.toISOString();
5485
+ const normalized = asDate.toISOString();
5777
5486
  const fractionalSeconds = timestamp.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1];
5778
5487
  return fractionalSeconds && fractionalSeconds.length > 3 ? normalized.replace(/\.\d{3}Z$/, `.${fractionalSeconds}Z`) : normalized;
5779
5488
  }
@@ -7462,7 +7171,7 @@ function createEventProcessor(_posthog, { organization, projectId, prefix, sever
7462
7171
  $sentry_exception_type: exceptions[0]?.type,
7463
7172
  $sentry_tags: event.tags
7464
7173
  };
7465
- const injectedReleaseId = exports_error_tracking.getInjectedReleaseId();
7174
+ const injectedReleaseId = getInjectedReleaseId();
7466
7175
  if (injectedReleaseId)
7467
7176
  properties.$release_id = injectedReleaseId;
7468
7177
  if (organization && projectId)
@@ -7505,13 +7214,13 @@ class PostHog extends PostHogBackendClient {
7505
7214
  return new PostHogContext;
7506
7215
  }
7507
7216
  createErrorPropertiesBuilder() {
7508
- return new exports_error_tracking.ErrorPropertiesBuilder([
7509
- new exports_error_tracking.EventCoercer,
7510
- new exports_error_tracking.ErrorCoercer,
7511
- new exports_error_tracking.ObjectCoercer,
7512
- new exports_error_tracking.StringCoercer,
7513
- new exports_error_tracking.PrimitiveCoercer
7514
- ], exports_error_tracking.createStackParser("node:javascript", exports_error_tracking.nodeStackLineParser), [
7217
+ return new ErrorPropertiesBuilder([
7218
+ new EventCoercer,
7219
+ new ErrorCoercer,
7220
+ new ObjectCoercer,
7221
+ new StringCoercer,
7222
+ new PrimitiveCoercer
7223
+ ], createStackParser("node:javascript", nodeStackLineParser), [
7515
7224
  createModulerModifier(),
7516
7225
  (frames) => addSourceContext(frames, undefined, this._logger),
7517
7226
  createRelativePathModifier()