oh-my-opencode 4.18.0 → 4.18.2

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 (226) hide show
  1. package/.agents/skills/codex-qa/scripts/lsp-e2e.sh +3677 -0
  2. package/.agents/skills/opencode-qa/scripts/lsp-e2e.sh +3154 -0
  3. package/.agents/skills/work-with-pr/SKILL.md +16 -37
  4. package/.agents/skills/work-with-pr-workspace/evals/evals.json +3 -3
  5. package/.opencode/skills/work-with-pr/SKILL.md +16 -37
  6. package/.opencode/skills/work-with-pr-workspace/evals/evals.json +3 -3
  7. package/bin/AGENTS.md +33 -0
  8. package/dist/cli/index.js +500 -158
  9. package/dist/cli-node/index.js +500 -158
  10. package/dist/hooks/anthropic-context-window-limit-recovery/empty-content-recovery-sdk.d.ts +6 -0
  11. package/dist/hooks/category-skill-reminder/hook.d.ts +9 -1
  12. package/dist/hooks/comment-checker/hook.d.ts +8 -1
  13. package/dist/hooks/todo-continuation-enforcer/types.d.ts +3 -0
  14. package/dist/index.js +956 -702
  15. package/dist/plugin/messages-transform.d.ts +1 -0
  16. package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +2 -0
  17. package/dist/tui.js +43 -4
  18. package/package.json +16 -16
  19. package/packages/git-bash-mcp/dist/cli.js +81 -19
  20. package/packages/lsp-core/package.json +4 -0
  21. package/packages/lsp-core/src/index.ts +1 -0
  22. package/packages/lsp-core/src/lsp/cleanup-errors.test.ts +18 -0
  23. package/packages/lsp-core/src/lsp/cleanup-errors.ts +12 -3
  24. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +261 -0
  25. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +63 -0
  26. package/packages/lsp-core/src/lsp/client-wrapper.ts +35 -5
  27. package/packages/lsp-core/src/lsp/client.ts +262 -80
  28. package/packages/lsp-core/src/lsp/config-loader.ts +5 -17
  29. package/packages/lsp-core/src/lsp/connection.ts +12 -6
  30. package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +221 -0
  31. package/packages/lsp-core/src/lsp/directory-diagnostics.ts +61 -28
  32. package/packages/lsp-core/src/lsp/errors.ts +11 -0
  33. package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +283 -0
  34. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-contract-probe.ts +196 -0
  35. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +215 -0
  36. package/packages/lsp-core/src/lsp/formatters.ts +3 -0
  37. package/packages/lsp-core/src/lsp/json-rpc-connection-cancellation.test.ts +97 -0
  38. package/packages/lsp-core/src/lsp/json-rpc-connection.ts +73 -5
  39. package/packages/lsp-core/src/lsp/server-install-state.ts +3 -6
  40. package/packages/lsp-core/src/lsp/transport-protocol.ts +52 -0
  41. package/packages/lsp-core/src/lsp/transport.ts +96 -70
  42. package/packages/lsp-core/src/lsp/workspace-apply-edit-failure.ts +19 -0
  43. package/packages/lsp-core/src/lsp/workspace-apply-edit-lease.integration.test.ts +214 -0
  44. package/packages/lsp-core/src/lsp/workspace-apply-edit-sync.integration.test.ts +113 -0
  45. package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +163 -0
  46. package/packages/lsp-core/src/lsp/workspace-apply-edit.integration.test.ts +163 -0
  47. package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +67 -0
  48. package/packages/lsp-core/src/lsp/workspace-document-state.ts +368 -0
  49. package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +113 -0
  50. package/packages/lsp-core/src/lsp/workspace-edit-commit.test.ts +140 -0
  51. package/packages/lsp-core/src/lsp/workspace-edit-commit.ts +220 -0
  52. package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.test.ts +56 -0
  53. package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.ts +30 -0
  54. package/packages/lsp-core/src/lsp/workspace-edit-fingerprint.ts +44 -0
  55. package/packages/lsp-core/src/lsp/workspace-edit-options.test.ts +147 -0
  56. package/packages/lsp-core/src/lsp/workspace-edit-parse-helpers.ts +59 -0
  57. package/packages/lsp-core/src/lsp/workspace-edit-parser.ts +130 -0
  58. package/packages/lsp-core/src/lsp/workspace-edit-path.ts +98 -0
  59. package/packages/lsp-core/src/lsp/workspace-edit-plan-types.ts +60 -0
  60. package/packages/lsp-core/src/lsp/workspace-edit-plan.ts +73 -0
  61. package/packages/lsp-core/src/lsp/workspace-edit-prevalidation.test.ts +174 -0
  62. package/packages/lsp-core/src/lsp/workspace-edit-resource-parser.ts +89 -0
  63. package/packages/lsp-core/src/lsp/workspace-edit-simulation.ts +183 -0
  64. package/packages/lsp-core/src/lsp/workspace-edit-snapshot.ts +53 -0
  65. package/packages/lsp-core/src/lsp/workspace-edit-text.ts +125 -0
  66. package/packages/lsp-core/src/lsp/workspace-edit-types.ts +121 -0
  67. package/packages/lsp-core/src/lsp/workspace-edit.characterization.test.ts +95 -0
  68. package/packages/lsp-core/src/lsp/workspace-edit.ts +49 -200
  69. package/packages/lsp-core/src/lsp/workspace-mutation-controller.ts +182 -0
  70. package/packages/lsp-core/src/mcp.ts +18 -7
  71. package/packages/lsp-core/src/missing-dependency-result.test.ts +105 -0
  72. package/packages/lsp-core/src/missing-dependency-result.ts +57 -0
  73. package/packages/lsp-core/src/post-edit/index.ts +1 -0
  74. package/packages/lsp-core/src/post-edit/orchestration.test.ts +157 -0
  75. package/packages/lsp-core/src/post-edit/orchestration.ts +178 -0
  76. package/packages/lsp-core/src/request-context.test.ts +171 -0
  77. package/packages/lsp-core/src/request-context.ts +222 -9
  78. package/packages/lsp-core/src/tool-surface.test.ts +4 -1
  79. package/packages/lsp-core/src/tools/diagnostics.ts +32 -13
  80. package/packages/lsp-core/src/tools/navigation.ts +12 -12
  81. package/packages/lsp-core/src/tools/rename.ts +10 -15
  82. package/packages/lsp-core/src/tools/symbols.ts +11 -11
  83. package/packages/lsp-core/src/tools/types.ts +2 -1
  84. package/packages/lsp-daemon/dist/cli.js +3330 -764
  85. package/packages/lsp-daemon/dist/client.d.ts +105 -0
  86. package/packages/lsp-daemon/dist/client.js +5995 -0
  87. package/packages/lsp-daemon/dist/daemon-client.d.ts +12 -7
  88. package/packages/lsp-daemon/dist/daemon-client.js +139 -32
  89. package/packages/lsp-daemon/dist/daemon-server.d.ts +1 -0
  90. package/packages/lsp-daemon/dist/daemon-server.js +40 -15
  91. package/packages/lsp-daemon/dist/ensure-daemon.d.ts +10 -8
  92. package/packages/lsp-daemon/dist/ensure-daemon.js +135 -51
  93. package/packages/lsp-daemon/dist/index.d.ts +2 -2
  94. package/packages/lsp-daemon/dist/index.js +3093 -786
  95. package/packages/lsp-daemon/dist/ipc-protocol.d.ts +46 -0
  96. package/packages/lsp-daemon/dist/ipc-protocol.js +187 -0
  97. package/packages/lsp-daemon/dist/lock.js +14 -4
  98. package/packages/lsp-daemon/dist/ownership.d.ts +49 -0
  99. package/packages/lsp-daemon/dist/ownership.js +168 -0
  100. package/packages/lsp-daemon/dist/paths.d.ts +33 -9
  101. package/packages/lsp-daemon/dist/paths.js +72 -33
  102. package/packages/lsp-daemon/dist/proxy.d.ts +5 -0
  103. package/packages/lsp-daemon/dist/proxy.js +123 -16
  104. package/packages/lsp-daemon/dist/request-routing.d.ts +7 -2
  105. package/packages/lsp-daemon/dist/request-routing.js +71 -22
  106. package/packages/lsp-daemon/dist/run-daemon.js +9 -2
  107. package/packages/lsp-daemon/dist/runtime-contract.d.ts +21 -0
  108. package/packages/lsp-daemon/dist/runtime-contract.js +58 -0
  109. package/packages/lsp-daemon/dist/socket-jsonrpc.js +6 -1
  110. package/packages/lsp-daemon/package.json +12 -3
  111. package/packages/lsp-tools-mcp/dist/cli.js +2189 -454
  112. package/packages/lsp-tools-mcp/dist/lsp/manager.js +1741 -148
  113. package/packages/lsp-tools-mcp/dist/mcp.js +2206 -471
  114. package/packages/lsp-tools-mcp/dist/request-context.js +176 -6
  115. package/packages/lsp-tools-mcp/dist/tools.js +2119 -447
  116. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  117. package/packages/omo-codex/plugin/.mcp.json +2 -1
  118. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  119. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  120. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +100 -28
  121. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +100 -28
  122. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  123. package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +21 -9
  124. package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +35 -0
  125. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +69 -0
  126. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +57 -1
  127. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  128. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  129. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  130. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  131. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  132. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  133. package/packages/omo-codex/plugin/components/lsp/.mcp.json +2 -1
  134. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +55 -0
  135. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +3033 -936
  136. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +0 -4
  137. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +5 -2
  138. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +41 -62
  139. package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.d.ts +1 -1
  140. package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +24 -15
  141. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +3 -7
  142. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +23 -49
  143. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  144. package/packages/omo-codex/plugin/components/lsp/package.json +3 -2
  145. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +31 -1
  146. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.test.mjs +76 -0
  147. package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.mjs +201 -0
  148. package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.test.mjs +55 -0
  149. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +0 -4
  150. package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +49 -71
  151. package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +26 -15
  152. package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +26 -64
  153. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +16 -17
  154. package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +30 -4
  155. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +20 -5
  156. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.5.md +1 -1
  157. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +5 -3
  158. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  159. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  160. package/packages/omo-codex/plugin/components/start-work-continuation/README.md +2 -2
  161. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +3 -3
  162. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +2 -2
  163. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  164. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  165. package/packages/omo-codex/plugin/components/start-work-continuation/src/boulder-reader.ts +1 -1
  166. package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +1 -1
  167. package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +15 -1
  168. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +20 -0
  169. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  170. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  171. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  172. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  173. package/packages/omo-codex/plugin/components/ultrawork/directive.md +50 -33
  174. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  175. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  176. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +50 -33
  177. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +50 -33
  178. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +3 -3
  179. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +5 -6
  180. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  181. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  182. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
  183. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +6 -5
  184. package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +5 -6
  185. package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +2 -2
  186. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  187. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  188. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  189. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  190. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  191. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  192. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  193. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  194. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  195. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  196. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  197. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  198. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  199. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  200. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  201. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  202. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  203. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  204. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  205. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  206. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  207. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  208. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  209. package/packages/omo-codex/plugin/package-lock.json +26 -14
  210. package/packages/omo-codex/plugin/package.json +1 -1
  211. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +2 -3
  212. package/packages/omo-codex/plugin/scripts/build-components.mjs +13 -1
  213. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +9 -1
  214. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +7 -0
  215. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -1
  216. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +50 -33
  217. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
  218. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +6 -5
  219. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +8 -0
  220. package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +128 -15
  221. package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +10 -0
  222. package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +2 -0
  223. package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +1 -0
  224. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +7 -0
  225. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +34 -3
  226. package/packages/omo-codex/scripts/install-dist/install-local.mjs +328 -63
@@ -2146,7 +2146,7 @@ var package_default;
2146
2146
  var init_package = __esm(() => {
2147
2147
  package_default = {
2148
2148
  name: "oh-my-opencode",
2149
- version: "4.18.0",
2149
+ version: "4.18.2",
2150
2150
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
2151
2151
  main: "./dist/index.js",
2152
2152
  types: "dist/index.d.ts",
@@ -2255,7 +2255,8 @@ var init_package = __esm(() => {
2255
2255
  "build:codex-install": "bun run script/build-codex-install.ts",
2256
2256
  "install:codex-dev": "bun run script/build-codex-install.ts && bun run script/install-codex-dev.ts",
2257
2257
  "build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
2258
- "build:senpi-plugin": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check",
2258
+ "build:senpi-plugin": "bun run build:lsp-daemon && bun run build:senpi-plugin:stage",
2259
+ "build:senpi-plugin:stage": "node packages/omo-senpi/plugin/scripts/stage-lsp-daemon-runtime.mjs && node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check && node packages/omo-senpi/plugin/scripts/build-install.mjs",
2259
2260
  "build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
2260
2261
  "build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
2261
2262
  "build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
@@ -2277,7 +2278,7 @@ var init_package = __esm(() => {
2277
2278
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
2278
2279
  test: "bun test",
2279
2280
  "test:codex": "bun run build:codex-install && bun run build:git-bash-mcp && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && npm --prefix packages/lsp-tools-mcp test && npm --prefix packages/omo-codex/plugin ci && npm --prefix packages/omo-codex/plugin/components/ulw-loop test && bun run --cwd packages/omo-codex/plugin build && npm --prefix packages/omo-codex/plugin/components/codegraph run typecheck && npm --prefix packages/omo-codex/plugin/components/codegraph test && node scripts/check-third-party-notices.mjs --ship && bun test packages/omo-opencode/src/cli/cli-installer.platform.test.ts packages/omo-codex/src/install/codex-cache.test.ts packages/omo-codex/src/install/codex-cleanup.test.ts packages/omo-codex/src/install/codex-config-agent-cleanup.test.ts packages/omo-codex/src/install/codex-config-autonomous-features.test.ts packages/omo-codex/src/install/codex-config-reasoning.test.ts packages/omo-codex/src/install/codex-config-toml.test.ts packages/omo-codex/src/install/codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex.test.ts packages/omo-codex/src/install/install-codex-packaged.test.ts packages/omo-codex/src/install/link-cached-plugin-agents.test.ts packages/omo-codex/src/**/*.test.ts packages/utils/src/jsonc-parser.test.ts packages/utils/src/frontmatter.test.ts packages/hashline-core/src/hash-computation.test.ts packages/hashline-core/src/smoke-untested-modules.test.ts packages/rules-engine/src/index.test.ts packages/rules-engine/src/security-boundary.test.ts packages/agents-md-core/src/injector.test.ts packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts && node --test packages/omo-codex/plugin/test/*.test.mjs packages/omo-codex/scripts/install-cache-copy.test.mjs packages/omo-codex/scripts/install-cli-args.test.mjs packages/omo-codex/scripts/install-delegated-command.test.mjs packages/omo-codex/scripts/install-config-autonomous-features.test.mjs packages/omo-codex/scripts/install-config-autonomous.test.mjs packages/omo-codex/scripts/install-config-reasoning.test.mjs packages/omo-codex/scripts/install-config.test.mjs packages/omo-codex/scripts/install-hook-targets.test.mjs packages/omo-codex/scripts/install-project-local-cleanup.test.mjs packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs packages/omo-codex/scripts/install-local-entrypoint.test.mjs packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs packages/omo-codex/scripts/install-local.test.mjs packages/omo-codex/scripts/install-marketplace-cache.test.mjs packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs packages/omo-codex/scripts/install-mcp-runtime.test.mjs packages/omo-codex/scripts/install-packaged-local.test.mjs packages/omo-codex/scripts/install-generated-bundle.test.mjs packages/omo-codex/scripts/install-agent-links.test.mjs packages/omo-codex/scripts/install-bin-links.test.mjs",
2280
- "test:senpi": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check && bun test packages/omo-senpi",
2281
+ "test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
2281
2282
  "test:windows-codex": "bun run test:codex",
2282
2283
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
2283
2284
  },
@@ -2317,7 +2318,6 @@ var init_package = __esm(() => {
2317
2318
  picocolors: "^1.1.1",
2318
2319
  picomatch: "^4.0.4",
2319
2320
  "posthog-node": "^5.34.3",
2320
- "vscode-jsonrpc": "^8.2.1",
2321
2321
  zod: "^4.4.3"
2322
2322
  },
2323
2323
  devDependencies: {
@@ -2358,18 +2358,18 @@ var init_package = __esm(() => {
2358
2358
  typescript: "^6.0.3"
2359
2359
  },
2360
2360
  optionalDependencies: {
2361
- "oh-my-opencode-darwin-arm64": "4.18.0",
2362
- "oh-my-opencode-darwin-x64": "4.18.0",
2363
- "oh-my-opencode-darwin-x64-baseline": "4.18.0",
2364
- "oh-my-opencode-linux-arm64": "4.18.0",
2365
- "oh-my-opencode-linux-arm64-musl": "4.18.0",
2366
- "oh-my-opencode-linux-x64": "4.18.0",
2367
- "oh-my-opencode-linux-x64-baseline": "4.18.0",
2368
- "oh-my-opencode-linux-x64-musl": "4.18.0",
2369
- "oh-my-opencode-linux-x64-musl-baseline": "4.18.0",
2370
- "oh-my-opencode-windows-arm64": "4.18.0",
2371
- "oh-my-opencode-windows-x64": "4.18.0",
2372
- "oh-my-opencode-windows-x64-baseline": "4.18.0"
2361
+ "oh-my-opencode-darwin-arm64": "4.18.2",
2362
+ "oh-my-opencode-darwin-x64": "4.18.2",
2363
+ "oh-my-opencode-darwin-x64-baseline": "4.18.2",
2364
+ "oh-my-opencode-linux-arm64": "4.18.2",
2365
+ "oh-my-opencode-linux-arm64-musl": "4.18.2",
2366
+ "oh-my-opencode-linux-x64": "4.18.2",
2367
+ "oh-my-opencode-linux-x64-baseline": "4.18.2",
2368
+ "oh-my-opencode-linux-x64-musl": "4.18.2",
2369
+ "oh-my-opencode-linux-x64-musl-baseline": "4.18.2",
2370
+ "oh-my-opencode-windows-arm64": "4.18.2",
2371
+ "oh-my-opencode-windows-x64": "4.18.2",
2372
+ "oh-my-opencode-windows-x64-baseline": "4.18.2"
2373
2373
  },
2374
2374
  overrides: {
2375
2375
  "@earendil-works/pi-agent-core": "0.80.3",
@@ -9223,7 +9223,7 @@ var init_agent_model_requirements = __esm(() => {
9223
9223
  hephaestus: {
9224
9224
  fallbackChain: [
9225
9225
  {
9226
- providers: ["openai", "vercel"],
9226
+ providers: ["openai", "github-copilot", "vercel"],
9227
9227
  model: "gpt-5.6-sol",
9228
9228
  variant: "high"
9229
9229
  },
@@ -9334,6 +9334,11 @@ var init_agent_model_requirements = __esm(() => {
9334
9334
  model: "gpt-5.6-sol",
9335
9335
  variant: "xhigh"
9336
9336
  },
9337
+ {
9338
+ providers: ["github-copilot"],
9339
+ model: "gpt-5.6-sol",
9340
+ variant: "high"
9341
+ },
9337
9342
  {
9338
9343
  providers: ["openai", "github-copilot", "opencode", "vercel"],
9339
9344
  model: "gpt-5.5",
@@ -9412,6 +9417,11 @@ var init_category_model_requirements = __esm(() => {
9412
9417
  model: "gpt-5.6-sol",
9413
9418
  variant: "xhigh"
9414
9419
  },
9420
+ {
9421
+ providers: ["github-copilot"],
9422
+ model: "gpt-5.6-sol",
9423
+ variant: "high"
9424
+ },
9415
9425
  {
9416
9426
  providers: ["openai", "opencode", "vercel"],
9417
9427
  model: "gpt-5.5",
@@ -9438,7 +9448,12 @@ var init_category_model_requirements = __esm(() => {
9438
9448
  variant: "xhigh"
9439
9449
  },
9440
9450
  {
9441
- providers: ["openai", "vercel"],
9451
+ providers: ["github-copilot"],
9452
+ model: "gpt-5.6-terra",
9453
+ variant: "high"
9454
+ },
9455
+ {
9456
+ providers: ["openai", "github-copilot", "vercel"],
9442
9457
  model: "gpt-5.6-sol",
9443
9458
  variant: "high"
9444
9459
  },
@@ -9505,6 +9520,11 @@ var init_category_model_requirements = __esm(() => {
9505
9520
  model: "gpt-5.6-luna",
9506
9521
  variant: "xhigh"
9507
9522
  },
9523
+ {
9524
+ providers: ["github-copilot"],
9525
+ model: "gpt-5.6-luna",
9526
+ variant: "high"
9527
+ },
9508
9528
  {
9509
9529
  providers: ["anthropic", "github-copilot", "opencode", "vercel"],
9510
9530
  model: "claude-sonnet-4-6"
@@ -9594,9 +9614,12 @@ function stripProviderPrefixForAliasLookup(normalizedModelID) {
9594
9614
  }
9595
9615
  return normalizedModelID.slice(slashIndex + 1);
9596
9616
  }
9597
- function resolveModelIDAlias(modelID) {
9617
+ function resolveModelIDAlias(modelID, providerID) {
9598
9618
  const requestedModelID = normalizeLookupModelID(modelID);
9599
9619
  const aliasLookupModelID = stripProviderPrefixForAliasLookup(requestedModelID);
9620
+ const normalizedProviderID = providerID ? normalizeLookupModelID(providerID) : undefined;
9621
+ const providerPrefixEnd = requestedModelID.indexOf("/");
9622
+ const embeddedProviderID = providerPrefixEnd > 0 ? requestedModelID.slice(0, providerPrefixEnd) : undefined;
9600
9623
  const exactRule = EXACT_ALIAS_RULES_BY_MODEL.get(aliasLookupModelID);
9601
9624
  if (exactRule) {
9602
9625
  return {
@@ -9607,6 +9630,13 @@ function resolveModelIDAlias(modelID) {
9607
9630
  };
9608
9631
  }
9609
9632
  for (const rule of PATTERN_ALIAS_RULES) {
9633
+ if (rule.providerIDs) {
9634
+ const matchesProviderID = normalizedProviderID !== undefined && rule.providerIDs.includes(normalizedProviderID);
9635
+ const matchesEmbeddedProviderID = normalizedProviderID !== undefined && rule.allowedSubproviderHosts?.includes(normalizedProviderID) === true && embeddedProviderID !== undefined && rule.providerIDs.includes(embeddedProviderID);
9636
+ if (!matchesProviderID && !matchesEmbeddedProviderID) {
9637
+ continue;
9638
+ }
9639
+ }
9610
9640
  if (!rule.match(aliasLookupModelID)) {
9611
9641
  continue;
9612
9642
  }
@@ -9647,6 +9677,14 @@ var init_model_capability_aliases = __esm(() => {
9647
9677
  ];
9648
9678
  EXACT_ALIAS_RULES_BY_MODEL = new Map(EXACT_ALIAS_RULES.map((rule) => [rule.aliasModelID, rule]));
9649
9679
  PATTERN_ALIAS_RULES = [
9680
+ {
9681
+ ruleID: "openai-gpt-5.6-fast-service-tier-alias",
9682
+ description: "Normalizes OpenCode's OpenAI GPT-5.6 fast service-tier IDs to canonical snapshot IDs.",
9683
+ providerIDs: ["openai"],
9684
+ allowedSubproviderHosts: ["vercel"],
9685
+ match: (normalizedModelID) => /^gpt-5\.6-(?:sol|terra|luna)-fast$/.test(normalizedModelID),
9686
+ canonicalize: (normalizedModelID) => normalizedModelID.slice(0, -"-fast".length)
9687
+ },
9650
9688
  {
9651
9689
  ruleID: "claude-thinking-legacy-alias",
9652
9690
  description: "Normalizes the legacy claude-opus-4-7-thinking id to the canonical snapshot ID.",
@@ -10314,7 +10352,7 @@ function getProviderOverride(providerID, modelID) {
10314
10352
  return GITHUB_COPILOT_GPT5_MODEL.test(normalizeLookupModelID2(modelID)) ? GITHUB_COPILOT_GPT5_OVERRIDE : undefined;
10315
10353
  }
10316
10354
  function getModelCapabilities(input) {
10317
- const canonicalization = resolveModelIDAlias(input.modelID);
10355
+ const canonicalization = resolveModelIDAlias(input.modelID, input.providerID);
10318
10356
  const override = getOverride(input.modelID);
10319
10357
  const providerOverride = getProviderOverride(input.providerID, canonicalization.canonicalModelID);
10320
10358
  const runtimeModel = readRuntimeModel(input.runtimeModel ?? input.providerCache?.findProviderModelMetadata(input.providerID, input.modelID));
@@ -11419,6 +11457,7 @@ var init_opencode_storage_detection = __esm(() => {
11419
11457
  var opencodePluginsCache;
11420
11458
  var init_load_opencode_plugins = __esm(() => {
11421
11459
  init_jsonc_parser2();
11460
+ init_opencode_config_dir();
11422
11461
  opencodePluginsCache = new Map;
11423
11462
  });
11424
11463
 
@@ -66851,14 +66890,14 @@ var init_config_manager = __esm(() => {
66851
66890
 
66852
66891
  // packages/telemetry-core/src/activity-state.ts
66853
66892
  import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "node:fs";
66854
- import { basename as basename10, join as join53 } from "node:path";
66893
+ import { basename as basename11, join as join53 } from "node:path";
66855
66894
  function resolveTelemetryStateDir(product, options = {}) {
66856
66895
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
66857
66896
  env: options.env,
66858
66897
  osProvider: options.osProvider
66859
66898
  });
66860
66899
  const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
66861
- if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
66900
+ if (dataDir === xdgStateDir || xdgStateDir === undefined && basename11(dataDir) === product.cacheDirName) {
66862
66901
  return dataDir;
66863
66902
  }
66864
66903
  return join53(dataDir, product.cacheDirName);
@@ -67092,18 +67131,18 @@ var init_env2 = __esm(() => {
67092
67131
  });
67093
67132
 
67094
67133
  // packages/telemetry-core/src/machine-id.ts
67095
- import { createHash as createHash3 } from "node:crypto";
67134
+ import { createHash as createHash4 } from "node:crypto";
67096
67135
  import os4 from "node:os";
67097
67136
  function getDefaultTelemetryOsProvider() {
67098
67137
  return os4;
67099
67138
  }
67100
67139
  function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
67101
- return createHash3("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
67140
+ return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
67102
67141
  }
67103
67142
  var init_machine_id = () => {};
67104
67143
 
67105
67144
  // node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
67106
- import { dirname as dirname18, posix as posix2, sep as sep7 } from "path";
67145
+ import { dirname as dirname18, posix as posix3, sep as sep7 } from "path";
67107
67146
  function createModulerModifier() {
67108
67147
  const getModuleFromFileName = createGetModuleFromFilename();
67109
67148
  return async (frames) => {
@@ -67118,7 +67157,7 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(proc
67118
67157
  if (!filename)
67119
67158
  return;
67120
67159
  const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
67121
- let { dir, base: file2, ext } = posix2.parse(normalizedFilename);
67160
+ let { dir, base: file2, ext } = posix3.parse(normalizedFilename);
67122
67161
  if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
67123
67162
  file2 = file2.slice(0, -1 * ext.length);
67124
67163
  const decodedFile = decodeURIComponent(file2);
@@ -72658,7 +72697,7 @@ var package_default2;
72658
72697
  var init_package2 = __esm(() => {
72659
72698
  package_default2 = {
72660
72699
  name: "@oh-my-opencode/omo-codex",
72661
- version: "4.18.0",
72700
+ version: "4.18.2",
72662
72701
  type: "module",
72663
72702
  private: true,
72664
72703
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -73477,18 +73516,18 @@ function removeFromTextBunLock(lockPath, packageNames) {
73477
73516
  try {
73478
73517
  const content = fs12.readFileSync(lockPath, "utf-8");
73479
73518
  const lock = JSON.parse(stripTrailingCommas(content));
73480
- let removed = false;
73519
+ let removed2 = false;
73481
73520
  for (const packageName of packageNames) {
73482
73521
  if (lock.packages?.[packageName]) {
73483
73522
  delete lock.packages[packageName];
73484
73523
  log2(`[auto-update-checker] Removed from bun.lock: ${packageName}`);
73485
- removed = true;
73524
+ removed2 = true;
73486
73525
  }
73487
73526
  }
73488
- if (removed) {
73527
+ if (removed2) {
73489
73528
  fs12.writeFileSync(lockPath, JSON.stringify(lock, null, 2));
73490
73529
  }
73491
- return removed;
73530
+ return removed2;
73492
73531
  } catch (error51) {
73493
73532
  if (!(error51 instanceof Error)) {
73494
73533
  throw error51;
@@ -73528,7 +73567,7 @@ function getInvalidationPackageNames(packageName, defaultPackageName, acceptedPa
73528
73567
  function removeSpecifierRootDirs(cacheDir, packageNames) {
73529
73568
  const parentDirs = [cacheDir, path13.join(cacheDir, "packages")];
73530
73569
  const prefixes = packageNames.map((packageName) => `${packageName}@`);
73531
- let removed = false;
73570
+ let removed2 = false;
73532
73571
  for (const parentDir of parentDirs) {
73533
73572
  if (!fs12.existsSync(parentDir)) {
73534
73573
  continue;
@@ -73540,10 +73579,10 @@ function removeSpecifierRootDirs(cacheDir, packageNames) {
73540
73579
  const specifierDir = path13.join(parentDir, entry.name);
73541
73580
  fs12.rmSync(specifierDir, { recursive: true, force: true });
73542
73581
  log2(`[auto-update-checker] Specifier cache removed: ${specifierDir}`);
73543
- removed = true;
73582
+ removed2 = true;
73544
73583
  }
73545
73584
  }
73546
- return removed;
73585
+ return removed2;
73547
73586
  }
73548
73587
  function invalidatePackage(packageName, options = {}) {
73549
73588
  try {
@@ -77843,65 +77882,297 @@ function formatUnknownError(error) {
77843
77882
  }
77844
77883
 
77845
77884
  // packages/omo-codex/src/install/lsp-daemon-reaper.ts
77846
- import { readFile as readFile18, readdir as readdir9, rm as rm10 } from "node:fs/promises";
77885
+ import { createHash as createHash3 } from "node:crypto";
77886
+ import { lstat as lstat11, readFile as readFile19, readdir as readdir10, rm as rm10 } from "node:fs/promises";
77887
+ import { tmpdir as tmpdir3 } from "node:os";
77888
+ import { join as join48, posix as posix2 } from "node:path";
77889
+
77890
+ // packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
77891
+ import { execFile as execFile2 } from "node:child_process";
77892
+ import { readFile as readFile18, readdir as readdir9, readlink as readlink5 } from "node:fs/promises";
77847
77893
  import { connect } from "node:net";
77848
- import { join as join48 } from "node:path";
77849
- async function reapLspDaemons(codexHome, deps = {}) {
77850
- const killProcess = deps.killProcess ?? sendSigterm;
77851
- const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
77852
- const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
77853
- const reaped = [];
77854
- let entries;
77894
+ import { basename as basename10 } from "node:path";
77895
+ var PROBE_TIMEOUT_MS = 500;
77896
+ async function probeLegacyJsonRpcEndpoint(endpoint, timeoutMs = PROBE_TIMEOUT_MS) {
77897
+ return await new Promise((resolve14) => {
77898
+ const socket = connect(endpoint);
77899
+ let settled = false;
77900
+ let buffer = "";
77901
+ const finish = (value) => {
77902
+ if (settled)
77903
+ return;
77904
+ settled = true;
77905
+ clearTimeout(timer);
77906
+ socket.destroy();
77907
+ resolve14(value);
77908
+ };
77909
+ const timer = setTimeout(() => finish(false), timeoutMs);
77910
+ timer.unref?.();
77911
+ socket.once("connect", () => {
77912
+ socket.write(`${JSON.stringify(legacyStatusRequest())}
77913
+ `);
77914
+ });
77915
+ socket.on("data", (chunk) => {
77916
+ buffer += chunk.toString("utf8");
77917
+ const newlineIndex = buffer.indexOf(`
77918
+ `);
77919
+ if (newlineIndex < 0)
77920
+ return;
77921
+ finish(isJsonRpcResponse(buffer.slice(0, newlineIndex).trim()));
77922
+ });
77923
+ socket.once("error", () => finish(false));
77924
+ });
77925
+ }
77926
+ async function attestLegacyDaemonOwnership(input, deps = {}) {
77927
+ if (input.platform === "linux")
77928
+ return await attestLinuxOwnership(input, deps);
77929
+ if (input.platform === "darwin")
77930
+ return await attestMacOwnership(input, deps);
77931
+ return false;
77932
+ }
77933
+ async function attestLinuxOwnership(input, deps) {
77934
+ const readFileImpl = deps.readFile ?? readFile18;
77935
+ const readDirImpl = deps.readDir ?? readdir9;
77936
+ const readLinkImpl = deps.readLink ?? readlink5;
77937
+ const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
77938
+ if (procNetUnix === null)
77939
+ return false;
77940
+ const inode = inodeForEndpoint(procNetUnix, input.endpoint);
77941
+ if (inode === null)
77942
+ return false;
77943
+ const fdEntries = await readDirImpl(`/proc/${input.pid}/fd`).catch(() => null);
77944
+ if (fdEntries === null)
77945
+ return false;
77946
+ let ownsEndpoint = false;
77947
+ for (const fdEntry of fdEntries) {
77948
+ const target = await readLinkImpl(`/proc/${input.pid}/fd/${fdEntry}`).catch(() => null);
77949
+ if (target !== `socket:[${inode}]`)
77950
+ continue;
77951
+ ownsEndpoint = true;
77952
+ break;
77953
+ }
77954
+ if (!ownsEndpoint)
77955
+ return false;
77956
+ const cmdline = await readBinary(readFileImpl, `/proc/${input.pid}/cmdline`);
77957
+ if (cmdline === null)
77958
+ return false;
77959
+ return isNodeCliDaemonArgv(splitCmdline(cmdline));
77960
+ }
77961
+ async function attestMacOwnership(input, deps) {
77962
+ const executeFileImpl = deps.executeFile ?? execFile2;
77963
+ const filteredLsofOutput = await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
77964
+ "-a",
77965
+ "-n",
77966
+ "-P",
77967
+ "-p",
77968
+ String(input.pid),
77969
+ "-U",
77970
+ "-Fn",
77971
+ "--",
77972
+ input.endpoint
77973
+ ]);
77974
+ const lsofOutput = filteredLsofOutput ?? await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
77975
+ "-a",
77976
+ "-n",
77977
+ "-P",
77978
+ "-p",
77979
+ String(input.pid),
77980
+ "-U",
77981
+ "-Fn"
77982
+ ]);
77983
+ if (lsofOutput === null || !lsofShowsUnixEndpoint(lsofOutput, input.pid, input.endpoint))
77984
+ return false;
77985
+ const commandOutput = await executeForStdout(executeFileImpl, "/bin/ps", ["-p", String(input.pid), "-o", "command="]);
77986
+ if (commandOutput === null)
77987
+ return false;
77988
+ return isNodeCliDaemonCommand(commandOutput.trim());
77989
+ }
77990
+ function legacyStatusRequest() {
77991
+ return {
77992
+ jsonrpc: "2.0",
77993
+ id: 1,
77994
+ method: "tools/call",
77995
+ params: { name: "status", arguments: {} }
77996
+ };
77997
+ }
77998
+ function isJsonRpcResponse(line) {
77999
+ if (line.length === 0)
78000
+ return false;
77855
78001
  try {
77856
- entries = await readdir9(daemonRoot);
78002
+ const parsed = JSON.parse(line);
78003
+ return parsed.jsonrpc === "2.0" && parsed.id === 1 && (Object.hasOwn(parsed, "result") || Object.hasOwn(parsed, "error"));
77857
78004
  } catch {
77858
- return reaped;
78005
+ return false;
77859
78006
  }
77860
- for (const entry of entries) {
77861
- const versionDir = join48(daemonRoot, entry);
77862
- const pid = await readPidFile(join48(versionDir, "daemon.pid"));
77863
- const socketPath = await readEndpointFile(join48(versionDir, "daemon.endpoint"));
77864
- if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
77865
- reaped.push(pid);
78007
+ }
78008
+ function inodeForEndpoint(procNetUnix, endpoint) {
78009
+ for (const line of procNetUnix.split(/\r?\n/)) {
78010
+ const trimmed = line.trim();
78011
+ if (trimmed.length === 0 || trimmed.startsWith("Num"))
78012
+ continue;
78013
+ const fields = trimmed.split(/\s+/);
78014
+ if (fields.length < 8 || fields[7] !== endpoint)
78015
+ continue;
78016
+ return fields[6] ?? null;
78017
+ }
78018
+ return null;
78019
+ }
78020
+ function splitCmdline(buffer) {
78021
+ return buffer.toString("utf8").split("\x00").filter((value) => value.length > 0);
78022
+ }
78023
+ function isNodeCliDaemonArgv(argv) {
78024
+ if (argv.length < 2 || !argv.includes("daemon"))
78025
+ return false;
78026
+ const executable = basename10(argv[0] ?? "");
78027
+ if (!/^node(?:\.exe)?$/i.test(executable))
78028
+ return false;
78029
+ return argv.some((value) => value === "cli.js" || value.endsWith("/cli.js") || value.endsWith("\\cli.js"));
78030
+ }
78031
+ function lsofShowsUnixEndpoint(output, pid, endpoint) {
78032
+ const lines = output.split(/\r?\n/).filter((line) => line.length > 0);
78033
+ const endpointName = basename10(endpoint);
78034
+ return lines.includes(`p${pid}`) && lines.some((line) => line === `n${endpoint}` || line === `n${endpointName}`);
78035
+ }
78036
+ function isNodeCliDaemonCommand(command) {
78037
+ return /\bnode(?:\.exe)?\b/i.test(command) && /\bcli\.js\b/.test(command) && /\bdaemon\b/.test(command);
78038
+ }
78039
+ async function executeForStdout(executeFileImpl, file2, args) {
78040
+ return await new Promise((resolve14) => {
78041
+ executeFileImpl(file2, [...args], { encoding: "utf8", maxBuffer: 1024 * 1024, timeout: 1000 }, (error, stdout) => {
78042
+ if (error !== null) {
78043
+ resolve14(null);
78044
+ return;
78045
+ }
78046
+ resolve14(stdout);
78047
+ });
78048
+ });
78049
+ }
78050
+ async function readText(readFileImpl, path7) {
78051
+ return await readFileImpl(path7, "utf8").catch(() => null);
78052
+ }
78053
+ async function readBinary(readFileImpl, path7) {
78054
+ return await readFileImpl(path7).catch(() => null);
78055
+ }
78056
+
78057
+ // packages/omo-codex/src/install/lsp-daemon-reaper.ts
78058
+ var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
78059
+ var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
78060
+ async function reapLspDaemons(codexHome, deps = {}) {
78061
+ const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
78062
+ const platform = deps.platform ?? process.platform;
78063
+ const tmpDir = deps.tmpDir ?? tmpdir3();
78064
+ const probe2 = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
78065
+ const attest = deps.attestLegacyDaemonOwnership ?? ((input) => attestLegacyDaemonOwnership(input));
78066
+ const killProcess = deps.killProcess ?? sendSigterm;
78067
+ const waitForProcessExit = deps.waitForProcessExit ?? defaultWaitForProcessExit;
78068
+ const entries = await readdir10(daemonRoot, { withFileTypes: true }).catch(() => []);
78069
+ const results = [];
78070
+ for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
78071
+ const versionPath = join48(daemonRoot, entry.name);
78072
+ const parsedVersion = parseVersionEntry(entry.name);
78073
+ if (parsedVersion === null || !entry.isDirectory()) {
78074
+ await removeVersionDir(versionPath);
78075
+ results.push(removed(entry.name, "removed invalid legacy version entry"));
78076
+ continue;
78077
+ }
78078
+ const metadata = await readLegacyMetadata({ versionPath, version: parsedVersion, codexHome, platform, tmpDir });
78079
+ if (metadata.kind === "remove") {
78080
+ await removeVersionDir(versionPath);
78081
+ results.push(removed(parsedVersion, metadata.reason));
78082
+ continue;
78083
+ }
78084
+ if (!await probe2(metadata.endpoint)) {
78085
+ await removeVersionDir(versionPath);
78086
+ results.push(removed(parsedVersion, "removed stale legacy daemon state"));
78087
+ continue;
78088
+ }
78089
+ if (platform === "win32") {
78090
+ results.push(deferred(parsedVersion, "legacy named pipe responded but Windows cannot prove pid ownership safely"));
78091
+ continue;
77866
78092
  }
77867
- await rm10(versionDir, { recursive: true, force: true });
78093
+ const owned = await attest({ pid: metadata.pid, endpoint: metadata.endpoint, platform });
78094
+ if (!owned) {
78095
+ results.push(deferred(parsedVersion, "legacy endpoint responded but pid ownership was not proven"));
78096
+ continue;
78097
+ }
78098
+ if (!killProcess(metadata.pid)) {
78099
+ await removeVersionDir(versionPath);
78100
+ results.push(removed(parsedVersion, "removed stale legacy daemon state"));
78101
+ continue;
78102
+ }
78103
+ if (!await waitForProcessExit(metadata.pid, LEGACY_EXIT_WAIT_TIMEOUT_MS)) {
78104
+ results.push(deferred(parsedVersion, `timed out waiting ${LEGACY_EXIT_WAIT_TIMEOUT_MS}ms for the proven legacy daemon to exit`));
78105
+ continue;
78106
+ }
78107
+ await removeVersionDir(versionPath);
78108
+ results.push(terminated(parsedVersion, "terminated proven owned legacy daemon"));
77868
78109
  }
77869
- return reaped;
78110
+ return results;
77870
78111
  }
77871
- async function readEndpointFile(path7) {
77872
- try {
77873
- const content = (await readFile18(path7, "utf8")).trim();
77874
- return content.length > 0 ? content : null;
77875
- } catch {
78112
+ function parseVersionEntry(entryName) {
78113
+ if (!entryName.startsWith("v"))
77876
78114
  return null;
78115
+ const version = entryName.slice(1);
78116
+ return LEGACY_VERSION_PATTERN.test(version) ? version : null;
78117
+ }
78118
+ async function readLegacyMetadata(input) {
78119
+ const pidText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.pid"));
78120
+ if (pidText === "non_regular")
78121
+ return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
78122
+ if (pidText === null)
78123
+ return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
78124
+ const pid = Number.parseInt(pidText, 10);
78125
+ if (!Number.isInteger(pid) || pid <= 0)
78126
+ return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
78127
+ const endpointText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.endpoint"));
78128
+ if (endpointText === "non_regular")
78129
+ return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
78130
+ if (endpointText === null)
78131
+ return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
78132
+ const allowedEndpoints = legacyEndpointCandidates({
78133
+ version: input.version,
78134
+ versionPath: input.versionPath,
78135
+ platform: input.platform,
78136
+ tmpDir: input.tmpDir
78137
+ });
78138
+ if (!allowedEndpoints.includes(endpointText)) {
78139
+ return { kind: "remove", reason: "removed legacy daemon state with an endpoint outside the frozen vectors" };
77877
78140
  }
78141
+ return { kind: "valid", pid, endpoint: endpointText };
77878
78142
  }
77879
- async function readPidFile(path7) {
77880
- try {
77881
- const pid = Number.parseInt((await readFile18(path7, "utf8")).trim(), 10);
77882
- return Number.isInteger(pid) && pid > 0 ? pid : null;
77883
- } catch {
77884
- return null;
78143
+ function legacyEndpointCandidates(input) {
78144
+ if (input.platform === "win32") {
78145
+ const normalizedVersionPath = input.versionPath.replaceAll("/", "\\");
78146
+ const digest = shortDigest(normalizedVersionPath);
78147
+ return [`\\\\.\\pipe\\omo-lsp-${input.version}-${digest}`];
77885
78148
  }
78149
+ const natural = posix2.join(input.versionPath, "daemon.sock");
78150
+ const hashed = posix2.join(input.tmpDir, `omo-lsp-${input.version}-${shortDigest(input.versionPath)}.sock`);
78151
+ return [natural, hashed];
77886
78152
  }
77887
- function probeSocketLive(socketPath, timeoutMs = 500) {
77888
- return new Promise((resolve14) => {
77889
- const socket = connect(socketPath);
77890
- const done = (ok) => {
77891
- socket.destroy();
77892
- resolve14(ok);
77893
- };
77894
- const timer = setTimeout(() => done(false), timeoutMs);
77895
- timer.unref();
77896
- socket.once("connect", () => {
77897
- clearTimeout(timer);
77898
- done(true);
77899
- });
77900
- socket.once("error", () => {
77901
- clearTimeout(timer);
77902
- done(false);
77903
- });
77904
- });
78153
+ async function readRegularTrimmedFile(path7) {
78154
+ const stats = await lstat11(path7).catch(() => null);
78155
+ if (stats === null)
78156
+ return null;
78157
+ if (!stats.isFile())
78158
+ return "non_regular";
78159
+ const content = (await readFile19(path7, "utf8")).trim();
78160
+ return content.length > 0 ? content : null;
78161
+ }
78162
+ function shortDigest(value) {
78163
+ return createHash3("sha256").update(value).digest("hex").slice(0, 16);
78164
+ }
78165
+ async function removeVersionDir(path7) {
78166
+ await rm10(path7, { recursive: true, force: true });
78167
+ }
78168
+ function removed(version, reason) {
78169
+ return { version, status: "removed", reason };
78170
+ }
78171
+ function terminated(version, reason) {
78172
+ return { version, status: "terminated", reason };
78173
+ }
78174
+ function deferred(version, reason) {
78175
+ return { version, status: "deferred", reason };
77905
78176
  }
77906
78177
  function sendSigterm(pid) {
77907
78178
  try {
@@ -77911,6 +78182,24 @@ function sendSigterm(pid) {
77911
78182
  return false;
77912
78183
  }
77913
78184
  }
78185
+ async function defaultWaitForProcessExit(pid, timeoutMs) {
78186
+ const deadline = Date.now() + timeoutMs;
78187
+ for (;; ) {
78188
+ if (!processIsRunning(pid))
78189
+ return true;
78190
+ if (Date.now() >= deadline)
78191
+ return false;
78192
+ await new Promise((resolve14) => setTimeout(resolve14, 100));
78193
+ }
78194
+ }
78195
+ function processIsRunning(pid) {
78196
+ try {
78197
+ process.kill(pid, 0);
78198
+ return true;
78199
+ } catch {
78200
+ return false;
78201
+ }
78202
+ }
77914
78203
 
77915
78204
  // packages/omo-codex/src/install/codex-installer-bin-dir.ts
77916
78205
  import { homedir as homedir5 } from "node:os";
@@ -77928,7 +78217,7 @@ function resolveCodexInstallerBinDir(input) {
77928
78217
  }
77929
78218
 
77930
78219
  // packages/omo-codex/src/install/codex-git-bash-hooks.ts
77931
- import { readFile as readFile19, writeFile as writeFile11 } from "node:fs/promises";
78220
+ import { readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
77932
78221
  import { join as join50 } from "node:path";
77933
78222
  var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
77934
78223
  "./hooks/pre-tool-use-recommending-git-bash-mcp.json",
@@ -77938,7 +78227,7 @@ async function removeGitBashHooksOffWindows(input) {
77938
78227
  if (input.platform === "win32")
77939
78228
  return;
77940
78229
  const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
77941
- const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
78230
+ const parsed = JSON.parse(await readFile20(manifestPath, "utf8"));
77942
78231
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
77943
78232
  return;
77944
78233
  const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
@@ -78132,7 +78421,16 @@ async function runCodexInstaller(options = {}) {
78132
78421
  pluginNames: marketplace.plugins.map((plugin) => plugin.name)
78133
78422
  });
78134
78423
  }
78135
- await reapLspDaemons(codexHome).catch(() => []);
78424
+ const legacyDaemonCleanup = await reapLspDaemons(codexHome).catch((error) => {
78425
+ const message = error instanceof Error ? error.message : String(error);
78426
+ log4(`Warning: skipped legacy Codex LSP daemon cleanup: ${message}`);
78427
+ return [];
78428
+ });
78429
+ for (const cleanup of legacyDaemonCleanup) {
78430
+ if (cleanup.status !== "deferred")
78431
+ continue;
78432
+ log4(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
78433
+ }
78136
78434
  const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
78137
78435
  await writeCachedMarketplaceManifest({
78138
78436
  marketplaceName: marketplace.name,
@@ -78224,10 +78522,10 @@ function codexMarketplaceSource(marketplaceRoot) {
78224
78522
  }
78225
78523
  // packages/omo-codex/src/install/codex-installation-detection.ts
78226
78524
  init_bun_which_shim();
78227
- import { execFile as execFile2 } from "node:child_process";
78525
+ import { execFile as execFile3 } from "node:child_process";
78228
78526
  import { existsSync as existsSync31 } from "node:fs";
78229
78527
  import { homedir as homedir7 } from "node:os";
78230
- import { posix as posix3, win32 as win323 } from "node:path";
78528
+ import { posix as posix4, win32 as win323 } from "node:path";
78231
78529
  var CODEX_PATH_CHECK_LABEL = "codex (PATH)";
78232
78530
  var WINDOWS_START_APPS_ARGS = [
78233
78531
  "-NoProfile",
@@ -78304,11 +78602,11 @@ async function findWindowsCodexStartApp(runCommand) {
78304
78602
  }
78305
78603
  }
78306
78604
  function macCodexAppPaths(homeDir) {
78307
- return ["/Applications/Codex.app", posix3.join(homeDir, "Applications", "Codex.app")];
78605
+ return ["/Applications/Codex.app", posix4.join(homeDir, "Applications", "Codex.app")];
78308
78606
  }
78309
78607
  function macCodexDmgPaths(homeDir) {
78310
- const downloads = posix3.join(homeDir, "Downloads");
78311
- return [posix3.join(downloads, "codex.dmg"), posix3.join(downloads, "Codex.dmg")];
78608
+ const downloads = posix4.join(homeDir, "Downloads");
78609
+ return [posix4.join(downloads, "codex.dmg"), posix4.join(downloads, "Codex.dmg")];
78312
78610
  }
78313
78611
  function windowsCodexCliPaths(env3) {
78314
78612
  const candidates = [];
@@ -78346,18 +78644,18 @@ function dedupe(values) {
78346
78644
  }
78347
78645
  function defaultRunCommand2(command, args) {
78348
78646
  return new Promise((resolve16) => {
78349
- execFile2(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
78647
+ execFile3(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
78350
78648
  resolve16({ success: error === null, stdout });
78351
78649
  });
78352
78650
  });
78353
78651
  }
78354
78652
  // packages/omo-codex/src/install/codex-cleanup.ts
78355
- import { lstat as lstat12, readFile as readFile21, readdir as readdir10, rm as rm11, rmdir } from "node:fs/promises";
78653
+ import { lstat as lstat13, readFile as readFile22, readdir as readdir11, rm as rm11, rmdir } from "node:fs/promises";
78356
78654
  import { homedir as homedir8 } from "node:os";
78357
78655
  import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "node:path";
78358
78656
 
78359
78657
  // packages/omo-codex/src/install/codex-cleanup-config.ts
78360
- import { lstat as lstat11, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile12 } from "node:fs/promises";
78658
+ import { lstat as lstat12, mkdir as mkdir8, readFile as readFile21, writeFile as writeFile12 } from "node:fs/promises";
78361
78659
  import { dirname as dirname19 } from "node:path";
78362
78660
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
78363
78661
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
@@ -78390,7 +78688,7 @@ function cleanupCodexLightConfigText(config) {
78390
78688
  async function cleanupCodexConfig(configPath, now) {
78391
78689
  if (!await configExists(configPath))
78392
78690
  return { changed: false };
78393
- const original = await readFile20(configPath, "utf8");
78691
+ const original = await readFile21(configPath, "utf8");
78394
78692
  const next = cleanupCodexLightConfigText(original);
78395
78693
  if (next === original)
78396
78694
  return { changed: false };
@@ -78459,7 +78757,7 @@ function formatBackupTimestamp2(date) {
78459
78757
  }
78460
78758
  async function configExists(path7) {
78461
78759
  try {
78462
- await lstat11(path7);
78760
+ await lstat12(path7);
78463
78761
  return true;
78464
78762
  } catch (error) {
78465
78763
  if (nodeErrorCode5(error) === "ENOENT")
@@ -78577,7 +78875,7 @@ async function collectBootstrapDataDirsByGlob(codexHome) {
78577
78875
  async function walkForManagedBootstrapDirs(directory, depth, results) {
78578
78876
  if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
78579
78877
  return;
78580
- const entries = await readdir10(directory, { withFileTypes: true }).catch(() => null);
78878
+ const entries = await readdir11(directory, { withFileTypes: true }).catch(() => null);
78581
78879
  if (entries === null)
78582
78880
  return;
78583
78881
  for (const entry of entries) {
@@ -78609,7 +78907,7 @@ async function removeManagedPathBestEffort(path7, seams) {
78609
78907
  }
78610
78908
  async function attemptRemove(path7) {
78611
78909
  try {
78612
- if (await lstat12(path7).catch(() => null) === null)
78910
+ if (await lstat13(path7).catch(() => null) === null)
78613
78911
  return false;
78614
78912
  await rm11(path7, { recursive: true, force: true });
78615
78913
  return true;
@@ -78635,7 +78933,7 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78635
78933
  ];
78636
78934
  const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78637
78935
  if (await exists6(versionRoot)) {
78638
- const entries = await readdir10(versionRoot, { withFileTypes: true });
78936
+ const entries = await readdir11(versionRoot, { withFileTypes: true });
78639
78937
  for (const entry of entries) {
78640
78938
  if (entry.isDirectory())
78641
78939
  manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
@@ -78655,20 +78953,20 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78655
78953
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
78656
78954
  if (!await exists6(configPath))
78657
78955
  return [];
78658
- const config = await readFile21(configPath, "utf8");
78956
+ const config = await readFile22(configPath, "utf8");
78659
78957
  return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
78660
78958
  }
78661
78959
  async function readInstalledAgentManifest(manifestPath) {
78662
78960
  if (!await exists6(manifestPath))
78663
78961
  return [];
78664
- const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
78962
+ const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
78665
78963
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
78666
78964
  return [];
78667
78965
  return parsed.agents.filter((path7) => typeof path7 === "string");
78668
78966
  }
78669
78967
  async function removeManifestListedAgentLinks(codexHome, paths) {
78670
78968
  const agentsDir = join57(codexHome, "agents");
78671
- const removed = [];
78969
+ const removed2 = [];
78672
78970
  const skipped2 = [];
78673
78971
  for (const path7 of paths) {
78674
78972
  if (!isSafeManagedAgentPath(agentsDir, path7)) {
@@ -78683,9 +78981,9 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
78683
78981
  continue;
78684
78982
  }
78685
78983
  await rm11(path7, { force: true });
78686
- removed.push(path7);
78984
+ removed2.push(path7);
78687
78985
  }
78688
- return { removed, skipped: skipped2 };
78986
+ return { removed: removed2, skipped: skipped2 };
78689
78987
  }
78690
78988
  function isSafeManagedAgentPath(agentsDir, path7) {
78691
78989
  if (!isAbsolute11(path7))
@@ -78703,7 +79001,7 @@ async function exists6(path7) {
78703
79001
  }
78704
79002
  async function maybeLstat2(path7) {
78705
79003
  try {
78706
- return await lstat12(path7);
79004
+ return await lstat13(path7);
78707
79005
  } catch (error) {
78708
79006
  if (nodeErrorCode6(error) === "ENOENT")
78709
79007
  return null;
@@ -78718,18 +79016,26 @@ function nodeErrorCode6(error) {
78718
79016
  // packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
78719
79017
  var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
78720
79018
  // packages/omo-senpi/src/install/install-senpi.ts
78721
- import { execFile as execFile3 } from "node:child_process";
79019
+ import { execFile as execFile4 } from "node:child_process";
78722
79020
  import { constants as constants7, existsSync as existsSync32 } from "node:fs";
78723
- import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
79021
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile23, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
78724
79022
  import { homedir as homedir9 } from "node:os";
78725
79023
  import { dirname as dirname21, join as join58, resolve as resolve18 } from "node:path";
78726
79024
  import { fileURLToPath } from "node:url";
78727
79025
  import { promisify as promisify2 } from "node:util";
78728
- var execFileAsync2 = promisify2(execFile3);
79026
+ var execFileAsync2 = promisify2(execFile4);
78729
79027
  var REQUIRED_PLUGIN_ARTIFACTS = [
78730
79028
  join58("extensions", "omo.js"),
78731
79029
  join58("skills", "ultrawork", "SKILL.md"),
78732
- join58("skills", "ulw-loop", "SKILL.md")
79030
+ join58("skills", "ulw-loop", "SKILL.md"),
79031
+ join58("runtime", "lsp-daemon", "dist", "cli.js"),
79032
+ join58("runtime", "lsp-daemon", "dist", "index.js"),
79033
+ join58("runtime", "lsp-daemon", "dist", "index.d.ts"),
79034
+ join58("runtime", "lsp-daemon", "dist", "daemon-client.js"),
79035
+ join58("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
79036
+ join58("runtime", "lsp-daemon", "dist", "package.json"),
79037
+ join58("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
79038
+ join58("scripts", "install.mjs")
78733
79039
  ];
78734
79040
  async function runSenpiInstaller(options = {}) {
78735
79041
  const context = resolveInstallContext(options);
@@ -78753,7 +79059,8 @@ async function runSenpiInstaller(options = {}) {
78753
79059
  }
78754
79060
  function resolveInstallContext(options) {
78755
79061
  const env3 = options.env ?? process.env;
78756
- const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))));
79062
+ const allowBuild = options.pluginPath === undefined;
79063
+ const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))) : dirname21(resolve18(options.pluginPath))));
78757
79064
  const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
78758
79065
  const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
78759
79066
  return {
@@ -78762,6 +79069,7 @@ function resolveInstallContext(options) {
78762
79069
  agentDir,
78763
79070
  settingsPath: join58(agentDir, "settings.json"),
78764
79071
  pluginPath,
79072
+ allowBuild,
78765
79073
  runCommand: options.runCommand ?? defaultRunCommand3
78766
79074
  };
78767
79075
  }
@@ -78769,8 +79077,13 @@ async function ensurePluginArtifacts(context) {
78769
79077
  const missing = await hasMissingPluginArtifact(context.pluginPath);
78770
79078
  if (!missing)
78771
79079
  return;
79080
+ if (!context.allowBuild) {
79081
+ throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
79082
+ }
78772
79083
  await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78773
79084
  await context.runCommand("node", [join58(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
79085
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
79086
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
78774
79087
  }
78775
79088
  async function hasMissingPluginArtifact(pluginPath) {
78776
79089
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
@@ -78789,7 +79102,7 @@ async function defaultRunCommand3(command, args, options) {
78789
79102
  async function readSettings(settingsPath) {
78790
79103
  let raw;
78791
79104
  try {
78792
- raw = await readFile22(settingsPath, "utf8");
79105
+ raw = await readFile23(settingsPath, "utf8");
78793
79106
  } catch (error) {
78794
79107
  if (isErrno(error, "ENOENT"))
78795
79108
  return {};
@@ -78868,7 +79181,7 @@ function isErrno(error, code) {
78868
79181
  return error instanceof Error && "code" in error && error.code === code;
78869
79182
  }
78870
79183
  // packages/omo-opencode/src/cli/star-request.ts
78871
- import { execFile as execFile4 } from "node:child_process";
79184
+ import { execFile as execFile5 } from "node:child_process";
78872
79185
  import { promisify as promisify3 } from "node:util";
78873
79186
  var STAR_REPOSITORIES = [
78874
79187
  "code-yeongyu/oh-my-openagent",
@@ -78880,7 +79193,7 @@ var PLATFORM_REPOSITORIES = {
78880
79193
  both: STAR_REPOSITORIES,
78881
79194
  senpi: STAR_REPOSITORIES
78882
79195
  };
78883
- var execFileAsync3 = promisify3(execFile4);
79196
+ var execFileAsync3 = promisify3(execFile5);
78884
79197
  async function runGitHubStarCommand(repository) {
78885
79198
  await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
78886
79199
  }
@@ -97250,7 +97563,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
97250
97563
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
97251
97564
  init_bun_which_shim();
97252
97565
  init_spawn_with_windows_hide();
97253
- import { delimiter as delimiter2, dirname as dirname23, posix as posix4, win32 as win324 } from "node:path";
97566
+ import { delimiter as delimiter2, dirname as dirname23, posix as posix5, win32 as win324 } from "node:path";
97254
97567
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
97255
97568
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
97256
97569
  function getCommandCandidates(platform) {
@@ -97261,7 +97574,7 @@ function getCommandCandidates(platform) {
97261
97574
  function getPathTools(platform) {
97262
97575
  if (platform === "win32")
97263
97576
  return win324;
97264
- return posix4;
97577
+ return posix5;
97265
97578
  }
97266
97579
  function collectCandidateBinaryPaths(pathEnv, which2 = bunWhich, platform = process.platform) {
97267
97580
  const seen = new Set;
@@ -100420,12 +100733,12 @@ import { dirname as dirname30, join as join79 } from "node:path";
100420
100733
 
100421
100734
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
100422
100735
  import { join as join78 } from "path";
100423
- import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
100736
+ import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
100424
100737
  init_binary_downloader();
100425
100738
  init_logger2();
100426
100739
  init_plugin_identity();
100427
100740
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
100428
- var DEBUG_FILE = join78(tmpdir3(), "comment-checker-debug.log");
100741
+ var DEBUG_FILE = join78(tmpdir4(), "comment-checker-debug.log");
100429
100742
  function getCacheDir2() {
100430
100743
  if (process.platform === "win32") {
100431
100744
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
@@ -100662,13 +100975,14 @@ async function getGhCliInfo(dependencies = {}) {
100662
100975
  }
100663
100976
 
100664
100977
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
100665
- import { readFileSync as readFileSync38 } from "node:fs";
100978
+ import { readFileSync as readFileSync39 } from "node:fs";
100666
100979
  import { join as join80 } from "node:path";
100667
100980
 
100668
100981
  // packages/omo-opencode/src/mcp/lsp.ts
100669
- import { existsSync as existsSync56 } from "node:fs";
100982
+ import { existsSync as existsSync56, readFileSync as readFileSync38 } from "node:fs";
100670
100983
  import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "node:path";
100671
100984
  import { fileURLToPath as fileURLToPath7 } from "node:url";
100985
+ init_opencode_config_dir();
100672
100986
 
100673
100987
  // packages/omo-opencode/src/mcp/cli-suffix.ts
100674
100988
  function normalizeCliPath(path14) {
@@ -100680,7 +100994,7 @@ function hasCliSuffix(candidatePath, suffix) {
100680
100994
 
100681
100995
  // packages/omo-opencode/src/mcp/runtime-executable.ts
100682
100996
  init_bun_which_shim();
100683
- import { basename as basename12 } from "node:path";
100997
+ import { basename as basename13 } from "node:path";
100684
100998
  var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
100685
100999
  function isUnsafeCommandName2(commandName) {
100686
101000
  if (commandName.length === 0)
@@ -100696,7 +101010,7 @@ function isUnsafeCommandName2(commandName) {
100696
101010
  return false;
100697
101011
  }
100698
101012
  function isNodeExecPath(execPath) {
100699
- return NODE_EXECUTABLE_NAMES.has(basename12(execPath).toLowerCase());
101013
+ return NODE_EXECUTABLE_NAMES.has(basename13(execPath).toLowerCase());
100700
101014
  }
100701
101015
  function resolveRuntimeExecutable(commandName, options = {}) {
100702
101016
  if (isUnsafeCommandName2(commandName)) {
@@ -100766,8 +101080,15 @@ var LSP_TOOLS_PACKAGE_REL = "packages/lsp-tools-mcp";
100766
101080
  var DIST_CLI_REL = "dist/cli.js";
100767
101081
  var SOURCE_CLI_REL = "src/cli.ts";
100768
101082
  var PROJECT_LSP_CONFIGS = [".opencode/lsp.json", ".omo/lsp.json", ".omo/lsp-client.json"];
101083
+ var DAEMON_PACKAGE_NAME = "@code-yeongyu/lsp-daemon";
101084
+ var OMO_LSP_DAEMON_CLI = "OMO_LSP_DAEMON_CLI";
101085
+ var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
101086
+ var DaemonPackageSchema = exports_external.object({
101087
+ version: exports_external.string().min(1)
101088
+ });
100769
101089
  var LSP_BOOTSTRAP_SCRIPT = [
100770
101090
  "const { existsSync } = require('node:fs')",
101091
+ "const { createRequire } = require('node:module')",
100771
101092
  "const { join } = require('node:path')",
100772
101093
  "const { spawnSync } = require('node:child_process')",
100773
101094
  "const root = process.argv[1]",
@@ -100776,16 +101097,18 @@ var LSP_BOOTSTRAP_SCRIPT = [
100776
101097
  `const toolsPackage = join(root, '${LSP_TOOLS_PACKAGE_REL}')`,
100777
101098
  `const daemonPackage = join(root, '${PACKAGE_REL}')`,
100778
101099
  "const toolsDist = join(toolsPackage, 'dist/cli.js')",
100779
- "const daemonDist = join(daemonPackage, 'dist/cli.js')",
101100
+ "const daemonPackageJson = join(daemonPackage, 'package.json')",
100780
101101
  "const daemonSource = join(daemonPackage, 'src/cli.ts')",
100781
101102
  "const run = (command, args, stdio) => spawnSync(command, args, { cwd: root, env: process.env, stdio })",
100782
101103
  "const finish = (result) => { if (result.error) { console.error(result.error.message); process.exit(1) } process.exit(result.status ?? 1) }",
100783
101104
  "const runIfAvailable = (command, args) => { const result = run(command, args, 'inherit'); if (result.error) return false; finish(result); return true }",
100784
- "if (existsSync(daemonDist)) finish(run(process.execPath, [daemonDist, 'mcp'], 'inherit'))",
100785
- "if (existsSync(daemonSource) && existsSync(toolsDist)) runIfAvailable(bun, [daemonSource, 'mcp'])",
101105
+ `const resolveDaemonCli = () => { try { return createRequire(daemonPackageJson).resolve('${DAEMON_PACKAGE_NAME}/cli') } catch (error) { if (error instanceof Error) return null; throw error } }`,
101106
+ "const daemonCli = existsSync(daemonPackageJson) ? resolveDaemonCli() : null",
101107
+ "if (daemonCli) finish(run(process.execPath, [daemonCli, 'mcp'], 'inherit'))",
101108
+ `if (existsSync(daemonSource) && existsSync(toolsDist)) { const pkg = require(daemonPackageJson); process.env.${OMO_LSP_DAEMON_CLI} = daemonSource; process.env.${OMO_LSP_DAEMON_VERSION} = pkg.version; runIfAvailable(bun, [daemonSource, 'mcp']) }`,
100786
101109
  "const steps = [[npm, ['--prefix', toolsPackage, 'install', '--no-package-lock', '--no-audit', '--no-fund']], [npm, ['--prefix', toolsPackage, 'run', 'build']], [npm, ['--prefix', daemonPackage, 'install', '--no-package-lock', '--no-audit', '--no-fund']], [npm, ['--prefix', daemonPackage, 'run', 'build']]]",
100787
101110
  "for (const [command, args] of steps) { const result = run(command, args, ['ignore', 'ignore', 'inherit']); if (result.error || result.status !== 0) finish(result) }",
100788
- "finish(run(process.execPath, [daemonDist, 'mcp'], 'inherit'))"
101111
+ "finish(run(process.execPath, [resolveDaemonCli(), 'mcp'], 'inherit'))"
100789
101112
  ].join(";");
100790
101113
  function getModuleDirectory(moduleUrl) {
100791
101114
  try {
@@ -100799,6 +101122,16 @@ function getModuleDirectory(moduleUrl) {
100799
101122
  function findBootstrapRoot(candidates, pathExists) {
100800
101123
  return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
100801
101124
  }
101125
+ function readDaemonPackageVersion(root) {
101126
+ try {
101127
+ const packageJson = JSON.parse(readFileSync38(resolve21(root, PACKAGE_REL, "package.json"), "utf-8"));
101128
+ return DaemonPackageSchema.parse(packageJson).version;
101129
+ } catch (error51) {
101130
+ if (!(error51 instanceof Error))
101131
+ throw error51;
101132
+ return null;
101133
+ }
101134
+ }
100802
101135
  function createBootstrapCandidate(root, pathExists, resolveExecutable) {
100803
101136
  const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
100804
101137
  const bun = resolveExecutable("bun");
@@ -100823,7 +101156,7 @@ function resolveLspCommand(options = {}) {
100823
101156
  sourceCliRel: SOURCE_CLI_REL,
100824
101157
  pathExists,
100825
101158
  resolveExecutable,
100826
- isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
101159
+ isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
100827
101160
  }) : [];
100828
101161
  const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
100829
101162
  if (distCandidate) {
@@ -100837,12 +101170,21 @@ function resolveLspCommand(options = {}) {
100837
101170
  }
100838
101171
  function createLspMcpConfig(options = {}) {
100839
101172
  const resolvedCommand = resolveLspCommand(options);
101173
+ const cwd = resolve21(options.cwd ?? process.cwd());
101174
+ const configDir = getOpenCodeConfigDir({ binary: "opencode" });
101175
+ const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
100840
101176
  return {
100841
101177
  type: "local",
100842
101178
  command: resolvedCommand.command,
100843
101179
  enabled: resolvedCommand.exists,
100844
101180
  environment: {
100845
- LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.join(delimiter3)
101181
+ LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve21(cwd, configPath)).join(delimiter3),
101182
+ LSP_TOOLS_MCP_USER_CONFIG: resolve21(configDir, "lsp.json"),
101183
+ LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve21(configDir, "lsp-install-decisions.json"),
101184
+ ...sourceVersion ? {
101185
+ [OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
101186
+ [OMO_LSP_DAEMON_VERSION]: sourceVersion
101187
+ } : {}
100846
101188
  }
100847
101189
  };
100848
101190
  }
@@ -100859,7 +101201,7 @@ function readOmoConfig(configDirectory) {
100859
101201
  return null;
100860
101202
  }
100861
101203
  try {
100862
- const content = readFileSync38(detected.path, "utf-8");
101204
+ const content = readFileSync39(detected.path, "utf-8");
100863
101205
  return parseJsonc(content);
100864
101206
  } catch (error51) {
100865
101207
  if (!(error51 instanceof Error)) {
@@ -100889,7 +101231,7 @@ function getInstalledLspServers(options = {}) {
100889
101231
 
100890
101232
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
100891
101233
  init_shared();
100892
- import { existsSync as existsSync57, readFileSync as readFileSync39 } from "node:fs";
101234
+ import { existsSync as existsSync57, readFileSync as readFileSync40 } from "node:fs";
100893
101235
  import { homedir as homedir20 } from "node:os";
100894
101236
  import { join as join81 } from "node:path";
100895
101237
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
@@ -100906,7 +101248,7 @@ function loadUserMcpConfig() {
100906
101248
  if (!existsSync57(configPath))
100907
101249
  continue;
100908
101250
  try {
100909
- const content = readFileSync39(configPath, "utf-8");
101251
+ const content = readFileSync40(configPath, "utf-8");
100910
101252
  const config3 = parseJsonc(content);
100911
101253
  if (config3.mcpServers) {
100912
101254
  Object.assign(servers, config3.mcpServers);
@@ -101041,7 +101383,7 @@ async function checkTools() {
101041
101383
 
101042
101384
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
101043
101385
  init_src4();
101044
- import { existsSync as existsSync58, readFileSync as readFileSync40 } from "node:fs";
101386
+ import { existsSync as existsSync58, readFileSync as readFileSync41 } from "node:fs";
101045
101387
  function isTelemetryState(value) {
101046
101388
  return value !== null && typeof value === "object" && !Array.isArray(value);
101047
101389
  }
@@ -101051,7 +101393,7 @@ function readLastActiveDay(stateFilePath) {
101051
101393
  }
101052
101394
  let parsed;
101053
101395
  try {
101054
- parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
101396
+ parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
101055
101397
  } catch (error51) {
101056
101398
  if (error51 instanceof Error) {
101057
101399
  return "unreadable";
@@ -101126,7 +101468,7 @@ function expandHomeDirectory(directoryPath) {
101126
101468
  // packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
101127
101469
  init_shared();
101128
101470
  init_plugin_identity();
101129
- import { readFileSync as readFileSync41, promises as fs13 } from "node:fs";
101471
+ import { readFileSync as readFileSync42, promises as fs13 } from "node:fs";
101130
101472
  import path15 from "node:path";
101131
101473
  async function checkTeamMode() {
101132
101474
  const config3 = loadTeamModeConfig();
@@ -101163,7 +101505,7 @@ function loadTeamModeConfig() {
101163
101505
  if (!configPath)
101164
101506
  return { team_mode: undefined };
101165
101507
  try {
101166
- return parseJsonc(readFileSync41(configPath, "utf-8"));
101508
+ return parseJsonc(readFileSync42(configPath, "utf-8"));
101167
101509
  } catch (error51) {
101168
101510
  if (error51 instanceof Error) {
101169
101511
  return { team_mode: undefined };
@@ -101197,9 +101539,9 @@ async function pathExists(dir) {
101197
101539
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
101198
101540
  init_src();
101199
101541
  import { existsSync as existsSync59 } from "node:fs";
101200
- import { lstat as lstat13, readdir as readdir11, readFile as readFile23 } from "node:fs/promises";
101542
+ import { lstat as lstat14, readdir as readdir12, readFile as readFile24 } from "node:fs/promises";
101201
101543
  import { homedir as homedir22 } from "node:os";
101202
- import { basename as basename13, join as join82, resolve as resolve22 } from "node:path";
101544
+ import { basename as basename14, join as join82, resolve as resolve22 } from "node:path";
101203
101545
  // packages/omo-opencode/package.json
101204
101546
  var package_default3 = {
101205
101547
  name: "@oh-my-opencode/omo-opencode",
@@ -101388,7 +101730,7 @@ async function resolveInstalledPluginRoot(codexHome) {
101388
101730
  const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
101389
101731
  if (!existsSync59(pluginRoot))
101390
101732
  return null;
101391
- const versions2 = await readdir11(pluginRoot, { withFileTypes: true });
101733
+ const versions2 = await readdir12(pluginRoot, { withFileTypes: true });
101392
101734
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
101393
101735
  return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
101394
101736
  }
@@ -101404,7 +101746,7 @@ async function readCodexConfigSummary(configPath) {
101404
101746
  companionLifecycleHookStateEvents: []
101405
101747
  };
101406
101748
  }
101407
- const content = await readFile23(configPath, "utf8");
101749
+ const content = await readFile24(configPath, "utf8");
101408
101750
  return {
101409
101751
  exists: true,
101410
101752
  marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
@@ -101427,12 +101769,12 @@ async function readLinkedAgents(codexHome) {
101427
101769
  const agentsDir = join82(codexHome, "agents");
101428
101770
  if (!existsSync59(agentsDir))
101429
101771
  return [];
101430
- const entries = await readdir11(agentsDir, { withFileTypes: true });
101431
- return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
101772
+ const entries = await readdir12(agentsDir, { withFileTypes: true });
101773
+ return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename14(entry.name, ".toml")).sort();
101432
101774
  }
101433
101775
  async function readJson(path16) {
101434
101776
  try {
101435
- const parsed = JSON.parse(await readFile23(path16, "utf8"));
101777
+ const parsed = JSON.parse(await readFile24(path16, "utf8"));
101436
101778
  return isPlainRecord(parsed) ? parsed : null;
101437
101779
  } catch (error51) {
101438
101780
  if (error51 instanceof Error)
@@ -101527,7 +101869,7 @@ function compareVersionsDescending(left, right) {
101527
101869
  }
101528
101870
  async function pathExists2(path16) {
101529
101871
  try {
101530
- await lstat13(path16);
101872
+ await lstat14(path16);
101531
101873
  return true;
101532
101874
  } catch (error51) {
101533
101875
  if (error51 instanceof Error)
@@ -101538,7 +101880,7 @@ async function pathExists2(path16) {
101538
101880
 
101539
101881
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
101540
101882
  init_src();
101541
- import { readdir as readdir12, readFile as readFile24, stat as stat6 } from "node:fs/promises";
101883
+ import { readdir as readdir13, readFile as readFile25, stat as stat6 } from "node:fs/promises";
101542
101884
  import { homedir as homedir23 } from "node:os";
101543
101885
  import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
101544
101886
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
@@ -101679,7 +102021,7 @@ async function findHookManifestPaths(root) {
101679
102021
  async function findManifestPaths(root, manifestName) {
101680
102022
  let entries;
101681
102023
  try {
101682
- entries = await readdir12(root, { withFileTypes: true });
102024
+ entries = await readdir13(root, { withFileTypes: true });
101683
102025
  } catch {
101684
102026
  return [];
101685
102027
  }
@@ -101791,7 +102133,7 @@ function degradedDetailLines(entries) {
101791
102133
  }
101792
102134
  async function readJson2(path16) {
101793
102135
  try {
101794
- const parsed = JSON.parse(await readFile24(path16, "utf8"));
102136
+ const parsed = JSON.parse(await readFile25(path16, "utf8"));
101795
102137
  return isRecord6(parsed) ? parsed : null;
101796
102138
  } catch (error51) {
101797
102139
  if (error51 instanceof Error)
@@ -101819,7 +102161,7 @@ function isRecord6(value) {
101819
102161
 
101820
102162
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
101821
102163
  import { existsSync as existsSync60 } from "node:fs";
101822
- import { readFile as readFile25 } from "node:fs/promises";
102164
+ import { readFile as readFile26 } from "node:fs/promises";
101823
102165
  import { homedir as homedir24 } from "node:os";
101824
102166
  import { join as join84, resolve as resolve24 } from "node:path";
101825
102167
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
@@ -101854,7 +102196,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
101854
102196
  }
101855
102197
  async function readRuntimeWrapper(path16) {
101856
102198
  try {
101857
- return await readFile25(path16, "utf8");
102199
+ return await readFile26(path16, "utf8");
101858
102200
  } catch (error51) {
101859
102201
  if (error51 instanceof Error)
101860
102202
  return null;
@@ -102330,18 +102672,18 @@ Doctor failed unexpectedly: ${message}`];
102330
102672
  }
102331
102673
 
102332
102674
  // packages/mcp-client-core/src/mcp-oauth/storage.ts
102333
- import { createHash as createHash4 } from "node:crypto";
102675
+ import { createHash as createHash5 } from "node:crypto";
102334
102676
  import {
102335
102677
  chmodSync as chmodSync4,
102336
102678
  existsSync as existsSync63,
102337
102679
  mkdirSync as mkdirSync14,
102338
102680
  readdirSync as readdirSync9,
102339
- readFileSync as readFileSync43,
102681
+ readFileSync as readFileSync44,
102340
102682
  renameSync as renameSync7,
102341
102683
  unlinkSync as unlinkSync8,
102342
102684
  writeFileSync as writeFileSync11
102343
102685
  } from "node:fs";
102344
- import { basename as basename14, dirname as dirname33, join as join87 } from "node:path";
102686
+ import { basename as basename15, dirname as dirname33, join as join87 } from "node:path";
102345
102687
 
102346
102688
  // packages/mcp-client-core/src/config-dir.ts
102347
102689
  import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
@@ -102369,7 +102711,7 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
102369
102711
  }
102370
102712
 
102371
102713
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
102372
- import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync42, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
102714
+ import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync43, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
102373
102715
  import { join as join86 } from "node:path";
102374
102716
  var INDEX_FILE_NAME = "index.json";
102375
102717
  function isTokenIndex(value) {
@@ -102385,7 +102727,7 @@ function readTokenIndex(storageDir) {
102385
102727
  if (!existsSync62(indexPath))
102386
102728
  return {};
102387
102729
  try {
102388
- const parsed = JSON.parse(readFileSync42(indexPath, "utf-8"));
102730
+ const parsed = JSON.parse(readFileSync43(indexPath, "utf-8"));
102389
102731
  return isTokenIndex(parsed) ? parsed : {};
102390
102732
  } catch (readError) {
102391
102733
  if (!(readError instanceof Error))
@@ -102425,7 +102767,7 @@ function getMcpOauthStorageDir() {
102425
102767
  return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
102426
102768
  }
102427
102769
  function getMcpOauthServerHash(serverHost, resource) {
102428
- return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
102770
+ return createHash5("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
102429
102771
  }
102430
102772
  function getMcpOauthStoragePath(serverHost, resource) {
102431
102773
  return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
@@ -102495,7 +102837,7 @@ function readTokenFile(filePath) {
102495
102837
  if (!existsSync63(filePath))
102496
102838
  return null;
102497
102839
  try {
102498
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102840
+ const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
102499
102841
  return isOAuthTokenData(parsed) ? parsed : null;
102500
102842
  } catch (readError) {
102501
102843
  if (!(readError instanceof Error))
@@ -102508,7 +102850,7 @@ function readLegacyStore() {
102508
102850
  if (!existsSync63(filePath))
102509
102851
  return null;
102510
102852
  try {
102511
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102853
+ const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
102512
102854
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
102513
102855
  return null;
102514
102856
  const result = {};
@@ -102626,7 +102968,7 @@ function listAllTokens() {
102626
102968
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
102627
102969
  continue;
102628
102970
  const token = readTokenFile(join87(dir, entry.name));
102629
- const hash2 = basename14(entry.name, ".json");
102971
+ const hash2 = basename15(entry.name, ".json");
102630
102972
  if (token)
102631
102973
  result[index[hash2] ?? hash2] = token;
102632
102974
  }
@@ -102799,13 +103141,13 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
102799
103141
 
102800
103142
  // packages/mcp-client-core/src/mcp-oauth/oauth-authorization-flow.ts
102801
103143
  import { spawn as spawn4 } from "node:child_process";
102802
- import { createHash as createHash5, randomBytes as randomBytes2 } from "node:crypto";
103144
+ import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
102803
103145
  import { createServer as createServer2 } from "node:http";
102804
103146
  function generateCodeVerifier() {
102805
103147
  return randomBytes2(32).toString("base64url");
102806
103148
  }
102807
103149
  function generateCodeChallenge(verifier) {
102808
- return createHash5("sha256").update(verifier).digest("base64url");
103150
+ return createHash6("sha256").update(verifier).digest("base64url");
102809
103151
  }
102810
103152
  function buildAuthorizationUrl(authorizationEndpoint, options) {
102811
103153
  const url2 = new URL(authorizationEndpoint);
@@ -103349,7 +103691,7 @@ async function boulder(options) {
103349
103691
  }
103350
103692
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
103351
103693
  import { spawn as spawn5 } from "node:child_process";
103352
- import { existsSync as existsSync65, readFileSync as readFileSync44, realpathSync as realpathSync9 } from "node:fs";
103694
+ import { existsSync as existsSync65, readFileSync as readFileSync45, realpathSync as realpathSync9 } from "node:fs";
103353
103695
  import { homedir as homedir26 } from "node:os";
103354
103696
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
103355
103697
  function resolveCodexUlwLoopCommand(input = {}) {
@@ -103399,7 +103741,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
103399
103741
  }
103400
103742
  function isGeneratedRuntimeWrapper(candidate) {
103401
103743
  try {
103402
- return readFileSync44(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
103744
+ return readFileSync45(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
103403
103745
  } catch (error51) {
103404
103746
  if (error51 instanceof Error)
103405
103747
  return false;