oh-my-opencode 4.8.0 → 4.9.0

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 (512) hide show
  1. package/dist/agents/prometheus/system-prompt.d.ts +1 -1
  2. package/dist/agents/sisyphus/claude-fable-5.d.ts +19 -0
  3. package/dist/agents/sisyphus/claude-opus-4-7.d.ts +3 -1
  4. package/dist/agents/sisyphus/claude-opus-4-8.d.ts +19 -0
  5. package/dist/agents/sisyphus/index.d.ts +4 -0
  6. package/dist/agents/types.d.ts +2 -2
  7. package/dist/cli/doctor/checks/codex.d.ts +1 -0
  8. package/dist/cli/doctor/checks/tools-gh.d.ts +8 -1
  9. package/dist/cli/doctor/index.d.ts +1 -0
  10. package/dist/cli/doctor/types.d.ts +2 -0
  11. package/dist/cli/index.js +1922 -785
  12. package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
  13. package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -0
  14. package/dist/cli/install-codex/codex-config-toml.d.ts +1 -0
  15. package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +8 -0
  16. package/dist/cli/install-codex/codex-multi-agent-v2-config.d.ts +11 -0
  17. package/dist/cli/install-codex/install-codex.d.ts +1 -8
  18. package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +5 -0
  19. package/dist/cli/run/runnable-agent-resolver.d.ts +11 -0
  20. package/dist/cli/sparkshell-condense.d.ts +10 -0
  21. package/dist/cli/sparkshell-parse.d.ts +3 -0
  22. package/dist/cli/sparkshell-session-context.d.ts +20 -0
  23. package/dist/cli/sparkshell-spark.d.ts +23 -0
  24. package/dist/cli/sparkshell.d.ts +8 -1
  25. package/dist/cli-node/index.js +92552 -0
  26. package/dist/config/schema/agent-names.d.ts +2 -0
  27. package/dist/config/schema/hooks.d.ts +0 -2
  28. package/dist/config/schema/keyword-detector.d.ts +0 -6
  29. package/dist/config/schema/oh-my-opencode-config.d.ts +2 -4
  30. package/dist/create-hooks.d.ts +0 -2
  31. package/dist/features/background-agent/parent-wake-dedupe.d.ts +2 -0
  32. package/dist/features/background-agent/parent-wake-flush-runner.d.ts +2 -0
  33. package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -0
  34. package/dist/features/background-agent/parent-wake-session-history.d.ts +4 -0
  35. package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -0
  36. package/dist/features/builtin-commands/templates/handoff.d.ts +1 -1
  37. package/dist/features/builtin-skills/index.d.ts +1 -1
  38. package/dist/features/builtin-skills/skills.d.ts +4 -0
  39. package/dist/features/opencode-runtime-skills/source-server.d.ts +16 -1
  40. package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +2 -0
  41. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +2 -0
  42. package/dist/features/team-mode/types.d.ts +1 -0
  43. package/dist/features/tmux-subagent/failed-readiness-cache.d.ts +28 -0
  44. package/dist/features/tmux-subagent/manager.d.ts +1 -9
  45. package/dist/features/tmux-subagent/resolve-server-url.d.ts +3 -0
  46. package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
  47. package/dist/hooks/index.d.ts +0 -1
  48. package/dist/hooks/keyword-detector/constants.d.ts +0 -4
  49. package/dist/hooks/keyword-detector/ultrawork/source-detector.d.ts +1 -1
  50. package/dist/index.js +9001 -1795
  51. package/dist/oh-my-opencode.schema.json +2 -4
  52. package/dist/plugin/chat-params.d.ts +1 -8
  53. package/dist/plugin/hooks/create-core-hooks.d.ts +0 -2
  54. package/dist/plugin/hooks/create-session-hooks.d.ts +0 -2
  55. package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -2
  56. package/dist/plugin/messages-transform.d.ts +0 -1
  57. package/dist/shared/model-availability.d.ts +10 -2
  58. package/package.json +25 -18
  59. package/packages/ast-grep-mcp/dist/cli.js +2 -10
  60. package/packages/git-bash-mcp/dist/cli.js +11 -4
  61. package/packages/lsp-daemon/dist/cli.d.ts +2 -0
  62. package/packages/lsp-daemon/dist/cli.js +3711 -0
  63. package/packages/lsp-daemon/dist/daemon-client.d.ts +19 -0
  64. package/packages/lsp-daemon/dist/daemon-client.js +114 -0
  65. package/packages/lsp-daemon/dist/daemon-server.d.ts +12 -0
  66. package/packages/lsp-daemon/dist/daemon-server.js +106 -0
  67. package/packages/lsp-daemon/dist/ensure-daemon.d.ts +21 -0
  68. package/packages/lsp-daemon/dist/ensure-daemon.js +97 -0
  69. package/packages/lsp-daemon/dist/index.d.ts +5 -0
  70. package/packages/lsp-daemon/dist/index.js +3573 -0
  71. package/packages/lsp-daemon/dist/lock.d.ts +7 -0
  72. package/packages/lsp-daemon/dist/lock.js +61 -0
  73. package/packages/lsp-daemon/dist/package.json +6 -0
  74. package/packages/lsp-daemon/dist/paths.d.ts +11 -0
  75. package/packages/lsp-daemon/dist/paths.js +49 -0
  76. package/packages/lsp-daemon/dist/proxy.d.ts +10 -0
  77. package/packages/lsp-daemon/dist/proxy.js +61 -0
  78. package/packages/lsp-daemon/dist/request-routing.d.ts +9 -0
  79. package/packages/lsp-daemon/dist/request-routing.js +44 -0
  80. package/packages/lsp-daemon/dist/run-daemon.d.ts +1 -0
  81. package/packages/lsp-daemon/dist/run-daemon.js +11 -0
  82. package/packages/lsp-daemon/dist/socket-jsonrpc.d.ts +5 -0
  83. package/packages/lsp-daemon/dist/socket-jsonrpc.js +25 -0
  84. package/packages/lsp-daemon/package.json +38 -0
  85. package/packages/lsp-tools-mcp/dist/cli.js +0 -0
  86. package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +40 -17
  87. package/packages/lsp-tools-mcp/dist/lsp/client.js +11 -9
  88. package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +5 -5
  89. package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +5 -3
  90. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -0
  91. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +8 -0
  92. package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +3 -2
  93. package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +1 -0
  94. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +12 -0
  95. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +12 -0
  96. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +51 -0
  97. package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +2 -1
  98. package/packages/lsp-tools-mcp/dist/request-context.d.ts +7 -0
  99. package/packages/lsp-tools-mcp/dist/request-context.js +14 -0
  100. package/packages/lsp-tools-mcp/dist/tools.js +44 -1
  101. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +46 -33
  102. package/packages/omo-codex/plugin/.mcp.json +1 -1
  103. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +7 -0
  104. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +173 -0
  105. package/packages/omo-codex/plugin/components/comment-checker/dist/cli.d.ts +2 -0
  106. package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +10 -0
  107. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +22 -0
  108. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +165 -0
  109. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +1 -0
  110. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +1 -0
  111. package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +5 -0
  112. package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +4 -0
  113. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +6 -0
  114. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +10 -0
  115. package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +2 -0
  116. package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +11 -0
  117. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +3 -0
  118. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +104 -0
  119. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +26 -0
  120. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +144 -0
  121. package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +43 -0
  122. package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +1 -0
  123. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  124. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  125. package/packages/omo-codex/plugin/components/git-bash/dist/cli.d.ts +2 -0
  126. package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +29 -0
  127. package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.d.ts +28 -0
  128. package/packages/omo-codex/plugin/components/git-bash/dist/codex-hook.js +137 -0
  129. package/packages/omo-codex/plugin/components/git-bash/dist/index.d.ts +1 -0
  130. package/packages/omo-codex/plugin/components/git-bash/dist/index.js +1 -0
  131. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  132. package/packages/omo-codex/plugin/components/git-bash/package.json +5 -2
  133. package/packages/omo-codex/plugin/components/lsp/.mcp.json +1 -1
  134. package/packages/omo-codex/plugin/components/lsp/dist/cli.d.ts +2 -0
  135. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +42 -0
  136. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.d.ts +2 -0
  137. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +40 -0
  138. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.d.ts +16 -0
  139. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook.js +180 -0
  140. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.d.ts +12 -0
  141. package/packages/omo-codex/plugin/components/lsp/dist/lsp-session-state.js +95 -0
  142. package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.d.ts +6 -0
  143. package/packages/omo-codex/plugin/components/lsp/dist/mutated-file-paths.js +79 -0
  144. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  145. package/packages/omo-codex/plugin/components/lsp/package.json +7 -7
  146. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-daemon.mjs +68 -0
  147. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.mjs +45 -22
  148. package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
  149. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +1 -1
  150. package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +6 -2
  151. package/packages/omo-codex/plugin/components/lsp/src/lsp-session-state.ts +4 -0
  152. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +68 -0
  153. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +8 -20
  154. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +69 -96
  155. package/packages/omo-codex/plugin/components/rules/dist/cli.d.ts +2 -0
  156. package/packages/omo-codex/plugin/components/rules/dist/cli.js +118 -0
  157. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +5 -0
  158. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +1 -0
  159. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +47 -0
  160. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +127 -0
  161. package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +2 -0
  162. package/packages/omo-codex/plugin/components/rules/dist/config.js +100 -0
  163. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +2 -0
  164. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +26 -0
  165. package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +8 -0
  166. package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +36 -0
  167. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +7 -0
  168. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +65 -0
  169. package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +3 -0
  170. package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +14 -0
  171. package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +2 -0
  172. package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +24 -0
  173. package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +4 -0
  174. package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +24 -0
  175. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +13 -0
  176. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +172 -0
  177. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +6 -0
  178. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +74 -0
  179. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +4 -0
  180. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +6 -0
  181. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +1 -0
  182. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +32 -0
  183. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +13 -0
  184. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +29 -0
  185. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +9 -0
  186. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +51 -0
  187. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +70 -0
  188. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +101 -0
  189. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +5 -0
  190. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +60 -0
  191. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +6 -0
  192. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +61 -0
  193. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +7 -0
  194. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +60 -0
  195. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +11 -0
  196. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +75 -0
  197. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +6 -0
  198. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +29 -0
  199. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +44 -0
  200. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +1 -0
  201. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +5 -0
  202. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +85 -0
  203. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +6 -0
  204. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +12 -0
  205. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +14 -0
  206. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +51 -0
  207. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +6 -0
  208. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +33 -0
  209. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +5 -0
  210. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +40 -0
  211. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +28 -0
  212. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +146 -0
  213. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +7 -0
  214. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +112 -0
  215. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +18 -0
  216. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +93 -0
  217. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +3 -0
  218. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +27 -0
  219. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +7 -0
  220. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +30 -0
  221. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +2 -0
  222. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +237 -0
  223. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +3 -0
  224. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +31 -0
  225. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +1 -0
  226. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +48 -0
  227. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +1 -0
  228. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +23 -0
  229. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +14 -0
  230. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +111 -0
  231. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +3 -0
  232. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +9 -0
  233. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +18 -0
  234. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +59 -0
  235. package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +126 -0
  236. package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +8 -0
  237. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +6 -0
  238. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +20 -0
  239. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +3 -0
  240. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +41 -0
  241. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +10 -0
  242. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +90 -0
  243. package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +3 -0
  244. package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +128 -0
  245. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +6 -0
  246. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +168 -0
  247. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +4 -0
  248. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +49 -0
  249. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +4 -0
  250. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +91 -0
  251. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  252. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  253. package/packages/omo-codex/plugin/components/rules/src/codex-hook.ts +4 -2
  254. package/packages/omo-codex/plugin/components/rules/src/config.ts +13 -0
  255. package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +17 -0
  256. package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +4 -1
  257. package/packages/omo-codex/plugin/components/rules/src/post-compact-directive.ts +39 -0
  258. package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +16 -0
  259. package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +8 -0
  260. package/packages/omo-codex/plugin/components/rules/src/rules/formatter.ts +7 -8
  261. package/packages/omo-codex/plugin/components/rules/src/rules/truncator.ts +17 -0
  262. package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +4 -0
  263. package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +53 -4
  264. package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +127 -7
  265. package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +9 -1
  266. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +4 -2
  267. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +7 -2
  268. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +9 -9
  269. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +10 -4
  270. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +241 -0
  271. package/packages/omo-codex/plugin/components/rules/test/event-budget.test.ts +168 -0
  272. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +20 -0
  273. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +4 -0
  274. package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +86 -3
  275. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +15 -15
  276. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +16 -0
  277. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +146 -0
  278. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +2 -0
  279. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +49 -0
  280. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +2 -0
  281. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +80 -0
  282. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +1 -0
  283. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +2 -0
  284. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +5 -0
  285. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +3 -0
  286. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +20 -0
  287. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +1 -0
  288. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  289. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  290. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +24 -2
  291. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +1 -0
  292. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +18 -0
  293. package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +2 -0
  294. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +62 -0
  295. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +15 -0
  296. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +42 -0
  297. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +10 -0
  298. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +35 -0
  299. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +12 -0
  300. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +108 -0
  301. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +4 -0
  302. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +31 -0
  303. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +8 -0
  304. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +68 -0
  305. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +21 -0
  306. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +133 -0
  307. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +8 -0
  308. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +29 -0
  309. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  310. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  311. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +5 -13
  312. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +61 -185
  313. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  314. package/packages/omo-codex/plugin/components/ultrawork/directive.md +122 -117
  315. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +2 -0
  316. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +48 -0
  317. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +7 -0
  318. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +122 -0
  319. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +1 -0
  320. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +2 -0
  321. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  322. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  323. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +20 -11
  324. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +17 -11
  325. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +2 -5
  326. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -71
  327. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +16 -0
  328. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +200 -0
  329. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.d.ts +17 -0
  330. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +97 -0
  331. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.d.ts +4 -0
  332. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +183 -0
  333. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +6 -0
  334. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +55 -0
  335. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +12 -0
  336. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +145 -0
  337. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.d.ts +2 -0
  338. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +39 -0
  339. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.d.ts +13 -0
  340. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +100 -0
  341. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +26 -0
  342. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +97 -0
  343. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +28 -0
  344. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +145 -0
  345. package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.d.ts +34 -0
  346. package/packages/omo-codex/plugin/components/ulw-loop/dist/command-types.js +1 -0
  347. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +16 -0
  348. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +41 -0
  349. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +95 -0
  350. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.js +1 -0
  351. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +31 -0
  352. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +119 -0
  353. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +12 -0
  354. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +69 -0
  355. package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.d.ts +16 -0
  356. package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +59 -0
  357. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +48 -0
  358. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +119 -0
  359. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +8 -0
  360. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +89 -0
  361. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +6 -0
  362. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +123 -0
  363. package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.d.ts +16 -0
  364. package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +70 -0
  365. package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.d.ts +10 -0
  366. package/packages/omo-codex/plugin/components/ulw-loop/dist/runtime.js +13 -0
  367. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.d.ts +63 -0
  368. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-types.js +1 -0
  369. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.d.ts +6 -0
  370. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +292 -0
  371. package/packages/omo-codex/plugin/components/ulw-loop/dist/types.d.ts +5 -0
  372. package/packages/omo-codex/plugin/components/ulw-loop/dist/types.js +5 -0
  373. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  374. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  375. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +14 -14
  376. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +24 -25
  377. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +17 -3
  378. package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +2 -1
  379. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -1
  380. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +95 -0
  381. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +0 -96
  382. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +23 -0
  383. package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +46 -0
  384. package/packages/omo-codex/plugin/hooks/hooks.json +16 -16
  385. package/packages/omo-codex/plugin/package-lock.json +10 -9
  386. package/packages/omo-codex/plugin/package.json +27 -26
  387. package/packages/omo-codex/plugin/scripts/auto-update.mjs +64 -15
  388. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +16 -0
  389. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +104 -0
  390. package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +23 -6
  391. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +23 -11
  392. package/packages/omo-codex/plugin/scripts/sync-version.mjs +94 -0
  393. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +9 -9
  394. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
  395. package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +93 -0
  396. package/packages/omo-codex/plugin/skills/lcx-doctor/agents/openai.yaml +11 -0
  397. package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +17 -13
  398. package/packages/omo-codex/plugin/skills/lsp-setup/SKILL.md +139 -0
  399. package/packages/omo-codex/plugin/skills/lsp-setup/references/bash/README.md +60 -0
  400. package/packages/omo-codex/plugin/skills/lsp-setup/references/c-cpp/README.md +61 -0
  401. package/packages/omo-codex/plugin/skills/lsp-setup/references/csharp/README.md +71 -0
  402. package/packages/omo-codex/plugin/skills/lsp-setup/references/dart/README.md +48 -0
  403. package/packages/omo-codex/plugin/skills/lsp-setup/references/elixir/README.md +51 -0
  404. package/packages/omo-codex/plugin/skills/lsp-setup/references/go/README.md +57 -0
  405. package/packages/omo-codex/plugin/skills/lsp-setup/references/haskell/README.md +57 -0
  406. package/packages/omo-codex/plugin/skills/lsp-setup/references/java/README.md +57 -0
  407. package/packages/omo-codex/plugin/skills/lsp-setup/references/julia/README.md +60 -0
  408. package/packages/omo-codex/plugin/skills/lsp-setup/references/kotlin/README.md +59 -0
  409. package/packages/omo-codex/plugin/skills/lsp-setup/references/lua/README.md +66 -0
  410. package/packages/omo-codex/plugin/skills/lsp-setup/references/php/README.md +62 -0
  411. package/packages/omo-codex/plugin/skills/lsp-setup/references/python/README.md +71 -0
  412. package/packages/omo-codex/plugin/skills/lsp-setup/references/ruby/README.md +53 -0
  413. package/packages/omo-codex/plugin/skills/lsp-setup/references/rust/README.md +59 -0
  414. package/packages/omo-codex/plugin/skills/lsp-setup/references/swift/README.md +51 -0
  415. package/packages/omo-codex/plugin/skills/lsp-setup/references/terraform/README.md +62 -0
  416. package/packages/omo-codex/plugin/skills/lsp-setup/references/typescript/README.md +77 -0
  417. package/packages/omo-codex/plugin/skills/lsp-setup/references/yaml/README.md +70 -0
  418. package/packages/omo-codex/plugin/skills/lsp-setup/references/zig/README.md +49 -0
  419. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
  420. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
  421. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/tsconfig.json +17 -0
  422. package/packages/omo-codex/plugin/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
  423. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +9 -9
  424. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +10 -10
  425. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +20 -22
  426. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +38 -61
  427. package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +135 -677
  428. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +14 -14
  429. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +24 -25
  430. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +20 -11
  431. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +17 -11
  432. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +9 -9
  433. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -1
  434. package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +1 -1
  435. package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +5 -5
  436. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +6 -6
  437. package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +194 -0
  438. package/packages/omo-codex/plugin/test/auto-update.test.mjs +17 -0
  439. package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +15 -44
  440. package/packages/omo-codex/plugin/test/lsp-prebuild-layouts.test.mjs +140 -0
  441. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +261 -0
  442. package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +9 -31
  443. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +68 -4
  444. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +119 -0
  445. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +11 -112
  446. package/packages/omo-codex/plugin/test/sync-version.test.mjs +68 -0
  447. package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +126 -0
  448. package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +2 -2
  449. package/packages/omo-codex/scripts/install/bin-dir.mjs +20 -0
  450. package/packages/omo-codex/scripts/install/bin-links.mjs +43 -6
  451. package/packages/omo-codex/scripts/install/cache.mjs +4 -0
  452. package/packages/omo-codex/scripts/install/config.mjs +5 -3
  453. package/packages/omo-codex/scripts/install/delegated-command.mjs +5 -1
  454. package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +28 -0
  455. package/packages/omo-codex/scripts/install/git-bash.mjs +12 -4
  456. package/packages/omo-codex/scripts/install/git-bash.test.mjs +39 -4
  457. package/packages/omo-codex/scripts/install/hook-targets.mjs +46 -0
  458. package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +22 -10
  459. package/packages/omo-codex/scripts/install/process.mjs +1 -0
  460. package/packages/omo-codex/scripts/install-bin-links.test.mjs +131 -3
  461. package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +91 -0
  462. package/packages/omo-codex/scripts/install-config.test.mjs +50 -44
  463. package/packages/omo-codex/scripts/install-delegated-command.test.mjs +78 -0
  464. package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +93 -0
  465. package/packages/omo-codex/scripts/install-hook-targets.test.mjs +100 -0
  466. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +3 -1
  467. package/packages/omo-codex/scripts/install-local.mjs +7 -18
  468. package/packages/omo-codex/scripts/install-local.test.mjs +34 -1
  469. package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +16 -1
  470. package/packages/shared-skills/skills/lcx-doctor/SKILL.md +93 -0
  471. package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +11 -0
  472. package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +17 -13
  473. package/packages/shared-skills/skills/lsp-setup/SKILL.md +139 -0
  474. package/packages/shared-skills/skills/lsp-setup/references/bash/README.md +60 -0
  475. package/packages/shared-skills/skills/lsp-setup/references/c-cpp/README.md +61 -0
  476. package/packages/shared-skills/skills/lsp-setup/references/csharp/README.md +71 -0
  477. package/packages/shared-skills/skills/lsp-setup/references/dart/README.md +48 -0
  478. package/packages/shared-skills/skills/lsp-setup/references/elixir/README.md +51 -0
  479. package/packages/shared-skills/skills/lsp-setup/references/go/README.md +57 -0
  480. package/packages/shared-skills/skills/lsp-setup/references/haskell/README.md +57 -0
  481. package/packages/shared-skills/skills/lsp-setup/references/java/README.md +57 -0
  482. package/packages/shared-skills/skills/lsp-setup/references/julia/README.md +60 -0
  483. package/packages/shared-skills/skills/lsp-setup/references/kotlin/README.md +59 -0
  484. package/packages/shared-skills/skills/lsp-setup/references/lua/README.md +66 -0
  485. package/packages/shared-skills/skills/lsp-setup/references/php/README.md +62 -0
  486. package/packages/shared-skills/skills/lsp-setup/references/python/README.md +71 -0
  487. package/packages/shared-skills/skills/lsp-setup/references/ruby/README.md +53 -0
  488. package/packages/shared-skills/skills/lsp-setup/references/rust/README.md +59 -0
  489. package/packages/shared-skills/skills/lsp-setup/references/swift/README.md +51 -0
  490. package/packages/shared-skills/skills/lsp-setup/references/terraform/README.md +62 -0
  491. package/packages/shared-skills/skills/lsp-setup/references/typescript/README.md +77 -0
  492. package/packages/shared-skills/skills/lsp-setup/references/yaml/README.md +70 -0
  493. package/packages/shared-skills/skills/lsp-setup/references/zig/README.md +49 -0
  494. package/packages/shared-skills/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
  495. package/packages/shared-skills/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
  496. package/packages/shared-skills/skills/lsp-setup/scripts/tsconfig.json +17 -0
  497. package/packages/shared-skills/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
  498. package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +1 -1
  499. package/packages/shared-skills/skills/review-work/SKILL.md +10 -14
  500. package/packages/shared-skills/skills/start-work/SKILL.md +30 -59
  501. package/packages/shared-skills/skills/ultraresearch/SKILL.md +126 -667
  502. package/dist/hooks/anthropic-effort/hook.d.ts +0 -26
  503. package/dist/hooks/anthropic-effort/index.d.ts +0 -1
  504. package/dist/hooks/keyword-detector/analyze/default.d.ts +0 -12
  505. package/dist/hooks/keyword-detector/analyze/index.d.ts +0 -1
  506. package/dist/hooks/keyword-detector/search/default.d.ts +0 -12
  507. package/dist/hooks/keyword-detector/search/index.d.ts +0 -1
  508. package/dist/hooks/thinking-block-validator/hook.d.ts +0 -12
  509. package/dist/hooks/thinking-block-validator/index.d.ts +0 -1
  510. package/packages/omo-codex/plugin/components/ultrawork/test/directive-contract.test.ts +0 -18
  511. package/packages/omo-codex/plugin/test/global-review-debug-gate.test.mjs +0 -29
  512. package/packages/omo-codex/plugin/test/subagent-guidance.test.mjs +0 -151
@@ -0,0 +1,93 @@
1
+ import assert from "node:assert/strict";
2
+ import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { join } from "node:path";
5
+ import test from "node:test";
6
+
7
+ import { stampGitBashMcpEnv } from "./install/git-bash-mcp-env.mjs";
8
+
9
+ const MANIFEST = `${JSON.stringify(
10
+ {
11
+ mcpServers: {
12
+ ast_grep: { command: "node", args: ["../../ast-grep-mcp/dist/cli.js", "mcp"] },
13
+ git_bash: { command: "node", args: ["../../git-bash-mcp/dist/cli.js", "mcp"] },
14
+ },
15
+ },
16
+ null,
17
+ "\t",
18
+ )}\n`;
19
+
20
+ async function createPluginRoot() {
21
+ const pluginRoot = await mkdtemp(join(tmpdir(), "git-bash-mcp-env-"));
22
+ await writeFile(join(pluginRoot, ".mcp.json"), MANIFEST);
23
+ return pluginRoot;
24
+ }
25
+
26
+ test("#given win32 install with OMO_CODEX_GIT_BASH_PATH set #when stamping #then git_bash server env forwards the override", async (t) => {
27
+ const pluginRoot = await createPluginRoot();
28
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
29
+
30
+ const changed = await stampGitBashMcpEnv({
31
+ pluginRoot,
32
+ env: { OMO_CODEX_GIT_BASH_PATH: "D:\\Git\\bin\\bash.exe" },
33
+ platform: "win32",
34
+ });
35
+
36
+ assert.equal(changed, true);
37
+ const parsed = JSON.parse(await readFile(join(pluginRoot, ".mcp.json"), "utf8"));
38
+ assert.deepEqual(parsed.mcpServers.git_bash.env, { OMO_CODEX_GIT_BASH_PATH: "D:\\Git\\bin\\bash.exe" });
39
+ assert.equal(parsed.mcpServers.ast_grep.env, undefined);
40
+ });
41
+
42
+ test("#given the override is unset #when stamping #then the manifest stays byte-identical", async (t) => {
43
+ const pluginRoot = await createPluginRoot();
44
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
45
+
46
+ const changed = await stampGitBashMcpEnv({ pluginRoot, env: {}, platform: "win32" });
47
+
48
+ assert.equal(changed, false);
49
+ assert.equal(await readFile(join(pluginRoot, ".mcp.json"), "utf8"), MANIFEST);
50
+ });
51
+
52
+ test("#given a non-Windows install #when stamping #then the manifest stays byte-identical", async (t) => {
53
+ const pluginRoot = await createPluginRoot();
54
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
55
+
56
+ const changed = await stampGitBashMcpEnv({
57
+ pluginRoot,
58
+ env: { OMO_CODEX_GIT_BASH_PATH: "D:\\Git\\bin\\bash.exe" },
59
+ platform: "darwin",
60
+ });
61
+
62
+ assert.equal(changed, false);
63
+ assert.equal(await readFile(join(pluginRoot, ".mcp.json"), "utf8"), MANIFEST);
64
+ });
65
+
66
+ test("#given the override already stamped #when stamping again #then nothing changes", async (t) => {
67
+ const pluginRoot = await createPluginRoot();
68
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
69
+ const input = { pluginRoot, env: { OMO_CODEX_GIT_BASH_PATH: "D:\\Git\\bin\\bash.exe" }, platform: "win32" };
70
+
71
+ await stampGitBashMcpEnv(input);
72
+ const afterFirst = await readFile(join(pluginRoot, ".mcp.json"), "utf8");
73
+ const changedAgain = await stampGitBashMcpEnv(input);
74
+
75
+ assert.equal(changedAgain, false);
76
+ assert.equal(await readFile(join(pluginRoot, ".mcp.json"), "utf8"), afterFirst);
77
+ });
78
+
79
+ test("#given a manifest without a git_bash server #when stamping #then the manifest stays byte-identical", async (t) => {
80
+ const pluginRoot = await mkdtemp(join(tmpdir(), "git-bash-mcp-env-"));
81
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
82
+ const manifest = `${JSON.stringify({ mcpServers: { ast_grep: { command: "node" } } }, null, "\t")}\n`;
83
+ await writeFile(join(pluginRoot, ".mcp.json"), manifest);
84
+
85
+ const changed = await stampGitBashMcpEnv({
86
+ pluginRoot,
87
+ env: { OMO_CODEX_GIT_BASH_PATH: "D:\\Git\\bin\\bash.exe" },
88
+ platform: "win32",
89
+ });
90
+
91
+ assert.equal(changed, false);
92
+ assert.equal(await readFile(join(pluginRoot, ".mcp.json"), "utf8"), manifest);
93
+ });
@@ -0,0 +1,100 @@
1
+ import assert from "node:assert/strict";
2
+ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import { dirname, join } from "node:path";
5
+ import test from "node:test";
6
+
7
+ import { assertHookCommandTargets, findMissingHookCommandTargets } from "./install/hook-targets.mjs";
8
+
9
+ const HOOKS_MANIFEST = {
10
+ hooks: {
11
+ SessionStart: [
12
+ {
13
+ hooks: [
14
+ {
15
+ type: "command",
16
+ command: 'node "${PLUGIN_ROOT}/components/git-bash/dist/cli.js" hook session-start',
17
+ },
18
+ ],
19
+ },
20
+ {
21
+ matcher: "^startup$",
22
+ hooks: [
23
+ {
24
+ type: "command",
25
+ command: 'node "${PLUGIN_ROOT}/scripts/auto-update.mjs" hook session-start',
26
+ },
27
+ ],
28
+ },
29
+ ],
30
+ Stop: [
31
+ {
32
+ hooks: [
33
+ {
34
+ type: "command",
35
+ command: 'node "${PLUGIN_ROOT}/components/ulw-loop/dist/cli.js" hook stop',
36
+ },
37
+ ],
38
+ },
39
+ ],
40
+ },
41
+ };
42
+
43
+ async function createPluginRoot({ withGitBashDist }) {
44
+ const pluginRoot = await mkdtemp(join(tmpdir(), "hook-targets-"));
45
+ await mkdir(join(pluginRoot, "hooks"), { recursive: true });
46
+ await writeFile(join(pluginRoot, "hooks", "hooks.json"), JSON.stringify(HOOKS_MANIFEST, null, "\t"));
47
+ const targets = [
48
+ "scripts/auto-update.mjs",
49
+ "components/ulw-loop/dist/cli.js",
50
+ ...(withGitBashDist ? ["components/git-bash/dist/cli.js"] : []),
51
+ ];
52
+ for (const target of targets) {
53
+ await mkdir(dirname(join(pluginRoot, target)), { recursive: true });
54
+ await writeFile(join(pluginRoot, target), "");
55
+ }
56
+ return pluginRoot;
57
+ }
58
+
59
+ test("#given a hook command target missing from the payload #when scanning #then exactly that path is reported", async (t) => {
60
+ const pluginRoot = await createPluginRoot({ withGitBashDist: false });
61
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
62
+
63
+ const missing = await findMissingHookCommandTargets(pluginRoot);
64
+
65
+ assert.deepEqual(missing, [join(pluginRoot, "components/git-bash/dist/cli.js")]);
66
+ });
67
+
68
+ test("#given a complete payload #when scanning #then nothing is missing", async (t) => {
69
+ const pluginRoot = await createPluginRoot({ withGitBashDist: true });
70
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
71
+
72
+ assert.deepEqual(await findMissingHookCommandTargets(pluginRoot), []);
73
+ });
74
+
75
+ test("#given no hooks manifest #when scanning #then nothing is missing", async (t) => {
76
+ const pluginRoot = await mkdtemp(join(tmpdir(), "hook-targets-"));
77
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
78
+
79
+ assert.deepEqual(await findMissingHookCommandTargets(pluginRoot), []);
80
+ });
81
+
82
+ test("#given a broken payload #when asserting #then the error names the missing target and the plugin root", async (t) => {
83
+ const pluginRoot = await createPluginRoot({ withGitBashDist: false });
84
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
85
+
86
+ await assert.rejects(
87
+ () => assertHookCommandTargets(pluginRoot),
88
+ (error) =>
89
+ error instanceof Error &&
90
+ error.message.includes("components/git-bash/dist/cli.js") &&
91
+ error.message.includes("hooks.json"),
92
+ );
93
+ });
94
+
95
+ test("#given a complete payload #when asserting #then it resolves", async (t) => {
96
+ const pluginRoot = await createPluginRoot({ withGitBashDist: true });
97
+ t.after(() => rm(pluginRoot, { recursive: true, force: true }));
98
+
99
+ await assertHookCommandTargets(pluginRoot);
100
+ });
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
- import { readFile } from "node:fs/promises";
2
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { join } from "node:path";
4
4
  import test from "node:test";
5
5
 
@@ -53,6 +53,8 @@ test("#given sisyphuslabs lazycodex install #when installing locally #then stamp
53
53
  ],
54
54
  },
55
55
  });
56
+ await mkdir(join(pluginRoot, "components", "comment-checker", "dist"), { recursive: true });
57
+ await writeFile(join(pluginRoot, "components", "comment-checker", "dist", "cli.js"), "console.log('comment checker cli')\n");
56
58
 
57
59
  const result = await installMarketplaceLocally({
58
60
  repoRoot,
@@ -39,17 +39,8 @@ import {
39
39
  } from "./install/lazycodex-version-stamp.mjs";
40
40
  import { shouldBuildSourcePackages } from "./install/source-package-build.mjs";
41
41
  import { runLazyCodexManualUpdate } from "../plugin/scripts/auto-update.mjs";
42
-
43
- export function resolveCodexInstallerBinDir(options = {}) {
44
- const homeDir = resolve(options.homeDir ?? homedir());
45
- const env = options.env ?? process.env;
46
- const explicitBinDir = nonEmptyEnvValue(env, "CODEX_LOCAL_BIN_DIR");
47
- if (explicitBinDir !== undefined) return explicitBinDir;
48
-
49
- const codexHome = resolve(options.codexHome ?? nonEmptyEnvValue(env, "CODEX_HOME") ?? join(homeDir, ".codex"));
50
- const defaultCodexHome = resolve(join(homeDir, ".codex"));
51
- return codexHome === defaultCodexHome ? join(homeDir, ".local", "bin") : join(codexHome, "bin");
52
- }
42
+ export { nonEmptyEnvValue, resolveCodexInstallerBinDir } from "./install/bin-dir.mjs";
43
+ import { nonEmptyEnvValue, resolveCodexInstallerBinDir } from "./install/bin-dir.mjs";
53
44
 
54
45
  export async function installMarketplaceLocally(options = {}) {
55
46
  const repoRoot = resolve(options.repoRoot ?? process.cwd());
@@ -115,6 +106,10 @@ export async function installMarketplaceLocally(options = {}) {
115
106
  if (marketplace.name === "sisyphuslabs" && plugin.name === "omo") {
116
107
  const runtimeLink = await linkRootRuntimeBin({ binDir, codexHome, repoRoot, platform });
117
108
  if (runtimeLink !== null) log(`Linked ${runtimeLink.name} -> ${runtimeLink.target}`);
109
+ else
110
+ log(
111
+ `Warning: skipped the omo runtime wrapper because ${join(repoRoot, "dist", "cli", "index.js")} is missing; omo sparkshell/ulw-loop commands will be unavailable until a package shipping dist/cli is installed`,
112
+ );
118
113
  }
119
114
  pluginSources.push({ name: entry.name, sourcePath });
120
115
  installed.push(plugin);
@@ -161,6 +156,7 @@ export async function installMarketplaceLocally(options = {}) {
161
156
  marketplaceSource: { sourceType: "local", source: marketplaceRoot },
162
157
  pluginNames,
163
158
  platform,
159
+ gitBashEnabled: platform === "win32" && gitBashResolution.found,
164
160
  trustedHookStates,
165
161
  agentConfigs: [...agentConfigs.values()].sort((left, right) => left.name.localeCompare(right.name)),
166
162
  autonomousPermissions: options.autonomousPermissions !== false,
@@ -198,13 +194,6 @@ function agentNameFromToml(fileName) {
198
194
  return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
199
195
  }
200
196
 
201
- function nonEmptyEnvValue(env, key) {
202
- const value = env[key];
203
- if (typeof value !== "string") return undefined;
204
- const trimmed = value.trim();
205
- return trimmed.length === 0 ? undefined : trimmed;
206
- }
207
-
208
197
  function legacyCacheMarketplaces(marketplaceName) {
209
198
  return marketplaceName === "sisyphuslabs" ? ["lazycodex", ["code", "yeongyu", "codex", "plugins"].join("-")] : [];
210
199
  }
@@ -1,5 +1,5 @@
1
1
  import assert from "node:assert/strict";
2
- import { mkdir, readFile, readlink, writeFile } from "node:fs/promises";
2
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import { dirname, join } from "node:path";
5
5
  import test from "node:test";
@@ -66,6 +66,38 @@ test("#given custom CODEX_HOME and PATH without omo #when installing locally wit
66
66
  assert.match(wrapper, /omo-ulw-loop/);
67
67
  });
68
68
 
69
+ test("#given repoRoot without root CLI dist #when installing locally #then warns about the skipped omo runtime wrapper", async () => {
70
+ const repoRoot = await makeTempDir();
71
+ const codexHome = await makeTempDir();
72
+ const homeDir = await makeTempDir();
73
+ const codexPackageRoot = join(repoRoot, "packages", "omo-codex");
74
+ const pluginRoot = join(codexPackageRoot, "plugin");
75
+
76
+ await writeJson(join(codexPackageRoot, "marketplace.json"), {
77
+ name: "sisyphuslabs",
78
+ plugins: [{ name: "omo", source: "./plugins/omo" }],
79
+ });
80
+ await writePluginAt(pluginRoot, "omo", "0.1.0");
81
+
82
+ const logs = [];
83
+ await installMarketplaceLocally({
84
+ repoRoot,
85
+ codexHome,
86
+ env: {},
87
+ homeDir,
88
+ platform: "linux",
89
+ runCommand: async () => {},
90
+ log: (line) => logs.push(String(line)),
91
+ });
92
+
93
+ const cliPath = join(repoRoot, "dist", "cli", "index.js");
94
+ assert.ok(
95
+ logs.some((line) => line.includes("omo runtime wrapper") && line.includes(cliPath)),
96
+ `expected a warning naming the missing ${cliPath}; got:\n${logs.join("\n")}`,
97
+ );
98
+ await assert.rejects(readFile(join(codexHome, "bin", "omo"), "utf8"));
99
+ });
100
+
69
101
  test("#given explicit CODEX_LOCAL_BIN_DIR #when resolving local installer bin dir #then preserves installed omo precedence", () => {
70
102
  const homeDir = join(tmpdir(), "omo-codex-home-explicit");
71
103
  const codexHome = join(tmpdir(), "omo-codex-install-explicit");
@@ -121,6 +153,7 @@ test("#given plugin hooks #when installing #then records trusted hook hashes", a
121
153
  });
122
154
  const pluginRoot = join(codexPackageRoot, "plugin");
123
155
  await writePluginAt(pluginRoot, "alpha", "1.2.3");
156
+ await writeFile(join(pluginRoot, "dist", "cli.js"), "console.log('plugin cli')\n");
124
157
  await writeJson(join(pluginRoot, "hooks", "hooks.json"), {
125
158
  hooks: {
126
159
  UserPromptSubmit: [
@@ -30,7 +30,22 @@ Create a PR that includes:
30
30
 
31
31
  1. Read the user's bug report and identify the affected surface.
32
32
  2. Invoke `$omo:debugging` for the investigation. If only unqualified skill names are exposed, invoke `$debugging` and state that it is the OMO debugging skill.
33
- 3. Decide the target repository. If ownership is close, compare against upstream Codex source under `/tmp/openai-codex-source` before choosing.
33
+ 3. Materialize the latest sources, then decide the target repository. Sync both checkouts on every run and compare them before choosing a stale checkout routes the fix to the wrong repo:
34
+
35
+ ```bash
36
+ sync_latest_source() {
37
+ REPO="$1"; DEST="$2"
38
+ if [ ! -d "$DEST/.git" ]; then
39
+ gh repo clone "$REPO" "$DEST" -- --depth=1 \
40
+ || git clone --depth=1 "https://github.com/$REPO" "$DEST"
41
+ fi
42
+ DEFAULT_BRANCH="$(git -C "$DEST" remote show origin | sed -n '/HEAD branch/s/.*: //p')"
43
+ git -C "$DEST" fetch --depth=1 origin "$DEFAULT_BRANCH"
44
+ git -C "$DEST" checkout -B "$DEFAULT_BRANCH" FETCH_HEAD
45
+ }
46
+ sync_latest_source code-yeongyu/lazycodex /tmp/lazycodex-source
47
+ sync_latest_source openai/codex /tmp/openai-codex-source
48
+ ```
34
49
  4. Create a fresh temporary clone and branch. Do not modify the user's current repository for the target fix unless the current repository is itself the requested target and the user explicitly asked for local edits.
35
50
 
36
51
  ```bash
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: lcx-doctor
3
+ description: "Diagnose LazyCodex and Codex CLI installation health against the latest sources. Use whenever the user asks for a doctor or health check, says LazyCodex, lazycodex-ai, omo-codex, or Codex behaves oddly after an install, update, or config change, suspects a stale, drifted, or broken setup, or wants the local install audited and compared with the latest LazyCodex and Codex code."
4
+ metadata:
5
+ short-description: Diagnose LazyCodex/Codex install health against latest sources
6
+ ---
7
+
8
+ # lcx-doctor
9
+
10
+ You are a LazyCodex install doctor. Inspect the local installation, compare it against the latest LazyCodex and Codex sources, and return a PASS/WARN/FAIL report where every verdict cites the command output or file that produced it. Diagnose only: the only writes you make are under `/tmp`. Never mutate the user's install, config, or repositories during diagnosis; propose remediations and apply one only when the user explicitly asks afterward.
11
+
12
+ Use GPT-5.5 style: outcome first, concise, evidence-bound.
13
+
14
+ ## Required Workflow
15
+
16
+ 1. Materialize the latest sources under `/tmp` first. Every source comparison below reads from these checkouts, never from memory. Re-sync on every run so a cached checkout cannot go stale:
17
+
18
+ ```bash
19
+ sync_latest_source() {
20
+ REPO="$1"; DEST="$2"
21
+ if [ ! -d "$DEST/.git" ]; then
22
+ gh repo clone "$REPO" "$DEST" -- --depth=1 \
23
+ || git clone --depth=1 "https://github.com/$REPO" "$DEST"
24
+ fi
25
+ DEFAULT_BRANCH="$(git -C "$DEST" remote show origin | sed -n '/HEAD branch/s/.*: //p')"
26
+ git -C "$DEST" fetch --depth=1 origin "$DEFAULT_BRANCH"
27
+ git -C "$DEST" checkout -B "$DEFAULT_BRANCH" FETCH_HEAD
28
+ }
29
+ sync_latest_source code-yeongyu/lazycodex /tmp/lazycodex-source
30
+ sync_latest_source openai/codex /tmp/openai-codex-source
31
+ ```
32
+
33
+ 2. Inventory the installed surface. Resolve `CODEX_HOME` (default `~/.codex`), then collect:
34
+ - `codex --version` and how `codex` resolves (`command -v codex`).
35
+ - Installed LazyCodex version: the `version` in the installed plugin manifest, discoverable with `find "${CODEX_HOME:-$HOME/.codex}/plugins" -path '*/.codex-plugin/plugin.json'`. Installed plugins live under `$CODEX_HOME/plugins/cache/<marketplace>/<name>/<version>/`.
36
+ - Latest LazyCodex version from `/tmp/lazycodex-source` (release tags or the version stamped in the repo) and latest Codex release (`gh release view --repo openai/codex`).
37
+ - OS, install method, and `lazycodex` / `lazycodex-ai` bin links resolving (`command -v`).
38
+ 3. Check config and wiring against the latest installer, not against assumptions. Read what the current installer under `/tmp/lazycodex-source` writes (installer sources live in the omo-codex package, e.g. `scripts/install/`), then verify the local equivalents:
39
+ - `$CODEX_HOME/config.toml` exists and parses; LazyCodex-managed entries match what the latest installer would write.
40
+ - Plugin payload present and non-empty: `hooks/hooks.json`, `skills/`, `.mcp.json`, components under the installed plugin root.
41
+ - Stale project-local leftovers the installer now removes (e.g. `.codex/hooks.json`, `.codex/skills` in the project) are flagged, not deleted.
42
+ 4. Probe the real surface. Run the built-in diagnostics first: `lazycodex doctor --json` (add `--verbose` when a check needs deeper traces) and fold its results into the report. A missing or crashing `lazycodex doctor` is itself a FAIL finding, not a reason to skip probing — fall back to `codex --version` plus a trivial non-interactive invocation that loads the plugin. Capture stderr verbatim; a clean exit with warnings is WARN, not PASS.
43
+ 5. Compare for drift. Where installed bundled files differ from the same files at the installed version, or the latest source renamed or removed something the local config still references, record it with both paths.
44
+ 6. Check whether each FAIL is already known: `gh issue list --repo code-yeongyu/lazycodex --search "<short symptom>" --state open` (and `openai/codex` when the failure points upstream). Link matches in the report instead of re-diagnosing from scratch.
45
+ 7. If a probe fails and the cause is not explained by config or source comparison, invoke `$omo:debugging` for the investigation. If Codex exposes only unqualified skill names in the current session, invoke `$debugging` and state that it is the OMO debugging skill.
46
+ 8. Emit the report.
47
+
48
+ ## Doctor Report Template
49
+
50
+ ```markdown
51
+ ## LazyCodex Doctor Report
52
+
53
+ ### Summary
54
+ [One sentence: healthy, degraded, or broken — and the single most important next action.]
55
+
56
+ ### Environment
57
+ - LazyCodex installed / latest:
58
+ - Codex CLI installed / latest:
59
+ - CODEX_HOME:
60
+ - OS / install method:
61
+
62
+ ### Checks
63
+ | Check | Verdict | Evidence |
64
+ | --- | --- | --- |
65
+ | Versions current | PASS/WARN/FAIL | [command output or file:line] |
66
+ | config.toml integrity | PASS/WARN/FAIL | [evidence] |
67
+ | Plugin payload wiring | PASS/WARN/FAIL | [evidence] |
68
+ | Bin links / aliases | PASS/WARN/FAIL | [evidence] |
69
+ | Runtime probe | PASS/WARN/FAIL | [evidence] |
70
+ | Drift vs latest source | PASS/WARN/FAIL | [evidence, citing /tmp/lazycodex-source or /tmp/openai-codex-source paths] |
71
+
72
+ ### Remediations
73
+ 1. [Most important fix first: exact command or config edit, and what it resolves.]
74
+
75
+ ### Known Issues Matched
76
+ - [issue URL — or "none found"]
77
+ ```
78
+
79
+ ## Follow-up Routing
80
+
81
+ - Local misconfiguration or stale install: give the remediation; reinstalling via the standard LazyCodex install command is the default fix for payload drift.
82
+ - Defect in LazyCodex or Codex product code: recommend `$lcx-report-bug` to file it, or `$lcx-contribute-bug-fix` when the user wants a fix PR. Both reuse the `/tmp` checkouts you already synced.
83
+
84
+ ## Stop Conditions
85
+
86
+ Ask one narrow question only when a finding requires a destructive decision, such as deleting user-edited config or downgrading a version.
87
+
88
+ Do not:
89
+
90
+ - mutate config, installs, or repositories during diagnosis
91
+ - report a verdict without captured evidence
92
+ - compare against remembered source layout instead of `/tmp/lazycodex-source` and `/tmp/openai-codex-source`
93
+ - declare healthy while any probe output was never captured
@@ -0,0 +1,11 @@
1
+ interface:
2
+ display_name: "lcx-doctor (omo)"
3
+ short_description: "Diagnose LazyCodex/Codex install health against latest sources"
4
+ search_terms:
5
+ - "lcx-doctor"
6
+ - "lazycodex doctor"
7
+ - "lazycodex health check"
8
+ - "codex doctor"
9
+ - "lazycodex install broken"
10
+ - "omo-codex diagnose"
11
+ default_prompt: "Use $lcx-doctor to sync the latest LazyCodex and Codex sources into /tmp, inventory the local installation, compare versions, config, and wiring against the latest sources, probe the real surface, and report PASS/WARN/FAIL findings with evidence and remediations."
@@ -33,24 +33,28 @@ Create or prepare a GitHub issue or PR that includes:
33
33
 
34
34
  1. Read the user's bug report and identify the affected surface: LazyCodex installer, Codex plugin, skill, hook, MCP, CLI alias, GitHub marketplace sync, or web/docs.
35
35
  2. Invoke `$omo:debugging` for the investigation. If Codex exposes only unqualified skill names in the current session, invoke `$debugging` and state that it is the OMO debugging skill.
36
- 3. Materialize upstream Codex source under `/tmp` before deciding ownership:
36
+ 3. Materialize the latest LazyCodex and upstream Codex sources under `/tmp` before deciding ownership. Re-sync on every run so a cached checkout cannot go stale — stale source produces wrong routing and dead line references:
37
37
 
38
38
  ```bash
39
- CODEX_SRC="/tmp/openai-codex-source"
40
- if [ ! -d "$CODEX_SRC/.git" ]; then
41
- gh repo clone openai/codex "$CODEX_SRC" -- --depth=1
42
- else
43
- git -C "$CODEX_SRC" fetch --depth=1 origin
44
- fi
39
+ sync_latest_source() {
40
+ REPO="$1"; DEST="$2"
41
+ if [ ! -d "$DEST/.git" ]; then
42
+ gh repo clone "$REPO" "$DEST" -- --depth=1 \
43
+ || git clone --depth=1 "https://github.com/$REPO" "$DEST"
44
+ fi
45
+ DEFAULT_BRANCH="$(git -C "$DEST" remote show origin | sed -n '/HEAD branch/s/.*: //p')"
46
+ git -C "$DEST" fetch --depth=1 origin "$DEFAULT_BRANCH"
47
+ git -C "$DEST" checkout -B "$DEFAULT_BRANCH" FETCH_HEAD
48
+ }
49
+ sync_latest_source code-yeongyu/lazycodex /tmp/lazycodex-source
50
+ sync_latest_source openai/codex /tmp/openai-codex-source
45
51
  ```
46
-
47
- If `gh` is unavailable, use `git clone --depth=1 https://github.com/openai/codex "$CODEX_SRC"`.
48
52
  4. Follow the debugging skill far enough to gather runtime evidence:
49
53
  - form at least three plausible hypotheses
50
54
  - run the smallest reproduction that exercises the real surface
51
55
  - confirm the root cause by observing the failing state
52
56
  - identify the minimal fix path or maintainer action
53
- 5. Compare local LazyCodex evidence with `/tmp/openai-codex-source` before choosing the target repo. Cite exact files, commands, logs, or source paths that support the routing decision.
57
+ 5. Compare runtime evidence with both `/tmp/lazycodex-source` and `/tmp/openai-codex-source` before choosing the target repo. Cite exact files, commands, logs, or source paths that support the routing decision.
54
58
  6. Choose the target repo:
55
59
  - Use `code-yeongyu/lazycodex` when the bug is in LazyCodex integration, distribution, bundled plugin code, skills, hooks, MCP wiring, installer behavior, aliases, marketplace sync, docs, or any behavior that disappears in clean upstream Codex.
56
60
  - Use `openai/codex` when the bug reproduces in clean upstream Codex without LazyCodex, or the failing behavior comes from Codex CLI core, plugin API contracts, sandboxing, approvals, config loading, or built-in tool behavior.
@@ -106,7 +110,7 @@ Write the issue body in English and keep it direct:
106
110
  ## Repository Decision
107
111
  - Target repository:
108
112
  - Why this belongs there:
109
- - LazyCodex evidence:
113
+ - LazyCodex evidence (runtime + `/tmp/lazycodex-source`):
110
114
  - Upstream Codex source evidence from `/tmp/openai-codex-source`:
111
115
 
112
116
  ## Reproduction
@@ -150,7 +154,7 @@ Use this when a PR is the right artifact:
150
154
  ## Repository Decision
151
155
  - Target repository:
152
156
  - Why this belongs there:
153
- - LazyCodex evidence:
157
+ - LazyCodex evidence (runtime + `/tmp/lazycodex-source`):
154
158
  - Upstream Codex source evidence from `/tmp/openai-codex-source`:
155
159
 
156
160
  ## Root Cause
@@ -227,6 +231,6 @@ Do not file:
227
231
  - a vague issue without reproduction steps
228
232
  - an issue that claims a root cause not supported by runtime evidence
229
233
  - a duplicate when commenting on an existing issue is enough
230
- - an upstream Codex issue without checking `/tmp/openai-codex-source`
234
+ - an issue without checking the latest `/tmp/lazycodex-source` and `/tmp/openai-codex-source` checkouts
231
235
  - a LazyCodex issue when the bug is proven to reproduce in clean upstream Codex
232
236
  - a fix PR without a concrete branch, implemented fix, and verification result
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: lsp-setup
3
+ description: "Configure a Language Server (LSP) for a specific language so editor/agent tooling — diagnostics, go-to-definition, find-references, rename — works. Use when you need to: configure LSP, lsp setup, set up or install a language server, fix 'no LSP server configured' / 'server not installed', choose between servers (basedpyright vs pyright vs ty vs ruff), or wire .codex/lsp-client.json / .opencode/lsp.json. 언어서버 설정. Routes by file extension to references/<language>/README.md for the exact builtin server, per-OS install commands (macOS/Linux/Windows), config snippets for both config files, initialization options, alternatives, and troubleshooting. Ships scripts: detect-lsp.ts (scan a project for languages + each server's install/config status) and verify-lsp.ts (run a real diagnostics roundtrip). Covers typescript, python, go, rust, c/c++, java, kotlin, c#/razor, swift, ruby, php, dart, elixir, zig, lua, bash, yaml, terraform, haskell, julia."
4
+ ---
5
+
6
+ # LSP Setup
7
+
8
+ Configure the right Language Server for a project so the `lsp` MCP tools
9
+ (`diagnostics`, `goto_definition`, `find_references`, `symbols`, `rename`)
10
+ actually work. This skill is an index: detect what a project needs, install the
11
+ server, write the config, then verify with a real roundtrip.
12
+
13
+ The list of servers we ship as **builtin** is the source of truth in
14
+ `packages/lsp-tools-mcp/src/lsp/server-definitions.ts` (`BUILTIN_SERVERS` +
15
+ `LSP_INSTALL_HINTS`). The per-language references below mirror it.
16
+
17
+ ---
18
+
19
+ ## PHASE 0 — LANGUAGE GATE (run first)
20
+
21
+ Identify the language from the file extension, then **read the matching
22
+ reference before installing or configuring anything**.
23
+
24
+ | Extension(s) | Reference |
25
+ |---|---|
26
+ | `.ts .tsx .js .jsx .mjs .cjs .mts .cts .vue .svelte .astro` | `references/typescript/README.md` |
27
+ | `.py .pyi` | `references/python/README.md` |
28
+ | `.go` | `references/go/README.md` |
29
+ | `.rs` | `references/rust/README.md` |
30
+ | `.c .cpp .cc .cxx .h .hpp .hh .hxx` | `references/c-cpp/README.md` |
31
+ | `.java` | `references/java/README.md` |
32
+ | `.kt .kts` | `references/kotlin/README.md` |
33
+ | `.cs .razor .cshtml` | `references/csharp/README.md` |
34
+ | `.swift` | `references/swift/README.md` |
35
+ | `.rb .rake .gemspec .ru` | `references/ruby/README.md` |
36
+ | `.php` | `references/php/README.md` |
37
+ | `.dart` | `references/dart/README.md` |
38
+ | `.ex .exs` | `references/elixir/README.md` |
39
+ | `.zig .zon` | `references/zig/README.md` |
40
+ | `.lua` | `references/lua/README.md` |
41
+ | `.sh .bash .zsh .ksh` | `references/bash/README.md` |
42
+ | `.yaml .yml` | `references/yaml/README.md` |
43
+ | `.tf .tfvars` | `references/terraform/README.md` |
44
+ | `.hs .lhs` | `references/haskell/README.md` |
45
+ | `.jl` | `references/julia/README.md` |
46
+
47
+ ---
48
+
49
+ ## WORKFLOW — detect → install → configure → verify
50
+
51
+ ### 1. Detect
52
+
53
+ Scan the project to see which languages are present and whether each server is
54
+ installed and configured:
55
+
56
+ ```bash
57
+ bun scripts/detect-lsp.ts <projectDir> # human report (default: cwd)
58
+ bun scripts/detect-lsp.ts <projectDir> --json
59
+ ```
60
+
61
+ For each detected language it prints the builtin server id, the executable it
62
+ needs on `PATH`, whether that executable is installed, an install hint, and
63
+ whether a project config file already references it.
64
+
65
+ ### 2. Install
66
+
67
+ Open `references/<language>/README.md` and run the install command for your OS.
68
+ Then confirm the executable resolves:
69
+
70
+ ```bash
71
+ command -v <server-executable> # e.g. typescript-language-server, gopls, rust-analyzer
72
+ ```
73
+
74
+ ### 3. Configure
75
+
76
+ Most builtin servers need **no config** — they are resolved automatically by
77
+ file extension. Write config only to: pick between competing servers, set a
78
+ `priority`, pass `initialization` options, override `extensions`, set `env`, or
79
+ `disable` a server.
80
+
81
+ Two project-scoped config files, **identical JSON shape**:
82
+
83
+ - Codex harness → `.codex/lsp-client.json` (user: `~/.codex/lsp-client.json`)
84
+ - OpenCode/omo harness → `.opencode/lsp.json` (also `.omo/lsp.json`)
85
+
86
+ ```jsonc
87
+ {
88
+ "lsp": {
89
+ "<server-id>": {
90
+ "command": ["<bin>", "<args>"], // optional for builtin ids (supplied automatically)
91
+ "extensions": [".ext"], // optional override
92
+ "priority": 100, // higher wins when several servers match an extension
93
+ "initialization": { }, // server-specific initializationOptions
94
+ "env": { "KEY": "value" }, // optional
95
+ "disabled": false // set true to turn a server off
96
+ }
97
+ }
98
+ }
99
+ ```
100
+
101
+ Rules enforced by `config-loader.ts`:
102
+
103
+ - In a **project** config (`.codex/lsp-client.json`, `.opencode/lsp.json`) an
104
+ entry whose id is a **builtin** server inherits `command` automatically — you
105
+ only override `extensions` / `priority` / `initialization`. A non-builtin id
106
+ in a project config is **ignored**.
107
+ - To define a **fully custom** (non-builtin) server with its own `command`, put
108
+ it in the **user** config (`~/.codex/lsp-client.json`, or the path set by
109
+ `LSP_TOOLS_MCP_USER_CONFIG`), where `command` + `extensions` are honored.
110
+ - Project entries win over user entries; both win over builtin defaults.
111
+
112
+ Each language reference gives a ready-to-paste snippet.
113
+
114
+ ### 4. Verify
115
+
116
+ Run a real diagnostics roundtrip against a source file. This spawns the server,
117
+ opens the file, requests diagnostics, and reports `OK`/`FAIL`:
118
+
119
+ ```bash
120
+ bun scripts/verify-lsp.ts <path/to/file.ext>
121
+ bun scripts/verify-lsp.ts <file> --timeout=90000
122
+ ```
123
+
124
+ `OK` = the server started and answered. `FAIL: language server not installed`
125
+ = go back to step 2. Other `FAIL` text carries the server/startup error.
126
+ `SKIP` = the engine source could not be located; run from inside the omo
127
+ repo/worktree, or call the `lsp` MCP `diagnostics` tool directly.
128
+
129
+ ---
130
+
131
+ ## Scripts
132
+
133
+ | Script | Purpose |
134
+ |---|---|
135
+ | `scripts/detect-lsp.ts` | Scan a directory; per detected language report server id, install status, install hint, config status. `--json` for machine output. |
136
+ | `scripts/verify-lsp.ts` | Real LSP diagnostics roundtrip for one file via the `lsp-tools-mcp` engine; `OK`/`FAIL`/`SKIP` + exit code 0/1/3. |
137
+ | `scripts/lsp-server-table.ts` | Embedded snapshot of the primary builtin server per language (mirrors `server-definitions.ts`). |
138
+
139
+ Run with [Bun](https://bun.sh): `curl -fsSL https://bun.sh/install | bash`.