oh-my-opencode 4.13.0 → 4.14.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 (445) hide show
  1. package/.agents/skills/codex-qa/SKILL.md +15 -0
  2. package/.agents/skills/codex-qa/references/logging-debug.md +12 -0
  3. package/.agents/skills/opencode-qa/SKILL.md +17 -0
  4. package/.agents/skills/opencode-qa/references/tui-tmux.md +17 -0
  5. package/.agents/skills/work-with-pr/SKILL.md +18 -10
  6. package/.opencode/skills/work-with-pr/SKILL.md +18 -10
  7. package/README.md +2 -2
  8. package/dist/cli/doctor/checks/telemetry.d.ts +2 -0
  9. package/dist/cli/doctor/framework/constants.d.ts +1 -0
  10. package/dist/cli/doctor/framework/doctor-target.d.ts +1 -1
  11. package/dist/cli/index.js +24651 -16452
  12. package/dist/cli-node/index.js +24651 -16452
  13. package/dist/config/schema/oh-my-opencode-config.d.ts +1 -0
  14. package/dist/features/team-mode/test-support/async-test-helpers.d.ts +19 -0
  15. package/dist/hooks/atlas/final-wave-approval-gate.d.ts +1 -0
  16. package/dist/hooks/atlas/subagent-completion-reminder.d.ts +30 -0
  17. package/dist/hooks/atlas/types.d.ts +2 -0
  18. package/dist/hooks/atlas/verification-reminders.d.ts +3 -0
  19. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +1 -0
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.js +33232 -19559
  22. package/dist/mcp/context7.d.ts +9 -8
  23. package/dist/oh-my-opencode.schema.json +4 -0
  24. package/dist/shared/posthog.d.ts +17 -10
  25. package/dist/shared/telemetry-product-identity.d.ts +2 -0
  26. package/dist/skills/coding-agent-sessions/SKILL.md +128 -0
  27. package/dist/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  28. package/dist/skills/coding-agent-sessions/references/all-platforms.md +71 -0
  29. package/dist/skills/coding-agent-sessions/references/claude.md +32 -0
  30. package/dist/skills/coding-agent-sessions/references/codex.md +30 -0
  31. package/dist/skills/coding-agent-sessions/references/opencode.md +43 -0
  32. package/dist/skills/coding-agent-sessions/references/senpi.md +17 -0
  33. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  34. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  35. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  36. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  37. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  38. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  39. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  40. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  41. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
  42. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  43. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  44. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  45. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  46. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  47. package/dist/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  48. package/dist/skills/frontend/ATTRIBUTION.md +52 -8
  49. package/dist/skills/frontend/SKILL.md +29 -8
  50. package/dist/skills/frontend/references/design/README.md +29 -12
  51. package/dist/skills/frontend/references/design/_INDEX.md +3 -3
  52. package/dist/skills/frontend/references/design/design-system-architecture.md +22 -19
  53. package/dist/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
  54. package/dist/skills/frontend/references/designpowers/README.md +48 -0
  55. package/dist/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
  56. package/dist/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
  57. package/dist/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
  58. package/dist/skills/frontend/references/designpowers/lane-c-review.md +65 -0
  59. package/dist/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
  60. package/dist/skills/frontend/references/designpowers/orchestration.md +80 -0
  61. package/dist/skills/frontend/references/designpowers/routing.md +79 -0
  62. package/dist/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
  63. package/dist/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
  64. package/dist/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
  65. package/dist/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
  66. package/dist/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
  67. package/dist/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
  68. package/dist/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
  69. package/dist/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
  70. package/dist/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
  71. package/dist/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
  72. package/dist/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
  73. package/dist/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
  74. package/dist/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
  75. package/dist/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
  76. package/dist/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
  77. package/dist/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
  78. package/dist/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
  79. package/dist/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
  80. package/dist/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
  81. package/dist/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
  82. package/dist/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
  83. package/dist/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
  84. package/dist/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
  85. package/dist/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
  86. package/dist/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
  87. package/dist/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
  88. package/dist/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
  89. package/dist/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
  90. package/dist/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
  91. package/dist/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
  92. package/dist/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
  93. package/dist/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
  94. package/dist/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
  95. package/dist/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
  96. package/dist/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
  97. package/dist/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
  98. package/dist/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
  99. package/dist/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
  100. package/dist/skills/frontend/references/ui-ux-db/scripts/core.py +0 -0
  101. package/dist/skills/git-master/SKILL.md +4 -0
  102. package/dist/skills/review-work/SKILL.md +3 -3
  103. package/dist/skills/start-work/SKILL.md +7 -5
  104. package/dist/skills/ultraresearch/SKILL.md +4 -252
  105. package/dist/skills/ulw-plan/SKILL.md +8 -6
  106. package/dist/skills/ulw-plan/references/full-workflow.md +11 -6
  107. package/dist/skills/ulw-plan/references/intent-clear.md +3 -3
  108. package/dist/skills/ulw-plan/references/intent-unclear.md +1 -1
  109. package/dist/skills/{ultraresearch → ulw-research}/ATTRIBUTION.md +1 -1
  110. package/dist/skills/ulw-research/SKILL.md +260 -0
  111. package/dist/skills/visual-qa/SKILL.md +105 -14
  112. package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +120 -1
  113. package/dist/testing/create-plugin-module.d.ts +2 -0
  114. package/dist/tui.js +23917 -16117
  115. package/docs/reference/github-attachment-upload.md +51 -0
  116. package/docs/reference/web-terminal-visual-qa.md +81 -0
  117. package/package.json +20 -14
  118. package/packages/lsp-core/src/lsp/process.ts +4 -1
  119. package/packages/lsp-core/src/mcp.ts +1 -0
  120. package/packages/lsp-daemon/dist/cli.js +5 -1
  121. package/packages/lsp-daemon/dist/index.js +5 -1
  122. package/packages/lsp-daemon/dist/proxy.js +1 -0
  123. package/packages/lsp-tools-mcp/dist/cli.js +5 -1
  124. package/packages/lsp-tools-mcp/dist/lsp/manager.js +4 -1
  125. package/packages/lsp-tools-mcp/dist/mcp.js +5 -1
  126. package/packages/lsp-tools-mcp/dist/tools.js +4 -1
  127. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  128. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +323 -62
  129. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  130. package/packages/omo-codex/plugin/components/bootstrap/scripts/bootstrap.ps1 +37 -68
  131. package/packages/omo-codex/plugin/components/bootstrap/scripts/node-dispatch.ps1 +75 -0
  132. package/packages/omo-codex/plugin/components/bootstrap/src/cli.ts +1 -1
  133. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +2 -18
  134. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +575 -334
  135. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +204 -39
  136. package/packages/omo-codex/plugin/components/codegraph/package.json +2 -2
  137. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +7 -1
  138. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +103 -3
  139. package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +114 -0
  140. package/packages/omo-codex/plugin/components/codegraph/src/serve-invocation.ts +29 -0
  141. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +31 -57
  142. package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +7 -4
  143. package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +43 -9
  144. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +146 -0
  145. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +12 -7
  146. package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +71 -1
  147. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  148. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  149. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  150. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +4 -1
  151. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  152. package/packages/omo-codex/plugin/components/rules/dist/cli.js +2 -2
  153. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  154. package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +2 -2
  155. package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +11 -2
  156. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +6 -6
  157. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  158. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +23 -0
  159. package/packages/omo-codex/plugin/components/teammode/dist/cli.js +22 -4
  160. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  161. package/packages/omo-codex/plugin/components/teammode/skills/teammode/SKILL.md +40 -2
  162. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-guide.mjs +32 -5
  163. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team.mjs +7 -3
  164. package/packages/omo-codex/plugin/components/teammode/src/codex-hook.ts +19 -4
  165. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +32 -2
  166. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  167. package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
  168. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
  169. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +2 -2
  170. package/packages/omo-codex/plugin/components/ultrawork/directive.md +23 -7
  171. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +1 -1
  172. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  173. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +6 -4
  174. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +11 -6
  175. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +3 -3
  176. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +1 -1
  177. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +1 -1
  178. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +24 -0
  179. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +6 -1
  180. package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +1 -1
  181. package/packages/omo-codex/plugin/components/ulw-loop/README.md +25 -21
  182. package/packages/omo-codex/plugin/components/ulw-loop/biome.json +1 -1
  183. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +381 -0
  184. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +14 -1
  185. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +145 -14
  186. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +6 -3
  187. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +16 -6
  188. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.d.ts +5 -0
  189. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.js +104 -0
  190. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +1 -1
  191. package/packages/omo-codex/plugin/components/ulw-loop/package.json +2 -1
  192. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +19 -11
  193. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +14 -1
  194. package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +4 -2
  195. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +28 -6
  196. package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-directive.ts +113 -0
  197. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +33 -2
  198. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-kind-guidance.test.ts +31 -0
  199. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +13 -0
  200. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +36 -0
  201. package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +12 -0
  202. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +64 -0
  203. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +2 -1
  204. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +2 -1
  205. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +2 -1
  206. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +2 -1
  207. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +2 -1
  208. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +2 -1
  209. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +2 -1
  210. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +2 -1
  211. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +2 -1
  212. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +2 -1
  213. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +2 -1
  214. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +2 -1
  215. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +2 -1
  216. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +2 -1
  217. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +2 -1
  218. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +2 -1
  219. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +2 -1
  220. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +2 -1
  221. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +2 -1
  222. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +2 -1
  223. package/packages/omo-codex/plugin/package-lock.json +13 -13
  224. package/packages/omo-codex/plugin/package.json +1 -1
  225. package/packages/omo-codex/plugin/scripts/auto-update.mjs +9 -5
  226. package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +1 -0
  227. package/packages/omo-codex/plugin/scripts/migrate-codex-config/context7-placeholder-guard.mjs +131 -0
  228. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-mode-guard.mjs +60 -0
  229. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +3 -10
  230. package/packages/omo-codex/plugin/scripts/migrate-codex-config/root-settings.mjs +31 -1
  231. package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +73 -0
  232. package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +20 -3
  233. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +30 -8
  234. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +128 -0
  235. package/packages/omo-codex/plugin/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  236. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +71 -0
  237. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/claude.md +32 -0
  238. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/codex.md +30 -0
  239. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/opencode.md +43 -0
  240. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +17 -0
  241. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  242. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  243. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  244. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  245. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  246. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  247. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  248. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  249. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
  250. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  251. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  252. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  253. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  254. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  255. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  256. package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +52 -8
  257. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +29 -8
  258. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +29 -12
  259. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +3 -3
  260. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +22 -19
  261. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
  262. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +48 -0
  263. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
  264. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
  265. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
  266. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-c-review.md +65 -0
  267. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
  268. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/orchestration.md +80 -0
  269. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/routing.md +79 -0
  270. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
  271. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
  272. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
  273. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
  274. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
  275. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
  276. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
  277. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
  278. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
  279. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
  280. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
  281. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
  282. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
  283. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
  284. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
  285. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
  286. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
  287. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
  288. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
  289. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
  290. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
  291. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
  292. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
  293. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
  294. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
  295. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
  296. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
  297. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
  298. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
  299. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
  300. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
  301. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
  302. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
  303. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
  304. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
  305. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
  306. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
  307. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
  308. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +0 -0
  309. package/packages/omo-codex/plugin/skills/git-master/SKILL.md +4 -0
  310. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +4 -0
  311. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +4 -0
  312. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +4 -0
  313. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +12 -4
  314. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +14 -8
  315. package/packages/omo-codex/plugin/skills/teammode/SKILL.md +40 -2
  316. package/packages/omo-codex/plugin/skills/teammode/scripts/team-guide.mjs +32 -5
  317. package/packages/omo-codex/plugin/skills/teammode/scripts/team.mjs +7 -3
  318. package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +4 -250
  319. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +19 -11
  320. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +6 -4
  321. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +11 -6
  322. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +3 -3
  323. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +1 -1
  324. package/packages/{shared-skills/skills/ultraresearch → omo-codex/plugin/skills/ulw-research}/ATTRIBUTION.md +1 -1
  325. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +262 -0
  326. package/packages/omo-codex/plugin/skills/ulw-research/agents/openai.yaml +2 -0
  327. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +109 -14
  328. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +23 -0
  329. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -0
  330. package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +1 -0
  331. package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +24 -1
  332. package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +23 -5
  333. package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +38 -0
  334. package/packages/omo-codex/plugin/test/bootstrap-ps-guard.test.mjs +25 -0
  335. package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +1 -7
  336. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +206 -6
  337. package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +44 -0
  338. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +50 -1
  339. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +10 -7
  340. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +28 -2
  341. package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +20 -0
  342. package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +117 -0
  343. package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +5 -2
  344. package/packages/omo-codex/plugin/test/ulw-research-skill-contract.test.mjs +285 -0
  345. package/packages/omo-codex/scripts/install-bin-links.test.mjs +6 -1
  346. package/packages/omo-codex/scripts/install-cache-copy.test.mjs +51 -0
  347. package/packages/omo-codex/scripts/install-config.test.mjs +198 -17
  348. package/packages/omo-codex/scripts/install-dist/install-local.mjs +701 -282
  349. package/packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs +24 -15
  350. package/packages/omo-codex/scripts/install-local.test.mjs +5 -1
  351. package/packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs +84 -0
  352. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +128 -0
  353. package/packages/shared-skills/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  354. package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +71 -0
  355. package/packages/shared-skills/skills/coding-agent-sessions/references/claude.md +32 -0
  356. package/packages/shared-skills/skills/coding-agent-sessions/references/codex.md +30 -0
  357. package/packages/shared-skills/skills/coding-agent-sessions/references/opencode.md +43 -0
  358. package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +17 -0
  359. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  360. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  361. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  362. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  363. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  364. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  365. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  366. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  367. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
  368. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  369. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  370. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  371. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  372. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  373. package/packages/shared-skills/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  374. package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +52 -8
  375. package/packages/shared-skills/skills/frontend/SKILL.md +29 -8
  376. package/packages/shared-skills/skills/frontend/references/design/README.md +29 -12
  377. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +3 -3
  378. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +22 -19
  379. package/packages/shared-skills/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
  380. package/packages/shared-skills/skills/frontend/references/designpowers/README.md +48 -0
  381. package/packages/shared-skills/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
  382. package/packages/shared-skills/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
  383. package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
  384. package/packages/shared-skills/skills/frontend/references/designpowers/lane-c-review.md +65 -0
  385. package/packages/shared-skills/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
  386. package/packages/shared-skills/skills/frontend/references/designpowers/orchestration.md +80 -0
  387. package/packages/shared-skills/skills/frontend/references/designpowers/routing.md +79 -0
  388. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
  389. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
  390. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
  391. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
  392. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
  393. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
  394. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
  395. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
  396. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
  397. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
  398. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
  399. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
  400. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
  401. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
  402. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
  403. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
  404. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
  405. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
  406. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
  407. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
  408. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
  409. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
  410. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
  411. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
  412. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
  413. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
  414. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
  415. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
  416. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
  417. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
  418. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
  419. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
  420. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
  421. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
  422. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
  423. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
  424. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
  425. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
  426. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/core.py +0 -0
  427. package/packages/shared-skills/skills/git-master/SKILL.md +4 -0
  428. package/packages/shared-skills/skills/review-work/SKILL.md +3 -3
  429. package/packages/shared-skills/skills/start-work/SKILL.md +7 -5
  430. package/packages/shared-skills/skills/ultraresearch/SKILL.md +4 -252
  431. package/packages/shared-skills/skills/ulw-plan/SKILL.md +8 -6
  432. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +11 -6
  433. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +3 -3
  434. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +1 -1
  435. package/packages/{omo-codex/plugin/skills/ultraresearch → shared-skills/skills/ulw-research}/ATTRIBUTION.md +1 -1
  436. package/packages/shared-skills/skills/ulw-research/SKILL.md +260 -0
  437. package/packages/shared-skills/skills/visual-qa/SKILL.md +105 -14
  438. package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +120 -1
  439. package/script/qa/web-terminal-redaction.d.mts +13 -0
  440. package/script/qa/web-terminal-redaction.mjs +43 -0
  441. package/script/qa/web-terminal-renderer.mjs +218 -0
  442. package/script/qa/web-terminal-visual-qa.mjs +264 -0
  443. package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/tests/test_cookie_domain_filter.py +0 -110
  444. package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/tests/test_extract_cookies.py +0 -245
  445. package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +0 -204
@@ -5907,7 +5907,7 @@ var package_default;
5907
5907
  var init_package = __esm(() => {
5908
5908
  package_default = {
5909
5909
  name: "@oh-my-opencode/omo-codex",
5910
- version: "4.13.0",
5910
+ version: "4.14.0",
5911
5911
  type: "module",
5912
5912
  private: true,
5913
5913
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -6352,7 +6352,6 @@ function bunWhich(commandName) {
6352
6352
  import { execFileSync } from "node:child_process";
6353
6353
  import { existsSync } from "node:fs";
6354
6354
  var GIT_BASH_ENV_KEY = "OMO_CODEX_GIT_BASH_PATH";
6355
- var WINGET_INSTALL_ARGS = ["install", "--id", "Git.Git", "-e", "--source", "winget"];
6356
6355
  var PROGRAM_FILES_GIT_BASH = "C:\\Program Files\\Git\\bin\\bash.exe";
6357
6356
  var PROGRAM_FILES_X86_GIT_BASH = "C:\\Program Files (x86)\\Git\\bin\\bash.exe";
6358
6357
  var NON_GIT_BASH_LAUNCHER_DIR_SEGMENTS = ["\\windows\\system32\\", "\\microsoft\\windowsapps\\"];
@@ -6469,6 +6468,44 @@ import { basename, isAbsolute, join as join4, relative, resolve, sep } from "nod
6469
6468
 
6470
6469
  // packages/omo-codex/src/install/codex-cache-command-shim.ts
6471
6470
  var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
6471
+ function windowsNodeDiscoveryLines() {
6472
+ return [
6473
+ "setlocal EnableExtensions EnableDelayedExpansion",
6474
+ 'set "OMO_NODE_BINARY="',
6475
+ 'set "OMO_NODE_REPL_NODE_PATH=%NODE_REPL_NODE_PATH%"',
6476
+ 'if exist "%CODEX_HOME%\\config.toml" (',
6477
+ ` for /f "tokens=1,* delims==" %%A in ('findstr /R /C:"NODE_REPL_NODE_PATH[ ]*=" "%CODEX_HOME%\\config.toml" 2^>nul') do (`,
6478
+ ' set "OMO_NODE_REPL_NODE_PATH=%%B"',
6479
+ " )",
6480
+ ")",
6481
+ "if defined OMO_NODE_REPL_NODE_PATH (",
6482
+ ' set "OMO_NODE_BINARY=!OMO_NODE_REPL_NODE_PATH!"',
6483
+ ' for /f "tokens=* delims= " %%N in ("!OMO_NODE_BINARY!") do set "OMO_NODE_BINARY=%%N"',
6484
+ ` if "!OMO_NODE_BINARY:~0,1!"=="'" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~1!"`,
6485
+ ` if "!OMO_NODE_BINARY:~-1!"=="'" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~0,-1!"`,
6486
+ ' if "!OMO_NODE_BINARY:~0,1!"=="^"" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~1!"',
6487
+ ' if "!OMO_NODE_BINARY:~-1!"=="^"" set "OMO_NODE_BINARY=!OMO_NODE_BINARY:~0,-1!"',
6488
+ ' if defined OMO_NODE_BINARY if not exist "!OMO_NODE_BINARY!" set "OMO_NODE_BINARY="',
6489
+ ")",
6490
+ 'if not defined OMO_NODE_BINARY where node >nul 2>nul && set "OMO_NODE_BINARY=node"'
6491
+ ];
6492
+ }
6493
+ function windowsCommandShim(targetPath) {
6494
+ return [
6495
+ "@echo off",
6496
+ COMMAND_SHIM_MARKER,
6497
+ 'if not defined CODEX_HOME set "CODEX_HOME=%USERPROFILE%\\.codex"',
6498
+ ...windowsNodeDiscoveryLines(),
6499
+ "if not defined OMO_NODE_BINARY (",
6500
+ " echo omo: no Node runtime was discovered from NODE_REPL_NODE_PATH or PATH; rerun LazyCodex install from Codex Desktop 1>&2",
6501
+ " exit /b 127",
6502
+ ")",
6503
+ `"%OMO_NODE_BINARY%" "${targetPath}" %*`,
6504
+ "exit /b %ERRORLEVEL%",
6505
+ ""
6506
+ ].join(`\r
6507
+ `);
6508
+ }
6472
6509
 
6473
6510
  // packages/omo-codex/src/install/codex-cache-fs.ts
6474
6511
  import { lstat } from "node:fs/promises";
@@ -6609,23 +6646,24 @@ function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
6609
6646
  `rem ${RUNTIME_WRAPPER_MARKER}`,
6610
6647
  `if not defined CODEX_HOME set "CODEX_HOME=${codexHome}"`,
6611
6648
  'if not defined OMO_SPARKSHELL_APP_SERVER_SOCKET set "OMO_SPARKSHELL_APP_SERVER_SOCKET=%CODEX_HOME%\\app-server-control\\app-server-control.sock"',
6649
+ ...windowsNodeDiscoveryLines(),
6612
6650
  `if "%~1"=="ulw-loop" if exist "${ulwLoopBin}" (`,
6613
6651
  " shift /1",
6614
6652
  ` "${ulwLoopBin}" %*`,
6615
6653
  " exit /b %ERRORLEVEL%",
6616
6654
  ")",
6617
- `if "%OMO_RUNTIME%"=="node" if exist "${nodeCliPath}" (`,
6618
- ` node "${nodeCliPath}" %*`,
6655
+ `if "%OMO_RUNTIME%"=="node" if defined OMO_NODE_BINARY if exist "${nodeCliPath}" (`,
6656
+ ` "%OMO_NODE_BINARY%" "${nodeCliPath}" %*`,
6619
6657
  " exit /b %ERRORLEVEL%",
6620
6658
  ")",
6621
6659
  'if not defined BUN_BINARY where bun >nul 2>nul && set "BUN_BINARY=bun"',
6622
6660
  'if not defined BUN_BINARY if exist "%USERPROFILE%\\.bun\\bin\\bun.exe" set "BUN_BINARY=%USERPROFILE%\\.bun\\bin\\bun.exe"',
6623
6661
  "if not defined BUN_BINARY (",
6624
- ` if exist "${nodeCliPath}" (`,
6625
- ` node "${nodeCliPath}" %*`,
6662
+ ` if defined OMO_NODE_BINARY if exist "${nodeCliPath}" (`,
6663
+ ` "%OMO_NODE_BINARY%" "${nodeCliPath}" %*`,
6626
6664
  " exit /b %ERRORLEVEL%",
6627
6665
  " )",
6628
- ` echo omo: bun runtime not found and the node fallback CLI is missing at ${nodeCliPath}; install bun from https://bun.sh or reinstall omo and force OMO_RUNTIME=node 1>&2`,
6666
+ ` echo omo: bun runtime not found, no Node runtime was discovered from NODE_REPL_NODE_PATH or PATH, or the node fallback CLI is missing at ${nodeCliPath}; install bun from https://bun.sh or rerun LazyCodex install from Codex Desktop 1>&2`,
6629
6667
  " exit /b 127",
6630
6668
  ")",
6631
6669
  `if not exist "${cliPath}" (`,
@@ -6658,6 +6696,20 @@ async function linkCachedPluginBins(input) {
6658
6696
  }
6659
6697
  return linked;
6660
6698
  }
6699
+ async function removeCachedManagedNpmBinShims(pluginRoot) {
6700
+ const binLinks = await discoverPackageBins(pluginRoot);
6701
+ if (binLinks.length === 0)
6702
+ return;
6703
+ const npmBinDir = join4(pluginRoot, "node_modules", ".bin");
6704
+ if (!await isFileSystemEntry(npmBinDir))
6705
+ return;
6706
+ const managedBinNames = new Set(binLinks.map((link) => link.name));
6707
+ for (const name of managedBinNames) {
6708
+ for (const suffix of ["", ".cmd", ".ps1"]) {
6709
+ await rm2(join4(npmBinDir, `${name}${suffix}`), { force: true });
6710
+ }
6711
+ }
6712
+ }
6661
6713
  async function linkRootRuntimeBin(input) {
6662
6714
  const cliPath = join4(input.repoRoot, "dist", "cli", "index.js");
6663
6715
  if (!await isFile(cliPath))
@@ -6694,6 +6746,16 @@ async function isFile(path) {
6694
6746
  throw error;
6695
6747
  }
6696
6748
  }
6749
+ async function isFileSystemEntry(path) {
6750
+ try {
6751
+ await stat(path);
6752
+ return true;
6753
+ } catch (error) {
6754
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
6755
+ return false;
6756
+ throw error;
6757
+ }
6758
+ }
6697
6759
  async function discoverPackageBins(root) {
6698
6760
  const links = [];
6699
6761
  await collectPackageBins(root, root, links);
@@ -6768,10 +6830,7 @@ async function replaceSymlink(linkPath, targetPath) {
6768
6830
  async function replaceCommandShim(linkPath, targetPath) {
6769
6831
  if (await existingNonShim(linkPath))
6770
6832
  throw new Error(`${linkPath} already exists and is not a command shim`);
6771
- await writeFile(linkPath, `@echo off\r
6772
- ${COMMAND_SHIM_MARKER}\r
6773
- node "${targetPath}" %*\r
6774
- `);
6833
+ await writeFile(linkPath, windowsCommandShim(targetPath));
6775
6834
  }
6776
6835
  async function replaceRuntimeWrapper(linkPath, content) {
6777
6836
  if (await existingNonRuntimeWrapper(linkPath))
@@ -6824,7 +6883,7 @@ async function existingNonSymlink(path) {
6824
6883
  }
6825
6884
  // packages/omo-codex/src/install/codex-cache-install.ts
6826
6885
  import { cp as cp2, mkdir as mkdir3, readFile as readFile7, rename, rm as rm3 } from "node:fs/promises";
6827
- import { basename as basename2, dirname as dirname3, join as join10, sep as sep5 } from "node:path";
6886
+ import { basename as basename3, dirname as dirname4, join as join11, sep as sep5 } from "node:path";
6828
6887
 
6829
6888
  // packages/omo-codex/src/install/codex-cache-bundled-mcps.ts
6830
6889
  import { cp, mkdir as mkdir2, readFile as readFile3, stat as stat2 } from "node:fs/promises";
@@ -7042,10 +7101,127 @@ async function collectPackageJsonPaths(directory, root, paths) {
7042
7101
 
7043
7102
  // packages/omo-codex/src/install/codex-cache-mcp-manifest.ts
7044
7103
  import { readFile as readFile5, writeFile as writeFile3 } from "node:fs/promises";
7045
- import { join as join8, sep as sep3 } from "node:path";
7104
+ import { join as join9, sep as sep3 } from "node:path";
7105
+
7106
+ // packages/utils/src/codegraph/resolve.ts
7107
+ import { existsSync as existsSync2 } from "node:fs";
7108
+ import { spawnSync as spawnSync2 } from "node:child_process";
7109
+ import { basename as basename2, dirname as dirname3, join as join8 } from "node:path";
7110
+ import { createRequire } from "node:module";
7111
+
7112
+ // packages/utils/src/codegraph/node-support.ts
7113
+ var CODEGRAPH_MIN_NODE_MAJOR = 20;
7114
+ var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
7115
+ var CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE";
7116
+ var CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
7117
+ function evaluateCodegraphNodeSupport(options = {}) {
7118
+ const nodeVersion = options.nodeVersion ?? process.versions.node;
7119
+ const env = options.env ?? process.env;
7120
+ const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
7121
+ const major = parseNodeMajor(nodeVersion);
7122
+ if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
7123
+ return { major, override, reason: "too-new", supported: override };
7124
+ }
7125
+ if (major < CODEGRAPH_MIN_NODE_MAJOR) {
7126
+ return { major, override, reason: "too-old", supported: override };
7127
+ }
7128
+ return { major, override, supported: true };
7129
+ }
7130
+ function parseNodeMajor(version) {
7131
+ const normalized = version.startsWith("v") ? version.slice(1) : version;
7132
+ const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
7133
+ return Number.isNaN(major) ? 0 : major;
7134
+ }
7135
+
7136
+ // packages/utils/src/codegraph/resolve.ts
7137
+ var CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
7138
+ var CODEGRAPH_NODE_PATH_CANDIDATES = [
7139
+ "/opt/homebrew/opt/node@24/bin/node",
7140
+ "/opt/homebrew/opt/node@22/bin/node",
7141
+ "/opt/homebrew/opt/node@20/bin/node",
7142
+ "/usr/local/opt/node@24/bin/node",
7143
+ "/usr/local/opt/node@22/bin/node",
7144
+ "/usr/local/opt/node@20/bin/node"
7145
+ ];
7146
+ var requireFromHere = createRequire(import.meta.url);
7147
+ function defaultNodeVersion(nodePath) {
7148
+ if (nodePath === process.execPath && isNodeExecutableName(nodePath))
7149
+ return process.versions.node;
7150
+ try {
7151
+ const result = spawnSync2(nodePath, ["--version"], {
7152
+ encoding: "utf8",
7153
+ timeout: 2000,
7154
+ windowsHide: true
7155
+ });
7156
+ if (result.error !== undefined || result.status !== 0)
7157
+ return null;
7158
+ const version = `${result.stdout}
7159
+ ${result.stderr}`.trim().split(/\s+/)[0];
7160
+ return version === undefined || version.length === 0 ? null : version;
7161
+ } catch (error) {
7162
+ if (error instanceof Error)
7163
+ return null;
7164
+ throw error;
7165
+ }
7166
+ }
7167
+ function isNodeExecutableName(filePath) {
7168
+ const executable = basename2(filePath).toLowerCase();
7169
+ return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
7170
+ }
7171
+ function looksLikePath(command) {
7172
+ return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
7173
+ }
7174
+ function resolveConfiguredNodeRuntime(configured, fileExists, which2) {
7175
+ if (looksLikePath(configured))
7176
+ return fileExists(configured) ? configured : null;
7177
+ return which2(configured);
7178
+ }
7179
+ function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
7180
+ const version = nodeVersion(nodePath);
7181
+ if (version === null)
7182
+ return false;
7183
+ return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
7184
+ }
7185
+ function defaultNodeRuntime(env, fileExists, which2, nodeVersion) {
7186
+ const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
7187
+ if (configured !== undefined && configured.length > 0) {
7188
+ const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which2);
7189
+ return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
7190
+ }
7191
+ const candidates = [
7192
+ ...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
7193
+ ...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which2(commandName)).filter((candidate) => candidate !== null),
7194
+ ...CODEGRAPH_NODE_PATH_CANDIDATES.filter((candidate) => fileExists(candidate))
7195
+ ];
7196
+ const seen = new Set;
7197
+ for (const candidate of candidates) {
7198
+ if (seen.has(candidate))
7199
+ continue;
7200
+ seen.add(candidate);
7201
+ if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
7202
+ return candidate;
7203
+ }
7204
+ return null;
7205
+ }
7206
+ function resolveCodegraphNodeRuntime(options = {}) {
7207
+ const env = options.env ?? process.env;
7208
+ return defaultNodeRuntime(env, options.fileExists ?? existsSync2, options.which ?? bunWhich, options.nodeVersion ?? defaultNodeVersion);
7209
+ }
7210
+ function resolveCodegraphNodeSupport(options = {}) {
7211
+ const env = options.env ?? process.env;
7212
+ const nodeVersion = options.nodeVersion ?? defaultNodeVersion;
7213
+ const runtime3 = resolveCodegraphNodeRuntime({ ...options, env, nodeVersion });
7214
+ if (runtime3 === null) {
7215
+ return evaluateCodegraphNodeSupport({ env, nodeVersion: "0.0.0" });
7216
+ }
7217
+ return evaluateCodegraphNodeSupport({ env, nodeVersion: nodeVersion(runtime3) ?? "0.0.0" });
7218
+ }
7219
+
7220
+ // packages/omo-codex/src/install/codex-cache-mcp-manifest.ts
7046
7221
  var CODEGRAPH_RELATIVE_ARGS = new Set(["components/codegraph/dist/serve.js", "./components/codegraph/dist/serve.js"]);
7047
- async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
7048
- const manifestPath = join8(pluginRoot, ".mcp.json");
7222
+ var CONTEXT7_API_KEY_ENV = "CONTEXT7_API_KEY";
7223
+ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot, options = {}) {
7224
+ const manifestPath = join9(pluginRoot, ".mcp.json");
7049
7225
  if (!await fileExistsStrict(manifestPath))
7050
7226
  return;
7051
7227
  const raw = await readFile5(manifestPath, "utf8");
@@ -7053,7 +7229,7 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
7053
7229
  if (!isPlainRecord(parsed) || !isPlainRecord(parsed.mcpServers))
7054
7230
  return;
7055
7231
  let changed = false;
7056
- for (const server of Object.values(parsed.mcpServers)) {
7232
+ for (const [serverName, server] of Object.entries(parsed.mcpServers)) {
7057
7233
  if (!isPlainRecord(server))
7058
7234
  continue;
7059
7235
  if (server.cwd === "." || server.cwd === "./") {
@@ -7061,31 +7237,95 @@ async function rewriteCachedMcpManifest(pluginRoot, sourceRoot = pluginRoot) {
7061
7237
  changed = true;
7062
7238
  }
7063
7239
  const currentArgs = server.args;
7064
- if (!Array.isArray(currentArgs))
7065
- continue;
7066
- const nextArgs = currentArgs.map((arg) => {
7067
- if (typeof arg !== "string")
7240
+ if (Array.isArray(currentArgs)) {
7241
+ const nextArgs = currentArgs.map((arg) => {
7242
+ if (typeof arg !== "string")
7243
+ return arg;
7244
+ const bundledMcpRuntimeArg = resolveBundledMcpRuntimeArg(pluginRoot, arg);
7245
+ if (bundledMcpRuntimeArg !== null)
7246
+ return bundledMcpRuntimeArg;
7247
+ if (CODEGRAPH_RELATIVE_ARGS.has(arg))
7248
+ return join9(pluginRoot, "components", "codegraph", "dist", "serve.js");
7249
+ if (arg.startsWith("./") || arg.startsWith("../"))
7250
+ return resolveCachedRuntimePath(pluginRoot, sourceRoot, arg);
7068
7251
  return arg;
7069
- const bundledMcpRuntimeArg = resolveBundledMcpRuntimeArg(pluginRoot, arg);
7070
- if (bundledMcpRuntimeArg !== null)
7071
- return bundledMcpRuntimeArg;
7072
- if (CODEGRAPH_RELATIVE_ARGS.has(arg))
7073
- return join8(pluginRoot, "components", "codegraph", "dist", "serve.js");
7074
- if (arg.startsWith("./") || arg.startsWith("../"))
7075
- return resolveCachedRuntimePath(pluginRoot, sourceRoot, arg);
7076
- return arg;
7077
- });
7078
- if (nextArgs.some((value, index) => value !== currentArgs[index])) {
7079
- server.args = nextArgs;
7252
+ });
7253
+ if (nextArgs.some((value, index) => value !== currentArgs[index])) {
7254
+ server.args = nextArgs;
7255
+ changed = true;
7256
+ }
7257
+ }
7258
+ if (serverName === "context7" && sanitizeContext7Auth(server)) {
7080
7259
  changed = true;
7081
7260
  }
7261
+ if (!Array.isArray(currentArgs))
7262
+ continue;
7263
+ if (server === parsed.mcpServers.codegraph) {
7264
+ const runtime3 = options.codegraphNodeRuntime?.() ?? resolveCodegraphNodeRuntime();
7265
+ if (runtime3 !== null && server.command === "node") {
7266
+ server.command = runtime3;
7267
+ changed = true;
7268
+ }
7269
+ }
7082
7270
  }
7083
7271
  if (changed)
7084
7272
  await writeFile3(manifestPath, `${JSON.stringify(parsed, null, "\t")}
7085
7273
  `);
7086
7274
  }
7275
+ function sanitizeContext7Auth(server) {
7276
+ let changed = false;
7277
+ const currentArgs = server.args;
7278
+ if (Array.isArray(currentArgs)) {
7279
+ const nextArgs = removeContext7ApiKeyArgs(currentArgs);
7280
+ if (nextArgs.some((value, index) => value !== currentArgs[index]) || nextArgs.length !== currentArgs.length) {
7281
+ server.args = nextArgs;
7282
+ changed = true;
7283
+ }
7284
+ }
7285
+ const beforeEnv = JSON.stringify(server.env);
7286
+ const nextEnv = sanitizeContext7Env(server.env);
7287
+ if (Object.keys(nextEnv).length > 0) {
7288
+ server.env = nextEnv;
7289
+ } else {
7290
+ delete server.env;
7291
+ }
7292
+ return changed || JSON.stringify(server.env) !== beforeEnv;
7293
+ }
7294
+ function removeContext7ApiKeyArgs(args) {
7295
+ const nextArgs = [];
7296
+ for (let index = 0;index < args.length; index += 1) {
7297
+ const arg = args[index];
7298
+ const value = args[index + 1];
7299
+ if (typeof arg === "string" && isContext7ApiKeyFlag(arg) && (isPlaceholderContext7ApiKey(value) || value === undefined)) {
7300
+ index += 1;
7301
+ continue;
7302
+ }
7303
+ nextArgs.push(arg);
7304
+ }
7305
+ return nextArgs;
7306
+ }
7307
+ function sanitizeContext7Env(value) {
7308
+ const nextEnv = {};
7309
+ if (isPlainRecord(value)) {
7310
+ for (const [key, envValue] of Object.entries(value)) {
7311
+ if (key === CONTEXT7_API_KEY_ENV && isPlaceholderContext7ApiKey(envValue))
7312
+ continue;
7313
+ nextEnv[key] = envValue;
7314
+ }
7315
+ }
7316
+ return nextEnv;
7317
+ }
7318
+ function isContext7ApiKeyFlag(value) {
7319
+ return value === "--api-key" || value === "--apiKey";
7320
+ }
7321
+ function isPlaceholderContext7ApiKey(value) {
7322
+ if (typeof value !== "string")
7323
+ return false;
7324
+ const normalized = value.trim().toLowerCase().replace(/[<>"'`]/g, "").replace(/[\s_-]+/g, " ");
7325
+ return normalized.length === 0 || normalized === "your api key";
7326
+ }
7087
7327
  async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
7088
- const manifestPath = join8(pluginRoot, ".mcp.json");
7328
+ const manifestPath = join9(pluginRoot, ".mcp.json");
7089
7329
  if (!await fileExistsStrict(manifestPath))
7090
7330
  return;
7091
7331
  const raw = await readFile5(manifestPath, "utf8");
@@ -7121,7 +7361,7 @@ async function rewriteCachedManifestRoot(pluginRoot, fromRoot, toRoot) {
7121
7361
 
7122
7362
  // packages/omo-codex/src/install/codex-hook-targets.ts
7123
7363
  import { readFile as readFile6 } from "node:fs/promises";
7124
- import { join as join9, sep as sep4 } from "node:path";
7364
+ import { join as join10, sep as sep4 } from "node:path";
7125
7365
  var PLUGIN_ROOT_TARGET_PATTERN = /\$\{PLUGIN_ROOT\}[\\/]+([^"']+)/g;
7126
7366
  async function findMissingHookCommandTargets(pluginRoot) {
7127
7367
  const commands = [];
@@ -7138,7 +7378,7 @@ async function findMissingHookCommandTargets(pluginRoot) {
7138
7378
  const targetSuffix = match[1];
7139
7379
  if (targetSuffix === undefined)
7140
7380
  continue;
7141
- const target = join9(pluginRoot, ...targetSuffix.split(/[\\/]+/));
7381
+ const target = join10(pluginRoot, ...targetSuffix.split(/[\\/]+/));
7142
7382
  if (seen.has(target))
7143
7383
  continue;
7144
7384
  seen.add(target);
@@ -7149,17 +7389,17 @@ async function findMissingHookCommandTargets(pluginRoot) {
7149
7389
  return missing;
7150
7390
  }
7151
7391
  async function hookManifestPaths(pluginRoot) {
7152
- const pluginManifestPath = join9(pluginRoot, ".codex-plugin", "plugin.json");
7392
+ const pluginManifestPath = join10(pluginRoot, ".codex-plugin", "plugin.json");
7153
7393
  if (!await fileExistsStrict(pluginManifestPath))
7154
- return [join9(pluginRoot, "hooks", "hooks.json")];
7394
+ return [join10(pluginRoot, "hooks", "hooks.json")];
7155
7395
  const parsed = JSON.parse(await readFile6(pluginManifestPath, "utf8"));
7156
7396
  if (!isPlainRecord(parsed))
7157
7397
  return [];
7158
7398
  if (typeof parsed.hooks === "string" && parsed.hooks.trim() !== "") {
7159
- return [join9(pluginRoot, stripDotSlash(parsed.hooks))];
7399
+ return [join10(pluginRoot, stripDotSlash(parsed.hooks))];
7160
7400
  }
7161
7401
  if (Array.isArray(parsed.hooks)) {
7162
- return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) => join9(pluginRoot, stripDotSlash(hookPath)));
7402
+ return parsed.hooks.filter((hookPath) => typeof hookPath === "string" && hookPath.trim() !== "").map((hookPath) => join10(pluginRoot, stripDotSlash(hookPath)));
7163
7403
  }
7164
7404
  return [];
7165
7405
  }
@@ -7195,7 +7435,7 @@ async function installCachedPlugin(input) {
7195
7435
  await maybeRunNpmInstall(input.sourcePath, input.runCommand);
7196
7436
  await maybeRunNpmBuild(input.sourcePath, input.runCommand);
7197
7437
  }
7198
- const targetPath = join10(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
7438
+ const targetPath = join11(input.codexHome, "plugins", "cache", input.marketplaceName, input.name, input.version);
7199
7439
  const tempPath = createTempSiblingPath(targetPath);
7200
7440
  await rm3(tempPath, { recursive: true, force: true });
7201
7441
  try {
@@ -7203,6 +7443,7 @@ async function installCachedPlugin(input) {
7203
7443
  await rewriteCachedPackageLocalFileDependencies(tempPath, input.sourcePath);
7204
7444
  await copyBundledMcpRuntimeDists({ pluginRoot: tempPath, sourceRoot: input.sourcePath });
7205
7445
  await maybeRunNpmInstall(tempPath, input.runCommand, ["ci", "--omit=dev"]);
7446
+ await removeCachedManagedNpmBinShims(tempPath);
7206
7447
  if (input.buildSource === false)
7207
7448
  await maybeRunNpmSyncSkills(tempPath, input.runCommand);
7208
7449
  await rewriteCachedMcpManifest(tempPath, input.sourcePath);
@@ -7216,14 +7457,14 @@ async function installCachedPlugin(input) {
7216
7457
  return { name: input.name, version: input.version, path: targetPath };
7217
7458
  }
7218
7459
  async function maybeRunNpmInstall(cwd, runCommand, args = ["install"]) {
7219
- if (!await fileExistsStrict(join10(cwd, "package.json")))
7460
+ if (!await fileExistsStrict(join11(cwd, "package.json")))
7220
7461
  return;
7221
7462
  await runCommand("npm", args, { cwd });
7222
7463
  }
7223
7464
  async function maybeRunNpmBuild(cwd, runCommand) {
7224
- if (!await fileExistsStrict(join10(cwd, "package.json")))
7465
+ if (!await fileExistsStrict(join11(cwd, "package.json")))
7225
7466
  return;
7226
- const packageJson = JSON.parse(await readFile7(join10(cwd, "package.json"), "utf8"));
7467
+ const packageJson = JSON.parse(await readFile7(join11(cwd, "package.json"), "utf8"));
7227
7468
  if (!isPlainRecord(packageJson))
7228
7469
  return;
7229
7470
  const scripts = packageJson.scripts;
@@ -7232,9 +7473,9 @@ async function maybeRunNpmBuild(cwd, runCommand) {
7232
7473
  await runCommand("npm", ["run", "build"], { cwd });
7233
7474
  }
7234
7475
  async function maybeRunNpmSyncSkills(cwd, runCommand) {
7235
- if (!await fileExistsStrict(join10(cwd, "package.json")))
7476
+ if (!await fileExistsStrict(join11(cwd, "package.json")))
7236
7477
  return;
7237
- const packageJson = JSON.parse(await readFile7(join10(cwd, "package.json"), "utf8"));
7478
+ const packageJson = JSON.parse(await readFile7(join11(cwd, "package.json"), "utf8"));
7238
7479
  if (!isPlainRecord(packageJson))
7239
7480
  return;
7240
7481
  const scripts = packageJson.scripts;
@@ -7243,13 +7484,13 @@ async function maybeRunNpmSyncSkills(cwd, runCommand) {
7243
7484
  await runCommand("npm", ["run", "sync:skills"], { cwd });
7244
7485
  }
7245
7486
  function createTempSiblingPath(targetPath) {
7246
- return join10(dirname3(targetPath), `.tmp-${basename2(targetPath)}-${process.pid}-${Date.now()}`);
7487
+ return join11(dirname4(targetPath), `.tmp-${basename3(targetPath)}-${process.pid}-${Date.now()}`);
7247
7488
  }
7248
7489
  function createBackupSiblingPath(targetPath) {
7249
- return join10(dirname3(targetPath), `.backup-${basename2(targetPath)}-${process.pid}-${Date.now()}`);
7490
+ return join11(dirname4(targetPath), `.backup-${basename3(targetPath)}-${process.pid}-${Date.now()}`);
7250
7491
  }
7251
7492
  async function copyDirectory(sourcePath, targetPath) {
7252
- await mkdir3(dirname3(targetPath), { recursive: true });
7493
+ await mkdir3(dirname4(targetPath), { recursive: true });
7253
7494
  await cp2(sourcePath, targetPath, { recursive: true, filter: (source) => shouldCopyPluginPath(source, sourcePath) });
7254
7495
  }
7255
7496
  async function promoteDirectory(tempPath, targetPath, renameDirectory) {
@@ -7285,9 +7526,9 @@ function shouldCopyPluginPath(path, root) {
7285
7526
  }
7286
7527
  // packages/omo-codex/src/install/codex-cache-prune.ts
7287
7528
  import { lstat as lstat4, readdir as readdir3, rm as rm4, stat as stat3 } from "node:fs/promises";
7288
- import { join as join11 } from "node:path";
7529
+ import { join as join12 } from "node:path";
7289
7530
  async function pruneMarketplaceCache(input) {
7290
- const cacheRoot = join11(input.codexHome, "plugins", "cache", input.marketplaceName);
7531
+ const cacheRoot = join12(input.codexHome, "plugins", "cache", input.marketplaceName);
7291
7532
  if (!await fileExistsStrict(cacheRoot))
7292
7533
  return;
7293
7534
  const keep = new Set(input.keepPluginNames);
@@ -7295,15 +7536,15 @@ async function pruneMarketplaceCache(input) {
7295
7536
  for (const entry of entries) {
7296
7537
  if (!entry.isDirectory() || keep.has(entry.name))
7297
7538
  continue;
7298
- await rm4(join11(cacheRoot, entry.name), { recursive: true, force: true });
7539
+ await rm4(join12(cacheRoot, entry.name), { recursive: true, force: true });
7299
7540
  }
7300
7541
  }
7301
7542
  async function pruneMarketplacePluginCaches(input) {
7302
- const cacheRoot = join11(input.codexHome, "plugins", "cache", input.marketplaceName);
7543
+ const cacheRoot = join12(input.codexHome, "plugins", "cache", input.marketplaceName);
7303
7544
  if (!await fileExistsStrict(cacheRoot))
7304
7545
  return;
7305
7546
  for (const pluginName of input.pluginNames) {
7306
- await rm4(join11(cacheRoot, pluginName), { recursive: true, force: true });
7547
+ await rm4(join12(cacheRoot, pluginName), { recursive: true, force: true });
7307
7548
  }
7308
7549
  const remainingEntries = await readCacheEntryNames(cacheRoot);
7309
7550
  if (remainingEntries.length === 0) {
@@ -7350,11 +7591,11 @@ async function isBrokenCacheSymlink(path) {
7350
7591
  }
7351
7592
  // packages/omo-codex/src/install/codex-cached-marketplace-manifest.ts
7352
7593
  import { mkdir as mkdir4, writeFile as writeFile4 } from "node:fs/promises";
7353
- import { join as join12 } from "node:path";
7594
+ import { join as join13 } from "node:path";
7354
7595
  async function writeCachedMarketplaceManifest(input) {
7355
- const marketplaceDir = join12(input.marketplaceRoot, ".agents", "plugins");
7596
+ const marketplaceDir = join13(input.marketplaceRoot, ".agents", "plugins");
7356
7597
  await mkdir4(marketplaceDir, { recursive: true });
7357
- await writeFile4(join12(marketplaceDir, "marketplace.json"), `${JSON.stringify({
7598
+ await writeFile4(join13(marketplaceDir, "marketplace.json"), `${JSON.stringify({
7358
7599
  name: input.marketplaceName,
7359
7600
  plugins: input.plugins.map((plugin) => ({
7360
7601
  name: plugin.name,
@@ -7365,9 +7606,9 @@ async function writeCachedMarketplaceManifest(input) {
7365
7606
  }
7366
7607
 
7367
7608
  // packages/omo-codex/src/install/codex-package-layout.ts
7368
- import { existsSync as existsSync2 } from "node:fs";
7609
+ import { existsSync as existsSync3 } from "node:fs";
7369
7610
  import { readFile as readFile8 } from "node:fs/promises";
7370
- import { join as join13 } from "node:path";
7611
+ import { join as join14 } from "node:path";
7371
7612
  var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
7372
7613
  "@code-yeongyu/lazycodex",
7373
7614
  "@code-yeongyu/lazycodex-ai",
@@ -7377,10 +7618,10 @@ var PACKAGED_CODEX_INSTALLER_NAMES = new Set([
7377
7618
  "oh-my-openagent"
7378
7619
  ]);
7379
7620
  async function shouldBuildSourcePackages(repoRoot) {
7380
- if (existsSync2(join13(repoRoot, "packages", "omo-opencode", "src", "index.ts")))
7621
+ if (existsSync3(join14(repoRoot, "packages", "omo-opencode", "src", "index.ts")))
7381
7622
  return true;
7382
- const packageJsonPath = join13(repoRoot, "package.json");
7383
- if (!existsSync2(packageJsonPath))
7623
+ const packageJsonPath = join14(repoRoot, "package.json");
7624
+ if (!existsSync3(packageJsonPath))
7384
7625
  return true;
7385
7626
  const packageJson = JSON.parse(await readFile8(packageJsonPath, "utf8"));
7386
7627
  if (!isPlainRecord(packageJson) || typeof packageJson.name !== "string")
@@ -7390,7 +7631,7 @@ async function shouldBuildSourcePackages(repoRoot) {
7390
7631
 
7391
7632
  // packages/omo-codex/src/install/codex-config-toml.ts
7392
7633
  import { mkdir as mkdir5, readFile as readFile10 } from "node:fs/promises";
7393
- import { dirname as dirname5 } from "node:path";
7634
+ import { dirname as dirname6 } from "node:path";
7394
7635
 
7395
7636
  // packages/omo-codex/src/install/toml-section-editor.ts
7396
7637
  function findTomlSection(config, header) {
@@ -7406,7 +7647,7 @@ function findTomlSection(config, header) {
7406
7647
  if (start === -1) {
7407
7648
  if (tomlTableHeaderMatches(trimmed, headerLine, targetHeaderPath))
7408
7649
  start = offset;
7409
- } else if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
7650
+ } else if (isTomlTableHeaderLine(line)) {
7410
7651
  return { start, end: offset, text: config.slice(start, offset) };
7411
7652
  }
7412
7653
  offset += line.length;
@@ -7416,12 +7657,12 @@ function findTomlSection(config, header) {
7416
7657
  return { start, end: config.length, text: config.slice(start) };
7417
7658
  }
7418
7659
  function replaceOrInsertSetting(config, section, key, value) {
7419
- const linePattern = new RegExp(`^${escapeRegExp(key)}\\s*=.*$`, "m");
7660
+ const linePattern = new RegExp(`^[ \\t]*${escapeRegExp(key)}[ \\t]*=.*$`, "m");
7420
7661
  const replacement = linePattern.test(section.text) ? section.text.replace(linePattern, `${key} = ${value}`) : insertSetting(section.text, key, value);
7421
7662
  return config.slice(0, section.start) + replacement + config.slice(section.end);
7422
7663
  }
7423
7664
  function removeSetting(config, section, key) {
7424
- const linePattern = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=.*(?:\\n|$)`, "m");
7665
+ const linePattern = new RegExp(`^[ \\t]*${escapeRegExp(key)}[ \\t]*=.*(?:\\n|$)`, "m");
7425
7666
  const replacement = section.text.replace(linePattern, "");
7426
7667
  return config.slice(0, section.start) + replacement + config.slice(section.end);
7427
7668
  }
@@ -7429,7 +7670,7 @@ function replaceOrInsertRootSetting(config, key, value) {
7429
7670
  const sectionStart = findFirstTableStart(config);
7430
7671
  const root = config.slice(0, sectionStart);
7431
7672
  const suffix = config.slice(sectionStart);
7432
- const linePattern = new RegExp(`^${escapeRegExp(key)}\\s*=.*$`, "m");
7673
+ const linePattern = new RegExp(`^[ \\t]*${escapeRegExp(key)}[ \\t]*=.*$`, "m");
7433
7674
  const replacement = linePattern.test(root) ? root.replace(linePattern, `${key} = ${value}`) : `${root.trimEnd()}${root.trimEnd().length > 0 ? `
7434
7675
  ` : ""}${key} = ${value}
7435
7676
  `;
@@ -7447,8 +7688,16 @@ function appendBlock(config, block) {
7447
7688
  `;
7448
7689
  }
7449
7690
  function findFirstTableStart(config) {
7450
- const match = config.match(/^[[].*$/m);
7451
- return match?.index ?? config.length;
7691
+ const lines = config.match(/[^\n]*\n?|$/g) ?? [];
7692
+ let offset = 0;
7693
+ for (const line of lines) {
7694
+ if (line.length === 0)
7695
+ break;
7696
+ if (isTomlTableHeaderLine(line))
7697
+ return offset;
7698
+ offset += line.length;
7699
+ }
7700
+ return config.length;
7452
7701
  }
7453
7702
  function insertSetting(sectionText, key, value) {
7454
7703
  const lines = sectionText.split(`
@@ -7461,19 +7710,57 @@ function escapeRegExp(value) {
7461
7710
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
7462
7711
  }
7463
7712
  function tomlTableHeaderMatches(line, headerLine, targetHeaderPath) {
7464
- if (line === headerLine)
7713
+ const normalizedLine = stripUnquotedInlineComment(line).trim();
7714
+ if (normalizedLine === headerLine)
7465
7715
  return true;
7466
7716
  if (!targetHeaderPath)
7467
7717
  return false;
7468
- const candidateHeaderPath = parseTomlTableHeader(line);
7718
+ const candidateHeaderPath = parseTomlTableHeader(normalizedLine);
7469
7719
  if (!candidateHeaderPath || candidateHeaderPath.length !== targetHeaderPath.length)
7470
7720
  return false;
7471
7721
  return candidateHeaderPath.every((part, index) => part === targetHeaderPath[index]);
7472
7722
  }
7473
7723
  function parseTomlTableHeader(line) {
7474
- if (!line.startsWith("[") || !line.endsWith("]") || line.startsWith("[["))
7724
+ const normalizedLine = stripUnquotedInlineComment(line).trim();
7725
+ if (!normalizedLine.startsWith("[") || !normalizedLine.endsWith("]") || normalizedLine.startsWith("[["))
7475
7726
  return null;
7476
- return parseTomlDottedKey(line.slice(1, -1).trim());
7727
+ return parseTomlDottedKey(normalizedLine.slice(1, -1).trim());
7728
+ }
7729
+ function isTomlTableHeaderLine(line) {
7730
+ const normalizedLine = stripUnquotedInlineComment(line).trim();
7731
+ return normalizedLine.startsWith("[") && normalizedLine.endsWith("]");
7732
+ }
7733
+ function stripUnquotedInlineComment(line) {
7734
+ let quote = null;
7735
+ let index = 0;
7736
+ while (index < line.length) {
7737
+ const char = line[index];
7738
+ if (quote === '"') {
7739
+ if (char === "\\") {
7740
+ index += 2;
7741
+ continue;
7742
+ }
7743
+ if (char === '"')
7744
+ quote = null;
7745
+ index += 1;
7746
+ continue;
7747
+ }
7748
+ if (quote === "'") {
7749
+ if (char === "'")
7750
+ quote = null;
7751
+ index += 1;
7752
+ continue;
7753
+ }
7754
+ if (char === '"' || char === "'") {
7755
+ quote = char;
7756
+ index += 1;
7757
+ continue;
7758
+ }
7759
+ if (char === "#")
7760
+ return line.slice(0, index);
7761
+ index += 1;
7762
+ }
7763
+ return line;
7477
7764
  }
7478
7765
  function parseTomlDottedKey(input) {
7479
7766
  const parts = [];
@@ -7584,7 +7871,7 @@ function skipWhitespace(input, startIndex) {
7584
7871
 
7585
7872
  // packages/omo-codex/src/install/codex-config-toml-sections.ts
7586
7873
  function removeTomlSections(config, shouldRemove) {
7587
- return splitTomlSections(config).filter((section) => section.header === null || !shouldRemove(section.header)).map((section) => section.text).join("").replace(/\n{3,}/g, `
7874
+ return splitTomlSections(config).filter((section) => section.header === null || !shouldRemove(section.header, section)).map((section) => section.text).join("").replace(/\n{3,}/g, `
7588
7875
 
7589
7876
  `);
7590
7877
  }
@@ -7623,11 +7910,43 @@ function parseHookStateHeaderKey(header) {
7623
7910
  return path[2] ?? null;
7624
7911
  }
7625
7912
  function parseTomlHeader(line) {
7626
- const trimmed = line.trim();
7913
+ const trimmed = stripTomlLineComment(line).trim();
7627
7914
  if (!trimmed.startsWith("[") || !trimmed.endsWith("]") || trimmed.startsWith("[["))
7628
7915
  return null;
7629
7916
  return trimmed.slice(1, -1);
7630
7917
  }
7918
+ function stripTomlLineComment(line) {
7919
+ let quote = null;
7920
+ let index = 0;
7921
+ while (index < line.length) {
7922
+ const char = line[index];
7923
+ if (quote === '"') {
7924
+ if (char === "\\") {
7925
+ index += 2;
7926
+ continue;
7927
+ }
7928
+ if (char === '"')
7929
+ quote = null;
7930
+ index += 1;
7931
+ continue;
7932
+ }
7933
+ if (quote === "'") {
7934
+ if (char === "'")
7935
+ quote = null;
7936
+ index += 1;
7937
+ continue;
7938
+ }
7939
+ if (char === '"' || char === "'") {
7940
+ quote = char;
7941
+ index += 1;
7942
+ continue;
7943
+ }
7944
+ if (char === "#")
7945
+ return line.slice(0, index);
7946
+ index += 1;
7947
+ }
7948
+ return line;
7949
+ }
7631
7950
 
7632
7951
  // packages/omo-codex/src/install/codex-config-agents.ts
7633
7952
  var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
@@ -7671,12 +7990,12 @@ function tomlKeySegment(value) {
7671
7990
 
7672
7991
  // packages/omo-codex/src/install/codex-config-atomic-write.ts
7673
7992
  import { lstat as lstat5, readlink as readlink3, realpath, rename as rename2, unlink, writeFile as writeFile5 } from "node:fs/promises";
7674
- import { basename as basename3, dirname as dirname4, isAbsolute as isAbsolute4, join as join14, resolve as resolve5 } from "node:path";
7993
+ import { basename as basename4, dirname as dirname5, isAbsolute as isAbsolute4, join as join15, resolve as resolve5 } from "node:path";
7675
7994
  var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
7676
7995
  var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
7677
7996
  async function writeFileAtomic(targetPath, data) {
7678
7997
  const writeTarget = await resolveSymlinkTarget(targetPath);
7679
- const temporaryPath = join14(dirname4(writeTarget), `.tmp-${basename3(writeTarget)}-${process.pid}-${Date.now()}`);
7998
+ const temporaryPath = join15(dirname5(writeTarget), `.tmp-${basename4(writeTarget)}-${process.pid}-${Date.now()}`);
7680
7999
  await writeFile5(temporaryPath, data);
7681
8000
  try {
7682
8001
  await renameWithRetry(temporaryPath, writeTarget);
@@ -7705,7 +8024,7 @@ async function resolveSymlinkTarget(targetPath) {
7705
8024
  if (!(error instanceof Error))
7706
8025
  throw error;
7707
8026
  const linkValue = await readlink3(targetPath);
7708
- return isAbsolute4(linkValue) ? linkValue : resolve5(dirname4(targetPath), linkValue);
8027
+ return isAbsolute4(linkValue) ? linkValue : resolve5(dirname5(targetPath), linkValue);
7709
8028
  }
7710
8029
  }
7711
8030
  async function renameWithRetry(fromPath, toPath) {
@@ -7851,7 +8170,8 @@ function ensureOmoBuiltinMcpPolicies(config, input) {
7851
8170
  return config;
7852
8171
  const codegraphEnabled = input.codegraphMcpEnabled ?? true;
7853
8172
  const gitBashEnabled = (input.platform ?? process.platform) === "win32" && input.gitBashEnabled === true;
7854
- let nextConfig = ensurePluginMcpEnabled(config, "omo@sisyphuslabs", "context7", true);
8173
+ let nextConfig = removeStaleContext7PlaceholderMcp(config);
8174
+ nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "context7", true);
7855
8175
  nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph", codegraphEnabled);
7856
8176
  nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", gitBashEnabled);
7857
8177
  return nextConfig;
@@ -7875,6 +8195,107 @@ enabled = ${enabledValue}
7875
8195
  `);
7876
8196
  return replaceOrInsertSetting(config, section, "enabled", enabledValue);
7877
8197
  }
8198
+ function removeStaleContext7PlaceholderMcp(config) {
8199
+ return removeTomlSections(config, (header, section) => header === "mcp_servers.context7" && isContext7PlaceholderSection(section.text));
8200
+ }
8201
+ function isContext7PlaceholderSection(sectionText) {
8202
+ const args = readStringArraySetting(sectionText, "args");
8203
+ if (args === null || !args.includes("@upstash/context7-mcp"))
8204
+ return false;
8205
+ const apiKey = valueAfter(args, "--api-key");
8206
+ return apiKey !== null && isPlaceholderApiKey(apiKey);
8207
+ }
8208
+ function valueAfter(values, key) {
8209
+ const index = values.indexOf(key);
8210
+ return index >= 0 ? values[index + 1] ?? null : null;
8211
+ }
8212
+ function isPlaceholderApiKey(value) {
8213
+ return /^your[-_ ]?api[-_ ]?key$/i.test(value);
8214
+ }
8215
+ function readStringArraySetting(sectionText, key) {
8216
+ for (const line of sectionText.split(`
8217
+ `)) {
8218
+ if (!new RegExp(`^\\s*${key}\\s*=`).test(line))
8219
+ continue;
8220
+ const assignmentIndex = line.indexOf("=");
8221
+ if (assignmentIndex === -1)
8222
+ return null;
8223
+ return parseTomlStringArray(stripUnquotedInlineComment2(line.slice(assignmentIndex + 1)).trim());
8224
+ }
8225
+ return null;
8226
+ }
8227
+ function parseTomlStringArray(value) {
8228
+ if (!value.startsWith("[") || !value.endsWith("]"))
8229
+ return null;
8230
+ const items = [];
8231
+ let index = 1;
8232
+ while (index < value.length - 1) {
8233
+ const char = value[index];
8234
+ if (char === '"' || char === "'") {
8235
+ const parsed = parseTomlString(value, index);
8236
+ if (parsed === null)
8237
+ return null;
8238
+ items.push(parsed.value);
8239
+ index = parsed.nextIndex;
8240
+ continue;
8241
+ }
8242
+ index += 1;
8243
+ }
8244
+ return items;
8245
+ }
8246
+ function parseTomlString(input, startIndex) {
8247
+ const quote = input[startIndex];
8248
+ let value = "";
8249
+ let index = startIndex + 1;
8250
+ while (index < input.length) {
8251
+ const char = input[index];
8252
+ if (quote === '"' && char === "\\") {
8253
+ const next = input[index + 1];
8254
+ if (next === undefined)
8255
+ return null;
8256
+ value += next;
8257
+ index += 2;
8258
+ continue;
8259
+ }
8260
+ if (char === quote)
8261
+ return { value, nextIndex: index + 1 };
8262
+ value += char;
8263
+ index += 1;
8264
+ }
8265
+ return null;
8266
+ }
8267
+ function stripUnquotedInlineComment2(line) {
8268
+ let quote = null;
8269
+ let index = 0;
8270
+ while (index < line.length) {
8271
+ const char = line[index];
8272
+ if (quote === '"') {
8273
+ if (char === "\\") {
8274
+ index += 2;
8275
+ continue;
8276
+ }
8277
+ if (char === '"')
8278
+ quote = null;
8279
+ index += 1;
8280
+ continue;
8281
+ }
8282
+ if (quote === "'") {
8283
+ if (char === "'")
8284
+ quote = null;
8285
+ index += 1;
8286
+ continue;
8287
+ }
8288
+ if (char === '"' || char === "'") {
8289
+ quote = char;
8290
+ index += 1;
8291
+ continue;
8292
+ }
8293
+ if (char === "#")
8294
+ return line.slice(0, index);
8295
+ index += 1;
8296
+ }
8297
+ return line;
8298
+ }
7878
8299
 
7879
8300
  // packages/omo-codex/src/install/codex-config-reasoning.ts
7880
8301
  var MANAGED_KEYS = ["model", "model_context_window", "model_reasoning_effort", "plan_mode_reasoning_effort"];
@@ -7945,7 +8366,7 @@ function isRootSetting(line, key) {
7945
8366
 
7946
8367
  // packages/omo-codex/src/install/codex-model-catalog.ts
7947
8368
  import { readFile as readFile9 } from "node:fs/promises";
7948
- import { join as join15 } from "node:path";
8369
+ import { join as join16 } from "node:path";
7949
8370
  var FALLBACK_CODEX_MODEL_CATALOG = {
7950
8371
  current: {
7951
8372
  model: "gpt-5.5",
@@ -7964,7 +8385,7 @@ var FALLBACK_CODEX_MODEL_CATALOG = {
7964
8385
  ]
7965
8386
  };
7966
8387
  async function readCodexModelCatalog(codexPackageRoot) {
7967
- const catalogPath = join15(codexPackageRoot, "plugin", "model-catalog.json");
8388
+ const catalogPath = join16(codexPackageRoot, "plugin", "model-catalog.json");
7968
8389
  try {
7969
8390
  const parsed = JSON.parse(await readFile9(catalogPath, "utf8"));
7970
8391
  return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
@@ -8015,36 +8436,92 @@ function parseProfileMatch(match) {
8015
8436
  return profile;
8016
8437
  }
8017
8438
 
8439
+ // packages/omo-codex/src/install/codex-multi-agent-mode-config.ts
8440
+ var CODEX_MULTI_AGENT_MODE_KEY = "multi_agent_mode";
8441
+ function removeUnsupportedCodexMultiAgentModeConfig(config) {
8442
+ const lines = config.split(/\n/);
8443
+ const output = [];
8444
+ let inRoot = true;
8445
+ let changed = false;
8446
+ for (const line of lines) {
8447
+ const sectionHeader = isSectionHeader2(line);
8448
+ if (inRoot && isRootSetting2(line, CODEX_MULTI_AGENT_MODE_KEY)) {
8449
+ changed = true;
8450
+ continue;
8451
+ }
8452
+ output.push(line);
8453
+ if (sectionHeader)
8454
+ inRoot = false;
8455
+ }
8456
+ return changed ? output.join(`
8457
+ `) : config;
8458
+ }
8459
+ function isSectionHeader2(line) {
8460
+ return isTomlTableHeaderLine(line);
8461
+ }
8462
+ function isRootSetting2(line, key) {
8463
+ const trimmed = line.trimStart();
8464
+ if (trimmed.startsWith("#") || trimmed.startsWith("["))
8465
+ return false;
8466
+ const match = trimmed.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=/);
8467
+ return match?.[1] === key;
8468
+ }
8469
+
8018
8470
  // packages/omo-codex/src/install/codex-multi-agent-v2-config.ts
8471
+ var CODEX_AGENTS_HEADER = "agents";
8019
8472
  var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
8020
- var CODEX_MULTI_AGENT_V2_MAX_CONCURRENT_THREADS_PER_SESSION = 1e4;
8473
+ var CODEX_SUBAGENT_THREAD_LIMIT = 1000;
8021
8474
  function ensureCodexMultiAgentV2Config(config) {
8022
- const normalizedConfig = removeLegacyAgentsMaxThreadsSetting(removeFeatureFlagSetting(config, "multi_agent_v2"));
8023
- const section = findTomlSection(normalizedConfig, CODEX_MULTI_AGENT_V2_HEADER);
8024
- const maxThreadsValue = CODEX_MULTI_AGENT_V2_MAX_CONCURRENT_THREADS_PER_SESSION.toString();
8475
+ const featureFlag = removeFeatureFlagSetting(config, "multi_agent_v2");
8476
+ const agentsConfig = ensureAgentsMaxThreads(featureFlag.config);
8477
+ const section = findTomlSection(agentsConfig, CODEX_MULTI_AGENT_V2_HEADER);
8478
+ const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
8025
8479
  if (!section) {
8026
- return appendBlock(normalizedConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
8480
+ const enabledSetting = featureFlag.value === false ? `enabled = false
8481
+ ` : "";
8482
+ return appendBlock(agentsConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
8483
+ ${enabledSetting}max_concurrent_threads_per_session = ${maxThreadsValue}
8484
+ `);
8485
+ }
8486
+ const withPreservedDisable = featureFlag.value === false ? replaceOrInsertSetting(agentsConfig, section, "enabled", "false") : agentsConfig;
8487
+ const updatedSection = featureFlag.value === false ? findTomlSection(withPreservedDisable, CODEX_MULTI_AGENT_V2_HEADER) : section;
8488
+ if (!updatedSection) {
8489
+ return appendBlock(withPreservedDisable, `[${CODEX_MULTI_AGENT_V2_HEADER}]
8490
+ enabled = false
8027
8491
  max_concurrent_threads_per_session = ${maxThreadsValue}
8028
8492
  `);
8029
8493
  }
8030
- return replaceOrInsertSetting(normalizedConfig, section, "max_concurrent_threads_per_session", maxThreadsValue);
8494
+ return replaceOrInsertSetting(withPreservedDisable, updatedSection, "max_concurrent_threads_per_session", maxThreadsValue);
8031
8495
  }
8032
8496
  function removeFeatureFlagSetting(config, featureName) {
8033
8497
  const section = findTomlSection(config, "features");
8034
8498
  if (!section)
8035
- return config;
8036
- return removeSetting(config, section, featureName);
8499
+ return { config, value: null };
8500
+ return {
8501
+ config: removeSetting(config, section, featureName),
8502
+ value: readBooleanSetting(section.text, featureName)
8503
+ };
8037
8504
  }
8038
- function removeLegacyAgentsMaxThreadsSetting(config) {
8039
- const section = findTomlSection(config, "agents");
8040
- if (!section)
8041
- return config;
8042
- return removeSetting(config, section, "max_threads");
8505
+ function ensureAgentsMaxThreads(config) {
8506
+ const maxThreadsValue = CODEX_SUBAGENT_THREAD_LIMIT.toString();
8507
+ const section = findTomlSection(config, CODEX_AGENTS_HEADER);
8508
+ if (!section) {
8509
+ return appendBlock(config, `[${CODEX_AGENTS_HEADER}]
8510
+ max_threads = ${maxThreadsValue}
8511
+ `);
8512
+ }
8513
+ return replaceOrInsertSetting(config, section, "max_threads", maxThreadsValue);
8514
+ }
8515
+ function readBooleanSetting(sectionText, key) {
8516
+ const match = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=\\s*(true|false)\\s*(?:#.*)?$`, "m").exec(sectionText);
8517
+ if (!match)
8518
+ return null;
8519
+ return match[1] === "true";
8043
8520
  }
8044
8521
 
8045
8522
  // packages/omo-codex/src/install/codex-config-toml.ts
8046
8523
  async function updateCodexConfig(input) {
8047
- await mkdir5(dirname5(input.configPath), { recursive: true });
8524
+ await mkdir5(dirname6(input.configPath), { recursive: true });
8048
8525
  let config = "";
8049
8526
  if (await exists(input.configPath))
8050
8527
  config = await readFile10(input.configPath, "utf8");
@@ -8061,6 +8538,7 @@ async function updateCodexConfig(input) {
8061
8538
  config = ensureFeatureEnabled(config, "plugin_hooks");
8062
8539
  config = ensureFeatureEnabled(config, "multi_agent");
8063
8540
  config = ensureFeatureEnabled(config, "child_agents_md");
8541
+ config = removeUnsupportedCodexMultiAgentModeConfig(config);
8064
8542
  config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(input.repoRoot));
8065
8543
  config = ensureCodexMultiAgentV2Config(config);
8066
8544
  if (input.autonomousPermissions === true)
@@ -8095,7 +8573,7 @@ async function exists(path) {
8095
8573
  // packages/omo-codex/src/install/codex-hook-trust.ts
8096
8574
  import { createHash } from "node:crypto";
8097
8575
  import { readFile as readFile11 } from "node:fs/promises";
8098
- import { join as join16 } from "node:path";
8576
+ import { join as join17 } from "node:path";
8099
8577
  var EVENT_LABELS = new Map([
8100
8578
  ["PreToolUse", "pre_tool_use"],
8101
8579
  ["PermissionRequest", "permission_request"],
@@ -8109,7 +8587,7 @@ var EVENT_LABELS = new Map([
8109
8587
  ["Stop", "stop"]
8110
8588
  ]);
8111
8589
  async function trustedHookStatesForPlugin(input) {
8112
- const manifestPath = join16(input.pluginRoot, ".codex-plugin", "plugin.json");
8590
+ const manifestPath = join17(input.pluginRoot, ".codex-plugin", "plugin.json");
8113
8591
  if (!await exists2(manifestPath))
8114
8592
  return [];
8115
8593
  const manifest = JSON.parse(await readFile11(manifestPath, "utf8"));
@@ -8117,7 +8595,7 @@ async function trustedHookStatesForPlugin(input) {
8117
8595
  return [];
8118
8596
  const states = [];
8119
8597
  for (const hookPath of hookManifestPaths2(manifest.hooks)) {
8120
- const hooksPath = join16(input.pluginRoot, hookPath);
8598
+ const hooksPath = join17(input.pluginRoot, hookPath);
8121
8599
  if (!await exists2(hooksPath))
8122
8600
  continue;
8123
8601
  const parsed = JSON.parse(await readFile11(hooksPath, "utf8"));
@@ -8125,7 +8603,8 @@ async function trustedHookStatesForPlugin(input) {
8125
8603
  continue;
8126
8604
  states.push(...trustedHookStatesForHooksFile({
8127
8605
  keySource: `${input.pluginName}@${input.marketplaceName}:${hookPath}`,
8128
- hooks: parsed.hooks
8606
+ hooks: parsed.hooks,
8607
+ platform: input.platform ?? process.platform
8129
8608
  }));
8130
8609
  }
8131
8610
  return states;
@@ -8153,20 +8632,28 @@ function trustedHookStatesForHooksFile(input) {
8153
8632
  continue;
8154
8633
  if (handler.async === true)
8155
8634
  continue;
8156
- if (typeof handler.command !== "string" || handler.command.trim() === "")
8635
+ const command = commandForPlatform(handler, input.platform);
8636
+ if (command === undefined || command.trim() === "")
8157
8637
  continue;
8158
8638
  const key = `${input.keySource}:${eventLabel}:${groupIndex}:${handlerIndex}`;
8159
- states.push({ key, trustedHash: commandHookHash(eventLabel, group.matcher, handler) });
8639
+ states.push({ key, trustedHash: commandHookHash(eventLabel, group.matcher, handler, command) });
8160
8640
  }
8161
8641
  }
8162
8642
  }
8163
8643
  return states;
8164
8644
  }
8165
- function commandHookHash(eventName, matcher, handler) {
8645
+ function commandForPlatform(handler, platform) {
8646
+ if (typeof handler.command !== "string")
8647
+ return;
8648
+ if (platform === "win32" && typeof handler.commandWindows === "string")
8649
+ return handler.commandWindows;
8650
+ return handler.command;
8651
+ }
8652
+ function commandHookHash(eventName, matcher, handler, command) {
8166
8653
  const timeout = Math.max(Number(handler.timeout ?? 600), 1);
8167
8654
  const normalizedHandler = {
8168
8655
  type: "command",
8169
- command: handler.command,
8656
+ command,
8170
8657
  timeout,
8171
8658
  async: false
8172
8659
  };
@@ -8204,25 +8691,13 @@ async function exists2(path) {
8204
8691
  }
8205
8692
 
8206
8693
  // packages/omo-codex/src/install/git-bash.ts
8207
- var SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY = "OMO_CODEX_SKIP_GIT_BASH_AUTO_INSTALL";
8208
8694
  var resolveGitBashForCurrentProcess2 = (input = {}) => {
8209
8695
  return toCodexResolution(resolveGitBashForCurrentProcess(input));
8210
8696
  };
8211
8697
  async function prepareGitBashForInstall(input) {
8212
8698
  const resolve6 = input.resolveGitBash ?? (() => resolveGitBashForCurrentProcess2({ platform: input.platform, env: input.env }));
8213
8699
  const initialResolution = resolve6();
8214
- if (input.platform !== "win32" || initialResolution.found)
8215
- return initialResolution;
8216
- if (input.env[SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY] === "1")
8217
- return initialResolution;
8218
- try {
8219
- await input.runCommand("winget", WINGET_INSTALL_ARGS, { cwd: input.cwd });
8220
- } catch (error) {
8221
- if (!(error instanceof Error))
8222
- throw error;
8223
- return initialResolution;
8224
- }
8225
- return resolve6();
8700
+ return initialResolution;
8226
8701
  }
8227
8702
  function toCodexResolution(resolution) {
8228
8703
  if (resolution.found) {
@@ -8246,11 +8721,11 @@ function toCodexResolution(resolution) {
8246
8721
 
8247
8722
  // packages/omo-codex/src/install/link-cached-plugin-agents.ts
8248
8723
  import { copyFile, lstat as lstat7, mkdir as mkdir6, readFile as readFile13, readdir as readdir4, rm as rm6, writeFile as writeFile6 } from "node:fs/promises";
8249
- import { basename as basename4, join as join18 } from "node:path";
8724
+ import { basename as basename5, join as join19 } from "node:path";
8250
8725
 
8251
8726
  // packages/omo-codex/src/install/retired-managed-agent-purge.ts
8252
8727
  import { lstat as lstat6, readFile as readFile12, rm as rm5 } from "node:fs/promises";
8253
- import { join as join17 } from "node:path";
8728
+ import { join as join18 } from "node:path";
8254
8729
  var RETIRED_MANAGED_AGENT_FILES = [
8255
8730
  {
8256
8731
  fileName: "codex-ultrawork-reviewer.toml",
@@ -8262,11 +8737,11 @@ var RETIRED_MANAGED_AGENT_FILES = [
8262
8737
  }
8263
8738
  ];
8264
8739
  async function purgeRetiredManagedAgentFiles(input) {
8265
- const agentsDir = join17(input.codexHome, "agents");
8740
+ const agentsDir = join18(input.codexHome, "agents");
8266
8741
  if (!await exists3(agentsDir))
8267
8742
  return;
8268
8743
  for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
8269
- const agentPath = join17(agentsDir, retiredAgent.fileName);
8744
+ const agentPath = join18(agentsDir, retiredAgent.fileName);
8270
8745
  if (!await exists3(agentPath))
8271
8746
  continue;
8272
8747
  const agentStat = await lstat6(agentPath);
@@ -8309,7 +8784,7 @@ function nodeErrorCode(error) {
8309
8784
  // packages/omo-codex/src/install/link-cached-plugin-agents.ts
8310
8785
  var MANIFEST_FILE = ".installed-agents.json";
8311
8786
  async function capturePreservedAgentReasoning(input) {
8312
- const agentsDir = join18(input.codexHome, "agents");
8787
+ const agentsDir = join19(input.codexHome, "agents");
8313
8788
  if (!await exists4(agentsDir))
8314
8789
  return new Map;
8315
8790
  const preserved = new Map;
@@ -8317,7 +8792,7 @@ async function capturePreservedAgentReasoning(input) {
8317
8792
  for (const entry of agentEntries) {
8318
8793
  if (!entry.name.endsWith(".toml"))
8319
8794
  continue;
8320
- const content = await readTextIfExists2(join18(agentsDir, entry.name));
8795
+ const content = await readTextIfExists2(join19(agentsDir, entry.name));
8321
8796
  if (content === null)
8322
8797
  continue;
8323
8798
  const effort = extractReasoningEffort(content);
@@ -8327,7 +8802,7 @@ async function capturePreservedAgentReasoning(input) {
8327
8802
  return preserved;
8328
8803
  }
8329
8804
  async function capturePreservedAgentServiceTier(input) {
8330
- const agentsDir = join18(input.codexHome, "agents");
8805
+ const agentsDir = join19(input.codexHome, "agents");
8331
8806
  if (!await exists4(agentsDir))
8332
8807
  return new Map;
8333
8808
  const preserved = new Map;
@@ -8335,7 +8810,7 @@ async function capturePreservedAgentServiceTier(input) {
8335
8810
  for (const entry of agentEntries) {
8336
8811
  if (!entry.name.endsWith(".toml"))
8337
8812
  continue;
8338
- const content = await readTextIfExists2(join18(agentsDir, entry.name));
8813
+ const content = await readTextIfExists2(join19(agentsDir, entry.name));
8339
8814
  if (content === null)
8340
8815
  continue;
8341
8816
  preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
@@ -8349,13 +8824,13 @@ async function linkCachedPluginAgents(input) {
8349
8824
  await writeManifest(input.pluginRoot, []);
8350
8825
  return [];
8351
8826
  }
8352
- const agentsDir = join18(input.codexHome, "agents");
8827
+ const agentsDir = join19(input.codexHome, "agents");
8353
8828
  await mkdir6(agentsDir, { recursive: true });
8354
8829
  const linked = [];
8355
8830
  for (const agentPath of bundledAgents) {
8356
- const agentFileName = basename4(agentPath);
8831
+ const agentFileName = basename5(agentPath);
8357
8832
  const agentName = agentNameFromToml(agentFileName);
8358
- const linkPath = join18(agentsDir, agentFileName);
8833
+ const linkPath = join19(agentsDir, agentFileName);
8359
8834
  await replaceWithCopy(linkPath, agentPath);
8360
8835
  await restorePreservedReasoning({
8361
8836
  agentName,
@@ -8385,7 +8860,7 @@ async function restorePreservedServiceTier(input) {
8385
8860
  await writeFile6(input.linkPath, replacement.content);
8386
8861
  }
8387
8862
  async function discoverBundledAgents(pluginRoot) {
8388
- const componentsRoot = join18(pluginRoot, "components");
8863
+ const componentsRoot = join19(pluginRoot, "components");
8389
8864
  if (!await exists4(componentsRoot))
8390
8865
  return [];
8391
8866
  const componentEntries = await readdir4(componentsRoot, { withFileTypes: true });
@@ -8393,14 +8868,14 @@ async function discoverBundledAgents(pluginRoot) {
8393
8868
  for (const entry of componentEntries) {
8394
8869
  if (!entry.isDirectory())
8395
8870
  continue;
8396
- const agentsRoot = join18(componentsRoot, entry.name, "agents");
8871
+ const agentsRoot = join19(componentsRoot, entry.name, "agents");
8397
8872
  if (!await exists4(agentsRoot))
8398
8873
  continue;
8399
8874
  const agentEntries = await readdir4(agentsRoot, { withFileTypes: true });
8400
8875
  for (const file2 of agentEntries) {
8401
8876
  if (!file2.isFile() || !file2.name.endsWith(".toml"))
8402
8877
  continue;
8403
- agents.push(join18(agentsRoot, file2.name));
8878
+ agents.push(join19(agentsRoot, file2.name));
8404
8879
  }
8405
8880
  }
8406
8881
  agents.sort();
@@ -8420,7 +8895,7 @@ async function prepareReplacement(linkPath) {
8420
8895
  await rm6(linkPath, { force: true });
8421
8896
  }
8422
8897
  async function writeManifest(pluginRoot, agentPaths) {
8423
- const manifestPath = join18(pluginRoot, MANIFEST_FILE);
8898
+ const manifestPath = join19(pluginRoot, MANIFEST_FILE);
8424
8899
  const payload = { agents: [...agentPaths].sort() };
8425
8900
  await writeFile6(manifestPath, `${JSON.stringify(payload, null, "\t")}
8426
8901
  `);
@@ -8454,7 +8929,7 @@ function extractServiceTier(content) {
8454
8929
  }
8455
8930
  function extractTopLevelStringSetting(content, key) {
8456
8931
  for (const line of content.split(/\n/)) {
8457
- if (isSectionHeader2(line))
8932
+ if (isSectionHeader3(line))
8458
8933
  return null;
8459
8934
  const rawValue = topLevelStringSettingRawValue(line, key);
8460
8935
  if (rawValue === undefined)
@@ -8475,7 +8950,7 @@ function replaceTopLevelStringSetting(content, key, value, options) {
8475
8950
  const lines = content.split(/\n/);
8476
8951
  for (let index = 0;index < lines.length; index += 1) {
8477
8952
  const line = lines[index];
8478
- if (line === undefined || isSectionHeader2(line))
8953
+ if (line === undefined || isSectionHeader3(line))
8479
8954
  break;
8480
8955
  if (topLevelStringSettingRawValue(line, key) === undefined)
8481
8956
  continue;
@@ -8505,7 +8980,7 @@ function topLevelStringSettingRawValue(line, key) {
8505
8980
  return rawValue;
8506
8981
  }
8507
8982
  function topLevelInsertionIndex(lines) {
8508
- const sectionIndex = lines.findIndex((line) => isSectionHeader2(line));
8983
+ const sectionIndex = lines.findIndex((line) => isSectionHeader3(line));
8509
8984
  const topLevelEnd = sectionIndex === -1 ? lines.length : sectionIndex;
8510
8985
  let insertionIndex = topLevelEnd;
8511
8986
  while (insertionIndex > 0 && lines[insertionIndex - 1] === "") {
@@ -8513,7 +8988,7 @@ function topLevelInsertionIndex(lines) {
8513
8988
  }
8514
8989
  return insertionIndex;
8515
8990
  }
8516
- function isSectionHeader2(line) {
8991
+ function isSectionHeader3(line) {
8517
8992
  const trimmed = line.trim();
8518
8993
  return trimmed.startsWith("[") && trimmed.endsWith("]");
8519
8994
  }
@@ -8548,10 +9023,10 @@ function nodeErrorCode2(error) {
8548
9023
 
8549
9024
  // packages/omo-codex/src/install/codex-marketplace.ts
8550
9025
  import { readFile as readFile14 } from "node:fs/promises";
8551
- import { join as join19 } from "node:path";
9026
+ import { join as join20 } from "node:path";
8552
9027
  var DEFAULT_MARKETPLACE_PATH = "packages/omo-codex/marketplace.json";
8553
9028
  async function readMarketplace(repoRoot, options) {
8554
- const marketplacePath = options?.marketplacePath ?? join19(repoRoot, DEFAULT_MARKETPLACE_PATH);
9029
+ const marketplacePath = options?.marketplacePath ?? join20(repoRoot, DEFAULT_MARKETPLACE_PATH);
8555
9030
  const raw = await readFile14(marketplacePath, "utf8");
8556
9031
  const parsed = JSON.parse(raw);
8557
9032
  if (!isPlainRecord(parsed))
@@ -8570,10 +9045,10 @@ async function readMarketplace(repoRoot, options) {
8570
9045
  function resolvePluginSource(repoRoot, plugin, options) {
8571
9046
  const sourcePath = localSourcePath(options?.pathOverride ?? plugin.source);
8572
9047
  const relativePath = sourcePath.slice(2);
8573
- return join19(repoRoot, ...relativePath.split(/[\\/]/));
9048
+ return join20(repoRoot, ...relativePath.split(/[\\/]/));
8574
9049
  }
8575
9050
  async function readPluginManifest(pluginRoot) {
8576
- const raw = await readFile14(join19(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
9051
+ const raw = await readFile14(join20(pluginRoot, ".codex-plugin", "plugin.json"), "utf8");
8577
9052
  const parsed = JSON.parse(raw);
8578
9053
  if (!isPlainRecord(parsed))
8579
9054
  throw new Error(`${pluginRoot} plugin.json must be an object`);
@@ -8655,7 +9130,7 @@ function validateLocalSourcePath(path) {
8655
9130
 
8656
9131
  // packages/omo-codex/src/install/codex-marketplace-snapshot.ts
8657
9132
  import { cp as cp3, mkdir as mkdir7, rename as rename3, rm as rm7, writeFile as writeFile7 } from "node:fs/promises";
8658
- import { join as join20, sep as sep6 } from "node:path";
9133
+ import { join as join21, sep as sep6 } from "node:path";
8659
9134
  var INSTALLED_MARKETPLACES_DIR = ".tmp/marketplaces";
8660
9135
  async function writeInstalledMarketplaceSnapshot(input) {
8661
9136
  const marketplaceRoot = installedMarketplaceRoot(input.codexHome, input.marketplace.name);
@@ -8668,21 +9143,21 @@ async function writeInstalledMarketplaceSnapshot(input) {
8668
9143
  return snapshotPlugins;
8669
9144
  }
8670
9145
  function installedMarketplaceRoot(codexHome, marketplaceName) {
8671
- return join20(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
9146
+ return join21(codexHome, INSTALLED_MARKETPLACES_DIR, marketplaceName);
8672
9147
  }
8673
9148
  async function writeMarketplaceManifest(marketplaceRoot, marketplace) {
8674
- const manifestDir = join20(marketplaceRoot, ".agents", "plugins");
9149
+ const manifestDir = join21(marketplaceRoot, ".agents", "plugins");
8675
9150
  await mkdir7(manifestDir, { recursive: true });
8676
- const tempPath = join20(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
9151
+ const tempPath = join21(manifestDir, `.marketplace-${process.pid}-${Date.now()}.json.tmp`);
8677
9152
  await writeFile7(tempPath, `${JSON.stringify(marketplace, null, "\t")}
8678
9153
  `);
8679
- await rename3(tempPath, join20(manifestDir, "marketplace.json"));
9154
+ await rename3(tempPath, join21(manifestDir, "marketplace.json"));
8680
9155
  }
8681
9156
  async function writeSnapshotPlugin(marketplaceRoot, plugin) {
8682
- const pluginsDir = join20(marketplaceRoot, "plugins");
9157
+ const pluginsDir = join21(marketplaceRoot, "plugins");
8683
9158
  await mkdir7(pluginsDir, { recursive: true });
8684
- const targetPath = join20(pluginsDir, plugin.name);
8685
- const tempPath = join20(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
9159
+ const targetPath = join21(pluginsDir, plugin.name);
9160
+ const tempPath = join21(pluginsDir, `.tmp-${plugin.name}-${process.pid}-${Date.now()}`);
8686
9161
  await rm7(tempPath, { recursive: true, force: true });
8687
9162
  await cp3(plugin.sourcePath, tempPath, {
8688
9163
  recursive: true,
@@ -8704,10 +9179,10 @@ function shouldCopyMarketplaceSourcePath(path, root) {
8704
9179
 
8705
9180
  // packages/omo-codex/src/install/lazycodex-version-stamp.ts
8706
9181
  import { readdir as readdir5, readFile as readFile15, writeFile as writeFile8 } from "node:fs/promises";
8707
- import { join as join21 } from "node:path";
9182
+ import { join as join22 } from "node:path";
8708
9183
  async function readDistributionManifest(repoRoot) {
8709
9184
  try {
8710
- const parsed = JSON.parse(await readFile15(join21(repoRoot, "package.json"), "utf8"));
9185
+ const parsed = JSON.parse(await readFile15(join22(repoRoot, "package.json"), "utf8"));
8711
9186
  if (!isPlainRecord(parsed) || typeof parsed.version !== "string" || parsed.version.trim().length === 0)
8712
9187
  return;
8713
9188
  return {
@@ -8727,19 +9202,19 @@ function resolveLazyCodexPluginVersion(input) {
8727
9202
  return input.manifestVersion ?? "local";
8728
9203
  }
8729
9204
  async function stampLazyCodexPluginVersion(input) {
8730
- const manifestPath = join21(input.pluginRoot, ".codex-plugin", "plugin.json");
9205
+ const manifestPath = join22(input.pluginRoot, ".codex-plugin", "plugin.json");
8731
9206
  const hookPaths = await readPluginHookPaths(manifestPath);
8732
9207
  await stampJsonVersion(manifestPath, input.version);
8733
- await stampJsonVersion(join21(input.pluginRoot, "package.json"), input.version);
9208
+ await stampJsonVersion(join22(input.pluginRoot, "package.json"), input.version);
8734
9209
  for (const hookPath of hookPaths) {
8735
- await stampHookStatusMessages(join21(input.pluginRoot, hookPath), input.version);
9210
+ await stampHookStatusMessages(join22(input.pluginRoot, hookPath), input.version);
8736
9211
  }
8737
9212
  await stampComponentVersions(input);
8738
9213
  }
8739
9214
  async function writeLazyCodexInstallSnapshot(input) {
8740
9215
  if (input.distributionManifest === undefined)
8741
9216
  return;
8742
- await writeFile8(join21(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
9217
+ await writeFile8(join22(input.pluginRoot, "lazycodex-install.json"), `${JSON.stringify({
8743
9218
  packageName: input.distributionManifest.name,
8744
9219
  version: input.distributionManifest.version
8745
9220
  }, null, "\t")}
@@ -8796,16 +9271,16 @@ async function stampHookStatusMessages(path, version) {
8796
9271
  async function stampComponentVersions(input) {
8797
9272
  let entries;
8798
9273
  try {
8799
- entries = await readdir5(join21(input.pluginRoot, "components"));
9274
+ entries = await readdir5(join22(input.pluginRoot, "components"));
8800
9275
  } catch (error) {
8801
9276
  if (error instanceof Error)
8802
9277
  return;
8803
9278
  throw error;
8804
9279
  }
8805
9280
  for (const entry of entries) {
8806
- const componentRoot = join21(input.pluginRoot, "components", entry);
8807
- await stampJsonVersion(join21(componentRoot, "package.json"), input.version);
8808
- await stampHookStatusMessages(join21(componentRoot, "hooks", "hooks.json"), input.version);
9281
+ const componentRoot = join22(input.pluginRoot, "components", entry);
9282
+ await stampJsonVersion(join22(componentRoot, "package.json"), input.version);
9283
+ await stampHookStatusMessages(join22(componentRoot, "hooks", "hooks.json"), input.version);
8809
9284
  }
8810
9285
  }
8811
9286
  function stampHookGroups(hooks, version) {
@@ -8831,7 +9306,7 @@ function stampHookStatusMessage(hook, version) {
8831
9306
 
8832
9307
  // packages/omo-codex/src/install/codex-project-local-cleanup.ts
8833
9308
  import { copyFile as copyFile2, lstat as lstat8, readFile as readFile16, writeFile as writeFile9 } from "node:fs/promises";
8834
- import { dirname as dirname6, join as join22, resolve as resolve6 } from "node:path";
9309
+ import { dirname as dirname7, join as join23, resolve as resolve6 } from "node:path";
8835
9310
  var LEGACY_AGENT_CONFLICT_KEYS = ["max_threads"];
8836
9311
  var PROJECT_LOCAL_ARTIFACT_PATHS = [
8837
9312
  ".codex/hooks.json",
@@ -8934,37 +9409,37 @@ async function findProjectLocalCodexConfigs(startDirectory, codexHome) {
8934
9409
  if (startDirectoryStat !== null && !startDirectoryStat.isDirectory()) {
8935
9410
  throw new ProjectLocalCleanupStartDirectoryError(startDirectory);
8936
9411
  }
8937
- const codexHomeConfigPath = codexHome === undefined ? null : join22(resolve6(codexHome), "config.toml");
9412
+ const codexHomeConfigPath = codexHome === undefined ? null : join23(resolve6(codexHome), "config.toml");
8938
9413
  let current = resolve6(startDirectory);
8939
9414
  const configPathsFromCwd = [];
8940
9415
  while (true) {
8941
- const configPath = join22(current, ".codex", "config.toml");
9416
+ const configPath = join23(current, ".codex", "config.toml");
8942
9417
  if (await isRegularProjectLocalConfig(current, configPath)) {
8943
9418
  if (codexHomeConfigPath === null || resolve6(configPath) !== codexHomeConfigPath) {
8944
9419
  configPathsFromCwd.push(configPath);
8945
9420
  }
8946
9421
  }
8947
- if (await exists5(join22(current, ".git"))) {
9422
+ if (await exists5(join23(current, ".git"))) {
8948
9423
  return configPathsFromCwd.length === 0 ? null : {
8949
9424
  projectRoot: current,
8950
9425
  configPaths: [...configPathsFromCwd].reverse(),
8951
9426
  artifactRoots: artifactRootsForConfigPaths(configPathsFromCwd)
8952
9427
  };
8953
9428
  }
8954
- const parent = dirname6(current);
9429
+ const parent = dirname7(current);
8955
9430
  if (parent === current) {
8956
9431
  const nearestConfigPath = configPathsFromCwd[0];
8957
9432
  return nearestConfigPath === undefined ? null : {
8958
- projectRoot: dirname6(dirname6(nearestConfigPath)),
9433
+ projectRoot: dirname7(dirname7(nearestConfigPath)),
8959
9434
  configPaths: [nearestConfigPath],
8960
- artifactRoots: [dirname6(dirname6(nearestConfigPath))]
9435
+ artifactRoots: [dirname7(dirname7(nearestConfigPath))]
8961
9436
  };
8962
9437
  }
8963
9438
  current = parent;
8964
9439
  }
8965
9440
  }
8966
9441
  async function isRegularProjectLocalConfig(directory, configPath) {
8967
- const codexDirStat = await maybeLstat(join22(directory, ".codex"));
9442
+ const codexDirStat = await maybeLstat(join23(directory, ".codex"));
8968
9443
  if (codexDirStat === null || !codexDirStat.isDirectory() || codexDirStat.isSymbolicLink())
8969
9444
  return false;
8970
9445
  const configStat = await maybeLstat(configPath);
@@ -8973,7 +9448,7 @@ async function isRegularProjectLocalConfig(directory, configPath) {
8973
9448
  function artifactRootsForConfigPaths(configPaths) {
8974
9449
  const roots = [];
8975
9450
  for (const configPath of configPaths) {
8976
- const root = dirname6(dirname6(configPath));
9451
+ const root = dirname7(dirname7(configPath));
8977
9452
  if (!roots.includes(root))
8978
9453
  roots.push(root);
8979
9454
  }
@@ -8984,7 +9459,7 @@ async function collectProjectLocalArtifacts(projectRoots) {
8984
9459
  const seenPaths = new Set;
8985
9460
  for (const projectRoot of projectRoots) {
8986
9461
  for (const relativePath of PROJECT_LOCAL_ARTIFACT_PATHS) {
8987
- const artifactPath = join22(projectRoot, relativePath);
9462
+ const artifactPath = join23(projectRoot, relativePath);
8988
9463
  if (seenPaths.has(artifactPath))
8989
9464
  continue;
8990
9465
  const entryStat = await maybeLstat(artifactPath);
@@ -9061,11 +9536,11 @@ function formatUnknownError(error) {
9061
9536
  // packages/omo-codex/src/install/lsp-daemon-reaper.ts
9062
9537
  import { readFile as readFile17, readdir as readdir6, rm as rm8 } from "node:fs/promises";
9063
9538
  import { connect } from "node:net";
9064
- import { join as join23 } from "node:path";
9539
+ import { join as join24 } from "node:path";
9065
9540
  async function reapLspDaemons(codexHome, deps = {}) {
9066
9541
  const killProcess = deps.killProcess ?? sendSigterm;
9067
9542
  const isDaemonLive = deps.isDaemonLive ?? probeSocketLive;
9068
- const daemonRoot = join23(codexHome, "codex-lsp", "daemon");
9543
+ const daemonRoot = join24(codexHome, "codex-lsp", "daemon");
9069
9544
  const reaped = [];
9070
9545
  let entries;
9071
9546
  try {
@@ -9074,9 +9549,9 @@ async function reapLspDaemons(codexHome, deps = {}) {
9074
9549
  return reaped;
9075
9550
  }
9076
9551
  for (const entry of entries) {
9077
- const versionDir = join23(daemonRoot, entry);
9078
- const pid = await readPidFile(join23(versionDir, "daemon.pid"));
9079
- const socketPath = await readEndpointFile(join23(versionDir, "daemon.endpoint"));
9552
+ const versionDir = join24(daemonRoot, entry);
9553
+ const pid = await readPidFile(join24(versionDir, "daemon.pid"));
9554
+ const socketPath = await readEndpointFile(join24(versionDir, "daemon.endpoint"));
9080
9555
  if (pid !== null && socketPath !== null && await isDaemonLive(socketPath) && killProcess(pid)) {
9081
9556
  reaped.push(pid);
9082
9557
  }
@@ -9130,7 +9605,7 @@ function sendSigterm(pid) {
9130
9605
 
9131
9606
  // packages/omo-codex/src/install/codex-installer-bin-dir.ts
9132
9607
  import { homedir } from "node:os";
9133
- import { join as join24, resolve as resolve7 } from "node:path";
9608
+ import { join as join25, resolve as resolve7 } from "node:path";
9134
9609
  function resolveCodexInstallerBinDir(input) {
9135
9610
  const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
9136
9611
  if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
@@ -9139,15 +9614,15 @@ function resolveCodexInstallerBinDir(input) {
9139
9614
  const defaultCodexHome = resolve7(homeDir, ".codex");
9140
9615
  const resolvedCodexHome = resolve7(input.codexHome);
9141
9616
  if (resolvedCodexHome !== defaultCodexHome)
9142
- return join24(resolvedCodexHome, "bin");
9617
+ return join25(resolvedCodexHome, "bin");
9143
9618
  return resolve7(homeDir, ".local", "bin");
9144
9619
  }
9145
9620
 
9146
9621
  // packages/omo-codex/src/install/omo-sot-migration.ts
9147
- import { join as join25 } from "node:path";
9622
+ import { join as join26 } from "node:path";
9148
9623
  async function seedAndMigrateOmoSot(input) {
9149
9624
  const commandEnv = { ...input.env };
9150
- const scriptPath = join25(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
9625
+ const scriptPath = join26(input.repoRoot, "packages", "omo-codex", "plugin", "scripts", "migrate-omo-sot.mjs");
9151
9626
  try {
9152
9627
  await input.runCommand(process.execPath, [scriptPath, "--seed"], {
9153
9628
  cwd: input.repoRoot,
@@ -12132,12 +12607,12 @@ function runtimeSlug(platform = process.platform, arch = process.arch) {
12132
12607
  }
12133
12608
  // packages/utils/src/ast-grep/install-script.ts
12134
12609
  import { spawn as spawn3 } from "node:child_process";
12135
- import { existsSync as existsSync3 } from "node:fs";
12136
- import { join as join26 } from "node:path";
12610
+ import { existsSync as existsSync4 } from "node:fs";
12611
+ import { join as join27 } from "node:path";
12137
12612
  var AST_GREP_BIN_DIR_ENV_KEY = "OMO_AST_GREP_BIN_DIR";
12138
12613
  var AST_GREP_INSTALL_TIMEOUT_MS = 30000;
12139
12614
  function astGrepRuntimeDir(baseDir, platform = process.platform, arch = process.arch) {
12140
- return join26(baseDir, "runtime", "ast-grep", runtimeSlug(platform, arch));
12615
+ return join27(baseDir, "runtime", "ast-grep", runtimeSlug(platform, arch));
12141
12616
  }
12142
12617
  function isMissingExecutable(error) {
12143
12618
  if (!("code" in error))
@@ -12175,7 +12650,7 @@ function defaultSpawnProcess(command, args, options) {
12175
12650
  };
12176
12651
  }
12177
12652
  function scriptPathForPlatform(skillDir, platform) {
12178
- return join26(skillDir, platform === "win32" ? "install.ps1" : "install.sh");
12653
+ return join27(skillDir, platform === "win32" ? "install.ps1" : "install.sh");
12179
12654
  }
12180
12655
  function invocationsForPlatform(scriptPath, platform) {
12181
12656
  if (platform !== "win32")
@@ -12203,7 +12678,7 @@ function failedReason(outcome) {
12203
12678
  }
12204
12679
  async function runAstGrepSkillInstall(options) {
12205
12680
  const platform = options.platform ?? process.platform;
12206
- const fileExists = options.fileExists ?? existsSync3;
12681
+ const fileExists = options.fileExists ?? existsSync4;
12207
12682
  const scriptPath = scriptPathForPlatform(options.skillDir, platform);
12208
12683
  if (!fileExists(scriptPath))
12209
12684
  return { kind: "skipped", reason: `missing ${scriptPath}` };
@@ -12232,111 +12707,46 @@ async function runAstGrepSkillInstall(options) {
12232
12707
  return { kind: "failed", reason: String(error) };
12233
12708
  }
12234
12709
  }
12235
- // packages/utils/src/codegraph/node-support.ts
12236
- var CODEGRAPH_MIN_NODE_MAJOR = 20;
12237
- var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
12238
- var CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE";
12239
- var CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
12240
- function evaluateCodegraphNodeSupport(options = {}) {
12241
- const nodeVersion = options.nodeVersion ?? process.versions.node;
12242
- const env = options.env ?? process.env;
12243
- const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
12244
- const major = parseNodeMajor(nodeVersion);
12245
- if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
12246
- return { major, override, reason: "too-new", supported: override };
12247
- }
12248
- if (major < CODEGRAPH_MIN_NODE_MAJOR) {
12249
- return { major, override, reason: "too-old", supported: override };
12250
- }
12251
- return { major, override, supported: true };
12252
- }
12253
- function parseNodeMajor(version) {
12254
- const normalized = version.startsWith("v") ? version.slice(1) : version;
12255
- const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
12256
- return Number.isNaN(major) ? 0 : major;
12257
- }
12710
+ // packages/utils/src/codegraph/env.ts
12711
+ var SAFE_AMBIENT_ENV_KEYS = new Set([
12712
+ "APPDATA",
12713
+ "CI",
12714
+ "CODEX_HOME",
12715
+ "ComSpec",
12716
+ "HOME",
12717
+ "HOMEDRIVE",
12718
+ "HOMEPATH",
12719
+ "LANG",
12720
+ "LC_ALL",
12721
+ "LC_CTYPE",
12722
+ "LOCALAPPDATA",
12723
+ "PATH",
12724
+ "PATHEXT",
12725
+ "Path",
12726
+ "SystemRoot",
12727
+ "TEMP",
12728
+ "TMP",
12729
+ "TMPDIR",
12730
+ "USERPROFILE",
12731
+ "WINDIR",
12732
+ "XDG_CACHE_HOME",
12733
+ "XDG_CONFIG_HOME",
12734
+ "XDG_DATA_HOME",
12735
+ "XDG_STATE_HOME"
12736
+ ]);
12737
+ var SAFE_CODEGRAPH_RUNTIME_ENV_KEYS = new Set([
12738
+ "CODEGRAPH_ALLOW_UNSAFE_NODE",
12739
+ "CODEGRAPH_BIN",
12740
+ "CODEGRAPH_FAKE_LOG",
12741
+ "CODEGRAPH_NODE_BIN",
12742
+ "OMO_CODEGRAPH_BIN",
12743
+ "OMO_CODEGRAPH_PROJECT_CWD",
12744
+ "OMO_CODEGRAPH_SESSION_START_CWD"
12745
+ ]);
12258
12746
  // packages/utils/src/codegraph/provision.ts
12259
12747
  import { execFile } from "node:child_process";
12260
12748
  import { promisify } from "node:util";
12261
12749
  var execFileAsync = promisify(execFile);
12262
- // packages/utils/src/codegraph/resolve.ts
12263
- import { existsSync as existsSync4 } from "node:fs";
12264
- import { spawnSync as spawnSync2 } from "node:child_process";
12265
- import { basename as basename5, dirname as dirname7, join as join27 } from "node:path";
12266
- import { createRequire } from "node:module";
12267
- var CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
12268
- var requireFromHere = createRequire(import.meta.url);
12269
- function defaultNodeVersion(nodePath) {
12270
- if (nodePath === process.execPath && isNodeExecutableName(nodePath))
12271
- return process.versions.node;
12272
- try {
12273
- const result = spawnSync2(nodePath, ["--version"], {
12274
- encoding: "utf8",
12275
- timeout: 2000,
12276
- windowsHide: true
12277
- });
12278
- if (result.error !== undefined || result.status !== 0)
12279
- return null;
12280
- const version = `${result.stdout}
12281
- ${result.stderr}`.trim().split(/\s+/)[0];
12282
- return version === undefined || version.length === 0 ? null : version;
12283
- } catch (error) {
12284
- if (error instanceof Error)
12285
- return null;
12286
- throw error;
12287
- }
12288
- }
12289
- function isNodeExecutableName(filePath) {
12290
- const executable = basename5(filePath).toLowerCase();
12291
- return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
12292
- }
12293
- function looksLikePath(command) {
12294
- return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
12295
- }
12296
- function resolveConfiguredNodeRuntime(configured, fileExists, which2) {
12297
- if (looksLikePath(configured))
12298
- return fileExists(configured) ? configured : null;
12299
- return which2(configured);
12300
- }
12301
- function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
12302
- const version = nodeVersion(nodePath);
12303
- if (version === null)
12304
- return false;
12305
- return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
12306
- }
12307
- function defaultNodeRuntime(env, fileExists, which2, nodeVersion) {
12308
- const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
12309
- if (configured !== undefined && configured.length > 0) {
12310
- const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which2);
12311
- return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
12312
- }
12313
- const candidates = [
12314
- ...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
12315
- ...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which2(commandName)).filter((candidate) => candidate !== null)
12316
- ];
12317
- const seen = new Set;
12318
- for (const candidate of candidates) {
12319
- if (seen.has(candidate))
12320
- continue;
12321
- seen.add(candidate);
12322
- if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
12323
- return candidate;
12324
- }
12325
- return null;
12326
- }
12327
- function resolveCodegraphNodeRuntime(options = {}) {
12328
- const env = options.env ?? process.env;
12329
- return defaultNodeRuntime(env, options.fileExists ?? existsSync4, options.which ?? bunWhich, options.nodeVersion ?? defaultNodeVersion);
12330
- }
12331
- function resolveCodegraphNodeSupport(options = {}) {
12332
- const env = options.env ?? process.env;
12333
- const nodeVersion = options.nodeVersion ?? defaultNodeVersion;
12334
- const runtime3 = resolveCodegraphNodeRuntime({ ...options, env, nodeVersion });
12335
- if (runtime3 === null) {
12336
- return evaluateCodegraphNodeSupport({ env, nodeVersion: "0.0.0" });
12337
- }
12338
- return evaluateCodegraphNodeSupport({ env, nodeVersion: nodeVersion(runtime3) ?? "0.0.0" });
12339
- }
12340
12750
  // packages/utils/src/command-executor/execute-command.ts
12341
12751
  import { exec } from "node:child_process";
12342
12752
  import { promisify as promisify2 } from "node:util";
@@ -12540,6 +12950,13 @@ function messageIsTerminalNoReplyUser(message) {
12540
12950
  const initiatorMessage = toInternalInitiatorMessageLike(message);
12541
12951
  return initiatorMessage !== undefined && isTerminalNoReplyUserMessage(initiatorMessage);
12542
12952
  }
12953
+ function messageHasInternalInitiatorMarker(message) {
12954
+ const initiatorMessage = toInternalInitiatorMessageLike(message);
12955
+ if (initiatorMessage === undefined) {
12956
+ return false;
12957
+ }
12958
+ return (initiatorMessage.parts ?? []).some((part) => part.type === "text" && typeof part.text === "string" && hasInternalInitiatorMarker(part.text));
12959
+ }
12543
12960
  var QUESTION_TOOL_NAMES = new Set(["question", "ask_user_question", "askuserquestion"]);
12544
12961
  function partToolName(part) {
12545
12962
  if (typeof part.name === "string") {
@@ -12712,6 +13129,9 @@ function latestAssistantTurnBlocksInternalPrompt(messages) {
12712
13129
  continue;
12713
13130
  }
12714
13131
  if (!sawAssistantAfterLatestUser) {
13132
+ if (messageHasInternalInitiatorMarker(message)) {
13133
+ continue;
13134
+ }
12715
13135
  return true;
12716
13136
  }
12717
13137
  continue;
@@ -13085,8 +13505,6 @@ async function runCodexInstaller(options = {}) {
13085
13505
  const gitBashResolution = await prepareGitBashForInstall({
13086
13506
  platform,
13087
13507
  env: env3,
13088
- cwd: repoRoot,
13089
- runCommand,
13090
13508
  resolveGitBash: platform === "win32" ? options.gitBashResolver ?? (() => resolveGitBashForCurrentProcess2({ platform, env: env3 })) : undefined
13091
13509
  });
13092
13510
  if (!gitBashResolution.found) {
@@ -13173,6 +13591,7 @@ async function runCodexInstaller(options = {}) {
13173
13591
  }
13174
13592
  const trustedHookStates = (await Promise.all(installed.map((plugin) => trustedHookStatesForPlugin({
13175
13593
  marketplaceName: marketplace.name,
13594
+ platform,
13176
13595
  pluginName: plugin.name,
13177
13596
  pluginRoot: plugin.path
13178
13597
  })))).flat();