oh-my-opencode 4.17.1 → 4.18.1

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 (213) hide show
  1. package/.agents/skills/codex-qa/SKILL.md +2 -0
  2. package/.agents/skills/codex-qa/scripts/lsp-e2e.sh +3654 -0
  3. package/.agents/skills/opencode-qa/scripts/lsp-e2e.sh +3071 -0
  4. package/.agents/skills/work-with-pr/SKILL.md +16 -37
  5. package/.agents/skills/work-with-pr-workspace/evals/evals.json +3 -3
  6. package/.opencode/skills/work-with-pr/SKILL.md +16 -37
  7. package/.opencode/skills/work-with-pr-workspace/evals/evals.json +3 -3
  8. package/dist/cli/get-local-version/types.d.ts +1 -1
  9. package/dist/cli/index.js +498 -165
  10. package/dist/cli-node/index.js +498 -165
  11. package/dist/index.js +425 -392
  12. package/dist/skills/frontend/SKILL.md +1 -1
  13. package/dist/skills/frontend/references/design/README.md +9 -0
  14. package/dist/skills/frontend/references/design/design-system-architecture.md +4 -2
  15. package/dist/skills/frontend/references/design/layout-skill.md +107 -0
  16. package/dist/skills/programming/SKILL.md +12 -2
  17. package/package.json +17 -16
  18. package/packages/lsp-core/package.json +4 -0
  19. package/packages/lsp-core/src/index.ts +1 -0
  20. package/packages/lsp-core/src/lsp/cleanup-errors.test.ts +18 -0
  21. package/packages/lsp-core/src/lsp/cleanup-errors.ts +12 -3
  22. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +261 -0
  23. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +63 -0
  24. package/packages/lsp-core/src/lsp/client-wrapper.ts +35 -5
  25. package/packages/lsp-core/src/lsp/client.ts +262 -80
  26. package/packages/lsp-core/src/lsp/config-loader.ts +5 -17
  27. package/packages/lsp-core/src/lsp/connection.ts +12 -6
  28. package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +104 -0
  29. package/packages/lsp-core/src/lsp/directory-diagnostics.ts +60 -27
  30. package/packages/lsp-core/src/lsp/errors.ts +11 -0
  31. package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +283 -0
  32. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-contract-probe.ts +196 -0
  33. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +215 -0
  34. package/packages/lsp-core/src/lsp/formatters.ts +3 -0
  35. package/packages/lsp-core/src/lsp/json-rpc-connection-cancellation.test.ts +97 -0
  36. package/packages/lsp-core/src/lsp/json-rpc-connection.ts +73 -5
  37. package/packages/lsp-core/src/lsp/server-install-state.ts +3 -6
  38. package/packages/lsp-core/src/lsp/transport-protocol.ts +52 -0
  39. package/packages/lsp-core/src/lsp/transport.ts +96 -70
  40. package/packages/lsp-core/src/lsp/workspace-apply-edit-failure.ts +19 -0
  41. package/packages/lsp-core/src/lsp/workspace-apply-edit-lease.integration.test.ts +214 -0
  42. package/packages/lsp-core/src/lsp/workspace-apply-edit-sync.integration.test.ts +113 -0
  43. package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +163 -0
  44. package/packages/lsp-core/src/lsp/workspace-apply-edit.integration.test.ts +163 -0
  45. package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +67 -0
  46. package/packages/lsp-core/src/lsp/workspace-document-state.ts +368 -0
  47. package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +113 -0
  48. package/packages/lsp-core/src/lsp/workspace-edit-commit.test.ts +140 -0
  49. package/packages/lsp-core/src/lsp/workspace-edit-commit.ts +220 -0
  50. package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.test.ts +56 -0
  51. package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.ts +30 -0
  52. package/packages/lsp-core/src/lsp/workspace-edit-fingerprint.ts +44 -0
  53. package/packages/lsp-core/src/lsp/workspace-edit-options.test.ts +147 -0
  54. package/packages/lsp-core/src/lsp/workspace-edit-parse-helpers.ts +59 -0
  55. package/packages/lsp-core/src/lsp/workspace-edit-parser.ts +130 -0
  56. package/packages/lsp-core/src/lsp/workspace-edit-path.ts +98 -0
  57. package/packages/lsp-core/src/lsp/workspace-edit-plan-types.ts +60 -0
  58. package/packages/lsp-core/src/lsp/workspace-edit-plan.ts +73 -0
  59. package/packages/lsp-core/src/lsp/workspace-edit-prevalidation.test.ts +174 -0
  60. package/packages/lsp-core/src/lsp/workspace-edit-resource-parser.ts +89 -0
  61. package/packages/lsp-core/src/lsp/workspace-edit-simulation.ts +183 -0
  62. package/packages/lsp-core/src/lsp/workspace-edit-snapshot.ts +53 -0
  63. package/packages/lsp-core/src/lsp/workspace-edit-text.ts +125 -0
  64. package/packages/lsp-core/src/lsp/workspace-edit-types.ts +121 -0
  65. package/packages/lsp-core/src/lsp/workspace-edit.characterization.test.ts +95 -0
  66. package/packages/lsp-core/src/lsp/workspace-edit.ts +49 -200
  67. package/packages/lsp-core/src/lsp/workspace-mutation-controller.ts +182 -0
  68. package/packages/lsp-core/src/mcp.ts +18 -7
  69. package/packages/lsp-core/src/missing-dependency-result.test.ts +105 -0
  70. package/packages/lsp-core/src/missing-dependency-result.ts +57 -0
  71. package/packages/lsp-core/src/post-edit/index.ts +1 -0
  72. package/packages/lsp-core/src/post-edit/orchestration.test.ts +157 -0
  73. package/packages/lsp-core/src/post-edit/orchestration.ts +178 -0
  74. package/packages/lsp-core/src/request-context.test.ts +171 -0
  75. package/packages/lsp-core/src/request-context.ts +222 -9
  76. package/packages/lsp-core/src/tool-surface.test.ts +4 -1
  77. package/packages/lsp-core/src/tools/diagnostics.ts +32 -13
  78. package/packages/lsp-core/src/tools/navigation.ts +12 -12
  79. package/packages/lsp-core/src/tools/rename.ts +10 -15
  80. package/packages/lsp-core/src/tools/symbols.ts +11 -11
  81. package/packages/lsp-core/src/tools/types.ts +2 -1
  82. package/packages/lsp-daemon/dist/cli.js +3114 -747
  83. package/packages/lsp-daemon/dist/client.d.ts +105 -0
  84. package/packages/lsp-daemon/dist/client.js +5851 -0
  85. package/packages/lsp-daemon/dist/daemon-client.d.ts +11 -6
  86. package/packages/lsp-daemon/dist/daemon-client.js +113 -30
  87. package/packages/lsp-daemon/dist/daemon-server.d.ts +1 -0
  88. package/packages/lsp-daemon/dist/daemon-server.js +40 -15
  89. package/packages/lsp-daemon/dist/ensure-daemon.d.ts +8 -7
  90. package/packages/lsp-daemon/dist/ensure-daemon.js +67 -44
  91. package/packages/lsp-daemon/dist/index.d.ts +2 -2
  92. package/packages/lsp-daemon/dist/index.js +2862 -754
  93. package/packages/lsp-daemon/dist/ipc-protocol.d.ts +46 -0
  94. package/packages/lsp-daemon/dist/ipc-protocol.js +187 -0
  95. package/packages/lsp-daemon/dist/lock.js +14 -4
  96. package/packages/lsp-daemon/dist/ownership.d.ts +49 -0
  97. package/packages/lsp-daemon/dist/ownership.js +168 -0
  98. package/packages/lsp-daemon/dist/paths.d.ts +33 -9
  99. package/packages/lsp-daemon/dist/paths.js +72 -33
  100. package/packages/lsp-daemon/dist/proxy.d.ts +3 -0
  101. package/packages/lsp-daemon/dist/proxy.js +54 -3
  102. package/packages/lsp-daemon/dist/request-routing.d.ts +7 -2
  103. package/packages/lsp-daemon/dist/request-routing.js +71 -22
  104. package/packages/lsp-daemon/dist/run-daemon.js +9 -2
  105. package/packages/lsp-daemon/dist/runtime-contract.d.ts +21 -0
  106. package/packages/lsp-daemon/dist/runtime-contract.js +58 -0
  107. package/packages/lsp-daemon/dist/socket-jsonrpc.js +6 -1
  108. package/packages/lsp-daemon/package.json +12 -3
  109. package/packages/lsp-tools-mcp/dist/cli.js +2115 -442
  110. package/packages/lsp-tools-mcp/dist/lsp/manager.js +1741 -148
  111. package/packages/lsp-tools-mcp/dist/mcp.js +2127 -454
  112. package/packages/lsp-tools-mcp/dist/request-context.js +176 -6
  113. package/packages/lsp-tools-mcp/dist/tools.js +2118 -446
  114. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  115. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  116. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  117. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  118. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  119. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  120. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  121. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  122. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  123. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  124. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +55 -0
  125. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +2959 -944
  126. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +0 -4
  127. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +5 -2
  128. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +41 -62
  129. package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.d.ts +1 -1
  130. package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +24 -15
  131. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +3 -7
  132. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +23 -49
  133. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  134. package/packages/omo-codex/plugin/components/lsp/package.json +3 -2
  135. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +31 -1
  136. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.test.mjs +76 -0
  137. package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.mjs +201 -0
  138. package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.test.mjs +55 -0
  139. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +0 -4
  140. package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +49 -71
  141. package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +26 -15
  142. package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +26 -64
  143. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +16 -17
  144. package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +30 -4
  145. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +19 -5
  146. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.5.md +1 -1
  147. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +8 -6
  148. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  149. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  150. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +1 -1
  151. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  152. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  153. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  154. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  155. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  156. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  157. package/packages/omo-codex/plugin/components/ultrawork/directive.md +37 -10
  158. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  159. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  160. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +37 -10
  161. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +37 -10
  162. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  163. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  164. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +2 -2
  165. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +10 -9
  166. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  167. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  168. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  169. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  170. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  171. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  172. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  173. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  174. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  175. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  176. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  177. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  178. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  179. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  180. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  181. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  182. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  183. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  184. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  185. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  186. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  187. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  188. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  189. package/packages/omo-codex/plugin/package-lock.json +26 -14
  190. package/packages/omo-codex/plugin/package.json +1 -1
  191. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +2 -3
  192. package/packages/omo-codex/plugin/scripts/build-components.mjs +13 -1
  193. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +1 -1
  194. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +1 -1
  195. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +9 -0
  196. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +4 -2
  197. package/packages/omo-codex/plugin/skills/frontend/references/design/layout-skill.md +107 -0
  198. package/packages/omo-codex/plugin/skills/programming/SKILL.md +12 -2
  199. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +1 -1
  200. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +37 -10
  201. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +2 -2
  202. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +10 -9
  203. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +8 -0
  204. package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +128 -15
  205. package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +10 -0
  206. package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +2 -0
  207. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +1 -1
  208. package/packages/omo-codex/scripts/install-dist/install-local.mjs +351 -74
  209. package/packages/shared-skills/skills/frontend/SKILL.md +1 -1
  210. package/packages/shared-skills/skills/frontend/references/design/README.md +9 -0
  211. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +4 -2
  212. package/packages/shared-skills/skills/frontend/references/design/layout-skill.md +107 -0
  213. package/packages/shared-skills/skills/programming/SKILL.md +12 -2
@@ -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.17.1",
2149
+ version: "4.18.1",
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",
@@ -2253,8 +2253,10 @@ var init_package = __esm(() => {
2253
2253
  build: "bun run script/build.ts",
2254
2254
  "build:cli-node": "bun run script/build-cli-node.ts",
2255
2255
  "build:codex-install": "bun run script/build-codex-install.ts",
2256
+ "install:codex-dev": "bun run script/build-codex-install.ts && bun run script/install-codex-dev.ts",
2256
2257
  "build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
2257
- "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",
2258
2260
  "build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
2259
2261
  "build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
2260
2262
  "build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
@@ -2276,7 +2278,7 @@ var init_package = __esm(() => {
2276
2278
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
2277
2279
  test: "bun test",
2278
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",
2279
- "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",
2280
2282
  "test:windows-codex": "bun run test:codex",
2281
2283
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
2282
2284
  },
@@ -2316,7 +2318,6 @@ var init_package = __esm(() => {
2316
2318
  picocolors: "^1.1.1",
2317
2319
  picomatch: "^4.0.4",
2318
2320
  "posthog-node": "^5.34.3",
2319
- "vscode-jsonrpc": "^8.2.1",
2320
2321
  zod: "^4.4.3"
2321
2322
  },
2322
2323
  devDependencies: {
@@ -2357,18 +2358,18 @@ var init_package = __esm(() => {
2357
2358
  typescript: "^6.0.3"
2358
2359
  },
2359
2360
  optionalDependencies: {
2360
- "oh-my-opencode-darwin-arm64": "4.17.1",
2361
- "oh-my-opencode-darwin-x64": "4.17.1",
2362
- "oh-my-opencode-darwin-x64-baseline": "4.17.1",
2363
- "oh-my-opencode-linux-arm64": "4.17.1",
2364
- "oh-my-opencode-linux-arm64-musl": "4.17.1",
2365
- "oh-my-opencode-linux-x64": "4.17.1",
2366
- "oh-my-opencode-linux-x64-baseline": "4.17.1",
2367
- "oh-my-opencode-linux-x64-musl": "4.17.1",
2368
- "oh-my-opencode-linux-x64-musl-baseline": "4.17.1",
2369
- "oh-my-opencode-windows-arm64": "4.17.1",
2370
- "oh-my-opencode-windows-x64": "4.17.1",
2371
- "oh-my-opencode-windows-x64-baseline": "4.17.1"
2361
+ "oh-my-opencode-darwin-arm64": "4.18.1",
2362
+ "oh-my-opencode-darwin-x64": "4.18.1",
2363
+ "oh-my-opencode-darwin-x64-baseline": "4.18.1",
2364
+ "oh-my-opencode-linux-arm64": "4.18.1",
2365
+ "oh-my-opencode-linux-arm64-musl": "4.18.1",
2366
+ "oh-my-opencode-linux-x64": "4.18.1",
2367
+ "oh-my-opencode-linux-x64-baseline": "4.18.1",
2368
+ "oh-my-opencode-linux-x64-musl": "4.18.1",
2369
+ "oh-my-opencode-linux-x64-musl-baseline": "4.18.1",
2370
+ "oh-my-opencode-windows-arm64": "4.18.1",
2371
+ "oh-my-opencode-windows-x64": "4.18.1",
2372
+ "oh-my-opencode-windows-x64-baseline": "4.18.1"
2372
2373
  },
2373
2374
  overrides: {
2374
2375
  "@earendil-works/pi-agent-core": "0.80.3",
@@ -66850,14 +66851,14 @@ var init_config_manager = __esm(() => {
66850
66851
 
66851
66852
  // packages/telemetry-core/src/activity-state.ts
66852
66853
  import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "node:fs";
66853
- import { basename as basename10, join as join53 } from "node:path";
66854
+ import { basename as basename11, join as join53 } from "node:path";
66854
66855
  function resolveTelemetryStateDir(product, options = {}) {
66855
66856
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
66856
66857
  env: options.env,
66857
66858
  osProvider: options.osProvider
66858
66859
  });
66859
66860
  const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
66860
- if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
66861
+ if (dataDir === xdgStateDir || xdgStateDir === undefined && basename11(dataDir) === product.cacheDirName) {
66861
66862
  return dataDir;
66862
66863
  }
66863
66864
  return join53(dataDir, product.cacheDirName);
@@ -67091,18 +67092,18 @@ var init_env2 = __esm(() => {
67091
67092
  });
67092
67093
 
67093
67094
  // packages/telemetry-core/src/machine-id.ts
67094
- import { createHash as createHash3 } from "node:crypto";
67095
+ import { createHash as createHash4 } from "node:crypto";
67095
67096
  import os4 from "node:os";
67096
67097
  function getDefaultTelemetryOsProvider() {
67097
67098
  return os4;
67098
67099
  }
67099
67100
  function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
67100
- return createHash3("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
67101
+ return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
67101
67102
  }
67102
67103
  var init_machine_id = () => {};
67103
67104
 
67104
67105
  // node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
67105
- import { dirname as dirname18, posix as posix2, sep as sep7 } from "path";
67106
+ import { dirname as dirname18, posix as posix3, sep as sep7 } from "path";
67106
67107
  function createModulerModifier() {
67107
67108
  const getModuleFromFileName = createGetModuleFromFilename();
67108
67109
  return async (frames) => {
@@ -67117,7 +67118,7 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(proc
67117
67118
  if (!filename)
67118
67119
  return;
67119
67120
  const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
67120
- let { dir, base: file2, ext } = posix2.parse(normalizedFilename);
67121
+ let { dir, base: file2, ext } = posix3.parse(normalizedFilename);
67121
67122
  if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
67122
67123
  file2 = file2.slice(0, -1 * ext.length);
67123
67124
  const decodedFile = decodeURIComponent(file2);
@@ -72657,7 +72658,7 @@ var package_default2;
72657
72658
  var init_package2 = __esm(() => {
72658
72659
  package_default2 = {
72659
72660
  name: "@oh-my-opencode/omo-codex",
72660
- version: "4.17.1",
72661
+ version: "4.18.1",
72661
72662
  type: "module",
72662
72663
  private: true,
72663
72664
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -73476,18 +73477,18 @@ function removeFromTextBunLock(lockPath, packageNames) {
73476
73477
  try {
73477
73478
  const content = fs12.readFileSync(lockPath, "utf-8");
73478
73479
  const lock = JSON.parse(stripTrailingCommas(content));
73479
- let removed = false;
73480
+ let removed2 = false;
73480
73481
  for (const packageName of packageNames) {
73481
73482
  if (lock.packages?.[packageName]) {
73482
73483
  delete lock.packages[packageName];
73483
73484
  log2(`[auto-update-checker] Removed from bun.lock: ${packageName}`);
73484
- removed = true;
73485
+ removed2 = true;
73485
73486
  }
73486
73487
  }
73487
- if (removed) {
73488
+ if (removed2) {
73488
73489
  fs12.writeFileSync(lockPath, JSON.stringify(lock, null, 2));
73489
73490
  }
73490
- return removed;
73491
+ return removed2;
73491
73492
  } catch (error51) {
73492
73493
  if (!(error51 instanceof Error)) {
73493
73494
  throw error51;
@@ -73527,7 +73528,7 @@ function getInvalidationPackageNames(packageName, defaultPackageName, acceptedPa
73527
73528
  function removeSpecifierRootDirs(cacheDir, packageNames) {
73528
73529
  const parentDirs = [cacheDir, path13.join(cacheDir, "packages")];
73529
73530
  const prefixes = packageNames.map((packageName) => `${packageName}@`);
73530
- let removed = false;
73531
+ let removed2 = false;
73531
73532
  for (const parentDir of parentDirs) {
73532
73533
  if (!fs12.existsSync(parentDir)) {
73533
73534
  continue;
@@ -73539,10 +73540,10 @@ function removeSpecifierRootDirs(cacheDir, packageNames) {
73539
73540
  const specifierDir = path13.join(parentDir, entry.name);
73540
73541
  fs12.rmSync(specifierDir, { recursive: true, force: true });
73541
73542
  log2(`[auto-update-checker] Specifier cache removed: ${specifierDir}`);
73542
- removed = true;
73543
+ removed2 = true;
73543
73544
  }
73544
73545
  }
73545
- return removed;
73546
+ return removed2;
73546
73547
  }
73547
73548
  function invalidatePackage(packageName, options = {}) {
73548
73549
  try {
@@ -75381,9 +75382,11 @@ function collectCommands(value, commands) {
75381
75382
 
75382
75383
  // packages/omo-codex/src/install/codex-cache-install.ts
75383
75384
  async function installCachedPlugin(input) {
75385
+ const env2 = input.env ?? process.env;
75386
+ const npmInstallEnv = sanitizeNpmInstallEnv(env2);
75384
75387
  if (input.buildSource !== false) {
75385
- await maybeRunNpmInstall(input.sourcePath, input.runCommand);
75386
- await maybeRunNpmBuild(input.sourcePath, input.runCommand);
75388
+ await maybeRunNpmInstall(input.sourcePath, input.runCommand, npmInstallEnv);
75389
+ await maybeRunNpmBuild(input.sourcePath, input.runCommand, env2);
75387
75390
  }
75388
75391
  const targetPath = join33(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
75389
75392
  const tempPath = createTempSiblingPath(targetPath);
@@ -75393,10 +75396,10 @@ async function installCachedPlugin(input) {
75393
75396
  await rewriteCachedPackageLocalFileDependencies(tempPath, input.sourcePath);
75394
75397
  await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: input.sourcePath });
75395
75398
  await copyRootRuntimeDists({ pluginRoot: tempPath, sourcePath: input.sourcePath });
75396
- await maybeRunNpmInstall(tempPath, input.runCommand, ["ci", "--omit=dev"]);
75399
+ await maybeRunNpmInstall(tempPath, input.runCommand, npmInstallEnv, ["ci", "--omit=dev"]);
75397
75400
  await removeCachedManagedNpmBinShims(tempPath);
75398
75401
  if (input.buildSource === false)
75399
- await maybeRunNpmSyncSkills(tempPath, input.runCommand);
75402
+ await maybeRunNpmSyncSkills(tempPath, input.runCommand, env2);
75400
75403
  await assertNoRemovedSparkshellPromptReferences(tempPath);
75401
75404
  await rewriteCachedMcpManifest(tempPath, input.sourcePath);
75402
75405
  await rewriteCachedManifestRoot(tempPath, tempPath, targetPath);
@@ -75408,12 +75411,12 @@ async function installCachedPlugin(input) {
75408
75411
  }
75409
75412
  return { name: input.name, version: input.version, path: targetPath };
75410
75413
  }
75411
- async function maybeRunNpmInstall(cwd, runCommand, args = ["install"]) {
75414
+ async function maybeRunNpmInstall(cwd, runCommand, env2, args = ["install"]) {
75412
75415
  if (!await fileExistsStrict(join33(cwd, "package.json")))
75413
75416
  return;
75414
- await runCommand("npm", args, { cwd });
75417
+ await runCommand("npm", args, { cwd, env: env2 });
75415
75418
  }
75416
- async function maybeRunNpmBuild(cwd, runCommand) {
75419
+ async function maybeRunNpmBuild(cwd, runCommand, env2) {
75417
75420
  if (!await fileExistsStrict(join33(cwd, "package.json")))
75418
75421
  return;
75419
75422
  const packageJson = JSON.parse(await readFile8(join33(cwd, "package.json"), "utf8"));
@@ -75422,9 +75425,9 @@ async function maybeRunNpmBuild(cwd, runCommand) {
75422
75425
  const scripts = packageJson.scripts;
75423
75426
  if (!isPlainRecord3(scripts) || typeof scripts.build !== "string")
75424
75427
  return;
75425
- await runCommand("npm", ["run", "build"], { cwd });
75428
+ await runCommand("npm", ["run", "build"], { cwd, env: env2 });
75426
75429
  }
75427
- async function maybeRunNpmSyncSkills(cwd, runCommand) {
75430
+ async function maybeRunNpmSyncSkills(cwd, runCommand, env2) {
75428
75431
  if (!await fileExistsStrict(join33(cwd, "package.json")))
75429
75432
  return;
75430
75433
  const packageJson = JSON.parse(await readFile8(join33(cwd, "package.json"), "utf8"));
@@ -75433,7 +75436,10 @@ async function maybeRunNpmSyncSkills(cwd, runCommand) {
75433
75436
  const scripts = packageJson.scripts;
75434
75437
  if (!isPlainRecord3(scripts) || typeof scripts["sync:skills"] !== "string")
75435
75438
  return;
75436
- await runCommand("npm", ["run", "sync:skills"], { cwd });
75439
+ await runCommand("npm", ["run", "sync:skills"], { cwd, env: env2 });
75440
+ }
75441
+ function sanitizeNpmInstallEnv(env2) {
75442
+ return Object.fromEntries(Object.entries(env2).filter(([key]) => key.toLowerCase() !== "npm_config_allow_scripts"));
75437
75443
  }
75438
75444
  function createTempSiblingPath(targetPath) {
75439
75445
  return join33(dirname13(targetPath), `.tmp-${basename7(targetPath)}-${process.pid}-${Date.now()}`);
@@ -77463,6 +77469,10 @@ async function readDistributionManifest(repoRoot) {
77463
77469
  }
77464
77470
  }
77465
77471
  function resolveLazyCodexPluginVersion(input) {
77472
+ const override = input.versionOverride?.trim();
77473
+ if (override !== undefined && override.length > 0) {
77474
+ return override;
77475
+ }
77466
77476
  if (input.marketplaceName === "sisyphuslabs" && input.pluginName === "omo" && input.distributionManifest !== undefined) {
77467
77477
  return input.distributionManifest.version;
77468
77478
  }
@@ -77833,65 +77843,297 @@ function formatUnknownError(error) {
77833
77843
  }
77834
77844
 
77835
77845
  // packages/omo-codex/src/install/lsp-daemon-reaper.ts
77836
- import { readFile as readFile18, readdir as readdir9, rm as rm10 } from "node:fs/promises";
77846
+ import { createHash as createHash3 } from "node:crypto";
77847
+ import { lstat as lstat11, readFile as readFile19, readdir as readdir10, rm as rm10 } from "node:fs/promises";
77848
+ import { tmpdir as tmpdir3 } from "node:os";
77849
+ import { join as join48, posix as posix2 } from "node:path";
77850
+
77851
+ // packages/omo-codex/src/install/lsp-daemon-reaper-attestation.ts
77852
+ import { execFile as execFile2 } from "node:child_process";
77853
+ import { readFile as readFile18, readdir as readdir9, readlink as readlink5 } from "node:fs/promises";
77837
77854
  import { connect } from "node:net";
77838
- import { join as join48 } from "node:path";
77839
- async function reapLspDaemons(codexHome, deps = {}) {
77840
- const killProcess = deps.killProcess ?? sendSigterm;
77841
- const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
77842
- const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
77843
- const reaped = [];
77844
- let entries;
77855
+ import { basename as basename10 } from "node:path";
77856
+ var PROBE_TIMEOUT_MS = 500;
77857
+ async function probeLegacyJsonRpcEndpoint(endpoint, timeoutMs = PROBE_TIMEOUT_MS) {
77858
+ return await new Promise((resolve14) => {
77859
+ const socket = connect(endpoint);
77860
+ let settled = false;
77861
+ let buffer = "";
77862
+ const finish = (value) => {
77863
+ if (settled)
77864
+ return;
77865
+ settled = true;
77866
+ clearTimeout(timer);
77867
+ socket.destroy();
77868
+ resolve14(value);
77869
+ };
77870
+ const timer = setTimeout(() => finish(false), timeoutMs);
77871
+ timer.unref?.();
77872
+ socket.once("connect", () => {
77873
+ socket.write(`${JSON.stringify(legacyStatusRequest())}
77874
+ `);
77875
+ });
77876
+ socket.on("data", (chunk) => {
77877
+ buffer += chunk.toString("utf8");
77878
+ const newlineIndex = buffer.indexOf(`
77879
+ `);
77880
+ if (newlineIndex < 0)
77881
+ return;
77882
+ finish(isJsonRpcResponse(buffer.slice(0, newlineIndex).trim()));
77883
+ });
77884
+ socket.once("error", () => finish(false));
77885
+ });
77886
+ }
77887
+ async function attestLegacyDaemonOwnership(input, deps = {}) {
77888
+ if (input.platform === "linux")
77889
+ return await attestLinuxOwnership(input, deps);
77890
+ if (input.platform === "darwin")
77891
+ return await attestMacOwnership(input, deps);
77892
+ return false;
77893
+ }
77894
+ async function attestLinuxOwnership(input, deps) {
77895
+ const readFileImpl = deps.readFile ?? readFile18;
77896
+ const readDirImpl = deps.readDir ?? readdir9;
77897
+ const readLinkImpl = deps.readLink ?? readlink5;
77898
+ const procNetUnix = await readText(readFileImpl, "/proc/net/unix");
77899
+ if (procNetUnix === null)
77900
+ return false;
77901
+ const inode = inodeForEndpoint(procNetUnix, input.endpoint);
77902
+ if (inode === null)
77903
+ return false;
77904
+ const fdEntries = await readDirImpl(`/proc/${input.pid}/fd`).catch(() => null);
77905
+ if (fdEntries === null)
77906
+ return false;
77907
+ let ownsEndpoint = false;
77908
+ for (const fdEntry of fdEntries) {
77909
+ const target = await readLinkImpl(`/proc/${input.pid}/fd/${fdEntry}`).catch(() => null);
77910
+ if (target !== `socket:[${inode}]`)
77911
+ continue;
77912
+ ownsEndpoint = true;
77913
+ break;
77914
+ }
77915
+ if (!ownsEndpoint)
77916
+ return false;
77917
+ const cmdline = await readBinary(readFileImpl, `/proc/${input.pid}/cmdline`);
77918
+ if (cmdline === null)
77919
+ return false;
77920
+ return isNodeCliDaemonArgv(splitCmdline(cmdline));
77921
+ }
77922
+ async function attestMacOwnership(input, deps) {
77923
+ const executeFileImpl = deps.executeFile ?? execFile2;
77924
+ const filteredLsofOutput = await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
77925
+ "-a",
77926
+ "-n",
77927
+ "-P",
77928
+ "-p",
77929
+ String(input.pid),
77930
+ "-U",
77931
+ "-Fn",
77932
+ "--",
77933
+ input.endpoint
77934
+ ]);
77935
+ const lsofOutput = filteredLsofOutput ?? await executeForStdout(executeFileImpl, "/usr/sbin/lsof", [
77936
+ "-a",
77937
+ "-n",
77938
+ "-P",
77939
+ "-p",
77940
+ String(input.pid),
77941
+ "-U",
77942
+ "-Fn"
77943
+ ]);
77944
+ if (lsofOutput === null || !lsofShowsUnixEndpoint(lsofOutput, input.pid, input.endpoint))
77945
+ return false;
77946
+ const commandOutput = await executeForStdout(executeFileImpl, "/bin/ps", ["-p", String(input.pid), "-o", "command="]);
77947
+ if (commandOutput === null)
77948
+ return false;
77949
+ return isNodeCliDaemonCommand(commandOutput.trim());
77950
+ }
77951
+ function legacyStatusRequest() {
77952
+ return {
77953
+ jsonrpc: "2.0",
77954
+ id: 1,
77955
+ method: "tools/call",
77956
+ params: { name: "status", arguments: {} }
77957
+ };
77958
+ }
77959
+ function isJsonRpcResponse(line) {
77960
+ if (line.length === 0)
77961
+ return false;
77845
77962
  try {
77846
- entries = await readdir9(daemonRoot);
77963
+ const parsed = JSON.parse(line);
77964
+ return parsed.jsonrpc === "2.0" && parsed.id === 1 && (Object.hasOwn(parsed, "result") || Object.hasOwn(parsed, "error"));
77847
77965
  } catch {
77848
- return reaped;
77966
+ return false;
77849
77967
  }
77850
- for (const entry of entries) {
77851
- const versionDir = join48(daemonRoot, entry);
77852
- const pid = await readPidFile(join48(versionDir, "daemon.pid"));
77853
- const socketPath = await readEndpointFile(join48(versionDir, "daemon.endpoint"));
77854
- if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
77855
- reaped.push(pid);
77968
+ }
77969
+ function inodeForEndpoint(procNetUnix, endpoint) {
77970
+ for (const line of procNetUnix.split(/\r?\n/)) {
77971
+ const trimmed = line.trim();
77972
+ if (trimmed.length === 0 || trimmed.startsWith("Num"))
77973
+ continue;
77974
+ const fields = trimmed.split(/\s+/);
77975
+ if (fields.length < 8 || fields[7] !== endpoint)
77976
+ continue;
77977
+ return fields[6] ?? null;
77978
+ }
77979
+ return null;
77980
+ }
77981
+ function splitCmdline(buffer) {
77982
+ return buffer.toString("utf8").split("\x00").filter((value) => value.length > 0);
77983
+ }
77984
+ function isNodeCliDaemonArgv(argv) {
77985
+ if (argv.length < 2 || !argv.includes("daemon"))
77986
+ return false;
77987
+ const executable = basename10(argv[0] ?? "");
77988
+ if (!/^node(?:\.exe)?$/i.test(executable))
77989
+ return false;
77990
+ return argv.some((value) => value === "cli.js" || value.endsWith("/cli.js") || value.endsWith("\\cli.js"));
77991
+ }
77992
+ function lsofShowsUnixEndpoint(output, pid, endpoint) {
77993
+ const lines = output.split(/\r?\n/).filter((line) => line.length > 0);
77994
+ const endpointName = basename10(endpoint);
77995
+ return lines.includes(`p${pid}`) && lines.some((line) => line === `n${endpoint}` || line === `n${endpointName}`);
77996
+ }
77997
+ function isNodeCliDaemonCommand(command) {
77998
+ return /\bnode(?:\.exe)?\b/i.test(command) && /\bcli\.js\b/.test(command) && /\bdaemon\b/.test(command);
77999
+ }
78000
+ async function executeForStdout(executeFileImpl, file2, args) {
78001
+ return await new Promise((resolve14) => {
78002
+ executeFileImpl(file2, [...args], { encoding: "utf8", maxBuffer: 1024 * 1024, timeout: 1000 }, (error, stdout) => {
78003
+ if (error !== null) {
78004
+ resolve14(null);
78005
+ return;
78006
+ }
78007
+ resolve14(stdout);
78008
+ });
78009
+ });
78010
+ }
78011
+ async function readText(readFileImpl, path7) {
78012
+ return await readFileImpl(path7, "utf8").catch(() => null);
78013
+ }
78014
+ async function readBinary(readFileImpl, path7) {
78015
+ return await readFileImpl(path7).catch(() => null);
78016
+ }
78017
+
78018
+ // packages/omo-codex/src/install/lsp-daemon-reaper.ts
78019
+ var LEGACY_EXIT_WAIT_TIMEOUT_MS = 5000;
78020
+ var LEGACY_VERSION_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;
78021
+ async function reapLspDaemons(codexHome, deps = {}) {
78022
+ const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
78023
+ const platform = deps.platform ?? process.platform;
78024
+ const tmpDir = deps.tmpDir ?? tmpdir3();
78025
+ const probe2 = deps.probeLegacyJsonRpc ?? probeLegacyJsonRpcEndpoint;
78026
+ const attest = deps.attestLegacyDaemonOwnership ?? ((input) => attestLegacyDaemonOwnership(input));
78027
+ const killProcess = deps.killProcess ?? sendSigterm;
78028
+ const waitForProcessExit = deps.waitForProcessExit ?? defaultWaitForProcessExit;
78029
+ const entries = await readdir10(daemonRoot, { withFileTypes: true }).catch(() => []);
78030
+ const results = [];
78031
+ for (const entry of [...entries].sort((left, right) => left.name.localeCompare(right.name))) {
78032
+ const versionPath = join48(daemonRoot, entry.name);
78033
+ const parsedVersion = parseVersionEntry(entry.name);
78034
+ if (parsedVersion === null || !entry.isDirectory()) {
78035
+ await removeVersionDir(versionPath);
78036
+ results.push(removed(entry.name, "removed invalid legacy version entry"));
78037
+ continue;
78038
+ }
78039
+ const metadata = await readLegacyMetadata({ versionPath, version: parsedVersion, codexHome, platform, tmpDir });
78040
+ if (metadata.kind === "remove") {
78041
+ await removeVersionDir(versionPath);
78042
+ results.push(removed(parsedVersion, metadata.reason));
78043
+ continue;
77856
78044
  }
77857
- await rm10(versionDir, { recursive: true, force: true });
78045
+ if (!await probe2(metadata.endpoint)) {
78046
+ await removeVersionDir(versionPath);
78047
+ results.push(removed(parsedVersion, "removed stale legacy daemon state"));
78048
+ continue;
78049
+ }
78050
+ if (platform === "win32") {
78051
+ results.push(deferred(parsedVersion, "legacy named pipe responded but Windows cannot prove pid ownership safely"));
78052
+ continue;
78053
+ }
78054
+ const owned = await attest({ pid: metadata.pid, endpoint: metadata.endpoint, platform });
78055
+ if (!owned) {
78056
+ results.push(deferred(parsedVersion, "legacy endpoint responded but pid ownership was not proven"));
78057
+ continue;
78058
+ }
78059
+ if (!killProcess(metadata.pid)) {
78060
+ await removeVersionDir(versionPath);
78061
+ results.push(removed(parsedVersion, "removed stale legacy daemon state"));
78062
+ continue;
78063
+ }
78064
+ if (!await waitForProcessExit(metadata.pid, LEGACY_EXIT_WAIT_TIMEOUT_MS)) {
78065
+ results.push(deferred(parsedVersion, `timed out waiting ${LEGACY_EXIT_WAIT_TIMEOUT_MS}ms for the proven legacy daemon to exit`));
78066
+ continue;
78067
+ }
78068
+ await removeVersionDir(versionPath);
78069
+ results.push(terminated(parsedVersion, "terminated proven owned legacy daemon"));
77858
78070
  }
77859
- return reaped;
78071
+ return results;
77860
78072
  }
77861
- async function readEndpointFile(path7) {
77862
- try {
77863
- const content = (await readFile18(path7, "utf8")).trim();
77864
- return content.length > 0 ? content : null;
77865
- } catch {
78073
+ function parseVersionEntry(entryName) {
78074
+ if (!entryName.startsWith("v"))
77866
78075
  return null;
78076
+ const version = entryName.slice(1);
78077
+ return LEGACY_VERSION_PATTERN.test(version) ? version : null;
78078
+ }
78079
+ async function readLegacyMetadata(input) {
78080
+ const pidText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.pid"));
78081
+ if (pidText === "non_regular")
78082
+ return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
78083
+ if (pidText === null)
78084
+ return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
78085
+ const pid = Number.parseInt(pidText, 10);
78086
+ if (!Number.isInteger(pid) || pid <= 0)
78087
+ return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
78088
+ const endpointText = await readRegularTrimmedFile(join48(input.versionPath, "daemon.endpoint"));
78089
+ if (endpointText === "non_regular")
78090
+ return { kind: "remove", reason: "removed non-regular legacy daemon metadata" };
78091
+ if (endpointText === null)
78092
+ return { kind: "remove", reason: "removed malformed legacy daemon metadata" };
78093
+ const allowedEndpoints = legacyEndpointCandidates({
78094
+ version: input.version,
78095
+ versionPath: input.versionPath,
78096
+ platform: input.platform,
78097
+ tmpDir: input.tmpDir
78098
+ });
78099
+ if (!allowedEndpoints.includes(endpointText)) {
78100
+ return { kind: "remove", reason: "removed legacy daemon state with an endpoint outside the frozen vectors" };
77867
78101
  }
78102
+ return { kind: "valid", pid, endpoint: endpointText };
77868
78103
  }
77869
- async function readPidFile(path7) {
77870
- try {
77871
- const pid = Number.parseInt((await readFile18(path7, "utf8")).trim(), 10);
77872
- return Number.isInteger(pid) && pid > 0 ? pid : null;
77873
- } catch {
77874
- return null;
78104
+ function legacyEndpointCandidates(input) {
78105
+ if (input.platform === "win32") {
78106
+ const normalizedVersionPath = input.versionPath.replaceAll("/", "\\");
78107
+ const digest = shortDigest(normalizedVersionPath);
78108
+ return [`\\\\.\\pipe\\omo-lsp-${input.version}-${digest}`];
77875
78109
  }
78110
+ const natural = posix2.join(input.versionPath, "daemon.sock");
78111
+ const hashed = posix2.join(input.tmpDir, `omo-lsp-${input.version}-${shortDigest(input.versionPath)}.sock`);
78112
+ return [natural, hashed];
77876
78113
  }
77877
- function probeSocketLive(socketPath, timeoutMs = 500) {
77878
- return new Promise((resolve14) => {
77879
- const socket = connect(socketPath);
77880
- const done = (ok) => {
77881
- socket.destroy();
77882
- resolve14(ok);
77883
- };
77884
- const timer = setTimeout(() => done(false), timeoutMs);
77885
- timer.unref();
77886
- socket.once("connect", () => {
77887
- clearTimeout(timer);
77888
- done(true);
77889
- });
77890
- socket.once("error", () => {
77891
- clearTimeout(timer);
77892
- done(false);
77893
- });
77894
- });
78114
+ async function readRegularTrimmedFile(path7) {
78115
+ const stats = await lstat11(path7).catch(() => null);
78116
+ if (stats === null)
78117
+ return null;
78118
+ if (!stats.isFile())
78119
+ return "non_regular";
78120
+ const content = (await readFile19(path7, "utf8")).trim();
78121
+ return content.length > 0 ? content : null;
78122
+ }
78123
+ function shortDigest(value) {
78124
+ return createHash3("sha256").update(value).digest("hex").slice(0, 16);
78125
+ }
78126
+ async function removeVersionDir(path7) {
78127
+ await rm10(path7, { recursive: true, force: true });
78128
+ }
78129
+ function removed(version, reason) {
78130
+ return { version, status: "removed", reason };
78131
+ }
78132
+ function terminated(version, reason) {
78133
+ return { version, status: "terminated", reason };
78134
+ }
78135
+ function deferred(version, reason) {
78136
+ return { version, status: "deferred", reason };
77895
78137
  }
77896
78138
  function sendSigterm(pid) {
77897
78139
  try {
@@ -77901,6 +78143,24 @@ function sendSigterm(pid) {
77901
78143
  return false;
77902
78144
  }
77903
78145
  }
78146
+ async function defaultWaitForProcessExit(pid, timeoutMs) {
78147
+ const deadline = Date.now() + timeoutMs;
78148
+ for (;; ) {
78149
+ if (!processIsRunning(pid))
78150
+ return true;
78151
+ if (Date.now() >= deadline)
78152
+ return false;
78153
+ await new Promise((resolve14) => setTimeout(resolve14, 100));
78154
+ }
78155
+ }
78156
+ function processIsRunning(pid) {
78157
+ try {
78158
+ process.kill(pid, 0);
78159
+ return true;
78160
+ } catch {
78161
+ return false;
78162
+ }
78163
+ }
77904
78164
 
77905
78165
  // packages/omo-codex/src/install/codex-installer-bin-dir.ts
77906
78166
  import { homedir as homedir5 } from "node:os";
@@ -77918,7 +78178,7 @@ function resolveCodexInstallerBinDir(input) {
77918
78178
  }
77919
78179
 
77920
78180
  // packages/omo-codex/src/install/codex-git-bash-hooks.ts
77921
- import { readFile as readFile19, writeFile as writeFile11 } from "node:fs/promises";
78181
+ import { readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
77922
78182
  import { join as join50 } from "node:path";
77923
78183
  var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
77924
78184
  "./hooks/pre-tool-use-recommending-git-bash-mcp.json",
@@ -77928,7 +78188,7 @@ async function removeGitBashHooksOffWindows(input) {
77928
78188
  if (input.platform === "win32")
77929
78189
  return;
77930
78190
  const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
77931
- const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
78191
+ const parsed = JSON.parse(await readFile20(manifestPath, "utf8"));
77932
78192
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
77933
78193
  return;
77934
78194
  const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
@@ -78013,6 +78273,7 @@ async function runCodexInstaller(options = {}) {
78013
78273
  return;
78014
78274
  });
78015
78275
  const buildSource = await shouldBuildSourcePackages(repoRoot);
78276
+ const versionOverride = env3.LAZYCODEX_DEV_VERSION?.trim() || undefined;
78016
78277
  const gitBashResolution = await prepareGitBashForInstall({
78017
78278
  platform,
78018
78279
  env: env3,
@@ -78039,13 +78300,15 @@ async function runCodexInstaller(options = {}) {
78039
78300
  manifestVersion: manifest.version,
78040
78301
  marketplaceName: marketplace.name,
78041
78302
  pluginName: entry.name,
78042
- distributionManifest
78303
+ distributionManifest,
78304
+ versionOverride
78043
78305
  });
78044
78306
  validatePathSegment(version2, "plugin version");
78045
78307
  log4(`Building ${entry.name}@${version2}`);
78046
78308
  const plugin = await installCachedPlugin({
78047
78309
  buildSource,
78048
78310
  codexHome,
78311
+ env: env3,
78049
78312
  marketplaceName: marketplace.name,
78050
78313
  name: entry.name,
78051
78314
  runCommand,
@@ -78119,7 +78382,16 @@ async function runCodexInstaller(options = {}) {
78119
78382
  pluginNames: marketplace.plugins.map((plugin) => plugin.name)
78120
78383
  });
78121
78384
  }
78122
- await reapLspDaemons(codexHome).catch(() => []);
78385
+ const legacyDaemonCleanup = await reapLspDaemons(codexHome).catch((error) => {
78386
+ const message = error instanceof Error ? error.message : String(error);
78387
+ log4(`Warning: skipped legacy Codex LSP daemon cleanup: ${message}`);
78388
+ return [];
78389
+ });
78390
+ for (const cleanup of legacyDaemonCleanup) {
78391
+ if (cleanup.status !== "deferred")
78392
+ continue;
78393
+ log4(`Warning: deferred legacy Codex LSP daemon cleanup for v${cleanup.version}: ${cleanup.reason}`);
78394
+ }
78123
78395
  const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
78124
78396
  await writeCachedMarketplaceManifest({
78125
78397
  marketplaceName: marketplace.name,
@@ -78211,10 +78483,10 @@ function codexMarketplaceSource(marketplaceRoot) {
78211
78483
  }
78212
78484
  // packages/omo-codex/src/install/codex-installation-detection.ts
78213
78485
  init_bun_which_shim();
78214
- import { execFile as execFile2 } from "node:child_process";
78486
+ import { execFile as execFile3 } from "node:child_process";
78215
78487
  import { existsSync as existsSync31 } from "node:fs";
78216
78488
  import { homedir as homedir7 } from "node:os";
78217
- import { posix as posix3, win32 as win323 } from "node:path";
78489
+ import { posix as posix4, win32 as win323 } from "node:path";
78218
78490
  var CODEX_PATH_CHECK_LABEL = "codex (PATH)";
78219
78491
  var WINDOWS_START_APPS_ARGS = [
78220
78492
  "-NoProfile",
@@ -78291,11 +78563,11 @@ async function findWindowsCodexStartApp(runCommand) {
78291
78563
  }
78292
78564
  }
78293
78565
  function macCodexAppPaths(homeDir) {
78294
- return ["/Applications/Codex.app", posix3.join(homeDir, "Applications", "Codex.app")];
78566
+ return ["/Applications/Codex.app", posix4.join(homeDir, "Applications", "Codex.app")];
78295
78567
  }
78296
78568
  function macCodexDmgPaths(homeDir) {
78297
- const downloads = posix3.join(homeDir, "Downloads");
78298
- return [posix3.join(downloads, "codex.dmg"), posix3.join(downloads, "Codex.dmg")];
78569
+ const downloads = posix4.join(homeDir, "Downloads");
78570
+ return [posix4.join(downloads, "codex.dmg"), posix4.join(downloads, "Codex.dmg")];
78299
78571
  }
78300
78572
  function windowsCodexCliPaths(env3) {
78301
78573
  const candidates = [];
@@ -78333,18 +78605,18 @@ function dedupe(values) {
78333
78605
  }
78334
78606
  function defaultRunCommand2(command, args) {
78335
78607
  return new Promise((resolve16) => {
78336
- execFile2(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
78608
+ execFile3(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
78337
78609
  resolve16({ success: error === null, stdout });
78338
78610
  });
78339
78611
  });
78340
78612
  }
78341
78613
  // packages/omo-codex/src/install/codex-cleanup.ts
78342
- import { lstat as lstat12, readFile as readFile21, readdir as readdir10, rm as rm11, rmdir } from "node:fs/promises";
78614
+ import { lstat as lstat13, readFile as readFile22, readdir as readdir11, rm as rm11, rmdir } from "node:fs/promises";
78343
78615
  import { homedir as homedir8 } from "node:os";
78344
78616
  import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "node:path";
78345
78617
 
78346
78618
  // packages/omo-codex/src/install/codex-cleanup-config.ts
78347
- import { lstat as lstat11, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile12 } from "node:fs/promises";
78619
+ import { lstat as lstat12, mkdir as mkdir8, readFile as readFile21, writeFile as writeFile12 } from "node:fs/promises";
78348
78620
  import { dirname as dirname19 } from "node:path";
78349
78621
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
78350
78622
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
@@ -78377,7 +78649,7 @@ function cleanupCodexLightConfigText(config) {
78377
78649
  async function cleanupCodexConfig(configPath, now) {
78378
78650
  if (!await configExists(configPath))
78379
78651
  return { changed: false };
78380
- const original = await readFile20(configPath, "utf8");
78652
+ const original = await readFile21(configPath, "utf8");
78381
78653
  const next = cleanupCodexLightConfigText(original);
78382
78654
  if (next === original)
78383
78655
  return { changed: false };
@@ -78446,7 +78718,7 @@ function formatBackupTimestamp2(date) {
78446
78718
  }
78447
78719
  async function configExists(path7) {
78448
78720
  try {
78449
- await lstat11(path7);
78721
+ await lstat12(path7);
78450
78722
  return true;
78451
78723
  } catch (error) {
78452
78724
  if (nodeErrorCode5(error) === "ENOENT")
@@ -78564,7 +78836,7 @@ async function collectBootstrapDataDirsByGlob(codexHome) {
78564
78836
  async function walkForManagedBootstrapDirs(directory, depth, results) {
78565
78837
  if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
78566
78838
  return;
78567
- const entries = await readdir10(directory, { withFileTypes: true }).catch(() => null);
78839
+ const entries = await readdir11(directory, { withFileTypes: true }).catch(() => null);
78568
78840
  if (entries === null)
78569
78841
  return;
78570
78842
  for (const entry of entries) {
@@ -78596,7 +78868,7 @@ async function removeManagedPathBestEffort(path7, seams) {
78596
78868
  }
78597
78869
  async function attemptRemove(path7) {
78598
78870
  try {
78599
- if (await lstat12(path7).catch(() => null) === null)
78871
+ if (await lstat13(path7).catch(() => null) === null)
78600
78872
  return false;
78601
78873
  await rm11(path7, { recursive: true, force: true });
78602
78874
  return true;
@@ -78622,7 +78894,7 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78622
78894
  ];
78623
78895
  const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78624
78896
  if (await exists6(versionRoot)) {
78625
- const entries = await readdir10(versionRoot, { withFileTypes: true });
78897
+ const entries = await readdir11(versionRoot, { withFileTypes: true });
78626
78898
  for (const entry of entries) {
78627
78899
  if (entry.isDirectory())
78628
78900
  manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
@@ -78642,20 +78914,20 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78642
78914
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
78643
78915
  if (!await exists6(configPath))
78644
78916
  return [];
78645
- const config = await readFile21(configPath, "utf8");
78917
+ const config = await readFile22(configPath, "utf8");
78646
78918
  return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
78647
78919
  }
78648
78920
  async function readInstalledAgentManifest(manifestPath) {
78649
78921
  if (!await exists6(manifestPath))
78650
78922
  return [];
78651
- const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
78923
+ const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
78652
78924
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
78653
78925
  return [];
78654
78926
  return parsed.agents.filter((path7) => typeof path7 === "string");
78655
78927
  }
78656
78928
  async function removeManifestListedAgentLinks(codexHome, paths) {
78657
78929
  const agentsDir = join57(codexHome, "agents");
78658
- const removed = [];
78930
+ const removed2 = [];
78659
78931
  const skipped2 = [];
78660
78932
  for (const path7 of paths) {
78661
78933
  if (!isSafeManagedAgentPath(agentsDir, path7)) {
@@ -78670,9 +78942,9 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
78670
78942
  continue;
78671
78943
  }
78672
78944
  await rm11(path7, { force: true });
78673
- removed.push(path7);
78945
+ removed2.push(path7);
78674
78946
  }
78675
- return { removed, skipped: skipped2 };
78947
+ return { removed: removed2, skipped: skipped2 };
78676
78948
  }
78677
78949
  function isSafeManagedAgentPath(agentsDir, path7) {
78678
78950
  if (!isAbsolute11(path7))
@@ -78690,7 +78962,7 @@ async function exists6(path7) {
78690
78962
  }
78691
78963
  async function maybeLstat2(path7) {
78692
78964
  try {
78693
- return await lstat12(path7);
78965
+ return await lstat13(path7);
78694
78966
  } catch (error) {
78695
78967
  if (nodeErrorCode6(error) === "ENOENT")
78696
78968
  return null;
@@ -78705,18 +78977,26 @@ function nodeErrorCode6(error) {
78705
78977
  // packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
78706
78978
  var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
78707
78979
  // packages/omo-senpi/src/install/install-senpi.ts
78708
- import { execFile as execFile3 } from "node:child_process";
78980
+ import { execFile as execFile4 } from "node:child_process";
78709
78981
  import { constants as constants7, existsSync as existsSync32 } from "node:fs";
78710
- import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
78982
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile23, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
78711
78983
  import { homedir as homedir9 } from "node:os";
78712
78984
  import { dirname as dirname21, join as join58, resolve as resolve18 } from "node:path";
78713
78985
  import { fileURLToPath } from "node:url";
78714
78986
  import { promisify as promisify2 } from "node:util";
78715
- var execFileAsync2 = promisify2(execFile3);
78987
+ var execFileAsync2 = promisify2(execFile4);
78716
78988
  var REQUIRED_PLUGIN_ARTIFACTS = [
78717
78989
  join58("extensions", "omo.js"),
78718
78990
  join58("skills", "ultrawork", "SKILL.md"),
78719
- join58("skills", "ulw-loop", "SKILL.md")
78991
+ join58("skills", "ulw-loop", "SKILL.md"),
78992
+ join58("runtime", "lsp-daemon", "dist", "cli.js"),
78993
+ join58("runtime", "lsp-daemon", "dist", "index.js"),
78994
+ join58("runtime", "lsp-daemon", "dist", "index.d.ts"),
78995
+ join58("runtime", "lsp-daemon", "dist", "daemon-client.js"),
78996
+ join58("runtime", "lsp-daemon", "dist", "daemon-client.d.ts"),
78997
+ join58("runtime", "lsp-daemon", "dist", "package.json"),
78998
+ join58("runtime", "lsp-daemon", "dist", ".omo-runtime-manifest.json"),
78999
+ join58("scripts", "install.mjs")
78720
79000
  ];
78721
79001
  async function runSenpiInstaller(options = {}) {
78722
79002
  const context = resolveInstallContext(options);
@@ -78740,7 +79020,8 @@ async function runSenpiInstaller(options = {}) {
78740
79020
  }
78741
79021
  function resolveInstallContext(options) {
78742
79022
  const env3 = options.env ?? process.env;
78743
- const repoRoot = resolve18(options.repoRoot ?? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))));
79023
+ const allowBuild = options.pluginPath === undefined;
79024
+ const repoRoot = resolve18(options.repoRoot ?? (allowBuild ? findRepoRoot2(dirname21(fileURLToPath(import.meta.url))) : dirname21(resolve18(options.pluginPath))));
78744
79025
  const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
78745
79026
  const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
78746
79027
  return {
@@ -78749,6 +79030,7 @@ function resolveInstallContext(options) {
78749
79030
  agentDir,
78750
79031
  settingsPath: join58(agentDir, "settings.json"),
78751
79032
  pluginPath,
79033
+ allowBuild,
78752
79034
  runCommand: options.runCommand ?? defaultRunCommand3
78753
79035
  };
78754
79036
  }
@@ -78756,8 +79038,13 @@ async function ensurePluginArtifacts(context) {
78756
79038
  const missing = await hasMissingPluginArtifact(context.pluginPath);
78757
79039
  if (!missing)
78758
79040
  return;
79041
+ if (!context.allowBuild) {
79042
+ throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
79043
+ }
78759
79044
  await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78760
79045
  await context.runCommand("node", [join58(context.pluginPath, "scripts", "sync-skills.mjs")], { cwd: context.repoRoot });
79046
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-install.mjs")], { cwd: context.repoRoot });
79047
+ await context.runCommand("node", [join58(context.pluginPath, "scripts", "stage-lsp-daemon-runtime.mjs")], { cwd: context.repoRoot });
78761
79048
  }
78762
79049
  async function hasMissingPluginArtifact(pluginPath) {
78763
79050
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
@@ -78776,7 +79063,7 @@ async function defaultRunCommand3(command, args, options) {
78776
79063
  async function readSettings(settingsPath) {
78777
79064
  let raw;
78778
79065
  try {
78779
- raw = await readFile22(settingsPath, "utf8");
79066
+ raw = await readFile23(settingsPath, "utf8");
78780
79067
  } catch (error) {
78781
79068
  if (isErrno(error, "ENOENT"))
78782
79069
  return {};
@@ -78855,7 +79142,7 @@ function isErrno(error, code) {
78855
79142
  return error instanceof Error && "code" in error && error.code === code;
78856
79143
  }
78857
79144
  // packages/omo-opencode/src/cli/star-request.ts
78858
- import { execFile as execFile4 } from "node:child_process";
79145
+ import { execFile as execFile5 } from "node:child_process";
78859
79146
  import { promisify as promisify3 } from "node:util";
78860
79147
  var STAR_REPOSITORIES = [
78861
79148
  "code-yeongyu/oh-my-openagent",
@@ -78867,7 +79154,7 @@ var PLATFORM_REPOSITORIES = {
78867
79154
  both: STAR_REPOSITORIES,
78868
79155
  senpi: STAR_REPOSITORIES
78869
79156
  };
78870
- var execFileAsync3 = promisify3(execFile4);
79157
+ var execFileAsync3 = promisify3(execFile5);
78871
79158
  async function runGitHubStarCommand(repository) {
78872
79159
  await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
78873
79160
  }
@@ -97237,7 +97524,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
97237
97524
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
97238
97525
  init_bun_which_shim();
97239
97526
  init_spawn_with_windows_hide();
97240
- import { delimiter as delimiter2, dirname as dirname23, posix as posix4, win32 as win324 } from "node:path";
97527
+ import { delimiter as delimiter2, dirname as dirname23, posix as posix5, win32 as win324 } from "node:path";
97241
97528
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
97242
97529
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
97243
97530
  function getCommandCandidates(platform) {
@@ -97248,7 +97535,7 @@ function getCommandCandidates(platform) {
97248
97535
  function getPathTools(platform) {
97249
97536
  if (platform === "win32")
97250
97537
  return win324;
97251
- return posix4;
97538
+ return posix5;
97252
97539
  }
97253
97540
  function collectCandidateBinaryPaths(pathEnv, which2 = bunWhich, platform = process.platform) {
97254
97541
  const seen = new Set;
@@ -99126,6 +99413,10 @@ function formatVersionOutput(info) {
99126
99413
  lines.push(` ${SYMBOLS3.dev} ${import_picocolors17.default.cyan("Running in local development mode")}`);
99127
99414
  lines.push(` ${import_picocolors17.default.dim("Using file:// protocol from config")}`);
99128
99415
  break;
99416
+ case "dev":
99417
+ lines.push(` ${SYMBOLS3.dev} ${import_picocolors17.default.cyan("Running a local dev build")}`);
99418
+ lines.push(` ${import_picocolors17.default.dim("Installed from source; update checks are skipped")}`);
99419
+ break;
99129
99420
  case "pinned":
99130
99421
  lines.push(` ${SYMBOLS3.pin} ${import_picocolors17.default.magenta(`Version pinned to ${info.pinnedVersion}`)}`);
99131
99422
  lines.push(` ${import_picocolors17.default.dim("Update check skipped for pinned versions")}`);
@@ -99198,6 +99489,19 @@ async function getLocalVersion(options = {}) {
99198
99489
  console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
99199
99490
  return 1;
99200
99491
  }
99492
+ if (!/^\d+\.\d+\.\d+/.test(currentVersion)) {
99493
+ const info2 = {
99494
+ currentVersion,
99495
+ latestVersion: null,
99496
+ isUpToDate: false,
99497
+ isLocalDev: true,
99498
+ isPinned: false,
99499
+ pinnedVersion: null,
99500
+ status: "dev"
99501
+ };
99502
+ console.log(options.json ? formatJsonOutput(info2) : formatVersionOutput(info2));
99503
+ return 0;
99504
+ }
99201
99505
  const { extractChannel: extractChannel2 } = await Promise.resolve().then(() => (init_auto_update_checker(), exports_auto_update_checker));
99202
99506
  const channel = extractChannel2(pluginInfo?.pinnedVersion ?? currentVersion);
99203
99507
  const latestVersion = await getLatestVersion(channel);
@@ -100390,12 +100694,12 @@ import { dirname as dirname30, join as join79 } from "node:path";
100390
100694
 
100391
100695
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
100392
100696
  import { join as join78 } from "path";
100393
- import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
100697
+ import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
100394
100698
  init_binary_downloader();
100395
100699
  init_logger2();
100396
100700
  init_plugin_identity();
100397
100701
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
100398
- var DEBUG_FILE = join78(tmpdir3(), "comment-checker-debug.log");
100702
+ var DEBUG_FILE = join78(tmpdir4(), "comment-checker-debug.log");
100399
100703
  function getCacheDir2() {
100400
100704
  if (process.platform === "win32") {
100401
100705
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
@@ -100632,13 +100936,14 @@ async function getGhCliInfo(dependencies = {}) {
100632
100936
  }
100633
100937
 
100634
100938
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
100635
- import { readFileSync as readFileSync38 } from "node:fs";
100939
+ import { readFileSync as readFileSync39 } from "node:fs";
100636
100940
  import { join as join80 } from "node:path";
100637
100941
 
100638
100942
  // packages/omo-opencode/src/mcp/lsp.ts
100639
- import { existsSync as existsSync56 } from "node:fs";
100943
+ import { existsSync as existsSync56, readFileSync as readFileSync38 } from "node:fs";
100640
100944
  import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "node:path";
100641
100945
  import { fileURLToPath as fileURLToPath7 } from "node:url";
100946
+ init_opencode_config_dir();
100642
100947
 
100643
100948
  // packages/omo-opencode/src/mcp/cli-suffix.ts
100644
100949
  function normalizeCliPath(path14) {
@@ -100650,7 +100955,7 @@ function hasCliSuffix(candidatePath, suffix) {
100650
100955
 
100651
100956
  // packages/omo-opencode/src/mcp/runtime-executable.ts
100652
100957
  init_bun_which_shim();
100653
- import { basename as basename12 } from "node:path";
100958
+ import { basename as basename13 } from "node:path";
100654
100959
  var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
100655
100960
  function isUnsafeCommandName2(commandName) {
100656
100961
  if (commandName.length === 0)
@@ -100666,7 +100971,7 @@ function isUnsafeCommandName2(commandName) {
100666
100971
  return false;
100667
100972
  }
100668
100973
  function isNodeExecPath(execPath) {
100669
- return NODE_EXECUTABLE_NAMES.has(basename12(execPath).toLowerCase());
100974
+ return NODE_EXECUTABLE_NAMES.has(basename13(execPath).toLowerCase());
100670
100975
  }
100671
100976
  function resolveRuntimeExecutable(commandName, options = {}) {
100672
100977
  if (isUnsafeCommandName2(commandName)) {
@@ -100736,8 +101041,15 @@ var LSP_TOOLS_PACKAGE_REL = "packages/lsp-tools-mcp";
100736
101041
  var DIST_CLI_REL = "dist/cli.js";
100737
101042
  var SOURCE_CLI_REL = "src/cli.ts";
100738
101043
  var PROJECT_LSP_CONFIGS = [".opencode/lsp.json", ".omo/lsp.json", ".omo/lsp-client.json"];
101044
+ var DAEMON_PACKAGE_NAME = "@code-yeongyu/lsp-daemon";
101045
+ var OMO_LSP_DAEMON_CLI = "OMO_LSP_DAEMON_CLI";
101046
+ var OMO_LSP_DAEMON_VERSION = "OMO_LSP_DAEMON_VERSION";
101047
+ var DaemonPackageSchema = exports_external.object({
101048
+ version: exports_external.string().min(1)
101049
+ });
100739
101050
  var LSP_BOOTSTRAP_SCRIPT = [
100740
101051
  "const { existsSync } = require('node:fs')",
101052
+ "const { createRequire } = require('node:module')",
100741
101053
  "const { join } = require('node:path')",
100742
101054
  "const { spawnSync } = require('node:child_process')",
100743
101055
  "const root = process.argv[1]",
@@ -100746,16 +101058,18 @@ var LSP_BOOTSTRAP_SCRIPT = [
100746
101058
  `const toolsPackage = join(root, '${LSP_TOOLS_PACKAGE_REL}')`,
100747
101059
  `const daemonPackage = join(root, '${PACKAGE_REL}')`,
100748
101060
  "const toolsDist = join(toolsPackage, 'dist/cli.js')",
100749
- "const daemonDist = join(daemonPackage, 'dist/cli.js')",
101061
+ "const daemonPackageJson = join(daemonPackage, 'package.json')",
100750
101062
  "const daemonSource = join(daemonPackage, 'src/cli.ts')",
100751
101063
  "const run = (command, args, stdio) => spawnSync(command, args, { cwd: root, env: process.env, stdio })",
100752
101064
  "const finish = (result) => { if (result.error) { console.error(result.error.message); process.exit(1) } process.exit(result.status ?? 1) }",
100753
101065
  "const runIfAvailable = (command, args) => { const result = run(command, args, 'inherit'); if (result.error) return false; finish(result); return true }",
100754
- "if (existsSync(daemonDist)) finish(run(process.execPath, [daemonDist, 'mcp'], 'inherit'))",
100755
- "if (existsSync(daemonSource) && existsSync(toolsDist)) runIfAvailable(bun, [daemonSource, 'mcp'])",
101066
+ `const resolveDaemonCli = () => { try { return createRequire(daemonPackageJson).resolve('${DAEMON_PACKAGE_NAME}/cli') } catch (error) { if (error instanceof Error) return null; throw error } }`,
101067
+ "const daemonCli = existsSync(daemonPackageJson) ? resolveDaemonCli() : null",
101068
+ "if (daemonCli) finish(run(process.execPath, [daemonCli, 'mcp'], 'inherit'))",
101069
+ `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']) }`,
100756
101070
  "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']]]",
100757
101071
  "for (const [command, args] of steps) { const result = run(command, args, ['ignore', 'ignore', 'inherit']); if (result.error || result.status !== 0) finish(result) }",
100758
- "finish(run(process.execPath, [daemonDist, 'mcp'], 'inherit'))"
101072
+ "finish(run(process.execPath, [resolveDaemonCli(), 'mcp'], 'inherit'))"
100759
101073
  ].join(";");
100760
101074
  function getModuleDirectory(moduleUrl) {
100761
101075
  try {
@@ -100769,6 +101083,16 @@ function getModuleDirectory(moduleUrl) {
100769
101083
  function findBootstrapRoot(candidates, pathExists) {
100770
101084
  return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
100771
101085
  }
101086
+ function readDaemonPackageVersion(root) {
101087
+ try {
101088
+ const packageJson = JSON.parse(readFileSync38(resolve21(root, PACKAGE_REL, "package.json"), "utf-8"));
101089
+ return DaemonPackageSchema.parse(packageJson).version;
101090
+ } catch (error51) {
101091
+ if (!(error51 instanceof Error))
101092
+ throw error51;
101093
+ return null;
101094
+ }
101095
+ }
100772
101096
  function createBootstrapCandidate(root, pathExists, resolveExecutable) {
100773
101097
  const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
100774
101098
  const bun = resolveExecutable("bun");
@@ -100793,7 +101117,7 @@ function resolveLspCommand(options = {}) {
100793
101117
  sourceCliRel: SOURCE_CLI_REL,
100794
101118
  pathExists,
100795
101119
  resolveExecutable,
100796
- isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL))
101120
+ isSourceCandidateAvailable: ({ root }) => pathExists(resolve21(root, LSP_TOOLS_PACKAGE_REL, DIST_CLI_REL)) && readDaemonPackageVersion(root) !== null
100797
101121
  }) : [];
100798
101122
  const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
100799
101123
  if (distCandidate) {
@@ -100807,12 +101131,21 @@ function resolveLspCommand(options = {}) {
100807
101131
  }
100808
101132
  function createLspMcpConfig(options = {}) {
100809
101133
  const resolvedCommand = resolveLspCommand(options);
101134
+ const cwd = resolve21(options.cwd ?? process.cwd());
101135
+ const configDir = getOpenCodeConfigDir({ binary: "opencode" });
101136
+ const sourceVersion = hasCliSuffix(resolvedCommand.path, SOURCE_CLI_REL) ? readDaemonPackageVersion(resolvedCommand.root) : null;
100810
101137
  return {
100811
101138
  type: "local",
100812
101139
  command: resolvedCommand.command,
100813
101140
  enabled: resolvedCommand.exists,
100814
101141
  environment: {
100815
- LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.join(delimiter3)
101142
+ LSP_TOOLS_MCP_PROJECT_CONFIG: PROJECT_LSP_CONFIGS.map((configPath) => resolve21(cwd, configPath)).join(delimiter3),
101143
+ LSP_TOOLS_MCP_USER_CONFIG: resolve21(configDir, "lsp.json"),
101144
+ LSP_TOOLS_MCP_INSTALL_DECISIONS: resolve21(configDir, "lsp-install-decisions.json"),
101145
+ ...sourceVersion ? {
101146
+ [OMO_LSP_DAEMON_CLI]: resolvedCommand.path,
101147
+ [OMO_LSP_DAEMON_VERSION]: sourceVersion
101148
+ } : {}
100816
101149
  }
100817
101150
  };
100818
101151
  }
@@ -100829,7 +101162,7 @@ function readOmoConfig(configDirectory) {
100829
101162
  return null;
100830
101163
  }
100831
101164
  try {
100832
- const content = readFileSync38(detected.path, "utf-8");
101165
+ const content = readFileSync39(detected.path, "utf-8");
100833
101166
  return parseJsonc(content);
100834
101167
  } catch (error51) {
100835
101168
  if (!(error51 instanceof Error)) {
@@ -100859,7 +101192,7 @@ function getInstalledLspServers(options = {}) {
100859
101192
 
100860
101193
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
100861
101194
  init_shared();
100862
- import { existsSync as existsSync57, readFileSync as readFileSync39 } from "node:fs";
101195
+ import { existsSync as existsSync57, readFileSync as readFileSync40 } from "node:fs";
100863
101196
  import { homedir as homedir20 } from "node:os";
100864
101197
  import { join as join81 } from "node:path";
100865
101198
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
@@ -100876,7 +101209,7 @@ function loadUserMcpConfig() {
100876
101209
  if (!existsSync57(configPath))
100877
101210
  continue;
100878
101211
  try {
100879
- const content = readFileSync39(configPath, "utf-8");
101212
+ const content = readFileSync40(configPath, "utf-8");
100880
101213
  const config3 = parseJsonc(content);
100881
101214
  if (config3.mcpServers) {
100882
101215
  Object.assign(servers, config3.mcpServers);
@@ -101011,7 +101344,7 @@ async function checkTools() {
101011
101344
 
101012
101345
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
101013
101346
  init_src4();
101014
- import { existsSync as existsSync58, readFileSync as readFileSync40 } from "node:fs";
101347
+ import { existsSync as existsSync58, readFileSync as readFileSync41 } from "node:fs";
101015
101348
  function isTelemetryState(value) {
101016
101349
  return value !== null && typeof value === "object" && !Array.isArray(value);
101017
101350
  }
@@ -101021,7 +101354,7 @@ function readLastActiveDay(stateFilePath) {
101021
101354
  }
101022
101355
  let parsed;
101023
101356
  try {
101024
- parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
101357
+ parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
101025
101358
  } catch (error51) {
101026
101359
  if (error51 instanceof Error) {
101027
101360
  return "unreadable";
@@ -101096,7 +101429,7 @@ function expandHomeDirectory(directoryPath) {
101096
101429
  // packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
101097
101430
  init_shared();
101098
101431
  init_plugin_identity();
101099
- import { readFileSync as readFileSync41, promises as fs13 } from "node:fs";
101432
+ import { readFileSync as readFileSync42, promises as fs13 } from "node:fs";
101100
101433
  import path15 from "node:path";
101101
101434
  async function checkTeamMode() {
101102
101435
  const config3 = loadTeamModeConfig();
@@ -101133,7 +101466,7 @@ function loadTeamModeConfig() {
101133
101466
  if (!configPath)
101134
101467
  return { team_mode: undefined };
101135
101468
  try {
101136
- return parseJsonc(readFileSync41(configPath, "utf-8"));
101469
+ return parseJsonc(readFileSync42(configPath, "utf-8"));
101137
101470
  } catch (error51) {
101138
101471
  if (error51 instanceof Error) {
101139
101472
  return { team_mode: undefined };
@@ -101167,9 +101500,9 @@ async function pathExists(dir) {
101167
101500
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
101168
101501
  init_src();
101169
101502
  import { existsSync as existsSync59 } from "node:fs";
101170
- import { lstat as lstat13, readdir as readdir11, readFile as readFile23 } from "node:fs/promises";
101503
+ import { lstat as lstat14, readdir as readdir12, readFile as readFile24 } from "node:fs/promises";
101171
101504
  import { homedir as homedir22 } from "node:os";
101172
- import { basename as basename13, join as join82, resolve as resolve22 } from "node:path";
101505
+ import { basename as basename14, join as join82, resolve as resolve22 } from "node:path";
101173
101506
  // packages/omo-opencode/package.json
101174
101507
  var package_default3 = {
101175
101508
  name: "@oh-my-opencode/omo-opencode",
@@ -101358,7 +101691,7 @@ async function resolveInstalledPluginRoot(codexHome) {
101358
101691
  const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
101359
101692
  if (!existsSync59(pluginRoot))
101360
101693
  return null;
101361
- const versions2 = await readdir11(pluginRoot, { withFileTypes: true });
101694
+ const versions2 = await readdir12(pluginRoot, { withFileTypes: true });
101362
101695
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
101363
101696
  return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
101364
101697
  }
@@ -101374,7 +101707,7 @@ async function readCodexConfigSummary(configPath) {
101374
101707
  companionLifecycleHookStateEvents: []
101375
101708
  };
101376
101709
  }
101377
- const content = await readFile23(configPath, "utf8");
101710
+ const content = await readFile24(configPath, "utf8");
101378
101711
  return {
101379
101712
  exists: true,
101380
101713
  marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
@@ -101397,12 +101730,12 @@ async function readLinkedAgents(codexHome) {
101397
101730
  const agentsDir = join82(codexHome, "agents");
101398
101731
  if (!existsSync59(agentsDir))
101399
101732
  return [];
101400
- const entries = await readdir11(agentsDir, { withFileTypes: true });
101401
- return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
101733
+ const entries = await readdir12(agentsDir, { withFileTypes: true });
101734
+ return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename14(entry.name, ".toml")).sort();
101402
101735
  }
101403
101736
  async function readJson(path16) {
101404
101737
  try {
101405
- const parsed = JSON.parse(await readFile23(path16, "utf8"));
101738
+ const parsed = JSON.parse(await readFile24(path16, "utf8"));
101406
101739
  return isPlainRecord(parsed) ? parsed : null;
101407
101740
  } catch (error51) {
101408
101741
  if (error51 instanceof Error)
@@ -101497,7 +101830,7 @@ function compareVersionsDescending(left, right) {
101497
101830
  }
101498
101831
  async function pathExists2(path16) {
101499
101832
  try {
101500
- await lstat13(path16);
101833
+ await lstat14(path16);
101501
101834
  return true;
101502
101835
  } catch (error51) {
101503
101836
  if (error51 instanceof Error)
@@ -101508,7 +101841,7 @@ async function pathExists2(path16) {
101508
101841
 
101509
101842
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
101510
101843
  init_src();
101511
- import { readdir as readdir12, readFile as readFile24, stat as stat6 } from "node:fs/promises";
101844
+ import { readdir as readdir13, readFile as readFile25, stat as stat6 } from "node:fs/promises";
101512
101845
  import { homedir as homedir23 } from "node:os";
101513
101846
  import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
101514
101847
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
@@ -101649,7 +101982,7 @@ async function findHookManifestPaths(root) {
101649
101982
  async function findManifestPaths(root, manifestName) {
101650
101983
  let entries;
101651
101984
  try {
101652
- entries = await readdir12(root, { withFileTypes: true });
101985
+ entries = await readdir13(root, { withFileTypes: true });
101653
101986
  } catch {
101654
101987
  return [];
101655
101988
  }
@@ -101761,7 +102094,7 @@ function degradedDetailLines(entries) {
101761
102094
  }
101762
102095
  async function readJson2(path16) {
101763
102096
  try {
101764
- const parsed = JSON.parse(await readFile24(path16, "utf8"));
102097
+ const parsed = JSON.parse(await readFile25(path16, "utf8"));
101765
102098
  return isRecord6(parsed) ? parsed : null;
101766
102099
  } catch (error51) {
101767
102100
  if (error51 instanceof Error)
@@ -101789,7 +102122,7 @@ function isRecord6(value) {
101789
102122
 
101790
102123
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
101791
102124
  import { existsSync as existsSync60 } from "node:fs";
101792
- import { readFile as readFile25 } from "node:fs/promises";
102125
+ import { readFile as readFile26 } from "node:fs/promises";
101793
102126
  import { homedir as homedir24 } from "node:os";
101794
102127
  import { join as join84, resolve as resolve24 } from "node:path";
101795
102128
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
@@ -101824,7 +102157,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
101824
102157
  }
101825
102158
  async function readRuntimeWrapper(path16) {
101826
102159
  try {
101827
- return await readFile25(path16, "utf8");
102160
+ return await readFile26(path16, "utf8");
101828
102161
  } catch (error51) {
101829
102162
  if (error51 instanceof Error)
101830
102163
  return null;
@@ -102300,18 +102633,18 @@ Doctor failed unexpectedly: ${message}`];
102300
102633
  }
102301
102634
 
102302
102635
  // packages/mcp-client-core/src/mcp-oauth/storage.ts
102303
- import { createHash as createHash4 } from "node:crypto";
102636
+ import { createHash as createHash5 } from "node:crypto";
102304
102637
  import {
102305
102638
  chmodSync as chmodSync4,
102306
102639
  existsSync as existsSync63,
102307
102640
  mkdirSync as mkdirSync14,
102308
102641
  readdirSync as readdirSync9,
102309
- readFileSync as readFileSync43,
102642
+ readFileSync as readFileSync44,
102310
102643
  renameSync as renameSync7,
102311
102644
  unlinkSync as unlinkSync8,
102312
102645
  writeFileSync as writeFileSync11
102313
102646
  } from "node:fs";
102314
- import { basename as basename14, dirname as dirname33, join as join87 } from "node:path";
102647
+ import { basename as basename15, dirname as dirname33, join as join87 } from "node:path";
102315
102648
 
102316
102649
  // packages/mcp-client-core/src/config-dir.ts
102317
102650
  import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
@@ -102339,7 +102672,7 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
102339
102672
  }
102340
102673
 
102341
102674
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
102342
- import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync42, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
102675
+ import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync43, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
102343
102676
  import { join as join86 } from "node:path";
102344
102677
  var INDEX_FILE_NAME = "index.json";
102345
102678
  function isTokenIndex(value) {
@@ -102355,7 +102688,7 @@ function readTokenIndex(storageDir) {
102355
102688
  if (!existsSync62(indexPath))
102356
102689
  return {};
102357
102690
  try {
102358
- const parsed = JSON.parse(readFileSync42(indexPath, "utf-8"));
102691
+ const parsed = JSON.parse(readFileSync43(indexPath, "utf-8"));
102359
102692
  return isTokenIndex(parsed) ? parsed : {};
102360
102693
  } catch (readError) {
102361
102694
  if (!(readError instanceof Error))
@@ -102395,7 +102728,7 @@ function getMcpOauthStorageDir() {
102395
102728
  return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
102396
102729
  }
102397
102730
  function getMcpOauthServerHash(serverHost, resource) {
102398
- return createHash4("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
102731
+ return createHash5("sha256").update(buildKey(serverHost, resource)).digest("hex").slice(0, 32);
102399
102732
  }
102400
102733
  function getMcpOauthStoragePath(serverHost, resource) {
102401
102734
  return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
@@ -102465,7 +102798,7 @@ function readTokenFile(filePath) {
102465
102798
  if (!existsSync63(filePath))
102466
102799
  return null;
102467
102800
  try {
102468
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102801
+ const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
102469
102802
  return isOAuthTokenData(parsed) ? parsed : null;
102470
102803
  } catch (readError) {
102471
102804
  if (!(readError instanceof Error))
@@ -102478,7 +102811,7 @@ function readLegacyStore() {
102478
102811
  if (!existsSync63(filePath))
102479
102812
  return null;
102480
102813
  try {
102481
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102814
+ const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
102482
102815
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
102483
102816
  return null;
102484
102817
  const result = {};
@@ -102596,7 +102929,7 @@ function listAllTokens() {
102596
102929
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
102597
102930
  continue;
102598
102931
  const token = readTokenFile(join87(dir, entry.name));
102599
- const hash2 = basename14(entry.name, ".json");
102932
+ const hash2 = basename15(entry.name, ".json");
102600
102933
  if (token)
102601
102934
  result[index[hash2] ?? hash2] = token;
102602
102935
  }
@@ -102769,13 +103102,13 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
102769
103102
 
102770
103103
  // packages/mcp-client-core/src/mcp-oauth/oauth-authorization-flow.ts
102771
103104
  import { spawn as spawn4 } from "node:child_process";
102772
- import { createHash as createHash5, randomBytes as randomBytes2 } from "node:crypto";
103105
+ import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
102773
103106
  import { createServer as createServer2 } from "node:http";
102774
103107
  function generateCodeVerifier() {
102775
103108
  return randomBytes2(32).toString("base64url");
102776
103109
  }
102777
103110
  function generateCodeChallenge(verifier) {
102778
- return createHash5("sha256").update(verifier).digest("base64url");
103111
+ return createHash6("sha256").update(verifier).digest("base64url");
102779
103112
  }
102780
103113
  function buildAuthorizationUrl(authorizationEndpoint, options) {
102781
103114
  const url2 = new URL(authorizationEndpoint);
@@ -103319,7 +103652,7 @@ async function boulder(options) {
103319
103652
  }
103320
103653
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
103321
103654
  import { spawn as spawn5 } from "node:child_process";
103322
- import { existsSync as existsSync65, readFileSync as readFileSync44, realpathSync as realpathSync9 } from "node:fs";
103655
+ import { existsSync as existsSync65, readFileSync as readFileSync45, realpathSync as realpathSync9 } from "node:fs";
103323
103656
  import { homedir as homedir26 } from "node:os";
103324
103657
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
103325
103658
  function resolveCodexUlwLoopCommand(input = {}) {
@@ -103369,7 +103702,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
103369
103702
  }
103370
103703
  function isGeneratedRuntimeWrapper(candidate) {
103371
103704
  try {
103372
- return readFileSync44(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
103705
+ return readFileSync45(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
103373
103706
  } catch (error51) {
103374
103707
  if (error51 instanceof Error)
103375
103708
  return false;