oh-my-opencode 4.18.0 → 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 (192) hide show
  1. package/.agents/skills/codex-qa/scripts/lsp-e2e.sh +3654 -0
  2. package/.agents/skills/opencode-qa/scripts/lsp-e2e.sh +3071 -0
  3. package/.agents/skills/work-with-pr/SKILL.md +16 -37
  4. package/.agents/skills/work-with-pr-workspace/evals/evals.json +3 -3
  5. package/.opencode/skills/work-with-pr/SKILL.md +16 -37
  6. package/.opencode/skills/work-with-pr-workspace/evals/evals.json +3 -3
  7. package/dist/cli/index.js +457 -154
  8. package/dist/cli-node/index.js +457 -154
  9. package/dist/index.js +415 -388
  10. package/package.json +16 -16
  11. package/packages/lsp-core/package.json +4 -0
  12. package/packages/lsp-core/src/index.ts +1 -0
  13. package/packages/lsp-core/src/lsp/cleanup-errors.test.ts +18 -0
  14. package/packages/lsp-core/src/lsp/cleanup-errors.ts +12 -3
  15. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +261 -0
  16. package/packages/lsp-core/src/lsp/client-wrapper.test.ts +63 -0
  17. package/packages/lsp-core/src/lsp/client-wrapper.ts +35 -5
  18. package/packages/lsp-core/src/lsp/client.ts +262 -80
  19. package/packages/lsp-core/src/lsp/config-loader.ts +5 -17
  20. package/packages/lsp-core/src/lsp/connection.ts +12 -6
  21. package/packages/lsp-core/src/lsp/directory-diagnostics.test.ts +104 -0
  22. package/packages/lsp-core/src/lsp/directory-diagnostics.ts +60 -27
  23. package/packages/lsp-core/src/lsp/errors.ts +11 -0
  24. package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +283 -0
  25. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-contract-probe.ts +196 -0
  26. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +215 -0
  27. package/packages/lsp-core/src/lsp/formatters.ts +3 -0
  28. package/packages/lsp-core/src/lsp/json-rpc-connection-cancellation.test.ts +97 -0
  29. package/packages/lsp-core/src/lsp/json-rpc-connection.ts +73 -5
  30. package/packages/lsp-core/src/lsp/server-install-state.ts +3 -6
  31. package/packages/lsp-core/src/lsp/transport-protocol.ts +52 -0
  32. package/packages/lsp-core/src/lsp/transport.ts +96 -70
  33. package/packages/lsp-core/src/lsp/workspace-apply-edit-failure.ts +19 -0
  34. package/packages/lsp-core/src/lsp/workspace-apply-edit-lease.integration.test.ts +214 -0
  35. package/packages/lsp-core/src/lsp/workspace-apply-edit-sync.integration.test.ts +113 -0
  36. package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +163 -0
  37. package/packages/lsp-core/src/lsp/workspace-apply-edit.integration.test.ts +163 -0
  38. package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +67 -0
  39. package/packages/lsp-core/src/lsp/workspace-document-state.ts +368 -0
  40. package/packages/lsp-core/src/lsp/workspace-edit-adversarial.test.ts +113 -0
  41. package/packages/lsp-core/src/lsp/workspace-edit-commit.test.ts +140 -0
  42. package/packages/lsp-core/src/lsp/workspace-edit-commit.ts +220 -0
  43. package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.test.ts +56 -0
  44. package/packages/lsp-core/src/lsp/workspace-edit-contract-evidence.ts +30 -0
  45. package/packages/lsp-core/src/lsp/workspace-edit-fingerprint.ts +44 -0
  46. package/packages/lsp-core/src/lsp/workspace-edit-options.test.ts +147 -0
  47. package/packages/lsp-core/src/lsp/workspace-edit-parse-helpers.ts +59 -0
  48. package/packages/lsp-core/src/lsp/workspace-edit-parser.ts +130 -0
  49. package/packages/lsp-core/src/lsp/workspace-edit-path.ts +98 -0
  50. package/packages/lsp-core/src/lsp/workspace-edit-plan-types.ts +60 -0
  51. package/packages/lsp-core/src/lsp/workspace-edit-plan.ts +73 -0
  52. package/packages/lsp-core/src/lsp/workspace-edit-prevalidation.test.ts +174 -0
  53. package/packages/lsp-core/src/lsp/workspace-edit-resource-parser.ts +89 -0
  54. package/packages/lsp-core/src/lsp/workspace-edit-simulation.ts +183 -0
  55. package/packages/lsp-core/src/lsp/workspace-edit-snapshot.ts +53 -0
  56. package/packages/lsp-core/src/lsp/workspace-edit-text.ts +125 -0
  57. package/packages/lsp-core/src/lsp/workspace-edit-types.ts +121 -0
  58. package/packages/lsp-core/src/lsp/workspace-edit.characterization.test.ts +95 -0
  59. package/packages/lsp-core/src/lsp/workspace-edit.ts +49 -200
  60. package/packages/lsp-core/src/lsp/workspace-mutation-controller.ts +182 -0
  61. package/packages/lsp-core/src/mcp.ts +18 -7
  62. package/packages/lsp-core/src/missing-dependency-result.test.ts +105 -0
  63. package/packages/lsp-core/src/missing-dependency-result.ts +57 -0
  64. package/packages/lsp-core/src/post-edit/index.ts +1 -0
  65. package/packages/lsp-core/src/post-edit/orchestration.test.ts +157 -0
  66. package/packages/lsp-core/src/post-edit/orchestration.ts +178 -0
  67. package/packages/lsp-core/src/request-context.test.ts +171 -0
  68. package/packages/lsp-core/src/request-context.ts +222 -9
  69. package/packages/lsp-core/src/tool-surface.test.ts +4 -1
  70. package/packages/lsp-core/src/tools/diagnostics.ts +32 -13
  71. package/packages/lsp-core/src/tools/navigation.ts +12 -12
  72. package/packages/lsp-core/src/tools/rename.ts +10 -15
  73. package/packages/lsp-core/src/tools/symbols.ts +11 -11
  74. package/packages/lsp-core/src/tools/types.ts +2 -1
  75. package/packages/lsp-daemon/dist/cli.js +3114 -747
  76. package/packages/lsp-daemon/dist/client.d.ts +105 -0
  77. package/packages/lsp-daemon/dist/client.js +5851 -0
  78. package/packages/lsp-daemon/dist/daemon-client.d.ts +11 -6
  79. package/packages/lsp-daemon/dist/daemon-client.js +113 -30
  80. package/packages/lsp-daemon/dist/daemon-server.d.ts +1 -0
  81. package/packages/lsp-daemon/dist/daemon-server.js +40 -15
  82. package/packages/lsp-daemon/dist/ensure-daemon.d.ts +8 -7
  83. package/packages/lsp-daemon/dist/ensure-daemon.js +67 -44
  84. package/packages/lsp-daemon/dist/index.d.ts +2 -2
  85. package/packages/lsp-daemon/dist/index.js +2862 -754
  86. package/packages/lsp-daemon/dist/ipc-protocol.d.ts +46 -0
  87. package/packages/lsp-daemon/dist/ipc-protocol.js +187 -0
  88. package/packages/lsp-daemon/dist/lock.js +14 -4
  89. package/packages/lsp-daemon/dist/ownership.d.ts +49 -0
  90. package/packages/lsp-daemon/dist/ownership.js +168 -0
  91. package/packages/lsp-daemon/dist/paths.d.ts +33 -9
  92. package/packages/lsp-daemon/dist/paths.js +72 -33
  93. package/packages/lsp-daemon/dist/proxy.d.ts +3 -0
  94. package/packages/lsp-daemon/dist/proxy.js +54 -3
  95. package/packages/lsp-daemon/dist/request-routing.d.ts +7 -2
  96. package/packages/lsp-daemon/dist/request-routing.js +71 -22
  97. package/packages/lsp-daemon/dist/run-daemon.js +9 -2
  98. package/packages/lsp-daemon/dist/runtime-contract.d.ts +21 -0
  99. package/packages/lsp-daemon/dist/runtime-contract.js +58 -0
  100. package/packages/lsp-daemon/dist/socket-jsonrpc.js +6 -1
  101. package/packages/lsp-daemon/package.json +12 -3
  102. package/packages/lsp-tools-mcp/dist/cli.js +2115 -442
  103. package/packages/lsp-tools-mcp/dist/lsp/manager.js +1741 -148
  104. package/packages/lsp-tools-mcp/dist/mcp.js +2127 -454
  105. package/packages/lsp-tools-mcp/dist/request-context.js +176 -6
  106. package/packages/lsp-tools-mcp/dist/tools.js +2118 -446
  107. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  108. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  109. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  110. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  111. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  112. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  113. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  114. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  115. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  116. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  117. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +55 -0
  118. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +2959 -944
  119. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +0 -4
  120. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +5 -2
  121. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +41 -62
  122. package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.d.ts +1 -1
  123. package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +24 -15
  124. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +3 -7
  125. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +23 -49
  126. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  127. package/packages/omo-codex/plugin/components/lsp/package.json +3 -2
  128. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +31 -1
  129. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.test.mjs +76 -0
  130. package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.mjs +201 -0
  131. package/packages/omo-codex/plugin/components/lsp/scripts/build-runtime.test.mjs +55 -0
  132. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +0 -4
  133. package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +49 -71
  134. package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +26 -15
  135. package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +26 -64
  136. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +16 -17
  137. package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +30 -4
  138. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +19 -5
  139. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.5.md +1 -1
  140. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +1 -1
  141. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  142. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  143. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +1 -1
  144. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  145. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  146. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  147. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  148. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  149. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  150. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  151. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  152. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  153. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  154. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +1 -1
  155. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +6 -5
  156. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  157. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  158. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  159. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  160. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  161. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  162. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  163. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  164. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  165. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  166. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  167. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  168. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  169. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  170. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  171. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  172. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  173. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  174. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  175. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  176. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  177. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  178. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  179. package/packages/omo-codex/plugin/package-lock.json +26 -14
  180. package/packages/omo-codex/plugin/package.json +1 -1
  181. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +2 -3
  182. package/packages/omo-codex/plugin/scripts/build-components.mjs +13 -1
  183. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +1 -1
  184. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +1 -1
  185. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +1 -1
  186. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +6 -5
  187. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +8 -0
  188. package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +128 -15
  189. package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +10 -0
  190. package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +2 -0
  191. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +1 -1
  192. package/packages/omo-codex/scripts/install-dist/install-local.mjs +328 -63
@@ -2146,7 +2146,7 @@ var package_default;
2146
2146
  var init_package = __esm(() => {
2147
2147
  package_default = {
2148
2148
  name: "oh-my-opencode",
2149
- version: "4.18.0",
2149
+ version: "4.18.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",
@@ -2255,7 +2255,8 @@ var init_package = __esm(() => {
2255
2255
  "build:codex-install": "bun run script/build-codex-install.ts",
2256
2256
  "install:codex-dev": "bun run script/build-codex-install.ts && bun run script/install-codex-dev.ts",
2257
2257
  "build:codex-plugin": "npm --prefix packages/omo-codex/plugin ci && bun run --cwd packages/omo-codex/plugin build",
2258
- "build:senpi-plugin": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check",
2258
+ "build:senpi-plugin": "bun run build:lsp-daemon && bun run build:senpi-plugin:stage",
2259
+ "build:senpi-plugin:stage": "node packages/omo-senpi/plugin/scripts/stage-lsp-daemon-runtime.mjs && node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check && node packages/omo-senpi/plugin/scripts/build-install.mjs",
2259
2260
  "build:materialize-frontend": "node packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs --strict",
2260
2261
  "build:shared-skills-assets": "bun run build:materialize-frontend && rm -rf dist/skills && cp -R packages/shared-skills/skills dist/skills",
2261
2262
  "build:lsp-tools-mcp": "npm --prefix packages/lsp-tools-mcp ci && npm --prefix packages/lsp-tools-mcp run build",
@@ -2277,7 +2278,7 @@ var init_package = __esm(() => {
2277
2278
  "typecheck:script": "tsgo --noEmit -p script/tsconfig.json",
2278
2279
  test: "bun test",
2279
2280
  "test:codex": "bun run build:codex-install && bun run build:git-bash-mcp && bun run build:lsp-tools-mcp && bun run build:lsp-daemon && npm --prefix packages/lsp-tools-mcp test && npm --prefix packages/omo-codex/plugin ci && npm --prefix packages/omo-codex/plugin/components/ulw-loop test && bun run --cwd packages/omo-codex/plugin build && npm --prefix packages/omo-codex/plugin/components/codegraph run typecheck && npm --prefix packages/omo-codex/plugin/components/codegraph test && node scripts/check-third-party-notices.mjs --ship && bun test packages/omo-opencode/src/cli/cli-installer.platform.test.ts packages/omo-codex/src/install/codex-cache.test.ts packages/omo-codex/src/install/codex-cleanup.test.ts packages/omo-codex/src/install/codex-config-agent-cleanup.test.ts packages/omo-codex/src/install/codex-config-autonomous-features.test.ts packages/omo-codex/src/install/codex-config-reasoning.test.ts packages/omo-codex/src/install/codex-config-toml.test.ts packages/omo-codex/src/install/codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex-project-local-cleanup.test.ts packages/omo-codex/src/install/install-codex.test.ts packages/omo-codex/src/install/install-codex-packaged.test.ts packages/omo-codex/src/install/link-cached-plugin-agents.test.ts packages/omo-codex/src/**/*.test.ts packages/utils/src/jsonc-parser.test.ts packages/utils/src/frontmatter.test.ts packages/hashline-core/src/hash-computation.test.ts packages/hashline-core/src/smoke-untested-modules.test.ts packages/rules-engine/src/index.test.ts packages/rules-engine/src/security-boundary.test.ts packages/agents-md-core/src/injector.test.ts packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts && node --test packages/omo-codex/plugin/test/*.test.mjs packages/omo-codex/scripts/install-cache-copy.test.mjs packages/omo-codex/scripts/install-cli-args.test.mjs packages/omo-codex/scripts/install-delegated-command.test.mjs packages/omo-codex/scripts/install-config-autonomous-features.test.mjs packages/omo-codex/scripts/install-config-autonomous.test.mjs packages/omo-codex/scripts/install-config-reasoning.test.mjs packages/omo-codex/scripts/install-config.test.mjs packages/omo-codex/scripts/install-hook-targets.test.mjs packages/omo-codex/scripts/install-project-local-cleanup.test.mjs packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs packages/omo-codex/scripts/install-local-entrypoint.test.mjs packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs packages/omo-codex/scripts/install-local.test.mjs packages/omo-codex/scripts/install-marketplace-cache.test.mjs packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs packages/omo-codex/scripts/install-mcp-runtime.test.mjs packages/omo-codex/scripts/install-packaged-local.test.mjs packages/omo-codex/scripts/install-generated-bundle.test.mjs packages/omo-codex/scripts/install-agent-links.test.mjs packages/omo-codex/scripts/install-bin-links.test.mjs",
2280
- "test:senpi": "node packages/omo-senpi/plugin/scripts/build-extension.mjs && node packages/omo-senpi/plugin/scripts/sync-skills.mjs && node packages/omo-senpi/plugin/scripts/embed-directive.mjs --check && bun test packages/omo-senpi",
2281
+ "test:senpi": "bun run build:senpi-plugin && tsgo --noEmit -p packages/omo-senpi/tsconfig.json && bun test packages/omo-senpi",
2281
2282
  "test:windows-codex": "bun run test:codex",
2282
2283
  "build:git-bash-mcp": "bun run --cwd packages/git-bash-mcp build"
2283
2284
  },
@@ -2317,7 +2318,6 @@ var init_package = __esm(() => {
2317
2318
  picocolors: "^1.1.1",
2318
2319
  picomatch: "^4.0.4",
2319
2320
  "posthog-node": "^5.34.3",
2320
- "vscode-jsonrpc": "^8.2.1",
2321
2321
  zod: "^4.4.3"
2322
2322
  },
2323
2323
  devDependencies: {
@@ -2358,18 +2358,18 @@ var init_package = __esm(() => {
2358
2358
  typescript: "^6.0.3"
2359
2359
  },
2360
2360
  optionalDependencies: {
2361
- "oh-my-opencode-darwin-arm64": "4.18.0",
2362
- "oh-my-opencode-darwin-x64": "4.18.0",
2363
- "oh-my-opencode-darwin-x64-baseline": "4.18.0",
2364
- "oh-my-opencode-linux-arm64": "4.18.0",
2365
- "oh-my-opencode-linux-arm64-musl": "4.18.0",
2366
- "oh-my-opencode-linux-x64": "4.18.0",
2367
- "oh-my-opencode-linux-x64-baseline": "4.18.0",
2368
- "oh-my-opencode-linux-x64-musl": "4.18.0",
2369
- "oh-my-opencode-linux-x64-musl-baseline": "4.18.0",
2370
- "oh-my-opencode-windows-arm64": "4.18.0",
2371
- "oh-my-opencode-windows-x64": "4.18.0",
2372
- "oh-my-opencode-windows-x64-baseline": "4.18.0"
2361
+ "oh-my-opencode-darwin-arm64": "4.18.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"
2373
2373
  },
2374
2374
  overrides: {
2375
2375
  "@earendil-works/pi-agent-core": "0.80.3",
@@ -66851,14 +66851,14 @@ var init_config_manager = __esm(() => {
66851
66851
 
66852
66852
  // packages/telemetry-core/src/activity-state.ts
66853
66853
  import { existsSync as existsSync28, mkdirSync as mkdirSync8, readFileSync as readFileSync14 } from "node:fs";
66854
- import { basename as basename10, join as join53 } from "node:path";
66854
+ import { basename as basename11, join as join53 } from "node:path";
66855
66855
  function resolveTelemetryStateDir(product, options = {}) {
66856
66856
  const dataDir = resolveXdgDataDir(product.cacheDirName, {
66857
66857
  env: options.env,
66858
66858
  osProvider: options.osProvider
66859
66859
  });
66860
66860
  const xdgStateDir = options.env?.XDG_DATA_HOME === undefined ? undefined : join53(options.env.XDG_DATA_HOME, product.cacheDirName);
66861
- if (dataDir === xdgStateDir || xdgStateDir === undefined && basename10(dataDir) === product.cacheDirName) {
66861
+ if (dataDir === xdgStateDir || xdgStateDir === undefined && basename11(dataDir) === product.cacheDirName) {
66862
66862
  return dataDir;
66863
66863
  }
66864
66864
  return join53(dataDir, product.cacheDirName);
@@ -67092,18 +67092,18 @@ var init_env2 = __esm(() => {
67092
67092
  });
67093
67093
 
67094
67094
  // packages/telemetry-core/src/machine-id.ts
67095
- import { createHash as createHash3 } from "node:crypto";
67095
+ import { createHash as createHash4 } from "node:crypto";
67096
67096
  import os4 from "node:os";
67097
67097
  function getDefaultTelemetryOsProvider() {
67098
67098
  return os4;
67099
67099
  }
67100
67100
  function getTelemetryDistinctId(machineIdPrefix, osProvider = getDefaultTelemetryOsProvider()) {
67101
- return createHash3("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
67101
+ return createHash4("sha256").update(`${machineIdPrefix}${osProvider.hostname()}`).digest("hex");
67102
67102
  }
67103
67103
  var init_machine_id = () => {};
67104
67104
 
67105
67105
  // node_modules/.bun/posthog-node@5.35.12/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
67106
- import { dirname as dirname18, posix as posix2, sep as sep7 } from "path";
67106
+ import { dirname as dirname18, posix as posix3, sep as sep7 } from "path";
67107
67107
  function createModulerModifier() {
67108
67108
  const getModuleFromFileName = createGetModuleFromFilename();
67109
67109
  return async (frames) => {
@@ -67118,7 +67118,7 @@ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname18(proc
67118
67118
  if (!filename)
67119
67119
  return;
67120
67120
  const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
67121
- let { dir, base: file2, ext } = posix2.parse(normalizedFilename);
67121
+ let { dir, base: file2, ext } = posix3.parse(normalizedFilename);
67122
67122
  if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
67123
67123
  file2 = file2.slice(0, -1 * ext.length);
67124
67124
  const decodedFile = decodeURIComponent(file2);
@@ -72658,7 +72658,7 @@ var package_default2;
72658
72658
  var init_package2 = __esm(() => {
72659
72659
  package_default2 = {
72660
72660
  name: "@oh-my-opencode/omo-codex",
72661
- version: "4.18.0",
72661
+ version: "4.18.1",
72662
72662
  type: "module",
72663
72663
  private: true,
72664
72664
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -73477,18 +73477,18 @@ function removeFromTextBunLock(lockPath, packageNames) {
73477
73477
  try {
73478
73478
  const content = fs12.readFileSync(lockPath, "utf-8");
73479
73479
  const lock = JSON.parse(stripTrailingCommas(content));
73480
- let removed = false;
73480
+ let removed2 = false;
73481
73481
  for (const packageName of packageNames) {
73482
73482
  if (lock.packages?.[packageName]) {
73483
73483
  delete lock.packages[packageName];
73484
73484
  log2(`[auto-update-checker] Removed from bun.lock: ${packageName}`);
73485
- removed = true;
73485
+ removed2 = true;
73486
73486
  }
73487
73487
  }
73488
- if (removed) {
73488
+ if (removed2) {
73489
73489
  fs12.writeFileSync(lockPath, JSON.stringify(lock, null, 2));
73490
73490
  }
73491
- return removed;
73491
+ return removed2;
73492
73492
  } catch (error51) {
73493
73493
  if (!(error51 instanceof Error)) {
73494
73494
  throw error51;
@@ -73528,7 +73528,7 @@ function getInvalidationPackageNames(packageName, defaultPackageName, acceptedPa
73528
73528
  function removeSpecifierRootDirs(cacheDir, packageNames) {
73529
73529
  const parentDirs = [cacheDir, path13.join(cacheDir, "packages")];
73530
73530
  const prefixes = packageNames.map((packageName) => `${packageName}@`);
73531
- let removed = false;
73531
+ let removed2 = false;
73532
73532
  for (const parentDir of parentDirs) {
73533
73533
  if (!fs12.existsSync(parentDir)) {
73534
73534
  continue;
@@ -73540,10 +73540,10 @@ function removeSpecifierRootDirs(cacheDir, packageNames) {
73540
73540
  const specifierDir = path13.join(parentDir, entry.name);
73541
73541
  fs12.rmSync(specifierDir, { recursive: true, force: true });
73542
73542
  log2(`[auto-update-checker] Specifier cache removed: ${specifierDir}`);
73543
- removed = true;
73543
+ removed2 = true;
73544
73544
  }
73545
73545
  }
73546
- return removed;
73546
+ return removed2;
73547
73547
  }
73548
73548
  function invalidatePackage(packageName, options = {}) {
73549
73549
  try {
@@ -77843,65 +77843,297 @@ function formatUnknownError(error) {
77843
77843
  }
77844
77844
 
77845
77845
  // packages/omo-codex/src/install/lsp-daemon-reaper.ts
77846
- 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";
77847
77854
  import { connect } from "node:net";
77848
- import { join as join48 } from "node:path";
77849
- async function reapLspDaemons(codexHome, deps = {}) {
77850
- const killProcess = deps.killProcess ?? sendSigterm;
77851
- const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
77852
- const daemonRoot = join48(codexHome, "codex-lsp", "daemon");
77853
- const reaped = [];
77854
- let entries;
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;
77855
77962
  try {
77856
- 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"));
77857
77965
  } catch {
77858
- return reaped;
77966
+ return false;
77859
77967
  }
77860
- for (const entry of entries) {
77861
- const versionDir = join48(daemonRoot, entry);
77862
- const pid = await readPidFile(join48(versionDir, "daemon.pid"));
77863
- const socketPath = await readEndpointFile(join48(versionDir, "daemon.endpoint"));
77864
- if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
77865
- reaped.push(pid);
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;
78044
+ }
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;
77866
78053
  }
77867
- await rm10(versionDir, { recursive: true, force: true });
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"));
77868
78070
  }
77869
- return reaped;
78071
+ return results;
77870
78072
  }
77871
- async function readEndpointFile(path7) {
77872
- try {
77873
- const content = (await readFile18(path7, "utf8")).trim();
77874
- return content.length > 0 ? content : null;
77875
- } catch {
78073
+ function parseVersionEntry(entryName) {
78074
+ if (!entryName.startsWith("v"))
77876
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" };
77877
78101
  }
78102
+ return { kind: "valid", pid, endpoint: endpointText };
77878
78103
  }
77879
- async function readPidFile(path7) {
77880
- try {
77881
- const pid = Number.parseInt((await readFile18(path7, "utf8")).trim(), 10);
77882
- return Number.isInteger(pid) && pid > 0 ? pid : null;
77883
- } catch {
77884
- return null;
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}`];
77885
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];
77886
78113
  }
77887
- function probeSocketLive(socketPath, timeoutMs = 500) {
77888
- return new Promise((resolve14) => {
77889
- const socket = connect(socketPath);
77890
- const done = (ok) => {
77891
- socket.destroy();
77892
- resolve14(ok);
77893
- };
77894
- const timer = setTimeout(() => done(false), timeoutMs);
77895
- timer.unref();
77896
- socket.once("connect", () => {
77897
- clearTimeout(timer);
77898
- done(true);
77899
- });
77900
- socket.once("error", () => {
77901
- clearTimeout(timer);
77902
- done(false);
77903
- });
77904
- });
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 };
77905
78137
  }
77906
78138
  function sendSigterm(pid) {
77907
78139
  try {
@@ -77911,6 +78143,24 @@ function sendSigterm(pid) {
77911
78143
  return false;
77912
78144
  }
77913
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
+ }
77914
78164
 
77915
78165
  // packages/omo-codex/src/install/codex-installer-bin-dir.ts
77916
78166
  import { homedir as homedir5 } from "node:os";
@@ -77928,7 +78178,7 @@ function resolveCodexInstallerBinDir(input) {
77928
78178
  }
77929
78179
 
77930
78180
  // packages/omo-codex/src/install/codex-git-bash-hooks.ts
77931
- import { readFile as readFile19, writeFile as writeFile11 } from "node:fs/promises";
78181
+ import { readFile as readFile20, writeFile as writeFile11 } from "node:fs/promises";
77932
78182
  import { join as join50 } from "node:path";
77933
78183
  var WINDOWS_ONLY_GIT_BASH_HOOKS = new Set([
77934
78184
  "./hooks/pre-tool-use-recommending-git-bash-mcp.json",
@@ -77938,7 +78188,7 @@ async function removeGitBashHooksOffWindows(input) {
77938
78188
  if (input.platform === "win32")
77939
78189
  return;
77940
78190
  const manifestPath = join50(input.pluginRoot, ".codex-plugin", "plugin.json");
77941
- const parsed = JSON.parse(await readFile19(manifestPath, "utf8"));
78191
+ const parsed = JSON.parse(await readFile20(manifestPath, "utf8"));
77942
78192
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.hooks))
77943
78193
  return;
77944
78194
  const hooks = parsed.hooks.filter((hook) => typeof hook !== "string" || !WINDOWS_ONLY_GIT_BASH_HOOKS.has(hook));
@@ -78132,7 +78382,16 @@ async function runCodexInstaller(options = {}) {
78132
78382
  pluginNames: marketplace.plugins.map((plugin) => plugin.name)
78133
78383
  });
78134
78384
  }
78135
- 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
+ }
78136
78395
  const marketplaceRoot = join55(codexHome, "plugins", "cache", marketplace.name);
78137
78396
  await writeCachedMarketplaceManifest({
78138
78397
  marketplaceName: marketplace.name,
@@ -78224,10 +78483,10 @@ function codexMarketplaceSource(marketplaceRoot) {
78224
78483
  }
78225
78484
  // packages/omo-codex/src/install/codex-installation-detection.ts
78226
78485
  init_bun_which_shim();
78227
- import { execFile as execFile2 } from "node:child_process";
78486
+ import { execFile as execFile3 } from "node:child_process";
78228
78487
  import { existsSync as existsSync31 } from "node:fs";
78229
78488
  import { homedir as homedir7 } from "node:os";
78230
- import { posix as posix3, win32 as win323 } from "node:path";
78489
+ import { posix as posix4, win32 as win323 } from "node:path";
78231
78490
  var CODEX_PATH_CHECK_LABEL = "codex (PATH)";
78232
78491
  var WINDOWS_START_APPS_ARGS = [
78233
78492
  "-NoProfile",
@@ -78304,11 +78563,11 @@ async function findWindowsCodexStartApp(runCommand) {
78304
78563
  }
78305
78564
  }
78306
78565
  function macCodexAppPaths(homeDir) {
78307
- return ["/Applications/Codex.app", posix3.join(homeDir, "Applications", "Codex.app")];
78566
+ return ["/Applications/Codex.app", posix4.join(homeDir, "Applications", "Codex.app")];
78308
78567
  }
78309
78568
  function macCodexDmgPaths(homeDir) {
78310
- const downloads = posix3.join(homeDir, "Downloads");
78311
- 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")];
78312
78571
  }
78313
78572
  function windowsCodexCliPaths(env3) {
78314
78573
  const candidates = [];
@@ -78346,18 +78605,18 @@ function dedupe(values) {
78346
78605
  }
78347
78606
  function defaultRunCommand2(command, args) {
78348
78607
  return new Promise((resolve16) => {
78349
- execFile2(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
78608
+ execFile3(command, [...args], { encoding: "utf8", windowsHide: true }, (error, stdout) => {
78350
78609
  resolve16({ success: error === null, stdout });
78351
78610
  });
78352
78611
  });
78353
78612
  }
78354
78613
  // packages/omo-codex/src/install/codex-cleanup.ts
78355
- import { lstat as lstat12, readFile as readFile21, readdir as readdir10, rm as rm11, rmdir } from "node:fs/promises";
78614
+ import { lstat as lstat13, readFile as readFile22, readdir as readdir11, rm as rm11, rmdir } from "node:fs/promises";
78356
78615
  import { homedir as homedir8 } from "node:os";
78357
78616
  import { isAbsolute as isAbsolute11, join as join57, relative as relative7, resolve as resolve17 } from "node:path";
78358
78617
 
78359
78618
  // packages/omo-codex/src/install/codex-cleanup-config.ts
78360
- import { lstat as lstat11, mkdir as mkdir8, readFile as readFile20, writeFile as writeFile12 } from "node:fs/promises";
78619
+ import { lstat as lstat12, mkdir as mkdir8, readFile as readFile21, writeFile as writeFile12 } from "node:fs/promises";
78361
78620
  import { dirname as dirname19 } from "node:path";
78362
78621
  var MANAGED_MARKETPLACES = ["sisyphuslabs", "lazycodex", "code-yeongyu-codex-plugins"];
78363
78622
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE2 = ["codex-ultrawork-reviewer"];
@@ -78390,7 +78649,7 @@ function cleanupCodexLightConfigText(config) {
78390
78649
  async function cleanupCodexConfig(configPath, now) {
78391
78650
  if (!await configExists(configPath))
78392
78651
  return { changed: false };
78393
- const original = await readFile20(configPath, "utf8");
78652
+ const original = await readFile21(configPath, "utf8");
78394
78653
  const next = cleanupCodexLightConfigText(original);
78395
78654
  if (next === original)
78396
78655
  return { changed: false };
@@ -78459,7 +78718,7 @@ function formatBackupTimestamp2(date) {
78459
78718
  }
78460
78719
  async function configExists(path7) {
78461
78720
  try {
78462
- await lstat11(path7);
78721
+ await lstat12(path7);
78463
78722
  return true;
78464
78723
  } catch (error) {
78465
78724
  if (nodeErrorCode5(error) === "ENOENT")
@@ -78577,7 +78836,7 @@ async function collectBootstrapDataDirsByGlob(codexHome) {
78577
78836
  async function walkForManagedBootstrapDirs(directory, depth, results) {
78578
78837
  if (depth > BOOTSTRAP_DATA_GLOB_MAX_DEPTH)
78579
78838
  return;
78580
- const entries = await readdir10(directory, { withFileTypes: true }).catch(() => null);
78839
+ const entries = await readdir11(directory, { withFileTypes: true }).catch(() => null);
78581
78840
  if (entries === null)
78582
78841
  return;
78583
78842
  for (const entry of entries) {
@@ -78609,7 +78868,7 @@ async function removeManagedPathBestEffort(path7, seams) {
78609
78868
  }
78610
78869
  async function attemptRemove(path7) {
78611
78870
  try {
78612
- if (await lstat12(path7).catch(() => null) === null)
78871
+ if (await lstat13(path7).catch(() => null) === null)
78613
78872
  return false;
78614
78873
  await rm11(path7, { recursive: true, force: true });
78615
78874
  return true;
@@ -78635,7 +78894,7 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78635
78894
  ];
78636
78895
  const versionRoot = join57(codexHome, "plugins", "cache", "sisyphuslabs", "omo");
78637
78896
  if (await exists6(versionRoot)) {
78638
- const entries = await readdir10(versionRoot, { withFileTypes: true });
78897
+ const entries = await readdir11(versionRoot, { withFileTypes: true });
78639
78898
  for (const entry of entries) {
78640
78899
  if (entry.isDirectory())
78641
78900
  manifestPaths.push(join57(versionRoot, entry.name, INSTALLED_AGENTS_MANIFEST));
@@ -78655,20 +78914,20 @@ async function collectInstalledAgentPaths(codexHome, configPath) {
78655
78914
  async function readManagedAgentPathsFromConfig(codexHome, configPath) {
78656
78915
  if (!await exists6(configPath))
78657
78916
  return [];
78658
- const config = await readFile21(configPath, "utf8");
78917
+ const config = await readFile22(configPath, "utf8");
78659
78918
  return MANAGED_CODEX_AGENT_NAMES2.filter((agentName) => config.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`)).map((agentName) => join57(codexHome, "agents", `${agentName}.toml`));
78660
78919
  }
78661
78920
  async function readInstalledAgentManifest(manifestPath) {
78662
78921
  if (!await exists6(manifestPath))
78663
78922
  return [];
78664
- const parsed = JSON.parse(await readFile21(manifestPath, "utf8"));
78923
+ const parsed = JSON.parse(await readFile22(manifestPath, "utf8"));
78665
78924
  if (!isPlainRecord3(parsed) || !Array.isArray(parsed.agents))
78666
78925
  return [];
78667
78926
  return parsed.agents.filter((path7) => typeof path7 === "string");
78668
78927
  }
78669
78928
  async function removeManifestListedAgentLinks(codexHome, paths) {
78670
78929
  const agentsDir = join57(codexHome, "agents");
78671
- const removed = [];
78930
+ const removed2 = [];
78672
78931
  const skipped2 = [];
78673
78932
  for (const path7 of paths) {
78674
78933
  if (!isSafeManagedAgentPath(agentsDir, path7)) {
@@ -78683,9 +78942,9 @@ async function removeManifestListedAgentLinks(codexHome, paths) {
78683
78942
  continue;
78684
78943
  }
78685
78944
  await rm11(path7, { force: true });
78686
- removed.push(path7);
78945
+ removed2.push(path7);
78687
78946
  }
78688
- return { removed, skipped: skipped2 };
78947
+ return { removed: removed2, skipped: skipped2 };
78689
78948
  }
78690
78949
  function isSafeManagedAgentPath(agentsDir, path7) {
78691
78950
  if (!isAbsolute11(path7))
@@ -78703,7 +78962,7 @@ async function exists6(path7) {
78703
78962
  }
78704
78963
  async function maybeLstat2(path7) {
78705
78964
  try {
78706
- return await lstat12(path7);
78965
+ return await lstat13(path7);
78707
78966
  } catch (error) {
78708
78967
  if (nodeErrorCode6(error) === "ENOENT")
78709
78968
  return null;
@@ -78718,18 +78977,26 @@ function nodeErrorCode6(error) {
78718
78977
  // packages/omo-codex/src/install/codex-git-bash-mcp-env.ts
78719
78978
  var CODEGRAPH_RELATIVE_ARGS2 = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
78720
78979
  // packages/omo-senpi/src/install/install-senpi.ts
78721
- import { execFile as execFile3 } from "node:child_process";
78980
+ import { execFile as execFile4 } from "node:child_process";
78722
78981
  import { constants as constants7, existsSync as existsSync32 } from "node:fs";
78723
- import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile22, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
78982
+ import { access, copyFile as copyFile3, mkdir as mkdir9, readFile as readFile23, rename as rename5, writeFile as writeFile13 } from "node:fs/promises";
78724
78983
  import { homedir as homedir9 } from "node:os";
78725
78984
  import { dirname as dirname21, join as join58, resolve as resolve18 } from "node:path";
78726
78985
  import { fileURLToPath } from "node:url";
78727
78986
  import { promisify as promisify2 } from "node:util";
78728
- var execFileAsync2 = promisify2(execFile3);
78987
+ var execFileAsync2 = promisify2(execFile4);
78729
78988
  var REQUIRED_PLUGIN_ARTIFACTS = [
78730
78989
  join58("extensions", "omo.js"),
78731
78990
  join58("skills", "ultrawork", "SKILL.md"),
78732
- 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")
78733
79000
  ];
78734
79001
  async function runSenpiInstaller(options = {}) {
78735
79002
  const context = resolveInstallContext(options);
@@ -78753,7 +79020,8 @@ async function runSenpiInstaller(options = {}) {
78753
79020
  }
78754
79021
  function resolveInstallContext(options) {
78755
79022
  const env3 = options.env ?? process.env;
78756
- 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))));
78757
79025
  const agentDir = resolve18(options.agentDir ?? env3.SENPI_CODING_AGENT_DIR ?? join58(homedir9(), ".senpi", "agent"));
78758
79026
  const pluginPath = resolve18(options.pluginPath ?? join58(repoRoot, "packages", "omo-senpi", "plugin"));
78759
79027
  return {
@@ -78762,6 +79030,7 @@ function resolveInstallContext(options) {
78762
79030
  agentDir,
78763
79031
  settingsPath: join58(agentDir, "settings.json"),
78764
79032
  pluginPath,
79033
+ allowBuild,
78765
79034
  runCommand: options.runCommand ?? defaultRunCommand3
78766
79035
  };
78767
79036
  }
@@ -78769,8 +79038,13 @@ async function ensurePluginArtifacts(context) {
78769
79038
  const missing = await hasMissingPluginArtifact(context.pluginPath);
78770
79039
  if (!missing)
78771
79040
  return;
79041
+ if (!context.allowBuild) {
79042
+ throw new Error(`Packed omo-senpi plugin is missing required runtime artifacts at ${context.pluginPath}`);
79043
+ }
78772
79044
  await context.runCommand("node", [join58(context.pluginPath, "scripts", "build-extension.mjs")], { cwd: context.repoRoot });
78773
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 });
78774
79048
  }
78775
79049
  async function hasMissingPluginArtifact(pluginPath) {
78776
79050
  for (const artifact of REQUIRED_PLUGIN_ARTIFACTS) {
@@ -78789,7 +79063,7 @@ async function defaultRunCommand3(command, args, options) {
78789
79063
  async function readSettings(settingsPath) {
78790
79064
  let raw;
78791
79065
  try {
78792
- raw = await readFile22(settingsPath, "utf8");
79066
+ raw = await readFile23(settingsPath, "utf8");
78793
79067
  } catch (error) {
78794
79068
  if (isErrno(error, "ENOENT"))
78795
79069
  return {};
@@ -78868,7 +79142,7 @@ function isErrno(error, code) {
78868
79142
  return error instanceof Error && "code" in error && error.code === code;
78869
79143
  }
78870
79144
  // packages/omo-opencode/src/cli/star-request.ts
78871
- import { execFile as execFile4 } from "node:child_process";
79145
+ import { execFile as execFile5 } from "node:child_process";
78872
79146
  import { promisify as promisify3 } from "node:util";
78873
79147
  var STAR_REPOSITORIES = [
78874
79148
  "code-yeongyu/oh-my-openagent",
@@ -78880,7 +79154,7 @@ var PLATFORM_REPOSITORIES = {
78880
79154
  both: STAR_REPOSITORIES,
78881
79155
  senpi: STAR_REPOSITORIES
78882
79156
  };
78883
- var execFileAsync3 = promisify3(execFile4);
79157
+ var execFileAsync3 = promisify3(execFile5);
78884
79158
  async function runGitHubStarCommand(repository) {
78885
79159
  await execFileAsync3("gh", ["api", "--silent", "--method", "PUT", `/user/starred/${repository}`]);
78886
79160
  }
@@ -97250,7 +97524,7 @@ var import_picocolors11 = __toESM(require_picocolors(), 1);
97250
97524
  // packages/omo-opencode/src/cli/run/opencode-binary-resolver.ts
97251
97525
  init_bun_which_shim();
97252
97526
  init_spawn_with_windows_hide();
97253
- 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";
97254
97528
  var OPENCODE_COMMANDS = ["opencode", "opencode-desktop"];
97255
97529
  var WINDOWS_SUFFIXES = ["", ".exe", ".cmd", ".bat", ".ps1"];
97256
97530
  function getCommandCandidates(platform) {
@@ -97261,7 +97535,7 @@ function getCommandCandidates(platform) {
97261
97535
  function getPathTools(platform) {
97262
97536
  if (platform === "win32")
97263
97537
  return win324;
97264
- return posix4;
97538
+ return posix5;
97265
97539
  }
97266
97540
  function collectCandidateBinaryPaths(pathEnv, which2 = bunWhich, platform = process.platform) {
97267
97541
  const seen = new Set;
@@ -100420,12 +100694,12 @@ import { dirname as dirname30, join as join79 } from "node:path";
100420
100694
 
100421
100695
  // packages/omo-opencode/src/hooks/comment-checker/downloader.ts
100422
100696
  import { join as join78 } from "path";
100423
- import { homedir as homedir18, tmpdir as tmpdir3 } from "os";
100697
+ import { homedir as homedir18, tmpdir as tmpdir4 } from "os";
100424
100698
  init_binary_downloader();
100425
100699
  init_logger2();
100426
100700
  init_plugin_identity();
100427
100701
  var DEBUG = process.env.COMMENT_CHECKER_DEBUG === "1";
100428
- var DEBUG_FILE = join78(tmpdir3(), "comment-checker-debug.log");
100702
+ var DEBUG_FILE = join78(tmpdir4(), "comment-checker-debug.log");
100429
100703
  function getCacheDir2() {
100430
100704
  if (process.platform === "win32") {
100431
100705
  const localAppData = process.env.LOCALAPPDATA || process.env.APPDATA;
@@ -100662,13 +100936,14 @@ async function getGhCliInfo(dependencies = {}) {
100662
100936
  }
100663
100937
 
100664
100938
  // packages/omo-opencode/src/cli/doctor/checks/tools-lsp.ts
100665
- import { readFileSync as readFileSync38 } from "node:fs";
100939
+ import { readFileSync as readFileSync39 } from "node:fs";
100666
100940
  import { join as join80 } from "node:path";
100667
100941
 
100668
100942
  // packages/omo-opencode/src/mcp/lsp.ts
100669
- import { existsSync as existsSync56 } from "node:fs";
100943
+ import { existsSync as existsSync56, readFileSync as readFileSync38 } from "node:fs";
100670
100944
  import { delimiter as delimiter3, dirname as dirname31, resolve as resolve21 } from "node:path";
100671
100945
  import { fileURLToPath as fileURLToPath7 } from "node:url";
100946
+ init_opencode_config_dir();
100672
100947
 
100673
100948
  // packages/omo-opencode/src/mcp/cli-suffix.ts
100674
100949
  function normalizeCliPath(path14) {
@@ -100680,7 +100955,7 @@ function hasCliSuffix(candidatePath, suffix) {
100680
100955
 
100681
100956
  // packages/omo-opencode/src/mcp/runtime-executable.ts
100682
100957
  init_bun_which_shim();
100683
- import { basename as basename12 } from "node:path";
100958
+ import { basename as basename13 } from "node:path";
100684
100959
  var NODE_EXECUTABLE_NAMES = new Set(["node", "node.exe"]);
100685
100960
  function isUnsafeCommandName2(commandName) {
100686
100961
  if (commandName.length === 0)
@@ -100696,7 +100971,7 @@ function isUnsafeCommandName2(commandName) {
100696
100971
  return false;
100697
100972
  }
100698
100973
  function isNodeExecPath(execPath) {
100699
- return NODE_EXECUTABLE_NAMES.has(basename12(execPath).toLowerCase());
100974
+ return NODE_EXECUTABLE_NAMES.has(basename13(execPath).toLowerCase());
100700
100975
  }
100701
100976
  function resolveRuntimeExecutable(commandName, options = {}) {
100702
100977
  if (isUnsafeCommandName2(commandName)) {
@@ -100766,8 +101041,15 @@ var LSP_TOOLS_PACKAGE_REL = "packages/lsp-tools-mcp";
100766
101041
  var DIST_CLI_REL = "dist/cli.js";
100767
101042
  var SOURCE_CLI_REL = "src/cli.ts";
100768
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
+ });
100769
101050
  var LSP_BOOTSTRAP_SCRIPT = [
100770
101051
  "const { existsSync } = require('node:fs')",
101052
+ "const { createRequire } = require('node:module')",
100771
101053
  "const { join } = require('node:path')",
100772
101054
  "const { spawnSync } = require('node:child_process')",
100773
101055
  "const root = process.argv[1]",
@@ -100776,16 +101058,18 @@ var LSP_BOOTSTRAP_SCRIPT = [
100776
101058
  `const toolsPackage = join(root, '${LSP_TOOLS_PACKAGE_REL}')`,
100777
101059
  `const daemonPackage = join(root, '${PACKAGE_REL}')`,
100778
101060
  "const toolsDist = join(toolsPackage, 'dist/cli.js')",
100779
- "const daemonDist = join(daemonPackage, 'dist/cli.js')",
101061
+ "const daemonPackageJson = join(daemonPackage, 'package.json')",
100780
101062
  "const daemonSource = join(daemonPackage, 'src/cli.ts')",
100781
101063
  "const run = (command, args, stdio) => spawnSync(command, args, { cwd: root, env: process.env, stdio })",
100782
101064
  "const finish = (result) => { if (result.error) { console.error(result.error.message); process.exit(1) } process.exit(result.status ?? 1) }",
100783
101065
  "const runIfAvailable = (command, args) => { const result = run(command, args, 'inherit'); if (result.error) return false; finish(result); return true }",
100784
- "if (existsSync(daemonDist)) finish(run(process.execPath, [daemonDist, 'mcp'], 'inherit'))",
100785
- "if (existsSync(daemonSource) && existsSync(toolsDist)) runIfAvailable(bun, [daemonSource, 'mcp'])",
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']) }`,
100786
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']]]",
100787
101071
  "for (const [command, args] of steps) { const result = run(command, args, ['ignore', 'ignore', 'inherit']); if (result.error || result.status !== 0) finish(result) }",
100788
- "finish(run(process.execPath, [daemonDist, 'mcp'], 'inherit'))"
101072
+ "finish(run(process.execPath, [resolveDaemonCli(), 'mcp'], 'inherit'))"
100789
101073
  ].join(";");
100790
101074
  function getModuleDirectory(moduleUrl) {
100791
101075
  try {
@@ -100799,6 +101083,16 @@ function getModuleDirectory(moduleUrl) {
100799
101083
  function findBootstrapRoot(candidates, pathExists) {
100800
101084
  return candidates.find((candidate) => pathExists(resolve21(candidate.root, "package.json")))?.root ?? process.cwd();
100801
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
+ }
100802
101096
  function createBootstrapCandidate(root, pathExists, resolveExecutable) {
100803
101097
  const runtime5 = resolveJavaScriptRuntime(resolveExecutable);
100804
101098
  const bun = resolveExecutable("bun");
@@ -100823,7 +101117,7 @@ function resolveLspCommand(options = {}) {
100823
101117
  sourceCliRel: SOURCE_CLI_REL,
100824
101118
  pathExists,
100825
101119
  resolveExecutable,
100826
- 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
100827
101121
  }) : [];
100828
101122
  const distCandidate = candidates.find((candidate) => hasCliSuffix(candidate.path, DIST_CLI_REL) && candidate.exists);
100829
101123
  if (distCandidate) {
@@ -100837,12 +101131,21 @@ function resolveLspCommand(options = {}) {
100837
101131
  }
100838
101132
  function createLspMcpConfig(options = {}) {
100839
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;
100840
101137
  return {
100841
101138
  type: "local",
100842
101139
  command: resolvedCommand.command,
100843
101140
  enabled: resolvedCommand.exists,
100844
101141
  environment: {
100845
- 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
+ } : {}
100846
101149
  }
100847
101150
  };
100848
101151
  }
@@ -100859,7 +101162,7 @@ function readOmoConfig(configDirectory) {
100859
101162
  return null;
100860
101163
  }
100861
101164
  try {
100862
- const content = readFileSync38(detected.path, "utf-8");
101165
+ const content = readFileSync39(detected.path, "utf-8");
100863
101166
  return parseJsonc(content);
100864
101167
  } catch (error51) {
100865
101168
  if (!(error51 instanceof Error)) {
@@ -100889,7 +101192,7 @@ function getInstalledLspServers(options = {}) {
100889
101192
 
100890
101193
  // packages/omo-opencode/src/cli/doctor/checks/tools-mcp.ts
100891
101194
  init_shared();
100892
- import { existsSync as existsSync57, readFileSync as readFileSync39 } from "node:fs";
101195
+ import { existsSync as existsSync57, readFileSync as readFileSync40 } from "node:fs";
100893
101196
  import { homedir as homedir20 } from "node:os";
100894
101197
  import { join as join81 } from "node:path";
100895
101198
  var BUILTIN_MCP_SERVERS = ["websearch", "context7", "grep_app", "lsp"];
@@ -100906,7 +101209,7 @@ function loadUserMcpConfig() {
100906
101209
  if (!existsSync57(configPath))
100907
101210
  continue;
100908
101211
  try {
100909
- const content = readFileSync39(configPath, "utf-8");
101212
+ const content = readFileSync40(configPath, "utf-8");
100910
101213
  const config3 = parseJsonc(content);
100911
101214
  if (config3.mcpServers) {
100912
101215
  Object.assign(servers, config3.mcpServers);
@@ -101041,7 +101344,7 @@ async function checkTools() {
101041
101344
 
101042
101345
  // packages/omo-opencode/src/cli/doctor/checks/telemetry.ts
101043
101346
  init_src4();
101044
- import { existsSync as existsSync58, readFileSync as readFileSync40 } from "node:fs";
101347
+ import { existsSync as existsSync58, readFileSync as readFileSync41 } from "node:fs";
101045
101348
  function isTelemetryState(value) {
101046
101349
  return value !== null && typeof value === "object" && !Array.isArray(value);
101047
101350
  }
@@ -101051,7 +101354,7 @@ function readLastActiveDay(stateFilePath) {
101051
101354
  }
101052
101355
  let parsed;
101053
101356
  try {
101054
- parsed = JSON.parse(readFileSync40(stateFilePath, "utf-8"));
101357
+ parsed = JSON.parse(readFileSync41(stateFilePath, "utf-8"));
101055
101358
  } catch (error51) {
101056
101359
  if (error51 instanceof Error) {
101057
101360
  return "unreadable";
@@ -101126,7 +101429,7 @@ function expandHomeDirectory(directoryPath) {
101126
101429
  // packages/omo-opencode/src/cli/doctor/checks/team-mode.ts
101127
101430
  init_shared();
101128
101431
  init_plugin_identity();
101129
- import { readFileSync as readFileSync41, promises as fs13 } from "node:fs";
101432
+ import { readFileSync as readFileSync42, promises as fs13 } from "node:fs";
101130
101433
  import path15 from "node:path";
101131
101434
  async function checkTeamMode() {
101132
101435
  const config3 = loadTeamModeConfig();
@@ -101163,7 +101466,7 @@ function loadTeamModeConfig() {
101163
101466
  if (!configPath)
101164
101467
  return { team_mode: undefined };
101165
101468
  try {
101166
- return parseJsonc(readFileSync41(configPath, "utf-8"));
101469
+ return parseJsonc(readFileSync42(configPath, "utf-8"));
101167
101470
  } catch (error51) {
101168
101471
  if (error51 instanceof Error) {
101169
101472
  return { team_mode: undefined };
@@ -101197,9 +101500,9 @@ async function pathExists(dir) {
101197
101500
  // packages/omo-opencode/src/cli/doctor/checks/codex.ts
101198
101501
  init_src();
101199
101502
  import { existsSync as existsSync59 } from "node:fs";
101200
- 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";
101201
101504
  import { homedir as homedir22 } from "node:os";
101202
- 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";
101203
101506
  // packages/omo-opencode/package.json
101204
101507
  var package_default3 = {
101205
101508
  name: "@oh-my-opencode/omo-opencode",
@@ -101388,7 +101691,7 @@ async function resolveInstalledPluginRoot(codexHome) {
101388
101691
  const pluginRoot = join82(codexHome, "plugins", "cache", MARKETPLACE_NAME, PLUGIN_NAME2);
101389
101692
  if (!existsSync59(pluginRoot))
101390
101693
  return null;
101391
- const versions2 = await readdir11(pluginRoot, { withFileTypes: true });
101694
+ const versions2 = await readdir12(pluginRoot, { withFileTypes: true });
101392
101695
  const candidates = versions2.filter((entry) => entry.isDirectory()).map((entry) => entry.name).sort(compareVersionsDescending);
101393
101696
  return candidates.length === 0 ? null : join82(pluginRoot, candidates[0] ?? DEFAULT_PLUGIN_VERSION);
101394
101697
  }
@@ -101404,7 +101707,7 @@ async function readCodexConfigSummary(configPath) {
101404
101707
  companionLifecycleHookStateEvents: []
101405
101708
  };
101406
101709
  }
101407
- const content = await readFile23(configPath, "utf8");
101710
+ const content = await readFile24(configPath, "utf8");
101408
101711
  return {
101409
101712
  exists: true,
101410
101713
  marketplaceConfigured: content.includes("[marketplaces.sisyphuslabs]"),
@@ -101427,12 +101730,12 @@ async function readLinkedAgents(codexHome) {
101427
101730
  const agentsDir = join82(codexHome, "agents");
101428
101731
  if (!existsSync59(agentsDir))
101429
101732
  return [];
101430
- const entries = await readdir11(agentsDir, { withFileTypes: true });
101431
- return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename13(entry.name, ".toml")).sort();
101733
+ const entries = await readdir12(agentsDir, { withFileTypes: true });
101734
+ return entries.filter((entry) => entry.isFile() || entry.isSymbolicLink()).map((entry) => basename14(entry.name, ".toml")).sort();
101432
101735
  }
101433
101736
  async function readJson(path16) {
101434
101737
  try {
101435
- const parsed = JSON.parse(await readFile23(path16, "utf8"));
101738
+ const parsed = JSON.parse(await readFile24(path16, "utf8"));
101436
101739
  return isPlainRecord(parsed) ? parsed : null;
101437
101740
  } catch (error51) {
101438
101741
  if (error51 instanceof Error)
@@ -101527,7 +101830,7 @@ function compareVersionsDescending(left, right) {
101527
101830
  }
101528
101831
  async function pathExists2(path16) {
101529
101832
  try {
101530
- await lstat13(path16);
101833
+ await lstat14(path16);
101531
101834
  return true;
101532
101835
  } catch (error51) {
101533
101836
  if (error51 instanceof Error)
@@ -101538,7 +101841,7 @@ async function pathExists2(path16) {
101538
101841
 
101539
101842
  // packages/omo-opencode/src/cli/doctor/checks/codex-components.ts
101540
101843
  init_src();
101541
- 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";
101542
101845
  import { homedir as homedir23 } from "node:os";
101543
101846
  import { dirname as dirname32, isAbsolute as isAbsolute13, join as join83, relative as relative10, resolve as resolve23, sep as sep9 } from "node:path";
101544
101847
  var CODEX_COMPONENTS_CHECK_ID = "codex-components";
@@ -101679,7 +101982,7 @@ async function findHookManifestPaths(root) {
101679
101982
  async function findManifestPaths(root, manifestName) {
101680
101983
  let entries;
101681
101984
  try {
101682
- entries = await readdir12(root, { withFileTypes: true });
101985
+ entries = await readdir13(root, { withFileTypes: true });
101683
101986
  } catch {
101684
101987
  return [];
101685
101988
  }
@@ -101791,7 +102094,7 @@ function degradedDetailLines(entries) {
101791
102094
  }
101792
102095
  async function readJson2(path16) {
101793
102096
  try {
101794
- const parsed = JSON.parse(await readFile24(path16, "utf8"));
102097
+ const parsed = JSON.parse(await readFile25(path16, "utf8"));
101795
102098
  return isRecord6(parsed) ? parsed : null;
101796
102099
  } catch (error51) {
101797
102100
  if (error51 instanceof Error)
@@ -101819,7 +102122,7 @@ function isRecord6(value) {
101819
102122
 
101820
102123
  // packages/omo-opencode/src/cli/doctor/checks/codex-runtime-wrapper.ts
101821
102124
  import { existsSync as existsSync60 } from "node:fs";
101822
- import { readFile as readFile25 } from "node:fs/promises";
102125
+ import { readFile as readFile26 } from "node:fs/promises";
101823
102126
  import { homedir as homedir24 } from "node:os";
101824
102127
  import { join as join84, resolve as resolve24 } from "node:path";
101825
102128
  var RUNTIME_WRAPPER_MARKER2 = "OMO_GENERATED_RUNTIME_WRAPPER";
@@ -101854,7 +102157,7 @@ async function checkCodexRuntimeWrapper(deps = {}) {
101854
102157
  }
101855
102158
  async function readRuntimeWrapper(path16) {
101856
102159
  try {
101857
- return await readFile25(path16, "utf8");
102160
+ return await readFile26(path16, "utf8");
101858
102161
  } catch (error51) {
101859
102162
  if (error51 instanceof Error)
101860
102163
  return null;
@@ -102330,18 +102633,18 @@ Doctor failed unexpectedly: ${message}`];
102330
102633
  }
102331
102634
 
102332
102635
  // packages/mcp-client-core/src/mcp-oauth/storage.ts
102333
- import { createHash as createHash4 } from "node:crypto";
102636
+ import { createHash as createHash5 } from "node:crypto";
102334
102637
  import {
102335
102638
  chmodSync as chmodSync4,
102336
102639
  existsSync as existsSync63,
102337
102640
  mkdirSync as mkdirSync14,
102338
102641
  readdirSync as readdirSync9,
102339
- readFileSync as readFileSync43,
102642
+ readFileSync as readFileSync44,
102340
102643
  renameSync as renameSync7,
102341
102644
  unlinkSync as unlinkSync8,
102342
102645
  writeFileSync as writeFileSync11
102343
102646
  } from "node:fs";
102344
- 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";
102345
102648
 
102346
102649
  // packages/mcp-client-core/src/config-dir.ts
102347
102650
  import { existsSync as existsSync61, realpathSync as realpathSync8 } from "node:fs";
@@ -102369,7 +102672,7 @@ function getOpenCodeCliConfigDir(env3 = process.env) {
102369
102672
  }
102370
102673
 
102371
102674
  // packages/mcp-client-core/src/mcp-oauth/storage-index.ts
102372
- import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync42, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
102675
+ import { chmodSync as chmodSync3, existsSync as existsSync62, readFileSync as readFileSync43, renameSync as renameSync6, writeFileSync as writeFileSync10 } from "node:fs";
102373
102676
  import { join as join86 } from "node:path";
102374
102677
  var INDEX_FILE_NAME = "index.json";
102375
102678
  function isTokenIndex(value) {
@@ -102385,7 +102688,7 @@ function readTokenIndex(storageDir) {
102385
102688
  if (!existsSync62(indexPath))
102386
102689
  return {};
102387
102690
  try {
102388
- const parsed = JSON.parse(readFileSync42(indexPath, "utf-8"));
102691
+ const parsed = JSON.parse(readFileSync43(indexPath, "utf-8"));
102389
102692
  return isTokenIndex(parsed) ? parsed : {};
102390
102693
  } catch (readError) {
102391
102694
  if (!(readError instanceof Error))
@@ -102425,7 +102728,7 @@ function getMcpOauthStorageDir() {
102425
102728
  return join87(getOpenCodeCliConfigDir(), STORAGE_DIR_NAME);
102426
102729
  }
102427
102730
  function getMcpOauthServerHash(serverHost, resource) {
102428
- 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);
102429
102732
  }
102430
102733
  function getMcpOauthStoragePath(serverHost, resource) {
102431
102734
  return join87(getMcpOauthStorageDir(), `${getMcpOauthServerHash(serverHost, resource)}.json`);
@@ -102495,7 +102798,7 @@ function readTokenFile(filePath) {
102495
102798
  if (!existsSync63(filePath))
102496
102799
  return null;
102497
102800
  try {
102498
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102801
+ const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
102499
102802
  return isOAuthTokenData(parsed) ? parsed : null;
102500
102803
  } catch (readError) {
102501
102804
  if (!(readError instanceof Error))
@@ -102508,7 +102811,7 @@ function readLegacyStore() {
102508
102811
  if (!existsSync63(filePath))
102509
102812
  return null;
102510
102813
  try {
102511
- const parsed = JSON.parse(readFileSync43(filePath, "utf-8"));
102814
+ const parsed = JSON.parse(readFileSync44(filePath, "utf-8"));
102512
102815
  if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed))
102513
102816
  return null;
102514
102817
  const result = {};
@@ -102626,7 +102929,7 @@ function listAllTokens() {
102626
102929
  if (!entry.isFile() || !entry.name.endsWith(".json") || entry.name === "index.json")
102627
102930
  continue;
102628
102931
  const token = readTokenFile(join87(dir, entry.name));
102629
- const hash2 = basename14(entry.name, ".json");
102932
+ const hash2 = basename15(entry.name, ".json");
102630
102933
  if (token)
102631
102934
  result[index[hash2] ?? hash2] = token;
102632
102935
  }
@@ -102799,13 +103102,13 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
102799
103102
 
102800
103103
  // packages/mcp-client-core/src/mcp-oauth/oauth-authorization-flow.ts
102801
103104
  import { spawn as spawn4 } from "node:child_process";
102802
- import { createHash as createHash5, randomBytes as randomBytes2 } from "node:crypto";
103105
+ import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
102803
103106
  import { createServer as createServer2 } from "node:http";
102804
103107
  function generateCodeVerifier() {
102805
103108
  return randomBytes2(32).toString("base64url");
102806
103109
  }
102807
103110
  function generateCodeChallenge(verifier) {
102808
- return createHash5("sha256").update(verifier).digest("base64url");
103111
+ return createHash6("sha256").update(verifier).digest("base64url");
102809
103112
  }
102810
103113
  function buildAuthorizationUrl(authorizationEndpoint, options) {
102811
103114
  const url2 = new URL(authorizationEndpoint);
@@ -103349,7 +103652,7 @@ async function boulder(options) {
103349
103652
  }
103350
103653
  // packages/omo-opencode/src/cli/codex-ulw-loop.ts
103351
103654
  import { spawn as spawn5 } from "node:child_process";
103352
- 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";
103353
103656
  import { homedir as homedir26 } from "node:os";
103354
103657
  var ULW_LOOP_DELEGATION_SENTINEL = "OMO_ULW_LOOP_DELEGATED";
103355
103658
  function resolveCodexUlwLoopCommand(input = {}) {
@@ -103399,7 +103702,7 @@ function resolveLegacyLocalOmoBin(env3, homeDir, currentExecutablePaths) {
103399
103702
  }
103400
103703
  function isGeneratedRuntimeWrapper(candidate) {
103401
103704
  try {
103402
- return readFileSync44(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
103705
+ return readFileSync45(candidate, "utf8").includes(RUNTIME_WRAPPER_MARKER);
103403
103706
  } catch (error51) {
103404
103707
  if (error51 instanceof Error)
103405
103708
  return false;