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

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 (193) hide show
  1. package/dist/cli/config-manager/parse-opencode-config-file.d.ts +2 -1
  2. package/dist/cli/doctor/checks/system-plugin.d.ts +4 -3
  3. package/dist/cli/index.js +309 -182
  4. package/dist/cli-node/index.js +332 -182
  5. package/dist/features/team-mode/tools/messaging-fallback-wake.d.ts +15 -0
  6. package/dist/hooks/todo-continuation-enforcer/types.d.ts +1 -0
  7. package/dist/index.js +1958 -1668
  8. package/dist/shared/index.d.ts +1 -0
  9. package/dist/shared/legacy-plugin-warning.d.ts +2 -1
  10. package/dist/shared/plugin-entry-migrator.d.ts +4 -3
  11. package/dist/shared/plugin-entry-shape.d.ts +6 -0
  12. package/dist/skills/data-scientist/SKILL.md +99 -239
  13. package/dist/skills/data-scientist/references/execution-surfaces.md +91 -0
  14. package/dist/skills/data-scientist/references/placement.md +74 -0
  15. package/dist/skills/data-scientist/references/polars-lane.md +95 -0
  16. package/dist/skills/data-scientist/references/uv-setup.md +1 -1
  17. package/dist/skills/data-scientist/references/visualization.md +64 -0
  18. package/dist/skills/data-scientist/scripts/ensure-js-deps.sh +28 -0
  19. package/dist/skills/data-scientist/scripts/ensure-py-deps.sh +37 -0
  20. package/dist/skills/debugging/SKILL.md +2 -0
  21. package/dist/skills/debugging/references/methodology/00-setup.md +12 -0
  22. package/dist/skills/debugging/references/methodology/02-investigate.md +21 -0
  23. package/dist/skills/debugging/references/runtimes/go.md +15 -1
  24. package/dist/skills/debugging/references/runtimes/native-binary.md +38 -0
  25. package/dist/skills/debugging/references/runtimes/node.md +25 -0
  26. package/dist/skills/debugging/references/runtimes/python.md +13 -0
  27. package/dist/skills/debugging/references/runtimes/rust.md +41 -0
  28. package/dist/skills/debugging/references/scripts/dap.mjs +267 -0
  29. package/dist/skills/debugging/references/scripts/dap.test.ts +86 -0
  30. package/dist/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
  31. package/dist/skills/debugging/references/tools/dap.md +103 -0
  32. package/dist/skills/debugging/references/tools/frida.md +193 -0
  33. package/dist/skills/ulw-research/SKILL.md +3 -1
  34. package/dist/tools/delegate-task/types.d.ts +3 -0
  35. package/dist/tui.d.ts +12 -0
  36. package/dist/tui.js +106 -15
  37. package/package.json +18 -15
  38. package/packages/lsp-core/src/index.ts +1 -0
  39. package/packages/lsp-core/src/lsp/client-wrapper.ts +25 -5
  40. package/packages/lsp-core/src/lsp/client.ts +26 -0
  41. package/packages/lsp-core/src/lsp/connection.ts +16 -0
  42. package/packages/lsp-core/src/lsp/constants.ts +1 -0
  43. package/packages/lsp-core/src/lsp/format-document.test.ts +143 -0
  44. package/packages/lsp-core/src/lsp/format-document.ts +90 -0
  45. package/packages/lsp-core/src/lsp/manager-max-clients.test.ts +151 -0
  46. package/packages/lsp-core/src/lsp/manager.ts +34 -1
  47. package/packages/lsp-core/src/lsp/server-definitions.ts +29 -0
  48. package/packages/lsp-core/src/lsp/server-installation.test.ts +376 -0
  49. package/packages/lsp-core/src/lsp/server-installation.ts +200 -27
  50. package/packages/lsp-core/src/lsp/server-resolution-local-binary.test.ts +170 -0
  51. package/packages/lsp-core/src/lsp/server-resolution.ts +18 -5
  52. package/packages/lsp-core/src/lsp/transport.ts +9 -0
  53. package/packages/lsp-core/src/lsp/types.ts +8 -0
  54. package/packages/lsp-core/src/request-context.test.ts +29 -0
  55. package/packages/lsp-core/src/request-context.ts +1 -1
  56. package/packages/lsp-core/src/tool-surface.test.ts +13 -1
  57. package/packages/lsp-core/src/tools/definitions.ts +14 -0
  58. package/packages/lsp-core/src/tools/format.test.ts +56 -0
  59. package/packages/lsp-core/src/tools/format.ts +56 -0
  60. package/packages/lsp-core/src/tools/index.ts +1 -0
  61. package/packages/lsp-core/src/tools/types.ts +10 -0
  62. package/packages/lsp-daemon/dist/cli.js +433 -145
  63. package/packages/lsp-daemon/dist/client.d.ts +10 -0
  64. package/packages/lsp-daemon/dist/client.js +402 -108
  65. package/packages/lsp-daemon/dist/daemon-client.d.ts +1 -0
  66. package/packages/lsp-daemon/dist/daemon-client.js +3 -0
  67. package/packages/lsp-daemon/dist/index.js +396 -108
  68. package/packages/lsp-tools-mcp/dist/cli.js +385 -100
  69. package/packages/lsp-tools-mcp/dist/lsp/manager.js +53 -0
  70. package/packages/lsp-tools-mcp/dist/mcp.js +385 -100
  71. package/packages/lsp-tools-mcp/dist/request-context.js +1 -1
  72. package/packages/lsp-tools-mcp/dist/tools.js +386 -100
  73. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  74. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +2 -2
  75. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  76. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  77. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +69 -35
  78. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +21 -2
  79. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  80. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  81. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  82. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  83. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  84. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  85. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  86. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  87. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +404 -121
  88. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  89. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  90. package/packages/omo-codex/plugin/components/rules/dist/cli.js +3 -3
  91. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  92. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  93. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +3 -3
  94. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +4 -4
  95. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  96. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  97. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +30 -15
  98. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +30 -15
  99. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  100. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  101. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  102. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  103. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +2 -2
  104. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  105. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  106. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  107. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  108. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  109. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  110. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  111. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  112. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  113. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  114. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  115. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  116. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  117. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  118. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  119. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  120. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  121. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  122. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  123. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  124. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  125. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +1 -1
  126. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  127. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  128. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  129. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  130. package/packages/omo-codex/plugin/model-catalog.json +3 -3
  131. package/packages/omo-codex/plugin/package-lock.json +13 -13
  132. package/packages/omo-codex/plugin/package.json +1 -1
  133. package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +3 -3
  134. package/packages/omo-codex/plugin/skills/data-scientist/SKILL.md +99 -239
  135. package/packages/omo-codex/plugin/skills/data-scientist/references/execution-surfaces.md +91 -0
  136. package/packages/omo-codex/plugin/skills/data-scientist/references/placement.md +74 -0
  137. package/packages/omo-codex/plugin/skills/data-scientist/references/polars-lane.md +95 -0
  138. package/packages/omo-codex/plugin/skills/data-scientist/references/uv-setup.md +1 -1
  139. package/packages/omo-codex/plugin/skills/data-scientist/references/visualization.md +64 -0
  140. package/packages/omo-codex/plugin/skills/data-scientist/scripts/ensure-js-deps.sh +28 -0
  141. package/packages/omo-codex/plugin/skills/data-scientist/scripts/ensure-py-deps.sh +37 -0
  142. package/packages/omo-codex/plugin/skills/debugging/SKILL.md +2 -0
  143. package/packages/omo-codex/plugin/skills/debugging/references/methodology/00-setup.md +12 -0
  144. package/packages/omo-codex/plugin/skills/debugging/references/methodology/02-investigate.md +21 -0
  145. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/go.md +15 -1
  146. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/native-binary.md +38 -0
  147. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/node.md +25 -0
  148. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/python.md +13 -0
  149. package/packages/omo-codex/plugin/skills/debugging/references/runtimes/rust.md +41 -0
  150. package/packages/omo-codex/plugin/skills/debugging/references/scripts/dap.mjs +267 -0
  151. package/packages/omo-codex/plugin/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
  152. package/packages/omo-codex/plugin/skills/debugging/references/tools/dap.md +103 -0
  153. package/packages/omo-codex/plugin/skills/debugging/references/tools/frida.md +193 -0
  154. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +3 -1
  155. package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +1 -1
  156. package/packages/omo-codex/plugin/test/auto-update.test.mjs +2 -2
  157. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +8 -8
  158. package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +2 -2
  159. package/packages/omo-codex/scripts/install-dist/install-local.mjs +38 -23
  160. package/packages/shared-skills/skills/data-scientist/SKILL.md +99 -239
  161. package/packages/shared-skills/skills/data-scientist/references/execution-surfaces.md +91 -0
  162. package/packages/shared-skills/skills/data-scientist/references/placement.md +74 -0
  163. package/packages/shared-skills/skills/data-scientist/references/polars-lane.md +95 -0
  164. package/packages/shared-skills/skills/data-scientist/references/uv-setup.md +1 -1
  165. package/packages/shared-skills/skills/data-scientist/references/visualization.md +64 -0
  166. package/packages/shared-skills/skills/data-scientist/scripts/ensure-js-deps.sh +28 -0
  167. package/packages/shared-skills/skills/data-scientist/scripts/ensure-py-deps.sh +37 -0
  168. package/packages/shared-skills/skills/debugging/SKILL.md +2 -0
  169. package/packages/shared-skills/skills/debugging/references/methodology/00-setup.md +12 -0
  170. package/packages/shared-skills/skills/debugging/references/methodology/02-investigate.md +21 -0
  171. package/packages/shared-skills/skills/debugging/references/runtimes/go.md +15 -1
  172. package/packages/shared-skills/skills/debugging/references/runtimes/native-binary.md +38 -0
  173. package/packages/shared-skills/skills/debugging/references/runtimes/node.md +25 -0
  174. package/packages/shared-skills/skills/debugging/references/runtimes/python.md +13 -0
  175. package/packages/shared-skills/skills/debugging/references/runtimes/rust.md +41 -0
  176. package/packages/shared-skills/skills/debugging/references/scripts/dap.mjs +267 -0
  177. package/packages/shared-skills/skills/debugging/references/scripts/dap.test.ts +86 -0
  178. package/packages/shared-skills/skills/debugging/references/scripts/fixture-adapter.mjs +59 -0
  179. package/packages/shared-skills/skills/debugging/references/tools/dap.md +103 -0
  180. package/packages/shared-skills/skills/debugging/references/tools/frida.md +193 -0
  181. package/packages/shared-skills/skills/ulw-research/SKILL.md +3 -1
  182. package/dist/skills/data-scientist/references/common-scenarios.md +0 -176
  183. package/dist/skills/data-scientist/references/execution-templates.md +0 -197
  184. package/dist/skills/data-scientist/references/integration-patterns.md +0 -153
  185. package/dist/skills/data-scientist/references/performance-benchmarks.md +0 -37
  186. package/packages/omo-codex/plugin/skills/data-scientist/references/common-scenarios.md +0 -176
  187. package/packages/omo-codex/plugin/skills/data-scientist/references/execution-templates.md +0 -197
  188. package/packages/omo-codex/plugin/skills/data-scientist/references/integration-patterns.md +0 -153
  189. package/packages/omo-codex/plugin/skills/data-scientist/references/performance-benchmarks.md +0 -37
  190. package/packages/shared-skills/skills/data-scientist/references/common-scenarios.md +0 -176
  191. package/packages/shared-skills/skills/data-scientist/references/execution-templates.md +0 -197
  192. package/packages/shared-skills/skills/data-scientist/references/integration-patterns.md +0 -153
  193. package/packages/shared-skills/skills/data-scientist/references/performance-benchmarks.md +0 -37
@@ -55,7 +55,7 @@ var package_default;
55
55
  var init_package = __esm(() => {
56
56
  package_default = {
57
57
  name: "oh-my-opencode",
58
- version: "5.0.0-beta.25",
58
+ version: "5.0.0-beta.28",
59
59
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
60
60
  main: "./dist/index.js",
61
61
  types: "dist/index.d.ts",
@@ -236,7 +236,7 @@ var init_package = __esm(() => {
236
236
  zod: "^4.4.3"
237
237
  },
238
238
  devDependencies: {
239
- "@code-yeongyu/senpi": "2026.8.26-2",
239
+ "@code-yeongyu/senpi": "2026.8.30",
240
240
  "@oh-my-opencode/agents-md-core": "workspace:*",
241
241
  "@oh-my-opencode/ast-grep-mcp": "workspace:*",
242
242
  "@oh-my-opencode/boulder-state": "workspace:*",
@@ -277,18 +277,18 @@ var init_package = __esm(() => {
277
277
  typescript: "^7.0.2"
278
278
  },
279
279
  optionalDependencies: {
280
- "oh-my-opencode-darwin-arm64": "5.0.0-beta.25",
281
- "oh-my-opencode-darwin-x64": "5.0.0-beta.25",
282
- "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.25",
283
- "oh-my-opencode-linux-arm64": "5.0.0-beta.25",
284
- "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.25",
285
- "oh-my-opencode-linux-x64": "5.0.0-beta.25",
286
- "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.25",
287
- "oh-my-opencode-linux-x64-musl": "5.0.0-beta.25",
288
- "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.25",
289
- "oh-my-opencode-windows-arm64": "5.0.0-beta.25",
290
- "oh-my-opencode-windows-x64": "5.0.0-beta.25",
291
- "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.25"
280
+ "oh-my-opencode-darwin-arm64": "5.0.0-beta.28",
281
+ "oh-my-opencode-darwin-x64": "5.0.0-beta.28",
282
+ "oh-my-opencode-darwin-x64-baseline": "5.0.0-beta.28",
283
+ "oh-my-opencode-linux-arm64": "5.0.0-beta.28",
284
+ "oh-my-opencode-linux-arm64-musl": "5.0.0-beta.28",
285
+ "oh-my-opencode-linux-x64": "5.0.0-beta.28",
286
+ "oh-my-opencode-linux-x64-baseline": "5.0.0-beta.28",
287
+ "oh-my-opencode-linux-x64-musl": "5.0.0-beta.28",
288
+ "oh-my-opencode-linux-x64-musl-baseline": "5.0.0-beta.28",
289
+ "oh-my-opencode-windows-arm64": "5.0.0-beta.28",
290
+ "oh-my-opencode-windows-x64": "5.0.0-beta.28",
291
+ "oh-my-opencode-windows-x64-baseline": "5.0.0-beta.28"
292
292
  },
293
293
  overrides: {
294
294
  "@earendil-works/pi-agent-core": "0.84.2",
@@ -304,7 +304,10 @@ var init_package = __esm(() => {
304
304
  },
305
305
  trustedDependencies: [
306
306
  "@code-yeongyu/comment-checker"
307
- ]
307
+ ],
308
+ patchedDependencies: {
309
+ "@code-yeongyu/senpi@2026.8.30": "patches/@code-yeongyu%2Fsenpi@2026.8.30.patch"
310
+ }
308
311
  };
309
312
  });
310
313
 
@@ -4814,9 +4817,12 @@ import {
4814
4817
  fsyncSync,
4815
4818
  openSync,
4816
4819
  renameSync,
4820
+ rmSync,
4817
4821
  unlinkSync,
4818
4822
  writeFileSync
4819
4823
  } from "node:fs";
4824
+ import { randomUUID } from "node:crypto";
4825
+ import { dirname } from "node:path";
4820
4826
  function isToleratedFsyncError(error) {
4821
4827
  if (!(error instanceof Error))
4822
4828
  return false;
@@ -4832,24 +4838,36 @@ function tolerantFsyncSync(fileDescriptor, fsyncImpl) {
4832
4838
  }
4833
4839
  }
4834
4840
  function writeFileAtomically(filePath, content, options = {}) {
4835
- const tempPath = `${filePath}.tmp`;
4836
- writeFileSync(tempPath, content, "utf-8");
4837
- const tempFileDescriptor = openSync(tempPath, "r+");
4838
- try {
4839
- tolerantFsyncSync(tempFileDescriptor, options.fsyncSync ?? fsyncSync);
4840
- } finally {
4841
- closeSync(tempFileDescriptor);
4842
- }
4841
+ const platform = options.platform ?? process.platform;
4842
+ const fsyncImpl = options.fsyncSync ?? fsyncSync;
4843
+ const tempPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
4843
4844
  try {
4844
- renameSync(tempPath, filePath);
4845
- } catch (error) {
4846
- const isPermissionError = error instanceof Error && (error.message.includes("EPERM") || error.message.includes("EACCES"));
4847
- if ((options.platform ?? process.platform) === "win32" && isPermissionError) {
4845
+ writeFileSync(tempPath, content, "utf-8");
4846
+ const tempFileDescriptor = openSync(tempPath, "r+");
4847
+ try {
4848
+ tolerantFsyncSync(tempFileDescriptor, fsyncImpl);
4849
+ } finally {
4850
+ closeSync(tempFileDescriptor);
4851
+ }
4852
+ try {
4853
+ renameSync(tempPath, filePath);
4854
+ } catch (error) {
4855
+ const isPermissionError = error instanceof Error && (error.message.includes("EPERM") || error.message.includes("EACCES"));
4856
+ if (platform !== "win32" || !isPermissionError)
4857
+ throw error;
4848
4858
  unlinkSync(filePath);
4849
4859
  renameSync(tempPath, filePath);
4860
+ }
4861
+ if (platform === "win32")
4850
4862
  return;
4863
+ const directoryFileDescriptor = openSync(dirname(filePath), "r");
4864
+ try {
4865
+ tolerantFsyncSync(directoryFileDescriptor, fsyncImpl);
4866
+ } finally {
4867
+ closeSync(directoryFileDescriptor);
4851
4868
  }
4852
- throw error;
4869
+ } finally {
4870
+ rmSync(tempPath, { force: true });
4853
4871
  }
4854
4872
  }
4855
4873
  var TOLERATED_FSYNC_CODES;
@@ -20555,6 +20573,25 @@ var init_telemetry = __esm(() => {
20555
20573
  }).strict();
20556
20574
  });
20557
20575
 
20576
+ // packages/omo-config-core/src/schema/format-on-mutation.ts
20577
+ var mode, languages, OmoFormatOnMutationLayerSchema, OmoFormatOnMutationSchema;
20578
+ var init_format_on_mutation = __esm(() => {
20579
+ init_zod();
20580
+ mode = _enum2(["off", "best-effort", "required"]);
20581
+ languages = record(string2(), boolean2()).optional();
20582
+ OmoFormatOnMutationLayerSchema = object({
20583
+ mode: mode.optional(),
20584
+ languages,
20585
+ maxFileBytes: number2().int().positive().optional(),
20586
+ timeoutMs: number2().int().positive().optional()
20587
+ }).strict();
20588
+ OmoFormatOnMutationSchema = OmoFormatOnMutationLayerSchema.extend({
20589
+ mode: mode.default("best-effort"),
20590
+ maxFileBytes: number2().int().positive().default(1048576),
20591
+ timeoutMs: number2().int().positive().default(3000)
20592
+ }).strict();
20593
+ });
20594
+
20558
20595
  // packages/omo-config-core/src/schema/config.ts
20559
20596
  var OmoOpenCodeHarnessConfigSchema, OmoTypedHarnessConfigSchema, OmoConfigProfileSchema, OmoConfigSchema, OmoConfigLayerSchema;
20560
20597
  var init_config = __esm(() => {
@@ -20568,8 +20605,10 @@ var init_config = __esm(() => {
20568
20605
  init_task();
20569
20606
  init_team();
20570
20607
  init_telemetry();
20608
+ init_format_on_mutation();
20571
20609
  OmoOpenCodeHarnessConfigSchema = record(string2(), unknown());
20572
20610
  OmoTypedHarnessConfigSchema = object({
20611
+ formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
20573
20612
  categories: OmoCategoriesConfigSchema.optional(),
20574
20613
  agents: OmoAgentsConfigSchema.optional(),
20575
20614
  codegraph: OmoCodegraphSettingsLayerSchema.optional(),
@@ -20581,6 +20620,7 @@ var init_config = __esm(() => {
20581
20620
  telemetry: OmoTelemetrySettingsLayerSchema.optional()
20582
20621
  }).strict();
20583
20622
  OmoConfigProfileSchema = object({
20623
+ formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
20584
20624
  categories: OmoCategoriesConfigSchema.optional(),
20585
20625
  agents: OmoAgentsConfigSchema.optional(),
20586
20626
  codegraph: OmoCodegraphSettingsLayerSchema.optional(),
@@ -20595,6 +20635,7 @@ var init_config = __esm(() => {
20595
20635
  "[codex]": OmoTypedHarnessConfigSchema.optional()
20596
20636
  }).strict();
20597
20637
  OmoConfigSchema = object({
20638
+ formatOnMutation: OmoFormatOnMutationSchema.optional(),
20598
20639
  $schema: string2().optional(),
20599
20640
  categories: OmoCategoriesConfigSchema.optional(),
20600
20641
  agents: OmoAgentsConfigSchema.optional(),
@@ -20613,6 +20654,7 @@ var init_config = __esm(() => {
20613
20654
  legacy_migrations: record(string2(), unknown()).optional()
20614
20655
  }).strict();
20615
20656
  OmoConfigLayerSchema = object({
20657
+ formatOnMutation: OmoFormatOnMutationLayerSchema.optional(),
20616
20658
  $schema: string2().optional(),
20617
20659
  categories: OmoCategoriesConfigSchema.optional(),
20618
20660
  agents: OmoAgentsConfigSchema.optional(),
@@ -20639,6 +20681,7 @@ var init_schema = __esm(() => {
20639
20681
  init_codegraph();
20640
20682
  init_config();
20641
20683
  init_fallback_models();
20684
+ init_format_on_mutation();
20642
20685
  init_git_master();
20643
20686
  init_harness();
20644
20687
  init_memory();
@@ -20708,7 +20751,7 @@ var init_types = __esm(() => {
20708
20751
 
20709
20752
  // packages/omo-config-core/src/loader/paths.ts
20710
20753
  import { userInfo } from "node:os";
20711
- import { dirname, join as join3, posix, resolve } from "node:path";
20754
+ import { dirname as dirname2, join as join3, posix, resolve } from "node:path";
20712
20755
  function resolveHomeDir(env = process.env) {
20713
20756
  const homeDir = env.HOME ?? env.USERPROFILE ?? process.cwd();
20714
20757
  return homeDir.startsWith("/") ? posix.resolve(homeDir) : toPosixPath(resolve(homeDir));
@@ -20773,7 +20816,7 @@ function findProjectConfigPathsFarthestFirst(cwd, homeDir, fileSystem, accountHo
20773
20816
  nearestFirst.push(configPath);
20774
20817
  if (isHomeDir)
20775
20818
  break;
20776
- const parentDir = dirname(currentDir);
20819
+ const parentDir = dirname2(currentDir);
20777
20820
  if (parentDir === currentDir)
20778
20821
  break;
20779
20822
  currentDir = parentDir;
@@ -21213,8 +21256,8 @@ var init_jsonc_parse = __esm(() => {
21213
21256
  });
21214
21257
 
21215
21258
  // packages/omo-config-core/src/writer/writer.ts
21216
- import { randomUUID } from "node:crypto";
21217
- import { dirname as dirname2, join as join4, posix as posix2 } from "node:path";
21259
+ import { randomUUID as randomUUID2 } from "node:crypto";
21260
+ import { dirname as dirname3, join as join4, posix as posix2 } from "node:path";
21218
21261
  function backupSuffix() {
21219
21262
  return new Date().toISOString().replace(/[:.]/g, "-");
21220
21263
  }
@@ -21247,20 +21290,20 @@ function resolveWritePath(options) {
21247
21290
  const jsoncPath2 = resolveUserOmoConfigPath(options.env);
21248
21291
  if (fileSystem.existsSync(jsoncPath2))
21249
21292
  return jsoncPath2;
21250
- const jsonPath2 = join4(dirname2(jsoncPath2), "omo.json");
21293
+ const jsonPath2 = join4(dirname3(jsoncPath2), "omo.json");
21251
21294
  return fileSystem.existsSync(jsonPath2) ? jsonPath2 : jsoncPath2;
21252
21295
  }
21253
21296
  const jsoncPath = join4(options.projectDir ?? process.cwd(), ".omo", "omo.jsonc");
21254
21297
  if (fileSystem.existsSync(jsoncPath))
21255
21298
  return jsoncPath;
21256
- const jsonPath = join4(dirname2(jsoncPath), "omo.json");
21299
+ const jsonPath = join4(dirname3(jsoncPath), "omo.json");
21257
21300
  return fileSystem.existsSync(jsonPath) ? jsonPath : jsoncPath;
21258
21301
  }
21259
21302
  function directoryPath(path4) {
21260
- return path4.startsWith("/") ? posix2.dirname(path4) : dirname2(path4);
21303
+ return path4.startsWith("/") ? posix2.dirname(path4) : dirname3(path4);
21261
21304
  }
21262
21305
  function writeAtomically(path4, content, fileSystem) {
21263
- const tempPath = `${path4}.${randomUUID()}.tmp`;
21306
+ const tempPath = `${path4}.${randomUUID2()}.tmp`;
21264
21307
  let tempCreated = false;
21265
21308
  try {
21266
21309
  fileSystem.writeFileExclusiveSync(tempPath, content);
@@ -21543,7 +21586,7 @@ var init_types3 = __esm(() => {
21543
21586
  });
21544
21587
 
21545
21588
  // packages/omo-config-core/src/migration/commit.ts
21546
- import { basename, dirname as dirname3, join as join5, resolve as resolve2 } from "node:path";
21589
+ import { basename, dirname as dirname4, join as join5, resolve as resolve2 } from "node:path";
21547
21590
  function parseDocument(path4, content) {
21548
21591
  const parsed = parseJsoncSafe2(content);
21549
21592
  if (parsed.errors.length > 0 || !isPlainObject5(parsed.data)) {
@@ -21577,11 +21620,11 @@ function writerInput(targetPath, env) {
21577
21620
  const homeDir = resolveHomeDir(env);
21578
21621
  const userDirectory = toPosixPath(join5(homeDir, ".omo"));
21579
21622
  const fileName = basename(targetPath);
21580
- if (toPosixPath(dirname3(targetPath)) === userDirectory && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21623
+ if (toPosixPath(dirname4(targetPath)) === userDirectory && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21581
21624
  return { scope: "user" };
21582
21625
  }
21583
- if (basename(dirname3(targetPath)) === ".omo" && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21584
- return { projectDir: dirname3(dirname3(targetPath)), scope: "project" };
21626
+ if (basename(dirname4(targetPath)) === ".omo" && (fileName === "omo.json" || fileName === "omo.jsonc")) {
21627
+ return { projectDir: dirname4(dirname4(targetPath)), scope: "project" };
21585
21628
  }
21586
21629
  throw new MigrationTransactionError(`Migration target is not an omo config path: ${targetPath}`);
21587
21630
  }
@@ -21944,7 +21987,7 @@ var init_recovery = __esm(() => {
21944
21987
  });
21945
21988
 
21946
21989
  // packages/omo-config-core/src/migration/batch.ts
21947
- import { dirname as dirname4, posix as posix3 } from "node:path";
21990
+ import { dirname as dirname5, posix as posix3 } from "node:path";
21948
21991
  function parseSource(path4, content) {
21949
21992
  const parsed = parseJsoncSafe2(content);
21950
21993
  if (parsed.errors.length > 0) {
@@ -21993,7 +22036,7 @@ function assertSafeSourcePaths(sources, protectedPaths) {
21993
22036
  }
21994
22037
  }
21995
22038
  function directoryPath2(path4) {
21996
- return path4.startsWith("/") ? posix3.dirname(path4) : dirname4(path4);
22039
+ return path4.startsWith("/") ? posix3.dirname(path4) : dirname5(path4);
21997
22040
  }
21998
22041
  function ensureBackupDirectories(moves, fileSystem) {
21999
22042
  for (const move of moves)
@@ -22624,7 +22667,7 @@ var init_process_sweep = () => {};
22624
22667
  // packages/utils/src/codegraph/resolve.ts
22625
22668
  import { existsSync as existsSync7 } from "node:fs";
22626
22669
  import { spawnSync } from "node:child_process";
22627
- import { basename as basename2, dirname as dirname5, join as join10 } from "node:path";
22670
+ import { basename as basename2, dirname as dirname6, join as join10 } from "node:path";
22628
22671
  import { createRequire as createRequire2 } from "node:module";
22629
22672
  function defaultNodeVersion(nodePath) {
22630
22673
  if (nodePath === process.execPath && isNodeExecutableName(nodePath))
@@ -23058,6 +23101,9 @@ var init_message_inspection_error = () => {};
23058
23101
  function getPromptGateMessagesFetchTimeoutMs() {
23059
23102
  return promptGateMessagesFetchTimeoutMsForTesting ?? DEFAULT_PROMPT_GATE_MESSAGES_FETCH_TIMEOUT_MS;
23060
23103
  }
23104
+ function getPromptGateRevalidationTimeoutMs() {
23105
+ return promptGateRevalidationTimeoutMsForTesting ?? DEFAULT_PROMPT_REVALIDATION_TIMEOUT_MS;
23106
+ }
23061
23107
  async function withDispatchTimeout(operation, dispatchTimeoutMs, operationName) {
23062
23108
  if (dispatchTimeoutMs <= 0) {
23063
23109
  return operation;
@@ -23076,7 +23122,7 @@ async function withDispatchTimeout(operation, dispatchTimeoutMs, operationName)
23076
23122
  }
23077
23123
  }
23078
23124
  }
23079
- 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;
23125
+ 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;
23080
23126
 
23081
23127
  // packages/utils/src/prompt-async-gate/pending-tool-turn.ts
23082
23128
  function getPromptQuery(input) {
@@ -23277,6 +23323,7 @@ async function dispatchAfterSessionIdle(args) {
23277
23323
  checkStatus,
23278
23324
  checkToolState,
23279
23325
  shouldDispatch,
23326
+ retryDispatchFailure,
23280
23327
  dispatch
23281
23328
  } = args;
23282
23329
  const existing = getActiveReservation(sessionID);
@@ -23331,7 +23378,9 @@ async function dispatchAfterSessionIdle(args) {
23331
23378
  });
23332
23379
  return { status: "active" };
23333
23380
  }
23334
- if (shouldDispatch?.() === false) {
23381
+ const dispatchDecision = shouldDispatch?.();
23382
+ const resolvedDispatchDecision = dispatchDecision !== undefined && typeof dispatchDecision !== "boolean" ? await withDispatchTimeout(dispatchDecision, Math.min(dispatchTimeoutMs, getPromptGateRevalidationTimeoutMs()), `[prompt-async-gate] ${sessionName} shouldDispatch`) : dispatchDecision;
23383
+ if (resolvedDispatchDecision === false) {
23335
23384
  log(`[prompt-async-gate] ${sessionName} cancelled before dispatch`, { sessionID, source });
23336
23385
  return { status: "cancelled" };
23337
23386
  }
@@ -23347,6 +23396,7 @@ async function dispatchAfterSessionIdle(args) {
23347
23396
  log(`[prompt-async-gate] ${sessionName} dispatched`, { sessionID, source });
23348
23397
  return { status: "dispatched", response };
23349
23398
  } catch (error51) {
23399
+ const queueRetryable = dispatchAttempted && retryDispatchFailure?.(error51) === true;
23350
23400
  if (dispatchAttempted) {
23351
23401
  rememberRecentPromptDispatch({
23352
23402
  sessionID,
@@ -23357,7 +23407,12 @@ async function dispatchAfterSessionIdle(args) {
23357
23407
  }
23358
23408
  const errorText = error51 instanceof Error ? `${error51.name}: ${error51.message}` : String(error51);
23359
23409
  log(`[prompt-async-gate] ${sessionName} failed`, { sessionID, source, error: errorText });
23360
- return { status: "failed", error: error51, dispatchAttempted };
23410
+ return {
23411
+ status: "failed",
23412
+ error: error51,
23413
+ dispatchAttempted,
23414
+ ...queueRetryable ? { queueRetryable: true } : {}
23415
+ };
23361
23416
  } finally {
23362
23417
  finishPromptReservation(sessionID, reservation, dispatchAttempted, postDispatchHoldMs);
23363
23418
  }
@@ -23419,6 +23474,7 @@ function schedulePromptQueueDrain(sessionID, delayMs) {
23419
23474
  promptQueueTimers.set(sessionID, timer);
23420
23475
  }
23421
23476
  function removePromptQueueEntry(sessionID, entry) {
23477
+ promptQueueRetryStates.delete(entry.id);
23422
23478
  const queue = promptQueues.get(sessionID);
23423
23479
  if (!queue) {
23424
23480
  return;
@@ -23448,6 +23504,7 @@ async function drainPromptQueue(sessionID, awaitedEntry) {
23448
23504
  promptQueueDraining.add(sessionID);
23449
23505
  clearPromptQueueTimer(sessionID);
23450
23506
  let awaitedResult;
23507
+ const deferredRetryIds = new Set;
23451
23508
  try {
23452
23509
  while (true) {
23453
23510
  const queue = promptQueues.get(sessionID);
@@ -23455,6 +23512,20 @@ async function drainPromptQueue(sessionID, awaitedEntry) {
23455
23512
  if (!entry) {
23456
23513
  break;
23457
23514
  }
23515
+ const retryState = promptQueueRetryStates.get(entry.id);
23516
+ if (entry.durableRetry && retryState?.retryAfter !== undefined && retryState.retryAfter > Date.now()) {
23517
+ if (deferredRetryIds.has(entry.id)) {
23518
+ const nextRetryAt = Math.min(...queue.flatMap((queued) => {
23519
+ const retryAfter = promptQueueRetryStates.get(queued.id)?.retryAfter;
23520
+ return retryAfter === undefined ? [] : [retryAfter];
23521
+ }));
23522
+ schedulePromptQueueDrain(sessionID, nextRetryAt - Date.now());
23523
+ break;
23524
+ }
23525
+ deferredRetryIds.add(entry.id);
23526
+ setPromptQueue(sessionID, [...queue.slice(1), entry]);
23527
+ continue;
23528
+ }
23458
23529
  promptQueueInFlight.set(sessionID, entry);
23459
23530
  const result = await dispatchAfterSessionIdle({
23460
23531
  sessionName: entry.sessionName,
@@ -23470,12 +23541,45 @@ async function drainPromptQueue(sessionID, awaitedEntry) {
23470
23541
  checkStatus: entry.checkStatus,
23471
23542
  checkToolState: entry.checkToolState,
23472
23543
  shouldDispatch: entry.shouldDispatch,
23544
+ retryDispatchFailure: entry.retryDispatchFailure,
23473
23545
  dispatch: entry.dispatch
23474
23546
  });
23475
23547
  if (promptQueueInFlight.get(sessionID)?.id === entry.id) {
23476
23548
  promptQueueInFlight.delete(sessionID);
23477
23549
  }
23478
- if (result.status === "active" || result.status === "reserved") {
23550
+ const retryableQueuedFailure = result.status === "failed" && (!result.dispatchAttempted || result.queueRetryable === true);
23551
+ if (retryableQueuedFailure) {
23552
+ const failureCount = (promptQueueRetryStates.get(entry.id)?.failureCount ?? 0) + 1;
23553
+ if (entry.durableRetry) {
23554
+ const exponentialBackoffMs = entry.queueRetryMs * 2 ** Math.min(failureCount, 7);
23555
+ const retryDelayMs = Math.max(entry.postDispatchHoldMs, Math.min(exponentialBackoffMs, MAX_DURABLE_RETRY_BACKOFF_MS));
23556
+ promptQueueRetryStates.set(entry.id, {
23557
+ failureCount,
23558
+ retryAfter: Date.now() + retryDelayMs
23559
+ });
23560
+ const currentQueue = promptQueues.get(sessionID);
23561
+ if (currentQueue && currentQueue.length > 1) {
23562
+ setPromptQueue(sessionID, [...currentQueue.slice(1), entry]);
23563
+ continue;
23564
+ }
23565
+ schedulePromptQueueDrain(sessionID, retryDelayMs);
23566
+ break;
23567
+ }
23568
+ if (failureCount >= MAX_QUEUED_RETRYABLE_FAILURES) {
23569
+ log("[prompt-async-gate] dropping queued prompt after repeated retryable failures", {
23570
+ sessionID,
23571
+ source: entry.source,
23572
+ failureCount
23573
+ });
23574
+ removePromptQueueEntry(sessionID, entry);
23575
+ if (awaitedEntry?.id === entry.id) {
23576
+ awaitedResult = result;
23577
+ }
23578
+ continue;
23579
+ }
23580
+ promptQueueRetryStates.set(entry.id, { failureCount });
23581
+ }
23582
+ if (result.status === "active" || result.status === "reserved" || retryableQueuedFailure) {
23479
23583
  const queued = queuedResult(entry, 1, result.status === "reserved" ? result.reservedBy : entry.source);
23480
23584
  if (awaitedEntry?.id === entry.id) {
23481
23585
  awaitedResult = queued;
@@ -23536,7 +23640,7 @@ async function enqueueInternalPrompt(entry) {
23536
23640
  const result = await drainPromptQueue(entry.sessionID, entry);
23537
23641
  return result ?? queuedResult(entry, 1);
23538
23642
  }
23539
- var promptQueues, promptQueueDraining, promptQueueInFlight, promptQueueTimers, promptQueueSequence = 0;
23643
+ var promptQueues, promptQueueDraining, promptQueueInFlight, promptQueueTimers, promptQueueRetryStates, MAX_QUEUED_RETRYABLE_FAILURES = 3, MAX_DURABLE_RETRY_BACKOFF_MS = 30000, promptQueueSequence = 0;
23540
23644
  var init_queue = __esm(() => {
23541
23645
  init_session_idle_dispatch();
23542
23646
  init_reservations();
@@ -23544,6 +23648,7 @@ var init_queue = __esm(() => {
23544
23648
  promptQueueDraining = new Set;
23545
23649
  promptQueueInFlight = new Map;
23546
23650
  promptQueueTimers = new Map;
23651
+ promptQueueRetryStates = new Map;
23547
23652
  setExpiredReservationHandler((sessionID) => {
23548
23653
  schedulePromptQueueDrain(sessionID, 0);
23549
23654
  });
@@ -23791,6 +23896,7 @@ async function dispatchInternalPrompt(args) {
23791
23896
  checkStatus: args.checkStatus !== false,
23792
23897
  checkToolState: args.checkToolState !== false,
23793
23898
  shouldDispatch: args.shouldDispatch,
23899
+ retryDispatchFailure: args.retryDispatchFailure,
23794
23900
  dispatch: (dispatchInput) => dispatchWithPathCompatibility(dispatch, dispatchInput)
23795
23901
  });
23796
23902
  if (deferResult.status === "failed" && resolved.route === "live" && deferResult.error instanceof Error && deferResult.error.message.startsWith(dispatchTimeoutPrefix)) {
@@ -23818,7 +23924,9 @@ async function dispatchInternalPrompt(args) {
23818
23924
  queueRetryMs,
23819
23925
  checkStatus: args.checkStatus !== false,
23820
23926
  checkToolState: args.checkToolState !== false,
23927
+ durableRetry: args.durableRetry === true,
23821
23928
  shouldDispatch: args.shouldDispatch,
23929
+ retryDispatchFailure: args.retryDispatchFailure,
23822
23930
  dispatch: async (_dispatchInput) => dispatchWithPathCompatibility(dispatch, input)
23823
23931
  });
23824
23932
  }
@@ -23840,6 +23948,7 @@ async function dispatchInternalPrompt(args) {
23840
23948
  checkStatus: args.checkStatus !== false,
23841
23949
  checkToolState: args.checkToolState !== false,
23842
23950
  shouldDispatch: args.shouldDispatch,
23951
+ retryDispatchFailure: args.retryDispatchFailure,
23843
23952
  dispatch: (dispatchInput) => dispatchWithPathCompatibility(dispatch, dispatchInput)
23844
23953
  });
23845
23954
  if (directResult.status === "failed" && resolved.route === "live" && directResult.error instanceof Error && directResult.error.message.startsWith(dispatchTimeoutPrefix)) {
@@ -26052,7 +26161,7 @@ var init_resolve_agent_definition_paths = __esm(() => {
26052
26161
  // packages/omo-opencode/src/shared/opencode-version.ts
26053
26162
  import { execSync } from "child_process";
26054
26163
  import { existsSync as existsSync9, readFileSync as readFileSync3, realpathSync as realpathSync4 } from "fs";
26055
- import { dirname as dirname6, join as join13 } from "path";
26164
+ import { dirname as dirname7, join as join13 } from "path";
26056
26165
  function parseVersion(version2) {
26057
26166
  const cleaned = version2.replace(/^v/, "").split("-")[0];
26058
26167
  return cleaned.split(".").map((n) => parseInt(n, 10) || 0);
@@ -26093,7 +26202,7 @@ function parsePackageVersion(content) {
26093
26202
  function getPackageVersionFromBinary(binaryPath, deps) {
26094
26203
  try {
26095
26204
  const realBinaryPath = deps.realpath(binaryPath);
26096
- const packagePath = join13(dirname6(dirname6(realBinaryPath)), "package.json");
26205
+ const packagePath = join13(dirname7(dirname7(realBinaryPath)), "package.json");
26097
26206
  if (!deps.exists(packagePath))
26098
26207
  return null;
26099
26208
  return parsePackageVersion(deps.readText(packagePath));
@@ -26331,10 +26440,10 @@ import {
26331
26440
  } from "node:fs";
26332
26441
  function writeFileAtomically2(filePath, content, deps = {}) {
26333
26442
  const tempPath = `${filePath}.tmp`;
26334
- const mode = deps.mode;
26335
- writeFileSync3(tempPath, content, { encoding: "utf-8", mode });
26336
- if (mode !== undefined) {
26337
- chmodSync2(tempPath, mode);
26443
+ const mode2 = deps.mode;
26444
+ writeFileSync3(tempPath, content, { encoding: "utf-8", mode: mode2 });
26445
+ if (mode2 !== undefined) {
26446
+ chmodSync2(tempPath, mode2);
26338
26447
  }
26339
26448
  const tempFileDescriptor = openSync2(tempPath, "r+");
26340
26449
  try {
@@ -26355,8 +26464,8 @@ function writeFileAtomically2(filePath, content, deps = {}) {
26355
26464
  throw error51;
26356
26465
  }
26357
26466
  }
26358
- if (mode !== undefined) {
26359
- chmodSync2(filePath, mode);
26467
+ if (mode2 !== undefined) {
26468
+ chmodSync2(filePath, mode2);
26360
26469
  }
26361
26470
  }
26362
26471
  var init_write_file_atomically = __esm(() => {
@@ -83748,7 +83857,17 @@ function isPreSendConnectionFailure2(error51) {
83748
83857
  if (error51.name === "AbortError") {
83749
83858
  return false;
83750
83859
  }
83751
- const CONNECTION_CODES = new Set(["ECONNREFUSED", "ENOTFOUND", "EAI_AGAIN"]);
83860
+ const CONNECTION_CODES = new Set([
83861
+ "ECONNREFUSED",
83862
+ "ENOTFOUND",
83863
+ "EAI_AGAIN",
83864
+ "ENETUNREACH",
83865
+ "EHOSTUNREACH",
83866
+ "ENETDOWN",
83867
+ "EHOSTDOWN",
83868
+ "EADDRNOTAVAIL",
83869
+ "UND_ERR_CONNECT_TIMEOUT"
83870
+ ]);
83752
83871
  const self = error51;
83753
83872
  if (self.code && CONNECTION_CODES.has(self.code)) {
83754
83873
  return true;
@@ -83760,12 +83879,6 @@ function isPreSendConnectionFailure2(error51) {
83760
83879
  return true;
83761
83880
  }
83762
83881
  }
83763
- if (error51 instanceof TypeError) {
83764
- const msg = error51.message;
83765
- if (msg.includes("fetch failed") || msg.includes("Unable to connect")) {
83766
- return true;
83767
- }
83768
- }
83769
83882
  return false;
83770
83883
  }
83771
83884
  function markLiveRouteUnavailable2(reason) {
@@ -84092,6 +84205,17 @@ var init_session_category_registry = __esm(() => {
84092
84205
  sessionCategoryMap = new Map;
84093
84206
  });
84094
84207
 
84208
+ // packages/omo-opencode/src/shared/plugin-entry-shape.ts
84209
+ function isPluginTupleEntry(entry) {
84210
+ return Array.isArray(entry) && typeof entry[0] === "string";
84211
+ }
84212
+ function getPluginEntryName(entry) {
84213
+ return isPluginTupleEntry(entry) ? entry[0] : entry;
84214
+ }
84215
+ function withPluginEntryName(entry, name) {
84216
+ return isPluginTupleEntry(entry) ? [name, entry[1]] : name;
84217
+ }
84218
+
84095
84219
  // packages/omo-opencode/src/shared/legacy-plugin-warning.ts
84096
84220
  var init_legacy_plugin_warning = __esm(() => {
84097
84221
  init_jsonc_parser2();
@@ -84100,6 +84224,29 @@ var init_legacy_plugin_warning = __esm(() => {
84100
84224
  });
84101
84225
 
84102
84226
  // node_modules/jsonc-parser/lib/esm/main.js
84227
+ function modify2(text, path7, value, options) {
84228
+ return setProperty(text, path7, value, options);
84229
+ }
84230
+ function applyEdits2(text, edits) {
84231
+ let sortedEdits = edits.slice(0).sort((a, b) => {
84232
+ const diff = a.offset - b.offset;
84233
+ if (diff === 0) {
84234
+ return a.length - b.length;
84235
+ }
84236
+ return diff;
84237
+ });
84238
+ let lastModifiedOffset = text.length;
84239
+ for (let i = sortedEdits.length - 1;i >= 0; i--) {
84240
+ let e = sortedEdits[i];
84241
+ if (e.offset + e.length <= lastModifiedOffset) {
84242
+ text = applyEdit(text, e);
84243
+ } else {
84244
+ throw new Error("Overlapping edit");
84245
+ }
84246
+ lastModifiedOffset = e.offset;
84247
+ }
84248
+ return text;
84249
+ }
84103
84250
  var ScanError2, SyntaxKind2, ParseErrorCode2;
84104
84251
  var init_main2 = __esm(() => {
84105
84252
  init_format();
@@ -84363,7 +84510,7 @@ var init_plugin_name_with_version = __esm(() => {
84363
84510
 
84364
84511
  // packages/omo-opencode/src/cli/config-manager/backup-config.ts
84365
84512
  import { copyFileSync as copyFileSync2, existsSync as existsSync16, mkdirSync as mkdirSync6 } from "node:fs";
84366
- import { dirname as dirname7 } from "node:path";
84513
+ import { dirname as dirname8 } from "node:path";
84367
84514
  function backupConfigFile(configPath) {
84368
84515
  if (!existsSync16(configPath)) {
84369
84516
  return { success: true };
@@ -84371,7 +84518,7 @@ function backupConfigFile(configPath) {
84371
84518
  const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
84372
84519
  const backupPath = `${configPath}.backup-${timestamp}`;
84373
84520
  try {
84374
- const dir = dirname7(backupPath);
84521
+ const dir = dirname8(backupPath);
84375
84522
  if (!existsSync16(dir)) {
84376
84523
  mkdirSync6(dir, { recursive: true });
84377
84524
  }
@@ -84569,7 +84716,7 @@ function extractVersionFromPluginEntry(entry) {
84569
84716
 
84570
84717
  // packages/omo-opencode/src/cli/config-manager/add-plugin-to-opencode-config.ts
84571
84718
  import { existsSync as existsSync19, readdirSync as readdirSync4, readFileSync as readFileSync8, writeFileSync as writeFileSync5 } from "node:fs";
84572
- import { basename as basename3, dirname as dirname8, join as join21 } from "node:path";
84719
+ import { basename as basename3, dirname as dirname9, join as join21 } from "node:path";
84573
84720
  function detectConfigFormatInDir(configDir) {
84574
84721
  const configJsonc = join21(configDir, "opencode.jsonc");
84575
84722
  const configJson = join21(configDir, "opencode.json");
@@ -84582,10 +84729,10 @@ function detectConfigFormatInDir(configDir) {
84582
84729
  return { format: "none", path: configJson };
84583
84730
  }
84584
84731
  function getParentConfigDirForProfile(configDir) {
84585
- const parentDir = dirname8(configDir);
84732
+ const parentDir = dirname9(configDir);
84586
84733
  if (basename3(parentDir) !== "profiles")
84587
84734
  return null;
84588
- return dirname8(parentDir);
84735
+ return dirname9(parentDir);
84589
84736
  }
84590
84737
  function listProfileConfigDirs(rootConfigDir) {
84591
84738
  const profilesDir = join21(rootConfigDir, "profiles");
@@ -84612,13 +84759,14 @@ function getConfigTargets() {
84612
84759
  });
84613
84760
  }
84614
84761
  function isSourceOmoPluginEntry(plugin) {
84615
- const normalized = plugin.toLowerCase().replaceAll("\\", "/");
84762
+ const normalized = getPluginEntryName(plugin).toLowerCase().replaceAll("\\", "/");
84616
84763
  if (!normalized.startsWith("file://"))
84617
84764
  return false;
84618
84765
  return /\/(omo(?:-[^/]*)?|oh-my-opencode|oh-my-openagent)\/(src|dist)\/index\.(ts|js)$/.test(normalized);
84619
84766
  }
84620
84767
  function isPackageOmoPluginEntry(plugin) {
84621
- return plugin === PLUGIN_NAME || plugin.startsWith(`${PLUGIN_NAME}@`) || plugin === LEGACY_PLUGIN_NAME || plugin.startsWith(`${LEGACY_PLUGIN_NAME}@`);
84768
+ const name = getPluginEntryName(plugin);
84769
+ return name === PLUGIN_NAME || name.startsWith(`${PLUGIN_NAME}@`) || name === LEGACY_PLUGIN_NAME || name.startsWith(`${LEGACY_PLUGIN_NAME}@`);
84622
84770
  }
84623
84771
  function isOurPlugin(plugin) {
84624
84772
  return isPackageOmoPluginEntry(plugin) || isSourceOmoPluginEntry(plugin);
@@ -84640,6 +84788,9 @@ function choosePluginEntry(params) {
84640
84788
  if (params.preferredSourceEntry) {
84641
84789
  return params.preferredSourceEntry;
84642
84790
  }
84791
+ if (params.existingEntry) {
84792
+ return withPluginEntryName(params.existingEntry, params.fallbackEntry);
84793
+ }
84643
84794
  return params.fallbackEntry;
84644
84795
  }
84645
84796
  function writePluginEntryToTarget(params) {
@@ -84673,7 +84824,7 @@ function writePluginEntryToTarget(params) {
84673
84824
  preferredSourceEntry
84674
84825
  });
84675
84826
  if (existingEntry && !preferredSourceEntry) {
84676
- const installedVersion = extractVersionFromPluginEntry(existingEntry);
84827
+ const installedVersion = extractVersionFromPluginEntry(getPluginEntryName(existingEntry));
84677
84828
  const compatibility = checkVersionCompatibility(installedVersion, currentVersion);
84678
84829
  if (!compatibility.canUpgrade) {
84679
84830
  return {
@@ -84696,20 +84847,12 @@ function writePluginEntryToTarget(params) {
84696
84847
  config3.plugin = normalizedPlugins;
84697
84848
  if (target.format === "jsonc") {
84698
84849
  const content = readFileSync8(target.path, "utf-8");
84699
- const pluginArrayRegex = /((?:"plugin"|plugin)\s*:\s*)\[([\s\S]*?)\]/;
84700
- const match = content.match(pluginArrayRegex);
84701
- if (match) {
84702
- const formattedPlugins = normalizedPlugins.map((p) => `"${p}"`).join(`,
84703
- `);
84704
- const newContent = content.replace(pluginArrayRegex, `$1[
84705
- ${formattedPlugins}
84706
- ]`);
84707
- writeFileSync5(target.path, newContent);
84708
- } else {
84709
- const newContent = content.replace(/(\{)/, `$1
84710
- "plugin": ["${nextPluginEntry}"],`);
84711
- writeFileSync5(target.path, newContent);
84712
- }
84850
+ const edits = modify2(content, ["plugin"], normalizedPlugins, {
84851
+ formattingOptions: { insertSpaces: true, tabSize: 2, eol: `
84852
+ ` },
84853
+ getInsertionIndex: () => 0
84854
+ });
84855
+ writeFileSync5(target.path, applyEdits2(content, edits));
84713
84856
  } else {
84714
84857
  writeFileSync5(target.path, JSON.stringify(config3, null, 2) + `
84715
84858
  `);
@@ -84754,6 +84897,7 @@ async function addPluginToOpenCodeConfig(currentVersion) {
84754
84897
  return primaryResult ?? { success: true, configPath: primaryTarget.path };
84755
84898
  }
84756
84899
  var init_add_plugin_to_opencode_config = __esm(() => {
84900
+ init_main2();
84757
84901
  init_shared();
84758
84902
  init_backup_config();
84759
84903
  init_config_context();
@@ -86283,10 +86427,12 @@ function detectProvidersFromOmoConfig() {
86283
86427
  }
86284
86428
  }
86285
86429
  function isOurPlugin2(plugin) {
86286
- return plugin === PLUGIN_NAME || plugin.startsWith(`${PLUGIN_NAME}@`) || plugin === LEGACY_PLUGIN_NAME || plugin.startsWith(`${LEGACY_PLUGIN_NAME}@`);
86430
+ const name = getPluginEntryName(plugin);
86431
+ return name === PLUGIN_NAME || name.startsWith(`${PLUGIN_NAME}@`) || name === LEGACY_PLUGIN_NAME || name.startsWith(`${LEGACY_PLUGIN_NAME}@`);
86287
86432
  }
86288
86433
  function findOurPluginEntry2(plugins) {
86289
- return plugins.find(isOurPlugin2) ?? null;
86434
+ const entry = plugins.find(isOurPlugin2);
86435
+ return entry === undefined ? null : getPluginEntryName(entry);
86290
86436
  }
86291
86437
  function detectCurrentConfig() {
86292
86438
  const result = {
@@ -86719,7 +86865,7 @@ var init_env2 = __esm(() => {
86719
86865
  });
86720
86866
 
86721
86867
  // node_modules/.bun/posthog-node@5.51.1/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
86722
- import { dirname as dirname17, posix as posix7, sep as sep7 } from "path";
86868
+ import { dirname as dirname18, posix as posix7, sep as sep7 } from "path";
86723
86869
  function createModulerModifier() {
86724
86870
  const getModuleFromFileName = createGetModuleFromFilename();
86725
86871
  return async (frames) => {
@@ -86728,7 +86874,7 @@ function createModulerModifier() {
86728
86874
  return frames;
86729
86875
  };
86730
86876
  }
86731
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
86877
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(process.argv[1]) : process.cwd(), isWindows = sep7 === "\\") {
86732
86878
  const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
86733
86879
  return (filename) => {
86734
86880
  if (!filename)
@@ -92062,7 +92208,7 @@ function splitNodeOptions(nodeOptions) {
92062
92208
  return args;
92063
92209
  }
92064
92210
  function findUnhandledRejectionMode(args) {
92065
- let mode;
92211
+ let mode2;
92066
92212
  for (let index = 0;index < args.length; index++) {
92067
92213
  const argument = args[index];
92068
92214
  const optionName = UNHANDLED_REJECTION_OPTION_NAMES.find((name) => argument === name || argument.startsWith(`${name}=`));
@@ -92070,9 +92216,9 @@ function findUnhandledRejectionMode(args) {
92070
92216
  continue;
92071
92217
  const value = argument === optionName ? args[++index] : argument.slice(optionName.length + 1);
92072
92218
  if (UNHANDLED_REJECTION_MODES.has(value))
92073
- mode = value;
92219
+ mode2 = value;
92074
92220
  }
92075
- return mode;
92221
+ return mode2;
92076
92222
  }
92077
92223
  function getUnhandledRejectionMode(execArgv = STARTUP_EXEC_ARGV, nodeOptions = STARTUP_NODE_OPTIONS) {
92078
92224
  return findUnhandledRejectionMode(execArgv) ?? findUnhandledRejectionMode(splitNodeOptions(nodeOptions ?? "")) ?? "throw";
@@ -92098,17 +92244,17 @@ function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
92098
92244
  _posthogErrorHandler: true
92099
92245
  });
92100
92246
  }
92101
- function addUncaughtExceptionListener(captureFn, onFatalFn, mode = STARTUP_UNHANDLED_REJECTION_MODE) {
92247
+ function addUncaughtExceptionListener(captureFn, onFatalFn, mode2 = STARTUP_UNHANDLED_REJECTION_MODE) {
92102
92248
  const process4 = globalThis.process;
92103
92249
  if (!process4)
92104
92250
  return;
92105
- if (mode === "strict")
92251
+ if (mode2 === "strict")
92106
92252
  return void process4.on("uncaughtExceptionMonitor", (error51, origin) => captureUncaughtException(captureFn, error51, origin));
92107
92253
  process4.on("uncaughtException", makeUncaughtExceptionHandler(captureFn, onFatalFn));
92108
92254
  }
92109
- function addUnhandledRejectionListener(captureFn, mode = STARTUP_UNHANDLED_REJECTION_MODE) {
92255
+ function addUnhandledRejectionListener(captureFn, mode2 = STARTUP_UNHANDLED_REJECTION_MODE) {
92110
92256
  const process4 = globalThis.process;
92111
- if (!process4 || mode === "throw" || mode === "strict" || mode === "warn-with-error-code")
92257
+ if (!process4 || mode2 === "throw" || mode2 === "strict" || mode2 === "warn-with-error-code")
92112
92258
  return;
92113
92259
  process4.on("unhandledRejection", (reason) => {
92114
92260
  captureFn(reason, {
@@ -94333,7 +94479,7 @@ var package_default2;
94333
94479
  var init_package2 = __esm(() => {
94334
94480
  package_default2 = {
94335
94481
  name: "@oh-my-opencode/omo-codex",
94336
- version: "5.0.0-beta.25",
94482
+ version: "5.0.0-beta.28",
94337
94483
  type: "module",
94338
94484
  private: true,
94339
94485
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -95303,19 +95449,19 @@ var init_update_toasts = __esm(() => {
95303
95449
 
95304
95450
  // packages/omo-opencode/src/hooks/auto-update-checker/hook/background-update-check.ts
95305
95451
  import { existsSync as existsSync48 } from "node:fs";
95306
- import { dirname as dirname30, join as join76 } from "node:path";
95452
+ import { dirname as dirname31, join as join76 } from "node:path";
95307
95453
  import { fileURLToPath as fileURLToPath5 } from "node:url";
95308
95454
  function defaultGetModuleHostingWorkspace() {
95309
95455
  try {
95310
- const currentDir = dirname30(fileURLToPath5(import.meta.url));
95456
+ const currentDir = dirname31(fileURLToPath5(import.meta.url));
95311
95457
  const pkgJsonPath = findPackageJsonUp(currentDir);
95312
95458
  if (!pkgJsonPath)
95313
95459
  return null;
95314
- const pkgDir = dirname30(pkgJsonPath);
95315
- const nodeModulesDir = dirname30(pkgDir);
95460
+ const pkgDir = dirname31(pkgJsonPath);
95461
+ const nodeModulesDir = dirname31(pkgDir);
95316
95462
  if (nodeModulesDir.split(/[\\/]/).pop() !== "node_modules")
95317
95463
  return null;
95318
- return dirname30(nodeModulesDir);
95464
+ return dirname31(nodeModulesDir);
95319
95465
  } catch (error51) {
95320
95466
  if (error51 instanceof Error) {
95321
95467
  return null;
@@ -97864,9 +98010,9 @@ function formatConfigSummary(config3) {
97864
98010
  `);
97865
98011
  }
97866
98012
  function printHeader(isUpdate) {
97867
- const mode = isUpdate ? "Update" : "Install";
98013
+ const mode2 = isUpdate ? "Update" : "Install";
97868
98014
  console.log();
97869
- console.log(import_picocolors.default.bgMagenta(import_picocolors.default.white(` oMoMoMoMo... ${mode} `)));
98015
+ console.log(import_picocolors.default.bgMagenta(import_picocolors.default.white(` oMoMoMoMo... ${mode2} `)));
97870
98016
  console.log();
97871
98017
  }
97872
98018
  function printStep(step, total, message) {
@@ -98145,7 +98291,7 @@ function windowsCommandShim(targetPath) {
98145
98291
 
98146
98292
  // packages/omo-codex/src/install/codex-cache-dangling-bins.ts
98147
98293
  import { lstat as lstat2, readFile, readdir, readlink, rm, stat } from "node:fs/promises";
98148
- import { dirname as dirname9, isAbsolute, join as join23, resolve as resolve5 } from "node:path";
98294
+ import { dirname as dirname10, isAbsolute, join as join23, resolve as resolve5 } from "node:path";
98149
98295
 
98150
98296
  // packages/omo-codex/src/install/codex-cache-fs.ts
98151
98297
  import { lstat } from "node:fs/promises";
@@ -98192,7 +98338,7 @@ async function removeDanglingManagedSymlink(linkPath) {
98192
98338
  if (!linkStat.isSymbolicLink())
98193
98339
  return;
98194
98340
  const linkTarget = await readlink(linkPath);
98195
- const target = isAbsolute(linkTarget) ? linkTarget : resolve5(dirname9(linkPath), linkTarget);
98341
+ const target = isAbsolute(linkTarget) ? linkTarget : resolve5(dirname10(linkPath), linkTarget);
98196
98342
  if (!await isFileSystemEntry(target) && isManagedComponentBinTarget(target))
98197
98343
  await rm(linkPath, { force: true });
98198
98344
  } catch (error51) {
@@ -98654,11 +98800,11 @@ async function existingNonSymlink(path7) {
98654
98800
  }
98655
98801
  // packages/omo-codex/src/install/codex-cache-install.ts
98656
98802
  import { cp as cp2, mkdir as mkdir3, readFile as readFile8, readdir as readdir4, rename, rm as rm4 } from "node:fs/promises";
98657
- import { basename as basename5, dirname as dirname12, join as join32, sep as sep5 } from "node:path";
98803
+ import { basename as basename5, dirname as dirname13, join as join32, sep as sep5 } from "node:path";
98658
98804
 
98659
98805
  // packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
98660
98806
  import { cp, mkdir as mkdir2, readFile as readFile4, stat as stat3 } from "node:fs/promises";
98661
- import { dirname as dirname10, join as join27, resolve as resolve7 } from "node:path";
98807
+ import { dirname as dirname11, join as join27, resolve as resolve7 } from "node:path";
98662
98808
  var BUNDLED_MCP_RUNTIMES = [
98663
98809
  {
98664
98810
  label: "Git Bash MCP",
@@ -98693,7 +98839,7 @@ async function copyBundledMcpRuntimeDist(pluginRoot, sourceRoot, runtime4) {
98693
98839
  throw new Error(`missing built ${runtime4.label} dist at ${sourcePath}`);
98694
98840
  }
98695
98841
  const destinationPath = join27(pluginRoot, runtime4.destinationDistFromPlugin);
98696
- await mkdir2(dirname10(destinationPath), { recursive: true });
98842
+ await mkdir2(dirname11(destinationPath), { recursive: true });
98697
98843
  await cp(sourcePath, destinationPath, { recursive: true });
98698
98844
  }
98699
98845
  async function readSourceMcpArgs(path7) {
@@ -98731,7 +98877,7 @@ async function isDirectory(path7) {
98731
98877
  // packages/omo-codex/src/install/codex-cache-local-dependencies.ts
98732
98878
  import { realpathSync as realpathSync6 } from "node:fs";
98733
98879
  import { readFile as readFile5, readdir as readdir3, writeFile as writeFile2 } from "node:fs/promises";
98734
- import { dirname as dirname11, isAbsolute as isAbsolute4, join as join29, relative as relative3, resolve as resolve9, sep as sep2 } from "node:path";
98880
+ import { dirname as dirname12, isAbsolute as isAbsolute4, join as join29, relative as relative3, resolve as resolve9, sep as sep2 } from "node:path";
98735
98881
 
98736
98882
  // packages/omo-codex/src/install/codex-cache-paths.ts
98737
98883
  import { existsSync as existsSync24, readdirSync as readdirSync6 } from "node:fs";
@@ -98800,7 +98946,7 @@ async function rewriteCachedPackageLocalFileDependencies(pluginRoot, sourceRoot)
98800
98946
  const parsed = JSON.parse(raw);
98801
98947
  if (!isPlainRecord4(parsed))
98802
98948
  continue;
98803
- const packageDir = dirname11(packageJsonPath);
98949
+ const packageDir = dirname12(packageJsonPath);
98804
98950
  const sourcePackageDir = join29(sourceRoot, relative3(pluginRoot, packageDir));
98805
98951
  let changed = false;
98806
98952
  for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
@@ -99195,13 +99341,13 @@ function sanitizeNpmInstallEnv(env2) {
99195
99341
  return Object.fromEntries(Object.entries(env2).filter(([key]) => key.toLowerCase() !== "npm_config_allow_scripts"));
99196
99342
  }
99197
99343
  function createTempSiblingPath(targetPath) {
99198
- return join32(dirname12(targetPath), `.tmp-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99344
+ return join32(dirname13(targetPath), `.tmp-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99199
99345
  }
99200
99346
  function createBackupSiblingPath(targetPath) {
99201
- return join32(dirname12(targetPath), `.backup-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99347
+ return join32(dirname13(targetPath), `.backup-${basename5(targetPath)}-${process.pid}-${Date.now()}`);
99202
99348
  }
99203
99349
  async function copyDirectory(sourcePath, targetPath) {
99204
- await mkdir3(dirname12(targetPath), { recursive: true });
99350
+ await mkdir3(dirname13(targetPath), { recursive: true });
99205
99351
  await cp2(sourcePath, targetPath, { recursive: true, filter: (source) => shouldCopyPluginPath(source, sourcePath) });
99206
99352
  }
99207
99353
  async function promoteDirectory(tempPath, targetPath, renameDirectory) {
@@ -99300,20 +99446,20 @@ async function copyRootRuntimeDists(input) {
99300
99446
  const sourcePath = join32(repoRoot, runtimePath);
99301
99447
  if (!await fileExistsStrict(join32(sourcePath, "index.js")))
99302
99448
  continue;
99303
- await mkdir3(dirname12(join32(input.pluginRoot, runtimePath)), { recursive: true });
99449
+ await mkdir3(dirname13(join32(input.pluginRoot, runtimePath)), { recursive: true });
99304
99450
  await cp2(sourcePath, join32(input.pluginRoot, runtimePath), { recursive: true });
99305
99451
  }
99306
99452
  }
99307
99453
  function repoRootForCodexPluginSource(sourcePath) {
99308
- const codexPackageRoot = dirname12(sourcePath);
99309
- const packagesRoot = dirname12(codexPackageRoot);
99454
+ const codexPackageRoot = dirname13(sourcePath);
99455
+ const packagesRoot = dirname13(codexPackageRoot);
99310
99456
  if (basename5(sourcePath) !== "plugin")
99311
99457
  return null;
99312
99458
  if (basename5(codexPackageRoot) !== "omo-codex")
99313
99459
  return null;
99314
99460
  if (basename5(packagesRoot) !== "packages")
99315
99461
  return null;
99316
- return dirname12(packagesRoot);
99462
+ return dirname13(packagesRoot);
99317
99463
  }
99318
99464
  // packages/omo-codex/src/install/codex-cache-prune.ts
99319
99465
  import { lstat as lstat5, readdir as readdir5, rm as rm5, stat as stat4 } from "node:fs/promises";
@@ -99444,7 +99590,7 @@ async function shouldBuildSourcePackages(repoRoot) {
99444
99590
 
99445
99591
  // packages/omo-codex/src/install/codex-config-toml.ts
99446
99592
  import { mkdir as mkdir5, readFile as readFile11 } from "node:fs/promises";
99447
- import { dirname as dirname15 } from "node:path";
99593
+ import { dirname as dirname16 } from "node:path";
99448
99594
 
99449
99595
  // packages/omo-codex/src/install/toml-section-editor.ts
99450
99596
  function findTomlSection(config3, header) {
@@ -100026,12 +100172,12 @@ function tomlKeySegment(value) {
100026
100172
 
100027
100173
  // packages/omo-codex/src/install/codex-config-atomic-write.ts
100028
100174
  import { lstat as lstat6, readlink as readlink4, realpath, rename as rename3, unlink, writeFile as writeFile5 } from "node:fs/promises";
100029
- import { basename as basename6, dirname as dirname13, isAbsolute as isAbsolute5, join as join36, resolve as resolve10 } from "node:path";
100175
+ import { basename as basename6, dirname as dirname14, isAbsolute as isAbsolute5, join as join36, resolve as resolve10 } from "node:path";
100030
100176
  var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
100031
100177
  var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
100032
100178
  async function writeFileAtomic(targetPath, data) {
100033
100179
  const writeTarget = await resolveSymlinkTarget(targetPath);
100034
- const temporaryPath = join36(dirname13(writeTarget), `.tmp-${basename6(writeTarget)}-${process.pid}-${Date.now()}`);
100180
+ const temporaryPath = join36(dirname14(writeTarget), `.tmp-${basename6(writeTarget)}-${process.pid}-${Date.now()}`);
100035
100181
  await writeFile5(temporaryPath, data);
100036
100182
  try {
100037
100183
  await renameWithRetry(temporaryPath, writeTarget);
@@ -100060,7 +100206,7 @@ async function resolveSymlinkTarget(targetPath) {
100060
100206
  if (!(error51 instanceof Error))
100061
100207
  throw error51;
100062
100208
  const linkValue = await readlink4(targetPath);
100063
- return isAbsolute5(linkValue) ? linkValue : resolve10(dirname13(targetPath), linkValue);
100209
+ return isAbsolute5(linkValue) ? linkValue : resolve10(dirname14(targetPath), linkValue);
100064
100210
  }
100065
100211
  }
100066
100212
  async function renameWithRetry(fromPath, toPath) {
@@ -100540,14 +100686,14 @@ import { join as join37 } from "node:path";
100540
100686
  var FALLBACK_CODEX_MODEL_CATALOG = {
100541
100687
  current: {
100542
100688
  model: "gpt-5.6-sol",
100543
- modelContextWindow: 372000,
100689
+ modelContextWindow: 650000,
100544
100690
  modelReasoningEffort: "high",
100545
100691
  planModeReasoningEffort: "xhigh"
100546
100692
  },
100547
100693
  managedProfiles: [
100548
100694
  {
100549
100695
  model: "gpt-5.5",
100550
- modelContextWindow: 400000,
100696
+ modelContextWindow: 650000,
100551
100697
  modelReasoningEffort: "high",
100552
100698
  planModeReasoningEffort: "xhigh"
100553
100699
  },
@@ -100645,7 +100791,7 @@ function isRootSetting2(line, key) {
100645
100791
 
100646
100792
  // packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
100647
100793
  import { readFileSync as readFileSync11 } from "node:fs";
100648
- import { dirname as dirname14, isAbsolute as isAbsolute6, join as join38 } from "node:path";
100794
+ import { dirname as dirname15, isAbsolute as isAbsolute6, join as join38 } from "node:path";
100649
100795
  var CODEX_AGENTS_HEADER = "agents";
100650
100796
  var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
100651
100797
  var CODEX_MULTI_AGENT_V2_THREAD_LIMIT_KEY = `${CODEX_MULTI_AGENT_V2_HEADER}.max_concurrent_threads_per_session`;
@@ -100682,8 +100828,8 @@ function resolveCodexMultiAgentVersion(config3, configPath) {
100682
100828
  }
100683
100829
  function resolveCatalogPath(configuredPath, configPath) {
100684
100830
  if (configuredPath === null)
100685
- return join38(dirname14(configPath), "models_cache.json");
100686
- return isAbsolute6(configuredPath) ? configuredPath : join38(dirname14(configPath), configuredPath);
100831
+ return join38(dirname15(configPath), "models_cache.json");
100832
+ return isAbsolute6(configuredPath) ? configuredPath : join38(dirname15(configPath), configuredPath);
100687
100833
  }
100688
100834
  function readCatalogMultiAgentVersion(model, cachePath) {
100689
100835
  let raw;
@@ -100787,7 +100933,7 @@ function readBooleanSetting(sectionText, key) {
100787
100933
 
100788
100934
  // packages/omo-codex/src/install/codex-config-toml.ts
100789
100935
  async function updateCodexConfig(input) {
100790
- await mkdir5(dirname15(input.configPath), { recursive: true });
100936
+ await mkdir5(dirname16(input.configPath), { recursive: true });
100791
100937
  let config3;
100792
100938
  try {
100793
100939
  config3 = await readFile11(input.configPath, "utf8");
@@ -101760,7 +101906,7 @@ var defaultRunCommand = async (command, args, options) => {
101760
101906
 
101761
101907
  // packages/omo-codex/src/install/codex-project-local-cleanup.ts
101762
101908
  import { copyFile as copyFile2, lstat as lstat10, readFile as readFile17, writeFile as writeFile10 } from "node:fs/promises";
101763
- import { dirname as dirname16, join as join46, resolve as resolve11 } from "node:path";
101909
+ import { dirname as dirname17, join as join46, resolve as resolve11 } from "node:path";
101764
101910
  var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
101765
101911
  var PROJECT_LOCAL_ARTIFACT_PATHS = [
101766
101912
  ".codex/hooks.json",
@@ -101880,13 +102026,13 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
101880
102026
  artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
101881
102027
  };
101882
102028
  }
101883
- const parent = dirname16(current);
102029
+ const parent = dirname17(current);
101884
102030
  if (parent === current) {
101885
102031
  const nearestConfigPath = configPathsFromCwd[0];
101886
102032
  return nearestConfigPath === undefined ? null : {
101887
- projectRoot: dirname16(dirname16(nearestConfigPath)),
102033
+ projectRoot: dirname17(dirname17(nearestConfigPath)),
101888
102034
  configPaths: [nearestConfigPath],
101889
- artifactRoots: [dirname16(dirname16(nearestConfigPath))]
102035
+ artifactRoots: [dirname17(dirname17(nearestConfigPath))]
101890
102036
  };
101891
102037
  }
101892
102038
  current = parent;
@@ -101902,7 +102048,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
101902
102048
  function artifactRootsForConfigPaths(configPaths2) {
101903
102049
  const roots = [];
101904
102050
  for (const configPath of configPaths2) {
101905
- const root = dirname16(dirname16(configPath));
102051
+ const root = dirname17(dirname17(configPath));
101906
102052
  if (!roots.includes(root))
101907
102053
  roots.push(root);
101908
102054
  }
@@ -102812,7 +102958,7 @@ import { isAbsolute as isAbsolute11, join as join58, relative as relative6, reso
102812
102958
 
102813
102959
  // packages/omo-codex/src/install/codex-cleanup-bins.ts
102814
102960
  import { lstat as lstat12, readFile as readFile22, readdir as readdir12, readlink as readlink6, rm as rm11 } from "node:fs/promises";
102815
- import { dirname as dirname18, isAbsolute as isAbsolute9, join as join56, resolve as resolve14 } from "node:path";
102961
+ import { dirname as dirname19, isAbsolute as isAbsolute9, join as join56, resolve as resolve14 } from "node:path";
102816
102962
  var ROOT_RUNTIME_BIN_NAME = "omo";
102817
102963
  var MANAGED_CODEX_BIN_NAMES = new Set([
102818
102964
  ROOT_RUNTIME_BIN_NAME,
@@ -102869,7 +103015,7 @@ async function isManagedCodexBin(linkPath, platform, binName) {
102869
103015
  if (platform === "win32")
102870
103016
  return false;
102871
103017
  const linkTarget = await readlink6(linkPath);
102872
- const target = isAbsolute9(linkTarget) ? linkTarget : resolve14(dirname18(linkPath), linkTarget);
103018
+ const target = isAbsolute9(linkTarget) ? linkTarget : resolve14(dirname19(linkPath), linkTarget);
102873
103019
  return isManagedComponentBinTarget(target) || isLegacyCodexBinTarget(binName, target);
102874
103020
  }
102875
103021
  if (!entryStat.isFile())
@@ -102880,7 +103026,7 @@ async function isManagedCodexBin(linkPath, platform, binName) {
102880
103026
 
102881
103027
  // packages/omo-codex/src/install/codex-cleanup-config.ts
102882
103028
  import { lstat as lstat13, mkdir as mkdir8, readFile as readFile23, writeFile as writeFile13 } from "node:fs/promises";
102883
- import { dirname as dirname19 } from "node:path";
103029
+ import { dirname as dirname20 } from "node:path";
102884
103030
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
102885
103031
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
102886
103032
  var CURRENT_MANAGED_CODEX_AGENT_NAMES2 = [
@@ -102917,7 +103063,7 @@ async function cleanupCodexConfig(configPath, now) {
102917
103063
  if (next === original)
102918
103064
  return { changed: false };
102919
103065
  const backupPath = `${configPath}.backup-${formatBackupTimestamp2(now?.() ?? new Date)}`;
102920
- await mkdir8(dirname19(configPath), { recursive: true });
103066
+ await mkdir8(dirname20(configPath), { recursive: true });
102921
103067
  await writeFile13(backupPath, original);
102922
103068
  await writeFile13(configPath, `${next.trimEnd()}
102923
103069
  `);
@@ -102996,10 +103142,10 @@ function nodeErrorCode5(error51) {
102996
103142
  }
102997
103143
 
102998
103144
  // packages/omo-codex/src/install/codex-cleanup-safety.ts
102999
- import { dirname as dirname20, isAbsolute as isAbsolute10, join as join57, relative as relative5, resolve as resolve15 } from "node:path";
103145
+ import { dirname as dirname21, isAbsolute as isAbsolute10, join as join57, relative as relative5, resolve as resolve15 } from "node:path";
103000
103146
  function codexHomeResolvesToFilesystemRoot(codexHome) {
103001
103147
  const resolved = resolve15(codexHome);
103002
- return dirname20(resolved) === resolved;
103148
+ return dirname21(resolved) === resolved;
103003
103149
  }
103004
103150
  function validateManagedCleanupTarget(input) {
103005
103151
  if (!isAbsolute10(input.path))
@@ -103262,7 +103408,7 @@ var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", ".
103262
103408
  import { execFile as execFile4 } from "node:child_process";
103263
103409
  import { existsSync as existsSync32 } from "node:fs";
103264
103410
  import { homedir as homedir11 } from "node:os";
103265
- import { dirname as dirname24, join as join63, resolve as resolve20 } from "node:path";
103411
+ import { dirname as dirname25, join as join63, resolve as resolve20 } from "node:path";
103266
103412
  import { fileURLToPath } from "node:url";
103267
103413
  import { promisify as promisify3 } from "node:util";
103268
103414
 
@@ -103293,9 +103439,9 @@ function resolveAgentHome(options) {
103293
103439
  }
103294
103440
 
103295
103441
  // packages/omo-senpi/src/install/local-launcher.ts
103296
- import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync, writeFileSync as writeFileSync6 } from "node:fs";
103442
+ import { chmodSync as chmodSync3, existsSync as existsSync31, mkdirSync as mkdirSync10, readFileSync as readFileSync14, rmSync as rmSync2, writeFileSync as writeFileSync6 } from "node:fs";
103297
103443
  import { homedir as homedir10 } from "node:os";
103298
- import { dirname as dirname21, join as join60, resolve as resolve18 } from "node:path";
103444
+ import { dirname as dirname22, join as join60, resolve as resolve18 } from "node:path";
103299
103445
  var MARKER = "omo-local-launcher";
103300
103446
  function localLauncherPath(homeDir = homedir10()) {
103301
103447
  return join60(homeDir, ".local", "bin", "omo");
@@ -103366,7 +103512,7 @@ function installLocalLauncher(options) {
103366
103512
  const path7 = localLauncherPath(options.homeDir);
103367
103513
  if (existsSync31(path7) && !readFileSync14(path7, "utf8").includes(MARKER))
103368
103514
  return;
103369
- mkdirSync10(dirname21(path7), { recursive: true });
103515
+ mkdirSync10(dirname22(path7), { recursive: true });
103370
103516
  writeFileSync6(path7, renderLocalLauncher(options));
103371
103517
  chmodSync3(path7, 493);
103372
103518
  if ((options.platform ?? process.platform) === "win32") {
@@ -103381,12 +103527,12 @@ node "%~dp0omo" %*\r
103381
103527
  import { createHash as createHash5 } from "node:crypto";
103382
103528
  import { constants as constants9 } from "node:fs";
103383
103529
  import { access as access2, readFile as readFile26, stat as stat6 } from "node:fs/promises";
103384
- import { dirname as dirname23, join as join62 } from "node:path";
103530
+ import { dirname as dirname24, join as join62 } from "node:path";
103385
103531
 
103386
103532
  // packages/omo-senpi/src/install/senpi-settings.ts
103387
103533
  import { constants as constants8 } from "node:fs";
103388
103534
  import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile25, rename as rename5, writeFile as writeFile14 } from "node:fs/promises";
103389
- import { dirname as dirname22, join as join61, resolve as resolve19 } from "node:path";
103535
+ import { dirname as dirname23, join as join61, resolve as resolve19 } from "node:path";
103390
103536
  var OMO_SENPI_PACKAGE_NAME = "@code-yeongyu/omo-senpi";
103391
103537
  var LEGACY_BUILTIN_SHADOW_PACKAGES = [
103392
103538
  join61("packages", "pi-goal"),
@@ -103433,7 +103579,7 @@ async function removeSupersededOmoPackages(packages, currentPluginPath, agentDir
103433
103579
  return entries.filter((entry) => entry !== undefined);
103434
103580
  }
103435
103581
  async function writeSettingsAtomically(settingsPath, settings) {
103436
- await mkdir9(dirname22(settingsPath), { recursive: true });
103582
+ await mkdir9(dirname23(settingsPath), { recursive: true });
103437
103583
  const backupPath = await nextBackupPath(settingsPath);
103438
103584
  if (await fileExists(settingsPath)) {
103439
103585
  await copyFile3(settingsPath, backupPath);
@@ -103553,7 +103699,7 @@ async function hasMissingPluginArtifact(pluginPath) {
103553
103699
  }
103554
103700
  async function verifyAstGrepRuntimeIntegrity(pluginPath, platform) {
103555
103701
  const runtimeEntry = join62(pluginPath, "runtime", "ast-grep-mcp", "cli.js");
103556
- const manifestPath = join62(dirname23(runtimeEntry), "manifest.json");
103702
+ const manifestPath = join62(dirname24(runtimeEntry), "manifest.json");
103557
103703
  let runtimeStat;
103558
103704
  try {
103559
103705
  runtimeStat = await stat6(runtimeEntry);
@@ -103643,7 +103789,7 @@ async function runSenpiInstaller(options = {}) {
103643
103789
  function resolveInstallContext(options) {
103644
103790
  const env3 = options.env ?? process.env;
103645
103791
  const allowBuild = options.pluginPath === undefined;
103646
- const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname24(fileURLToPath(import.meta.url))) : dirname24(resolve20(options.pluginPath))));
103792
+ const repoRoot = resolve20(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname25(fileURLToPath(import.meta.url))) : dirname25(resolve20(options.pluginPath))));
103647
103793
  const agentDir = resolve20(options.agentDir ?? resolveAgentHome({ env: env3, homeDir: env3.HOME ?? homedir11() }));
103648
103794
  const pluginPath = resolve20(options.pluginPath ?? join63(repoRoot, "packages", "omo-senpi", "plugin"));
103649
103795
  return {
@@ -107647,7 +107793,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
107647
107793
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
107648
107794
  init_bun_which_shim();
107649
107795
  init_spawn_with_windows_hide();
107650
- import { delimiter as delimiter2, dirname as dirname25, posix as posix9, win32 as win325 } from "node:path";
107796
+ import { delimiter as delimiter2, dirname as dirname26, posix as posix9, win32 as win325 } from "node:path";
107651
107797
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
107652
107798
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
107653
107799
  function getCommandCandidates(platform) {
@@ -107705,7 +107851,7 @@ async function findWorkingOpencodeBinary(pathEnv = process.env.PATH, probe2 = ca
107705
107851
  return null;
107706
107852
  }
107707
107853
  function buildPathWithBinaryFirst(pathEnv, binaryPath) {
107708
- const preferredDir = dirname25(binaryPath);
107854
+ const preferredDir = dirname26(binaryPath);
107709
107855
  const existing = (pathEnv ?? "").split(delimiter2).filter((entry) => entry.length > 0 && entry !== preferredDir);
107710
107856
  return [preferredDir, ...existing].join(delimiter2);
107711
107857
  }
@@ -108483,7 +108629,7 @@ init_state();
108483
108629
  // packages/omo-opencode/src/features/run-continuation-state/constants.ts
108484
108630
  var CONTINUATION_MARKER_DIR = ".omo/run-continuation";
108485
108631
  // packages/omo-opencode/src/features/run-continuation-state/storage.ts
108486
- import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync2, writeFileSync as writeFileSync7 } from "node:fs";
108632
+ import { existsSync as existsSync40, mkdirSync as mkdirSync12, readFileSync as readFileSync20, rmSync as rmSync3, writeFileSync as writeFileSync7 } from "node:fs";
108487
108633
  import { join as join68 } from "node:path";
108488
108634
  function getMarkerPath(directory, sessionID) {
108489
108635
  return join68(directory, CONTINUATION_MARKER_DIR, `${sessionID}.json`);
@@ -108663,7 +108809,7 @@ init_agent_display_names();
108663
108809
  // packages/omo-opencode/src/hooks/ralph-loop/storage.ts
108664
108810
  init_frontmatter2();
108665
108811
  import { existsSync as existsSync41, readFileSync as readFileSync22, writeFileSync as writeFileSync8, unlinkSync as unlinkSync6, mkdirSync as mkdirSync13 } from "node:fs";
108666
- import { dirname as dirname26, join as join70 } from "node:path";
108812
+ import { dirname as dirname27, join as join70 } from "node:path";
108667
108813
 
108668
108814
  // packages/omo-opencode/src/hooks/ralph-loop/constants.ts
108669
108815
  var DEFAULT_STATE_FILE = ".omo/ralph-loop.local.md";
@@ -109978,14 +110124,15 @@ function detectConfigPath() {
109978
110124
  return null;
109979
110125
  }
109980
110126
  function parsePluginVersion(entry) {
109981
- if (entry.startsWith(`${PLUGIN_NAME}@`)) {
109982
- const value = entry.slice(PLUGIN_NAME.length + 1);
110127
+ const name = getPluginEntryName(entry);
110128
+ if (name.startsWith(`${PLUGIN_NAME}@`)) {
110129
+ const value = name.slice(PLUGIN_NAME.length + 1);
109983
110130
  if (!value || value === "latest")
109984
110131
  return null;
109985
110132
  return value;
109986
110133
  }
109987
- if (entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)) {
109988
- const value = entry.slice(LEGACY_PLUGIN_NAME.length + 1);
110134
+ if (name.startsWith(`${LEGACY_PLUGIN_NAME}@`)) {
110135
+ const value = name.slice(LEGACY_PLUGIN_NAME.length + 1);
109989
110136
  if (!value || value === "latest")
109990
110137
  return null;
109991
110138
  return value;
@@ -109994,13 +110141,14 @@ function parsePluginVersion(entry) {
109994
110141
  }
109995
110142
  function findPluginEntry2(entries) {
109996
110143
  for (const entry of entries) {
109997
- if (entry === PLUGIN_NAME || entry.startsWith(`${PLUGIN_NAME}@`)) {
110144
+ const name = getPluginEntryName(entry);
110145
+ if (name === PLUGIN_NAME || name.startsWith(`${PLUGIN_NAME}@`)) {
109998
110146
  return { entry, isLocalDev: false };
109999
110147
  }
110000
- if (entry === LEGACY_PLUGIN_NAME || entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)) {
110148
+ if (name === LEGACY_PLUGIN_NAME || name.startsWith(`${LEGACY_PLUGIN_NAME}@`)) {
110001
110149
  return { entry, isLocalDev: false };
110002
110150
  }
110003
- if (entry.startsWith("file://") && (entry.includes(PLUGIN_NAME) || entry.includes(LEGACY_PLUGIN_NAME))) {
110151
+ if (name.startsWith("file://") && (name.includes(PLUGIN_NAME) || name.includes(LEGACY_PLUGIN_NAME))) {
110004
110152
  return { entry, isLocalDev: true };
110005
110153
  }
110006
110154
  }
@@ -110322,13 +110470,14 @@ async function checkSystem(deps = defaultDeps6) {
110322
110470
  });
110323
110471
  }
110324
110472
  if (pluginInfo.entry && !pluginInfo.isLocalDev) {
110325
- const isLegacyName = pluginInfo.entry === LEGACY_PLUGIN_NAME || pluginInfo.entry.startsWith(`${LEGACY_PLUGIN_NAME}@`);
110473
+ const entryName = getPluginEntryName(pluginInfo.entry);
110474
+ const isLegacyName = entryName === LEGACY_PLUGIN_NAME || entryName.startsWith(`${LEGACY_PLUGIN_NAME}@`);
110326
110475
  if (isLegacyName) {
110327
- const suggestedEntry = pluginInfo.entry.replace(LEGACY_PLUGIN_NAME, PLUGIN_NAME);
110476
+ const suggestedEntry = entryName.replace(LEGACY_PLUGIN_NAME, PLUGIN_NAME);
110328
110477
  issues.push({
110329
110478
  title: "Using legacy package name",
110330
110479
  description: `Your opencode.json references "${LEGACY_PLUGIN_NAME}" which has been renamed to "${PLUGIN_NAME}". The old name may stop working in a future release.`,
110331
- fix: `Update your opencode.json plugin entry: "${pluginInfo.entry}" → "${suggestedEntry}"`,
110480
+ fix: `Update your opencode.json plugin entry: "${entryName}" → "${suggestedEntry}"`,
110332
110481
  severity: "warning",
110333
110482
  affects: ["plugin loading"]
110334
110483
  });
@@ -110505,8 +110654,8 @@ function getCategoryEffectiveVariant(categoryName, requirement, config4) {
110505
110654
  }
110506
110655
 
110507
110656
  // packages/omo-opencode/src/cli/doctor/checks/model-resolution-details.ts
110508
- function formatCapabilityResolutionLabel(mode) {
110509
- return mode ?? "unknown";
110657
+ function formatCapabilityResolutionLabel(mode2) {
110658
+ return mode2 ?? "unknown";
110510
110659
  }
110511
110660
  function buildModelResolutionDetails(options) {
110512
110661
  const details = [];
@@ -110624,8 +110773,8 @@ function collectCapabilityResolutionIssues(info) {
110624
110773
  const issues = [];
110625
110774
  const allEntries = [...info.agents, ...info.categories];
110626
110775
  const fallbackEntries = allEntries.filter((entry) => {
110627
- const mode = entry.capabilityDiagnostics?.resolutionMode;
110628
- return mode === "unknown";
110776
+ const mode2 = entry.capabilityDiagnostics?.resolutionMode;
110777
+ return mode2 === "unknown";
110629
110778
  });
110630
110779
  if (fallbackEntries.length === 0) {
110631
110780
  return issues;
@@ -110901,7 +111050,7 @@ init_src2();
110901
111050
  import { existsSync as existsSync55 } from "node:fs";
110902
111051
  import { createRequire as createRequire4 } from "node:module";
110903
111052
  import { homedir as homedir19 } from "node:os";
110904
- import { dirname as dirname31, join as join83 } from "node:path";
111053
+ import { dirname as dirname32, join as join83 } from "node:path";
110905
111054
 
110906
111055
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
110907
111056
  import { join as join82 } from "path";
@@ -110998,7 +111147,7 @@ function findCommentCheckerPackageBinary(baseDirOverride, resolvePackageJsonPath
110998
111147
  const binaryName = process.platform === "win32" ? "comment-checker.exe" : "comment-checker";
110999
111148
  const platformKey = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
111000
111149
  try {
111001
- const packageDir = baseDirOverride ?? dirname31(resolvePackageJsonPath());
111150
+ const packageDir = baseDirOverride ?? dirname32(resolvePackageJsonPath());
111002
111151
  const vendorPath = join83(packageDir, "vendor", platformKey, binaryName);
111003
111152
  if (existsSync55(vendorPath))
111004
111153
  return vendorPath;
@@ -111150,7 +111299,7 @@ async function getGhCliInfo(dependencies = {}) {
111150
111299
  init_zod();
111151
111300
  init_opencode_config_dir();
111152
111301
  import { existsSync as existsSync56, readFileSync as readFileSync35 } from "node:fs";
111153
- import { delimiter as delimiter3, dirname as dirname32, resolve as resolve23 } from "node:path";
111302
+ import { delimiter as delimiter3, dirname as dirname33, resolve as resolve23 } from "node:path";
111154
111303
  import { fileURLToPath as fileURLToPath7 } from "node:url";
111155
111304
 
111156
111305
  // packages/omo-opencode/src/mcp/cli-suffix.ts
@@ -111281,7 +111430,7 @@ var LSP_BOOTSTRAP_SCRIPT = [
111281
111430
  ].join(";");
111282
111431
  function getModuleDirectory(moduleUrl) {
111283
111432
  try {
111284
- return dirname32(fileURLToPath7(moduleUrl));
111433
+ return dirname33(fileURLToPath7(moduleUrl));
111285
111434
  } catch (error51) {
111286
111435
  if (!(error51 instanceof Error))
111287
111436
  throw error51;
@@ -111348,6 +111497,7 @@ function createLspMcpConfig(options = {}) {
111348
111497
  enabled: resolvedCommand.exists,
111349
111498
  cwd,
111350
111499
  environment: {
111500
+ LSP_TOOLS_MCP_CWD: cwd,
111351
111501
  LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve23(cwd, configPath)).join(delimiter3),
111352
111502
  LSP_TOOLS_MCP_USER_CONFIG: resolve23(configDir, "lsp.json"),
111353
111503
  LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve23(configDir, "lsp-install-decisions.json"),
@@ -112014,7 +112164,7 @@ async function pathExists2(path15) {
112014
112164
  init_src2();
112015
112165
  import { readdir as readdir15, readFile as readFile28, stat as stat7 } from "node:fs/promises";
112016
112166
  import { homedir as homedir23 } from "node:os";
112017
- import { dirname as dirname33, isAbsolute as isAbsolute13, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "node:path";
112167
+ import { dirname as dirname34, isAbsolute as isAbsolute13, join as join86, relative as relative9, resolve as resolve25, sep as sep9 } from "node:path";
112018
112168
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
112019
112169
  var CODEX_COMPONENTS_CHECK_NAME = "codex-components";
112020
112170
  var PLUGIN_DATA_DIR_NAME = "omo-sisyphuslabs";
@@ -112088,7 +112238,7 @@ async function auditBundleTargets(pluginRoot) {
112088
112238
  const manifest2 = await readJson2(manifestPath);
112089
112239
  if (manifest2 === null || !isRecord13(manifest2["mcpServers"]))
112090
112240
  continue;
112091
- const manifestRoot = dirname33(manifestPath);
112241
+ const manifestRoot = dirname34(manifestPath);
112092
112242
  const isRootManifest = resolve25(manifestRoot) === resolve25(pluginRoot);
112093
112243
  for (const server2 of Object.values(manifest2["mcpServers"])) {
112094
112244
  if (!isRecord13(server2) || !Array.isArray(server2["args"]))
@@ -112109,7 +112259,7 @@ async function auditBundleTargets(pluginRoot) {
112109
112259
  continue;
112110
112260
  const commands2 = [];
112111
112261
  collectHookCommands(manifest2, commands2);
112112
- const hookPluginRoot = dirname33(dirname33(hookManifestPath));
112262
+ const hookPluginRoot = dirname34(dirname34(hookManifestPath));
112113
112263
  for (const command of commands2) {
112114
112264
  for (const relativePath of extractPluginRootPaths(command)) {
112115
112265
  referencedCount += 1;
@@ -112148,7 +112298,7 @@ async function classifyBundleTarget(bundleRoot, baseRoot, relativePath, allowEsc
112148
112298
  }
112149
112299
  async function findHookManifestPaths(root) {
112150
112300
  const paths3 = await findManifestPaths(root, "hooks.json");
112151
- return paths3.filter((path15) => dirname33(path15).endsWith(`${sep9}hooks`));
112301
+ return paths3.filter((path15) => dirname34(path15).endsWith(`${sep9}hooks`));
112152
112302
  }
112153
112303
  async function findManifestPaths(root, manifestName) {
112154
112304
  let entries;
@@ -112667,8 +112817,8 @@ function formatVerbose(result) {
112667
112817
  }
112668
112818
 
112669
112819
  // packages/omo-opencode/src/cli/doctor/framework/formatter.ts
112670
- function formatDoctorOutput(result, mode) {
112671
- switch (mode) {
112820
+ function formatDoctorOutput(result, mode2) {
112821
+ switch (mode2) {
112672
112822
  case "default":
112673
112823
  return formatDefault(result);
112674
112824
  case "status":
@@ -112832,7 +112982,7 @@ import {
112832
112982
  unlinkSync as unlinkSync9,
112833
112983
  writeFileSync as writeFileSync12
112834
112984
  } from "node:fs";
112835
- import { basename as basename12, dirname as dirname34, join as join90 } from "node:path";
112985
+ import { basename as basename12, dirname as dirname35, join as join90 } from "node:path";
112836
112986
 
112837
112987
  // packages/mcp-client-core/src/config-dir.ts
112838
112988
  import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
@@ -113016,7 +113166,7 @@ function readLegacyStore() {
113016
113166
  }
113017
113167
  function writeTokenFile(filePath, token) {
113018
113168
  try {
113019
- const dir = dirname34(filePath);
113169
+ const dir = dirname35(filePath);
113020
113170
  if (!existsSync63(dir)) {
113021
113171
  mkdirSync15(dir, { recursive: true });
113022
113172
  }
@@ -113988,10 +114138,10 @@ function formatClassification(classification) {
113988
114138
  return classification.ref.length > 0 ? `${head} ${classification.path} ${classification.ref}` : `${head} ${classification.path}`;
113989
114139
  }
113990
114140
  function formatSummary(result) {
113991
- const mode = result.apply ? "apply" : "dry-run";
114141
+ const mode2 = result.apply ? "apply" : "dry-run";
113992
114142
  const removed2 = result.repos.reduce((total, repo) => total + repo.removed.length, 0);
113993
114143
  const failed = result.repos.reduce((total, repo) => total + repo.failed.length, 0);
113994
- return `SUMMARY mode=${mode} repos=${result.repos.length} sweep=${result.sweepCount} keep=${result.keepCount} prune=${result.pruneCount} removed=${removed2} failed=${failed}`;
114144
+ return `SUMMARY mode=${mode2} repos=${result.repos.length} sweep=${result.sweepCount} keep=${result.keepCount} prune=${result.pruneCount} removed=${removed2} failed=${failed}`;
113995
114145
  }
113996
114146
  function formatResult(result) {
113997
114147
  const lines = [];
@@ -114513,9 +114663,9 @@ Examples:
114513
114663
  `).action(async (options) => {
114514
114664
  const rootOptions = program2.opts();
114515
114665
  const rootDoctorPlatform = rootOptions.platform === "opencode" || rootOptions.platform === "codex" ? rootOptions.platform : undefined;
114516
- const mode = options.status ? "status" : options.verbose ? "verbose" : "default";
114666
+ const mode2 = options.status ? "status" : options.verbose ? "verbose" : "default";
114517
114667
  const doctorOptions = {
114518
- mode,
114668
+ mode: mode2,
114519
114669
  json: options.json ?? false,
114520
114670
  target: resolveDoctorTarget(process.env.OMO_INVOCATION_NAME, options.platform ?? rootDoctorPlatform)
114521
114671
  };