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,20 +1,16 @@
1
1
  #!/usr/bin/env node
2
- // omo-codex-install:81cf03496fa0db52b428d9e5f1d2a022f753fe60530d84f72d767af03333373f:68365e4c1ec89226f01d55d21613f2b3a049a5669f4e6e3ff7c15b088c6eaa59
3
- var __defProp = Object.defineProperty;
4
- var __returnValue = (v) => v;
5
- function __exportSetter(name, newValue) {
6
- this[name] = __returnValue.bind(null, newValue);
7
- }
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, {
11
- get: all[name],
12
- enumerable: true,
13
- configurable: true,
14
- set: __exportSetter.bind(all, name)
15
- });
2
+ // omo-codex-install:dd6a563800e30ce8e45f73e631a566e5e525285c2e2049577b5f004bf9d9710a:26ef1567ba9e38d0d52846b6fe707522f7d02c45e69ba503717e1a6aa88c3ce4
3
+ var __esm = (fn, res, err) => () => {
4
+ if (fn)
5
+ try {
6
+ res = fn(fn = 0);
7
+ } catch (e) {
8
+ err = [e];
9
+ }
10
+ if (err)
11
+ throw err[0];
12
+ return res;
16
13
  };
17
- var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
18
14
 
19
15
  // packages/utils/src/xdg-data-dir.ts
20
16
  import { accessSync, constants, mkdirSync } from "node:fs";
@@ -394,8 +390,8 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname10(proc
394
390
  return decodedFile;
395
391
  };
396
392
  }
397
- function normalizeWindowsPath(path2) {
398
- return path2.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
393
+ function normalizeWindowsPath(path) {
394
+ return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
399
395
  }
400
396
  var init_module_node = () => {};
401
397
 
@@ -802,9 +798,6 @@ function isError(candidate) {
802
798
  return isInstanceOf(candidate, Error);
803
799
  }
804
800
  }
805
- function isErrorEvent(event) {
806
- return isBuiltin(event, "ErrorEvent");
807
- }
808
801
  function isEvent(candidate) {
809
802
  return typeof Event != "undefined" && isInstanceOf(candidate, Event);
810
803
  }
@@ -1475,11 +1468,11 @@ async function raceWithTimeout(promise, timeoutMs, onTimeout) {
1475
1468
  try {
1476
1469
  return await Promise.race([
1477
1470
  promise,
1478
- new Promise((resolve9, reject) => {
1471
+ new Promise((resolve, reject) => {
1479
1472
  timeoutHandle = safeSetTimeout(() => {
1480
1473
  try {
1481
1474
  onTimeout?.();
1482
- resolve9();
1475
+ resolve();
1483
1476
  } catch (error) {
1484
1477
  reject(error);
1485
1478
  }
@@ -1521,14 +1514,14 @@ function newState() {
1521
1514
  remainingNodes: MAX_JSON_SAFE_VALUE_NODES
1522
1515
  };
1523
1516
  }
1524
- function toOtlpKeyValueList(attrs, logger2) {
1517
+ function toOtlpKeyValueList(attrs, logger) {
1525
1518
  try {
1526
- return encodeKeyValueList(attrs, logger2, newState(), 0);
1519
+ return encodeKeyValueList(attrs, logger, newState(), 0);
1527
1520
  } catch {
1528
1521
  return [];
1529
1522
  }
1530
1523
  }
1531
- function encodeAnyValue(value, logger2, state, depth) {
1524
+ function encodeAnyValue(value, logger, state, depth) {
1532
1525
  if (state.remainingNodes <= 0)
1533
1526
  return {
1534
1527
  stringValue: TRUNCATED_VALUE
@@ -1554,7 +1547,7 @@ function encodeAnyValue(value, logger2, state, depth) {
1554
1547
  };
1555
1548
  const decimal = BigInt(value).toString();
1556
1549
  if (value >= INT64_RANGE_LIMIT || value < -INT64_RANGE_LIMIT) {
1557
- logger2?.debug(`Attribute ${decimal} is outside the int64 range; encoding it as a string`);
1550
+ logger?.debug(`Attribute ${decimal} is outside the int64 range; encoding it as a string`);
1558
1551
  return {
1559
1552
  stringValue: decimal
1560
1553
  };
@@ -1600,17 +1593,17 @@ function encodeAnyValue(value, logger2, state, depth) {
1600
1593
  try {
1601
1594
  const toJSON = value.toJSON;
1602
1595
  if (typeof toJSON == "function")
1603
- return encodeAnyValue(toJSON.call(value), logger2, state, depth + 1);
1596
+ return encodeAnyValue(toJSON.call(value), logger, state, depth + 1);
1604
1597
  } catch {}
1605
1598
  if (isArray(value))
1606
1599
  return {
1607
1600
  arrayValue: {
1608
- values: encodeArrayValues(value, logger2, state, depth + 1)
1601
+ values: encodeArrayValues(value, logger, state, depth + 1)
1609
1602
  }
1610
1603
  };
1611
1604
  return {
1612
1605
  kvlistValue: {
1613
- values: encodeKeyValueList(value, logger2, state, depth + 1)
1606
+ values: encodeKeyValueList(value, logger, state, depth + 1)
1614
1607
  }
1615
1608
  };
1616
1609
  } finally {
@@ -1621,7 +1614,7 @@ function encodeAnyValue(value, logger2, state, depth) {
1621
1614
  stringValue: sanitizeString(String(value))
1622
1615
  };
1623
1616
  }
1624
- function encodeArrayValues(values, logger2, state, depth) {
1617
+ function encodeArrayValues(values, logger, state, depth) {
1625
1618
  const result = [];
1626
1619
  const itemCount = Math.min(values.length, MAX_JSON_SAFE_VALUE_ITEMS);
1627
1620
  let index = 0;
@@ -1630,7 +1623,7 @@ function encodeArrayValues(values, logger2, state, depth) {
1630
1623
  const element = index in values ? values[index] : undefined;
1631
1624
  if (isNullish(element))
1632
1625
  continue;
1633
- result.push(encodeAnyValue(element, logger2, state, depth));
1626
+ result.push(encodeAnyValue(element, logger, state, depth));
1634
1627
  } catch {
1635
1628
  result.push({
1636
1629
  stringValue: UNSERIALIZABLE_VALUE
@@ -1642,12 +1635,12 @@ function encodeArrayValues(values, logger2, state, depth) {
1642
1635
  });
1643
1636
  return result;
1644
1637
  }
1645
- function encodeKeyValueList(attrs, logger2, state, depth) {
1638
+ function encodeKeyValueList(attrs, logger, state, depth) {
1646
1639
  const result = [];
1647
1640
  for (const key in attrs)
1648
1641
  if (propertyIsEnumerable.call(attrs, key)) {
1649
1642
  if (result.length >= MAX_JSON_SAFE_VALUE_ITEMS || state.remainingNodes <= 0) {
1650
- logger2?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");
1643
+ logger?.debug("Attributes truncated: the value exceeds the OTLP encoder budget");
1651
1644
  break;
1652
1645
  }
1653
1646
  try {
@@ -1656,7 +1649,7 @@ function encodeKeyValueList(attrs, logger2, state, depth) {
1656
1649
  continue;
1657
1650
  result.push({
1658
1651
  key: sanitizeString(key),
1659
- value: encodeAnyValue(value, logger2, state, depth)
1652
+ value: encodeAnyValue(value, logger, state, depth)
1660
1653
  });
1661
1654
  } catch {
1662
1655
  result.push({
@@ -2300,11 +2293,11 @@ class ErrorPropertiesBuilder {
2300
2293
  return context;
2301
2294
  }
2302
2295
  buildCoercingContext(mechanism, hint, depth = 0) {
2303
- const coerce = (input, depth2) => {
2304
- if (!(depth2 <= MAX_CAUSE_RECURSION))
2296
+ const coerce = (input, depth) => {
2297
+ if (!(depth <= MAX_CAUSE_RECURSION))
2305
2298
  return;
2306
2299
  {
2307
- const ctx = this.buildCoercingContext(mechanism, hint, depth2);
2300
+ const ctx = this.buildCoercingContext(mechanism, hint, depth);
2308
2301
  return this.applyCoercers(input, ctx);
2309
2302
  }
2310
2303
  };
@@ -2363,8 +2356,8 @@ var init_safari = __esm(() => {
2363
2356
  var chromeRegexNoFnName, chromeRegex, chromeEvalRegex, chromeStackLineParser = (line, platform) => {
2364
2357
  const noFnParts = chromeRegexNoFnName.exec(line);
2365
2358
  if (noFnParts) {
2366
- const [, filename, line2, col] = noFnParts;
2367
- return createFrame(platform, filename, UNKNOWN_FUNCTION, +line2, +col);
2359
+ const [, filename, line, col] = noFnParts;
2360
+ return createFrame(platform, filename, UNKNOWN_FUNCTION, +line, +col);
2368
2361
  }
2369
2362
  const parts = chromeRegex.exec(line);
2370
2363
  if (parts) {
@@ -2417,27 +2410,13 @@ var init_gecko = __esm(() => {
2417
2410
  });
2418
2411
 
2419
2412
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
2420
- var winjsRegex, winjsStackLineParser = (line, platform) => {
2421
- const parts = winjsRegex.exec(line);
2422
- return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) : undefined;
2423
- };
2424
2413
  var init_winjs = __esm(() => {
2425
2414
  init_base();
2426
- winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
2427
2415
  });
2428
2416
 
2429
2417
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
2430
- var opera10Regex, opera10StackLineParser = (line, platform) => {
2431
- const parts = opera10Regex.exec(line);
2432
- return parts ? createFrame(platform, parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;
2433
- }, opera11Regex, opera11StackLineParser = (line, platform) => {
2434
- const parts = opera11Regex.exec(line);
2435
- return parts ? createFrame(platform, parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
2436
- };
2437
2418
  var init_opera = __esm(() => {
2438
2419
  init_base();
2439
- opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
2440
- opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i;
2441
2420
  });
2442
2421
 
2443
2422
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
@@ -2571,35 +2550,6 @@ var init_parsers = __esm(() => {
2571
2550
  });
2572
2551
 
2573
2552
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
2574
- class DOMExceptionCoercer {
2575
- match(err) {
2576
- return this.isDOMException(err) || this.isDOMError(err);
2577
- }
2578
- coerce(err, ctx) {
2579
- const hasStack = isString(err.stack);
2580
- return {
2581
- type: this.getType(err),
2582
- value: this.getValue(err),
2583
- stack: hasStack ? err.stack : undefined,
2584
- cause: err.cause ? ctx.next(err.cause) : undefined,
2585
- synthetic: false
2586
- };
2587
- }
2588
- getType(candidate) {
2589
- return this.isDOMError(candidate) ? "DOMError" : "DOMException";
2590
- }
2591
- getValue(err) {
2592
- const name = err.name || (this.isDOMError(err) ? "DOMError" : "DOMException");
2593
- const message = err.message ? `${name}: ${err.message}` : name;
2594
- return message;
2595
- }
2596
- isDOMException(err) {
2597
- return isBuiltin(err, "DOMException");
2598
- }
2599
- isDOMError(err) {
2600
- return isBuiltin(err, "DOMError");
2601
- }
2602
- }
2603
2553
  var init_dom_exception_coercer = __esm(() => {
2604
2554
  init_utils();
2605
2555
  });
@@ -2638,39 +2588,6 @@ var init_error_coercer = __esm(() => {
2638
2588
  });
2639
2589
 
2640
2590
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
2641
- class ErrorEventCoercer {
2642
- constructor() {}
2643
- match(err) {
2644
- if (!isErrorEvent(err))
2645
- return false;
2646
- const errorEvent = err;
2647
- return errorEvent.error != null || this._hasUsableMessage(errorEvent);
2648
- }
2649
- coerce(err, ctx) {
2650
- if (err.error != null)
2651
- return ctx.apply(err.error);
2652
- const exceptionLike = ctx.apply(err.message);
2653
- return {
2654
- ...exceptionLike,
2655
- stack: this._buildLocationStack(err) ?? exceptionLike.stack,
2656
- synthetic: true
2657
- };
2658
- }
2659
- _hasUsableMessage(err) {
2660
- return isString(err.message) && err.message.length > 0;
2661
- }
2662
- _buildLocationStack(err) {
2663
- const location = err;
2664
- const lineno = location.lineno ?? 0;
2665
- const colno = location.colno ?? 0;
2666
- if (!isString(location.filename) || location.filename.length === 0)
2667
- return;
2668
- if (lineno === 0)
2669
- return;
2670
- return `Error
2671
- at ${location.filename}:${lineno}:${colno}`;
2672
- }
2673
- }
2674
2591
  var init_error_event_coercer = __esm(() => {
2675
2592
  init_utils();
2676
2593
  });
@@ -2849,41 +2766,6 @@ var init_primitive_coercer = __esm(() => {
2849
2766
  });
2850
2767
 
2851
2768
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
2852
- class PromiseRejectionEventCoercer {
2853
- match(err) {
2854
- return isBuiltin(err, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(err);
2855
- }
2856
- isCustomEventWrappingRejection(err) {
2857
- if (!isEvent(err))
2858
- return false;
2859
- try {
2860
- const detail = err.detail;
2861
- return detail != null && typeof detail == "object" && "reason" in detail;
2862
- } catch {
2863
- return false;
2864
- }
2865
- }
2866
- coerce(err, ctx) {
2867
- const reason = this.getUnhandledRejectionReason(err);
2868
- if (isPrimitive(reason))
2869
- return {
2870
- type: "UnhandledRejection",
2871
- value: `Non-Error promise rejection captured with value: ${String(reason)}`,
2872
- stack: ctx.syntheticException?.stack,
2873
- synthetic: true
2874
- };
2875
- return ctx.apply(reason);
2876
- }
2877
- getUnhandledRejectionReason(error) {
2878
- try {
2879
- if ("reason" in error)
2880
- return error.reason;
2881
- if ("detail" in error && error.detail != null && typeof error.detail == "object" && "reason" in error.detail)
2882
- return error.detail.reason;
2883
- } catch {}
2884
- return error;
2885
- }
2886
- }
2887
2769
  var init_promise_rejection_event = __esm(() => {
2888
2770
  init_utils();
2889
2771
  });
@@ -2928,127 +2810,7 @@ class ReduceableCache {
2928
2810
  var init_utils3 = () => {};
2929
2811
 
2930
2812
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/exception-steps.mjs
2931
- function resolveExceptionStepsConfig(config) {
2932
- if (!config)
2933
- return {
2934
- ...DEFAULT_EXCEPTION_STEPS_CONFIG
2935
- };
2936
- return {
2937
- enabled: config.enabled ?? DEFAULT_EXCEPTION_STEPS_CONFIG.enabled,
2938
- max_bytes: normalizePositiveInteger(config.max_bytes, DEFAULT_EXCEPTION_STEPS_CONFIG.max_bytes)
2939
- };
2940
- }
2941
- function stripReservedExceptionStepFields(properties) {
2942
- if (!properties)
2943
- return {
2944
- sanitizedProperties: {},
2945
- droppedKeys: []
2946
- };
2947
- const droppedKeys = [];
2948
- const sanitizedProperties = Object.keys(properties).reduce((acc, key) => {
2949
- if (RESERVED_EXCEPTION_STEP_KEYS.has(key)) {
2950
- droppedKeys.push(key);
2951
- return acc;
2952
- }
2953
- acc[key] = properties[key];
2954
- return acc;
2955
- }, {});
2956
- return {
2957
- sanitizedProperties,
2958
- droppedKeys
2959
- };
2960
- }
2961
-
2962
- class ExceptionStepsBuffer {
2963
- constructor(config) {
2964
- this._entries = [];
2965
- this._totalBytes = 0;
2966
- this._config = resolveExceptionStepsConfig(config);
2967
- }
2968
- setConfig(config) {
2969
- this._config = resolveExceptionStepsConfig(config);
2970
- this._trimToMaxBytes();
2971
- }
2972
- add(step) {
2973
- const serialized = normalizeAndSerializeStep(step);
2974
- if (!serialized)
2975
- return;
2976
- const bytes = getUtf8ByteLength(serialized.json);
2977
- if (bytes > this._config.max_bytes)
2978
- return;
2979
- this._entries.push({
2980
- step: serialized.step,
2981
- bytes
2982
- });
2983
- this._totalBytes += bytes;
2984
- this._trimToMaxBytes();
2985
- }
2986
- getAttachable() {
2987
- return this._entries.map((e) => e.step);
2988
- }
2989
- clear() {
2990
- this._entries = [];
2991
- this._totalBytes = 0;
2992
- }
2993
- size() {
2994
- return this._entries.length;
2995
- }
2996
- _trimToMaxBytes() {
2997
- while (this._totalBytes > this._config.max_bytes && this._entries.length > 0) {
2998
- const evicted = this._entries.shift();
2999
- if (evicted)
3000
- this._totalBytes -= evicted.bytes;
3001
- }
3002
- }
3003
- }
3004
- function normalizePositiveInteger(input, fallback) {
3005
- if (!isNumber(input) || input === 1 / 0 || input === -1 / 0)
3006
- return fallback;
3007
- const normalized = Math.floor(input);
3008
- if (normalized < 0)
3009
- return fallback;
3010
- return normalized;
3011
- }
3012
- function normalizeAndSerializeStep(step) {
3013
- let json;
3014
- try {
3015
- json = safeJsonStringify(step);
3016
- } catch {
3017
- return;
3018
- }
3019
- try {
3020
- const parsed = JSON.parse(json);
3021
- if (!isObject(parsed))
3022
- return;
3023
- const parsedStep = parsed;
3024
- const message = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE];
3025
- const timestamp = parsedStep[EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP];
3026
- if (!isString(message) || message.trim().length === 0)
3027
- return;
3028
- if (!isString(timestamp) && !isNumber(timestamp))
3029
- return;
3030
- return {
3031
- step: parsedStep,
3032
- json
3033
- };
3034
- } catch {
3035
- return;
3036
- }
3037
- }
3038
- function getUtf8ByteLength(value) {
3039
- if (typeof TextEncoder != "undefined")
3040
- return new TextEncoder().encode(value).length;
3041
- const encoded = encodeURIComponent(value);
3042
- let byteLength = 0;
3043
- for (let i = 0;i < encoded.length; i++)
3044
- if (encoded[i] === "%") {
3045
- byteLength += 1;
3046
- i += 2;
3047
- } else
3048
- byteLength += 1;
3049
- return byteLength;
3050
- }
3051
- var EXCEPTION_STEP_INTERNAL_FIELDS, RESERVED_EXCEPTION_STEP_KEYS, DEFAULT_EXCEPTION_STEPS_CONFIG;
2813
+ var EXCEPTION_STEP_INTERNAL_FIELDS, RESERVED_EXCEPTION_STEP_KEYS;
3052
2814
  var init_exception_steps = __esm(() => {
3053
2815
  init_utils();
3054
2816
  EXCEPTION_STEP_INTERNAL_FIELDS = {
@@ -3059,10 +2821,6 @@ var init_exception_steps = __esm(() => {
3059
2821
  EXCEPTION_STEP_INTERNAL_FIELDS.MESSAGE,
3060
2822
  EXCEPTION_STEP_INTERNAL_FIELDS.TIMESTAMP
3061
2823
  ]);
3062
- DEFAULT_EXCEPTION_STEPS_CONFIG = {
3063
- enabled: true,
3064
- max_bytes: 32768
3065
- };
3066
2824
  });
3067
2825
 
3068
2826
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/release.mjs
@@ -3073,35 +2831,6 @@ function getInjectedReleaseId() {
3073
2831
  var init_release = () => {};
3074
2832
 
3075
2833
  // node_modules/.bun/@posthog+core@1.48.9/node_modules/@posthog/core/dist/error-tracking/index.mjs
3076
- var exports_error_tracking = {};
3077
- __export(exports_error_tracking, {
3078
- DEFAULT_EXCEPTION_STEPS_CONFIG: () => DEFAULT_EXCEPTION_STEPS_CONFIG,
3079
- DOMExceptionCoercer: () => DOMExceptionCoercer,
3080
- EXCEPTION_STEP_INTERNAL_FIELDS: () => EXCEPTION_STEP_INTERNAL_FIELDS,
3081
- ErrorCoercer: () => ErrorCoercer,
3082
- ErrorEventCoercer: () => ErrorEventCoercer,
3083
- ErrorPropertiesBuilder: () => ErrorPropertiesBuilder,
3084
- EventCoercer: () => EventCoercer,
3085
- ExceptionStepsBuffer: () => ExceptionStepsBuffer,
3086
- ObjectCoercer: () => ObjectCoercer,
3087
- PrimitiveCoercer: () => PrimitiveCoercer,
3088
- PromiseRejectionEventCoercer: () => PromiseRejectionEventCoercer,
3089
- ReduceableCache: () => ReduceableCache,
3090
- StringCoercer: () => StringCoercer,
3091
- chromeStackLineParser: () => chromeStackLineParser,
3092
- createDefaultStackParser: () => createDefaultStackParser,
3093
- createStackParser: () => createStackParser,
3094
- geckoStackLineParser: () => geckoStackLineParser,
3095
- getInjectedReleaseId: () => getInjectedReleaseId,
3096
- getUtf8ByteLength: () => getUtf8ByteLength,
3097
- nodeStackLineParser: () => nodeStackLineParser,
3098
- opera10StackLineParser: () => opera10StackLineParser,
3099
- opera11StackLineParser: () => opera11StackLineParser,
3100
- resolveExceptionStepsConfig: () => resolveExceptionStepsConfig,
3101
- reverseAndStripFrames: () => reverseAndStripFrames,
3102
- stripReservedExceptionStepFields: () => stripReservedExceptionStepFields,
3103
- winjsStackLineParser: () => winjsStackLineParser
3104
- });
3105
2834
  var init_error_tracking = __esm(() => {
3106
2835
  init_error_properties_builder();
3107
2836
  init_parsers();
@@ -3571,15 +3300,15 @@ class PostHogCoreStateless {
3571
3300
  };
3572
3301
  const response = await this.fetchWithRetry(url, fetchOptions, {
3573
3302
  type: "required",
3574
- consume: (response2) => {
3575
- if (response2.status !== 200 || !response2.json) {
3576
- const msg = `Surveys API could not be loaded: ${response2.status}`;
3303
+ consume: (response) => {
3304
+ if (response.status !== 200 || !response.json) {
3305
+ const msg = `Surveys API could not be loaded: ${response.status}`;
3577
3306
  const error = new Error(msg);
3578
3307
  this._logger.error(error);
3579
3308
  this._events.emit("error", new Error(msg));
3580
3309
  return Promise.resolve(undefined);
3581
3310
  }
3582
- return response2.json();
3311
+ return response.json();
3583
3312
  }
3584
3313
  }).catch((error) => {
3585
3314
  this._logger.error("Surveys API could not be loaded", error);
@@ -4269,7 +3998,7 @@ import { constants as constants2 } from "node:fs";
4269
3998
  import { open as promises_open } from "node:fs/promises";
4270
3999
  import { isAbsolute as isAbsolute7 } from "node:path";
4271
4000
  import { createInterface } from "node:readline";
4272
- async function addSourceContext(frames, openSourceFile = promises_open, logger2) {
4001
+ async function addSourceContext(frames, openSourceFile = promises_open, logger) {
4273
4002
  const filesToLines = {};
4274
4003
  let basePath;
4275
4004
  try {
@@ -4305,7 +4034,7 @@ async function addSourceContext(frames, openSourceFile = promises_open, logger2)
4305
4034
  if (ranges.every((r) => rangeExistsInContentCache(cacheKey, r)))
4306
4035
  continue;
4307
4036
  const cache = emplace(LRU_FILE_CONTENTS_CACHE, cacheKey, {});
4308
- readlinePromises.push(getContextLinesFromFile(file, ranges, cache, cacheKey, openSourceFile, logger2));
4037
+ readlinePromises.push(getContextLinesFromFile(file, ranges, cache, cacheKey, openSourceFile, logger));
4309
4038
  }
4310
4039
  await Promise.all(readlinePromises).catch(() => {});
4311
4040
  if (frames && frames.length > 0)
@@ -4313,16 +4042,16 @@ async function addSourceContext(frames, openSourceFile = promises_open, logger2)
4313
4042
  LRU_FILE_CONTENTS_CACHE.reduce();
4314
4043
  return frames;
4315
4044
  }
4316
- async function openRegularSourceFile(path2, openSourceFile, logger2) {
4045
+ async function openRegularSourceFile(path, openSourceFile, logger) {
4317
4046
  let fileHandle;
4318
4047
  let isValid = false;
4319
4048
  try {
4320
- fileHandle = await openSourceFile(path2, constants2.O_RDONLY | constants2.O_NONBLOCK);
4049
+ fileHandle = await openSourceFile(path, constants2.O_RDONLY | constants2.O_NONBLOCK);
4321
4050
  const fileStat = await fileHandle.stat();
4322
4051
  if (!fileStat.isFile())
4323
4052
  return;
4324
4053
  if (fileStat.size > MAX_CONTEXTLINES_FILE_SIZE)
4325
- return void logger2?.debug(`Skipping source context for oversized file ${path2}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
4054
+ return void logger?.debug(`Skipping source context for oversized file ${path}: ${fileStat.size} bytes exceeds ${MAX_CONTEXTLINES_FILE_SIZE}`);
4326
4055
  isValid = true;
4327
4056
  return fileHandle;
4328
4057
  } catch {
@@ -4332,19 +4061,19 @@ async function openRegularSourceFile(path2, openSourceFile, logger2) {
4332
4061
  await fileHandle.close().catch(() => {});
4333
4062
  }
4334
4063
  }
4335
- async function getContextLinesFromFile(path2, ranges, output, cacheKey, openSourceFile, logger2) {
4336
- const fileHandle = await openRegularSourceFile(path2, openSourceFile, logger2);
4064
+ async function getContextLinesFromFile(path, ranges, output, cacheKey, openSourceFile, logger) {
4065
+ const fileHandle = await openRegularSourceFile(path, openSourceFile, logger);
4337
4066
  if (fileHandle === undefined)
4338
4067
  return void LRU_FILE_CONTENTS_FS_READ_FAILED.set(cacheKey, 1);
4339
4068
  const openedFileHandle = fileHandle;
4340
- return new Promise((resolve9) => {
4069
+ return new Promise((resolve) => {
4341
4070
  let finished = false;
4342
- function destroyStreamAndResolve(stream2) {
4071
+ function destroyStreamAndResolve(stream) {
4343
4072
  if (finished)
4344
4073
  return;
4345
4074
  finished = true;
4346
- stream2?.destroy();
4347
- openedFileHandle.close().then(resolve9, resolve9);
4075
+ stream?.destroy();
4076
+ openedFileHandle.close().then(resolve, resolve);
4348
4077
  }
4349
4078
  let stream;
4350
4079
  try {
@@ -4396,14 +4125,14 @@ async function getContextLinesFromFile(path2, ranges, output, cacheKey, openSour
4396
4125
  return;
4397
4126
  }
4398
4127
  currentRangeIndex++;
4399
- const range2 = ranges[currentRangeIndex];
4400
- if (range2 === undefined) {
4128
+ const range = ranges[currentRangeIndex];
4129
+ if (range === undefined) {
4401
4130
  lineReaded.close();
4402
4131
  lineReaded.removeAllListeners();
4403
4132
  return;
4404
4133
  }
4405
- rangeStart = range2[0];
4406
- rangeEnd = range2[1];
4134
+ rangeStart = range[0];
4135
+ rangeEnd = range[1];
4407
4136
  }
4408
4137
  });
4409
4138
  });
@@ -4445,8 +4174,8 @@ function clearLineContext(frame) {
4445
4174
  delete frame.context_line;
4446
4175
  delete frame.post_context;
4447
4176
  }
4448
- function shouldSkipContextLinesForFile(path2) {
4449
- return path2.startsWith("node:") || path2.endsWith(".min.js") || path2.endsWith(".min.cjs") || path2.endsWith(".min.mjs") || path2.startsWith("data:");
4177
+ function shouldSkipContextLinesForFile(path) {
4178
+ return path.startsWith("node:") || path.endsWith(".min.js") || path.endsWith(".min.cjs") || path.endsWith(".min.mjs") || path.startsWith("data:");
4450
4179
  }
4451
4180
  function shouldSkipContextLinesForFrame(frame) {
4452
4181
  if (frame.lineno !== undefined && frame.lineno > MAX_CONTEXTLINES_LINENO)
@@ -4455,15 +4184,15 @@ function shouldSkipContextLinesForFrame(frame) {
4455
4184
  return true;
4456
4185
  return false;
4457
4186
  }
4458
- function makeSourceCacheKey(path2, basePath) {
4459
- if (isAbsolute7(path2))
4187
+ function makeSourceCacheKey(path, basePath) {
4188
+ if (isAbsolute7(path))
4460
4189
  return JSON.stringify([
4461
4190
  null,
4462
- path2
4191
+ path
4463
4192
  ]);
4464
4193
  return basePath === undefined ? undefined : JSON.stringify([
4465
4194
  basePath,
4466
- path2
4195
+ path
4467
4196
  ]);
4468
4197
  }
4469
4198
  function rangeExistsInContentCache(cacheKey, range) {
@@ -4547,8 +4276,8 @@ function snipLine(line, colno) {
4547
4276
  var LRU_FILE_CONTENTS_CACHE, LRU_FILE_CONTENTS_FS_READ_FAILED, DEFAULT_LINES_OF_CONTEXT = 7, MAX_CONTEXTLINES_COLNO = 1000, MAX_CONTEXTLINES_LINENO = 1e4, MAX_CONTEXTLINES_FILE_SIZE = 10485760;
4548
4277
  var init_context_lines_node = __esm(() => {
4549
4278
  init_dist();
4550
- LRU_FILE_CONTENTS_CACHE = new exports_error_tracking.ReduceableCache(25);
4551
- LRU_FILE_CONTENTS_FS_READ_FAILED = new exports_error_tracking.ReduceableCache(20);
4279
+ LRU_FILE_CONTENTS_CACHE = new ReduceableCache(25);
4280
+ LRU_FILE_CONTENTS_FS_READ_FAILED = new ReduceableCache(20);
4552
4281
  });
4553
4282
 
4554
4283
  // node_modules/.bun/posthog-node@5.51.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/relative-path.node.mjs
@@ -5291,21 +5020,21 @@ function matchProperty(property, propertyValues, warnFunction) {
5291
5020
  warnFunction(`Property ${key} cannot have a value of null/undefined with the ${operator} operator`);
5292
5021
  return false;
5293
5022
  }
5294
- function computeExactMatch(value2, overrideValue2) {
5295
- if (Array.isArray(value2))
5296
- return value2.map((val) => String(val).toLowerCase()).includes(String(overrideValue2).toLowerCase());
5297
- return String(value2).toLowerCase() === String(overrideValue2).toLowerCase();
5023
+ function computeExactMatch(value, overrideValue) {
5024
+ if (Array.isArray(value))
5025
+ return value.map((val) => String(val).toLowerCase()).includes(String(overrideValue).toLowerCase());
5026
+ return String(value).toLowerCase() === String(overrideValue).toLowerCase();
5298
5027
  }
5299
- function compare(lhs, rhs, operator2) {
5300
- if (operator2 === "gt")
5028
+ function compare(lhs, rhs, operator) {
5029
+ if (operator === "gt")
5301
5030
  return lhs > rhs;
5302
- if (operator2 === "gte")
5031
+ if (operator === "gte")
5303
5032
  return lhs >= rhs;
5304
- if (operator2 === "lt")
5033
+ if (operator === "lt")
5305
5034
  return lhs < rhs;
5306
- if (operator2 === "lte")
5035
+ if (operator === "lte")
5307
5036
  return lhs <= rhs;
5308
- throw new Error(`Invalid operator: ${operator2}`);
5037
+ throw new Error(`Invalid operator: ${operator}`);
5309
5038
  }
5310
5039
  switch (operator) {
5311
5040
  case "exact":
@@ -5805,7 +5534,7 @@ class error_tracking_ErrorTracking {
5805
5534
  };
5806
5535
  const exceptionProperties = builder.buildFromUnknown(error, hint);
5807
5536
  exceptionProperties.$exception_list = await builder.modifyFrames(exceptionProperties.$exception_list);
5808
- const injectedReleaseId = exports_error_tracking.getInjectedReleaseId();
5537
+ const injectedReleaseId = getInjectedReleaseId();
5809
5538
  if (injectedReleaseId)
5810
5539
  properties.$release_id = injectedReleaseId;
5811
5540
  return {
@@ -5930,10 +5659,10 @@ function isRecord3(value) {
5930
5659
  }
5931
5660
  function toRfc3339(timestamp) {
5932
5661
  if (typeof timestamp == "string") {
5933
- const asDate2 = new Date(timestamp);
5934
- if (Number.isNaN(asDate2.getTime()))
5662
+ const asDate = new Date(timestamp);
5663
+ if (Number.isNaN(asDate.getTime()))
5935
5664
  return new Date().toISOString();
5936
- const normalized = asDate2.toISOString();
5665
+ const normalized = asDate.toISOString();
5937
5666
  const fractionalSeconds = timestamp.match(/\.(\d+)(?:Z|[+-]\d{2}:?\d{2})?$/i)?.[1];
5938
5667
  return fractionalSeconds && fractionalSeconds.length > 3 ? normalized.replace(/\.\d{3}Z$/, `.${fractionalSeconds}Z`) : normalized;
5939
5668
  }
@@ -6034,7 +5763,7 @@ class V1CaptureSender {
6034
5763
  this.fetchFn = hooks.fetch;
6035
5764
  this.onError = hooks.onError;
6036
5765
  this.now = hooks.now ?? Date.now;
6037
- this.sleep = hooks.sleep ?? ((ms) => new Promise((resolve9) => safeSetTimeout(resolve9, ms)));
5766
+ this.sleep = hooks.sleep ?? ((ms) => new Promise((resolve) => safeSetTimeout(resolve, ms)));
6038
5767
  this.generateRequestId = hooks.generateRequestId ?? uuidv7;
6039
5768
  this.compress = hooks.compress ?? gzipCompress;
6040
5769
  }
@@ -6448,9 +6177,9 @@ var init_client = __esm(() => {
6448
6177
  if (this.disabled || this.optedOut)
6449
6178
  return;
6450
6179
  if (!this._waitUntilCycle) {
6451
- let resolve9;
6180
+ let resolve;
6452
6181
  const promise = new Promise((r) => {
6453
- resolve9 = r;
6182
+ resolve = r;
6454
6183
  });
6455
6184
  try {
6456
6185
  waitUntil(promise);
@@ -6458,7 +6187,7 @@ var init_client = __esm(() => {
6458
6187
  return;
6459
6188
  }
6460
6189
  this._waitUntilCycle = {
6461
- resolve: resolve9,
6190
+ resolve,
6462
6191
  startedAt: Date.now(),
6463
6192
  timer: undefined
6464
6193
  };
@@ -6484,11 +6213,11 @@ var init_client = __esm(() => {
6484
6213
  return cycle?.resolve;
6485
6214
  }
6486
6215
  async resolveWaitUntilFlush() {
6487
- const resolve9 = this._consumeWaitUntilCycle();
6216
+ const resolve = this._consumeWaitUntilCycle();
6488
6217
  try {
6489
6218
  await this.flushWithPendingPromises();
6490
6219
  } catch {} finally {
6491
- resolve9?.();
6220
+ resolve?.();
6492
6221
  }
6493
6222
  }
6494
6223
  getPersistedProperty(key) {
@@ -6767,15 +6496,15 @@ var init_client = __esm(() => {
6767
6496
  return true;
6768
6497
  if (this.featureFlagsPoller === undefined)
6769
6498
  return false;
6770
- return new Promise((resolve9) => {
6499
+ return new Promise((resolve) => {
6771
6500
  const timeout = setTimeout(() => {
6772
6501
  cleanup();
6773
- resolve9(false);
6502
+ resolve(false);
6774
6503
  }, timeoutMs);
6775
6504
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count) => {
6776
6505
  clearTimeout(timeout);
6777
6506
  cleanup();
6778
- resolve9(count > 0);
6507
+ resolve(count > 0);
6779
6508
  });
6780
6509
  });
6781
6510
  }
@@ -7325,7 +7054,7 @@ var init_client = __esm(() => {
7325
7054
  }
7326
7055
  async _shutdown(shutdownTimeoutMs) {
7327
7056
  const shutdownDeadlineMs = Date.now() + (shutdownTimeoutMs ?? 30000);
7328
- const resolve9 = this._consumeWaitUntilCycle();
7057
+ const resolve = this._consumeWaitUntilCycle();
7329
7058
  await this.featureFlagsPoller?.stopPoller(shutdownTimeoutMs);
7330
7059
  this.errorTracking.shutdown();
7331
7060
  if (this._metrics) {
@@ -7336,7 +7065,7 @@ var init_client = __esm(() => {
7336
7065
  return await super._shutdown(Math.max(0, shutdownDeadlineMs - Date.now()));
7337
7066
  } finally {
7338
7067
  this.distinctIdHasSentFlagCalls = {};
7339
- resolve9?.();
7068
+ resolve?.();
7340
7069
  }
7341
7070
  }
7342
7071
  async _requestRemoteConfigPayload(flagKey) {
@@ -7674,7 +7403,7 @@ function createEventProcessor(_posthog, { organization, projectId, prefix, sever
7674
7403
  $sentry_exception_type: exceptions[0]?.type,
7675
7404
  $sentry_tags: event.tags
7676
7405
  };
7677
- const injectedReleaseId = exports_error_tracking.getInjectedReleaseId();
7406
+ const injectedReleaseId = getInjectedReleaseId();
7678
7407
  if (injectedReleaseId)
7679
7408
  properties.$release_id = injectedReleaseId;
7680
7409
  if (organization && projectId)
@@ -7756,13 +7485,13 @@ var init_index_node = __esm(() => {
7756
7485
  return new PostHogContext;
7757
7486
  }
7758
7487
  createErrorPropertiesBuilder() {
7759
- return new exports_error_tracking.ErrorPropertiesBuilder([
7760
- new exports_error_tracking.EventCoercer,
7761
- new exports_error_tracking.ErrorCoercer,
7762
- new exports_error_tracking.ObjectCoercer,
7763
- new exports_error_tracking.StringCoercer,
7764
- new exports_error_tracking.PrimitiveCoercer
7765
- ], exports_error_tracking.createStackParser("node:javascript", exports_error_tracking.nodeStackLineParser), [
7488
+ return new ErrorPropertiesBuilder([
7489
+ new EventCoercer,
7490
+ new ErrorCoercer,
7491
+ new ObjectCoercer,
7492
+ new StringCoercer,
7493
+ new PrimitiveCoercer
7494
+ ], createStackParser("node:javascript", nodeStackLineParser), [
7766
7495
  createModulerModifier(),
7767
7496
  (frames) => addSourceContext(frames, undefined, this._logger),
7768
7497
  createRelativePathModifier()
@@ -7977,7 +7706,7 @@ var package_default;
7977
7706
  var init_package = __esm(() => {
7978
7707
  package_default = {
7979
7708
  name: "@oh-my-opencode/omo-codex",
7980
- version: "5.0.0-beta.49",
7709
+ version: "5.0.0-beta.50",
7981
7710
  type: "module",
7982
7711
  private: true,
7983
7712
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -8012,7 +7741,7 @@ var init_package = __esm(() => {
8012
7741
  "@oh-my-opencode/utils": "workspace:*"
8013
7742
  },
8014
7743
  devDependencies: {
8015
- "bun-types": "1.4.0"
7744
+ "bun-types": "1.4.2"
8016
7745
  }
8017
7746
  };
8018
7747
  });
@@ -8143,27 +7872,9 @@ function createPostHogClient(source, options = {}) {
8143
7872
  function getPostHogDistinctId() {
8144
7873
  return getTelemetryDistinctId(MACHINE_ID_PREFIX, resolveOsProvider());
8145
7874
  }
8146
- function createCliPostHog() {
8147
- return createPostHogClient("cli");
8148
- }
8149
7875
  function createInstallPostHog() {
8150
7876
  return createPostHogClient("install");
8151
7877
  }
8152
- function createPluginPostHog() {
8153
- return createPostHogClient("plugin");
8154
- }
8155
- function __setOsProviderForTesting(provider) {
8156
- osProviderOverride2 = provider;
8157
- }
8158
- function __resetOsProviderForTesting() {
8159
- osProviderOverride2 = null;
8160
- }
8161
- function __setActivityStateProviderForTesting(provider) {
8162
- activityStateProviderOverride = provider;
8163
- }
8164
- function __resetActivityStateProviderForTesting() {
8165
- activityStateProviderOverride = null;
8166
- }
8167
7878
  var osProviderOverride2 = null, activityStateProviderOverride = null, transportFactoryOverride = null, NO_OP_POSTHOG;
8168
7879
  var init_posthog = __esm(() => {
8169
7880
  init_src();
@@ -8181,17 +7892,6 @@ var init_posthog = __esm(() => {
8181
7892
  });
8182
7893
 
8183
7894
  // packages/omo-codex/src/telemetry/index.ts
8184
- var exports_telemetry = {};
8185
- __export(exports_telemetry, {
8186
- __resetActivityStateProviderForTesting: () => __resetActivityStateProviderForTesting,
8187
- __resetOsProviderForTesting: () => __resetOsProviderForTesting,
8188
- __setActivityStateProviderForTesting: () => __setActivityStateProviderForTesting,
8189
- __setOsProviderForTesting: () => __setOsProviderForTesting,
8190
- createCliPostHog: () => createCliPostHog,
8191
- createInstallPostHog: () => createInstallPostHog,
8192
- createPluginPostHog: () => createPluginPostHog,
8193
- getPostHogDistinctId: () => getPostHogDistinctId
8194
- });
8195
7895
  var init_telemetry = __esm(() => {
8196
7896
  init_posthog();
8197
7897
  });
@@ -8646,16 +8346,16 @@ async function removeLegacyCodexComponentBins(binDir, platform) {
8646
8346
  }
8647
8347
  async function removeLegacyCodexComponentBin(linkPath, component, platform) {
8648
8348
  try {
8649
- const stat2 = await lstat3(linkPath);
8349
+ const stat = await lstat3(linkPath);
8650
8350
  if (platform !== "win32") {
8651
- if (!stat2.isSymbolicLink())
8351
+ if (!stat.isSymbolicLink())
8652
8352
  return;
8653
8353
  const target = await readlink2(linkPath);
8654
8354
  if (isManagedLegacyComponentTarget(target, component))
8655
8355
  await rm2(linkPath, { force: true });
8656
8356
  return;
8657
8357
  }
8658
- if (!stat2.isFile())
8358
+ if (!stat.isFile())
8659
8359
  return;
8660
8360
  const content = await readFile2(linkPath, "utf8");
8661
8361
  if (content.includes(COMMAND_SHIM_MARKER))
@@ -8832,10 +8532,10 @@ async function linkRootRuntimeBin(input) {
8832
8532
  const nodeCliPath = join4(input.repoRoot, "dist", "cli-node", "index.js");
8833
8533
  await mkdir(input.binDir, { recursive: true });
8834
8534
  if (platform === "win32") {
8835
- const linkPath2 = join4(input.binDir, `${binName}.cmd`);
8836
- await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(binName, cliPath, input.codexHome, input.binDir, nodeCliPath));
8535
+ const linkPath = join4(input.binDir, `${binName}.cmd`);
8536
+ await replaceRuntimeWrapper(linkPath, windowsRuntimeWrapper(binName, cliPath, input.codexHome, input.binDir, nodeCliPath));
8837
8537
  await removeGeneratedRuntimeWrapper(legacyPath);
8838
- return { name: binName, path: linkPath2, target: cliPath };
8538
+ return { name: binName, path: linkPath, target: cliPath };
8839
8539
  }
8840
8540
  const linkPath = join4(input.binDir, binName);
8841
8541
  await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(binName, cliPath, input.codexHome, input.binDir, nodeCliPath));
@@ -8845,9 +8545,9 @@ async function linkRootRuntimeBin(input) {
8845
8545
  }
8846
8546
  async function linkCachedPluginBin(binDir, link, platform) {
8847
8547
  if (platform === "win32") {
8848
- const linkPath2 = join4(binDir, `${link.name}.cmd`);
8849
- await replaceCommandShim(linkPath2, link.target);
8850
- return linkPath2;
8548
+ const linkPath = join4(binDir, `${link.name}.cmd`);
8549
+ await replaceCommandShim(linkPath, link.target);
8550
+ return linkPath;
8851
8551
  }
8852
8552
  const linkPath = join4(binDir, link.name);
8853
8553
  await replaceSymlink(linkPath, link.target);
@@ -8979,10 +8679,10 @@ async function readGeneratedWrapperContent(path) {
8979
8679
  }
8980
8680
  async function existingNonRuntimeWrapper(path) {
8981
8681
  try {
8982
- const stat3 = await lstat4(path);
8983
- if (stat3.isSymbolicLink())
8682
+ const stat = await lstat4(path);
8683
+ if (stat.isSymbolicLink())
8984
8684
  return false;
8985
- if (!stat3.isFile())
8685
+ if (!stat.isFile())
8986
8686
  return true;
8987
8687
  const content = await readFile3(path, "utf8");
8988
8688
  return !content.includes(RUNTIME_WRAPPER_MARKER);
@@ -8994,8 +8694,8 @@ async function existingNonRuntimeWrapper(path) {
8994
8694
  }
8995
8695
  async function existingNonShim(path) {
8996
8696
  try {
8997
- const stat3 = await lstat4(path);
8998
- if (!stat3.isFile())
8697
+ const stat = await lstat4(path);
8698
+ if (!stat.isFile())
8999
8699
  return true;
9000
8700
  const content = await readFile3(path, "utf8");
9001
8701
  if (content.includes(COMMAND_SHIM_MARKER))
@@ -9009,8 +8709,8 @@ async function existingNonShim(path) {
9009
8709
  }
9010
8710
  async function existingNonSymlink(path) {
9011
8711
  try {
9012
- const stat3 = await lstat4(path);
9013
- if (!stat3.isSymbolicLink())
8712
+ const stat = await lstat4(path);
8713
+ if (!stat.isSymbolicLink())
9014
8714
  return true;
9015
8715
  await readlink3(path);
9016
8716
  return false;
@@ -9045,22 +8745,22 @@ var BUNDLED_MCP_RUNTIMES = [
9045
8745
  ];
9046
8746
  async function copyBundledMcpRuntimeDists(input) {
9047
8747
  const sourceArgs = await readSourceMcpArgs(join5(input.sourceRoot, ".mcp.json"));
9048
- for (const runtime2 of BUNDLED_MCP_RUNTIMES) {
9049
- if (!sourceArgs.has(runtime2.sourceArg))
8748
+ for (const runtime of BUNDLED_MCP_RUNTIMES) {
8749
+ if (!sourceArgs.has(runtime.sourceArg))
9050
8750
  continue;
9051
- await copyBundledMcpRuntimeDist(input.pluginRoot, input.sourceRoot, runtime2);
8751
+ await copyBundledMcpRuntimeDist(input.pluginRoot, input.sourceRoot, runtime);
9052
8752
  }
9053
8753
  }
9054
8754
  function resolveBundledMcpRuntimeArg(pluginRoot, arg) {
9055
- const runtime2 = BUNDLED_MCP_RUNTIMES.find((candidate) => candidate.sourceArg === arg);
9056
- return runtime2 ? join5(pluginRoot, runtime2.destinationArg) : null;
8755
+ const runtime = BUNDLED_MCP_RUNTIMES.find((candidate) => candidate.sourceArg === arg);
8756
+ return runtime ? join5(pluginRoot, runtime.destinationArg) : null;
9057
8757
  }
9058
- async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot, runtime2) {
9059
- const sourcePath = resolve3(sourceRoot, runtime2.sourceDistFromPlugin);
8758
+ async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot, runtime) {
8759
+ const sourcePath = resolve3(sourceRoot, runtime.sourceDistFromPlugin);
9060
8760
  if (!await isDirectory(sourcePath)) {
9061
- throw new Error(`missing built ${runtime2.label} dist at ${sourcePath}`);
8761
+ throw new Error(`missing built ${runtime.label} dist at ${sourcePath}`);
9062
8762
  }
9063
- const destinationPath = join5(pluginRoot, runtime2.destinationDistFromPlugin);
8763
+ const destinationPath = join5(pluginRoot, runtime.destinationDistFromPlugin);
9064
8764
  await mkdir2(dirname2(destinationPath), { recursive: true });
9065
8765
  await cp(sourcePath, destinationPath, { recursive: true });
9066
8766
  }
@@ -9542,10 +9242,10 @@ async function restoreBackupDirectory(backupPath, targetPath, renameDirectory) {
9542
9242
  await renameDirectory(backupPath, targetPath);
9543
9243
  }
9544
9244
  function shouldCopyPluginPath(path, root) {
9545
- const relative4 = path === root ? "" : path.slice(root.length + sep5.length);
9546
- if (relative4 === "")
9245
+ const relative = path === root ? "" : path.slice(root.length + sep5.length);
9246
+ if (relative === "")
9547
9247
  return true;
9548
- const parts = relative4.split(sep5);
9248
+ const parts = relative.split(sep5);
9549
9249
  if (parts.some((part) => part === ".git" || part === "node_modules"))
9550
9250
  return false;
9551
9251
  return !isNestedComponentMcpManifest(parts);
@@ -9829,9 +9529,9 @@ function replaceOrInsertSetting(config, section, key, value) {
9829
9529
  offset += line.length;
9830
9530
  continue;
9831
9531
  }
9832
- const replacement2 = replaceTomlAssignmentValue(line, assignmentIndex, value);
9532
+ const replacement = replaceTomlAssignmentValue(line, assignmentIndex, value);
9833
9533
  const assignmentEnd = multilineScan.nextQuote ? findTomlMultilineValueEnd(section.text, offset + line.length, multilineScan.nextQuote) : offset + line.length;
9834
- const sectionReplacement = section.text.slice(0, offset) + replacement2 + section.text.slice(assignmentEnd);
9534
+ const sectionReplacement = section.text.slice(0, offset) + replacement + section.text.slice(assignmentEnd);
9835
9535
  return config.slice(0, section.start) + sectionReplacement + config.slice(section.end);
9836
9536
  }
9837
9537
  const replacement = insertSetting(section.text, key, value);
@@ -9893,9 +9593,9 @@ function replaceOrInsertRootDottedSetting(config, keyPath, value) {
9893
9593
  offset += line.length;
9894
9594
  continue;
9895
9595
  }
9896
- const replacement2 = replaceTomlAssignmentValue(line, assignmentIndex, value);
9596
+ const replacement = replaceTomlAssignmentValue(line, assignmentIndex, value);
9897
9597
  const assignmentEnd = multilineScan.nextQuote ? findTomlMultilineValueEnd(config, offset + line.length, multilineScan.nextQuote) : offset + line.length;
9898
- return config.slice(0, offset) + replacement2 + config.slice(assignmentEnd);
9598
+ return config.slice(0, offset) + replacement + config.slice(assignmentEnd);
9899
9599
  }
9900
9600
  const sectionStart = findFirstTableStart(config);
9901
9601
  const root = config.slice(0, sectionStart).trimEnd();
@@ -10422,15 +10122,6 @@ function delay(milliseconds) {
10422
10122
  }
10423
10123
 
10424
10124
  // packages/omo-codex/src/install/toml-setting-reader.ts
10425
- function hasTomlSetting(config, keyPath) {
10426
- const targetPath = parseTomlDottedKey(keyPath);
10427
- if (!targetPath)
10428
- return false;
10429
- return hasTomlAssignment(config, (tablePath, settingPath) => {
10430
- const fullPath = [...tablePath, ...settingPath];
10431
- return fullPath.length === targetPath.length && fullPath.every((part, index) => part === targetPath[index]);
10432
- });
10433
- }
10434
10125
  function hasTomlRootDottedKeyPrefix(config, rootKey) {
10435
10126
  return hasTomlAssignment(config, (tablePath, settingPath) => tablePath.length === 0 && settingPath.length > 1 && settingPath[0] === rootKey);
10436
10127
  }
@@ -10873,15 +10564,15 @@ import { readFile as readFile10 } from "node:fs/promises";
10873
10564
  import { join as join15 } from "node:path";
10874
10565
  var FALLBACK_CODEX_MODEL_CATALOG = {
10875
10566
  current: {
10876
- model: "gpt-5.6-sol",
10877
- modelContextWindow: 650000,
10567
+ model: "gpt-6-astra",
10568
+ modelContextWindow: 600000,
10878
10569
  modelReasoningEffort: "high",
10879
10570
  planModeReasoningEffort: "xhigh"
10880
10571
  },
10881
10572
  managedProfiles: [
10882
10573
  {
10883
10574
  model: "gpt-5.5",
10884
- modelContextWindow: 650000,
10575
+ modelContextWindow: 400000,
10885
10576
  modelReasoningEffort: "high",
10886
10577
  planModeReasoningEffort: "xhigh"
10887
10578
  },
@@ -10891,7 +10582,13 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
10891
10582
  modelReasoningEffort: "high",
10892
10583
  planModeReasoningEffort: "xhigh"
10893
10584
  },
10894
- { model: "gpt-5.5", modelContextWindow: 272000 }
10585
+ { model: "gpt-5.5", modelContextWindow: 272000 },
10586
+ {
10587
+ model: "gpt-5.6-sol",
10588
+ modelContextWindow: 650000,
10589
+ modelReasoningEffort: "high",
10590
+ planModeReasoningEffort: "xhigh"
10591
+ }
10895
10592
  ]
10896
10593
  };
10897
10594
  async function readCodexModelCatalog(codexPackageRoot) {
@@ -10982,27 +10679,18 @@ import { readFileSync } from "node:fs";
10982
10679
  import { dirname as dirname6, isAbsolute as isAbsolute6, join as join16 } from "node:path";
10983
10680
  var CODEX_AGENTS_HEADER = "agents";
10984
10681
  var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
10985
- var CODEX_MULTI_AGENT_V2_THREAD_LIMIT_KEY = `${CODEX_MULTI_AGENT_V2_HEADER}.max_concurrent_threads_per_session`;
10986
- var CODEX_SUBAGENT_THREAD_LIMIT = 1000;
10987
- var CODEX_MULTI_AGENT_V2_THREAD_LIMIT = 16;
10988
10682
  function ensureCodexMultiAgentV2Config(config, options = {}) {
10989
10683
  const featureFlag = removeFeatureFlagSetting(config, "multi_agent_v2");
10990
10684
  const v2Preferred = options.multiAgentVersion === "v2";
10991
- const modelKnown = options.multiAgentVersion != null || readRootModel(featureFlag.config) !== null;
10992
- const agentsConfig = v2Preferred ? removeAgentsMaxThreads(featureFlag.config) : modelKnown ? ensureAgentsMaxThreads(featureFlag.config) : raiseExistingAgentsMaxThreads(featureFlag.config);
10685
+ const agentsConfig = removeAgentsMaxThreads(featureFlag.config, v2Preferred);
10993
10686
  const preserveDisable = featureFlag.value === false && !v2Preferred;
10994
10687
  const featureConfig = preserveDisable ? setMultiAgentV2Disable(agentsConfig) : v2Preferred ? removeMultiAgentV2Disable(agentsConfig) : agentsConfig;
10995
- if (hasTomlSetting(featureConfig, CODEX_MULTI_AGENT_V2_THREAD_LIMIT_KEY))
10996
- return featureConfig;
10997
- const section = findTomlSection(featureConfig, CODEX_MULTI_AGENT_V2_HEADER);
10998
- if (!section) {
10999
- const enabledSetting = preserveDisable ? `enabled = false
11000
- ` : "";
11001
- return appendBlock(featureConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
11002
- ${enabledSetting}max_concurrent_threads_per_session = ${CODEX_MULTI_AGENT_V2_THREAD_LIMIT}
11003
- `);
10688
+ const withoutManagedLimit = removeManagedMultiAgentV2ThreadLimit(featureConfig);
10689
+ if (preserveDisable && !findTomlSection(withoutManagedLimit, CODEX_MULTI_AGENT_V2_HEADER)) {
10690
+ return appendBlock(withoutManagedLimit, `[${CODEX_MULTI_AGENT_V2_HEADER}]
10691
+ enabled = false`);
11004
10692
  }
11005
- return replaceOrInsertSetting(featureConfig, section, "max_concurrent_threads_per_session", CODEX_MULTI_AGENT_V2_THREAD_LIMIT.toString());
10693
+ return withoutManagedLimit;
11006
10694
  }
11007
10695
  function resolveCodexMultiAgentVersion(config, configPath) {
11008
10696
  const model = readRootModel(config);
@@ -11012,7 +10700,7 @@ function resolveCodexMultiAgentVersion(config, configPath) {
11012
10700
  const catalogVersion = readCatalogMultiAgentVersion(model, catalogPath);
11013
10701
  if (catalogVersion !== null)
11014
10702
  return catalogVersion;
11015
- return /^gpt-5\.6\b/i.test(model) ? "v2" : null;
10703
+ return /^(?:gpt-5\.6|gpt-6)\b/i.test(model) ? "v2" : null;
11016
10704
  }
11017
10705
  function resolveCatalogPath(configuredPath, configPath) {
11018
10706
  if (configuredPath === null)
@@ -11072,23 +10760,34 @@ function removeFeatureFlagSetting(config, featureName) {
11072
10760
  value: readBooleanSetting(section.text, featureName)
11073
10761
  };
11074
10762
  }
11075
- function ensureAgentsMaxThreads(config) {
11076
- const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
11077
- const section = findTomlSection(config, CODEX_AGENTS_HEADER);
11078
- if (!section) {
11079
- return appendBlock(config, `[${CODEX_AGENTS_HEADER}]
11080
- max_threads = ${maxThreadsValue}
11081
- `);
11082
- }
11083
- return replaceOrInsertSetting(config, section, "max_threads", maxThreadsValue);
11084
- }
11085
- function removeAgentsMaxThreads(config) {
10763
+ function removeAgentsMaxThreads(config, v2Preferred) {
11086
10764
  const section = findTomlSection(config, CODEX_AGENTS_HEADER);
11087
10765
  if (!section)
11088
10766
  return config;
11089
- if (!/^\s*max_threads\s*=/m.test(section.text))
10767
+ return removeMatchingCap(config, section, "max_threads", v2Preferred ? undefined : /^1000\s*(?:#.*)?$/);
10768
+ }
10769
+ function removeManagedMultiAgentV2ThreadLimit(config) {
10770
+ const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
10771
+ if (!section)
11090
10772
  return config;
11091
- return removeSetting(config, section, "max_threads");
10773
+ return removeMatchingCap(config, section, "max_concurrent_threads_per_session", /^(?:1000|16)\s*(?:#.*)?$/);
10774
+ }
10775
+ function removeMatchingCap(config, section, keyName, expectedValue) {
10776
+ let quote = null;
10777
+ let offset = section.start;
10778
+ for (const line of section.text.match(/[^\n]*\n?/g) ?? []) {
10779
+ const scan = scanTomlMultilineLine(line, quote);
10780
+ quote = scan.nextQuote;
10781
+ if (!scan.wasInside) {
10782
+ const assignment = line.indexOf("=");
10783
+ const key = assignment < 0 ? null : parseTomlDottedKey(line.slice(0, assignment).trim());
10784
+ if (key?.length === 1 && key[0] === keyName && (expectedValue === undefined || expectedValue.test(line.slice(assignment + 1).trim()))) {
10785
+ return config.slice(0, offset) + config.slice(offset + line.length);
10786
+ }
10787
+ }
10788
+ offset += line.length;
10789
+ }
10790
+ return config;
11092
10791
  }
11093
10792
  function removeMultiAgentV2Disable(config) {
11094
10793
  const section = findTomlSection(config, CODEX_MULTI_AGENT_V2_HEADER);
@@ -11104,14 +10803,6 @@ function setMultiAgentV2Disable(config) {
11104
10803
  return config;
11105
10804
  return replaceOrInsertSetting(config, section, "enabled", "false");
11106
10805
  }
11107
- function raiseExistingAgentsMaxThreads(config) {
11108
- const section = findTomlSection(config, CODEX_AGENTS_HEADER);
11109
- if (!section)
11110
- return config;
11111
- if (!/^\s*max_threads\s*=/m.test(section.text))
11112
- return config;
11113
- return replaceOrInsertSetting(config, section, "max_threads", CODEX_SUBAGENT_THREAD_LIMIT.toString());
11114
- }
11115
10806
  function readBooleanSetting(sectionText, key) {
11116
10807
  const match = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=\\s*(true|false)\\s*(?:#.*)?$`, "m").exec(sectionText);
11117
10808
  if (!match)
@@ -11294,8 +10985,8 @@ var resolveGitBashForCurrentProcess2 = (input = {}) => {
11294
10985
  return toCodexResolution(resolveGitBashForCurrentProcess(input));
11295
10986
  };
11296
10987
  async function prepareGitBashForInstall(input) {
11297
- const resolve7 = input.resolveGitBash ?? (() => resolveGitBashForCurrentProcess2({ platform: input.platform, env: input.env }));
11298
- const initialResolution = resolve7();
10988
+ const resolve = input.resolveGitBash ?? (() => resolveGitBashForCurrentProcess2({ platform: input.platform, env: input.env }));
10989
+ const initialResolution = resolve();
11299
10990
  return initialResolution;
11300
10991
  }
11301
10992
  function toCodexResolution(resolution) {
@@ -11338,6 +11029,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11338
11029
  {
11339
11030
  previous: { model: "gpt-5.6-terra", effort: "medium" },
11340
11031
  current: { model: "gpt-5.6-luna", effort: "low" }
11032
+ },
11033
+ {
11034
+ previous: { model: "gpt-5.6-luna", effort: "low" },
11035
+ current: { model: "gpt-6-astra", effort: "low" }
11341
11036
  }
11342
11037
  ]
11343
11038
  ],
@@ -11351,6 +11046,28 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11351
11046
  {
11352
11047
  previous: { model: "gpt-5.6-terra", effort: "medium" },
11353
11048
  current: { model: "gpt-5.6-luna", effort: "low" }
11049
+ },
11050
+ {
11051
+ previous: { model: "gpt-5.6-luna", effort: "low" },
11052
+ current: { model: "gpt-6-astra", effort: "low" }
11053
+ }
11054
+ ]
11055
+ ],
11056
+ [
11057
+ "metis",
11058
+ [
11059
+ {
11060
+ previous: { model: "gpt-5.6-sol", effort: "high" },
11061
+ current: { model: "gpt-6-astra", effort: "high" }
11062
+ }
11063
+ ]
11064
+ ],
11065
+ [
11066
+ "lazycodex-worker-low",
11067
+ [
11068
+ {
11069
+ previous: { model: "gpt-5.6-luna", effort: "high" },
11070
+ current: { model: "gpt-6-astra", effort: "high" }
11354
11071
  }
11355
11072
  ]
11356
11073
  ],
@@ -11364,6 +11081,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11364
11081
  {
11365
11082
  previous: { model: "gpt-5.6-sol", effort: "ultra" },
11366
11083
  current: { model: "gpt-5.6-terra", effort: "high" }
11084
+ },
11085
+ {
11086
+ previous: { model: "gpt-5.6-terra", effort: "high" },
11087
+ current: { model: "gpt-6-astra", effort: "high" }
11367
11088
  }
11368
11089
  ]
11369
11090
  ],
@@ -11377,6 +11098,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11377
11098
  {
11378
11099
  previous: { model: "gpt-5.6-sol", effort: "max" },
11379
11100
  current: { model: "gpt-5.6-sol", effort: "high" }
11101
+ },
11102
+ {
11103
+ previous: { model: "gpt-5.6-sol", effort: "high" },
11104
+ current: { model: "gpt-6-astra", effort: "high" }
11380
11105
  }
11381
11106
  ]
11382
11107
  ],
@@ -11390,6 +11115,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11390
11115
  {
11391
11116
  previous: { model: "gpt-5.6-luna", effort: "max" },
11392
11117
  current: { model: "gpt-5.6-terra", effort: "high" }
11118
+ },
11119
+ {
11120
+ previous: { model: "gpt-5.6-terra", effort: "high" },
11121
+ current: { model: "gpt-6-astra", effort: "high" }
11393
11122
  }
11394
11123
  ]
11395
11124
  ],
@@ -11399,6 +11128,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11399
11128
  {
11400
11129
  previous: { model: "gpt-5.6-sol", effort: "max" },
11401
11130
  current: { model: "gpt-5.6-sol", effort: "medium" }
11131
+ },
11132
+ {
11133
+ previous: { model: "gpt-5.6-sol", effort: "medium" },
11134
+ current: { model: "gpt-6-astra", effort: "medium" }
11402
11135
  }
11403
11136
  ]
11404
11137
  ],
@@ -11408,6 +11141,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11408
11141
  {
11409
11142
  previous: { model: "gpt-5.6-sol", effort: "xhigh" },
11410
11143
  current: { model: "gpt-5.6-terra", effort: "medium" }
11144
+ },
11145
+ {
11146
+ previous: { model: "gpt-5.6-terra", effort: "medium" },
11147
+ current: { model: "gpt-6-astra", effort: "medium" }
11411
11148
  }
11412
11149
  ]
11413
11150
  ],
@@ -11417,6 +11154,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11417
11154
  {
11418
11155
  previous: { model: "gpt-5.6-sol", effort: "xhigh" },
11419
11156
  current: { model: "gpt-5.6-terra", effort: "high" }
11157
+ },
11158
+ {
11159
+ previous: { model: "gpt-5.6-terra", effort: "high" },
11160
+ current: { model: "gpt-6-astra", effort: "high" }
11420
11161
  }
11421
11162
  ]
11422
11163
  ],
@@ -11426,6 +11167,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11426
11167
  {
11427
11168
  previous: { model: "gpt-5.6-terra", effort: "medium" },
11428
11169
  current: { model: "gpt-5.6-luna", effort: "high" }
11170
+ },
11171
+ {
11172
+ previous: { model: "gpt-5.6-luna", effort: "high" },
11173
+ current: { model: "gpt-6-astra", effort: "high" }
11429
11174
  }
11430
11175
  ]
11431
11176
  ],
@@ -11439,6 +11184,10 @@ var MANAGED_REASONING_DEFAULT_UPGRADES = new Map([
11439
11184
  {
11440
11185
  previous: { model: "gpt-5.6-sol", effort: "high" },
11441
11186
  current: { model: "gpt-5.6-sol", effort: "low" }
11187
+ },
11188
+ {
11189
+ previous: { model: "gpt-5.6-sol", effort: "low" },
11190
+ current: { model: "gpt-6-astra", effort: "low" }
11442
11191
  }
11443
11192
  ]
11444
11193
  ]
@@ -11450,9 +11199,9 @@ function resolveManagedAgentReasoning(input) {
11450
11199
  const latest = steps[steps.length - 1];
11451
11200
  if (latest === undefined)
11452
11201
  return input.preserved.effort;
11453
- if (input.bundledModel !== latest.current.model || input.bundledEffort !== latest.current.effort) {
11202
+ const bundledMatchesCurrentEffort = input.bundledEffort === latest.current.effort && steps.some((step) => input.bundledModel === step.current.model && input.bundledEffort === step.current.effort);
11203
+ if (!bundledMatchesCurrentEffort)
11454
11204
  return input.preserved.effort;
11455
- }
11456
11205
  const preservedMatchesAnyStep = steps.some((step) => input.preserved.model === step.previous.model && input.preserved.effort === step.previous.effort);
11457
11206
  return preservedMatchesAnyStep ? latest.current.effort : input.preserved.effort;
11458
11207
  }
@@ -11868,10 +11617,10 @@ function localSourcePath(source) {
11868
11617
  function validateLocalSourcePath(path) {
11869
11618
  if (!path.startsWith("./"))
11870
11619
  throw new Error("local plugin source path must start with ./");
11871
- const relative4 = path.slice(2);
11872
- if (relative4.length === 0)
11620
+ const relative = path.slice(2);
11621
+ if (relative.length === 0)
11873
11622
  throw new Error("local plugin source path must not be empty");
11874
- for (const part of relative4.split(/[\\/]/)) {
11623
+ for (const part of relative.split(/[\\/]/)) {
11875
11624
  if (part === "" || part === "." || part === "..") {
11876
11625
  throw new Error("local plugin source path must stay within the marketplace root");
11877
11626
  }
@@ -11921,10 +11670,10 @@ async function writeSnapshotPlugin(marketplaceRoot, plugin) {
11921
11670
  return { name: plugin.name, path: targetPath };
11922
11671
  }
11923
11672
  function shouldCopyMarketplaceSourcePath(path, root) {
11924
- const relative4 = path === root ? "" : path.slice(root.length + sep6.length);
11925
- if (relative4 === "")
11673
+ const relative = path === root ? "" : path.slice(root.length + sep6.length);
11674
+ if (relative === "")
11926
11675
  return true;
11927
- const parts = relative4.split(sep6);
11676
+ const parts = relative.split(sep6);
11928
11677
  return !parts.some((part) => part === ".git" || part === "node_modules");
11929
11678
  }
11930
11679
 
@@ -12305,7 +12054,7 @@ import { connect } from "node:net";
12305
12054
  import { basename as basename5 } from "node:path";
12306
12055
  var PROBE_TIMEOUT_MS = 500;
12307
12056
  async function probeLegacyJsonRpcEndpoint(endpoint, timeoutMs = PROBE_TIMEOUT_MS) {
12308
- return await new Promise((resolve8) => {
12057
+ return await new Promise((resolve) => {
12309
12058
  const socket = connect(endpoint);
12310
12059
  let settled = false;
12311
12060
  let buffer = "";
@@ -12315,7 +12064,7 @@ async function probeLegacyJsonRpcEndpoint(endpoint, timeoutMs = PROBE_TIMEOUT_MS
12315
12064
  settled = true;
12316
12065
  clearTimeout(timer);
12317
12066
  socket.destroy();
12318
- resolve8(value);
12067
+ resolve(value);
12319
12068
  };
12320
12069
  const timer = setTimeout(() => finish(false), timeoutMs);
12321
12070
  timer.unref?.();
@@ -12448,13 +12197,13 @@ function isNodeCliDaemonCommand(command) {
12448
12197
  return /\bnode(?:\.exe)?\b/i.test(command) && /\bcli\.js\b/.test(command) && /\bdaemon\b/.test(command);
12449
12198
  }
12450
12199
  async function executeForStdout(executeFileImpl, file, args) {
12451
- return await new Promise((resolve8) => {
12200
+ return await new Promise((resolve) => {
12452
12201
  executeFileImpl(file, [...args], { encoding: "utf8", maxBuffer: 1024 * 1024, timeout: 1000 }, (error, stdout) => {
12453
12202
  if (error !== null) {
12454
- resolve8(null);
12203
+ resolve(null);
12455
12204
  return;
12456
12205
  }
12457
- resolve8(stdout);
12206
+ resolve(stdout);
12458
12207
  });
12459
12208
  });
12460
12209
  }
@@ -12600,7 +12349,7 @@ async function defaultWaitForProcessExit(pid, timeoutMs) {
12600
12349
  return true;
12601
12350
  if (Date.now() >= deadline)
12602
12351
  return false;
12603
- await new Promise((resolve8) => setTimeout(resolve8, 100));
12352
+ await new Promise((resolve) => setTimeout(resolve, 100));
12604
12353
  }
12605
12354
  }
12606
12355
  function processIsRunning(pid) {
@@ -12700,12 +12449,12 @@ function defaultSpawnProcess(command, args, options) {
12700
12449
  windowsHide: true
12701
12450
  });
12702
12451
  let settled = false;
12703
- const outcome = new Promise((resolve9) => {
12452
+ const outcome = new Promise((resolve) => {
12704
12453
  const settle = (result) => {
12705
12454
  if (settled)
12706
12455
  return;
12707
12456
  settled = true;
12708
- resolve9(result);
12457
+ resolve(result);
12709
12458
  };
12710
12459
  child.once("error", (error) => {
12711
12460
  settle({ kind: "spawn-error", error, missingExecutable: isMissingExecutable(error) });
@@ -12825,9 +12574,9 @@ async function installAstGrepForCodex(options) {
12825
12574
  // packages/omo-codex/src/install/codex-install-telemetry.ts
12826
12575
  async function trackCodexInstallTelemetry() {
12827
12576
  try {
12828
- const { createInstallPostHog: createInstallPostHog2, getPostHogDistinctId: getPostHogDistinctId2 } = await Promise.resolve().then(() => (init_telemetry(), exports_telemetry));
12829
- const posthog = createInstallPostHog2();
12830
- posthog.trackActive(getPostHogDistinctId2(), "install_completed");
12577
+ await Promise.resolve().then(() => init_telemetry());
12578
+ const posthog = createInstallPostHog();
12579
+ posthog.trackActive(getPostHogDistinctId(), "install_completed");
12831
12580
  await posthog.shutdown();
12832
12581
  } catch (error) {
12833
12582
  if (error instanceof Error)
@@ -12839,22 +12588,22 @@ async function trackCodexInstallTelemetry() {
12839
12588
  // packages/omo-codex/src/install/install-codex.ts
12840
12589
  var SISYPHUS_LEGACY_CACHE_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"];
12841
12590
  async function runCodexInstaller(options = {}) {
12842
- const env2 = options.env ?? process.env;
12591
+ const env = options.env ?? process.env;
12843
12592
  const platform = options.platform ?? process.platform;
12844
- const repoRoot = resolve9(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env: env2 }));
12845
- const codexHome = resolve9(options.codexHome ?? env2.CODEX_HOME ?? join33(homedir2(), ".codex"));
12846
- const projectDirectory = resolve9(options.projectDirectory ?? env2.OMO_CODEX_PROJECT ?? process.cwd());
12847
- const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env: env2 });
12593
+ const repoRoot = resolve9(options.repoRoot ?? findRepoRoot({ importerDir: import.meta.dir, env }));
12594
+ const codexHome = resolve9(options.codexHome ?? env.CODEX_HOME ?? join33(homedir2(), ".codex"));
12595
+ const projectDirectory = resolve9(options.projectDirectory ?? env.OMO_CODEX_PROJECT ?? process.cwd());
12596
+ const binDir = resolveCodexInstallerBinDir({ binDir: options.binDir, codexHome, env });
12848
12597
  const runCommand = options.runCommand ?? defaultRunCommand;
12849
12598
  const log = options.log ?? (() => {
12850
12599
  return;
12851
12600
  });
12852
12601
  const buildSource = await shouldBuildSourcePackages(repoRoot);
12853
- const versionOverride = env2.LAZYCODEX_DEV_VERSION?.trim() || undefined;
12602
+ const versionOverride = env.LAZYCODEX_DEV_VERSION?.trim() || undefined;
12854
12603
  const gitBashResolution = await prepareGitBashForInstall({
12855
12604
  platform,
12856
- env: env2,
12857
- resolveGitBash: platform === "win32" ? options.gitBashResolver ?? (() => resolveGitBashForCurrentProcess2({ platform, env: env2 })) : undefined
12605
+ env,
12606
+ resolveGitBash: platform === "win32" ? options.gitBashResolver ?? (() => resolveGitBashForCurrentProcess2({ platform, env })) : undefined
12858
12607
  });
12859
12608
  if (!gitBashResolution.found) {
12860
12609
  throw new Error(gitBashResolution.installHint);
@@ -12873,27 +12622,27 @@ async function runCodexInstaller(options = {}) {
12873
12622
  if (manifest.name !== entry.name) {
12874
12623
  throw new Error(`plugin manifest name ${JSON.stringify(manifest.name)} does not match marketplace name ${JSON.stringify(entry.name)}`);
12875
12624
  }
12876
- const version2 = resolveLazyCodexPluginVersion({
12625
+ const version = resolveLazyCodexPluginVersion({
12877
12626
  manifestVersion: manifest.version,
12878
12627
  marketplaceName: marketplace.name,
12879
12628
  pluginName: entry.name,
12880
12629
  distributionManifest,
12881
12630
  versionOverride
12882
12631
  });
12883
- validatePathSegment(version2, "plugin version");
12884
- log(`Building ${entry.name}@${version2}`);
12632
+ validatePathSegment(version, "plugin version");
12633
+ log(`Building ${entry.name}@${version}`);
12885
12634
  const plugin = await installCachedPlugin({
12886
12635
  buildSource,
12887
12636
  codexHome,
12888
- env: env2,
12637
+ env,
12889
12638
  marketplaceName: marketplace.name,
12890
12639
  name: entry.name,
12891
12640
  runCommand,
12892
12641
  sourcePath,
12893
- version: version2
12642
+ version
12894
12643
  });
12895
12644
  if (marketplace.name === "sisyphuslabs" && plugin.name === "omo") {
12896
- await stampLazyCodexPluginVersion({ pluginRoot: plugin.path, version: version2 });
12645
+ await stampLazyCodexPluginVersion({ pluginRoot: plugin.path, version });
12897
12646
  await writeLazyCodexInstallSnapshot({ pluginRoot: plugin.path, distributionManifest });
12898
12647
  await writeInstalledCodexBinDir({ pluginRoot: plugin.path, binDir });
12899
12648
  await removeGitBashHooksOffWindows({ platform, pluginRoot: plugin.path });
@@ -13240,25 +12989,25 @@ async function runDelegatedOmoCommand(parsed, options) {
13240
12989
  options.log(formatShellCommand(invocation.command, invocation.args));
13241
12990
  return;
13242
12991
  }
13243
- const env2 = invocation.delegatesToOmo ? { ...process.env, OMO_INVOCATION_NAME: "omo-agent-toolkit", ...invocation.env } : { ...process.env, ...invocation.env };
13244
- await options.runCommand(invocation.command, invocation.args, { cwd: options.cwd, env: env2 });
12992
+ const env = invocation.delegatesToOmo ? { ...process.env, OMO_INVOCATION_NAME: "omo-agent-toolkit", ...invocation.env } : { ...process.env, ...invocation.env };
12993
+ await options.runCommand(invocation.command, invocation.args, { cwd: options.cwd, env });
13245
12994
  }
13246
12995
  function buildDelegatedOmoInvocation(parsed) {
13247
12996
  if (parsed.command === "doctor")
13248
12997
  return buildLazyCodexDoctorInvocation(parsed.args);
13249
12998
  if (parsed.command === "install") {
13250
- const args2 = ["--yes", "oh-my-openagent@latest", parsed.command, "--platform=codex"];
12999
+ const args = ["--yes", "oh-my-openagent@latest", parsed.command, "--platform=codex"];
13251
13000
  if (parsed.noTui)
13252
- args2.push("--no-tui");
13001
+ args.push("--no-tui");
13253
13002
  if (parsed.skipAuth)
13254
- args2.push("--skip-auth");
13003
+ args.push("--skip-auth");
13255
13004
  if (parsed.autonomousPermissions !== false)
13256
- args2.push("--codex-autonomous");
13005
+ args.push("--codex-autonomous");
13257
13006
  if (parsed.autonomousPermissions === false)
13258
- args2.push("--no-codex-autonomous");
13007
+ args.push("--no-codex-autonomous");
13259
13008
  if (parsed.repoRoot)
13260
- args2.push(`--repo-root=${parsed.repoRoot}`);
13261
- return { command: "npx", args: args2, delegatesToOmo: true };
13009
+ args.push(`--repo-root=${parsed.repoRoot}`);
13010
+ return { command: "npx", args, delegatesToOmo: true };
13262
13011
  }
13263
13012
  const args = ["--yes", "--package", "oh-my-openagent", "omo-agent-toolkit", parsed.command];
13264
13013
  if (parsed.command === "cleanup") {
@@ -13372,22 +13121,22 @@ import { fileURLToPath } from "node:url";
13372
13121
 
13373
13122
  // packages/omo-codex/src/install/lazycodex-bun-global-paths.ts
13374
13123
  import { join as join34 } from "node:path";
13375
- function isBunGlobalEntrypointPath(invokedPath, env2) {
13124
+ function isBunGlobalEntrypointPath(invokedPath, env) {
13376
13125
  if (typeof invokedPath !== "string" || invokedPath.trim().length === 0)
13377
13126
  return false;
13378
13127
  const normalizedPath = normalizePathForPrefix(invokedPath);
13379
- return resolveBunGlobalRoots(env2).some((root) => normalizedPath.startsWith(root));
13128
+ return resolveBunGlobalRoots(env).some((root) => normalizedPath.startsWith(root));
13380
13129
  }
13381
- function resolveBunGlobalRoots(env2) {
13382
- const bunInstallRoot = env2.BUN_INSTALL?.trim();
13383
- const homeRoot = env2.HOME?.trim();
13130
+ function resolveBunGlobalRoots(env) {
13131
+ const bunInstallRoot = env.BUN_INSTALL?.trim();
13132
+ const homeRoot = env.HOME?.trim();
13384
13133
  return [
13385
13134
  ...bunInstallRoot ? [join34(bunInstallRoot, "bin"), join34(bunInstallRoot, "install", "global", "node_modules")] : [],
13386
13135
  ...homeRoot ? [join34(homeRoot, ".bun", "bin"), join34(homeRoot, ".bun", "install", "global", "node_modules")] : []
13387
13136
  ].map(normalizePathForPrefix);
13388
13137
  }
13389
- function normalizePathForPrefix(path2) {
13390
- const normalized = path2.replaceAll("\\", "/").replace(/\/+$/, "");
13138
+ function normalizePathForPrefix(path) {
13139
+ const normalized = path.replaceAll("\\", "/").replace(/\/+$/, "");
13391
13140
  return normalized.endsWith("/node_modules") || normalized.endsWith("/bin") ? `${normalized}/` : normalized;
13392
13141
  }
13393
13142
 
@@ -13409,17 +13158,17 @@ var KNOWN_LAZYCODEX_BUN_TRUST_PACKAGES = new Set([
13409
13158
  ]);
13410
13159
  var KNOWN_LAZYCODEX_BUN_TRUST_PREFIXES = ["@oh-my-opencode/", "oh-my-openagent-", "oh-my-opencode-"];
13411
13160
  async function runLazyCodexManualUpdate(input = {}) {
13412
- const env2 = input.env ?? process.env;
13161
+ const env = input.env ?? process.env;
13413
13162
  const log = input.log ?? console.log;
13414
13163
  const commandRunner = input.runCommand ?? defaultRunCommandForManualUpdate;
13415
- const currentVersion = resolveCurrentVersion(env2);
13416
- const latestVersion = resolveLatestVersion(env2);
13164
+ const currentVersion = resolveCurrentVersion(env);
13165
+ const latestVersion = resolveLatestVersion(env);
13417
13166
  const plan = resolveLazyCodexUpdatePlan({
13418
13167
  currentVersion,
13419
13168
  latestVersion,
13420
- command: resolveCommand2(env2),
13421
- args: resolveArgs(env2),
13422
- env: env2,
13169
+ command: resolveCommand2(env),
13170
+ args: resolveArgs(env),
13171
+ env,
13423
13172
  invokedPath: input.invokedPath ?? process.argv[1]
13424
13173
  });
13425
13174
  if (!plan.shouldUpdate) {
@@ -13433,15 +13182,15 @@ async function runLazyCodexManualUpdate(input = {}) {
13433
13182
  log(`${DEFAULT_UPDATE_COMMAND} ${DEFAULT_UPDATE_ARGS.join(" ")}`);
13434
13183
  return 0;
13435
13184
  }
13436
- await commandRunner(plan.command, plan.args, { cwd: process.cwd(), env: env2 });
13185
+ await commandRunner(plan.command, plan.args, { cwd: process.cwd(), env });
13437
13186
  if (plan.postUpdate === "bun-global-trust") {
13438
13187
  await handleBunGlobalTrust({
13439
- env: env2,
13188
+ env,
13440
13189
  log,
13441
13190
  commandRunner,
13442
13191
  isInteractive: input.isInteractive ?? (process.stdin.isTTY === true && process.stdout.isTTY === true)
13443
13192
  });
13444
- await commandRunner(DEFAULT_UPDATE_COMMAND, DEFAULT_UPDATE_ARGS, { cwd: process.cwd(), env: env2 });
13193
+ await commandRunner(DEFAULT_UPDATE_COMMAND, DEFAULT_UPDATE_ARGS, { cwd: process.cwd(), env });
13445
13194
  }
13446
13195
  return 0;
13447
13196
  }
@@ -13459,12 +13208,12 @@ function resolveLazyCodexUpdatePlan(input = {}) {
13459
13208
  }
13460
13209
  return { shouldUpdate: true, command: input.command ?? DEFAULT_UPDATE_COMMAND, args: input.args ?? DEFAULT_UPDATE_ARGS, postUpdate: "none" };
13461
13210
  }
13462
- function resolveCommand2(env2) {
13463
- return env2.LAZYCODEX_AUTO_UPDATE_COMMAND?.trim() || DEFAULT_UPDATE_COMMAND;
13211
+ function resolveCommand2(env) {
13212
+ return env.LAZYCODEX_AUTO_UPDATE_COMMAND?.trim() || DEFAULT_UPDATE_COMMAND;
13464
13213
  }
13465
- function resolveArgs(env2) {
13466
- if (env2.LAZYCODEX_AUTO_UPDATE_ARGS_JSON) {
13467
- const parsed = JSON.parse(env2.LAZYCODEX_AUTO_UPDATE_ARGS_JSON);
13214
+ function resolveArgs(env) {
13215
+ if (env.LAZYCODEX_AUTO_UPDATE_ARGS_JSON) {
13216
+ const parsed = JSON.parse(env.LAZYCODEX_AUTO_UPDATE_ARGS_JSON);
13468
13217
  if (!Array.isArray(parsed) || parsed.some((value) => typeof value !== "string")) {
13469
13218
  throw new TypeError("LAZYCODEX_AUTO_UPDATE_ARGS_JSON must be a JSON string array");
13470
13219
  }
@@ -13472,23 +13221,23 @@ function resolveArgs(env2) {
13472
13221
  }
13473
13222
  return DEFAULT_UPDATE_ARGS;
13474
13223
  }
13475
- function resolveCurrentVersion(env2) {
13476
- if (env2.LAZYCODEX_CURRENT_VERSION?.trim())
13477
- return env2.LAZYCODEX_CURRENT_VERSION.trim();
13224
+ function resolveCurrentVersion(env) {
13225
+ if (env.LAZYCODEX_CURRENT_VERSION?.trim())
13226
+ return env.LAZYCODEX_CURRENT_VERSION.trim();
13478
13227
  const pluginRoot = dirname11(dirname11(fileURLToPath(import.meta.url)));
13479
- return readVersionManifest(resolveInstalledVersionPath(env2, pluginRoot)) ?? readVersionManifest(join35(pluginRoot, "..", "..", "..", "package.json")) ?? readVersionManifest(join35(pluginRoot, ".codex-plugin", "plugin.json"));
13228
+ return readVersionManifest(resolveInstalledVersionPath(env, pluginRoot)) ?? readVersionManifest(join35(pluginRoot, "..", "..", "..", "package.json")) ?? readVersionManifest(join35(pluginRoot, ".codex-plugin", "plugin.json"));
13480
13229
  }
13481
- function resolveLatestVersion(env2) {
13482
- if (env2.LAZYCODEX_LATEST_VERSION?.trim())
13483
- return env2.LAZYCODEX_LATEST_VERSION.trim();
13230
+ function resolveLatestVersion(env) {
13231
+ if (env.LAZYCODEX_LATEST_VERSION?.trim())
13232
+ return env.LAZYCODEX_LATEST_VERSION.trim();
13484
13233
  const result = spawnSync2("npm", ["view", "lazycodex-ai", "version", "--silent"], {
13485
13234
  encoding: "utf8",
13486
13235
  stdio: ["ignore", "pipe", "ignore"]
13487
13236
  });
13488
13237
  if (result.status !== 0)
13489
13238
  return;
13490
- const version2 = result.stdout.trim();
13491
- return version2.length > 0 ? version2 : undefined;
13239
+ const version = result.stdout.trim();
13240
+ return version.length > 0 ? version : undefined;
13492
13241
  }
13493
13242
  async function handleBunGlobalTrust(input) {
13494
13243
  const packageNames = resolveKnownBunGlobalUntrustedPackages(input.env);
@@ -13508,10 +13257,10 @@ ${trustCommand}`);
13508
13257
  input.log(`Skipped Bun postinstall trust. To run it later:
13509
13258
  ${trustCommand}`);
13510
13259
  }
13511
- function resolveKnownBunGlobalUntrustedPackages(env2) {
13260
+ function resolveKnownBunGlobalUntrustedPackages(env) {
13512
13261
  const result = spawnSync2(BUN_UPDATE_COMMAND, BUN_GLOBAL_UNTRUSTED_ARGS, {
13513
13262
  encoding: "utf8",
13514
- env: env2,
13263
+ env,
13515
13264
  stdio: ["ignore", "pipe", "ignore"]
13516
13265
  });
13517
13266
  if (result.status !== 0)
@@ -13538,11 +13287,11 @@ async function confirmBunGlobalTrust(packageNames) {
13538
13287
  function isKnownLazyCodexBunTrustPackage(packageName) {
13539
13288
  return KNOWN_LAZYCODEX_BUN_TRUST_PACKAGES.has(packageName) || KNOWN_LAZYCODEX_BUN_TRUST_PREFIXES.some((prefix) => packageName.startsWith(prefix));
13540
13289
  }
13541
- function isBunGlobalEntrypoint(invokedPath, env2) {
13542
- return isBunGlobalEntrypointPath(invokedPath, env2);
13290
+ function isBunGlobalEntrypoint(invokedPath, env) {
13291
+ return isBunGlobalEntrypointPath(invokedPath, env);
13543
13292
  }
13544
13293
  function defaultRunCommandForManualUpdate(command, args, options) {
13545
- return new Promise((resolve10, reject) => {
13294
+ return new Promise((resolve, reject) => {
13546
13295
  const child = spawn3(command, args, {
13547
13296
  cwd: options.cwd,
13548
13297
  env: options.env,
@@ -13552,17 +13301,17 @@ function defaultRunCommandForManualUpdate(command, args, options) {
13552
13301
  child.once("error", reject);
13553
13302
  child.once("close", (code) => {
13554
13303
  if (code === 0) {
13555
- resolve10();
13304
+ resolve();
13556
13305
  return;
13557
13306
  }
13558
13307
  reject(new Error(`${command} ${args.join(" ")} exited with ${code ?? "unknown status"}`));
13559
13308
  });
13560
13309
  });
13561
13310
  }
13562
- function parseVersion(version2) {
13563
- if (typeof version2 !== "string")
13311
+ function parseVersion(version) {
13312
+ if (typeof version !== "string")
13564
13313
  return null;
13565
- const match = /^(\d+)\.(\d+)\.(\d+)(?:-([^+]+))?(?:\+.*)?$/.exec(version2.trim());
13314
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:-([^+]+))?(?:\+.*)?$/.exec(version.trim());
13566
13315
  if (match === null)
13567
13316
  return null;
13568
13317
  const major = Number.parseInt(match[1] ?? "", 10);
@@ -13589,14 +13338,14 @@ function compareVersions(left, right) {
13589
13338
  }
13590
13339
  return 0;
13591
13340
  }
13592
- function resolveInstalledVersionPath(env2, pluginRoot) {
13593
- if (env2.LAZYCODEX_INSTALLED_VERSION_FILE?.trim())
13594
- return env2.LAZYCODEX_INSTALLED_VERSION_FILE.trim();
13341
+ function resolveInstalledVersionPath(env, pluginRoot) {
13342
+ if (env.LAZYCODEX_INSTALLED_VERSION_FILE?.trim())
13343
+ return env.LAZYCODEX_INSTALLED_VERSION_FILE.trim();
13595
13344
  return join35(pluginRoot, INSTALLED_VERSION_FILE);
13596
13345
  }
13597
- function readVersionManifest(path2) {
13346
+ function readVersionManifest(path) {
13598
13347
  try {
13599
- const parsed = JSON.parse(readFileSync4(path2, "utf8"));
13348
+ const parsed = JSON.parse(readFileSync4(path, "utf8"));
13600
13349
  if (typeof parsed === "object" && parsed !== null && "version" in parsed && typeof parsed.version === "string") {
13601
13350
  return parsed.version;
13602
13351
  }
@@ -13660,8 +13409,8 @@ async function runLazyCodexInstallLocalCli(input) {
13660
13409
  }
13661
13410
  if (parsed.kind === "version") {
13662
13411
  const packageJson = JSON.parse(await readFile23(join37(input.defaultRepoRoot, "package.json"), "utf8"));
13663
- const version2 = typeof packageJson.version === "string" ? packageJson.version : "unknown";
13664
- input.log(`lazycodex-ai ${version2}`);
13412
+ const version = typeof packageJson.version === "string" ? packageJson.version : "unknown";
13413
+ input.log(`lazycodex-ai ${version}`);
13665
13414
  return 0;
13666
13415
  }
13667
13416
  if (parsed.kind === "command") {
@@ -13674,13 +13423,13 @@ async function runLazyCodexInstallLocalCli(input) {
13674
13423
  input.log(`node ${input.entrypointPath} install --repo-root=${parsed.repoRoot}`);
13675
13424
  return 0;
13676
13425
  }
13677
- const result2 = await installMarketplaceLocally({
13426
+ const result = await installMarketplaceLocally({
13678
13427
  repoRoot: resolve10(parsed.repoRoot),
13679
13428
  autonomousPermissions: true,
13680
13429
  env: input.env,
13681
13430
  log: logWarning
13682
13431
  });
13683
- input.log(`Installed ${result2.installed.length} plugin(s) from ${result2.marketplaceName}.`);
13432
+ input.log(`Installed ${result.installed.length} plugin(s) from ${result.marketplaceName}.`);
13684
13433
  return 0;
13685
13434
  }
13686
13435
  return runLazyCodexManualUpdate({ env: input.env, dryRun: parsed.dryRun, log: input.log, invokedPath: input.invokedPath });