oh-my-opencode 4.18.2 → 4.19.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 (307) hide show
  1. package/.agents/command/omomomo.md +1 -1
  2. package/.agents/skills/omomomo/SKILL.md +1 -1
  3. package/.opencode/command/omomomo.md +1 -1
  4. package/README.ja.md +6 -6
  5. package/README.ko.md +6 -6
  6. package/README.md +8 -8
  7. package/README.ru.md +6 -6
  8. package/README.zh-cn.md +6 -6
  9. package/dist/agents/atlas/agent.d.ts +7 -6
  10. package/dist/agents/gpt-prompt-identity.d.ts +3 -0
  11. package/dist/agents/sisyphus/gpt-5-5.d.ts +1 -1
  12. package/dist/agents/sisyphus/gpt-task-system-guide.d.ts +1 -0
  13. package/dist/agents/sisyphus/index.d.ts +5 -0
  14. package/dist/agents/sisyphus/kimi-k3.d.ts +19 -0
  15. package/dist/agents/sisyphus-agent-factory.d.ts +1 -1
  16. package/dist/agents/sisyphus-junior/agent.d.ts +8 -4
  17. package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +2 -2
  18. package/dist/agents/sisyphus-junior/index.d.ts +2 -0
  19. package/dist/agents/sisyphus-junior/kimi-k3.d.ts +12 -0
  20. package/dist/agents/types.d.ts +2 -2
  21. package/dist/cli/index.js +781 -215
  22. package/dist/cli-node/index.js +781 -215
  23. package/dist/config/index.d.ts +1 -1
  24. package/dist/config/schema/agent-overrides.d.ts +48 -48
  25. package/dist/config/schema/browser-automation.d.ts +1 -0
  26. package/dist/config/schema/categories.d.ts +6 -6
  27. package/dist/config/schema/codegraph.d.ts +2 -0
  28. package/dist/config/schema/commands.d.ts +1 -3
  29. package/dist/config/schema/default-mode.d.ts +1 -1
  30. package/dist/config/schema/fallback-models.d.ts +5 -5
  31. package/dist/config/schema/goal.d.ts +7 -0
  32. package/dist/config/schema/hooks.d.ts +1 -1
  33. package/dist/config/schema/oh-my-opencode-config.d.ts +56 -58
  34. package/dist/config/schema/ralph-loop.d.ts +1 -1
  35. package/dist/config/schema.d.ts +1 -1
  36. package/dist/create-hooks.d.ts +1 -1
  37. package/dist/features/builtin-commands/templates/goal.d.ts +1 -0
  38. package/dist/features/builtin-commands/templates/stop-continuation.d.ts +1 -1
  39. package/dist/features/builtin-commands/types.d.ts +1 -1
  40. package/dist/hooks/auto-slash-command/executor.d.ts +1 -0
  41. package/dist/hooks/codegraph-bootstrap/hook.d.ts +3 -2
  42. package/dist/hooks/goal/command-arguments.d.ts +13 -0
  43. package/dist/hooks/goal/controller.d.ts +26 -0
  44. package/dist/hooks/goal/index.d.ts +23 -0
  45. package/dist/hooks/goal/prompt.d.ts +3 -0
  46. package/dist/hooks/goal/store.d.ts +8 -0
  47. package/dist/hooks/goal/tools.d.ts +10 -0
  48. package/dist/hooks/goal/types.d.ts +93 -0
  49. package/dist/hooks/goal/validation.d.ts +4 -0
  50. package/dist/hooks/index.d.ts +1 -0
  51. package/dist/hooks/keyword-detector/hook.d.ts +1 -2
  52. package/dist/hooks/ralph-loop/types.d.ts +1 -1
  53. package/dist/hooks/sisyphus-junior-notepad/constants.d.ts +1 -1
  54. package/dist/hooks/start-work/notepad-scaffold.d.ts +10 -0
  55. package/dist/index.js +5398 -5109
  56. package/dist/oh-my-opencode.schema.json +34 -19
  57. package/dist/plugin/chat-message/loop-commands.d.ts +1 -1
  58. package/dist/plugin/chat-message/types.d.ts +23 -10
  59. package/dist/plugin/hooks/create-core-hooks.d.ts +1 -1
  60. package/dist/plugin/hooks/create-session-hooks.d.ts +3 -2
  61. package/dist/plugin/hooks/create-transform-hooks.d.ts +0 -2
  62. package/dist/plugin/stop-continuation.d.ts +2 -2
  63. package/dist/shared/omo-process-sweep.d.ts +18 -0
  64. package/dist/shared/system-directive.d.ts +0 -1
  65. package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
  66. package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
  67. package/dist/skills/ulw-plan/SKILL.md +31 -8
  68. package/dist/skills/ulw-plan/references/full-workflow.md +117 -6
  69. package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
  70. package/dist/skills/ulw-research/SKILL.md +3 -3
  71. package/dist/testing/create-plugin-module.d.ts +1 -0
  72. package/dist/tools/delegate-task/types.d.ts +0 -1
  73. package/dist/tui.js +138 -80
  74. package/package.json +14 -14
  75. package/packages/git-bash-mcp/dist/cli.js +54 -8
  76. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +60 -0
  77. package/packages/lsp-core/src/lsp/client.ts +14 -1
  78. package/packages/lsp-core/src/lsp/fixtures/diagnostics-freshness-contract-probe.ts +2 -2
  79. package/packages/lsp-core/src/mcp.ts +9 -0
  80. package/packages/lsp-daemon/dist/cli.js +319 -51
  81. package/packages/lsp-daemon/dist/client.js +136 -48
  82. package/packages/lsp-daemon/dist/daemon-client.d.ts +0 -10
  83. package/packages/lsp-daemon/dist/daemon-client.js +4 -34
  84. package/packages/lsp-daemon/dist/daemon-failure-result.d.ts +3 -0
  85. package/packages/lsp-daemon/dist/daemon-failure-result.js +38 -0
  86. package/packages/lsp-daemon/dist/daemon-request-error.d.ts +14 -0
  87. package/packages/lsp-daemon/dist/daemon-request-error.js +26 -0
  88. package/packages/lsp-daemon/dist/daemon-server.js +5 -1
  89. package/packages/lsp-daemon/dist/index.js +137 -48
  90. package/packages/lsp-daemon/dist/proxy.d.ts +2 -0
  91. package/packages/lsp-daemon/dist/proxy.js +1 -0
  92. package/packages/lsp-daemon/dist/version-reap.d.ts +26 -0
  93. package/packages/lsp-daemon/dist/version-reap.js +182 -0
  94. package/packages/lsp-tools-mcp/dist/cli.js +61 -10
  95. package/packages/lsp-tools-mcp/dist/lsp/manager.js +6 -1
  96. package/packages/lsp-tools-mcp/dist/mcp.js +61 -10
  97. package/packages/lsp-tools-mcp/dist/tools.js +6 -1
  98. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  99. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +416 -25
  100. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  101. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  102. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +22 -2
  103. package/packages/omo-codex/plugin/components/codegraph/AGENTS.md +7 -6
  104. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +638 -267
  105. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +178 -89
  106. package/packages/omo-codex/plugin/components/codegraph/package.json +2 -2
  107. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +3 -1
  108. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +3 -1
  109. package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +98 -32
  110. package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +5 -0
  111. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +15 -6
  112. package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +6 -2
  113. package/packages/omo-codex/plugin/components/codegraph/src/sweep-cli.ts +1 -0
  114. package/packages/omo-codex/plugin/components/codegraph/test/hook-exclusion.test.ts +1 -1
  115. package/packages/omo-codex/plugin/components/codegraph/test/hook-store-upgrade.test.ts +148 -0
  116. package/packages/omo-codex/plugin/components/codegraph/test/mcp-bridge-fixtures.ts +31 -2
  117. package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +1 -1
  118. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge-lifecycle.test.ts +65 -1
  119. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +3 -7
  120. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +1 -1
  121. package/packages/omo-codex/plugin/components/codegraph/test/serve-provision.test.ts +57 -3
  122. package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +41 -0
  123. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +109 -8
  124. package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +2 -2
  125. package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +43 -0
  126. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  127. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  128. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  129. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  130. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  131. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  132. package/packages/omo-codex/plugin/components/lsp/AGENTS.md +1 -0
  133. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  134. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +80 -40
  135. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  136. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  137. package/packages/omo-codex/plugin/components/rules/dist/cli.js +11 -0
  138. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  139. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  140. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +11 -0
  141. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +60 -0
  142. package/packages/omo-codex/plugin/components/start-work-continuation/AGENTS.md +8 -0
  143. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +147 -60
  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/start-work-continuation/src/boulder-reader.ts +3 -71
  147. package/packages/omo-codex/plugin/components/start-work-continuation/src/plan-checklist.ts +171 -0
  148. package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +198 -23
  149. package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +4 -3
  150. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +6 -5
  151. package/packages/omo-codex/plugin/components/start-work-continuation/test/fixtures/plan-scaffold.md +15 -0
  152. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  153. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  154. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  155. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  156. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +10 -10
  157. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +2 -2
  158. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +2 -2
  159. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +1 -1
  160. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +1 -1
  161. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +2 -2
  162. package/packages/omo-codex/plugin/components/ultrawork/agents/momus.toml +3 -3
  163. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  164. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +1 -1
  165. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  166. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  167. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +31 -8
  168. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +117 -6
  169. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
  170. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +1 -1
  171. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +42 -0
  172. package/packages/omo-codex/plugin/components/ulw-loop/README.md +6 -4
  173. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.d.ts +21 -0
  174. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +64 -0
  175. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +15 -2
  176. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-arg-parser.js +1 -1
  177. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +2 -1
  178. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
  179. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +3 -3
  180. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.d.ts +3 -0
  181. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +85 -0
  182. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +0 -1
  183. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +13 -33
  184. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +998 -593
  185. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +1 -0
  186. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.d.ts +1 -1
  187. package/packages/omo-codex/plugin/components/ulw-loop/dist/constants.js +2 -0
  188. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +6 -0
  189. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +1 -0
  190. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +3 -0
  191. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +1 -0
  192. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +4 -0
  193. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.d.ts +1 -0
  194. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +10 -2
  195. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +1 -1
  196. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.d.ts +15 -0
  197. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-batch.js +84 -0
  198. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.d.ts +5 -0
  199. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering-mutations.js +81 -0
  200. package/packages/omo-codex/plugin/components/ulw-loop/dist/steering.js +7 -59
  201. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +12 -4
  202. package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.d.ts +9 -0
  203. package/packages/omo-codex/plugin/components/ulw-loop/dist/validation-batch.js +122 -0
  204. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  205. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  206. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +8 -6
  207. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +84 -0
  208. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +13 -2
  209. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-arg-parser.ts +1 -1
  210. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +1 -1
  211. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +3 -3
  212. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +49 -0
  213. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +13 -45
  214. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +1 -0
  215. package/packages/omo-codex/plugin/components/ulw-loop/src/constants.ts +2 -0
  216. package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +7 -0
  217. package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +4 -0
  218. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +4 -1
  219. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +20 -2
  220. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +1 -1
  221. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-batch.ts +125 -0
  222. package/packages/omo-codex/plugin/components/ulw-loop/src/steering-mutations.ts +59 -0
  223. package/packages/omo-codex/plugin/components/ulw-loop/src/steering.ts +6 -58
  224. package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +12 -4
  225. package/packages/omo-codex/plugin/components/ulw-loop/src/validation-batch.ts +122 -0
  226. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +76 -0
  227. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint-continuation.test.ts +111 -0
  228. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-batch.test.ts +67 -0
  229. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-validation-batch.test.ts +57 -0
  230. package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +1 -0
  231. package/packages/omo-codex/plugin/components/ulw-loop/test/steering-batch.test.ts +152 -0
  232. package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +29 -0
  233. package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch-checkpoint.test.ts +147 -0
  234. package/packages/omo-codex/plugin/components/ulw-loop/test/validation-batch.test.ts +73 -0
  235. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  236. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  237. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  238. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  239. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  240. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  241. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  242. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  243. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  244. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  245. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  246. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +2 -2
  247. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  248. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +2 -2
  249. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  250. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +2 -2
  251. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  252. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  253. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  254. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  255. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  256. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  257. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  258. package/packages/omo-codex/plugin/package-lock.json +41 -41
  259. package/packages/omo-codex/plugin/package.json +1 -1
  260. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +32 -28
  261. package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +17 -45
  262. package/packages/omo-codex/plugin/scripts/migrate-codex-config/toml-section-editor.mjs +455 -0
  263. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +3 -18
  264. package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +43 -0
  265. package/packages/omo-codex/plugin/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
  266. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +8 -6
  267. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +31 -8
  268. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +117 -6
  269. package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
  270. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +11 -11
  271. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +26 -0
  272. package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +41 -0
  273. package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +2 -2
  274. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +6 -6
  275. package/packages/omo-codex/plugin/test/multi-agent-v2-regression.test.mjs +3 -3
  276. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +62 -0
  277. package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +271 -14
  278. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +3 -18
  279. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +0 -5
  280. package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +293 -0
  281. package/packages/omo-codex/scripts/install-config.test.mjs +10 -10
  282. package/packages/omo-codex/scripts/install-dist/install-local.mjs +401 -22
  283. package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +39 -2
  284. package/packages/omo-codex/scripts/install-marketplace-cache.test.mjs +4 -1
  285. package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.test.ts +87 -0
  286. package/packages/shared-skills/skills/programming/scripts/typescript/check-no-excuse-rules.ts +35 -5
  287. package/packages/shared-skills/skills/ulw-plan/SKILL.md +31 -8
  288. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +117 -6
  289. package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +46 -10
  290. package/packages/shared-skills/skills/ulw-research/SKILL.md +3 -3
  291. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +0 -3
  292. package/dist/skills/ultraresearch/SKILL.md +0 -10
  293. package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +0 -273
  294. package/packages/shared-skills/skills/lcx-contribute-bug-fix/agents/openai.yaml +0 -12
  295. package/packages/shared-skills/skills/lcx-contribute-bug-fix/scripts/create-pr-body.mjs +0 -107
  296. package/packages/shared-skills/skills/lcx-doctor/SKILL.md +0 -128
  297. package/packages/shared-skills/skills/lcx-doctor/agents/openai.yaml +0 -11
  298. package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +0 -268
  299. package/packages/shared-skills/skills/lcx-report-bug/agents/openai.yaml +0 -11
  300. package/packages/shared-skills/skills/ultraresearch/SKILL.md +0 -10
  301. /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-contribute-bug-fix/SKILL.md +0 -0
  302. /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-contribute-bug-fix/agents/openai.yaml +0 -0
  303. /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-contribute-bug-fix/scripts/create-pr-body.mjs +0 -0
  304. /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-doctor/SKILL.md +0 -0
  305. /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-doctor/agents/openai.yaml +0 -0
  306. /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-report-bug/SKILL.md +0 -0
  307. /package/{dist → packages/omo-codex/plugin/components/lcx}/skills/lcx-report-bug/agents/openai.yaml +0 -0
@@ -50,6 +50,7 @@ var SAFE_AMBIENT_ENV_KEYS = new Set([
50
50
  var SAFE_CODEGRAPH_RUNTIME_ENV_KEYS = new Set([
51
51
  "CODEGRAPH_ALLOW_UNSAFE_NODE",
52
52
  "CODEGRAPH_BIN",
53
+ "CODEGRAPH_DAEMON_IDLE_TIMEOUT_MS",
53
54
  "CODEGRAPH_FAKE_LOG",
54
55
  "CODEGRAPH_NO_DAEMON",
55
56
  "CODEGRAPH_NODE_BIN",
@@ -61,7 +62,7 @@ function buildCodegraphEnv(options = {}) {
61
62
  const homeDir = options.homeDir ?? homedir();
62
63
  return {
63
64
  [CODEGRAPH_INSTALL_DIR_ENV]: join(homeDir, ".omo", "codegraph"),
64
- [CODEGRAPH_NO_DAEMON_ENV]: "1",
65
+ ...options.daemon === true ? {} : { [CODEGRAPH_NO_DAEMON_ENV]: "1" },
65
66
  [CODEGRAPH_NO_DOWNLOAD_ENV]: "1",
66
67
  [CODEGRAPH_TELEMETRY_ENV]: "0",
67
68
  [DO_NOT_TRACK_ENV]: "1"
@@ -88,6 +89,44 @@ function buildCodegraphChildEnv(options = {}) {
88
89
  return env;
89
90
  }
90
91
 
92
+ // ../../../../utils/src/codegraph/manifest.ts
93
+ var CODEGRAPH_PINNED_VERSION = "1.4.1";
94
+ var CODEGRAPH_PROVISION_MANIFEST = {
95
+ assets: {
96
+ "darwin-arm64": {
97
+ executableName: "codegraph",
98
+ sha256: "4a679ae5a5cb9fff900dd59bb786da6a581b7f68f4cf713bdedd137e347d34dc",
99
+ url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-darwin-arm64.tar.gz"
100
+ },
101
+ "darwin-x64": {
102
+ executableName: "codegraph",
103
+ sha256: "436f96943cfd926ea6d0a8454f18833d21254d5fd9b3d224317b1426132def95",
104
+ url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-darwin-x64.tar.gz"
105
+ },
106
+ "linux-arm64": {
107
+ executableName: "codegraph",
108
+ sha256: "0d62c5eb2722f8d19d20f7a1bd974445e18d5294cb59be116a0c3d55ce87591f",
109
+ url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-linux-arm64.tar.gz"
110
+ },
111
+ "linux-x64": {
112
+ executableName: "codegraph",
113
+ sha256: "fb585ff5018d6faaa46d282b61f4f689bc7967ed8a1b467a5c556dd7ced9b542",
114
+ url: "https://github.com/colbymchenry/codegraph/releases/download/v1.4.1/codegraph-linux-x64.tar.gz"
115
+ },
116
+ "win32-arm64": {
117
+ executableName: "codegraph.cmd",
118
+ sha256: "e2a2a28c802a79804c7df203afa50bd461309c6c180ce3f76079fdc7cddc7697",
119
+ url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-arm64/-/codegraph-win32-arm64-1.4.1.tgz"
120
+ },
121
+ "win32-x64": {
122
+ executableName: "codegraph.cmd",
123
+ sha256: "4f08700fda5f4a03ad5b2956135c5788d739a351b3433db2b5820e5d5224c30d",
124
+ url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-x64/-/codegraph-win32-x64-1.4.1.tgz"
125
+ }
126
+ },
127
+ version: CODEGRAPH_PINNED_VERSION
128
+ };
129
+
91
130
  // ../../../../utils/src/codegraph/node-support.ts
92
131
  var CODEGRAPH_MIN_NODE_MAJOR = 20;
93
132
  var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
@@ -125,45 +164,6 @@ import { existsSync } from "node:fs";
125
164
  import { homedir as homedir2, hostname } from "node:os";
126
165
  import { basename, join as join2 } from "node:path";
127
166
  import { promisify } from "node:util";
128
-
129
- // ../../../../utils/src/codegraph/manifest.ts
130
- var CODEGRAPH_PROVISION_MANIFEST = {
131
- assets: {
132
- "darwin-arm64": {
133
- executableName: "codegraph",
134
- sha256: "95bb27bf6382b69659e158e0c04d71cc394778951e1317d582be7807e7866908",
135
- url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-darwin-arm64.tar.gz"
136
- },
137
- "darwin-x64": {
138
- executableName: "codegraph",
139
- sha256: "3311cc1d1f0f0ad742709b6a43d8a9187b1ef0af0dd30e0b58008dc673e29478",
140
- url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-darwin-x64.tar.gz"
141
- },
142
- "linux-arm64": {
143
- executableName: "codegraph",
144
- sha256: "e16f612bc96c2ebccd04574cbed500c9939147c80666ad6bb024398dff7992ae",
145
- url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-linux-arm64.tar.gz"
146
- },
147
- "linux-x64": {
148
- executableName: "codegraph",
149
- sha256: "d45a068f44596a85c7ba7d0ef924eaf7103fbbf3cafbeb668127daff60a52228",
150
- url: "https://github.com/colbymchenry/codegraph/releases/download/v1.0.1/codegraph-linux-x64.tar.gz"
151
- },
152
- "win32-arm64": {
153
- executableName: "codegraph.cmd",
154
- sha256: "8d57ced73b24d35f758f2ede2318e80e1d7241987f37a999e3d80edb6fddf961",
155
- url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-arm64/-/codegraph-win32-arm64-1.0.1.tgz"
156
- },
157
- "win32-x64": {
158
- executableName: "codegraph.cmd",
159
- sha256: "52607fe73b05e741fd1087da2ceca9d3c8f565e36bf1a7070600bdbdf3931e32",
160
- url: "https://registry.npmjs.org/@colbymchenry/codegraph-win32-x64/-/codegraph-win32-x64-1.0.1.tgz"
161
- }
162
- },
163
- version: "1.0.1"
164
- };
165
-
166
- // ../../../../utils/src/codegraph/provision.ts
167
167
  var DEFAULT_LOCK_WAIT_MS = 5000;
168
168
  var DEFAULT_LOCK_STALE_MS = 120000;
169
169
  var DEFAULT_DOWNLOAD_TIMEOUT_MS = 60000;
@@ -1490,8 +1490,9 @@ function parseJsoncSafe(content) {
1490
1490
  var HARNESS_IDS = ["codex", "opencode", "omo"];
1491
1491
  var SETTING_HARNESS_SUPPORT = {
1492
1492
  "codegraph.auto_provision": HARNESS_IDS,
1493
+ "codegraph.daemon": ["codex", "opencode"],
1493
1494
  "codegraph.enabled": HARNESS_IDS,
1494
- "codegraph.excluded_roots": ["codex"],
1495
+ "codegraph.excluded_roots": ["codex", "opencode"],
1495
1496
  "codegraph.install_dir": HARNESS_IDS,
1496
1497
  "codegraph.telemetry": HARNESS_IDS,
1497
1498
  "codegraph.watch_debounce_ms": ["opencode", "omo"]
@@ -1508,6 +1509,7 @@ var BUILT_IN_DEFAULTS = {
1508
1509
  var HARNESS_BLOCK_KEYS = HARNESS_IDS.map((harness) => `[${harness}]`);
1509
1510
  var CODEGRAPH_SETTING_KEYS = [
1510
1511
  "auto_provision",
1512
+ "daemon",
1511
1513
  "enabled",
1512
1514
  "excluded_roots",
1513
1515
  "install_dir",
@@ -1581,6 +1583,10 @@ function setCodegraphSetting(config, key, value) {
1581
1583
  if (typeof value === "boolean")
1582
1584
  config.auto_provision = value;
1583
1585
  return;
1586
+ case "daemon":
1587
+ if (typeof value === "boolean")
1588
+ config.daemon = value;
1589
+ return;
1584
1590
  case "enabled":
1585
1591
  if (typeof value === "boolean")
1586
1592
  config.enabled = value;
@@ -2043,16 +2049,35 @@ function bufferFromChunk(chunk) {
2043
2049
 
2044
2050
  // ../../../../mcp-stdio-core/src/server.ts
2045
2051
  var DEFAULT_IDLE_TIMEOUT_MS = 10 * 60000;
2052
+ var DEFAULT_PARENT_POLL_INTERVAL_MS = 30000;
2046
2053
  var noopLog = () => {};
2054
+ function isProcessAlive(pid) {
2055
+ try {
2056
+ process.kill(pid, 0);
2057
+ return true;
2058
+ } catch (error) {
2059
+ return !hasErrorCode(error, "ESRCH");
2060
+ }
2061
+ }
2047
2062
  async function runJsonRpcStdioServer(config) {
2048
2063
  const log = config.log ?? noopLog;
2049
2064
  const idleTimeoutMs = config.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
2050
- const idleTimer = createIdleTimer(idleTimeoutMs, log, config.onIdleTimeout);
2065
+ let isClosed = false;
2066
+ const idleTimer = createIdleTimer(idleTimeoutMs, log, () => {
2067
+ isClosed = true;
2068
+ config.onIdleTimeout?.();
2069
+ });
2070
+ const watchdog = createParentWatchdog(config.parentWatchdog, (parentPid, pollIntervalMs) => {
2071
+ isClosed = true;
2072
+ log("parent_exit", { parent_pid: parentPid, poll_interval_ms: pollIntervalMs });
2073
+ config.onParentExit?.();
2074
+ config.input.destroy();
2075
+ });
2051
2076
  log("stdio_started", { cwd: process.cwd(), idle_timeout_ms: idleTimeoutMs });
2052
2077
  idleTimer.arm();
2053
2078
  try {
2054
2079
  for await (const message of readStdioJsonRpcMessages(config.input)) {
2055
- if (idleTimer.closed())
2080
+ if (isClosed)
2056
2081
  break;
2057
2082
  idleTimer.arm();
2058
2083
  if (message.kind === "parse_error") {
@@ -2063,8 +2088,12 @@ async function runJsonRpcStdioServer(config) {
2063
2088
  if (!await handleRequest(message, config, log))
2064
2089
  break;
2065
2090
  }
2091
+ } catch (error) {
2092
+ if (!(isClosed && hasErrorCode(error, "ERR_STREAM_PREMATURE_CLOSE")))
2093
+ throw error;
2066
2094
  } finally {
2067
2095
  idleTimer.clear();
2096
+ watchdog.clear();
2068
2097
  log("stdio_stopped");
2069
2098
  }
2070
2099
  }
@@ -2120,9 +2149,33 @@ function isTerminalOutputError(error) {
2120
2149
  return false;
2121
2150
  return error.code === "EPIPE" || error.code === "ERR_STREAM_DESTROYED" || error.code === "ERR_STREAM_WRITE_AFTER_END";
2122
2151
  }
2123
- function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
2152
+ function hasErrorCode(error, code) {
2153
+ return error instanceof Error && "code" in error && error.code === code;
2154
+ }
2155
+ function createParentWatchdog(config, onDeadParent) {
2156
+ if (config === undefined)
2157
+ return { clear: () => {} };
2158
+ const pollIntervalMs = config.pollIntervalMs ?? DEFAULT_PARENT_POLL_INTERVAL_MS;
2159
+ if (pollIntervalMs <= 0)
2160
+ return { clear: () => {} };
2161
+ const parentPid = config.parentPid ?? process.ppid;
2162
+ const probeAlive = config.probeAlive ?? isProcessAlive;
2163
+ let fired = false;
2164
+ const timer = setInterval(() => {
2165
+ if (fired || probeAlive(parentPid))
2166
+ return;
2167
+ fired = true;
2168
+ onDeadParent(parentPid, pollIntervalMs);
2169
+ }, pollIntervalMs);
2170
+ timer.unref();
2171
+ return {
2172
+ clear: () => {
2173
+ clearInterval(timer);
2174
+ }
2175
+ };
2176
+ }
2177
+ function createIdleTimer(idleTimeoutMs, log, onTimeout) {
2124
2178
  let timer = null;
2125
- let isClosed = false;
2126
2179
  return {
2127
2180
  arm: () => {
2128
2181
  if (timer !== null)
@@ -2130,9 +2183,8 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
2130
2183
  if (idleTimeoutMs <= 0)
2131
2184
  return;
2132
2185
  timer = setTimeout(() => {
2133
- isClosed = true;
2134
2186
  log("idle_timeout", { idle_timeout_ms: idleTimeoutMs });
2135
- onIdleTimeout?.();
2187
+ onTimeout();
2136
2188
  }, idleTimeoutMs);
2137
2189
  timer.unref();
2138
2190
  },
@@ -2141,8 +2193,7 @@ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
2141
2193
  return;
2142
2194
  clearTimeout(timer);
2143
2195
  timer = null;
2144
- },
2145
- closed: () => isClosed
2196
+ }
2146
2197
  };
2147
2198
  }
2148
2199
  // src/serve-invocation.ts
@@ -2175,6 +2226,7 @@ class CodegraphBridgeStdioError extends Error {
2175
2226
  var CODEGRAPH_NODE_DESCRIPTION = "Inspect one named symbol or file. In symbol mode, includeCode=true includes leaf-symbol source when available. Container symbols such as classes, interfaces, structs, enums, modules, and namespaces return structural outlines with member lists by design. For container source, request a specific member symbol or use file mode with symbolsOnly=false plus offset/limit.";
2176
2227
  var CODEGRAPH_NODE_INCLUDE_CODE_DESCRIPTION = "Symbol mode: include leaf-symbol source when available. Container symbols such as classes, interfaces, structs, enums, modules, and namespaces intentionally return structural outlines with members; request a specific member symbol or use file mode with symbolsOnly=false plus offset/limit for source.";
2177
2228
  var CODEGRAPH_CONTAINER_OUTLINE_GUIDANCE = "Container symbols intentionally return structural outlines with members. For source, request a specific member symbol or call codegraph_node in file mode with symbolsOnly=false plus offset/limit around the symbol location.";
2229
+ var SIGKILL_ESCALATION_MS = 2000;
2178
2230
  async function runBridgedCodegraphProcess(command, args, options) {
2179
2231
  const invocation = resolveServeProcessInvocation(command, args);
2180
2232
  const child = spawn(invocation.command, invocation.args, {
@@ -2200,17 +2252,24 @@ async function runBridgedCodegraphProcess(command, args, options) {
2200
2252
  resolveExit(signal === null ? 0 : 1);
2201
2253
  });
2202
2254
  });
2203
- const clientForwardingDone = forwardClientToCodegraph(options.input, childInput, pendingResponses, (mode) => {
2204
- defaultResponseMode = mode;
2205
- });
2206
- const responseForwardingDone = forwardCodegraphToClient(childOutput, options.output, pendingResponses, () => defaultResponseMode);
2207
- const bridgeDone = Promise.all([clientForwardingDone, responseForwardingDone]);
2208
- const childAndResponsesDone = Promise.all([childExit, responseForwardingDone]).then(([exitCode]) => exitCode);
2209
2255
  const destroyChildPipes = () => {
2210
2256
  childInput.destroy();
2211
2257
  childOutput.destroy();
2212
2258
  };
2213
2259
  childExit.then(destroyChildPipes, destroyChildPipes);
2260
+ let parentWatchdogFired = false;
2261
+ const parentWatchdog = createParentWatchdog(options.parentWatchdog, () => {
2262
+ parentWatchdogFired = true;
2263
+ options.input.destroy();
2264
+ destroyChildPipes();
2265
+ terminateCodegraphChild(child);
2266
+ });
2267
+ const clientForwardingDone = forwardClientToCodegraph(options.input, childInput, pendingResponses, (mode) => {
2268
+ defaultResponseMode = mode;
2269
+ }, () => parentWatchdogFired);
2270
+ const responseForwardingDone = forwardCodegraphToClient(childOutput, options.output, pendingResponses, () => defaultResponseMode, () => parentWatchdogFired);
2271
+ const bridgeDone = Promise.all([clientForwardingDone, responseForwardingDone]);
2272
+ const childAndResponsesDone = Promise.all([childExit, responseForwardingDone]).then(([exitCode]) => exitCode);
2214
2273
  try {
2215
2274
  return await Promise.race([childAndResponsesDone, bridgeDone.then(() => childExit)]);
2216
2275
  } catch (error) {
@@ -2221,39 +2280,66 @@ async function runBridgedCodegraphProcess(command, args, options) {
2221
2280
  return;
2222
2281
  });
2223
2282
  throw error;
2283
+ } finally {
2284
+ parentWatchdog.clear();
2224
2285
  }
2225
2286
  }
2226
- async function forwardClientToCodegraph(input, childInput, pendingResponses, setDefaultResponseMode) {
2227
- for await (const message of readStdioJsonRpcMessages(input)) {
2228
- if (message.kind === "parse_error") {
2229
- continue;
2230
- }
2231
- const responseMode = message.responseMode;
2232
- setDefaultResponseMode(responseMode);
2233
- const key = responseModeKey(message.payload);
2234
- if (key !== null) {
2235
- pendingResponses.set(key, {
2236
- method: jsonRpcMethod(message.payload),
2237
- responseMode,
2238
- toolName: jsonRpcToolName(message.payload)
2239
- });
2287
+ function terminateCodegraphChild(child) {
2288
+ if (child.exitCode !== null || child.signalCode !== null)
2289
+ return;
2290
+ child.kill("SIGTERM");
2291
+ const escalation = setTimeout(() => {
2292
+ if (child.exitCode === null && child.signalCode === null)
2293
+ child.kill("SIGKILL");
2294
+ }, SIGKILL_ESCALATION_MS);
2295
+ escalation.unref();
2296
+ }
2297
+ function isWatchdogTeardownError(error) {
2298
+ if (!(error instanceof Error) || !("code" in error))
2299
+ return false;
2300
+ return error.code === "ERR_STREAM_PREMATURE_CLOSE" || error.code === "ERR_STREAM_DESTROYED" || error.code === "ERR_STREAM_WRITE_AFTER_END" || error.code === "EPIPE";
2301
+ }
2302
+ async function forwardClientToCodegraph(input, childInput, pendingResponses, setDefaultResponseMode, tolerateWatchdogClose) {
2303
+ try {
2304
+ for await (const message of readStdioJsonRpcMessages(input)) {
2305
+ if (message.kind === "parse_error") {
2306
+ continue;
2307
+ }
2308
+ const responseMode = message.responseMode;
2309
+ setDefaultResponseMode(responseMode);
2310
+ const key = responseModeKey(message.payload);
2311
+ if (key !== null) {
2312
+ pendingResponses.set(key, {
2313
+ method: jsonRpcMethod(message.payload),
2314
+ responseMode,
2315
+ toolName: jsonRpcToolName(message.payload)
2316
+ });
2317
+ }
2318
+ await writeLine(childInput, JSON.stringify(message.payload));
2240
2319
  }
2241
- await writeLine(childInput, JSON.stringify(message.payload));
2320
+ childInput.end();
2321
+ } catch (error) {
2322
+ if (!(tolerateWatchdogClose() && isWatchdogTeardownError(error)))
2323
+ throw error;
2242
2324
  }
2243
- childInput.end();
2244
2325
  }
2245
- async function forwardCodegraphToClient(childOutput, output, pendingResponses, defaultResponseMode) {
2246
- for await (const message of readStdioJsonRpcMessages(childOutput)) {
2247
- if (message.kind === "parse_error") {
2248
- await writeStdioJsonRpcResponse(output, errorResponse(null, -32700, "Parse error", message.message), defaultResponseMode());
2249
- continue;
2326
+ async function forwardCodegraphToClient(childOutput, output, pendingResponses, defaultResponseMode, tolerateWatchdogClose) {
2327
+ try {
2328
+ for await (const message of readStdioJsonRpcMessages(childOutput)) {
2329
+ if (message.kind === "parse_error") {
2330
+ await writeStdioJsonRpcResponse(output, errorResponse(null, -32700, "Parse error", message.message), defaultResponseMode());
2331
+ continue;
2332
+ }
2333
+ const key = responseModeKey(message.payload);
2334
+ const pendingResponse = key === null ? undefined : pendingResponses.get(key);
2335
+ const responseMode = pendingResponse?.responseMode ?? defaultResponseMode();
2336
+ if (key !== null)
2337
+ pendingResponses.delete(key);
2338
+ await writeStdioJsonRpcResponse(output, clarifyCodegraphResponse(message.payload, pendingResponse), responseMode);
2250
2339
  }
2251
- const key = responseModeKey(message.payload);
2252
- const pendingResponse = key === null ? undefined : pendingResponses.get(key);
2253
- const responseMode = pendingResponse?.responseMode ?? defaultResponseMode();
2254
- if (key !== null)
2255
- pendingResponses.delete(key);
2256
- await writeStdioJsonRpcResponse(output, clarifyCodegraphResponse(message.payload, pendingResponse), responseMode);
2340
+ } catch (error) {
2341
+ if (!(tolerateWatchdogClose() && isWatchdogTeardownError(error)))
2342
+ throw error;
2257
2343
  }
2258
2344
  }
2259
2345
  function responseModeKey(payload) {
@@ -2385,7 +2471,8 @@ async function runUnavailableCodegraphMcpServer(options) {
2385
2471
  serverVersion: options.serverVersion
2386
2472
  },
2387
2473
  input: options.input,
2388
- output: options.output
2474
+ output: options.output,
2475
+ parentWatchdog: options.parentWatchdog ?? {}
2389
2476
  });
2390
2477
  }
2391
2478
  async function handleUnavailableCodegraphMcpRequest(input, options) {
@@ -2434,7 +2521,7 @@ var CODEGRAPH_DISABLED_HINT = `CodeGraph MCP skipped: disabled by OMO SOT config
2434
2521
  `;
2435
2522
  var CODEGRAPH_EXCLUDED_HINT = `CodeGraph MCP skipped: project excluded by OMO CodeGraph policy.
2436
2523
  `;
2437
- var CODEGRAPH_VERSION = "1.0.1";
2524
+ var CODEGRAPH_VERSION = CODEGRAPH_PINNED_VERSION;
2438
2525
  var PROJECT_CWD_ENV_KEYS = ["OMO_CODEGRAPH_PROJECT_CWD", SESSION_START_CWD_ENV, "PWD"];
2439
2526
  async function runCodegraphServe(options = {}) {
2440
2527
  const env = options.env ?? processEnv;
@@ -2482,7 +2569,7 @@ async function runCodegraphServe(options = {}) {
2482
2569
  return runUnavailableMcp(buildCodegraphNodeSkipHint(nodeSupport), options);
2483
2570
  }
2484
2571
  const runProcess = options.runProcess ?? runBridgedCodegraphProcess;
2485
- const codegraphEnv = codegraphEnvForConfig(trustedInstallDir, homeDir, options.buildEnv);
2572
+ const codegraphEnv = codegraphEnvForConfig(trustedInstallDir, homeDir, codegraphConfig.daemon === true, options.buildEnv);
2486
2573
  const mergedEnv = buildCodegraphChildEnv({ ambientEnv: env, codegraphEnv, runtimeEnv: env });
2487
2574
  return runProcess(resolution.command, [...resolution.argsPrefix, "serve", "--mcp"], {
2488
2575
  cwd: projectCwd,
@@ -2490,7 +2577,8 @@ async function runCodegraphServe(options = {}) {
2490
2577
  input: options.stdin ?? processStdin,
2491
2578
  output: options.stdout ?? processStdout,
2492
2579
  stderr: options.stderr ?? processStderr,
2493
- stdio: "pipe"
2580
+ stdio: "pipe",
2581
+ parentWatchdog: options.parentWatchdog ?? {}
2494
2582
  });
2495
2583
  }
2496
2584
  async function runUnavailableMcp(reason, options) {
@@ -2499,7 +2587,8 @@ async function runUnavailableMcp(reason, options) {
2499
2587
  input: options.stdin ?? processStdin,
2500
2588
  output: options.stdout ?? processStdout,
2501
2589
  reason,
2502
- serverVersion: CODEGRAPH_VERSION
2590
+ serverVersion: CODEGRAPH_VERSION,
2591
+ parentWatchdog: options.parentWatchdog ?? {}
2503
2592
  });
2504
2593
  return 0;
2505
2594
  }
@@ -2528,8 +2617,8 @@ function shouldSkipResolvedCommand(resolution, commandExists) {
2528
2617
  function looksLikePath2(command) {
2529
2618
  return command.includes("/") || command.includes("\\");
2530
2619
  }
2531
- function codegraphEnvForConfig(trustedInstallDir, homeDir, buildEnv) {
2532
- const env = { ...buildEnv?.({ homeDir }) ?? buildCodegraphEnv({ homeDir }), [CODEGRAPH_NO_DAEMON_ENV]: "1" };
2620
+ function codegraphEnvForConfig(trustedInstallDir, homeDir, daemon, buildEnv) {
2621
+ const env = buildEnv?.({ daemon, homeDir }) ?? buildCodegraphEnv({ daemon, homeDir });
2533
2622
  return trustedInstallDir === undefined ? env : { ...env, CODEGRAPH_INSTALL_DIR: trustedInstallDir };
2534
2623
  }
2535
2624
  function resolveProjectCwd(env, fallback) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sisyphuslabs/codex-codegraph",
3
- "version": "4.18.2",
3
+ "version": "4.19.1",
4
4
  "description": "Codex plugin MCP wrapper for CodeGraph.",
5
5
  "type": "module",
6
6
  "private": true,
@@ -25,7 +25,7 @@
25
25
  "typescript": "^6.0.3"
26
26
  },
27
27
  "optionalDependencies": {
28
- "@colbymchenry/codegraph": "1.0.1"
28
+ "@colbymchenry/codegraph": "1.4.1"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=20.0.0"
@@ -1,6 +1,7 @@
1
1
  import type { Readable } from "node:stream";
2
2
 
3
3
  import type { CodexOmoConfig as SharedCodexOmoConfig } from "../../../shared/src/config-loader.ts";
4
+ import type { CODEGRAPH_PINNED_VERSION } from "../../../../../utils/src/codegraph/manifest.ts";
4
5
  import type { SweepCodegraphZombiesOptions } from "../../../../../utils/src/codegraph/process-sweep.ts";
5
6
  import type { CodegraphProvisionResult as SharedCodegraphProvisionResult } from "../../../../../utils/src/codegraph/provision.ts";
6
7
  import type {
@@ -58,7 +59,7 @@ export interface CodegraphSessionStartOutcome {
58
59
 
59
60
  export interface CodegraphSessionStartDeps {
60
61
  readonly ensureGitignored: (projectRoot: string) => boolean;
61
- readonly ensureProvisioned: (options: { readonly installDir?: string; readonly lockDir: string; readonly version: "1.0.1" }) => Promise<CodegraphProvisionResult>;
62
+ readonly ensureProvisioned: (options: { readonly installDir?: string; readonly lockDir: string; readonly version: typeof CODEGRAPH_PINNED_VERSION }) => Promise<CodegraphProvisionResult>;
62
63
  readonly prepareWorkspace: (projectRoot: string, options: { readonly homeDir: string }) => CodegraphWorkspacePreparation;
63
64
  readonly resolveCommand: (options?: ResolveCodegraphCommandOptions) => CodegraphCommandResolution;
64
65
  readonly runCommand: (
@@ -76,6 +77,7 @@ export interface SessionStartHookOptions {
76
77
  readonly env?: Record<string, string | undefined>;
77
78
  readonly spawnWorker?: (invocation: WorkerSpawnInvocation) => void;
78
79
  readonly statusProbe?: (options: {
80
+ readonly daemon: boolean;
79
81
  readonly env: Record<string, string | undefined>;
80
82
  readonly homeDir: string;
81
83
  readonly projectRoot: string;
@@ -87,6 +87,7 @@ export async function executeCodegraphSessionStartHook(options: SessionStartHook
87
87
  }
88
88
 
89
89
  const isInitialized = await (options.statusProbe ?? isCodegraphProjectInitialized)({
90
+ daemon: config.codegraph?.daemon === true,
90
91
  env,
91
92
  homeDir,
92
93
  projectRoot,
@@ -110,6 +111,7 @@ export async function executeCodegraphSessionStartHook(options: SessionStartHook
110
111
  }
111
112
 
112
113
  async function isCodegraphProjectInitialized(options: {
114
+ readonly daemon: boolean;
113
115
  readonly env: Record<string, string | undefined>;
114
116
  readonly homeDir: string;
115
117
  readonly projectRoot: string;
@@ -124,7 +126,7 @@ async function isCodegraphProjectInitialized(options: {
124
126
 
125
127
  const invocation = resolveCodegraphCommandInvocation(resolved.command, [...resolved.argsPrefix, "status", "--json"]);
126
128
  const codegraphEnv = {
127
- ...buildCodegraphEnv({ homeDir: options.homeDir }),
129
+ ...buildCodegraphEnv({ daemon: options.daemon, homeDir: options.homeDir }),
128
130
  ...(options.trustedCodegraphInstallDir === undefined ? {} : { CODEGRAPH_INSTALL_DIR: options.trustedCodegraphInstallDir }),
129
131
  };
130
132
  const status = await runStatusProbe(