oh-my-opencode 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 (115) hide show
  1. package/dist/cli/index.js +4682 -14969
  2. package/dist/cli-node/index.js +4727 -15014
  3. package/dist/index.js +5880 -6423
  4. package/dist/tui.js +1244 -10984
  5. package/package.json +15 -15
  6. package/packages/git-bash-mcp/package.json +1 -1
  7. package/packages/lsp-daemon/dist/cli.js +181 -181
  8. package/packages/lsp-daemon/dist/client.js +232 -232
  9. package/packages/lsp-daemon/dist/index.js +132 -132
  10. package/packages/lsp-tools-mcp/dist/cli.js +103 -101
  11. package/packages/lsp-tools-mcp/dist/lsp/manager.js +14 -14
  12. package/packages/lsp-tools-mcp/dist/mcp.js +129 -129
  13. package/packages/lsp-tools-mcp/dist/tools.js +47 -47
  14. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  15. package/packages/omo-codex/plugin/README.md +4 -0
  16. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +151 -102
  17. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  18. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  19. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  20. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  21. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  22. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  23. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/AGENTS.md +2 -2
  24. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/directive.md +2 -0
  25. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +35 -24
  26. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +31 -21
  27. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.d.ts +3 -0
  28. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  29. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  30. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +31 -23
  31. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/types.ts +3 -0
  32. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/cli.test.ts +1 -1
  33. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +133 -7
  34. package/packages/omo-codex/plugin/components/lcx/skills/lcx-doctor/SKILL.md +3 -1
  35. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  36. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +298 -298
  37. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  38. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  39. package/packages/omo-codex/plugin/components/rules/README.md +2 -0
  40. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-6.md +123 -0
  41. package/packages/omo-codex/plugin/components/rules/dist/cli.js +38 -30
  42. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  43. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  44. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +6 -0
  45. package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +38 -2
  46. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +24 -0
  47. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  48. package/packages/omo-codex/plugin/components/teammode/package.json +2 -2
  49. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +66 -357
  50. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +66 -358
  51. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  52. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  53. package/packages/omo-codex/plugin/components/ultrawork/README.md +2 -0
  54. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
  55. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +1 -1
  56. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +1 -1
  57. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
  58. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +1 -1
  59. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
  60. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-low.toml +1 -1
  61. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +1 -1
  62. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +1 -1
  63. package/packages/omo-codex/plugin/components/ultrawork/agents/metis.toml +1 -1
  64. package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +1 -1
  65. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  66. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  67. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  68. package/packages/omo-codex/plugin/components/ulw-execute-continuation/dist/cli.js +3 -3
  69. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  70. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  71. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +63 -63
  72. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  73. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  74. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  78. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  92. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  93. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  94. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  95. package/packages/omo-codex/plugin/model-catalog.json +16 -7
  96. package/packages/omo-codex/plugin/package-lock.json +16 -16
  97. package/packages/omo-codex/plugin/package.json +1 -1
  98. package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +16 -7
  99. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +8 -4
  100. package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +18 -90
  101. package/packages/omo-codex/plugin/scripts/migrate-codex-config/toml-section-editor.mjs +1 -1
  102. package/packages/omo-codex/plugin/shared/package.json +1 -1
  103. package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +3 -1
  104. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +12 -12
  105. package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +14 -4
  106. package/packages/omo-codex/plugin/test/auto-update.test.mjs +4 -4
  107. package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +25 -1
  108. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +35 -35
  109. package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +1 -1
  110. package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +107 -15
  111. package/packages/omo-codex/scripts/check-model-catalog-parity.mjs +42 -0
  112. package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +5 -5
  113. package/packages/omo-codex/scripts/install-config.test.mjs +15 -17
  114. package/packages/omo-codex/scripts/install-dist/install-local.mjs +318 -569
  115. package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +3 -4
@@ -1,18 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __returnValue = (v) => v;
3
- function __exportSetter(name, newValue) {
4
- this[name] = __returnValue.bind(null, newValue);
5
- }
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true,
11
- configurable: true,
12
- set: __exportSetter.bind(all, name)
13
- });
14
- };
15
-
16
1
  // ../../../../telemetry-core/src/activity-state.ts
17
2
  import { existsSync, mkdirSync as mkdirSync2, readFileSync } from "node:fs";
18
3
  import { basename, join } from "node:path";
@@ -381,8 +366,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname2(proce
381
366
  return decodedFile;
382
367
  };
383
368
  }
384
- function normalizeWindowsPath(path2) {
385
- return path2.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
369
+ function normalizeWindowsPath(path) {
370
+ return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
386
371
  }
387
372
 
388
373
  // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/featureFlagUtils.mjs
@@ -803,9 +788,6 @@ function isError(candidate) {
803
788
  return isInstanceOf(candidate, Error);
804
789
  }
805
790
  }
806
- function isErrorEvent(event) {
807
- return isBuiltin(event, "ErrorEvent");
808
- }
809
791
  function isEvent(candidate) {
810
792
  return typeof Event != "undefined" && isInstanceOf(candidate, Event);
811
793
  }
@@ -1544,14 +1526,14 @@ function newState() {
1544
1526
  remainingNodes: MAX_JSON_SAFE_VALUE_NODES
1545
1527
  };
1546
1528
  }
1547
- function toOtlpKeyValueList(attrs, logger2) {
1529
+ function toOtlpKeyValueList(attrs, logger) {
1548
1530
  try {
1549
- return encodeKeyValueList(attrs, logger2, newState(), 0);
1531
+ return encodeKeyValueList(attrs, logger, newState(), 0);
1550
1532
  } catch {
1551
1533
  return [];
1552
1534
  }
1553
1535
  }
1554
- function encodeAnyValue(value, logger2, state, depth) {
1536
+ function encodeAnyValue(value, logger, state, depth) {
1555
1537
  if (state.remainingNodes <= 0)
1556
1538
  return {
1557
1539
  stringValue: TRUNCATED_VALUE
@@ -1577,7 +1559,7 @@ function encodeAnyValue(value, logger2, state, depth) {
1577
1559
  };
1578
1560
  const decimal = BigInt(value).toString();
1579
1561
  if (value >= INT64_RANGE_LIMIT || value < -INT64_RANGE_LIMIT) {
1580
- logger2?.debug(`Attribute ${decimal} is outside the int64 range; encoding it as a string`);
1562
+ logger?.debug(`Attribute ${decimal} is outside the int64 range; encoding it as a string`);
1581
1563
  return {
1582
1564
  stringValue: decimal
1583
1565
  };
@@ -1623,17 +1605,17 @@ function encodeAnyValue(value, logger2, state, depth) {
1623
1605
  try {
1624
1606
  const toJSON = value.toJSON;
1625
1607
  if (typeof toJSON == "function")
1626
- return encodeAnyValue(toJSON.call(value), logger2, state, depth + 1);
1608
+ return encodeAnyValue(toJSON.call(value), logger, state, depth + 1);
1627
1609
  } catch {}
1628
1610
  if (isArray(value))
1629
1611
  return {
1630
1612
  arrayValue: {
1631
- values: encodeArrayValues(value, logger2, state, depth + 1)
1613
+ values: encodeArrayValues(value, logger, state, depth + 1)
1632
1614
  }
1633
1615
  };
1634
1616
  return {
1635
1617
  kvlistValue: {
1636
- values: encodeKeyValueList(value, logger2, state, depth + 1)
1618
+ values: encodeKeyValueList(value, logger, state, depth + 1)
1637
1619
  }
1638
1620
  };
1639
1621
  } finally {
@@ -1644,7 +1626,7 @@ function encodeAnyValue(value, logger2, state, depth) {
1644
1626
  stringValue: sanitizeString(String(value))
1645
1627
  };
1646
1628
  }
1647
- function encodeArrayValues(values, logger2, state, depth) {
1629
+ function encodeArrayValues(values, logger, state, depth) {
1648
1630
  const result = [];
1649
1631
  const itemCount = Math.min(values.length, MAX_JSON_SAFE_VALUE_ITEMS);
1650
1632
  let index = 0;
@@ -1653,7 +1635,7 @@ function encodeArrayValues(values, logger2, state, depth) {
1653
1635
  const element = index in values ? values[index] : undefined;
1654
1636
  if (isNullish(element))
1655
1637
  continue;
1656
- result.push(encodeAnyValue(element, logger2, state, depth));
1638
+ result.push(encodeAnyValue(element, logger, state, depth));
1657
1639
  } catch {
1658
1640
  result.push({
1659
1641
  stringValue: UNSERIALIZABLE_VALUE
@@ -1665,12 +1647,12 @@ function encodeArrayValues(values, logger2, state, depth) {
1665
1647
  });
1666
1648
  return result;
1667
1649
  }
1668
- function encodeKeyValueList(attrs, logger2, state, depth) {
1650
+ function encodeKeyValueList(attrs, logger, state, depth) {
1669
1651
  const result = [];
1670
1652
  for (const key in attrs)
1671
1653
  if (propertyIsEnumerable.call(attrs, key)) {
1672
1654
  if (result.length >= MAX_JSON_SAFE_VALUE_ITEMS || state.remainingNodes <= 0) {
1673
- logger2?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");
1655
+ logger?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");
1674
1656
  break;
1675
1657
  }
1676
1658
  try {
@@ -1679,7 +1661,7 @@ function encodeKeyValueList(attrs, logger2, state, depth) {
1679
1661
  continue;
1680
1662
  result.push({
1681
1663
  key: sanitizeString(key),
1682
- value: encodeAnyValue(value, logger2, state, depth)
1664
+ value: encodeAnyValue(value, logger, state, depth)
1683
1665
  });
1684
1666
  } catch {
1685
1667
  result.push({
@@ -2121,37 +2103,6 @@ class SimpleEventEmitter {
2121
2103
  }
2122
2104
  }
2123
2105
 
2124
- // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/index.mjs
2125
- var exports_error_tracking = {};
2126
- __export(exports_error_tracking, {
2127
- DEFAULT_EXCEPTION_STEPS_CONFIG: () => DEFAULT_EXCEPTION_STEPS_CONFIG,
2128
- DOMExceptionCoercer: () => DOMExceptionCoercer,
2129
- EXCEPTION_STEP_INTERNAL_FIELDS: () => EXCEPTION_STEP_INTERNAL_FIELDS,
2130
- ErrorCoercer: () => ErrorCoercer,
2131
- ErrorEventCoercer: () => ErrorEventCoercer,
2132
- ErrorPropertiesBuilder: () => ErrorPropertiesBuilder,
2133
- EventCoercer: () => EventCoercer,
2134
- ExceptionStepsBuffer: () => ExceptionStepsBuffer,
2135
- ObjectCoercer: () => ObjectCoercer,
2136
- PrimitiveCoercer: () => PrimitiveCoercer,
2137
- PromiseRejectionEventCoercer: () => PromiseRejectionEventCoercer,
2138
- ReduceableCache: () => ReduceableCache,
2139
- StringCoercer: () => StringCoercer,
2140
- chromeStackLineParser: () => chromeStackLineParser,
2141
- createDefaultStackParser: () => createDefaultStackParser,
2142
- createStackParser: () => createStackParser,
2143
- geckoStackLineParser: () => geckoStackLineParser,
2144
- getInjectedReleaseId: () => getInjectedReleaseId,
2145
- getUtf8ByteLength: () => getUtf8ByteLength,
2146
- nodeStackLineParser: () => nodeStackLineParser,
2147
- opera10StackLineParser: () => opera10StackLineParser,
2148
- opera11StackLineParser: () => opera11StackLineParser,
2149
- resolveExceptionStepsConfig: () => resolveExceptionStepsConfig,
2150
- reverseAndStripFrames: () => reverseAndStripFrames,
2151
- stripReservedExceptionStepFields: () => stripReservedExceptionStepFields,
2152
- winjsStackLineParser: () => winjsStackLineParser
2153
- });
2154
-
2155
2106
  // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
2156
2107
  var parsedStackResults;
2157
2108
  var lastKeysCount;
@@ -2295,11 +2246,11 @@ class ErrorPropertiesBuilder {
2295
2246
  return context;
2296
2247
  }
2297
2248
  buildCoercingContext(mechanism, hint, depth = 0) {
2298
- const coerce = (input, depth2) => {
2299
- if (!(depth2 <= MAX_CAUSE_RECURSION))
2249
+ const coerce = (input, depth) => {
2250
+ if (!(depth <= MAX_CAUSE_RECURSION))
2300
2251
  return;
2301
2252
  {
2302
- const ctx = this.buildCoercingContext(mechanism, hint, depth2);
2253
+ const ctx = this.buildCoercingContext(mechanism, hint, depth);
2303
2254
  return this.applyCoercers(input, ctx);
2304
2255
  }
2305
2256
  };
@@ -2351,8 +2302,8 @@ var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
2351
2302
  var chromeStackLineParser = (line, platform) => {
2352
2303
  const noFnParts = chromeRegexNoFnName.exec(line);
2353
2304
  if (noFnParts) {
2354
- const [, filename, line2, col] = noFnParts;
2355
- return createFrame(platform, filename, UNKNOWN_FUNCTION, +line2, +col);
2305
+ const [, filename, line, col] = noFnParts;
2306
+ return createFrame(platform, filename, UNKNOWN_FUNCTION, +line, +col);
2356
2307
  }
2357
2308
  const parts = chromeRegex.exec(line);
2358
2309
  if (parts) {
@@ -2393,25 +2344,6 @@ var geckoStackLineParser = (line, platform) => {
2393
2344
  }
2394
2345
  };
2395
2346
 
2396
- // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
2397
- var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
2398
- var winjsStackLineParser = (line, platform) => {
2399
- const parts = winjsRegex.exec(line);
2400
- return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) : undefined;
2401
- };
2402
-
2403
- // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
2404
- var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
2405
- var opera10StackLineParser = (line, platform) => {
2406
- const parts = opera10Regex.exec(line);
2407
- return parts ? createFrame(platform, parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;
2408
- };
2409
- var opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;
2410
- var opera11StackLineParser = (line, platform) => {
2411
- const parts = opera11Regex.exec(line);
2412
- return parts ? createFrame(platform, parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
2413
- };
2414
-
2415
2347
  // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
2416
2348
  var FILENAME_MATCH = /^\s*[-]{4,}$/;
2417
2349
  var FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
@@ -2531,36 +2463,6 @@ function createStackParser(platform, ...parsers) {
2531
2463
  return reverseAndStripFrames(frames);
2532
2464
  };
2533
2465
  }
2534
- // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
2535
- class DOMExceptionCoercer {
2536
- match(err) {
2537
- return this.isDOMException(err) || this.isDOMError(err);
2538
- }
2539
- coerce(err, ctx) {
2540
- const hasStack = isString(err.stack);
2541
- return {
2542
- type: this.getType(err),
2543
- value: this.getValue(err),
2544
- stack: hasStack ? err.stack : undefined,
2545
- cause: err.cause ? ctx.next(err.cause) : undefined,
2546
- synthetic: false
2547
- };
2548
- }
2549
- getType(candidate) {
2550
- return this.isDOMError(candidate) ? "DOMError" : "DOMException";
2551
- }
2552
- getValue(err) {
2553
- const name = err.name || (this.isDOMError(err) ? "DOMError" : "DOMException");
2554
- const message = err.message ? `${name}: ${err.message}` : name;
2555
- return message;
2556
- }
2557
- isDOMException(err) {
2558
- return isBuiltin(err, "DOMException");
2559
- }
2560
- isDOMError(err) {
2561
- return isBuiltin(err, "DOMError");
2562
- }
2563
- }
2564
2466
  // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
2565
2467
  class ErrorCoercer {
2566
2468
  match(err) {
@@ -2590,40 +2492,6 @@ class ErrorCoercer {
2590
2492
  return err.stacktrace || err.stack || undefined;
2591
2493
  }
2592
2494
  }
2593
- // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
2594
- class ErrorEventCoercer {
2595
- constructor() {}
2596
- match(err) {
2597
- if (!isErrorEvent(err))
2598
- return false;
2599
- const errorEvent = err;
2600
- return errorEvent.error != null || this._hasUsableMessage(errorEvent);
2601
- }
2602
- coerce(err, ctx) {
2603
- if (err.error != null)
2604
- return ctx.apply(err.error);
2605
- const exceptionLike = ctx.apply(err.message);
2606
- return {
2607
- ...exceptionLike,
2608
- stack: this._buildLocationStack(err) ?? exceptionLike.stack,
2609
- synthetic: true
2610
- };
2611
- }
2612
- _hasUsableMessage(err) {
2613
- return isString(err.message) && err.message.length > 0;
2614
- }
2615
- _buildLocationStack(err) {
2616
- const location = err;
2617
- const lineno = location.lineno ?? 0;
2618
- const colno = location.colno ?? 0;
2619
- if (!isString(location.filename) || location.filename.length === 0)
2620
- return;
2621
- if (lineno === 0)
2622
- return;
2623
- return `Error
2624
- at ${location.filename}:${lineno}:${colno}`;
2625
- }
2626
- }
2627
2495
  // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
2628
2496
  var ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
2629
2497
 
@@ -2775,42 +2643,6 @@ class PrimitiveCoercer {
2775
2643
  };
2776
2644
  }
2777
2645
  }
2778
- // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
2779
- class PromiseRejectionEventCoercer {
2780
- match(err) {
2781
- return isBuiltin(err, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(err);
2782
- }
2783
- isCustomEventWrappingRejection(err) {
2784
- if (!isEvent(err))
2785
- return false;
2786
- try {
2787
- const detail = err.detail;
2788
- return detail != null && typeof detail == "object" && "reason" in detail;
2789
- } catch {
2790
- return false;
2791
- }
2792
- }
2793
- coerce(err, ctx) {
2794
- const reason = this.getUnhandledRejectionReason(err);
2795
- if (isPrimitive(reason))
2796
- return {
2797
- type: "UnhandledRejection",
2798
- value: `Non-Error promise rejection captured with value: ${String(reason)}`,
2799
- stack: ctx.syntheticException?.stack,
2800
- synthetic: true
2801
- };
2802
- return ctx.apply(reason);
2803
- }
2804
- getUnhandledRejectionReason(error) {
2805
- try {
2806
- if ("reason" in error)
2807
- return error.reason;
2808
- if ("detail" in error && error.detail != null && typeof error.detail == "object" && "reason" in error.detail)
2809
- return error.detail.reason;
2810
- } catch {}
2811
- return error;
2812
- }
2813
- }
2814
2646
  // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/utils.mjs
2815
2647
  class ReduceableCache {
2816
2648
  constructor(_maxSize) {
@@ -2845,130 +2677,6 @@ var RESERVED_EXCEPTION_STEP_KEYS = new Set([
2845
2677
  EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE,
2846
2678
  EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP
2847
2679
  ]);
2848
- var DEFAULT_EXCEPTION_STEPS_CONFIG = {
2849
- enabled: true,
2850
- max_bytes: 32768
2851
- };
2852
- function resolveExceptionStepsConfig(config) {
2853
- if (!config)
2854
- return {
2855
- ...DEFAULT_EXCEPTION_STEPS_CONFIG
2856
- };
2857
- return {
2858
- enabled: config.enabled ?? DEFAULT_EXCEPTION_STEPS_CONFIG.enabled,
2859
- max_bytes: normalizePositiveInteger(config.max_bytes, DEFAULT_EXCEPTION_STEPS_CONFIG.max_bytes)
2860
- };
2861
- }
2862
- function stripReservedExceptionStepFields(properties) {
2863
- if (!properties)
2864
- return {
2865
- sanitizedProperties: {},
2866
- droppedKeys: []
2867
- };
2868
- const droppedKeys = [];
2869
- const sanitizedProperties = Object.keys(properties).reduce((acc, key) => {
2870
- if (RESERVED_EXCEPTION_STEP_KEYS.has(key)) {
2871
- droppedKeys.push(key);
2872
- return acc;
2873
- }
2874
- acc[key] = properties[key];
2875
- return acc;
2876
- }, {});
2877
- return {
2878
- sanitizedProperties,
2879
- droppedKeys
2880
- };
2881
- }
2882
-
2883
- class ExceptionStepsBuffer {
2884
- constructor(config) {
2885
- this._entries = [];
2886
- this._totalBytes = 0;
2887
- this._config = resolveExceptionStepsConfig(config);
2888
- }
2889
- setConfig(config) {
2890
- this._config = resolveExceptionStepsConfig(config);
2891
- this._trimToMaxBytes();
2892
- }
2893
- add(step) {
2894
- const serialized = normalizeAndSerializeStep(step);
2895
- if (!serialized)
2896
- return;
2897
- const bytes = getUtf8ByteLength(serialized.json);
2898
- if (bytes > this._config.max_bytes)
2899
- return;
2900
- this._entries.push({
2901
- step: serialized.step,
2902
- bytes
2903
- });
2904
- this._totalBytes += bytes;
2905
- this._trimToMaxBytes();
2906
- }
2907
- getAttachable() {
2908
- return this._entries.map((e) => e.step);
2909
- }
2910
- clear() {
2911
- this._entries = [];
2912
- this._totalBytes = 0;
2913
- }
2914
- size() {
2915
- return this._entries.length;
2916
- }
2917
- _trimToMaxBytes() {
2918
- while (this._totalBytes > this._config.max_bytes && this._entries.length > 0) {
2919
- const evicted = this._entries.shift();
2920
- if (evicted)
2921
- this._totalBytes -= evicted.bytes;
2922
- }
2923
- }
2924
- }
2925
- function normalizePositiveInteger(input, fallback) {
2926
- if (!isNumber(input) || input === 1 / 0 || input === -1 / 0)
2927
- return fallback;
2928
- const normalized = Math.floor(input);
2929
- if (normalized < 0)
2930
- return fallback;
2931
- return normalized;
2932
- }
2933
- function normalizeAndSerializeStep(step) {
2934
- let json;
2935
- try {
2936
- json = safeJsonStringify(step);
2937
- } catch {
2938
- return;
2939
- }
2940
- try {
2941
- const parsed = JSON.parse(json);
2942
- if (!isObject(parsed))
2943
- return;
2944
- const parsedStep = parsed;
2945
- const message = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE];
2946
- const timestamp = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP];
2947
- if (!isString(message) || message.trim().length === 0)
2948
- return;
2949
- if (!isString(timestamp) && !isNumber(timestamp))
2950
- return;
2951
- return {
2952
- step: parsedStep,
2953
- json
2954
- };
2955
- } catch {
2956
- return;
2957
- }
2958
- }
2959
- function getUtf8ByteLength(value) {
2960
- if (typeof TextEncoder != "undefined")
2961
- return new TextEncoder().encode(value).length;
2962
- const encoded = encodeURIComponent(value);
2963
- let byteLength = 0;
2964
- for (let i = 0;i < encoded.length; i++)
2965
- if (encoded[i] === "%") {
2966
- byteLength += 1;
2967
- i += 2;
2968
- } else
2969
- byteLength += 1;
2970
- return byteLength;
2971
- }
2972
2680
  // ../../../../../node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/release.mjs
2973
2681
  function getInjectedReleaseId() {
2974
2682
  const injected = globalThis._posthogReleaseId;
@@ -3503,15 +3211,15 @@ class PostHogCoreStateless {
3503
3211
  };
3504
3212
  const response = await this.fetchWithRetry(url, fetchOptions, {
3505
3213
  type: "required",
3506
- consume: (response2) => {
3507
- if (response2.status !== 200 || !response2.json) {
3508
- const msg = `Surveys API could not be loaded: ${response2.status}`;
3214
+ consume: (response) => {
3215
+ if (response.status !== 200 || !response.json) {
3216
+ const msg = `Surveys API could not be loaded: ${response.status}`;
3509
3217
  const error = new Error(msg);
3510
3218
  this._logger.error(error);
3511
3219
  this._events.emit("error", new Error(msg));
3512
3220
  return Promise.resolve(undefined);
3513
3221
  }
3514
- return response2.json();
3222
+ return response.json();
3515
3223
  }
3516
3224
  }).catch((error) => {
3517
3225
  this._logger.error("Surveys API could not be loaded", error);
@@ -4092,13 +3800,13 @@ import { constants as constants2 } from "node:fs";
4092
3800
  import { open as promises_open } from "node:fs/promises";
4093
3801
  import { isAbsolute } from "node:path";
4094
3802
  import { createInterface } from "node:readline";
4095
- var LRU_FILE_CONTENTS_CACHE = new exports_error_tracking.ReduceableCache(25);
4096
- var LRU_FILE_CONTENTS_FS_READ_FAILED = new exports_error_tracking.ReduceableCache(20);
3803
+ var LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
3804
+ var LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
4097
3805
  var DEFAULT_LINES_OF_CONTEXT = 7;
4098
3806
  var MAX_CONTEXTLINES_COLNO = 1000;
4099
3807
  var MAX_CONTEXTLINES_LINENO = 1e4;
4100
3808
  var MAX_CONTEXTLINES_FILE_SIZE = 10485760;
4101
- async function addSourceContext(frames, openSourceFile = promises_open, logger2) {
3809
+ async function addSourceContext(frames, openSourceFile = promises_open, logger) {
4102
3810
  const filesToLines = {};
4103
3811
  let basePath;
4104
3812
  try {
@@ -4134,7 +3842,7 @@ async function addSourceContext(frames, openSourceFile = promises_open, logger2)
4134
3842
  if (ranges.every((r) => rangeExistsInContentCache(cacheKey, r)))
4135
3843
  continue;
4136
3844
  const cache = emplace(LRU_FILE_CONTENTS_CACHE, cacheKey, {});
4137
- readlinePromises.push(getContextLinesFromFile(file, ranges, cache, cacheKey, openSourceFile, logger2));
3845
+ readlinePromises.push(getContextLinesFromFile(file, ranges, cache, cacheKey, openSourceFile, logger));
4138
3846
  }
4139
3847
  await Promise.all(readlinePromises).catch(() => {});
4140
3848
  if (frames && frames.length > 0)
@@ -4142,16 +3850,16 @@ async function addSourceContext(frames, openSourceFile = promises_open, logger2)
4142
3850
  LRU_FILE_CONTENTS_CACHE.reduce();
4143
3851
  return frames;
4144
3852
  }
4145
- async function openRegularSourceFile(path2, openSourceFile, logger2) {
3853
+ async function openRegularSourceFile(path, openSourceFile, logger) {
4146
3854
  let fileHandle;
4147
3855
  let isValid = false;
4148
3856
  try {
4149
- fileHandle = await openSourceFile(path2, constants2.O_RDONLY | constants2.O_NONBLOCK);
3857
+ fileHandle = await openSourceFile(path, constants2.O_RDONLY | constants2.O_NONBLOCK);
4150
3858
  const fileStat = await fileHandle.stat();
4151
3859
  if (!fileStat.isFile())
4152
3860
  return;
4153
3861
  if (fileStat.size > MAX_CONTEXTLINES_FILE_SIZE)
4154
- return void logger2?.debug(`Skipping source context for oversized file ${path2}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
3862
+ return void logger?.debug(`Skipping source context for oversized file ${path}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
4155
3863
  isValid = true;
4156
3864
  return fileHandle;
4157
3865
  } catch {
@@ -4161,18 +3869,18 @@ async function openRegularSourceFile(path2, openSourceFile, logger2) {
4161
3869
  await fileHandle.close().catch(() => {});
4162
3870
  }
4163
3871
  }
4164
- async function getContextLinesFromFile(path2, ranges, output, cacheKey, openSourceFile, logger2) {
4165
- const fileHandle = await openRegularSourceFile(path2, openSourceFile, logger2);
3872
+ async function getContextLinesFromFile(path, ranges, output, cacheKey, openSourceFile, logger) {
3873
+ const fileHandle = await openRegularSourceFile(path, openSourceFile, logger);
4166
3874
  if (fileHandle === undefined)
4167
3875
  return void LRU_FILE_CONTENTS_FS_READ_FAILED.set(cacheKey, 1);
4168
3876
  const openedFileHandle = fileHandle;
4169
3877
  return new Promise((resolve) => {
4170
3878
  let finished = false;
4171
- function destroyStreamAndResolve(stream2) {
3879
+ function destroyStreamAndResolve(stream) {
4172
3880
  if (finished)
4173
3881
  return;
4174
3882
  finished = true;
4175
- stream2?.destroy();
3883
+ stream?.destroy();
4176
3884
  openedFileHandle.close().then(resolve, resolve);
4177
3885
  }
4178
3886
  let stream;
@@ -4225,14 +3933,14 @@ async function getContextLinesFromFile(path2, ranges, output, cacheKey, openSour
4225
3933
  return;
4226
3934
  }
4227
3935
  currentRangeIndex++;
4228
- const range2 = ranges[currentRangeIndex];
4229
- if (range2 === undefined) {
3936
+ const range = ranges[currentRangeIndex];
3937
+ if (range === undefined) {
4230
3938
  lineReaded.close();
4231
3939
  lineReaded.removeAllListeners();
4232
3940
  return;
4233
3941
  }
4234
- rangeStart = range2[0];
4235
- rangeEnd = range2[1];
3942
+ rangeStart = range[0];
3943
+ rangeEnd = range[1];
4236
3944
  }
4237
3945
  });
4238
3946
  });
@@ -4274,8 +3982,8 @@ function clearLineContext(frame) {
4274
3982
  delete frame.context_line;
4275
3983
  delete frame.post_context;
4276
3984
  }
4277
- function shouldSkipContextLinesForFile(path2) {
4278
- return path2.startsWith("node:") || path2.endsWith(".min.js") || path2.endsWith(".min.cjs") || path2.endsWith(".min.mjs") || path2.startsWith("data:");
3985
+ function shouldSkipContextLinesForFile(path) {
3986
+ return path.startsWith("node:") || path.endsWith(".min.js") || path.endsWith(".min.cjs") || path.endsWith(".min.mjs") || path.startsWith("data:");
4279
3987
  }
4280
3988
  function shouldSkipContextLinesForFrame(frame) {
4281
3989
  if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO)
@@ -4284,15 +3992,15 @@ function shouldSkipContextLinesForFrame(frame) {
4284
3992
  return true;
4285
3993
  return false;
4286
3994
  }
4287
- function makeSourceCacheKey(path2, basePath) {
4288
- if (isAbsolute(path2))
3995
+ function makeSourceCacheKey(path, basePath) {
3996
+ if (isAbsolute(path))
4289
3997
  return JSON.stringify([
4290
3998
  null,
4291
- path2
3999
+ path
4292
4000
  ]);
4293
4001
  return basePath === undefined ? undefined : JSON.stringify([
4294
4002
  basePath,
4295
- path2
4003
+ path
4296
4004
  ]);
4297
4005
  }
4298
4006
  function rangeExistsInContentCache(cacheKey, range) {
@@ -5135,21 +4843,21 @@ function matchProperty(property, propertyValues, warnFunction) {
5135
4843
  warnFunction(`Property ${key} cannot have a value of null/undefined with the ${operator} operator`);
5136
4844
  return false;
5137
4845
  }
5138
- function computeExactMatch(value2, overrideValue2) {
5139
- if (Array.isArray(value2))
5140
- return value2.map((val) => String(val).toLowerCase()).includes(String(overrideValue2).toLowerCase());
5141
- return String(value2).toLowerCase() === String(overrideValue2).toLowerCase();
4846
+ function computeExactMatch(value, overrideValue) {
4847
+ if (Array.isArray(value))
4848
+ return value.map((val) => String(val).toLowerCase()).includes(String(overrideValue).toLowerCase());
4849
+ return String(value).toLowerCase() === String(overrideValue).toLowerCase();
5142
4850
  }
5143
- function compare(lhs, rhs, operator2) {
5144
- if (operator2 === "gt")
4851
+ function compare(lhs, rhs, operator) {
4852
+ if (operator === "gt")
5145
4853
  return lhs > rhs;
5146
- if (operator2 === "gte")
4854
+ if (operator === "gte")
5147
4855
  return lhs >= rhs;
5148
- if (operator2 === "lt")
4856
+ if (operator === "lt")
5149
4857
  return lhs < rhs;
5150
- if (operator2 === "lte")
4858
+ if (operator === "lte")
5151
4859
  return lhs <= rhs;
5152
- throw new Error(`Invalid operator: ${operator2}`);
4860
+ throw new Error(`Invalid operator: ${operator}`);
5153
4861
  }
5154
4862
  switch (operator) {
5155
4863
  case "exact":
@@ -5618,7 +5326,7 @@ class error_tracking_ErrorTracking {
5618
5326
  };
5619
5327
  const exceptionProperties = builder.buildFromUnknown(error, hint);
5620
5328
  exceptionProperties.$exception_list = await builder.modifyFrames(exceptionProperties.$exception_list);
5621
- const injectedReleaseId = exports_error_tracking.getInjectedReleaseId();
5329
+ const injectedReleaseId = getInjectedReleaseId();
5622
5330
  if (injectedReleaseId)
5623
5331
  properties.$release_id = injectedReleaseId;
5624
5332
  return {
@@ -5766,10 +5474,10 @@ function isRecord2(value) {
5766
5474
  }
5767
5475
  function toRfc3339(timestamp) {
5768
5476
  if (typeof timestamp == "string") {
5769
- const asDate2 = new Date(timestamp);
5770
- if (Number.isNaN(asDate2.getTime()))
5477
+ const asDate = new Date(timestamp);
5478
+ if (Number.isNaN(asDate.getTime()))
5771
5479
  return new Date().toISOString();
5772
- const normalized = asDate2.toISOString();
5480
+ const normalized = asDate.toISOString();
5773
5481
  const fractionalSeconds = timestamp.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1];
5774
5482
  return fractionalSeconds && fractionalSeconds.length > 3 ? normalized.replace(/\.\d{3}Z$/, `.${fractionalSeconds}Z`) : normalized;
5775
5483
  }
@@ -7458,7 +7166,7 @@ function createEventProcessor(_posthog, { organization, projectId, prefix, sever
7458
7166
  $sentry_exception_type: exceptions[0]?.type,
7459
7167
  $sentry_tags: event.tags
7460
7168
  };
7461
- const injectedReleaseId = exports_error_tracking.getInjectedReleaseId();
7169
+ const injectedReleaseId = getInjectedReleaseId();
7462
7170
  if (injectedReleaseId)
7463
7171
  properties.$release_id = injectedReleaseId;
7464
7172
  if (organization && projectId)
@@ -7501,13 +7209,13 @@ class PostHog extends PostHogBackendClient {
7501
7209
  return new PostHogContext;
7502
7210
  }
7503
7211
  createErrorPropertiesBuilder() {
7504
- return new exports_error_tracking.ErrorPropertiesBuilder([
7505
- new exports_error_tracking.EventCoercer,
7506
- new exports_error_tracking.ErrorCoercer,
7507
- new exports_error_tracking.ObjectCoercer,
7508
- new exports_error_tracking.StringCoercer,
7509
- new exports_error_tracking.PrimitiveCoercer
7510
- ], exports_error_tracking.createStackParser("node:javascript", exports_error_tracking.nodeStackLineParser), [
7212
+ return new ErrorPropertiesBuilder([
7213
+ new EventCoercer,
7214
+ new ErrorCoercer,
7215
+ new ObjectCoercer,
7216
+ new StringCoercer,
7217
+ new PrimitiveCoercer
7218
+ ], createStackParser("node:javascript", nodeStackLineParser), [
7511
7219
  createModulerModifier(),
7512
7220
  (frames) => addSourceContext(frames, undefined, this._logger),
7513
7221
  createRelativePathModifier()