oh-my-opencode 5.0.0-beta.25 → 5.0.0-beta.26

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 (143) hide show
  1. package/dist/cli/index.js +266 -153
  2. package/dist/cli-node/index.js +266 -153
  3. package/dist/features/team-mode/tools/messaging-fallback-wake.d.ts +15 -0
  4. package/dist/index.js +1920 -1655
  5. package/dist/skills/debugging/SKILL.md +2 -0
  6. package/dist/skills/debugging/references/methodology/00-setup.md +12 -0
  7. package/dist/skills/debugging/references/methodology/02-investigate.md +21 -0
  8. package/dist/skills/debugging/references/runtimes/go.md +15 -1
  9. package/dist/skills/debugging/references/runtimes/native-binary.md +38 -0
  10. package/dist/skills/debugging/references/runtimes/node.md +25 -0
  11. package/dist/skills/debugging/references/runtimes/python.md +13 -0
  12. package/dist/skills/debugging/references/runtimes/rust.md +41 -0
  13. package/dist/skills/debugging/references/scripts/dap.mjs +267 -0
  14. package/dist/skills/debugging/references/scripts/dap.test.ts +86 -0
  15. package/dist/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
  16. package/dist/skills/debugging/references/tools/dap.md +103 -0
  17. package/dist/skills/debugging/references/tools/frida.md +193 -0
  18. package/dist/tools/delegate-task/types.d.ts +3 -0
  19. package/dist/tui.js +103 -12
  20. package/package.json +18 -15
  21. package/packages/lsp-core/src/index.ts +1 -0
  22. package/packages/lsp-core/src/lsp/client-wrapper.ts +25 -5
  23. package/packages/lsp-core/src/lsp/client.ts +26 -0
  24. package/packages/lsp-core/src/lsp/connection.ts +16 -0
  25. package/packages/lsp-core/src/lsp/constants.ts +1 -0
  26. package/packages/lsp-core/src/lsp/format-document.test.ts +143 -0
  27. package/packages/lsp-core/src/lsp/format-document.ts +90 -0
  28. package/packages/lsp-core/src/lsp/manager-max-clients.test.ts +151 -0
  29. package/packages/lsp-core/src/lsp/manager.ts +34 -1
  30. package/packages/lsp-core/src/lsp/server-definitions.ts +29 -0
  31. package/packages/lsp-core/src/lsp/server-installation.test.ts +376 -0
  32. package/packages/lsp-core/src/lsp/server-installation.ts +200 -27
  33. package/packages/lsp-core/src/lsp/server-resolution-local-binary.test.ts +170 -0
  34. package/packages/lsp-core/src/lsp/server-resolution.ts +18 -5
  35. package/packages/lsp-core/src/lsp/transport.ts +9 -0
  36. package/packages/lsp-core/src/lsp/types.ts +8 -0
  37. package/packages/lsp-core/src/tool-surface.test.ts +13 -1
  38. package/packages/lsp-core/src/tools/definitions.ts +14 -0
  39. package/packages/lsp-core/src/tools/format.test.ts +56 -0
  40. package/packages/lsp-core/src/tools/format.ts +56 -0
  41. package/packages/lsp-core/src/tools/index.ts +1 -0
  42. package/packages/lsp-core/src/tools/types.ts +10 -0
  43. package/packages/lsp-daemon/dist/cli.js +432 -144
  44. package/packages/lsp-daemon/dist/client.d.ts +10 -0
  45. package/packages/lsp-daemon/dist/client.js +401 -107
  46. package/packages/lsp-daemon/dist/daemon-client.d.ts +1 -0
  47. package/packages/lsp-daemon/dist/daemon-client.js +3 -0
  48. package/packages/lsp-daemon/dist/index.js +395 -107
  49. package/packages/lsp-tools-mcp/dist/cli.js +384 -99
  50. package/packages/lsp-tools-mcp/dist/lsp/manager.js +53 -0
  51. package/packages/lsp-tools-mcp/dist/mcp.js +384 -99
  52. package/packages/lsp-tools-mcp/dist/tools.js +385 -99
  53. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  54. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +2 -2
  55. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  56. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  57. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +69 -35
  58. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +21 -2
  59. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  60. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  61. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  62. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  63. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  64. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  65. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  66. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  67. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +404 -121
  68. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  69. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  70. package/packages/omo-codex/plugin/components/rules/dist/cli.js +3 -3
  71. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  72. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  73. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +3 -3
  74. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +4 -4
  75. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  76. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  77. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +30 -15
  78. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +30 -15
  79. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  80. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  81. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  82. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  83. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +2 -2
  84. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  85. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  86. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  92. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  93. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  94. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  95. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  96. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  97. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  98. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  99. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  100. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  101. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  102. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  103. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  104. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  105. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +1 -1
  106. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  107. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  108. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  109. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  110. package/packages/omo-codex/plugin/model-catalog.json +3 -3
  111. package/packages/omo-codex/plugin/package-lock.json +13 -13
  112. package/packages/omo-codex/plugin/package.json +1 -1
  113. package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +3 -3
  114. package/packages/omo-codex/plugin/skills/debugging/SKILL.md +2 -0
  115. package/packages/omo-codex/plugin/skills/debugging/references/methodology/00-setup.md +12 -0
  116. package/packages/omo-codex/plugin/skills/debugging/references/methodology/02-investigate.md +21 -0
  117. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/go.md +15 -1
  118. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/native-binary.md +38 -0
  119. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/node.md +25 -0
  120. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/python.md +13 -0
  121. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/rust.md +41 -0
  122. package/packages/omo-codex/plugin/skills/debugging/references/scripts/dap.mjs +267 -0
  123. package/packages/omo-codex/plugin/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
  124. package/packages/omo-codex/plugin/skills/debugging/references/tools/dap.md +103 -0
  125. package/packages/omo-codex/plugin/skills/debugging/references/tools/frida.md +193 -0
  126. package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +1 -1
  127. package/packages/omo-codex/plugin/test/auto-update.test.mjs +2 -2
  128. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +8 -8
  129. package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +2 -2
  130. package/packages/omo-codex/scripts/install-dist/install-local.mjs +38 -23
  131. package/packages/shared-skills/skills/debugging/SKILL.md +2 -0
  132. package/packages/shared-skills/skills/debugging/references/methodology/00-setup.md +12 -0
  133. package/packages/shared-skills/skills/debugging/references/methodology/02-investigate.md +21 -0
  134. package/packages/shared-skills/skills/debugging/references/runtimes/go.md +15 -1
  135. package/packages/shared-skills/skills/debugging/references/runtimes/native-binary.md +38 -0
  136. package/packages/shared-skills/skills/debugging/references/runtimes/node.md +25 -0
  137. package/packages/shared-skills/skills/debugging/references/runtimes/python.md +13 -0
  138. package/packages/shared-skills/skills/debugging/references/runtimes/rust.md +41 -0
  139. package/packages/shared-skills/skills/debugging/references/scripts/dap.mjs +267 -0
  140. package/packages/shared-skills/skills/debugging/references/scripts/dap.test.ts +86 -0
  141. package/packages/shared-skills/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
  142. package/packages/shared-skills/skills/debugging/references/tools/dap.md +103 -0
  143. package/packages/shared-skills/skills/debugging/references/tools/frida.md +193 -0
package/dist/cli/index.js CHANGED
@@ -54,7 +54,7 @@ var package_default;
54
54
  var init_package = __esm(() => {
55
55
  package_default = {
56
56
  name: "oh-my-opencode",
57
- version: "5.0.0-beta.25",
57
+ version: "5.0.0-beta.26",
58
58
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
59
59
  main: "./dist/index.js",
60
60
  types: "dist/index.d.ts",
@@ -235,7 +235,7 @@ var init_package = __esm(() => {
235
235
  zod: "^4.4.3"
236
236
  },
237
237
  devDependencies: {
238
- "@code-yeongyu/senpi": "2026.8.26-2",
238
+ "@code-yeongyu/senpi": "2026.8.28-2",
239
239
  "@oh-my-opencode/agents-md-core": "workspace:*",
240
240
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
241
241
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -276,18 +276,18 @@ var init_package = __esm(() => {
276
276
  typescript: "^7.0.2"
277
277
  },
278
278
  optionalDependencies: {
279
- "oh-my-opencode-darwin-arm64": "5.0.0-beta.25",
280
- "oh-my-opencode-darwin-x64": "5.0.0-beta.25",
281
- "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.25",
282
- "oh-my-opencode-linux-arm64": "5.0.0-beta.25",
283
- "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.25",
284
- "oh-my-opencode-linux-x64": "5.0.0-beta.25",
285
- "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.25",
286
- "oh-my-opencode-linux-x64-musl": "5.0.0-beta.25",
287
- "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.25",
288
- "oh-my-opencode-windows-arm64": "5.0.0-beta.25",
289
- "oh-my-opencode-windows-x64": "5.0.0-beta.25",
290
- "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.25"
279
+ "oh-my-opencode-darwin-arm64": "5.0.0-beta.26",
280
+ "oh-my-opencode-darwin-x64": "5.0.0-beta.26",
281
+ "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.26",
282
+ "oh-my-opencode-linux-arm64": "5.0.0-beta.26",
283
+ "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.26",
284
+ "oh-my-opencode-linux-x64": "5.0.0-beta.26",
285
+ "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.26",
286
+ "oh-my-opencode-linux-x64-musl": "5.0.0-beta.26",
287
+ "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.26",
288
+ "oh-my-opencode-windows-arm64": "5.0.0-beta.26",
289
+ "oh-my-opencode-windows-x64": "5.0.0-beta.26",
290
+ "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.26"
291
291
  },
292
292
  overrides: {
293
293
  "@earendil-works/pi-agent-core": "0.84.2",
@@ -303,7 +303,10 @@ var init_package = __esm(() => {
303
303
  },
304
304
  trustedDependencies: [
305
305
  "@code-yeongyu/comment-checker"
306
- ]
306
+ ],
307
+ patchedDependencies: {
308
+ "@code-yeongyu/senpi@2026.8.28-2": "patches/@code-yeongyu%2Fsenpi@2026.8.28-2.patch"
309
+ }
307
310
  };
308
311
  });
309
312
 
@@ -4813,9 +4816,12 @@ import {
4813
4816
  fsyncSync,
4814
4817
  openSync,
4815
4818
  renameSync,
4819
+ rmSync,
4816
4820
  unlinkSync,
4817
4821
  writeFileSync
4818
4822
  } from "fs";
4823
+ import { randomUUID } from "crypto";
4824
+ import { dirname } from "path";
4819
4825
  function isToleratedFsyncError(error) {
4820
4826
  if (!(error instanceof Error))
4821
4827
  return false;
@@ -4831,24 +4837,36 @@ function tolerantFsyncSync(fileDescriptor, fsyncImpl) {
4831
4837
  }
4832
4838
  }
4833
4839
  function writeFileAtomically(filePath, content, options = {}) {
4834
- const tempPath = `${filePath}.tmp`;
4835
- writeFileSync(tempPath, content, "utf-8");
4836
- const tempFileDescriptor = openSync(tempPath, "r+");
4837
- try {
4838
- tolerantFsyncSync(tempFileDescriptor, options.fsyncSync ?? fsyncSync);
4839
- } finally {
4840
- closeSync(tempFileDescriptor);
4841
- }
4840
+ const platform = options.platform ?? process.platform;
4841
+ const fsyncImpl = options.fsyncSync ?? fsyncSync;
4842
+ const tempPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
4842
4843
  try {
4843
- renameSync(tempPath, filePath);
4844
- } catch (error) {
4845
- const isPermissionError = error instanceof Error && (error.message.includes("EPERM") || error.message.includes("EACCES"));
4846
- if ((options.platform ?? process.platform) === "win32" && isPermissionError) {
4844
+ writeFileSync(tempPath, content, "utf-8");
4845
+ const tempFileDescriptor = openSync(tempPath, "r+");
4846
+ try {
4847
+ tolerantFsyncSync(tempFileDescriptor, fsyncImpl);
4848
+ } finally {
4849
+ closeSync(tempFileDescriptor);
4850
+ }
4851
+ try {
4852
+ renameSync(tempPath, filePath);
4853
+ } catch (error) {
4854
+ const isPermissionError = error instanceof Error && (error.message.includes("EPERM") || error.message.includes("EACCES"));
4855
+ if (platform !== "win32" || !isPermissionError)
4856
+ throw error;
4847
4857
  unlinkSync(filePath);
4848
4858
  renameSync(tempPath, filePath);
4859
+ }
4860
+ if (platform === "win32")
4849
4861
  return;
4862
+ const directoryFileDescriptor = openSync(dirname(filePath), "r");
4863
+ try {
4864
+ tolerantFsyncSync(directoryFileDescriptor, fsyncImpl);
4865
+ } finally {
4866
+ closeSync(directoryFileDescriptor);
4850
4867
  }
4851
- throw error;
4868
+ } finally {
4869
+ rmSync(tempPath, { force: true });
4852
4870
  }
4853
4871
  }
4854
4872
  var TOLERATED_FSYNC_CODES;
@@ -20554,6 +20572,25 @@ var init_telemetry = __esm(() => {
20554
20572
  }).strict();
20555
20573
  });
20556
20574
 
20575
+ // packages/omo-config-core/src/schema/format-on-mutation.ts
20576
+ var mode, languages, OmoFormatOnMutationLayerSchema, OmoFormatOnMutationSchema;
20577
+ var init_format_on_mutation = __esm(() => {
20578
+ init_zod();
20579
+ mode = _enum2(["off", "best-effort", "required"]);
20580
+ languages = record(string2(), boolean2()).optional();
20581
+ OmoFormatOnMutationLayerSchema = object({
20582
+ mode: mode.optional(),
20583
+ languages,
20584
+ maxFileBytes: number2().int().positive().optional(),
20585
+ timeoutMs: number2().int().positive().optional()
20586
+ }).strict();
20587
+ OmoFormatOnMutationSchema = OmoFormatOnMutationLayerSchema.extend({
20588
+ mode: mode.default("best-effort"),
20589
+ maxFileBytes: number2().int().positive().default(1048576),
20590
+ timeoutMs: number2().int().positive().default(3000)
20591
+ }).strict();
20592
+ });
20593
+
20557
20594
  // packages/omo-config-core/src/schema/config.ts
20558
20595
  var OmoOpenCodeHarnessConfigSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
20559
20596
  var init_config = __esm(() => {
@@ -20567,8 +20604,10 @@ var init_config = __esm(() => {
20567
20604
  init_task();
20568
20605
  init_team();
20569
20606
  init_telemetry();
20607
+ init_format_on_mutation();
20570
20608
  OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
20571
20609
  OmoTypedHarnessConfigSchema = object({
20610
+ formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
20572
20611
  categories: OmoCategoriesConfigSchema.optional(),
20573
20612
  agents: OmoAgentsConfigSchema.optional(),
20574
20613
  codegraph: OmoCodegraphSettingsLayerSchema.optional(),
@@ -20580,6 +20619,7 @@ var init_config = __esm(() => {
20580
20619
  telemetry: OmoTelemetrySettingsLayerSchema.optional()
20581
20620
  }).strict();
20582
20621
  OmoConfigProfileSchema = object({
20622
+ formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
20583
20623
  categories: OmoCategoriesConfigSchema.optional(),
20584
20624
  agents: OmoAgentsConfigSchema.optional(),
20585
20625
  codegraph: OmoCodegraphSettingsLayerSchema.optional(),
@@ -20594,6 +20634,7 @@ var init_config = __esm(() => {
20594
20634
  "[codex]": OmoTypedHarnessConfigSchema.optional()
20595
20635
  }).strict();
20596
20636
  OmoConfigSchema = object({
20637
+ formatOnMutation: OmoFormatOnMutationSchema.optional(),
20597
20638
  $schema: string2().optional(),
20598
20639
  categories: OmoCategoriesConfigSchema.optional(),
20599
20640
  agents: OmoAgentsConfigSchema.optional(),
@@ -20612,6 +20653,7 @@ var init_config = __esm(() => {
20612
20653
  legacy_migrations: record(string2(), unknown()).optional()
20613
20654
  }).strict();
20614
20655
  OmoConfigLayerSchema = object({
20656
+ formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
20615
20657
  $schema: string2().optional(),
20616
20658
  categories: OmoCategoriesConfigSchema.optional(),
20617
20659
  agents: OmoAgentsConfigSchema.optional(),
@@ -20638,6 +20680,7 @@ var init_schema = __esm(() => {
20638
20680
  init_codegraph();
20639
20681
  init_config();
20640
20682
  init_fallback_models();
20683
+ init_format_on_mutation();
20641
20684
  init_git_master();
20642
20685
  init_harness();
20643
20686
  init_memory();
@@ -20707,7 +20750,7 @@ var init_types = __esm(() => {
20707
20750
 
20708
20751
  // packages/omo-config-core/src/loader/paths.ts
20709
20752
  import { userInfo } from "os";
20710
- import { dirname, join as join3, posix, resolve } from "path";
20753
+ import { dirname as dirname2, join as join3, posix, resolve } from "path";
20711
20754
  function resolveHomeDir(env = process.env) {
20712
20755
  const homeDir = env.HOME ?? env.USERPROFILE ?? process.cwd();
20713
20756
  return homeDir.startsWith("/") ? posix.resolve(homeDir) : toPosixPath(resolve(homeDir));
@@ -20772,7 +20815,7 @@ function findProjectConfigPathsFarthestFirst(cwd, homeDir, fileSystem, accountHo
20772
20815
  nearestFirst.push(configPath);
20773
20816
  if (isHomeDir)
20774
20817
  break;
20775
- const parentDir = dirname(currentDir);
20818
+ const parentDir = dirname2(currentDir);
20776
20819
  if (parentDir === currentDir)
20777
20820
  break;
20778
20821
  currentDir = parentDir;
@@ -21212,8 +21255,8 @@ var init_jsonc_parse = __esm(() => {
21212
21255
  });
21213
21256
 
21214
21257
  // packages/omo-config-core/src/writer/writer.ts
21215
- import { randomUUID } from "crypto";
21216
- import { dirname as dirname2, join as join4, posix as posix2 } from "path";
21258
+ import { randomUUID as randomUUID2 } from "crypto";
21259
+ import { dirname as dirname3, join as join4, posix as posix2 } from "path";
21217
21260
  function backupSuffix() {
21218
21261
  return new Date().toISOString().replace(/[:.]/g, "-");
21219
21262
  }
@@ -21246,20 +21289,20 @@ function resolveWritePath(options) {
21246
21289
  const jsoncPath2 = resolveUserOmoConfigPath(options.env);
21247
21290
  if (fileSystem.existsSync(jsoncPath2))
21248
21291
  return jsoncPath2;
21249
- const jsonPath2 = join4(dirname2(jsoncPath2), "omo.json");
21292
+ const jsonPath2 = join4(dirname3(jsoncPath2), "omo.json");
21250
21293
  return fileSystem.existsSync(jsonPath2) ? jsonPath2 : jsoncPath2;
21251
21294
  }
21252
21295
  const jsoncPath = join4(options.projectDir ?? process.cwd(), ".omo", "omo.jsonc");
21253
21296
  if (fileSystem.existsSync(jsoncPath))
21254
21297
  return jsoncPath;
21255
- const jsonPath = join4(dirname2(jsoncPath), "omo.json");
21298
+ const jsonPath = join4(dirname3(jsoncPath), "omo.json");
21256
21299
  return fileSystem.existsSync(jsonPath) ? jsonPath : jsoncPath;
21257
21300
  }
21258
21301
  function directoryPath(path4) {
21259
- return path4.startsWith("/") ? posix2.dirname(path4) : dirname2(path4);
21302
+ return path4.startsWith("/") ? posix2.dirname(path4) : dirname3(path4);
21260
21303
  }
21261
21304
  function writeAtomically(path4, content, fileSystem) {
21262
- const tempPath = `${path4}.${randomUUID()}.tmp`;
21305
+ const tempPath = `${path4}.${randomUUID2()}.tmp`;
21263
21306
  let tempCreated = false;
21264
21307
  try {
21265
21308
  fileSystem.writeFileExclusiveSync(tempPath, content);
@@ -21542,7 +21585,7 @@ var init_types3 = __esm(() => {
21542
21585
  });
21543
21586
 
21544
21587
  // packages/omo-config-core/src/migration/commit.ts
21545
- import { basename, dirname as dirname3, join as join5, resolve as resolve2 } from "path";
21588
+ import { basename, dirname as dirname4, join as join5, resolve as resolve2 } from "path";
21546
21589
  function parseDocument(path4, content) {
21547
21590
  const parsed = parseJsoncSafe2(content);
21548
21591
  if (parsed.errors.length > 0 || !isPlainObject5(parsed.data)) {
@@ -21576,11 +21619,11 @@ function writerInput(targetPath, env) {
21576
21619
  const homeDir = resolveHomeDir(env);
21577
21620
  const userDirectory = toPosixPath(join5(homeDir, ".omo"));
21578
21621
  const fileName = basename(targetPath);
21579
- if (toPosixPath(dirname3(targetPath)) === userDirectory && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21622
+ if (toPosixPath(dirname4(targetPath)) === userDirectory && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21580
21623
  return { scope: "user" };
21581
21624
  }
21582
- if (basename(dirname3(targetPath)) === ".omo" && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21583
- return { projectDir: dirname3(dirname3(targetPath)), scope: "project" };
21625
+ if (basename(dirname4(targetPath)) === ".omo" && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21626
+ return { projectDir: dirname4(dirname4(targetPath)), scope: "project" };
21584
21627
  }
21585
21628
  throw new MigrationTransactionError(`Migration target is not an omo config path: ${targetPath}`);
21586
21629
  }
@@ -21943,7 +21986,7 @@ var init_recovery = __esm(() => {
21943
21986
  });
21944
21987
 
21945
21988
  // packages/omo-config-core/src/migration/batch.ts
21946
- import { dirname as dirname4, posix as posix3 } from "path";
21989
+ import { dirname as dirname5, posix as posix3 } from "path";
21947
21990
  function parseSource(path4, content) {
21948
21991
  const parsed = parseJsoncSafe2(content);
21949
21992
  if (parsed.errors.length > 0) {
@@ -21992,7 +22035,7 @@ function assertSafeSourcePaths(sources, protectedPaths) {
21992
22035
  }
21993
22036
  }
21994
22037
  function directoryPath2(path4) {
21995
- return path4.startsWith("/") ? posix3.dirname(path4) : dirname4(path4);
22038
+ return path4.startsWith("/") ? posix3.dirname(path4) : dirname5(path4);
21996
22039
  }
21997
22040
  function ensureBackupDirectories(moves, fileSystem) {
21998
22041
  for (const move of moves)
@@ -22623,7 +22666,7 @@ var init_process_sweep = () => {};
22623
22666
  // packages/utils/src/codegraph/resolve.ts
22624
22667
  import { existsSync as existsSync7 } from "fs";
22625
22668
  import { spawnSync } from "child_process";
22626
- import { basename as basename2, dirname as dirname5, join as join10 } from "path";
22669
+ import { basename as basename2, dirname as dirname6, join as join10 } from "path";
22627
22670
  import { createRequire } from "module";
22628
22671
  function defaultNodeVersion(nodePath) {
22629
22672
  if (nodePath === process.execPath && isNodeExecutableName(nodePath))
@@ -23057,6 +23100,9 @@ var init_message_inspection_error = () => {};
23057
23100
  function getPromptGateMessagesFetchTimeoutMs() {
23058
23101
  return promptGateMessagesFetchTimeoutMsForTesting ?? DEFAULT_PROMPT_GATE_MESSAGES_FETCH_TIMEOUT_MS;
23059
23102
  }
23103
+ function getPromptGateRevalidationTimeoutMs() {
23104
+ return promptGateRevalidationTimeoutMsForTesting ?? DEFAULT_PROMPT_REVALIDATION_TIMEOUT_MS;
23105
+ }
23060
23106
  async function withDispatchTimeout(operation, dispatchTimeoutMs, operationName) {
23061
23107
  if (dispatchTimeoutMs <= 0) {
23062
23108
  return operation;
@@ -23075,7 +23121,7 @@ async function withDispatchTimeout(operation, dispatchTimeoutMs, operationName)
23075
23121
  }
23076
23122
  }
23077
23123
  }
23078
- var DEFAULT_PROMPT_ASYNC_POST_DISPATCH_HOLD_MS = 2000, DEFAULT_PROMPT_SEMANTIC_DEDUPE_HOLD_MS = 15000, DEFAULT_PROMPT_DISPATCH_TIMEOUT_MS = 30000, DEFAULT_PROMPT_GATE_MESSAGES_FETCH_TIMEOUT_MS = 5000, DEFAULT_PROMPT_QUEUE_RETRY_MS = 250, promptGateMessagesFetchTimeoutMsForTesting;
23124
+ var DEFAULT_PROMPT_ASYNC_POST_DISPATCH_HOLD_MS = 2000, DEFAULT_PROMPT_SEMANTIC_DEDUPE_HOLD_MS = 15000, DEFAULT_PROMPT_DISPATCH_TIMEOUT_MS = 30000, DEFAULT_PROMPT_GATE_MESSAGES_FETCH_TIMEOUT_MS = 5000, DEFAULT_PROMPT_REVALIDATION_TIMEOUT_MS = 5000, DEFAULT_PROMPT_QUEUE_RETRY_MS = 250, promptGateMessagesFetchTimeoutMsForTesting, promptGateRevalidationTimeoutMsForTesting;
23079
23125
 
23080
23126
  // packages/utils/src/prompt-async-gate/pending-tool-turn.ts
23081
23127
  function getPromptQuery(input) {
@@ -23276,6 +23322,7 @@ async function dispatchAfterSessionIdle(args) {
23276
23322
  checkStatus,
23277
23323
  checkToolState,
23278
23324
  shouldDispatch,
23325
+ retryDispatchFailure,
23279
23326
  dispatch
23280
23327
  } = args;
23281
23328
  const existing = getActiveReservation(sessionID);
@@ -23330,7 +23377,9 @@ async function dispatchAfterSessionIdle(args) {
23330
23377
  });
23331
23378
  return { status: "active" };
23332
23379
  }
23333
- if (shouldDispatch?.() === false) {
23380
+ const dispatchDecision = shouldDispatch?.();
23381
+ const resolvedDispatchDecision = dispatchDecision !== undefined && typeof dispatchDecision !== "boolean" ? await withDispatchTimeout(dispatchDecision, Math.min(dispatchTimeoutMs, getPromptGateRevalidationTimeoutMs()), `[prompt-async-gate] ${sessionName} shouldDispatch`) : dispatchDecision;
23382
+ if (resolvedDispatchDecision === false) {
23334
23383
  log(`[prompt-async-gate] ${sessionName} cancelled before dispatch`, { sessionID, source });
23335
23384
  return { status: "cancelled" };
23336
23385
  }
@@ -23346,6 +23395,7 @@ async function dispatchAfterSessionIdle(args) {
23346
23395
  log(`[prompt-async-gate] ${sessionName} dispatched`, { sessionID, source });
23347
23396
  return { status: "dispatched", response };
23348
23397
  } catch (error51) {
23398
+ const queueRetryable = dispatchAttempted && retryDispatchFailure?.(error51) === true;
23349
23399
  if (dispatchAttempted) {
23350
23400
  rememberRecentPromptDispatch({
23351
23401
  sessionID,
@@ -23356,7 +23406,12 @@ async function dispatchAfterSessionIdle(args) {
23356
23406
  }
23357
23407
  const errorText = error51 instanceof Error ? `${error51.name}: ${error51.message}` : String(error51);
23358
23408
  log(`[prompt-async-gate] ${sessionName} failed`, { sessionID, source, error: errorText });
23359
- return { status: "failed", error: error51, dispatchAttempted };
23409
+ return {
23410
+ status: "failed",
23411
+ error: error51,
23412
+ dispatchAttempted,
23413
+ ...queueRetryable ? { queueRetryable: true } : {}
23414
+ };
23360
23415
  } finally {
23361
23416
  finishPromptReservation(sessionID, reservation, dispatchAttempted, postDispatchHoldMs);
23362
23417
  }
@@ -23418,6 +23473,7 @@ function schedulePromptQueueDrain(sessionID, delayMs) {
23418
23473
  promptQueueTimers.set(sessionID, timer);
23419
23474
  }
23420
23475
  function removePromptQueueEntry(sessionID, entry) {
23476
+ promptQueueRetryStates.delete(entry.id);
23421
23477
  const queue = promptQueues.get(sessionID);
23422
23478
  if (!queue) {
23423
23479
  return;
@@ -23447,6 +23503,7 @@ async function drainPromptQueue(sessionID, awaitedEntry) {
23447
23503
  promptQueueDraining.add(sessionID);
23448
23504
  clearPromptQueueTimer(sessionID);
23449
23505
  let awaitedResult;
23506
+ const deferredRetryIds = new Set;
23450
23507
  try {
23451
23508
  while (true) {
23452
23509
  const queue = promptQueues.get(sessionID);
@@ -23454,6 +23511,20 @@ async function drainPromptQueue(sessionID, awaitedEntry) {
23454
23511
  if (!entry) {
23455
23512
  break;
23456
23513
  }
23514
+ const retryState = promptQueueRetryStates.get(entry.id);
23515
+ if (entry.durableRetry && retryState?.retryAfter !== undefined && retryState.retryAfter > Date.now()) {
23516
+ if (deferredRetryIds.has(entry.id)) {
23517
+ const nextRetryAt = Math.min(...queue.flatMap((queued) => {
23518
+ const retryAfter = promptQueueRetryStates.get(queued.id)?.retryAfter;
23519
+ return retryAfter === undefined ? [] : [retryAfter];
23520
+ }));
23521
+ schedulePromptQueueDrain(sessionID, nextRetryAt - Date.now());
23522
+ break;
23523
+ }
23524
+ deferredRetryIds.add(entry.id);
23525
+ setPromptQueue(sessionID, [...queue.slice(1), entry]);
23526
+ continue;
23527
+ }
23457
23528
  promptQueueInFlight.set(sessionID, entry);
23458
23529
  const result = await dispatchAfterSessionIdle({
23459
23530
  sessionName: entry.sessionName,
@@ -23469,12 +23540,45 @@ async function drainPromptQueue(sessionID, awaitedEntry) {
23469
23540
  checkStatus: entry.checkStatus,
23470
23541
  checkToolState: entry.checkToolState,
23471
23542
  shouldDispatch: entry.shouldDispatch,
23543
+ retryDispatchFailure: entry.retryDispatchFailure,
23472
23544
  dispatch: entry.dispatch
23473
23545
  });
23474
23546
  if (promptQueueInFlight.get(sessionID)?.id === entry.id) {
23475
23547
  promptQueueInFlight.delete(sessionID);
23476
23548
  }
23477
- if (result.status === "active" || result.status === "reserved") {
23549
+ const retryableQueuedFailure = result.status === "failed" && (!result.dispatchAttempted || result.queueRetryable === true);
23550
+ if (retryableQueuedFailure) {
23551
+ const failureCount = (promptQueueRetryStates.get(entry.id)?.failureCount ?? 0) + 1;
23552
+ if (entry.durableRetry) {
23553
+ const exponentialBackoffMs = entry.queueRetryMs * 2 ** Math.min(failureCount, 7);
23554
+ const retryDelayMs = Math.max(entry.postDispatchHoldMs, Math.min(exponentialBackoffMs, MAX_DURABLE_RETRY_BACKOFF_MS));
23555
+ promptQueueRetryStates.set(entry.id, {
23556
+ failureCount,
23557
+ retryAfter: Date.now() + retryDelayMs
23558
+ });
23559
+ const currentQueue = promptQueues.get(sessionID);
23560
+ if (currentQueue && currentQueue.length > 1) {
23561
+ setPromptQueue(sessionID, [...currentQueue.slice(1), entry]);
23562
+ continue;
23563
+ }
23564
+ schedulePromptQueueDrain(sessionID, retryDelayMs);
23565
+ break;
23566
+ }
23567
+ if (failureCount >= MAX_QUEUED_RETRYABLE_FAILURES) {
23568
+ log("[prompt-async-gate] dropping queued prompt after repeated retryable failures", {
23569
+ sessionID,
23570
+ source: entry.source,
23571
+ failureCount
23572
+ });
23573
+ removePromptQueueEntry(sessionID, entry);
23574
+ if (awaitedEntry?.id === entry.id) {
23575
+ awaitedResult = result;
23576
+ }
23577
+ continue;
23578
+ }
23579
+ promptQueueRetryStates.set(entry.id, { failureCount });
23580
+ }
23581
+ if (result.status === "active" || result.status === "reserved" || retryableQueuedFailure) {
23478
23582
  const queued = queuedResult(entry, 1, result.status === "reserved" ? result.reservedBy : entry.source);
23479
23583
  if (awaitedEntry?.id === entry.id) {
23480
23584
  awaitedResult = queued;
@@ -23535,7 +23639,7 @@ async function enqueueInternalPrompt(entry) {
23535
23639
  const result = await drainPromptQueue(entry.sessionID, entry);
23536
23640
  return result ?? queuedResult(entry, 1);
23537
23641
  }
23538
- var promptQueues, promptQueueDraining, promptQueueInFlight, promptQueueTimers, promptQueueSequence = 0;
23642
+ var promptQueues, promptQueueDraining, promptQueueInFlight, promptQueueTimers, promptQueueRetryStates, MAX_QUEUED_RETRYABLE_FAILURES = 3, MAX_DURABLE_RETRY_BACKOFF_MS = 30000, promptQueueSequence = 0;
23539
23643
  var init_queue = __esm(() => {
23540
23644
  init_session_idle_dispatch();
23541
23645
  init_reservations();
@@ -23543,6 +23647,7 @@ var init_queue = __esm(() => {
23543
23647
  promptQueueDraining = new Set;
23544
23648
  promptQueueInFlight = new Map;
23545
23649
  promptQueueTimers = new Map;
23650
+ promptQueueRetryStates = new Map;
23546
23651
  setExpiredReservationHandler((sessionID) => {
23547
23652
  schedulePromptQueueDrain(sessionID, 0);
23548
23653
  });
@@ -23790,6 +23895,7 @@ async function dispatchInternalPrompt(args) {
23790
23895
  checkStatus: args.checkStatus !== false,
23791
23896
  checkToolState: args.checkToolState !== false,
23792
23897
  shouldDispatch: args.shouldDispatch,
23898
+ retryDispatchFailure: args.retryDispatchFailure,
23793
23899
  dispatch: (dispatchInput) => dispatchWithPathCompatibility(dispatch, dispatchInput)
23794
23900
  });
23795
23901
  if (deferResult.status === "failed" && resolved.route === "live" && deferResult.error instanceof Error && deferResult.error.message.startsWith(dispatchTimeoutPrefix)) {
@@ -23817,7 +23923,9 @@ async function dispatchInternalPrompt(args) {
23817
23923
  queueRetryMs,
23818
23924
  checkStatus: args.checkStatus !== false,
23819
23925
  checkToolState: args.checkToolState !== false,
23926
+ durableRetry: args.durableRetry === true,
23820
23927
  shouldDispatch: args.shouldDispatch,
23928
+ retryDispatchFailure: args.retryDispatchFailure,
23821
23929
  dispatch: async (_dispatchInput) => dispatchWithPathCompatibility(dispatch, input)
23822
23930
  });
23823
23931
  }
@@ -23839,6 +23947,7 @@ async function dispatchInternalPrompt(args) {
23839
23947
  checkStatus: args.checkStatus !== false,
23840
23948
  checkToolState: args.checkToolState !== false,
23841
23949
  shouldDispatch: args.shouldDispatch,
23950
+ retryDispatchFailure: args.retryDispatchFailure,
23842
23951
  dispatch: (dispatchInput) => dispatchWithPathCompatibility(dispatch, dispatchInput)
23843
23952
  });
23844
23953
  if (directResult.status === "failed" && resolved.route === "live" && directResult.error instanceof Error && directResult.error.message.startsWith(dispatchTimeoutPrefix)) {
@@ -26051,7 +26160,7 @@ var init_resolve_agent_definition_paths = __esm(() => {
26051
26160
  // packages/omo-opencode/src/shared/opencode-version.ts
26052
26161
  import { execSync } from "child_process";
26053
26162
  import { existsSync as existsSync9, readFileSync as readFileSync3, realpathSync as realpathSync4 } from "fs";
26054
- import { dirname as dirname6, join as join13 } from "path";
26163
+ import { dirname as dirname7, join as join13 } from "path";
26055
26164
  function parseVersion(version2) {
26056
26165
  const cleaned = version2.replace(/^v/, "").split("-")[0];
26057
26166
  return cleaned.split(".").map((n) => parseInt(n, 10) || 0);
@@ -26092,7 +26201,7 @@ function parsePackageVersion(content) {
26092
26201
  function getPackageVersionFromBinary(binaryPath, deps) {
26093
26202
  try {
26094
26203
  const realBinaryPath = deps.realpath(binaryPath);
26095
- const packagePath = join13(dirname6(dirname6(realBinaryPath)), "package.json");
26204
+ const packagePath = join13(dirname7(dirname7(realBinaryPath)), "package.json");
26096
26205
  if (!deps.exists(packagePath))
26097
26206
  return null;
26098
26207
  return parsePackageVersion(deps.readText(packagePath));
@@ -26330,10 +26439,10 @@ import {
26330
26439
  } from "fs";
26331
26440
  function writeFileAtomically2(filePath, content, deps = {}) {
26332
26441
  const tempPath = `${filePath}.tmp`;
26333
- const mode = deps.mode;
26334
- writeFileSync3(tempPath, content, { encoding: "utf-8", mode });
26335
- if (mode !== undefined) {
26336
- chmodSync2(tempPath, mode);
26442
+ const mode2 = deps.mode;
26443
+ writeFileSync3(tempPath, content, { encoding: "utf-8", mode: mode2 });
26444
+ if (mode2 !== undefined) {
26445
+ chmodSync2(tempPath, mode2);
26337
26446
  }
26338
26447
  const tempFileDescriptor = openSync2(tempPath, "r+");
26339
26448
  try {
@@ -26354,8 +26463,8 @@ function writeFileAtomically2(filePath, content, deps = {}) {
26354
26463
  throw error51;
26355
26464
  }
26356
26465
  }
26357
- if (mode !== undefined) {
26358
- chmodSync2(filePath, mode);
26466
+ if (mode2 !== undefined) {
26467
+ chmodSync2(filePath, mode2);
26359
26468
  }
26360
26469
  }
26361
26470
  var init_write_file_atomically = __esm(() => {
@@ -83747,7 +83856,17 @@ function isPreSendConnectionFailure2(error51) {
83747
83856
  if (error51.name === "AbortError") {
83748
83857
  return false;
83749
83858
  }
83750
- const CONNECTION_CODES = new Set(["ECONNREFUSED", "ENOTFOUND", "EAI_AGAIN"]);
83859
+ const CONNECTION_CODES = new Set([
83860
+ "ECONNREFUSED",
83861
+ "ENOTFOUND",
83862
+ "EAI_AGAIN",
83863
+ "ENETUNREACH",
83864
+ "EHOSTUNREACH",
83865
+ "ENETDOWN",
83866
+ "EHOSTDOWN",
83867
+ "EADDRNOTAVAIL",
83868
+ "UND_ERR_CONNECT_TIMEOUT"
83869
+ ]);
83751
83870
  const self = error51;
83752
83871
  if (self.code && CONNECTION_CODES.has(self.code)) {
83753
83872
  return true;
@@ -83759,12 +83878,6 @@ function isPreSendConnectionFailure2(error51) {
83759
83878
  return true;
83760
83879
  }
83761
83880
  }
83762
- if (error51 instanceof TypeError) {
83763
- const msg = error51.message;
83764
- if (msg.includes("fetch failed") || msg.includes("Unable to connect")) {
83765
- return true;
83766
- }
83767
- }
83768
83881
  return false;
83769
83882
  }
83770
83883
  function markLiveRouteUnavailable2(reason) {
@@ -84307,7 +84420,7 @@ var init_plugin_name_with_version = __esm(() => {
84307
84420
 
84308
84421
  // packages/omo-opencode/src/cli/config-manager/backup-config.ts
84309
84422
  import { copyFileSync as copyFileSync2, existsSync as existsSync16, mkdirSync as mkdirSync6 } from "fs";
84310
- import { dirname as dirname7 } from "path";
84423
+ import { dirname as dirname8 } from "path";
84311
84424
  function backupConfigFile(configPath) {
84312
84425
  if (!existsSync16(configPath)) {
84313
84426
  return { success: true };
@@ -84315,7 +84428,7 @@ function backupConfigFile(configPath) {
84315
84428
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
84316
84429
  const backupPath = `${configPath}.backup-${timestamp}`;
84317
84430
  try {
84318
- const dir = dirname7(backupPath);
84431
+ const dir = dirname8(backupPath);
84319
84432
  if (!existsSync16(dir)) {
84320
84433
  mkdirSync6(dir, { recursive: true });
84321
84434
  }
@@ -84513,7 +84626,7 @@ function extractVersionFromPluginEntry(entry) {
84513
84626
 
84514
84627
  // packages/omo-opencode/src/cli/config-manager/add-plugin-to-opencode-config.ts
84515
84628
  import { existsSync as existsSync19, readdirSync as readdirSync4, readFileSync as readFileSync8, writeFileSync as writeFileSync5 } from "fs";
84516
- import { basename as basename3, dirname as dirname8, join as join21 } from "path";
84629
+ import { basename as basename3, dirname as dirname9, join as join21 } from "path";
84517
84630
  function detectConfigFormatInDir(configDir) {
84518
84631
  const configJsonc = join21(configDir, "opencode.jsonc");
84519
84632
  const configJson = join21(configDir, "opencode.json");
@@ -84526,10 +84639,10 @@ function detectConfigFormatInDir(configDir) {
84526
84639
  return { format: "none", path: configJson };
84527
84640
  }
84528
84641
  function getParentConfigDirForProfile(configDir) {
84529
- const parentDir = dirname8(configDir);
84642
+ const parentDir = dirname9(configDir);
84530
84643
  if (basename3(parentDir) !== "profiles")
84531
84644
  return null;
84532
- return dirname8(parentDir);
84645
+ return dirname9(parentDir);
84533
84646
  }
84534
84647
  function listProfileConfigDirs(rootConfigDir) {
84535
84648
  const profilesDir = join21(rootConfigDir, "profiles");
@@ -86663,7 +86776,7 @@ var init_env2 = __esm(() => {
86663
86776
  });
86664
86777
 
86665
86778
  // node_modules/.bun/posthog-node@5.51.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
86666
- import { dirname as dirname17, posix as posix7, sep as sep7 } from "path";
86779
+ import { dirname as dirname18, posix as posix7, sep as sep7 } from "path";
86667
86780
  function createModulerModifier() {
86668
86781
  const getModuleFromFileName = createGetModuleFromFilename();
86669
86782
  return async (frames) => {
@@ -86672,7 +86785,7 @@ function createModulerModifier() {
86672
86785
  return frames;
86673
86786
  };
86674
86787
  }
86675
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
86788
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
86676
86789
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
86677
86790
  return (filename) => {
86678
86791
  if (!filename)
@@ -92006,7 +92119,7 @@ function splitNodeOptions(nodeOptions) {
92006
92119
  return args;
92007
92120
  }
92008
92121
  function findUnhandledRejectionMode(args) {
92009
- let mode;
92122
+ let mode2;
92010
92123
  for (let index = 0;index < args.length; index++) {
92011
92124
  const argument = args[index];
92012
92125
  const optionName = UNHANDLED_REJECTION_OPTION_NAMES.find((name) => argument === name || argument.startsWith(`${name}=`));
@@ -92014,9 +92127,9 @@ function findUnhandledRejectionMode(args) {
92014
92127
  continue;
92015
92128
  const value = argument === optionName ? args[++index] : argument.slice(optionName.length + 1);
92016
92129
  if (UNHANDLED_REJECTION_MODES.has(value))
92017
- mode = value;
92130
+ mode2 = value;
92018
92131
  }
92019
- return mode;
92132
+ return mode2;
92020
92133
  }
92021
92134
  function getUnhandledRejectionMode(execArgv = STARTUP_EXEC_ARGV, nodeOptions = STARTUP_NODE_OPTIONS) {
92022
92135
  return findUnhandledRejectionMode(execArgv) ?? findUnhandledRejectionMode(splitNodeOptions(nodeOptions ?? "")) ?? "throw";
@@ -92042,17 +92155,17 @@ function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
92042
92155
  _posthogErrorHandler: true
92043
92156
  });
92044
92157
  }
92045
- function addUncaughtExceptionListener(captureFn, onFatalFn, mode = STARTUP_UNHANDLED_REJECTION_MODE) {
92158
+ function addUncaughtExceptionListener(captureFn, onFatalFn, mode2 = STARTUP_UNHANDLED_REJECTION_MODE) {
92046
92159
  const process4 = globalThis.process;
92047
92160
  if (!process4)
92048
92161
  return;
92049
- if (mode === "strict")
92162
+ if (mode2 === "strict")
92050
92163
  return void process4.on("uncaughtExceptionMonitor", (error51, origin) => captureUncaughtException(captureFn, error51, origin));
92051
92164
  process4.on("uncaughtException", makeUncaughtExceptionHandler(captureFn, onFatalFn));
92052
92165
  }
92053
- function addUnhandledRejectionListener(captureFn, mode = STARTUP_UNHANDLED_REJECTION_MODE) {
92166
+ function addUnhandledRejectionListener(captureFn, mode2 = STARTUP_UNHANDLED_REJECTION_MODE) {
92054
92167
  const process4 = globalThis.process;
92055
- if (!process4 || mode === "throw" || mode === "strict" || mode === "warn-with-error-code")
92168
+ if (!process4 || mode2 === "throw" || mode2 === "strict" || mode2 === "warn-with-error-code")
92056
92169
  return;
92057
92170
  process4.on("unhandledRejection", (reason) => {
92058
92171
  captureFn(reason, {
@@ -94277,7 +94390,7 @@ var package_default2;
94277
94390
  var init_package2 = __esm(() => {
94278
94391
  package_default2 = {
94279
94392
  name: "@oh-my-opencode/omo-codex",
94280
- version: "5.0.0-beta.25",
94393
+ version: "5.0.0-beta.26",
94281
94394
  type: "module",
94282
94395
  private: true,
94283
94396
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -95247,19 +95360,19 @@ var init_update_toasts = __esm(() => {
95247
95360
 
95248
95361
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
95249
95362
  import { existsSync as existsSync48 } from "fs";
95250
- import { dirname as dirname30, join as join76 } from "path";
95363
+ import { dirname as dirname31, join as join76 } from "path";
95251
95364
  import { fileURLToPath as fileURLToPath5 } from "url";
95252
95365
  function defaultGetModuleHostingWorkspace() {
95253
95366
  try {
95254
- const currentDir = dirname30(fileURLToPath5(import.meta.url));
95367
+ const currentDir = dirname31(fileURLToPath5(import.meta.url));
95255
95368
  const pkgJsonPath = findPackageJsonUp(currentDir);
95256
95369
  if (!pkgJsonPath)
95257
95370
  return null;
95258
- const pkgDir = dirname30(pkgJsonPath);
95259
- const nodeModulesDir = dirname30(pkgDir);
95371
+ const pkgDir = dirname31(pkgJsonPath);
95372
+ const nodeModulesDir = dirname31(pkgDir);
95260
95373
  if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
95261
95374
  return null;
95262
- return dirname30(nodeModulesDir);
95375
+ return dirname31(nodeModulesDir);
95263
95376
  } catch (error51) {
95264
95377
  if (error51 instanceof Error) {
95265
95378
  return null;
@@ -97808,9 +97921,9 @@ function formatConfigSummary(config3) {
97808
97921
  `);
97809
97922
  }
97810
97923
  function printHeader(isUpdate) {
97811
- const mode = isUpdate ? "Update" : "Install";
97924
+ const mode2 = isUpdate ? "Update" : "Install";
97812
97925
  console.log();
97813
- console.log(import_picocolors.default.bgMagenta(import_picocolors.default.white(` oMoMoMoMo... ${mode} `)));
97926
+ console.log(import_picocolors.default.bgMagenta(import_picocolors.default.white(` oMoMoMoMo... ${mode2} `)));
97814
97927
  console.log();
97815
97928
  }
97816
97929
  function printStep(step, total, message) {
@@ -98089,7 +98202,7 @@ function windowsCommandShim(targetPath) {
98089
98202
 
98090
98203
  // packages/omo-codex/src/install/codex-cache-dangling-bins.ts
98091
98204
  import { lstat as lstat2, readFile, readdir, readlink, rm, stat } from "fs/promises";
98092
- import { dirname as dirname9, isAbsolute, join as join23, resolve as resolve5 } from "path";
98205
+ import { dirname as dirname10, isAbsolute, join as join23, resolve as resolve5 } from "path";
98093
98206
 
98094
98207
  // packages/omo-codex/src/install/codex-cache-fs.ts
98095
98208
  import { lstat } from "fs/promises";
@@ -98136,7 +98249,7 @@ async function removeDanglingManagedSymlink(linkPath) {
98136
98249
  if (!linkStat.isSymbolicLink())
98137
98250
  return;
98138
98251
  const linkTarget = await readlink(linkPath);
98139
- const target = isAbsolute(linkTarget) ? linkTarget : resolve5(dirname9(linkPath), linkTarget);
98252
+ const target = isAbsolute(linkTarget) ? linkTarget : resolve5(dirname10(linkPath), linkTarget);
98140
98253
  if (!await isFileSystemEntry(target) && isManagedComponentBinTarget(target))
98141
98254
  await rm(linkPath, { force: true });
98142
98255
  } catch (error51) {
@@ -98598,11 +98711,11 @@ async function existingNonSymlink(path7) {
98598
98711
  }
98599
98712
  // packages/omo-codex/src/install/codex-cache-install.ts
98600
98713
  import { cp as cp2, mkdir as mkdir3, readFile as readFile8, readdir as readdir4, rename, rm as rm4 } from "fs/promises";
98601
- import { basename as basename5, dirname as dirname12, join as join32, sep as sep5 } from "path";
98714
+ import { basename as basename5, dirname as dirname13, join as join32, sep as sep5 } from "path";
98602
98715
 
98603
98716
  // packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
98604
98717
  import { cp, mkdir as mkdir2, readFile as readFile4, stat as stat3 } from "fs/promises";
98605
- import { dirname as dirname10, join as join27, resolve as resolve7 } from "path";
98718
+ import { dirname as dirname11, join as join27, resolve as resolve7 } from "path";
98606
98719
  var BUNDLED_MCP_RUNTIMES = [
98607
98720
  {
98608
98721
  label: "Git Bash MCP",
@@ -98637,7 +98750,7 @@ async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot, runtime4) {
98637
98750
  throw new Error(`missing built ${runtime4.label} dist at ${sourcePath}`);
98638
98751
  }
98639
98752
  const destinationPath = join27(pluginRoot, runtime4.destinationDistFromPlugin);
98640
- await mkdir2(dirname10(destinationPath), { recursive: true });
98753
+ await mkdir2(dirname11(destinationPath), { recursive: true });
98641
98754
  await cp(sourcePath, destinationPath, { recursive: true });
98642
98755
  }
98643
98756
  async function readSourceMcpArgs(path7) {
@@ -98675,7 +98788,7 @@ async function isDirectory(path7) {
98675
98788
  // packages/omo-codex/src/install/codex-cache-local-dependencies.ts
98676
98789
  import { realpathSync as realpathSync6 } from "fs";
98677
98790
  import { readFile as readFile5, readdir as readdir3, writeFile as writeFile2 } from "fs/promises";
98678
- import { dirname as dirname11, isAbsolute as isAbsolute4, join as join29, relative as relative3, resolve as resolve9, sep as sep2 } from "path";
98791
+ import { dirname as dirname12, isAbsolute as isAbsolute4, join as join29, relative as relative3, resolve as resolve9, sep as sep2 } from "path";
98679
98792
 
98680
98793
  // packages/omo-codex/src/install/codex-cache-paths.ts
98681
98794
  import { existsSync as existsSync24, readdirSync as readdirSync6 } from "fs";
@@ -98744,7 +98857,7 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
98744
98857
  const parsed = JSON.parse(raw);
98745
98858
  if (!isPlainRecord4(parsed))
98746
98859
  continue;
98747
- const packageDir = dirname11(packageJsonPath);
98860
+ const packageDir = dirname12(packageJsonPath);
98748
98861
  const sourcePackageDir = join29(sourceRoot, relative3(pluginRoot, packageDir));
98749
98862
  let changed = false;
98750
98863
  for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
@@ -99139,13 +99252,13 @@ function sanitizeNpmInstallEnv(env2) {
99139
99252
  return Object.fromEntries(Object.entries(env2).filter(([key]) => key.toLowerCase() !== "npm_config_allow_scripts"));
99140
99253
  }
99141
99254
  function createTempSiblingPath(targetPath) {
99142
- return join32(dirname12(targetPath), `.tmp-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99255
+ return join32(dirname13(targetPath), `.tmp-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99143
99256
  }
99144
99257
  function createBackupSiblingPath(targetPath) {
99145
- return join32(dirname12(targetPath), `.backup-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99258
+ return join32(dirname13(targetPath), `.backup-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99146
99259
  }
99147
99260
  async function copyDirectory(sourcePath, targetPath) {
99148
- await mkdir3(dirname12(targetPath), { recursive: true });
99261
+ await mkdir3(dirname13(targetPath), { recursive: true });
99149
99262
  await cp2(sourcePath, targetPath, { recursive: true, filter: (source) => shouldCopyPluginPath(source, sourcePath) });
99150
99263
  }
99151
99264
  async function promoteDirectory(tempPath, targetPath, renameDirectory) {
@@ -99244,20 +99357,20 @@ async function copyRootRuntimeDists(input) {
99244
99357
  const sourcePath = join32(repoRoot, runtimePath);
99245
99358
  if (!await fileExistsStrict(join32(sourcePath, "index.js")))
99246
99359
  continue;
99247
- await mkdir3(dirname12(join32(input.pluginRoot, runtimePath)), { recursive: true });
99360
+ await mkdir3(dirname13(join32(input.pluginRoot, runtimePath)), { recursive: true });
99248
99361
  await cp2(sourcePath, join32(input.pluginRoot, runtimePath), { recursive: true });
99249
99362
  }
99250
99363
  }
99251
99364
  function repoRootForCodexPluginSource(sourcePath) {
99252
- const codexPackageRoot = dirname12(sourcePath);
99253
- const packagesRoot = dirname12(codexPackageRoot);
99365
+ const codexPackageRoot = dirname13(sourcePath);
99366
+ const packagesRoot = dirname13(codexPackageRoot);
99254
99367
  if (basename5(sourcePath) !== "plugin")
99255
99368
  return null;
99256
99369
  if (basename5(codexPackageRoot) !== "omo-codex")
99257
99370
  return null;
99258
99371
  if (basename5(packagesRoot) !== "packages")
99259
99372
  return null;
99260
- return dirname12(packagesRoot);
99373
+ return dirname13(packagesRoot);
99261
99374
  }
99262
99375
  // packages/omo-codex/src/install/codex-cache-prune.ts
99263
99376
  import { lstat as lstat5, readdir as readdir5, rm as rm5, stat as stat4 } from "fs/promises";
@@ -99388,7 +99501,7 @@ async function shouldBuildSourcePackages(repoRoot) {
99388
99501
 
99389
99502
  // packages/omo-codex/src/install/codex-config-toml.ts
99390
99503
  import { mkdir as mkdir5, readFile as readFile11 } from "fs/promises";
99391
- import { dirname as dirname15 } from "path";
99504
+ import { dirname as dirname16 } from "path";
99392
99505
 
99393
99506
  // packages/omo-codex/src/install/toml-section-editor.ts
99394
99507
  function findTomlSection(config3, header) {
@@ -99970,12 +100083,12 @@ function tomlKeySegment(value) {
99970
100083
 
99971
100084
  // packages/omo-codex/src/install/codex-config-atomic-write.ts
99972
100085
  import { lstat as lstat6, readlink as readlink4, realpath, rename as rename3, unlink, writeFile as writeFile5 } from "fs/promises";
99973
- import { basename as basename6, dirname as dirname13, isAbsolute as isAbsolute5, join as join36, resolve as resolve10 } from "path";
100086
+ import { basename as basename6, dirname as dirname14, isAbsolute as isAbsolute5, join as join36, resolve as resolve10 } from "path";
99974
100087
  var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
99975
100088
  var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
99976
100089
  async function writeFileAtomic(targetPath, data) {
99977
100090
  const writeTarget = await resolveSymlinkTarget(targetPath);
99978
- const temporaryPath = join36(dirname13(writeTarget), `.tmp-${basename6(writeTarget)}-${process.pid}-${Date.now()}`);
100091
+ const temporaryPath = join36(dirname14(writeTarget), `.tmp-${basename6(writeTarget)}-${process.pid}-${Date.now()}`);
99979
100092
  await writeFile5(temporaryPath, data);
99980
100093
  try {
99981
100094
  await renameWithRetry(temporaryPath, writeTarget);
@@ -100004,7 +100117,7 @@ async function resolveSymlinkTarget(targetPath) {
100004
100117
  if (!(error51 instanceof Error))
100005
100118
  throw error51;
100006
100119
  const linkValue = await readlink4(targetPath);
100007
- return isAbsolute5(linkValue) ? linkValue : resolve10(dirname13(targetPath), linkValue);
100120
+ return isAbsolute5(linkValue) ? linkValue : resolve10(dirname14(targetPath), linkValue);
100008
100121
  }
100009
100122
  }
100010
100123
  async function renameWithRetry(fromPath, toPath) {
@@ -100484,14 +100597,14 @@ import { join as join37 } from "path";
100484
100597
  var FALLBACK_CODEX_MODEL_CATALOG = {
100485
100598
  current: {
100486
100599
  model: "gpt-5.6-sol",
100487
- modelContextWindow: 372000,
100600
+ modelContextWindow: 650000,
100488
100601
  modelReasoningEffort: "high",
100489
100602
  planModeReasoningEffort: "xhigh"
100490
100603
  },
100491
100604
  managedProfiles: [
100492
100605
  {
100493
100606
  model: "gpt-5.5",
100494
- modelContextWindow: 400000,
100607
+ modelContextWindow: 650000,
100495
100608
  modelReasoningEffort: "high",
100496
100609
  planModeReasoningEffort: "xhigh"
100497
100610
  },
@@ -100589,7 +100702,7 @@ function isRootSetting2(line, key) {
100589
100702
 
100590
100703
  // packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
100591
100704
  import { readFileSync as readFileSync11 } from "fs";
100592
- import { dirname as dirname14, isAbsolute as isAbsolute6, join as join38 } from "path";
100705
+ import { dirname as dirname15, isAbsolute as isAbsolute6, join as join38 } from "path";
100593
100706
  var CODEX_AGENTS_HEADER = "agents";
100594
100707
  var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
100595
100708
  var CODEX_MULTI_AGENT_V2_THREAD_LIMIT_KEY = `${CODEX_MULTI_AGENT_V2_HEADER}.max_concurrent_threads_per_session`;
@@ -100626,8 +100739,8 @@ function resolveCodexMultiAgentVersion(config3, configPath) {
100626
100739
  }
100627
100740
  function resolveCatalogPath(configuredPath, configPath) {
100628
100741
  if (configuredPath === null)
100629
- return join38(dirname14(configPath), "models_cache.json");
100630
- return isAbsolute6(configuredPath) ? configuredPath : join38(dirname14(configPath), configuredPath);
100742
+ return join38(dirname15(configPath), "models_cache.json");
100743
+ return isAbsolute6(configuredPath) ? configuredPath : join38(dirname15(configPath), configuredPath);
100631
100744
  }
100632
100745
  function readCatalogMultiAgentVersion(model, cachePath) {
100633
100746
  let raw;
@@ -100731,7 +100844,7 @@ function readBooleanSetting(sectionText, key) {
100731
100844
 
100732
100845
  // packages/omo-codex/src/install/codex-config-toml.ts
100733
100846
  async function updateCodexConfig(input) {
100734
- await mkdir5(dirname15(input.configPath), { recursive: true });
100847
+ await mkdir5(dirname16(input.configPath), { recursive: true });
100735
100848
  let config3;
100736
100849
  try {
100737
100850
  config3 = await readFile11(input.configPath, "utf8");
@@ -101704,7 +101817,7 @@ var defaultRunCommand = async (command, args, options) => {
101704
101817
 
101705
101818
  // packages/omo-codex/src/install/codex-project-local-cleanup.ts
101706
101819
  import { copyFile as copyFile2, lstat as lstat10, readFile as readFile17, writeFile as writeFile10 } from "fs/promises";
101707
- import { dirname as dirname16, join as join46, resolve as resolve11 } from "path";
101820
+ import { dirname as dirname17, join as join46, resolve as resolve11 } from "path";
101708
101821
  var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
101709
101822
  var PROJECT_LOCAL_ARTIFACT_PATHS = [
101710
101823
  ".codex/hooks.json",
@@ -101824,13 +101937,13 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
101824
101937
  artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
101825
101938
  };
101826
101939
  }
101827
- const parent = dirname16(current);
101940
+ const parent = dirname17(current);
101828
101941
  if (parent === current) {
101829
101942
  const nearestConfigPath = configPathsFromCwd[0];
101830
101943
  return nearestConfigPath === undefined ? null : {
101831
- projectRoot: dirname16(dirname16(nearestConfigPath)),
101944
+ projectRoot: dirname17(dirname17(nearestConfigPath)),
101832
101945
  configPaths: [nearestConfigPath],
101833
- artifactRoots: [dirname16(dirname16(nearestConfigPath))]
101946
+ artifactRoots: [dirname17(dirname17(nearestConfigPath))]
101834
101947
  };
101835
101948
  }
101836
101949
  current = parent;
@@ -101846,7 +101959,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
101846
101959
  function artifactRootsForConfigPaths(configPaths2) {
101847
101960
  const roots = [];
101848
101961
  for (const configPath of configPaths2) {
101849
- const root = dirname16(dirname16(configPath));
101962
+ const root = dirname17(dirname17(configPath));
101850
101963
  if (!roots.includes(root))
101851
101964
  roots.push(root);
101852
101965
  }
@@ -102756,7 +102869,7 @@ import { isAbsolute as isAbsolute11, join as join58, relative as relative6, reso
102756
102869
 
102757
102870
  // packages/omo-codex/src/install/codex-cleanup-bins.ts
102758
102871
  import { lstat as lstat12, readFile as readFile22, readdir as readdir12, readlink as readlink6, rm as rm11 } from "fs/promises";
102759
- import { dirname as dirname18, isAbsolute as isAbsolute9, join as join56, resolve as resolve14 } from "path";
102872
+ import { dirname as dirname19, isAbsolute as isAbsolute9, join as join56, resolve as resolve14 } from "path";
102760
102873
  var ROOT_RUNTIME_BIN_NAME = "omo";
102761
102874
  var MANAGED_CODEX_BIN_NAMES = new Set([
102762
102875
  ROOT_RUNTIME_BIN_NAME,
@@ -102813,7 +102926,7 @@ async function isManagedCodexBin(linkPath, platform, binName) {
102813
102926
  if (platform === "win32")
102814
102927
  return false;
102815
102928
  const linkTarget = await readlink6(linkPath);
102816
- const target = isAbsolute9(linkTarget) ? linkTarget : resolve14(dirname18(linkPath), linkTarget);
102929
+ const target = isAbsolute9(linkTarget) ? linkTarget : resolve14(dirname19(linkPath), linkTarget);
102817
102930
  return isManagedComponentBinTarget(target) || isLegacyCodexBinTarget(binName, target);
102818
102931
  }
102819
102932
  if (!entryStat.isFile())
@@ -102824,7 +102937,7 @@ async function isManagedCodexBin(linkPath, platform, binName) {
102824
102937
 
102825
102938
  // packages/omo-codex/src/install/codex-cleanup-config.ts
102826
102939
  import { lstat as lstat13, mkdir as mkdir8, readFile as readFile23, writeFile as writeFile13 } from "fs/promises";
102827
- import { dirname as dirname19 } from "path";
102940
+ import { dirname as dirname20 } from "path";
102828
102941
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
102829
102942
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
102830
102943
  var CURRENT_MANAGED_CODEX_AGENT_NAMES2 = [
@@ -102861,7 +102974,7 @@ async function cleanupCodexConfig(configPath, now) {
102861
102974
  if (next === original)
102862
102975
  return { changed: false };
102863
102976
  const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
102864
- await mkdir8(dirname19(configPath), { recursive: true });
102977
+ await mkdir8(dirname20(configPath), { recursive: true });
102865
102978
  await writeFile13(backupPath, original);
102866
102979
  await writeFile13(configPath, `${next.trimEnd()}
102867
102980
  `);
@@ -102940,10 +103053,10 @@ function nodeErrorCode5(error51) {
102940
103053
  }
102941
103054
 
102942
103055
  // packages/omo-codex/src/install/codex-cleanup-safety.ts
102943
- import { dirname as dirname20, isAbsolute as isAbsolute10, join as join57, relative as relative5, resolve as resolve15 } from "path";
103056
+ import { dirname as dirname21, isAbsolute as isAbsolute10, join as join57, relative as relative5, resolve as resolve15 } from "path";
102944
103057
  function codexHomeResolvesToFilesystemRoot(codexHome) {
102945
103058
  const resolved = resolve15(codexHome);
102946
- return dirname20(resolved) === resolved;
103059
+ return dirname21(resolved) === resolved;
102947
103060
  }
102948
103061
  function validateManagedCleanupTarget(input) {
102949
103062
  if (!isAbsolute10(input.path))
@@ -103206,7 +103319,7 @@ var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", ".
103206
103319
  import { execFile as execFile4 } from "child_process";
103207
103320
  import { existsSync as existsSync32 } from "fs";
103208
103321
  import { homedir as homedir11 } from "os";
103209
- import { dirname as dirname24, join as join63, resolve as resolve20 } from "path";
103322
+ import { dirname as dirname25, join as join63, resolve as resolve20 } from "path";
103210
103323
  import { fileURLToPath } from "url";
103211
103324
  import { promisify as promisify3 } from "util";
103212
103325
 
@@ -103237,9 +103350,9 @@ function resolveAgentHome(options) {
103237
103350
  }
103238
103351
 
103239
103352
  // packages/omo-senpi/src/install/local-launcher.ts
103240
- import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "fs";
103353
+ import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "fs";
103241
103354
  import { homedir as homedir10 } from "os";
103242
- import { dirname as dirname21, join as join60, resolve as resolve18 } from "path";
103355
+ import { dirname as dirname22, join as join60, resolve as resolve18 } from "path";
103243
103356
  var MARKER = "omo-local-launcher";
103244
103357
  function localLauncherPath(homeDir = homedir10()) {
103245
103358
  return join60(homeDir, ".local", "bin", "omo");
@@ -103310,7 +103423,7 @@ function installLocalLauncher(options) {
103310
103423
  const path7 = localLauncherPath(options.homeDir);
103311
103424
  if (existsSync31(path7) && !readFileSync14(path7, "utf8").includes(MARKER))
103312
103425
  return;
103313
- mkdirSync10(dirname21(path7), { recursive: true });
103426
+ mkdirSync10(dirname22(path7), { recursive: true });
103314
103427
  writeFileSync6(path7, renderLocalLauncher(options));
103315
103428
  chmodSync3(path7, 493);
103316
103429
  if ((options.platform ?? process.platform) === "win32") {
@@ -103325,12 +103438,12 @@ node "%~dp0omo" %*\r
103325
103438
  import { createHash as createHash5 } from "crypto";
103326
103439
  import { constants as constants9 } from "fs";
103327
103440
  import { access as access2, readFile as readFile26, stat as stat6 } from "fs/promises";
103328
- import { dirname as dirname23, join as join62 } from "path";
103441
+ import { dirname as dirname24, join as join62 } from "path";
103329
103442
 
103330
103443
  // packages/omo-senpi/src/install/senpi-settings.ts
103331
103444
  import { constants as constants8 } from "fs";
103332
103445
  import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "fs/promises";
103333
- import { dirname as dirname22, join as join61, resolve as resolve19 } from "path";
103446
+ import { dirname as dirname23, join as join61, resolve as resolve19 } from "path";
103334
103447
  var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
103335
103448
  var LEGACY_BUILTIN_SHADOW_PACKAGES = [
103336
103449
  join61("packages", "pi-goal"),
@@ -103377,7 +103490,7 @@ async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir
103377
103490
  return entries.filter((entry) => entry !== undefined);
103378
103491
  }
103379
103492
  async function writeSettingsAtomically(settingsPath, settings) {
103380
- await mkdir9(dirname22(settingsPath), { recursive: true });
103493
+ await mkdir9(dirname23(settingsPath), { recursive: true });
103381
103494
  const backupPath = await nextBackupPath(settingsPath);
103382
103495
  if (await fileExists(settingsPath)) {
103383
103496
  await copyFile3(settingsPath, backupPath);
@@ -103497,7 +103610,7 @@ async function hasMissingPluginArtifact(pluginPath) {
103497
103610
  }
103498
103611
  async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
103499
103612
  const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
103500
- const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
103613
+ const manifestPath = join62(dirname24(runtimeEntry), "manifest.json");
103501
103614
  let runtimeStat;
103502
103615
  try {
103503
103616
  runtimeStat = await stat6(runtimeEntry);
@@ -103587,7 +103700,7 @@ async function runSenpiInstaller(options = {}) {
103587
103700
  function resolveInstallContext(options) {
103588
103701
  const env3 = options.env ?? process.env;
103589
103702
  const allowBuild = options.pluginPath === undefined;
103590
- const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
103703
+ const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname25(fileURLToPath(import.meta.url))) : dirname25(resolve20(options.pluginPath))));
103591
103704
  const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
103592
103705
  const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
103593
103706
  return {
@@ -107591,7 +107704,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
107591
107704
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
107592
107705
  init_bun_which_shim();
107593
107706
  init_spawn_with_windows_hide();
107594
- import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "path";
107707
+ import { delimiter as delimiter2, dirname as dirname26, posix as posix9, win32 as win325 } from "path";
107595
107708
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
107596
107709
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
107597
107710
  function getCommandCandidates(platform) {
@@ -107649,7 +107762,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
107649
107762
  return null;
107650
107763
  }
107651
107764
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
107652
- const preferredDir = dirname25(binaryPath);
107765
+ const preferredDir = dirname26(binaryPath);
107653
107766
  const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
107654
107767
  return [preferredDir, ...existing].join(delimiter2);
107655
107768
  }
@@ -108427,7 +108540,7 @@ init_state();
108427
108540
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
108428
108541
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
108429
108542
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
108430
- import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "fs";
108543
+ import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync3, writeFileSync as writeFileSync7 } from "fs";
108431
108544
  import { join as join68 } from "path";
108432
108545
  function getMarkerPath(directory, sessionID) {
108433
108546
  return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
@@ -108607,7 +108720,7 @@ init_agent_display_names();
108607
108720
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
108608
108721
  init_frontmatter2();
108609
108722
  import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "fs";
108610
- import { dirname as dirname26, join as join70 } from "path";
108723
+ import { dirname as dirname27, join as join70 } from "path";
108611
108724
 
108612
108725
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
108613
108726
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -110449,8 +110562,8 @@ function getCategoryEffectiveVariant(categoryName, requirement, config4) {
110449
110562
  }
110450
110563
 
110451
110564
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
110452
- function formatCapabilityResolutionLabel(mode) {
110453
- return mode ?? "unknown";
110565
+ function formatCapabilityResolutionLabel(mode2) {
110566
+ return mode2 ?? "unknown";
110454
110567
  }
110455
110568
  function buildModelResolutionDetails(options) {
110456
110569
  const details = [];
@@ -110568,8 +110681,8 @@ function collectCapabilityResolutionIssues(info) {
110568
110681
  const issues = [];
110569
110682
  const allEntries = [...info.agents, ...info.categories];
110570
110683
  const fallbackEntries = allEntries.filter((entry) => {
110571
- const mode = entry.capabilityDiagnostics?.resolutionMode;
110572
- return mode === "unknown";
110684
+ const mode2 = entry.capabilityDiagnostics?.resolutionMode;
110685
+ return mode2 === "unknown";
110573
110686
  });
110574
110687
  if (fallbackEntries.length === 0) {
110575
110688
  return issues;
@@ -110845,7 +110958,7 @@ init_src2();
110845
110958
  import { existsSync as existsSync55 } from "fs";
110846
110959
  import { createRequire as createRequire3 } from "module";
110847
110960
  import { homedir as homedir19 } from "os";
110848
- import { dirname as dirname31, join as join83 } from "path";
110961
+ import { dirname as dirname32, join as join83 } from "path";
110849
110962
 
110850
110963
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
110851
110964
  import { join as join82 } from "path";
@@ -110942,7 +111055,7 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
110942
111055
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
110943
111056
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
110944
111057
  try {
110945
- const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
111058
+ const packageDir = baseDirOverride ?? dirname32(resolvePackageJsonPath());
110946
111059
  const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
110947
111060
  if (existsSync55(vendorPath))
110948
111061
  return vendorPath;
@@ -111094,7 +111207,7 @@ async function getGhCliInfo(dependencies = {}) {
111094
111207
  init_zod();
111095
111208
  init_opencode_config_dir();
111096
111209
  import { existsSync as existsSync56, readFileSync as readFileSync35 } from "fs";
111097
- import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "path";
111210
+ import { delimiter as delimiter3, dirname as dirname33, resolve as resolve23 } from "path";
111098
111211
  import { fileURLToPath as fileURLToPath7 } from "url";
111099
111212
 
111100
111213
  // packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -111225,7 +111338,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
111225
111338
  ].join(";");
111226
111339
  function getModuleDirectory(moduleUrl) {
111227
111340
  try {
111228
- return dirname32(fileURLToPath7(moduleUrl));
111341
+ return dirname33(fileURLToPath7(moduleUrl));
111229
111342
  } catch (error51) {
111230
111343
  if (!(error51 instanceof Error))
111231
111344
  throw error51;
@@ -111958,7 +112071,7 @@ async function pathExists2(path15) {
111958
112071
  init_src2();
111959
112072
  import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "fs/promises";
111960
112073
  import { homedir as homedir23 } from "os";
111961
- import { dirname as dirname33, isAbsolute as isAbsolute13, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
112074
+ import { dirname as dirname34, isAbsolute as isAbsolute13, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "path";
111962
112075
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
111963
112076
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
111964
112077
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -112032,7 +112145,7 @@ async function auditBundleTargets(pluginRoot) {
112032
112145
  const manifest2 = await readJson2(manifestPath);
112033
112146
  if (manifest2 === null || !isRecord13(manifest2["mcpServers"]))
112034
112147
  continue;
112035
- const manifestRoot = dirname33(manifestPath);
112148
+ const manifestRoot = dirname34(manifestPath);
112036
112149
  const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
112037
112150
  for (const server2 of Object.values(manifest2["mcpServers"])) {
112038
112151
  if (!isRecord13(server2) || !Array.isArray(server2["args"]))
@@ -112053,7 +112166,7 @@ async function auditBundleTargets(pluginRoot) {
112053
112166
  continue;
112054
112167
  const commands2 = [];
112055
112168
  collectHookCommands(manifest2, commands2);
112056
- const hookPluginRoot = dirname33(dirname33(hookManifestPath));
112169
+ const hookPluginRoot = dirname34(dirname34(hookManifestPath));
112057
112170
  for (const command of commands2) {
112058
112171
  for (const relativePath of extractPluginRootPaths(command)) {
112059
112172
  referencedCount += 1;
@@ -112092,7 +112205,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
112092
112205
  }
112093
112206
  async function findHookManifestPaths(root) {
112094
112207
  const paths3 = await findManifestPaths(root, "hooks.json");
112095
- return paths3.filter((path15) => dirname33(path15).endsWith(`${sep9}hooks`));
112208
+ return paths3.filter((path15) => dirname34(path15).endsWith(`${sep9}hooks`));
112096
112209
  }
112097
112210
  async function findManifestPaths(root, manifestName) {
112098
112211
  let entries;
@@ -112611,8 +112724,8 @@ function formatVerbose(result) {
112611
112724
  }
112612
112725
 
112613
112726
  // packages/omo-opencode/src/cli/doctor/framework/formatter.ts
112614
- function formatDoctorOutput(result, mode) {
112615
- switch (mode) {
112727
+ function formatDoctorOutput(result, mode2) {
112728
+ switch (mode2) {
112616
112729
  case "default":
112617
112730
  return formatDefault(result);
112618
112731
  case "status":
@@ -112776,7 +112889,7 @@ import {
112776
112889
  unlinkSync as unlinkSync9,
112777
112890
  writeFileSync as writeFileSync12
112778
112891
  } from "fs";
112779
- import { basename as basename12, dirname as dirname34, join as join90 } from "path";
112892
+ import { basename as basename12, dirname as dirname35, join as join90 } from "path";
112780
112893
 
112781
112894
  // packages/mcp-client-core/src/config-dir.ts
112782
112895
  import { existsSync as existsSync61, realpathSync as realpathSync8 } from "fs";
@@ -112960,7 +113073,7 @@ function readLegacyStore() {
112960
113073
  }
112961
113074
  function writeTokenFile(filePath, token) {
112962
113075
  try {
112963
- const dir = dirname34(filePath);
113076
+ const dir = dirname35(filePath);
112964
113077
  if (!existsSync63(dir)) {
112965
113078
  mkdirSync15(dir, { recursive: true });
112966
113079
  }
@@ -113932,10 +114045,10 @@ function formatClassification(classification) {
113932
114045
  return classification.ref.length > 0 ? `${head} ${classification.path} ${classification.ref}` : `${head} ${classification.path}`;
113933
114046
  }
113934
114047
  function formatSummary(result) {
113935
- const mode = result.apply ? "apply" : "dry-run";
114048
+ const mode2 = result.apply ? "apply" : "dry-run";
113936
114049
  const removed2 = result.repos.reduce((total, repo) => total + repo.removed.length, 0);
113937
114050
  const failed = result.repos.reduce((total, repo) => total + repo.failed.length, 0);
113938
- return `SUMMARY mode=${mode} repos=${result.repos.length} sweep=${result.sweepCount} keep=${result.keepCount} prune=${result.pruneCount} removed=${removed2} failed=${failed}`;
114051
+ return `SUMMARY mode=${mode2} repos=${result.repos.length} sweep=${result.sweepCount} keep=${result.keepCount} prune=${result.pruneCount} removed=${removed2} failed=${failed}`;
113939
114052
  }
113940
114053
  function formatResult(result) {
113941
114054
  const lines = [];
@@ -114457,9 +114570,9 @@ Examples:
114457
114570
  `).action(async (options) => {
114458
114571
  const rootOptions = program2.opts();
114459
114572
  const rootDoctorPlatform = rootOptions.platform === "opencode" || rootOptions.platform === "codex" ? rootOptions.platform : undefined;
114460
- const mode = options.status ? "status" : options.verbose ? "verbose" : "default";
114573
+ const mode2 = options.status ? "status" : options.verbose ? "verbose" : "default";
114461
114574
  const doctorOptions = {
114462
- mode,
114575
+ mode: mode2,
114463
114576
  json: options.json ?? false,
114464
114577
  target: resolveDoctorTarget(process.env.OMO_INVOCATION_NAME, options.platform ?? rootDoctorPlatform)
114465
114578
  };