oh-my-opencode 4.12.1 → 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 (911) 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 +3 -3
  8. package/THIRD-PARTY-NOTICES.md +1 -1
  9. package/dist/agents/sisyphus-agent-factory.d.ts +9 -0
  10. package/dist/agents/sisyphus-runtime-prompt-reconciler.d.ts +31 -0
  11. package/dist/cli/doctor/checks/telemetry.d.ts +2 -0
  12. package/dist/cli/doctor/framework/constants.d.ts +1 -0
  13. package/dist/cli/doctor/framework/doctor-target.d.ts +1 -1
  14. package/dist/cli/index.js +25417 -16991
  15. package/dist/cli-node/index.js +25598 -17172
  16. package/dist/config/schema/codegraph.d.ts +1 -0
  17. package/dist/config/schema/oh-my-opencode-config.d.ts +3 -0
  18. package/dist/config/schema/runtime-fallback.d.ts +1 -0
  19. package/dist/features/background-agent/background-task-marker.d.ts +8 -0
  20. package/dist/features/background-agent/fallback-retry-handler.d.ts +1 -0
  21. package/dist/features/background-agent/manager.d.ts +1 -0
  22. package/dist/features/background-agent/parent-wake-dedupe.d.ts +1 -0
  23. package/dist/features/background-agent/parent-wake-notifier-types.d.ts +2 -0
  24. package/dist/features/background-agent/parent-wake-notifier.d.ts +1 -0
  25. package/dist/features/background-agent/parent-wake-window-recovery.d.ts +2 -0
  26. package/dist/features/team-mode/test-support/async-test-helpers.d.ts +19 -0
  27. package/dist/hooks/atlas/final-wave-approval-gate.d.ts +1 -0
  28. package/dist/hooks/atlas/subagent-completion-reminder.d.ts +30 -0
  29. package/dist/hooks/atlas/types.d.ts +2 -0
  30. package/dist/hooks/atlas/verification-reminders.d.ts +3 -0
  31. package/dist/hooks/runtime-fallback/auto-retry-dispatch.d.ts +2 -2
  32. package/dist/hooks/runtime-fallback/auto-retry-timeout.d.ts +2 -2
  33. package/dist/hooks/runtime-fallback/auto-retry.d.ts +1 -1
  34. package/dist/hooks/runtime-fallback/fallback-state-snapshot.d.ts +13 -0
  35. package/dist/hooks/runtime-fallback/types.d.ts +8 -0
  36. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +1 -0
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +33620 -19652
  39. package/dist/mcp/context7.d.ts +9 -8
  40. package/dist/oh-my-opencode.schema.json +12 -0
  41. package/dist/plugin/runtime-skill-resolver.d.ts +35 -0
  42. package/dist/plugin/skill-context.d.ts +9 -0
  43. package/dist/shared/posthog.d.ts +17 -10
  44. package/dist/shared/telemetry-product-identity.d.ts +2 -0
  45. package/dist/skills/coding-agent-sessions/SKILL.md +128 -0
  46. package/dist/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  47. package/dist/skills/coding-agent-sessions/references/all-platforms.md +71 -0
  48. package/dist/skills/coding-agent-sessions/references/claude.md +32 -0
  49. package/dist/skills/coding-agent-sessions/references/codex.md +30 -0
  50. package/dist/skills/coding-agent-sessions/references/opencode.md +43 -0
  51. package/dist/skills/coding-agent-sessions/references/senpi.md +17 -0
  52. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  53. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  54. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  55. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  56. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  57. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  58. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  59. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  60. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
  61. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  62. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  63. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  64. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  65. package/dist/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  66. package/dist/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  67. package/dist/skills/frontend/ATTRIBUTION.md +77 -9
  68. package/dist/skills/frontend/SKILL.md +29 -8
  69. package/dist/skills/frontend/references/design/README.md +29 -12
  70. package/dist/skills/frontend/references/design/_INDEX.md +3 -3
  71. package/dist/skills/frontend/references/design/airbnb.md +3 -0
  72. package/dist/skills/frontend/references/design/airtable.md +3 -0
  73. package/dist/skills/frontend/references/design/apple.md +3 -0
  74. package/dist/skills/frontend/references/design/binance.md +3 -0
  75. package/dist/skills/frontend/references/design/bmw.md +3 -0
  76. package/dist/skills/frontend/references/design/bugatti.md +3 -0
  77. package/dist/skills/frontend/references/design/cal.md +3 -0
  78. package/dist/skills/frontend/references/design/claude.md +3 -0
  79. package/dist/skills/frontend/references/design/clay.md +3 -0
  80. package/dist/skills/frontend/references/design/clickhouse.md +3 -0
  81. package/dist/skills/frontend/references/design/cohere.md +3 -0
  82. package/dist/skills/frontend/references/design/coinbase.md +3 -0
  83. package/dist/skills/frontend/references/design/composio.md +3 -0
  84. package/dist/skills/frontend/references/design/cursor.md +3 -0
  85. package/dist/skills/frontend/references/design/design-system-architecture.md +22 -19
  86. package/dist/skills/frontend/references/design/elevenlabs.md +3 -0
  87. package/dist/skills/frontend/references/design/expo.md +3 -0
  88. package/dist/skills/frontend/references/design/ferrari.md +3 -0
  89. package/dist/skills/frontend/references/design/figma.md +3 -0
  90. package/dist/skills/frontend/references/design/framer.md +3 -0
  91. package/dist/skills/frontend/references/design/hashicorp.md +3 -0
  92. package/dist/skills/frontend/references/design/ibm.md +3 -0
  93. package/dist/skills/frontend/references/design/imagegen-frontend-web.md +380 -79
  94. package/dist/skills/frontend/references/design/intercom.md +3 -0
  95. package/dist/skills/frontend/references/design/kraken.md +3 -0
  96. package/dist/skills/frontend/references/design/lamborghini.md +3 -0
  97. package/dist/skills/frontend/references/design/linear.app.md +3 -0
  98. package/dist/skills/frontend/references/design/lovable.md +3 -0
  99. package/dist/skills/frontend/references/design/mastercard.md +3 -0
  100. package/dist/skills/frontend/references/design/meta.md +3 -0
  101. package/dist/skills/frontend/references/design/minimax.md +3 -0
  102. package/dist/skills/frontend/references/design/mintlify.md +3 -0
  103. package/dist/skills/frontend/references/design/miro.md +3 -0
  104. package/dist/skills/frontend/references/design/mistral.ai.md +3 -0
  105. package/dist/skills/frontend/references/design/mongodb.md +3 -0
  106. package/dist/skills/frontend/references/design/nike.md +3 -0
  107. package/dist/skills/frontend/references/design/notion.md +3 -0
  108. package/dist/skills/frontend/references/design/nvidia.md +3 -0
  109. package/dist/skills/frontend/references/design/ollama.md +3 -0
  110. package/dist/skills/frontend/references/design/opencode.ai.md +3 -0
  111. package/dist/skills/frontend/references/design/pinterest.md +3 -0
  112. package/dist/skills/frontend/references/design/playstation.md +3 -0
  113. package/dist/skills/frontend/references/design/posthog.md +3 -0
  114. package/dist/skills/frontend/references/design/raycast.md +3 -0
  115. package/dist/skills/frontend/references/design/renault.md +3 -0
  116. package/dist/skills/frontend/references/design/replicate.md +3 -0
  117. package/dist/skills/frontend/references/design/resend.md +3 -0
  118. package/dist/skills/frontend/references/design/revolut.md +3 -0
  119. package/dist/skills/frontend/references/design/runwayml.md +3 -0
  120. package/dist/skills/frontend/references/design/sanity.md +3 -0
  121. package/dist/skills/frontend/references/design/sentry.md +3 -0
  122. package/dist/skills/frontend/references/design/shopify.md +3 -0
  123. package/dist/skills/frontend/references/design/spacex.md +3 -0
  124. package/dist/skills/frontend/references/design/spotify.md +3 -0
  125. package/dist/skills/frontend/references/design/starbucks.md +3 -0
  126. package/dist/skills/frontend/references/design/stitch-skill.md +1 -1
  127. package/dist/skills/frontend/references/design/stripe.md +3 -0
  128. package/dist/skills/frontend/references/design/supabase.md +3 -0
  129. package/dist/skills/frontend/references/design/superhuman.md +3 -0
  130. package/dist/skills/frontend/references/design/taste-skill.md +1188 -208
  131. package/dist/skills/frontend/references/design/tesla.md +3 -0
  132. package/dist/skills/frontend/references/design/theverge.md +3 -0
  133. package/dist/skills/frontend/references/design/together.ai.md +3 -0
  134. package/dist/skills/frontend/references/design/uber.md +3 -0
  135. package/dist/skills/frontend/references/design/vercel.md +3 -0
  136. package/dist/skills/frontend/references/design/vodafone.md +3 -0
  137. package/dist/skills/frontend/references/design/voltagent.md +3 -0
  138. package/dist/skills/frontend/references/design/warp.md +3 -0
  139. package/dist/skills/frontend/references/design/webflow.md +3 -0
  140. package/dist/skills/frontend/references/design/wired.md +3 -0
  141. package/dist/skills/frontend/references/design/wise.md +3 -0
  142. package/dist/skills/frontend/references/design/x.ai.md +3 -0
  143. package/dist/skills/frontend/references/design/zapier.md +3 -0
  144. package/dist/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
  145. package/dist/skills/frontend/references/designpowers/README.md +48 -0
  146. package/dist/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
  147. package/dist/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
  148. package/dist/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
  149. package/dist/skills/frontend/references/designpowers/lane-c-review.md +65 -0
  150. package/dist/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
  151. package/dist/skills/frontend/references/designpowers/orchestration.md +80 -0
  152. package/dist/skills/frontend/references/designpowers/routing.md +79 -0
  153. package/dist/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
  154. package/dist/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
  155. package/dist/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
  156. package/dist/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
  157. package/dist/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
  158. package/dist/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
  159. package/dist/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
  160. package/dist/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
  161. package/dist/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
  162. package/dist/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
  163. package/dist/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
  164. package/dist/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
  165. package/dist/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
  166. package/dist/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
  167. package/dist/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
  168. package/dist/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
  169. package/dist/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
  170. package/dist/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
  171. package/dist/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
  172. package/dist/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
  173. package/dist/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
  174. package/dist/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
  175. package/dist/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
  176. package/dist/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
  177. package/dist/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
  178. package/dist/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
  179. package/dist/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
  180. package/dist/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
  181. package/dist/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
  182. package/dist/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
  183. package/dist/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
  184. package/dist/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
  185. package/dist/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
  186. package/dist/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
  187. package/dist/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
  188. package/dist/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
  189. package/dist/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
  190. package/dist/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
  191. package/dist/skills/frontend/references/ui-ux-db/README.md +501 -115
  192. package/dist/skills/frontend/references/ui-ux-db/data/charts.csv +26 -26
  193. package/dist/skills/frontend/references/ui-ux-db/data/colors.csv +162 -97
  194. package/dist/skills/frontend/references/ui-ux-db/data/icons.csv +105 -100
  195. package/dist/skills/frontend/references/ui-ux-db/data/landing.csv +22 -18
  196. package/dist/skills/frontend/references/ui-ux-db/data/products.csv +162 -97
  197. package/dist/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -53
  198. package/dist/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -56
  199. package/dist/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -53
  200. package/dist/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -54
  201. package/dist/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -54
  202. package/dist/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -51
  203. package/dist/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -50
  204. package/dist/skills/frontend/references/ui-ux-db/data/styles.csv +17 -0
  205. package/dist/skills/frontend/references/ui-ux-db/data/typography.csv +17 -1
  206. package/dist/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -101
  207. package/dist/skills/frontend/references/ui-ux-db/data/web-interface.csv +30 -30
  208. package/dist/skills/frontend/references/ui-ux-db/scripts/core.py +31 -22
  209. package/dist/skills/frontend/references/ui-ux-db/scripts/design_system.py +150 -69
  210. package/dist/skills/frontend/references/ui-ux-db/scripts/search.py +3 -3
  211. package/dist/skills/git-master/SKILL.md +4 -0
  212. package/dist/skills/lcx-doctor/SKILL.md +1 -1
  213. package/dist/skills/review-work/SKILL.md +3 -3
  214. package/dist/skills/start-work/SKILL.md +7 -5
  215. package/dist/skills/ultimate-browsing/ATTRIBUTION.md +105 -0
  216. package/dist/skills/ultimate-browsing/SKILL.md +140 -0
  217. package/dist/skills/ultimate-browsing/engine/__init__.py +24 -0
  218. package/dist/skills/ultimate-browsing/engine/__main__.py +106 -0
  219. package/dist/skills/ultimate-browsing/engine/bias_check.py +174 -0
  220. package/dist/skills/ultimate-browsing/engine/curl_probe.py +91 -0
  221. package/dist/skills/ultimate-browsing/engine/executor.py +192 -0
  222. package/dist/skills/ultimate-browsing/engine/fetch_chain.py +268 -0
  223. package/dist/skills/ultimate-browsing/engine/referers.py +15 -0
  224. package/dist/skills/ultimate-browsing/engine/result_schema.py +45 -0
  225. package/dist/skills/ultimate-browsing/engine/summary.py +37 -0
  226. package/dist/skills/ultimate-browsing/engine/templates/package.json +11 -0
  227. package/dist/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +129 -0
  228. package/dist/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +167 -0
  229. package/dist/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +77 -0
  230. package/dist/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +282 -0
  231. package/dist/skills/ultimate-browsing/engine/url_transforms.py +98 -0
  232. package/dist/skills/ultimate-browsing/engine/validators.py +216 -0
  233. package/dist/skills/ultimate-browsing/engine/waf_detector.py +214 -0
  234. package/dist/skills/ultimate-browsing/engine/waf_profiles.yaml +162 -0
  235. package/dist/skills/ultimate-browsing/references/agent-reach/README.md +79 -0
  236. package/dist/skills/ultimate-browsing/references/agent-reach/career.md +29 -0
  237. package/dist/skills/ultimate-browsing/references/agent-reach/dev.md +62 -0
  238. package/dist/skills/ultimate-browsing/references/agent-reach/search.md +33 -0
  239. package/dist/skills/ultimate-browsing/references/agent-reach/social.md +207 -0
  240. package/dist/skills/ultimate-browsing/references/agent-reach/video.md +115 -0
  241. package/dist/skills/ultimate-browsing/references/agent-reach/web.md +76 -0
  242. package/dist/skills/ultimate-browsing/references/chrome-stealth.md +120 -0
  243. package/dist/skills/ultimate-browsing/references/insane-search/README.md +319 -0
  244. package/dist/skills/ultimate-browsing/references/insane-search/cache-archive.md +83 -0
  245. package/dist/skills/ultimate-browsing/references/insane-search/fallback.md +159 -0
  246. package/dist/skills/ultimate-browsing/references/insane-search/jina.md +130 -0
  247. package/dist/skills/ultimate-browsing/references/insane-search/json-api.md +133 -0
  248. package/dist/skills/ultimate-browsing/references/insane-search/media.md +123 -0
  249. package/dist/skills/ultimate-browsing/references/insane-search/metadata.md +116 -0
  250. package/dist/skills/ultimate-browsing/references/insane-search/naver.md +107 -0
  251. package/dist/skills/ultimate-browsing/references/insane-search/playwright.md +142 -0
  252. package/dist/skills/ultimate-browsing/references/insane-search/public-api.md +119 -0
  253. package/dist/skills/ultimate-browsing/references/insane-search/rss.md +123 -0
  254. package/dist/skills/ultimate-browsing/references/insane-search/tls-impersonate.md +186 -0
  255. package/dist/skills/ultimate-browsing/references/insane-search/twitter.md +104 -0
  256. package/dist/skills/ultimate-browsing/scripts/cookie_crypto.py +75 -0
  257. package/dist/skills/ultimate-browsing/scripts/cookie_domains.py +38 -0
  258. package/dist/skills/ultimate-browsing/scripts/cookie_paths.py +112 -0
  259. package/dist/skills/ultimate-browsing/scripts/extract_cookies.py +280 -0
  260. package/dist/skills/ultimate-browsing/scripts/tests/test_cookie_domain_filter.py +110 -0
  261. package/dist/skills/ultimate-browsing/scripts/tests/test_extract_cookies.py +245 -0
  262. package/dist/skills/ultraresearch/SKILL.md +4 -233
  263. package/dist/skills/ulw-plan/SKILL.md +9 -4
  264. package/dist/skills/ulw-plan/references/full-workflow.md +11 -6
  265. package/dist/skills/ulw-plan/references/intent-clear.md +3 -3
  266. package/dist/skills/ulw-plan/references/intent-unclear.md +1 -1
  267. package/dist/skills/ulw-research/ATTRIBUTION.md +49 -0
  268. package/dist/skills/ulw-research/SKILL.md +260 -0
  269. package/dist/skills/visual-qa/SKILL.md +105 -14
  270. package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +120 -1
  271. package/dist/testing/create-plugin-module.d.ts +2 -0
  272. package/dist/tools/delegate-task/sync-task-deps.d.ts +8 -6
  273. package/dist/tools/skill-mcp/tools.d.ts +1 -1
  274. package/dist/tui.js +23924 -16116
  275. package/docs/reference/github-attachment-upload.md +51 -0
  276. package/docs/reference/web-terminal-visual-qa.md +81 -0
  277. package/package.json +23 -15
  278. package/packages/lsp-core/src/lsp/process.ts +4 -1
  279. package/packages/lsp-core/src/mcp.ts +1 -0
  280. package/packages/lsp-daemon/dist/cli.js +5 -1
  281. package/packages/lsp-daemon/dist/index.js +5 -1
  282. package/packages/lsp-daemon/dist/proxy.js +1 -0
  283. package/packages/lsp-tools-mcp/dist/cli.js +5 -1
  284. package/packages/lsp-tools-mcp/dist/lsp/manager.js +4 -1
  285. package/packages/lsp-tools-mcp/dist/mcp.js +5 -1
  286. package/packages/lsp-tools-mcp/dist/tools.js +4 -1
  287. package/packages/omo-codex/THIRD-PARTY-NOTICES.md +27 -4
  288. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  289. package/packages/omo-codex/plugin/README.md +1 -1
  290. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +447 -94
  291. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  292. package/packages/omo-codex/plugin/components/bootstrap/scripts/bootstrap.ps1 +37 -68
  293. package/packages/omo-codex/plugin/components/bootstrap/scripts/node-dispatch.ps1 +75 -0
  294. package/packages/omo-codex/plugin/components/bootstrap/src/cli.ts +1 -1
  295. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +2 -18
  296. package/packages/omo-codex/plugin/components/codegraph/LICENSE +21 -0
  297. package/packages/omo-codex/plugin/components/codegraph/NODE-RUNTIME-LICENSES.md +2951 -0
  298. package/packages/omo-codex/plugin/components/codegraph/NOTICE +16 -0
  299. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +889 -364
  300. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +497 -59
  301. package/packages/omo-codex/plugin/components/codegraph/package.json +10 -4
  302. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +7 -1
  303. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +103 -3
  304. package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +114 -0
  305. package/packages/omo-codex/plugin/components/codegraph/src/mcp-unavailable.ts +75 -0
  306. package/packages/omo-codex/plugin/components/codegraph/src/serve-invocation.ts +29 -0
  307. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +60 -70
  308. package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +27 -11
  309. package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +31 -239
  310. package/packages/omo-codex/plugin/components/codegraph/test/package-runtime.test.ts +91 -0
  311. package/packages/omo-codex/plugin/components/codegraph/test/provisioned-node-guard.test.ts +1 -1
  312. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-bridge.test.ts +146 -0
  313. package/packages/omo-codex/plugin/components/codegraph/test/serve-mcp-facade.test.ts +68 -0
  314. package/packages/omo-codex/plugin/components/codegraph/test/serve-node-support.test.ts +11 -1
  315. package/packages/omo-codex/plugin/components/codegraph/test/serve-unavailable.test.ts +133 -0
  316. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +13 -120
  317. package/packages/omo-codex/plugin/components/codegraph/test/session-start-node-support.test.ts +8 -1
  318. package/packages/omo-codex/plugin/components/codegraph/test/session-start-trust-boundary.test.ts +63 -0
  319. package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-availability.test.ts +106 -0
  320. package/packages/omo-codex/plugin/components/codegraph/test/session-start-worker-flow.test.ts +220 -0
  321. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  322. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  323. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  324. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +4 -1
  325. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  326. package/packages/omo-codex/plugin/components/rules/dist/cli.js +3 -3
  327. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  328. package/packages/omo-codex/plugin/components/rules/src/sparkshell-awareness.ts +3 -3
  329. package/packages/omo-codex/plugin/components/rules/test/sparkshell-awareness.test.ts +42 -9
  330. package/packages/omo-codex/plugin/components/start-work-continuation/directive.md +6 -6
  331. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  332. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +23 -0
  333. package/packages/omo-codex/plugin/components/teammode/dist/cli.js +22 -4
  334. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  335. package/packages/omo-codex/plugin/components/teammode/skills/teammode/SKILL.md +97 -32
  336. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-guide.mjs +48 -20
  337. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-state.mjs +70 -3
  338. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team-worktree.mjs +113 -0
  339. package/packages/omo-codex/plugin/components/teammode/skills/teammode/scripts/team.mjs +69 -6
  340. package/packages/omo-codex/plugin/components/teammode/src/codex-hook.ts +19 -4
  341. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +32 -2
  342. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  343. package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
  344. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
  345. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +2 -2
  346. package/packages/omo-codex/plugin/components/ultrawork/directive.md +24 -7
  347. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +1 -1
  348. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  349. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +6 -4
  350. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +11 -6
  351. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +3 -3
  352. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +1 -1
  353. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +1 -1
  354. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +24 -0
  355. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +29 -3
  356. package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +1 -1
  357. package/packages/omo-codex/plugin/components/ulw-loop/README.md +25 -21
  358. package/packages/omo-codex/plugin/components/ulw-loop/biome.json +1 -1
  359. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +381 -0
  360. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-steering.js +14 -1
  361. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +145 -14
  362. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.d.ts +6 -3
  363. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-hook.js +16 -6
  364. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.d.ts +5 -0
  365. package/packages/omo-codex/plugin/components/ulw-loop/dist/ultrawork-directive.js +104 -0
  366. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +1 -1
  367. package/packages/omo-codex/plugin/components/ulw-loop/package.json +2 -1
  368. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +23 -14
  369. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-steering.ts +14 -1
  370. package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +4 -2
  371. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +28 -6
  372. package/packages/omo-codex/plugin/components/ulw-loop/src/ultrawork-directive.ts +113 -0
  373. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +33 -2
  374. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-steering-kind-guidance.test.ts +31 -0
  375. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +13 -0
  376. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +36 -0
  377. package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +13 -1
  378. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +64 -0
  379. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +2 -1
  380. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +2 -1
  381. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +2 -1
  382. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +2 -1
  383. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +2 -1
  384. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +2 -1
  385. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +2 -1
  386. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +2 -1
  387. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +2 -1
  388. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +2 -1
  389. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +2 -1
  390. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +2 -1
  391. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +2 -1
  392. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +2 -1
  393. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +2 -1
  394. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +2 -1
  395. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +2 -1
  396. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +2 -1
  397. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +2 -1
  398. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +2 -1
  399. package/packages/omo-codex/plugin/package-lock.json +112 -13
  400. package/packages/omo-codex/plugin/package.json +2 -2
  401. package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +133 -0
  402. package/packages/omo-codex/plugin/scripts/auto-update-release-notes.mjs +135 -0
  403. package/packages/omo-codex/plugin/scripts/auto-update.mjs +42 -138
  404. package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +42 -0
  405. package/packages/omo-codex/plugin/scripts/migrate-codex-config/context7-placeholder-guard.mjs +131 -0
  406. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-mode-guard.mjs +60 -0
  407. package/packages/omo-codex/plugin/scripts/migrate-codex-config/multi-agent-v2-guard.mjs +3 -10
  408. package/packages/omo-codex/plugin/scripts/migrate-codex-config/root-settings.mjs +31 -1
  409. package/packages/omo-codex/plugin/scripts/migrate-codex-config/subagent-limit-guard.mjs +73 -0
  410. package/packages/omo-codex/plugin/scripts/migrate-codex-config.mjs +20 -3
  411. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +30 -8
  412. package/packages/omo-codex/plugin/shared/src/config-loader.ts +20 -2
  413. package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +16 -0
  414. package/packages/omo-codex/plugin/skills/coding-agent-sessions/SKILL.md +128 -0
  415. package/packages/omo-codex/plugin/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  416. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/all-platforms.md +71 -0
  417. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/claude.md +32 -0
  418. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/codex.md +30 -0
  419. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/opencode.md +43 -0
  420. package/packages/omo-codex/plugin/skills/coding-agent-sessions/references/senpi.md +17 -0
  421. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  422. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  423. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  424. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  425. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  426. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  427. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  428. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  429. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
  430. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  431. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  432. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  433. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  434. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  435. package/packages/omo-codex/plugin/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  436. package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +77 -9
  437. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +29 -8
  438. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +29 -12
  439. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +3 -3
  440. package/packages/omo-codex/plugin/skills/frontend/references/design/airbnb.md +3 -0
  441. package/packages/omo-codex/plugin/skills/frontend/references/design/airtable.md +3 -0
  442. package/packages/omo-codex/plugin/skills/frontend/references/design/apple.md +3 -0
  443. package/packages/omo-codex/plugin/skills/frontend/references/design/binance.md +3 -0
  444. package/packages/omo-codex/plugin/skills/frontend/references/design/bmw.md +3 -0
  445. package/packages/omo-codex/plugin/skills/frontend/references/design/bugatti.md +3 -0
  446. package/packages/omo-codex/plugin/skills/frontend/references/design/cal.md +3 -0
  447. package/packages/omo-codex/plugin/skills/frontend/references/design/claude.md +3 -0
  448. package/packages/omo-codex/plugin/skills/frontend/references/design/clay.md +3 -0
  449. package/packages/omo-codex/plugin/skills/frontend/references/design/clickhouse.md +3 -0
  450. package/packages/omo-codex/plugin/skills/frontend/references/design/cohere.md +3 -0
  451. package/packages/omo-codex/plugin/skills/frontend/references/design/coinbase.md +3 -0
  452. package/packages/omo-codex/plugin/skills/frontend/references/design/composio.md +3 -0
  453. package/packages/omo-codex/plugin/skills/frontend/references/design/cursor.md +3 -0
  454. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +22 -19
  455. package/packages/omo-codex/plugin/skills/frontend/references/design/elevenlabs.md +3 -0
  456. package/packages/omo-codex/plugin/skills/frontend/references/design/expo.md +3 -0
  457. package/packages/omo-codex/plugin/skills/frontend/references/design/ferrari.md +3 -0
  458. package/packages/omo-codex/plugin/skills/frontend/references/design/figma.md +3 -0
  459. package/packages/omo-codex/plugin/skills/frontend/references/design/framer.md +3 -0
  460. package/packages/omo-codex/plugin/skills/frontend/references/design/hashicorp.md +3 -0
  461. package/packages/omo-codex/plugin/skills/frontend/references/design/ibm.md +3 -0
  462. package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-web.md +380 -79
  463. package/packages/omo-codex/plugin/skills/frontend/references/design/intercom.md +3 -0
  464. package/packages/omo-codex/plugin/skills/frontend/references/design/kraken.md +3 -0
  465. package/packages/omo-codex/plugin/skills/frontend/references/design/lamborghini.md +3 -0
  466. package/packages/omo-codex/plugin/skills/frontend/references/design/linear.app.md +3 -0
  467. package/packages/omo-codex/plugin/skills/frontend/references/design/lovable.md +3 -0
  468. package/packages/omo-codex/plugin/skills/frontend/references/design/mastercard.md +3 -0
  469. package/packages/omo-codex/plugin/skills/frontend/references/design/meta.md +3 -0
  470. package/packages/omo-codex/plugin/skills/frontend/references/design/minimax.md +3 -0
  471. package/packages/omo-codex/plugin/skills/frontend/references/design/mintlify.md +3 -0
  472. package/packages/omo-codex/plugin/skills/frontend/references/design/miro.md +3 -0
  473. package/packages/omo-codex/plugin/skills/frontend/references/design/mistral.ai.md +3 -0
  474. package/packages/omo-codex/plugin/skills/frontend/references/design/mongodb.md +3 -0
  475. package/packages/omo-codex/plugin/skills/frontend/references/design/nike.md +3 -0
  476. package/packages/omo-codex/plugin/skills/frontend/references/design/notion.md +3 -0
  477. package/packages/omo-codex/plugin/skills/frontend/references/design/nvidia.md +3 -0
  478. package/packages/omo-codex/plugin/skills/frontend/references/design/ollama.md +3 -0
  479. package/packages/omo-codex/plugin/skills/frontend/references/design/opencode.ai.md +3 -0
  480. package/packages/omo-codex/plugin/skills/frontend/references/design/pinterest.md +3 -0
  481. package/packages/omo-codex/plugin/skills/frontend/references/design/playstation.md +3 -0
  482. package/packages/omo-codex/plugin/skills/frontend/references/design/posthog.md +3 -0
  483. package/packages/omo-codex/plugin/skills/frontend/references/design/raycast.md +3 -0
  484. package/packages/omo-codex/plugin/skills/frontend/references/design/renault.md +3 -0
  485. package/packages/omo-codex/plugin/skills/frontend/references/design/replicate.md +3 -0
  486. package/packages/omo-codex/plugin/skills/frontend/references/design/resend.md +3 -0
  487. package/packages/omo-codex/plugin/skills/frontend/references/design/revolut.md +3 -0
  488. package/packages/omo-codex/plugin/skills/frontend/references/design/runwayml.md +3 -0
  489. package/packages/omo-codex/plugin/skills/frontend/references/design/sanity.md +3 -0
  490. package/packages/omo-codex/plugin/skills/frontend/references/design/sentry.md +3 -0
  491. package/packages/omo-codex/plugin/skills/frontend/references/design/shopify.md +3 -0
  492. package/packages/omo-codex/plugin/skills/frontend/references/design/spacex.md +3 -0
  493. package/packages/omo-codex/plugin/skills/frontend/references/design/spotify.md +3 -0
  494. package/packages/omo-codex/plugin/skills/frontend/references/design/starbucks.md +3 -0
  495. package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-skill.md +1 -1
  496. package/packages/omo-codex/plugin/skills/frontend/references/design/stripe.md +3 -0
  497. package/packages/omo-codex/plugin/skills/frontend/references/design/supabase.md +3 -0
  498. package/packages/omo-codex/plugin/skills/frontend/references/design/superhuman.md +3 -0
  499. package/packages/omo-codex/plugin/skills/frontend/references/design/taste-skill.md +1188 -208
  500. package/packages/omo-codex/plugin/skills/frontend/references/design/tesla.md +3 -0
  501. package/packages/omo-codex/plugin/skills/frontend/references/design/theverge.md +3 -0
  502. package/packages/omo-codex/plugin/skills/frontend/references/design/together.ai.md +3 -0
  503. package/packages/omo-codex/plugin/skills/frontend/references/design/uber.md +3 -0
  504. package/packages/omo-codex/plugin/skills/frontend/references/design/vercel.md +3 -0
  505. package/packages/omo-codex/plugin/skills/frontend/references/design/vodafone.md +3 -0
  506. package/packages/omo-codex/plugin/skills/frontend/references/design/voltagent.md +3 -0
  507. package/packages/omo-codex/plugin/skills/frontend/references/design/warp.md +3 -0
  508. package/packages/omo-codex/plugin/skills/frontend/references/design/webflow.md +3 -0
  509. package/packages/omo-codex/plugin/skills/frontend/references/design/wired.md +3 -0
  510. package/packages/omo-codex/plugin/skills/frontend/references/design/wise.md +3 -0
  511. package/packages/omo-codex/plugin/skills/frontend/references/design/x.ai.md +3 -0
  512. package/packages/omo-codex/plugin/skills/frontend/references/design/zapier.md +3 -0
  513. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
  514. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/README.md +48 -0
  515. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
  516. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
  517. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
  518. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-c-review.md +65 -0
  519. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
  520. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/orchestration.md +80 -0
  521. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/routing.md +79 -0
  522. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
  523. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
  524. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
  525. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
  526. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
  527. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
  528. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
  529. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
  530. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
  531. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
  532. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
  533. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
  534. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
  535. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
  536. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
  537. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
  538. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
  539. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
  540. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
  541. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
  542. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
  543. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
  544. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
  545. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
  546. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
  547. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
  548. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
  549. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
  550. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
  551. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
  552. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
  553. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
  554. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
  555. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
  556. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
  557. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
  558. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
  559. package/packages/omo-codex/plugin/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
  560. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/README.md +501 -115
  561. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/charts.csv +26 -26
  562. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/colors.csv +162 -97
  563. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/icons.csv +105 -100
  564. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/landing.csv +22 -18
  565. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/products.csv +162 -97
  566. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -53
  567. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -56
  568. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -53
  569. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -54
  570. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -54
  571. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -51
  572. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -50
  573. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/styles.csv +17 -0
  574. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/typography.csv +17 -1
  575. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -101
  576. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/web-interface.csv +30 -30
  577. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +31 -22
  578. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +150 -69
  579. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +3 -3
  580. package/packages/omo-codex/plugin/skills/git-master/SKILL.md +4 -0
  581. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +4 -0
  582. package/packages/omo-codex/plugin/skills/lcx-doctor/SKILL.md +1 -1
  583. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +4 -0
  584. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +4 -0
  585. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +12 -4
  586. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +14 -8
  587. package/packages/omo-codex/plugin/skills/teammode/SKILL.md +97 -32
  588. package/packages/omo-codex/plugin/skills/teammode/scripts/team-guide.mjs +48 -20
  589. package/packages/omo-codex/plugin/skills/teammode/scripts/team-state.mjs +70 -3
  590. package/packages/omo-codex/plugin/skills/teammode/scripts/team-worktree.mjs +113 -0
  591. package/packages/omo-codex/plugin/skills/teammode/scripts/team.mjs +69 -6
  592. package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +105 -0
  593. package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +140 -0
  594. package/packages/omo-codex/plugin/skills/ultimate-browsing/agents/openai.yaml +2 -0
  595. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__init__.py +24 -0
  596. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/__main__.py +106 -0
  597. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/bias_check.py +174 -0
  598. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/curl_probe.py +91 -0
  599. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/executor.py +192 -0
  600. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/fetch_chain.py +268 -0
  601. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/referers.py +15 -0
  602. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/result_schema.py +45 -0
  603. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/summary.py +37 -0
  604. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/package.json +11 -0
  605. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +129 -0
  606. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +167 -0
  607. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +77 -0
  608. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +282 -0
  609. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/url_transforms.py +98 -0
  610. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/validators.py +216 -0
  611. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_detector.py +214 -0
  612. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/waf_profiles.yaml +162 -0
  613. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/README.md +79 -0
  614. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/career.md +29 -0
  615. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/dev.md +62 -0
  616. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/search.md +33 -0
  617. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/social.md +207 -0
  618. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/video.md +115 -0
  619. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/agent-reach/web.md +76 -0
  620. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +120 -0
  621. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +319 -0
  622. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/cache-archive.md +83 -0
  623. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/fallback.md +159 -0
  624. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/jina.md +130 -0
  625. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/json-api.md +133 -0
  626. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/media.md +123 -0
  627. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/metadata.md +116 -0
  628. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/naver.md +107 -0
  629. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/playwright.md +142 -0
  630. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/public-api.md +119 -0
  631. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/rss.md +123 -0
  632. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/tls-impersonate.md +186 -0
  633. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/twitter.md +104 -0
  634. package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/cookie_crypto.py +75 -0
  635. package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/cookie_domains.py +38 -0
  636. package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/cookie_paths.py +112 -0
  637. package/packages/omo-codex/plugin/skills/ultimate-browsing/scripts/extract_cookies.py +280 -0
  638. package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +4 -231
  639. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +23 -14
  640. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +6 -4
  641. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +11 -6
  642. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +3 -3
  643. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +1 -1
  644. package/packages/omo-codex/plugin/skills/ulw-research/ATTRIBUTION.md +49 -0
  645. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +262 -0
  646. package/packages/omo-codex/plugin/skills/ulw-research/agents/openai.yaml +2 -0
  647. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +109 -14
  648. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -1
  649. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +23 -0
  650. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -0
  651. package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +96 -0
  652. package/packages/omo-codex/plugin/test/auto-update-restart-notice.test.mjs +36 -4
  653. package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +23 -5
  654. package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +38 -0
  655. package/packages/omo-codex/plugin/test/bootstrap-ps-guard.test.mjs +25 -0
  656. package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +1 -7
  657. package/packages/omo-codex/plugin/test/component-codegraph-mcp-smoke.test.mjs +76 -0
  658. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +206 -6
  659. package/packages/omo-codex/plugin/test/subagent-limit-migration.test.mjs +44 -0
  660. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +50 -1
  661. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +11 -7
  662. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +28 -2
  663. package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +107 -0
  664. package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +117 -0
  665. package/packages/omo-codex/plugin/test/teammode-thread-title.test.mjs +169 -0
  666. package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +249 -0
  667. package/packages/omo-codex/plugin/test/ulw-research-skill-contract.test.mjs +285 -0
  668. package/packages/omo-codex/scripts/install-bin-links.test.mjs +6 -1
  669. package/packages/omo-codex/scripts/install-cache-copy.test.mjs +51 -0
  670. package/packages/omo-codex/scripts/install-cli-args.test.mjs +1 -1
  671. package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +23 -0
  672. package/packages/omo-codex/scripts/install-config.test.mjs +198 -17
  673. package/packages/omo-codex/scripts/install-delegated-command.test.mjs +76 -4
  674. package/packages/omo-codex/scripts/install-dist/install-local.mjs +1021 -298
  675. package/packages/omo-codex/scripts/install-local-entrypoint.test.mjs +40 -3
  676. package/packages/omo-codex/scripts/install-local-git-bash-preflight.test.mjs +24 -15
  677. package/packages/omo-codex/scripts/install-local.test.mjs +5 -1
  678. package/packages/omo-codex/scripts/install-mcp-context7-runtime.test.mjs +84 -0
  679. package/packages/shared-skills/skills/coding-agent-sessions/SKILL.md +128 -0
  680. package/packages/shared-skills/skills/coding-agent-sessions/agents/openai.yaml +4 -0
  681. package/packages/shared-skills/skills/coding-agent-sessions/references/all-platforms.md +71 -0
  682. package/packages/shared-skills/skills/coding-agent-sessions/references/claude.md +32 -0
  683. package/packages/shared-skills/skills/coding-agent-sessions/references/codex.md +30 -0
  684. package/packages/shared-skills/skills/coding-agent-sessions/references/opencode.md +43 -0
  685. package/packages/shared-skills/skills/coding-agent-sessions/references/senpi.md +17 -0
  686. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/__init__.py +1 -0
  687. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/claude.py +66 -0
  688. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/cli.py +283 -0
  689. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/codex.py +105 -0
  690. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/file_scanners.py +275 -0
  691. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/jsonio.py +55 -0
  692. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/kiro_scanner.py +91 -0
  693. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/opencode.py +289 -0
  694. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/scanners.py +92 -0
  695. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_optional_scanners.py +203 -0
  696. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/sqlite_scanners.py +177 -0
  697. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/timeparse.py +51 -0
  698. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/transcript.py +149 -0
  699. package/packages/shared-skills/skills/coding-agent-sessions/scripts/agent_sessions/types.py +57 -0
  700. package/packages/shared-skills/skills/coding-agent-sessions/scripts/find-agent-sessions.py +19 -0
  701. package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +77 -9
  702. package/packages/shared-skills/skills/frontend/SKILL.md +29 -8
  703. package/packages/shared-skills/skills/frontend/references/design/README.md +29 -12
  704. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +3 -3
  705. package/packages/shared-skills/skills/frontend/references/design/airbnb.md +3 -0
  706. package/packages/shared-skills/skills/frontend/references/design/airtable.md +3 -0
  707. package/packages/shared-skills/skills/frontend/references/design/apple.md +3 -0
  708. package/packages/shared-skills/skills/frontend/references/design/binance.md +3 -0
  709. package/packages/shared-skills/skills/frontend/references/design/bmw.md +3 -0
  710. package/packages/shared-skills/skills/frontend/references/design/bugatti.md +3 -0
  711. package/packages/shared-skills/skills/frontend/references/design/cal.md +3 -0
  712. package/packages/shared-skills/skills/frontend/references/design/claude.md +3 -0
  713. package/packages/shared-skills/skills/frontend/references/design/clay.md +3 -0
  714. package/packages/shared-skills/skills/frontend/references/design/clickhouse.md +3 -0
  715. package/packages/shared-skills/skills/frontend/references/design/cohere.md +3 -0
  716. package/packages/shared-skills/skills/frontend/references/design/coinbase.md +3 -0
  717. package/packages/shared-skills/skills/frontend/references/design/composio.md +3 -0
  718. package/packages/shared-skills/skills/frontend/references/design/cursor.md +3 -0
  719. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +22 -19
  720. package/packages/shared-skills/skills/frontend/references/design/elevenlabs.md +3 -0
  721. package/packages/shared-skills/skills/frontend/references/design/expo.md +3 -0
  722. package/packages/shared-skills/skills/frontend/references/design/ferrari.md +3 -0
  723. package/packages/shared-skills/skills/frontend/references/design/figma.md +3 -0
  724. package/packages/shared-skills/skills/frontend/references/design/framer.md +3 -0
  725. package/packages/shared-skills/skills/frontend/references/design/hashicorp.md +3 -0
  726. package/packages/shared-skills/skills/frontend/references/design/ibm.md +3 -0
  727. package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-web.md +380 -79
  728. package/packages/shared-skills/skills/frontend/references/design/intercom.md +3 -0
  729. package/packages/shared-skills/skills/frontend/references/design/kraken.md +3 -0
  730. package/packages/shared-skills/skills/frontend/references/design/lamborghini.md +3 -0
  731. package/packages/shared-skills/skills/frontend/references/design/linear.app.md +3 -0
  732. package/packages/shared-skills/skills/frontend/references/design/lovable.md +3 -0
  733. package/packages/shared-skills/skills/frontend/references/design/mastercard.md +3 -0
  734. package/packages/shared-skills/skills/frontend/references/design/meta.md +3 -0
  735. package/packages/shared-skills/skills/frontend/references/design/minimax.md +3 -0
  736. package/packages/shared-skills/skills/frontend/references/design/mintlify.md +3 -0
  737. package/packages/shared-skills/skills/frontend/references/design/miro.md +3 -0
  738. package/packages/shared-skills/skills/frontend/references/design/mistral.ai.md +3 -0
  739. package/packages/shared-skills/skills/frontend/references/design/mongodb.md +3 -0
  740. package/packages/shared-skills/skills/frontend/references/design/nike.md +3 -0
  741. package/packages/shared-skills/skills/frontend/references/design/notion.md +3 -0
  742. package/packages/shared-skills/skills/frontend/references/design/nvidia.md +3 -0
  743. package/packages/shared-skills/skills/frontend/references/design/ollama.md +3 -0
  744. package/packages/shared-skills/skills/frontend/references/design/opencode.ai.md +3 -0
  745. package/packages/shared-skills/skills/frontend/references/design/pinterest.md +3 -0
  746. package/packages/shared-skills/skills/frontend/references/design/playstation.md +3 -0
  747. package/packages/shared-skills/skills/frontend/references/design/posthog.md +3 -0
  748. package/packages/shared-skills/skills/frontend/references/design/raycast.md +3 -0
  749. package/packages/shared-skills/skills/frontend/references/design/renault.md +3 -0
  750. package/packages/shared-skills/skills/frontend/references/design/replicate.md +3 -0
  751. package/packages/shared-skills/skills/frontend/references/design/resend.md +3 -0
  752. package/packages/shared-skills/skills/frontend/references/design/revolut.md +3 -0
  753. package/packages/shared-skills/skills/frontend/references/design/runwayml.md +3 -0
  754. package/packages/shared-skills/skills/frontend/references/design/sanity.md +3 -0
  755. package/packages/shared-skills/skills/frontend/references/design/sentry.md +3 -0
  756. package/packages/shared-skills/skills/frontend/references/design/shopify.md +3 -0
  757. package/packages/shared-skills/skills/frontend/references/design/spacex.md +3 -0
  758. package/packages/shared-skills/skills/frontend/references/design/spotify.md +3 -0
  759. package/packages/shared-skills/skills/frontend/references/design/starbucks.md +3 -0
  760. package/packages/shared-skills/skills/frontend/references/design/stitch-skill.md +1 -1
  761. package/packages/shared-skills/skills/frontend/references/design/stripe.md +3 -0
  762. package/packages/shared-skills/skills/frontend/references/design/supabase.md +3 -0
  763. package/packages/shared-skills/skills/frontend/references/design/superhuman.md +3 -0
  764. package/packages/shared-skills/skills/frontend/references/design/taste-skill.md +1188 -208
  765. package/packages/shared-skills/skills/frontend/references/design/tesla.md +3 -0
  766. package/packages/shared-skills/skills/frontend/references/design/theverge.md +3 -0
  767. package/packages/shared-skills/skills/frontend/references/design/together.ai.md +3 -0
  768. package/packages/shared-skills/skills/frontend/references/design/uber.md +3 -0
  769. package/packages/shared-skills/skills/frontend/references/design/vercel.md +3 -0
  770. package/packages/shared-skills/skills/frontend/references/design/vodafone.md +3 -0
  771. package/packages/shared-skills/skills/frontend/references/design/voltagent.md +3 -0
  772. package/packages/shared-skills/skills/frontend/references/design/warp.md +3 -0
  773. package/packages/shared-skills/skills/frontend/references/design/webflow.md +3 -0
  774. package/packages/shared-skills/skills/frontend/references/design/wired.md +3 -0
  775. package/packages/shared-skills/skills/frontend/references/design/wise.md +3 -0
  776. package/packages/shared-skills/skills/frontend/references/design/x.ai.md +3 -0
  777. package/packages/shared-skills/skills/frontend/references/design/zapier.md +3 -0
  778. package/packages/shared-skills/skills/frontend/references/designpowers/EVIDENCE.md +89 -0
  779. package/packages/shared-skills/skills/frontend/references/designpowers/README.md +48 -0
  780. package/packages/shared-skills/skills/frontend/references/designpowers/UPSTREAM.md +80 -0
  781. package/packages/shared-skills/skills/frontend/references/designpowers/lane-a-direction.md +64 -0
  782. package/packages/shared-skills/skills/frontend/references/designpowers/lane-b-execution.md +65 -0
  783. package/packages/shared-skills/skills/frontend/references/designpowers/lane-c-review.md +65 -0
  784. package/packages/shared-skills/skills/frontend/references/designpowers/lane-d-memory.md +83 -0
  785. package/packages/shared-skills/skills/frontend/references/designpowers/orchestration.md +80 -0
  786. package/packages/shared-skills/skills/frontend/references/designpowers/routing.md +79 -0
  787. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/LICENSE +21 -0
  788. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/accessibility-reviewer.md +83 -0
  789. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/content-writer.md +132 -0
  790. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-builder.md +109 -0
  791. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-critic.md +89 -0
  792. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-lead.md +113 -0
  793. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-scout.md +78 -0
  794. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/design-strategist.md +121 -0
  795. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/heuristic-evaluator.md +268 -0
  796. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/inspiration-scout.md +107 -0
  797. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/agents/motion-designer.md +120 -0
  798. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/accessible-content/SKILL.md +101 -0
  799. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/adaptive-interfaces/SKILL.md +109 -0
  800. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/cognitive-accessibility/SKILL.md +107 -0
  801. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-debate/SKILL.md +199 -0
  802. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-debt-tracker/SKILL.md +174 -0
  803. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-handoff/SKILL.md +125 -0
  804. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-md/SKILL.md +106 -0
  805. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-retrospective/SKILL.md +266 -0
  806. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-review/SKILL.md +123 -0
  807. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/design-system-alignment/SKILL.md +120 -0
  808. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/designpowers-critique/SKILL.md +164 -0
  809. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/heuristic-evaluation/SKILL.md +85 -0
  810. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/inclusive-personas/SKILL.md +98 -0
  811. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/inspiration-scouting/SKILL.md +165 -0
  812. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/interaction-design/SKILL.md +122 -0
  813. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/motion-choreography/SKILL.md +81 -0
  814. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/research-planning/SKILL.md +96 -0
  815. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/responsive-patterns/SKILL.md +77 -0
  816. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/synthetic-user-testing/SKILL.md +192 -0
  817. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/taste-feedback/SKILL.md +165 -0
  818. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/taste-report/SKILL.md +78 -0
  819. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/token-architecture/SKILL.md +75 -0
  820. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/ui-composition/SKILL.md +117 -0
  821. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/usability-testing/SKILL.md +78 -0
  822. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/verification-before-shipping/SKILL.md +125 -0
  823. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/voice-and-tone/SKILL.md +79 -0
  824. package/packages/shared-skills/skills/frontend/references/designpowers/vendor/skills/writing-design-plans/SKILL.md +119 -0
  825. package/packages/shared-skills/skills/frontend/references/ui-ux-db/README.md +501 -115
  826. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/charts.csv +26 -26
  827. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/colors.csv +162 -97
  828. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/icons.csv +105 -100
  829. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/landing.csv +22 -18
  830. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/products.csv +162 -97
  831. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -53
  832. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -56
  833. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -53
  834. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -54
  835. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -54
  836. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -51
  837. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -50
  838. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/styles.csv +17 -0
  839. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/typography.csv +17 -1
  840. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +162 -101
  841. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/web-interface.csv +30 -30
  842. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/core.py +31 -22
  843. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +150 -69
  844. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +3 -3
  845. package/packages/shared-skills/skills/git-master/SKILL.md +4 -0
  846. package/packages/shared-skills/skills/lcx-doctor/SKILL.md +1 -1
  847. package/packages/shared-skills/skills/review-work/SKILL.md +3 -3
  848. package/packages/shared-skills/skills/start-work/SKILL.md +7 -5
  849. package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +105 -0
  850. package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +140 -0
  851. package/packages/shared-skills/skills/ultimate-browsing/engine/__init__.py +24 -0
  852. package/packages/shared-skills/skills/ultimate-browsing/engine/__main__.py +106 -0
  853. package/packages/shared-skills/skills/ultimate-browsing/engine/bias_check.py +174 -0
  854. package/packages/shared-skills/skills/ultimate-browsing/engine/curl_probe.py +91 -0
  855. package/packages/shared-skills/skills/ultimate-browsing/engine/executor.py +192 -0
  856. package/packages/shared-skills/skills/ultimate-browsing/engine/fetch_chain.py +268 -0
  857. package/packages/shared-skills/skills/ultimate-browsing/engine/referers.py +15 -0
  858. package/packages/shared-skills/skills/ultimate-browsing/engine/result_schema.py +45 -0
  859. package/packages/shared-skills/skills/ultimate-browsing/engine/summary.py +37 -0
  860. package/packages/shared-skills/skills/ultimate-browsing/engine/templates/package.json +11 -0
  861. package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_mobile_chrome.js +129 -0
  862. package/packages/shared-skills/skills/ultimate-browsing/engine/templates/playwright_real_chrome.js +167 -0
  863. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_fetch_chain.py +77 -0
  864. package/packages/shared-skills/skills/ultimate-browsing/engine/tests/test_playwright_templates.py +282 -0
  865. package/packages/shared-skills/skills/ultimate-browsing/engine/url_transforms.py +98 -0
  866. package/packages/shared-skills/skills/ultimate-browsing/engine/validators.py +216 -0
  867. package/packages/shared-skills/skills/ultimate-browsing/engine/waf_detector.py +214 -0
  868. package/packages/shared-skills/skills/ultimate-browsing/engine/waf_profiles.yaml +162 -0
  869. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/README.md +79 -0
  870. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/career.md +29 -0
  871. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/dev.md +62 -0
  872. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/search.md +33 -0
  873. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/social.md +207 -0
  874. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/video.md +115 -0
  875. package/packages/shared-skills/skills/ultimate-browsing/references/agent-reach/web.md +76 -0
  876. package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +120 -0
  877. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +319 -0
  878. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/cache-archive.md +83 -0
  879. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/fallback.md +159 -0
  880. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/jina.md +130 -0
  881. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/json-api.md +133 -0
  882. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/media.md +123 -0
  883. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/metadata.md +116 -0
  884. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/naver.md +107 -0
  885. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/playwright.md +142 -0
  886. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/public-api.md +119 -0
  887. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/rss.md +123 -0
  888. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/tls-impersonate.md +186 -0
  889. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/twitter.md +104 -0
  890. package/packages/shared-skills/skills/ultimate-browsing/scripts/cookie_crypto.py +75 -0
  891. package/packages/shared-skills/skills/ultimate-browsing/scripts/cookie_domains.py +38 -0
  892. package/packages/shared-skills/skills/ultimate-browsing/scripts/cookie_paths.py +112 -0
  893. package/packages/shared-skills/skills/ultimate-browsing/scripts/extract_cookies.py +280 -0
  894. package/packages/shared-skills/skills/ultimate-browsing/scripts/tests/test_cookie_domain_filter.py +110 -0
  895. package/packages/shared-skills/skills/ultimate-browsing/scripts/tests/test_extract_cookies.py +245 -0
  896. package/packages/shared-skills/skills/ultraresearch/SKILL.md +4 -233
  897. package/packages/shared-skills/skills/ulw-plan/SKILL.md +9 -4
  898. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +11 -6
  899. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +3 -3
  900. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +1 -1
  901. package/packages/shared-skills/skills/ulw-research/ATTRIBUTION.md +49 -0
  902. package/packages/shared-skills/skills/ulw-research/SKILL.md +260 -0
  903. package/packages/shared-skills/skills/visual-qa/SKILL.md +105 -14
  904. package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +120 -1
  905. package/script/qa/web-terminal-redaction.d.mts +13 -0
  906. package/script/qa/web-terminal-redaction.mjs +43 -0
  907. package/script/qa/web-terminal-renderer.mjs +218 -0
  908. package/script/qa/web-terminal-visual-qa.mjs +264 -0
  909. package/packages/omo-codex/plugin/components/codegraph/dist/cli.d.ts +0 -2
  910. package/packages/omo-codex/plugin/components/codegraph/dist/serve.d.ts +0 -32
  911. package/packages/omo-codex/plugin/test/ultraresearch-skill-contract.test.mjs +0 -174
@@ -7,13 +7,86 @@ import { stderr as processStderr3 } from "node:process";
7
7
  import { fileURLToPath as fileURLToPath3 } from "node:url";
8
8
 
9
9
  // components/codegraph/src/hook.ts
10
- import { spawn } from "node:child_process";
11
- import { homedir as homedir8 } from "node:os";
10
+ import { execFile as execFile3, spawn } from "node:child_process";
11
+ import { homedir as homedir9 } from "node:os";
12
+ import { join as join8 } from "node:path";
12
13
  import { cwd as processCwd2, env as processEnv2, stdin as processStdin, stdout as processStdout } from "node:process";
13
14
  import { fileURLToPath } from "node:url";
14
15
 
16
+ // ../../utils/src/codegraph/env.ts
17
+ import { homedir } from "node:os";
18
+ import { join } from "node:path";
19
+ var CODEGRAPH_INSTALL_DIR_ENV = "CODEGRAPH_INSTALL_DIR";
20
+ var CODEGRAPH_NO_DOWNLOAD_ENV = "CODEGRAPH_NO_DOWNLOAD";
21
+ var CODEGRAPH_TELEMETRY_ENV = "CODEGRAPH_TELEMETRY";
22
+ var DO_NOT_TRACK_ENV = "DO_NOT_TRACK";
23
+ var SAFE_AMBIENT_ENV_KEYS = new Set([
24
+ "APPDATA",
25
+ "CI",
26
+ "CODEX_HOME",
27
+ "ComSpec",
28
+ "HOME",
29
+ "HOMEDRIVE",
30
+ "HOMEPATH",
31
+ "LANG",
32
+ "LC_ALL",
33
+ "LC_CTYPE",
34
+ "LOCALAPPDATA",
35
+ "PATH",
36
+ "PATHEXT",
37
+ "Path",
38
+ "SystemRoot",
39
+ "TEMP",
40
+ "TMP",
41
+ "TMPDIR",
42
+ "USERPROFILE",
43
+ "WINDIR",
44
+ "XDG_CACHE_HOME",
45
+ "XDG_CONFIG_HOME",
46
+ "XDG_DATA_HOME",
47
+ "XDG_STATE_HOME"
48
+ ]);
49
+ var SAFE_CODEGRAPH_RUNTIME_ENV_KEYS = new Set([
50
+ "CODEGRAPH_ALLOW_UNSAFE_NODE",
51
+ "CODEGRAPH_BIN",
52
+ "CODEGRAPH_FAKE_LOG",
53
+ "CODEGRAPH_NODE_BIN",
54
+ "OMO_CODEGRAPH_BIN",
55
+ "OMO_CODEGRAPH_PROJECT_CWD",
56
+ "OMO_CODEGRAPH_SESSION_START_CWD"
57
+ ]);
58
+ function buildCodegraphEnv(options = {}) {
59
+ const homeDir = options.homeDir ?? homedir();
60
+ return {
61
+ [CODEGRAPH_INSTALL_DIR_ENV]: join(homeDir, ".omo", "codegraph"),
62
+ [CODEGRAPH_NO_DOWNLOAD_ENV]: "1",
63
+ [CODEGRAPH_TELEMETRY_ENV]: "0",
64
+ [DO_NOT_TRACK_ENV]: "1"
65
+ };
66
+ }
67
+ function copyDefinedEnvKeys(output, input, allowedKeys) {
68
+ for (const key of allowedKeys) {
69
+ const value = input[key];
70
+ if (value !== undefined)
71
+ output[key] = value;
72
+ }
73
+ }
74
+ function copyDefinedEnv(output, input) {
75
+ for (const [key, value] of Object.entries(input)) {
76
+ if (value !== undefined)
77
+ output[key] = value;
78
+ }
79
+ }
80
+ function buildCodegraphChildEnv(options = {}) {
81
+ const env = {};
82
+ copyDefinedEnvKeys(env, options.ambientEnv ?? {}, SAFE_AMBIENT_ENV_KEYS);
83
+ copyDefinedEnvKeys(env, options.runtimeEnv ?? {}, SAFE_CODEGRAPH_RUNTIME_ENV_KEYS);
84
+ copyDefinedEnv(env, options.codegraphEnv ?? {});
85
+ return env;
86
+ }
87
+
15
88
  // ../../utils/src/codegraph/guidance.ts
16
- import { homedir as homedir2 } from "node:os";
89
+ import { homedir as homedir3 } from "node:os";
17
90
 
18
91
  // ../../utils/src/codegraph/workspace.ts
19
92
  import { createHash } from "node:crypto";
@@ -29,14 +102,14 @@ import {
29
102
  statSync,
30
103
  symlinkSync
31
104
  } from "node:fs";
32
- import { homedir } from "node:os";
33
- import { basename, join, resolve } from "node:path";
105
+ import { homedir as homedir2 } from "node:os";
106
+ import { basename, join as join2, resolve } from "node:path";
34
107
  function sanitizeBase(value) {
35
108
  const sanitized = value.replace(/[^A-Za-z0-9._-]/g, "-").replace(/-+/g, "-");
36
109
  return sanitized.length > 0 ? sanitized : "workspace";
37
110
  }
38
111
  function codegraphDataRoot(homeDir) {
39
- return join(homeDir, ".omo", "codegraph");
112
+ return join2(homeDir, ".omo", "codegraph");
40
113
  }
41
114
  function workspaceStorageName(workspace) {
42
115
  const resolved = resolve(workspace);
@@ -45,11 +118,11 @@ function workspaceStorageName(workspace) {
45
118
  }
46
119
  function resolveCodegraphWorkspacePaths(workspace, options = {}) {
47
120
  const resolvedWorkspace = resolve(workspace);
48
- const dataRoot = codegraphDataRoot(options.homeDir ?? homedir());
121
+ const dataRoot = codegraphDataRoot(options.homeDir ?? homedir2());
49
122
  return {
50
- dataDir: join(dataRoot, "projects", workspaceStorageName(resolvedWorkspace)),
123
+ dataDir: join2(dataRoot, "projects", workspaceStorageName(resolvedWorkspace)),
51
124
  dataRoot,
52
- projectLink: join(resolvedWorkspace, ".codegraph")
125
+ projectLink: join2(resolvedWorkspace, ".codegraph")
53
126
  };
54
127
  }
55
128
  function fallbackResult(dataRoot, projectLink, reason) {
@@ -97,12 +170,12 @@ function prepareCodegraphWorkspace(workspace, options = {}) {
97
170
  }
98
171
  }
99
172
  function ensureCodegraphGitignored(workspace) {
100
- const gitDir = join(workspace, ".git");
173
+ const gitDir = join2(workspace, ".git");
101
174
  if (!existsSync(gitDir))
102
175
  return false;
103
- const excludePath = join(gitDir, "info", "exclude");
176
+ const excludePath = join2(gitDir, "info", "exclude");
104
177
  try {
105
- mkdirSync(join(gitDir, "info"), { recursive: true });
178
+ mkdirSync(join2(gitDir, "info"), { recursive: true });
106
179
  const existing = existsSync(excludePath) ? readFileSync(excludePath, "utf8") : "";
107
180
  if (existing.split(/\r?\n/).includes(".codegraph"))
108
181
  return true;
@@ -137,7 +210,7 @@ function getCodegraphUninitializedProject(input) {
137
210
  }
138
211
  function buildCodegraphInitGuidance(projectPath, options = {}) {
139
212
  const { dataDir, dataRoot, projectLink } = resolveCodegraphWorkspacePaths(projectPath, {
140
- homeDir: options.homeDir ?? homedir2()
213
+ homeDir: options.homeDir ?? homedir3()
141
214
  });
142
215
  const displayProjectPath = formatDisplayPath(projectPath);
143
216
  const displayProjectLink = formatDisplayPath(projectLink);
@@ -204,9 +277,245 @@ function isRecord(value) {
204
277
  return typeof value === "object" && value !== null && !Array.isArray(value);
205
278
  }
206
279
 
280
+ // ../../utils/src/codegraph/resolve.ts
281
+ import { existsSync as existsSync2 } from "node:fs";
282
+ import { homedir as homedir4 } from "node:os";
283
+ import { spawnSync } from "node:child_process";
284
+ import { basename as basename2, dirname, join as join4 } from "node:path";
285
+ import { createRequire } from "node:module";
286
+
287
+ // ../../utils/src/runtime/which.ts
288
+ import { accessSync, constants } from "node:fs";
289
+ import { delimiter, join as join3 } from "node:path";
290
+ var runtime = globalThis;
291
+ function isUnsafeCommandName(commandName) {
292
+ if (commandName.includes("/") || commandName.includes("\\"))
293
+ return true;
294
+ if (commandName === "." || commandName === ".." || commandName.includes(".."))
295
+ return true;
296
+ if (/^[a-zA-Z]:/.test(commandName))
297
+ return true;
298
+ if (commandName.includes("\x00"))
299
+ return true;
300
+ return false;
301
+ }
302
+ function isExecutable(filePath) {
303
+ try {
304
+ accessSync(filePath, process.platform === "win32" ? constants.F_OK : constants.X_OK);
305
+ return true;
306
+ } catch (error) {
307
+ if (!(error instanceof Error) && Object.prototype.toString.call(error) !== "[object Error]") {
308
+ throw error;
309
+ }
310
+ return false;
311
+ }
312
+ }
313
+ function resolvePathValue() {
314
+ if (process.platform === "win32")
315
+ return process.env["Path"] ?? process.env["PATH"];
316
+ return process.env["PATH"];
317
+ }
318
+ function getWindowsCandidates(commandName) {
319
+ if (process.platform !== "win32")
320
+ return [commandName];
321
+ if (/\.[^\\/]+$/.test(commandName))
322
+ return [commandName];
323
+ return [commandName, `${commandName}.exe`, `${commandName}.cmd`, `${commandName}.bat`, `${commandName}.com`];
324
+ }
325
+ function bunWhich(commandName) {
326
+ if (!commandName)
327
+ return null;
328
+ if (isUnsafeCommandName(commandName))
329
+ return null;
330
+ const candidateNames = getWindowsCandidates(commandName);
331
+ for (const candidateName of candidateNames) {
332
+ const resolvedPath = runtime.Bun?.which(candidateName) ?? null;
333
+ if (resolvedPath !== null)
334
+ return resolvedPath;
335
+ }
336
+ const pathValue = resolvePathValue();
337
+ if (!pathValue)
338
+ return null;
339
+ const pathEntries = pathValue.split(delimiter).filter((pathEntry) => pathEntry.length > 0);
340
+ if (pathEntries.length === 0)
341
+ return null;
342
+ for (const pathEntry of pathEntries) {
343
+ for (const candidateName of candidateNames) {
344
+ const candidatePath = join3(pathEntry, candidateName);
345
+ if (isExecutable(candidatePath))
346
+ return candidatePath;
347
+ }
348
+ }
349
+ return null;
350
+ }
351
+
352
+ // ../../utils/src/codegraph/node-support.ts
353
+ var CODEGRAPH_MIN_NODE_MAJOR = 20;
354
+ var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
355
+ var CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE";
356
+ var CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
357
+ function evaluateCodegraphNodeSupport(options = {}) {
358
+ const nodeVersion = options.nodeVersion ?? process.versions.node;
359
+ const env = options.env ?? process.env;
360
+ const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
361
+ const major = parseNodeMajor(nodeVersion);
362
+ if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
363
+ return { major, override, reason: "too-new", supported: override };
364
+ }
365
+ if (major < CODEGRAPH_MIN_NODE_MAJOR) {
366
+ return { major, override, reason: "too-old", supported: override };
367
+ }
368
+ return { major, override, supported: true };
369
+ }
370
+ function buildCodegraphNodeSkipHint(support) {
371
+ const detail = support.reason === "too-new" ? `Node ${support.major} is unsupported (>= ${CODEGRAPH_BLOCKED_NODE_MAJOR} crashes CodeGraph mid-indexing)` : `Node ${support.major} is too old (CodeGraph requires >= ${CODEGRAPH_MIN_NODE_MAJOR})`;
372
+ return `CodeGraph MCP skipped: ${detail}. Use Node ${CODEGRAPH_MIN_NODE_MAJOR}-${CODEGRAPH_BLOCKED_NODE_MAJOR - 1} (e.g. Node 22 LTS) or set ${CODEGRAPH_UNSAFE_NODE_ENV}=1 to override.
373
+ `;
374
+ }
375
+ function parseNodeMajor(version) {
376
+ const normalized = version.startsWith("v") ? version.slice(1) : version;
377
+ const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
378
+ return Number.isNaN(major) ? 0 : major;
379
+ }
380
+
381
+ // ../../utils/src/codegraph/resolve.ts
382
+ function codegraphCommandRequiresSupportedLocalNode(resolution) {
383
+ return resolution.source !== "bundled" && resolution.source !== "env" && resolution.source !== "provisioned";
384
+ }
385
+ var CODEGRAPH_PACKAGE = "@colbymchenry/codegraph";
386
+ var CODEGRAPH_ENV_BIN = "OMO_CODEGRAPH_BIN";
387
+ var CODEGRAPH_LEGACY_ENV_BIN = "CODEGRAPH_BIN";
388
+ var CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
389
+ var CODEGRAPH_NODE_PATH_CANDIDATES = [
390
+ "/opt/homebrew/opt/node@24/bin/node",
391
+ "/opt/homebrew/opt/node@22/bin/node",
392
+ "/opt/homebrew/opt/node@20/bin/node",
393
+ "/usr/local/opt/node@24/bin/node",
394
+ "/usr/local/opt/node@22/bin/node",
395
+ "/usr/local/opt/node@20/bin/node"
396
+ ];
397
+ var requireFromHere = createRequire(import.meta.url);
398
+ function defaultRequireResolve(specifier) {
399
+ return requireFromHere.resolve(specifier);
400
+ }
401
+ function defaultNodeVersion(nodePath) {
402
+ if (nodePath === process.execPath && isNodeExecutableName(nodePath))
403
+ return process.versions.node;
404
+ try {
405
+ const result = spawnSync(nodePath, ["--version"], {
406
+ encoding: "utf8",
407
+ timeout: 2000,
408
+ windowsHide: true
409
+ });
410
+ if (result.error !== undefined || result.status !== 0)
411
+ return null;
412
+ const version = `${result.stdout}
413
+ ${result.stderr}`.trim().split(/\s+/)[0];
414
+ return version === undefined || version.length === 0 ? null : version;
415
+ } catch (error) {
416
+ if (error instanceof Error)
417
+ return null;
418
+ throw error;
419
+ }
420
+ }
421
+ function isNodeExecutableName(filePath) {
422
+ const executable = basename2(filePath).toLowerCase();
423
+ return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
424
+ }
425
+ function looksLikePath(command) {
426
+ return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
427
+ }
428
+ function resolveConfiguredNodeRuntime(configured, fileExists, which) {
429
+ if (looksLikePath(configured))
430
+ return fileExists(configured) ? configured : null;
431
+ return which(configured);
432
+ }
433
+ function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
434
+ const version = nodeVersion(nodePath);
435
+ if (version === null)
436
+ return false;
437
+ return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
438
+ }
439
+ function defaultNodeRuntime(env, fileExists, which, nodeVersion) {
440
+ const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
441
+ if (configured !== undefined && configured.length > 0) {
442
+ const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which);
443
+ return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
444
+ }
445
+ const candidates = [
446
+ ...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
447
+ ...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which(commandName)).filter((candidate) => candidate !== null),
448
+ ...CODEGRAPH_NODE_PATH_CANDIDATES.filter((candidate) => fileExists(candidate))
449
+ ];
450
+ const seen = new Set;
451
+ for (const candidate of candidates) {
452
+ if (seen.has(candidate))
453
+ continue;
454
+ seen.add(candidate);
455
+ if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
456
+ return candidate;
457
+ }
458
+ return null;
459
+ }
460
+ function defaultProvisionedBin(homeDir, fileExists) {
461
+ const binaryName = process.platform === "win32" ? "codegraph.cmd" : "codegraph";
462
+ const candidates = [
463
+ join4(homeDir, ".omo", "codegraph", "bin", binaryName),
464
+ join4(homeDir, ".omo", "codegraph", "node-servers", "node_modules", ".bin", binaryName)
465
+ ];
466
+ return candidates.find((candidate) => fileExists(candidate)) ?? null;
467
+ }
468
+ function resolveBundledShim(requireResolve, fileExists) {
469
+ try {
470
+ const packageJson = requireResolve(`${CODEGRAPH_PACKAGE}/package.json`);
471
+ const packageRoot = dirname(packageJson);
472
+ const candidates = [join4(packageRoot, "bin", "codegraph.js"), join4(packageRoot, "npm-shim.js")];
473
+ return candidates.find((candidate) => fileExists(candidate)) ?? null;
474
+ } catch (error) {
475
+ if (error instanceof Error)
476
+ return null;
477
+ if (error === null || error === undefined)
478
+ return null;
479
+ if (typeof error === "object" || typeof error === "string" || typeof error === "number")
480
+ return null;
481
+ if (typeof error === "boolean" || typeof error === "bigint" || typeof error === "symbol")
482
+ return null;
483
+ return null;
484
+ }
485
+ }
486
+ function resolveCodegraphCommand(options = {}) {
487
+ const env = options.env ?? process.env;
488
+ const fileExists = options.fileExists ?? existsSync2;
489
+ const configuredBin = env[CODEGRAPH_ENV_BIN]?.trim() || env[CODEGRAPH_LEGACY_ENV_BIN]?.trim();
490
+ if (configuredBin !== undefined && configuredBin.length > 0) {
491
+ return { argsPrefix: [], command: configuredBin, exists: fileExists(configuredBin), source: "env" };
492
+ }
493
+ const which = options.which ?? bunWhich;
494
+ const nodeRuntime = options.nodeRuntime ?? (() => defaultNodeRuntime(env, fileExists, which, options.nodeVersion ?? defaultNodeVersion));
495
+ const bundled = resolveBundledShim(options.requireResolve ?? defaultRequireResolve, fileExists);
496
+ const runtime2 = nodeRuntime();
497
+ if (bundled !== null && runtime2 !== null) {
498
+ return { argsPrefix: [bundled], command: runtime2, exists: true, source: "bundled" };
499
+ }
500
+ const provisioned = options.provisioned?.() ?? defaultProvisionedBin(options.homeDir ?? homedir4(), fileExists);
501
+ if (provisioned !== null && fileExists(provisioned)) {
502
+ return { argsPrefix: [], command: provisioned, exists: true, source: "provisioned" };
503
+ }
504
+ const pathCommand = which("codegraph");
505
+ return {
506
+ argsPrefix: [],
507
+ command: pathCommand ?? "codegraph",
508
+ exists: pathCommand !== null,
509
+ source: "path"
510
+ };
511
+ }
512
+
513
+ // shared/src/config-loader.ts
514
+ import { homedir as homedir6 } from "node:os";
515
+
207
516
  // ../../utils/src/omo-config/loader.ts
208
- import { existsSync as existsSync3, readFileSync as readFileSync2 } from "node:fs";
209
- import { homedir as homedir3 } from "node:os";
517
+ import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
518
+ import { homedir as homedir5 } from "node:os";
210
519
 
211
520
  // ../../utils/src/deep-merge.ts
212
521
  var DANGEROUS_KEYS = new Set(["__proto__", "constructor", "prototype"]);
@@ -1162,8 +1471,8 @@ function buildEnvOverrides(harness, env, warnings, merge) {
1162
1471
  }
1163
1472
 
1164
1473
  // ../../utils/src/omo-config/resolve.ts
1165
- import { existsSync as existsSync2 } from "node:fs";
1166
- import { dirname, isAbsolute, join as join2, relative, resolve as resolve2 } from "node:path";
1474
+ import { existsSync as existsSync3 } from "node:fs";
1475
+ import { dirname as dirname2, isAbsolute, join as join5, relative, resolve as resolve2 } from "node:path";
1167
1476
  function containsPath(parent, child) {
1168
1477
  const pathToChild = relative(parent, child);
1169
1478
  return pathToChild === "" || !pathToChild.startsWith("..") && !isAbsolute(pathToChild);
@@ -1176,11 +1485,11 @@ function findProjectConfigPathsNearestFirst(cwd, homeDir) {
1176
1485
  while (true) {
1177
1486
  if (stopBeforeDir !== null && currentDir === stopBeforeDir)
1178
1487
  break;
1179
- const configPath = join2(currentDir, ".omo", "config.jsonc");
1180
- if (existsSync2(configPath)) {
1488
+ const configPath = join5(currentDir, ".omo", "config.jsonc");
1489
+ if (existsSync3(configPath)) {
1181
1490
  paths.push(configPath);
1182
1491
  }
1183
- const parentDir = dirname(currentDir);
1492
+ const parentDir = dirname2(currentDir);
1184
1493
  if (parentDir === currentDir)
1185
1494
  break;
1186
1495
  currentDir = parentDir;
@@ -1188,7 +1497,7 @@ function findProjectConfigPathsNearestFirst(cwd, homeDir) {
1188
1497
  return paths;
1189
1498
  }
1190
1499
  function resolveOmoConfigPaths(options) {
1191
- const globalPath = join2(resolve2(options.homeDir), ".omo", "config.jsonc");
1500
+ const globalPath = join5(resolve2(options.homeDir), ".omo", "config.jsonc");
1192
1501
  const projectPathsFarthestFirst = findProjectConfigPathsNearestFirst(options.cwd, options.homeDir).reverse();
1193
1502
  return [
1194
1503
  { path: globalPath, scope: "global" },
@@ -1399,13 +1708,13 @@ function validateHarnessApplicability(config, harness) {
1399
1708
  }
1400
1709
  function loadOmoConfig(options) {
1401
1710
  const cwd = options.cwd ?? process.cwd();
1402
- const homeDir = options.homeDir ?? process.env["HOME"] ?? process.env["USERPROFILE"] ?? homedir3();
1711
+ const homeDir = options.homeDir ?? process.env["HOME"] ?? process.env["USERPROFILE"] ?? homedir5();
1403
1712
  const env = options.env ?? process.env;
1404
1713
  let config = BUILT_IN_DEFAULTS;
1405
1714
  const sources = [];
1406
1715
  const warnings = [];
1407
1716
  for (const candidate of resolveOmoConfigPaths({ cwd, homeDir })) {
1408
- if (!existsSync3(candidate.path)) {
1717
+ if (!existsSync4(candidate.path)) {
1409
1718
  if (candidate.scope === "global") {
1410
1719
  sources.push(toMissingSource(candidate));
1411
1720
  }
@@ -1429,79 +1738,47 @@ function loadOmoConfig(options) {
1429
1738
 
1430
1739
  // shared/src/config-loader.ts
1431
1740
  function getCodexOmoConfig(options = {}) {
1741
+ const env = options.env ?? process.env;
1742
+ const homeDir = resolveHomeDir(options);
1432
1743
  const result = loadOmoConfig({
1433
1744
  ...options.cwd === undefined ? {} : { cwd: options.cwd },
1434
- ...options.env === undefined ? {} : { env: options.env },
1435
- ...options.homeDir === undefined ? {} : { homeDir: options.homeDir },
1745
+ env,
1746
+ homeDir,
1747
+ harness: "codex"
1748
+ });
1749
+ const trustedConfig = loadOmoConfig({
1750
+ cwd: homeDir,
1751
+ env,
1752
+ homeDir,
1436
1753
  harness: "codex"
1437
1754
  });
1755
+ const trustedCodegraphInstallDir = trustedConfig.config.codegraph?.install_dir;
1438
1756
  return {
1439
1757
  ...result.config,
1440
1758
  sources: result.sources,
1759
+ ...trustedCodegraphInstallDir === undefined ? {} : { trustedCodegraphInstallDir },
1441
1760
  warnings: result.warnings
1442
1761
  };
1443
1762
  }
1763
+ function resolveHomeDir(options) {
1764
+ const env = options.env ?? process.env;
1765
+ return options.homeDir ?? env["HOME"] ?? env["USERPROFILE"] ?? homedir6();
1766
+ }
1444
1767
 
1445
1768
  // components/codegraph/src/session-start-worker.ts
1446
1769
  import { execFile as execFile2 } from "node:child_process";
1447
1770
  import { appendFileSync as appendFileSync2, existsSync as existsSync6, mkdirSync as mkdirSync2 } from "node:fs";
1448
- import { homedir as homedir7 } from "node:os";
1771
+ import { homedir as homedir8 } from "node:os";
1449
1772
  import { extname, join as join7 } from "node:path";
1450
- import { cwd as processCwd, env as processEnv, stderr as processStderr } from "node:process";
1451
-
1452
- // ../../utils/src/codegraph/env.ts
1453
- import { homedir as homedir4 } from "node:os";
1454
- import { join as join3 } from "node:path";
1455
- var CODEGRAPH_INSTALL_DIR_ENV = "CODEGRAPH_INSTALL_DIR";
1456
- var CODEGRAPH_NO_DOWNLOAD_ENV = "CODEGRAPH_NO_DOWNLOAD";
1457
- var CODEGRAPH_TELEMETRY_ENV = "CODEGRAPH_TELEMETRY";
1458
- var DO_NOT_TRACK_ENV = "DO_NOT_TRACK";
1459
- function buildCodegraphEnv(options = {}) {
1460
- const homeDir = options.homeDir ?? homedir4();
1461
- return {
1462
- [CODEGRAPH_INSTALL_DIR_ENV]: join3(homeDir, ".omo", "codegraph"),
1463
- [CODEGRAPH_NO_DOWNLOAD_ENV]: "1",
1464
- [CODEGRAPH_TELEMETRY_ENV]: "0",
1465
- [DO_NOT_TRACK_ENV]: "1"
1466
- };
1467
- }
1468
-
1469
- // ../../utils/src/codegraph/node-support.ts
1470
- var CODEGRAPH_MIN_NODE_MAJOR = 20;
1471
- var CODEGRAPH_BLOCKED_NODE_MAJOR = 25;
1472
- var CODEGRAPH_UNSAFE_NODE_ENV = "CODEGRAPH_ALLOW_UNSAFE_NODE";
1473
- var CODEGRAPH_NODE_BIN_ENV = "CODEGRAPH_NODE_BIN";
1474
- function evaluateCodegraphNodeSupport(options = {}) {
1475
- const nodeVersion = options.nodeVersion ?? process.versions.node;
1476
- const env = options.env ?? process.env;
1477
- const override = (env[CODEGRAPH_UNSAFE_NODE_ENV]?.trim().length ?? 0) > 0;
1478
- const major = parseNodeMajor(nodeVersion);
1479
- if (major >= CODEGRAPH_BLOCKED_NODE_MAJOR) {
1480
- return { major, override, reason: "too-new", supported: override };
1481
- }
1482
- if (major < CODEGRAPH_MIN_NODE_MAJOR) {
1483
- return { major, override, reason: "too-old", supported: override };
1484
- }
1485
- return { major, override, supported: true };
1486
- }
1487
- function buildCodegraphNodeSkipHint(support) {
1488
- const detail = support.reason === "too-new" ? `Node ${support.major} is unsupported (>= ${CODEGRAPH_BLOCKED_NODE_MAJOR} crashes CodeGraph mid-indexing)` : `Node ${support.major} is too old (CodeGraph requires >= ${CODEGRAPH_MIN_NODE_MAJOR})`;
1489
- return `CodeGraph MCP skipped: ${detail}. Use Node ${CODEGRAPH_MIN_NODE_MAJOR}-${CODEGRAPH_BLOCKED_NODE_MAJOR - 1} (e.g. Node 22 LTS) or set ${CODEGRAPH_UNSAFE_NODE_ENV}=1 to override.
1490
- `;
1491
- }
1492
- function parseNodeMajor(version) {
1493
- const normalized = version.startsWith("v") ? version.slice(1) : version;
1494
- const major = Number.parseInt(normalized.split(".")[0] ?? "", 10);
1495
- return Number.isNaN(major) ? 0 : major;
1496
- }
1773
+ import { cwd as processCwd, env as processEnv, execPath as processExecPath, stderr as processStderr } from "node:process";
1497
1774
 
1498
1775
  // ../../utils/src/codegraph/provision.ts
1499
1776
  import { createHash as createHash2, randomUUID } from "node:crypto";
1500
1777
  import { execFile } from "node:child_process";
1501
1778
  import { chmod, mkdir, readdir, readFile, rename, rm, rmdir, stat, writeFile } from "node:fs/promises";
1502
- import { existsSync as existsSync4 } from "node:fs";
1503
- import { homedir as homedir5, hostname } from "node:os";
1504
- import { basename as basename2, join as join4 } from "node:path";
1779
+ import { existsSync as existsSync5 } from "node:fs";
1780
+ import { homedir as homedir7, hostname } from "node:os";
1781
+ import { basename as basename3, join as join6 } from "node:path";
1505
1782
  import { promisify } from "node:util";
1506
1783
 
1507
1784
  // ../../utils/src/codegraph/manifest.ts
@@ -1550,10 +1827,10 @@ function platformKey() {
1550
1827
  return `${process.platform}-${process.arch}`;
1551
1828
  }
1552
1829
  function markerPath(installDir, version) {
1553
- return join4(installDir, ".provisioned", `codegraph-${version}.json`);
1830
+ return join6(installDir, ".provisioned", `codegraph-${version}.json`);
1554
1831
  }
1555
1832
  function defaultInstallDir() {
1556
- return join4(homedir5(), ".omo", "codegraph");
1833
+ return join6(homedir7(), ".omo", "codegraph");
1557
1834
  }
1558
1835
  function sha256(bytes) {
1559
1836
  return createHash2("sha256").update(bytes).digest("hex");
@@ -1587,7 +1864,7 @@ function forcedBadChecksumOptions(options) {
1587
1864
  const key = options.platformKey ?? platformKey();
1588
1865
  return {
1589
1866
  downloader: async () => new TextEncoder().encode("checksum mismatch"),
1590
- installDir: options.installDir ?? join4(options.lockDir, "codegraph-force-bad-checksum"),
1867
+ installDir: options.installDir ?? join6(options.lockDir, "codegraph-force-bad-checksum"),
1591
1868
  manifest: {
1592
1869
  assets: {
1593
1870
  [key]: { executableName: process.platform === "win32" ? "codegraph.cmd" : "codegraph", sha256: "0000", url: "memory://bad" }
@@ -1598,13 +1875,13 @@ function forcedBadChecksumOptions(options) {
1598
1875
  };
1599
1876
  }
1600
1877
  async function readMarker(path) {
1601
- if (!existsSync4(path))
1878
+ if (!existsSync5(path))
1602
1879
  return null;
1603
1880
  try {
1604
1881
  const raw = JSON.parse(await readFile(path, "utf8"));
1605
1882
  if (typeof raw === "object" && raw !== null && "binPath" in raw) {
1606
1883
  const value = raw.binPath;
1607
- return typeof value === "string" && existsSync4(value) ? value : null;
1884
+ return typeof value === "string" && existsSync5(value) ? value : null;
1608
1885
  }
1609
1886
  return null;
1610
1887
  } catch (error) {
@@ -1615,7 +1892,7 @@ async function readMarker(path) {
1615
1892
  }
1616
1893
  async function acquireLock(lockPath, waitMs, staleMs) {
1617
1894
  const startedAt = Date.now();
1618
- await mkdir(join4(lockPath, ".."), { recursive: true });
1895
+ await mkdir(join6(lockPath, ".."), { recursive: true });
1619
1896
  while (Date.now() - startedAt <= waitMs) {
1620
1897
  try {
1621
1898
  await mkdir(lockPath);
@@ -1640,44 +1917,44 @@ async function installExtractedBundle(extractDir, installDir, executableName) {
1640
1917
  const roots = await readdir(extractDir);
1641
1918
  if (roots.length !== 1)
1642
1919
  throw new Error(`CodeGraph archive should contain one root directory, found ${roots.length}`);
1643
- const bundleDir = join4(extractDir, roots[0] ?? "");
1920
+ const bundleDir = join6(extractDir, roots[0] ?? "");
1644
1921
  const bundleEntries = await readdir(bundleDir);
1645
1922
  await mkdir(installDir, { recursive: true });
1646
1923
  for (const entry of bundleEntries) {
1647
- await rm(join4(installDir, entry), { force: true, recursive: true });
1648
- await rename(join4(bundleDir, entry), join4(installDir, entry));
1924
+ await rm(join6(installDir, entry), { force: true, recursive: true });
1925
+ await rename(join6(bundleDir, entry), join6(installDir, entry));
1649
1926
  }
1650
- const destination = join4(installDir, "bin", executableName);
1651
- if (!existsSync4(destination))
1927
+ const destination = join6(installDir, "bin", executableName);
1928
+ if (!existsSync5(destination))
1652
1929
  throw new Error(`CodeGraph archive did not contain bin/${executableName}`);
1653
1930
  await chmod(destination, 493);
1654
1931
  return destination;
1655
1932
  }
1656
1933
  async function installAsset(layout) {
1657
1934
  const { asset, downloader, installDir, version } = layout;
1658
- const stagingDir = join4(installDir, ".staging", randomUUID());
1659
- const archivePath = join4(stagingDir, basename2(asset.url));
1660
- const extractDir = join4(stagingDir, "extract");
1935
+ const stagingDir = join6(installDir, ".staging", randomUUID());
1936
+ const archivePath = join6(stagingDir, basename3(asset.url));
1937
+ const extractDir = join6(stagingDir, "extract");
1661
1938
  try {
1662
1939
  await mkdir(extractDir, { recursive: true });
1663
1940
  const bytes = await downloader(asset);
1664
1941
  const actualChecksum = sha256(bytes);
1665
1942
  if (actualChecksum !== asset.sha256) {
1666
- throw new Error(`checksum mismatch for ${basename2(asset.url)}: expected ${asset.sha256}, got ${actualChecksum}`);
1943
+ throw new Error(`checksum mismatch for ${basename3(asset.url)}: expected ${asset.sha256}, got ${actualChecksum}`);
1667
1944
  }
1668
1945
  if (!asset.url.endsWith(".tar.gz") && !asset.url.endsWith(".tgz")) {
1669
- throw new Error(`unsupported CodeGraph archive type for ${basename2(asset.url)}`);
1946
+ throw new Error(`unsupported CodeGraph archive type for ${basename3(asset.url)}`);
1670
1947
  }
1671
1948
  await writeFile(archivePath, bytes);
1672
1949
  await extractTarGz(archivePath, extractDir);
1673
1950
  const destination = await installExtractedBundle(extractDir, installDir, asset.executableName);
1674
- await mkdir(join4(installDir, ".provisioned"), { recursive: true });
1951
+ await mkdir(join6(installDir, ".provisioned"), { recursive: true });
1675
1952
  await writeFile(markerPath(installDir, version), `${JSON.stringify({ binPath: destination, version })}
1676
1953
  `);
1677
1954
  return destination;
1678
1955
  } finally {
1679
1956
  await rm(stagingDir, { force: true, recursive: true });
1680
- await removeEmptyDirectory(join4(installDir, ".staging"));
1957
+ await removeEmptyDirectory(join6(installDir, ".staging"));
1681
1958
  }
1682
1959
  }
1683
1960
  async function ensureCodegraphProvisioned(options) {
@@ -1690,7 +1967,7 @@ async function ensureCodegraphProvisioned(options) {
1690
1967
  const existing = await readMarker(marker);
1691
1968
  if (existing !== null)
1692
1969
  return { binPath: existing, provisioned: true };
1693
- const lockPath = join4(options.lockDir, `codegraph-${hostname()}.lock`);
1970
+ const lockPath = join6(options.lockDir, `codegraph-${hostname()}.lock`);
1694
1971
  const release = await acquireLock(lockPath, options.lockWaitMs ?? DEFAULT_LOCK_WAIT_MS, options.lockStaleMs ?? DEFAULT_LOCK_STALE_MS);
1695
1972
  if (release === null)
1696
1973
  return { error: "timed out waiting for codegraph provisioning lock", provisioned: false };
@@ -1714,206 +1991,12 @@ async function ensureCodegraphProvisioned(options) {
1714
1991
  }
1715
1992
  }
1716
1993
 
1717
- // ../../utils/src/codegraph/resolve.ts
1718
- import { existsSync as existsSync5 } from "node:fs";
1719
- import { homedir as homedir6 } from "node:os";
1720
- import { spawnSync } from "node:child_process";
1721
- import { basename as basename3, dirname as dirname2, join as join6 } from "node:path";
1722
- import { createRequire } from "node:module";
1723
-
1724
- // ../../utils/src/runtime/which.ts
1725
- import { accessSync, constants } from "node:fs";
1726
- import { delimiter, join as join5 } from "node:path";
1727
- var runtime = globalThis;
1728
- function isUnsafeCommandName(commandName) {
1729
- if (commandName.includes("/") || commandName.includes("\\"))
1730
- return true;
1731
- if (commandName === "." || commandName === ".." || commandName.includes(".."))
1732
- return true;
1733
- if (/^[a-zA-Z]:/.test(commandName))
1734
- return true;
1735
- if (commandName.includes("\x00"))
1736
- return true;
1737
- return false;
1738
- }
1739
- function isExecutable(filePath) {
1740
- try {
1741
- accessSync(filePath, process.platform === "win32" ? constants.F_OK : constants.X_OK);
1742
- return true;
1743
- } catch (error) {
1744
- if (!(error instanceof Error) && Object.prototype.toString.call(error) !== "[object Error]") {
1745
- throw error;
1746
- }
1747
- return false;
1748
- }
1749
- }
1750
- function resolvePathValue() {
1751
- if (process.platform === "win32")
1752
- return process.env["Path"] ?? process.env["PATH"];
1753
- return process.env["PATH"];
1754
- }
1755
- function getWindowsCandidates(commandName) {
1756
- if (process.platform !== "win32")
1757
- return [commandName];
1758
- if (/\.[^\\/]+$/.test(commandName))
1759
- return [commandName];
1760
- return [commandName, `${commandName}.exe`, `${commandName}.cmd`, `${commandName}.bat`, `${commandName}.com`];
1761
- }
1762
- function bunWhich(commandName) {
1763
- if (!commandName)
1764
- return null;
1765
- if (isUnsafeCommandName(commandName))
1766
- return null;
1767
- const candidateNames = getWindowsCandidates(commandName);
1768
- for (const candidateName of candidateNames) {
1769
- const resolvedPath = runtime.Bun?.which(candidateName) ?? null;
1770
- if (resolvedPath !== null)
1771
- return resolvedPath;
1772
- }
1773
- const pathValue = resolvePathValue();
1774
- if (!pathValue)
1775
- return null;
1776
- const pathEntries = pathValue.split(delimiter).filter((pathEntry) => pathEntry.length > 0);
1777
- if (pathEntries.length === 0)
1778
- return null;
1779
- for (const pathEntry of pathEntries) {
1780
- for (const candidateName of candidateNames) {
1781
- const candidatePath = join5(pathEntry, candidateName);
1782
- if (isExecutable(candidatePath))
1783
- return candidatePath;
1784
- }
1785
- }
1786
- return null;
1787
- }
1788
-
1789
- // ../../utils/src/codegraph/resolve.ts
1790
- function codegraphCommandRequiresSupportedLocalNode(resolution) {
1791
- return resolution.source !== "bundled" && resolution.source !== "env" && resolution.source !== "provisioned";
1792
- }
1793
- var CODEGRAPH_PACKAGE = "@colbymchenry/codegraph";
1794
- var CODEGRAPH_ENV_BIN = "OMO_CODEGRAPH_BIN";
1795
- var CODEGRAPH_LEGACY_ENV_BIN = "CODEGRAPH_BIN";
1796
- var CODEGRAPH_NODE_CANDIDATES = ["node24", "node22", "node20", "node"];
1797
- var requireFromHere = createRequire(import.meta.url);
1798
- function defaultRequireResolve(specifier) {
1799
- return requireFromHere.resolve(specifier);
1800
- }
1801
- function defaultNodeVersion(nodePath) {
1802
- if (nodePath === process.execPath && isNodeExecutableName(nodePath))
1803
- return process.versions.node;
1804
- try {
1805
- const result = spawnSync(nodePath, ["--version"], {
1806
- encoding: "utf8",
1807
- timeout: 2000,
1808
- windowsHide: true
1809
- });
1810
- if (result.error !== undefined || result.status !== 0)
1811
- return null;
1812
- const version = `${result.stdout}
1813
- ${result.stderr}`.trim().split(/\s+/)[0];
1814
- return version === undefined || version.length === 0 ? null : version;
1815
- } catch (error) {
1816
- if (error instanceof Error)
1817
- return null;
1818
- throw error;
1819
- }
1820
- }
1821
- function isNodeExecutableName(filePath) {
1822
- const executable = basename3(filePath).toLowerCase();
1823
- return executable === "node" || executable === "node.exe" || /^node\d+(\.exe)?$/.test(executable);
1824
- }
1825
- function looksLikePath(command) {
1826
- return command.includes("/") || command.includes("\\") || /^[a-zA-Z]:/.test(command);
1827
- }
1828
- function resolveConfiguredNodeRuntime(configured, fileExists, which) {
1829
- if (looksLikePath(configured))
1830
- return fileExists(configured) ? configured : null;
1831
- return which(configured);
1832
- }
1833
- function supportsCodegraphNodeRuntime(nodePath, env, nodeVersion) {
1834
- const version = nodeVersion(nodePath);
1835
- if (version === null)
1836
- return false;
1837
- return evaluateCodegraphNodeSupport({ env, nodeVersion: version }).supported;
1838
- }
1839
- function defaultNodeRuntime(env, fileExists, which, nodeVersion) {
1840
- const configured = env[CODEGRAPH_NODE_BIN_ENV]?.trim();
1841
- if (configured !== undefined && configured.length > 0) {
1842
- const resolved = resolveConfiguredNodeRuntime(configured, fileExists, which);
1843
- return resolved !== null && supportsCodegraphNodeRuntime(resolved, env, nodeVersion) ? resolved : null;
1844
- }
1845
- const candidates = [
1846
- ...isNodeExecutableName(process.execPath) ? [process.execPath] : [],
1847
- ...CODEGRAPH_NODE_CANDIDATES.map((commandName) => which(commandName)).filter((candidate) => candidate !== null)
1848
- ];
1849
- const seen = new Set;
1850
- for (const candidate of candidates) {
1851
- if (seen.has(candidate))
1852
- continue;
1853
- seen.add(candidate);
1854
- if (supportsCodegraphNodeRuntime(candidate, env, nodeVersion))
1855
- return candidate;
1856
- }
1857
- return null;
1858
- }
1859
- function defaultProvisionedBin(homeDir, fileExists) {
1860
- const binaryName = process.platform === "win32" ? "codegraph.cmd" : "codegraph";
1861
- const candidates = [
1862
- join6(homeDir, ".omo", "codegraph", "bin", binaryName),
1863
- join6(homeDir, ".omo", "codegraph", "node-servers", "node_modules", ".bin", binaryName)
1864
- ];
1865
- return candidates.find((candidate) => fileExists(candidate)) ?? null;
1866
- }
1867
- function resolveBundledShim(requireResolve, fileExists) {
1868
- try {
1869
- const packageJson = requireResolve(`${CODEGRAPH_PACKAGE}/package.json`);
1870
- const packageRoot = dirname2(packageJson);
1871
- const candidates = [join6(packageRoot, "bin", "codegraph.js"), join6(packageRoot, "npm-shim.js")];
1872
- return candidates.find((candidate) => fileExists(candidate)) ?? null;
1873
- } catch (error) {
1874
- if (error instanceof Error)
1875
- return null;
1876
- if (error === null || error === undefined)
1877
- return null;
1878
- if (typeof error === "object" || typeof error === "string" || typeof error === "number")
1879
- return null;
1880
- if (typeof error === "boolean" || typeof error === "bigint" || typeof error === "symbol")
1881
- return null;
1882
- return null;
1883
- }
1884
- }
1885
- function resolveCodegraphCommand(options = {}) {
1886
- const env = options.env ?? process.env;
1887
- const fileExists = options.fileExists ?? existsSync5;
1888
- const configuredBin = env[CODEGRAPH_ENV_BIN]?.trim() || env[CODEGRAPH_LEGACY_ENV_BIN]?.trim();
1889
- if (configuredBin !== undefined && configuredBin.length > 0) {
1890
- return { argsPrefix: [], command: configuredBin, exists: fileExists(configuredBin), source: "env" };
1891
- }
1892
- const which = options.which ?? bunWhich;
1893
- const nodeRuntime = options.nodeRuntime ?? (() => defaultNodeRuntime(env, fileExists, which, options.nodeVersion ?? defaultNodeVersion));
1894
- const bundled = resolveBundledShim(options.requireResolve ?? defaultRequireResolve, fileExists);
1895
- const runtime2 = nodeRuntime();
1896
- if (bundled !== null && runtime2 !== null) {
1897
- return { argsPrefix: [bundled], command: runtime2, exists: true, source: "bundled" };
1898
- }
1899
- const provisioned = options.provisioned?.() ?? defaultProvisionedBin(options.homeDir ?? homedir6(), fileExists);
1900
- if (provisioned !== null && fileExists(provisioned)) {
1901
- return { argsPrefix: [], command: provisioned, exists: true, source: "provisioned" };
1902
- }
1903
- const pathCommand = which("codegraph");
1904
- return {
1905
- argsPrefix: [],
1906
- command: pathCommand ?? "codegraph",
1907
- exists: pathCommand !== null,
1908
- source: "path"
1909
- };
1910
- }
1911
-
1912
1994
  // components/codegraph/src/session-start-worker.ts
1913
1995
  var SESSION_START_CWD_ENV = "OMO_CODEGRAPH_SESSION_START_CWD";
1914
1996
  var CODEGRAPH_VERSION = "1.0.1";
1915
1997
  var COMMAND_TIMEOUT_MS = 60000;
1916
1998
  var WINDOWS_CMD_EXTENSIONS = new Set([".bat", ".cmd"]);
1999
+ var WINDOWS_NODE_SCRIPT_EXTENSIONS = new Set([".cjs", ".js", ".mjs"]);
1917
2000
  var defaultDeps = {
1918
2001
  ensureGitignored: ensureCodegraphGitignored,
1919
2002
  ensureProvisioned: ensureCodegraphProvisioned,
@@ -1923,7 +2006,7 @@ var defaultDeps = {
1923
2006
  };
1924
2007
  async function runCodegraphSessionStartWorker(options = {}) {
1925
2008
  const env = options.env ?? processEnv;
1926
- const homeDir = resolveHomeDir(env);
2009
+ const homeDir = resolveHomeDir2(env);
1927
2010
  const projectRoot = options.cwd ?? env[SESSION_START_CWD_ENV] ?? processCwd();
1928
2011
  const config = options.config ?? getCodexOmoConfig({ cwd: projectRoot, env, homeDir });
1929
2012
  const logOutcome = options.logOutcome ?? ((outcome) => appendOutcome(homeDir, outcome));
@@ -1931,7 +2014,11 @@ async function runCodegraphSessionStartWorker(options = {}) {
1931
2014
  return finish("skipped-disabled", { projectRoot }, logOutcome);
1932
2015
  }
1933
2016
  const nodeSupport = evaluateCodegraphNodeSupport({ env, nodeVersion: options.nodeVersion });
1934
- return runBootstrap(projectRoot, config.codegraph ?? {}, env, homeDir, nodeSupport, { ...defaultDeps, ...options.deps }, logOutcome);
2017
+ const bootstrapConfig = {
2018
+ ...config.codegraph ?? {},
2019
+ ...config.trustedCodegraphInstallDir === undefined ? {} : { trustedCodegraphInstallDir: config.trustedCodegraphInstallDir }
2020
+ };
2021
+ return runBootstrap(projectRoot, bootstrapConfig, env, homeDir, nodeSupport, { ...defaultDeps, ...options.deps }, logOutcome);
1935
2022
  }
1936
2023
  async function runBootstrap(projectRoot, config, env, homeDir, nodeSupport, deps, logOutcome) {
1937
2024
  try {
@@ -1944,7 +2031,7 @@ async function runBootstrap(projectRoot, config, env, homeDir, nodeSupport, deps
1944
2031
  }
1945
2032
  deps.prepareWorkspace(projectRoot, { homeDir });
1946
2033
  deps.ensureGitignored(projectRoot);
1947
- const codegraphEnv = config.install_dir === undefined ? buildCodegraphEnv({ homeDir }) : { ...buildCodegraphEnv({ homeDir }), CODEGRAPH_INSTALL_DIR: config.install_dir };
2034
+ const codegraphEnv = codegraphEnvForConfig(config, homeDir);
1948
2035
  const status = await deps.runCommand(projectRoot, command.resolution.command, [...command.resolution.argsPrefix, "status", "--json"], { env: codegraphEnv, timeoutMs: COMMAND_TIMEOUT_MS });
1949
2036
  const decision = decideStartupAction(status);
1950
2037
  if (decision.kind === "skip")
@@ -1961,7 +2048,8 @@ function finish(action, detail, logOutcome) {
1961
2048
  return { action };
1962
2049
  }
1963
2050
  async function resolveOrProvisionCommand(deps, config, env, homeDir, nodeSupport) {
1964
- const resolved = deps.resolveCommand({ env, homeDir, provisioned: () => provisionedBinFromInstallDir(config.install_dir) });
2051
+ const trustedInstallDir = config.trustedCodegraphInstallDir;
2052
+ const resolved = deps.resolveCommand({ env, homeDir, provisioned: () => provisionedBinFromInstallDir(trustedInstallDir) });
1965
2053
  if (resolved.exists && canUseResolvedCommand(resolved, nodeSupport)) {
1966
2054
  return { kind: "resolved", resolution: resolved };
1967
2055
  }
@@ -1969,13 +2057,17 @@ async function resolveOrProvisionCommand(deps, config, env, homeDir, nodeSupport
1969
2057
  return { kind: "unsupported-node" };
1970
2058
  if (config.auto_provision === false)
1971
2059
  return { error: "codegraph binary unavailable and auto_provision is disabled", kind: "unavailable", source: resolved.source };
1972
- const installDir = config.install_dir ?? join7(homeDir, ".omo", "codegraph");
1973
- const provisioned = await deps.ensureProvisioned({ installDir, lockDir: join7(installDir, "locks"), version: CODEGRAPH_VERSION });
2060
+ const installDir = trustedInstallDir ?? join7(homeDir, ".omo", "codegraph");
2061
+ const provisioned = await deps.ensureProvisioned({ installDir, lockDir: join7(installDir, ".locks"), version: CODEGRAPH_VERSION });
1974
2062
  if (!provisioned.provisioned || provisioned.binPath === undefined) {
1975
2063
  return { error: provisioned.error ?? "provisioning did not produce a binary", kind: "unavailable", source: resolved.source };
1976
2064
  }
1977
2065
  return { kind: "resolved", resolution: { argsPrefix: [], command: provisioned.binPath, exists: true, source: "provisioned" } };
1978
2066
  }
2067
+ function codegraphEnvForConfig(config, homeDir) {
2068
+ const env = buildCodegraphEnv({ homeDir });
2069
+ return config.trustedCodegraphInstallDir === undefined ? env : { ...env, CODEGRAPH_INSTALL_DIR: config.trustedCodegraphInstallDir };
2070
+ }
1979
2071
  function canUseResolvedCommand(resolved, nodeSupport) {
1980
2072
  return !codegraphCommandRequiresSupportedLocalNode(resolved) || nodeSupport.supported;
1981
2073
  }
@@ -2014,7 +2106,7 @@ function jsonSaysInitialized(value) {
2014
2106
  async function runCodegraphCommand(projectRoot, command, args, options) {
2015
2107
  const invocation = resolveCodegraphCommandInvocation(command, args);
2016
2108
  return new Promise((resolvePromise) => {
2017
- execFile2(invocation.command, [...invocation.args], { cwd: projectRoot, encoding: "utf8", env: { ...process.env, ...options.env }, maxBuffer: 1024 * 1024, timeout: options.timeoutMs, windowsHide: true }, (error, stdout, stderr) => {
2109
+ execFile2(invocation.command, [...invocation.args], { cwd: projectRoot, encoding: "utf8", env: buildCodegraphChildEnv({ ambientEnv: processEnv, codegraphEnv: options.env }), maxBuffer: 1024 * 1024, timeout: options.timeoutMs, windowsHide: true }, (error, stdout, stderr) => {
2018
2110
  if (error === null) {
2019
2111
  resolvePromise({ exitCode: 0, stderr: toOutputText(stderr), stdout: toOutputText(stdout), timedOut: false });
2020
2112
  return;
@@ -2026,7 +2118,10 @@ async function runCodegraphCommand(projectRoot, command, args, options) {
2026
2118
  function resolveCodegraphCommandInvocation(command, args, platform = process.platform) {
2027
2119
  if (platform !== "win32")
2028
2120
  return { args: [...args], command };
2029
- if (!WINDOWS_CMD_EXTENSIONS.has(extname(command).toLowerCase()))
2121
+ const extension = extname(command).toLowerCase();
2122
+ if (WINDOWS_NODE_SCRIPT_EXTENSIONS.has(extension))
2123
+ return { args: [command, ...args], command: processExecPath };
2124
+ if (!WINDOWS_CMD_EXTENSIONS.has(extension))
2030
2125
  return { args: [...args], command };
2031
2126
  return { args: ["/d", "/s", "/c", command, ...args], command: "cmd.exe" };
2032
2127
  }
@@ -2061,8 +2156,8 @@ function resolveExitCode(error) {
2061
2156
  function toOutputText(value) {
2062
2157
  return Buffer.isBuffer(value) ? value.toString("utf8") : value;
2063
2158
  }
2064
- function resolveHomeDir(env) {
2065
- return env["HOME"] ?? env["USERPROFILE"] ?? homedir7();
2159
+ function resolveHomeDir2(env) {
2160
+ return env["HOME"] ?? env["USERPROFILE"] ?? homedir8();
2066
2161
  }
2067
2162
  function parseJson(text) {
2068
2163
  try {
@@ -2079,6 +2174,7 @@ function isRecord3(value) {
2079
2174
 
2080
2175
  // components/codegraph/src/hook.ts
2081
2176
  var CODEGRAPH_SESSION_START_NOTICE = "LazyCodex CodeGraph bootstrap scheduled in background";
2177
+ var STATUS_PROBE_TIMEOUT_MS = 2000;
2082
2178
  async function runCodegraphSessionStartHook(options = {}) {
2083
2179
  return (await executeCodegraphSessionStartHook(options)).exitCode;
2084
2180
  }
@@ -2089,23 +2185,90 @@ async function executeCodegraphSessionStartHook(options = {}) {
2089
2185
  const env = options.env ?? processEnv2;
2090
2186
  const input = await readHookInput(options.stdin ?? processStdin);
2091
2187
  const projectRoot = resolveProjectRoot(input, options.cwd ?? processCwd2());
2092
- const homeDir = resolveHomeDir2(env);
2188
+ const homeDir = resolveHomeDir3(env);
2093
2189
  const config = options.config ?? getCodexOmoConfig({ cwd: projectRoot, env, homeDir });
2094
2190
  if (config.codegraph?.enabled === false) {
2095
2191
  return { action: "skipped-disabled", exitCode: 0 };
2096
2192
  }
2193
+ const isInitialized = await (options.statusProbe ?? isCodegraphProjectInitialized)({
2194
+ env,
2195
+ homeDir,
2196
+ projectRoot,
2197
+ ...config.trustedCodegraphInstallDir === undefined ? {} : { trustedCodegraphInstallDir: config.trustedCodegraphInstallDir }
2198
+ });
2199
+ if (isInitialized) {
2200
+ return { action: "skipped-initialized", exitCode: 0 };
2201
+ }
2097
2202
  (options.spawnWorker ?? spawnDetachedWorker)({
2098
2203
  args: [options.workerCliPath ?? defaultWorkerCliPath(), "hook", "session-start-worker"],
2099
2204
  command: process.execPath,
2100
- env: { ...env, [SESSION_START_CWD_ENV]: projectRoot }
2205
+ env: buildCodegraphChildEnv({
2206
+ ambientEnv: env,
2207
+ codegraphEnv: { [SESSION_START_CWD_ENV]: projectRoot },
2208
+ runtimeEnv: env
2209
+ })
2101
2210
  });
2102
2211
  writeHookJson(options.stdout ?? processStdout);
2103
2212
  return { action: "spawned", exitCode: 0 };
2104
2213
  }
2214
+ async function isCodegraphProjectInitialized(options) {
2215
+ const resolved = resolveCodegraphCommand({
2216
+ env: options.env,
2217
+ homeDir: options.homeDir,
2218
+ provisioned: () => provisionedBinFromInstallDir2(options.trustedCodegraphInstallDir)
2219
+ });
2220
+ if (!resolved.exists)
2221
+ return false;
2222
+ const invocation = resolveCodegraphCommandInvocation(resolved.command, [...resolved.argsPrefix, "status", "--json"]);
2223
+ const codegraphEnv = {
2224
+ ...buildCodegraphEnv({ homeDir: options.homeDir }),
2225
+ ...options.trustedCodegraphInstallDir === undefined ? {} : { CODEGRAPH_INSTALL_DIR: options.trustedCodegraphInstallDir }
2226
+ };
2227
+ const status = await runStatusProbe(options.projectRoot, invocation.command, invocation.args, buildCodegraphChildEnv({ ambientEnv: options.env, codegraphEnv, runtimeEnv: options.env }));
2228
+ if (status.exitCode !== 0 || status.timedOut)
2229
+ return false;
2230
+ return codegraphStatusSaysInitialized(status.stdout);
2231
+ }
2232
+ function runStatusProbe(projectRoot, command, args, env) {
2233
+ return new Promise((resolveProbe) => {
2234
+ execFile3(command, [...args], {
2235
+ cwd: projectRoot,
2236
+ encoding: "utf8",
2237
+ env,
2238
+ maxBuffer: 1024 * 1024,
2239
+ timeout: STATUS_PROBE_TIMEOUT_MS,
2240
+ windowsHide: true
2241
+ }, (error, stdout) => {
2242
+ if (error === null) {
2243
+ resolveProbe({ exitCode: 0, stdout: toOutputText2(stdout), timedOut: false });
2244
+ return;
2245
+ }
2246
+ resolveProbe({ exitCode: resolveExitCode2(error), stdout: toOutputText2(stdout), timedOut: error.killed === true });
2247
+ });
2248
+ });
2249
+ }
2250
+ function codegraphStatusSaysInitialized(stdout) {
2251
+ const parsed = parseJson2(stdout);
2252
+ if (!isRecord4(parsed))
2253
+ return false;
2254
+ const initialized = parsed["initialized"] ?? parsed["isInitialized"] ?? parsed["ready"];
2255
+ if (typeof initialized === "boolean")
2256
+ return initialized;
2257
+ const status = parsed["status"];
2258
+ if (typeof status !== "string")
2259
+ return false;
2260
+ const normalized = status.toLowerCase();
2261
+ return (normalized.includes("initialized") || normalized.includes("ready")) && !normalized.includes("not initialized") && !normalized.includes("uninitialized");
2262
+ }
2263
+ function provisionedBinFromInstallDir2(installDir) {
2264
+ if (installDir === undefined)
2265
+ return null;
2266
+ return join8(installDir, "bin", process.platform === "win32" ? "codegraph.cmd" : "codegraph");
2267
+ }
2105
2268
  async function executeCodegraphPostToolUseHook(options = {}) {
2106
2269
  const env = options.env ?? processEnv2;
2107
2270
  const input = await readHookInput(options.stdin ?? processStdin);
2108
- const output = runCodegraphPostToolUseHook(input, { homeDir: resolveHomeDir2(env) });
2271
+ const output = runCodegraphPostToolUseHook(input, { homeDir: resolveHomeDir3(env) });
2109
2272
  if (output.length === 0)
2110
2273
  return { action: "skipped", exitCode: 0 };
2111
2274
  (options.stdout ?? processStdout).write(output);
@@ -2140,8 +2303,16 @@ function spawnDetachedWorker(invocation) {
2140
2303
  const child = spawn(invocation.command, [...invocation.args], { detached: true, env: invocation.env, stdio: "ignore" });
2141
2304
  child.unref();
2142
2305
  }
2143
- function resolveHomeDir2(env) {
2144
- return env["HOME"] ?? env["USERPROFILE"] ?? homedir8();
2306
+ function resolveHomeDir3(env) {
2307
+ return env["HOME"] ?? env["USERPROFILE"] ?? homedir9();
2308
+ }
2309
+ function resolveExitCode2(error) {
2310
+ if ("code" in error && typeof error.code === "number")
2311
+ return error.code;
2312
+ return 1;
2313
+ }
2314
+ function toOutputText2(value) {
2315
+ return Buffer.isBuffer(value) ? value.toString("utf8") : value;
2145
2316
  }
2146
2317
  function resolveProjectRoot(input, fallback) {
2147
2318
  if (!isRecord4(input))
@@ -2176,81 +2347,450 @@ function defaultWorkerCliPath() {
2176
2347
  }
2177
2348
 
2178
2349
  // components/codegraph/src/serve.ts
2179
- import { spawn as spawn2 } from "node:child_process";
2180
2350
  import { existsSync as existsSync7, realpathSync as realpathSync2 } from "node:fs";
2181
- import { homedir as homedir9 } from "node:os";
2182
- import { basename as basename4, extname as extname2, join as join8, resolve as resolve3 } from "node:path";
2351
+ import { homedir as homedir10 } from "node:os";
2352
+ import { basename as basename4, join as join9, resolve as resolve3 } from "node:path";
2183
2353
  import {
2184
2354
  cwd as processCwd3,
2185
2355
  env as processEnv3,
2186
- execPath as processExecPath,
2187
- stderr as processStderr2
2356
+ stdin as processStdin2,
2357
+ stderr as processStderr2,
2358
+ stdout as processStdout2
2188
2359
  } from "node:process";
2189
2360
  import { fileURLToPath as fileURLToPath2 } from "node:url";
2361
+
2362
+ // components/codegraph/src/mcp-bridge.ts
2363
+ import { spawn as spawn2 } from "node:child_process";
2364
+
2365
+ // ../../mcp-stdio-core/src/record.ts
2366
+ function isPlainRecord(value) {
2367
+ return typeof value === "object" && value !== null && !Array.isArray(value);
2368
+ }
2369
+ // ../../mcp-stdio-core/src/responses.ts
2370
+ function successResponse(id, result) {
2371
+ return { jsonrpc: "2.0", id, result };
2372
+ }
2373
+ function errorResponse(id, code, message, data) {
2374
+ return { jsonrpc: "2.0", id, error: data === undefined ? { code, message } : { code, message, data } };
2375
+ }
2376
+ function jsonRpcId(value) {
2377
+ return typeof value === "string" || typeof value === "number" || value === null ? value : null;
2378
+ }
2379
+ // ../../mcp-stdio-core/src/transport.ts
2380
+ var HEADER_SEPARATOR = Buffer.from(`\r
2381
+ \r
2382
+ `);
2383
+ async function* readStdioJsonRpcMessages(input) {
2384
+ let buffer = Buffer.alloc(0);
2385
+ for await (const chunk of input) {
2386
+ buffer = Buffer.concat([buffer, bufferFromChunk(chunk)]);
2387
+ while (true) {
2388
+ const result = readNextMessage(buffer);
2389
+ if (result.kind === "incomplete")
2390
+ break;
2391
+ buffer = result.remaining;
2392
+ if (result.message)
2393
+ yield result.message;
2394
+ }
2395
+ }
2396
+ const trailing = buffer.toString("utf8").trim();
2397
+ if (trailing.length > 0) {
2398
+ yield parseJsonPayload(trailing, "line");
2399
+ }
2400
+ }
2401
+ function writeStdioJsonRpcResponse(output, response, responseMode) {
2402
+ const body = JSON.stringify(response);
2403
+ if (responseMode === "framed") {
2404
+ output.write(`Content-Length: ${Buffer.byteLength(body, "utf8")}\r
2405
+ \r
2406
+ ${body}`);
2407
+ return;
2408
+ }
2409
+ output.write(`${body}
2410
+ `);
2411
+ }
2412
+ function readNextMessage(buffer) {
2413
+ if (buffer.length === 0)
2414
+ return { kind: "incomplete" };
2415
+ return startsWithContentLength(buffer) ? readFramedMessage(buffer) : readLineMessage(buffer);
2416
+ }
2417
+ function readLineMessage(buffer) {
2418
+ const newlineIndex = buffer.indexOf(10);
2419
+ if (newlineIndex === -1)
2420
+ return { kind: "incomplete" };
2421
+ const line = buffer.subarray(0, newlineIndex).toString("utf8").replace(/\r$/, "");
2422
+ if (line.trim().length === 0) {
2423
+ return { kind: "complete", remaining: buffer.subarray(newlineIndex + 1) };
2424
+ }
2425
+ return {
2426
+ kind: "complete",
2427
+ message: parseJsonPayload(line, "line"),
2428
+ remaining: buffer.subarray(newlineIndex + 1)
2429
+ };
2430
+ }
2431
+ function readFramedMessage(buffer) {
2432
+ const separatorIndex = buffer.indexOf(HEADER_SEPARATOR);
2433
+ if (separatorIndex === -1)
2434
+ return { kind: "incomplete" };
2435
+ const headers = buffer.subarray(0, separatorIndex).toString("ascii");
2436
+ const contentLength = parseContentLength(headers);
2437
+ const bodyStart = separatorIndex + HEADER_SEPARATOR.length;
2438
+ if (contentLength === undefined) {
2439
+ return {
2440
+ kind: "complete",
2441
+ message: {
2442
+ kind: "parse_error",
2443
+ message: "Missing or invalid Content-Length header",
2444
+ responseMode: "framed"
2445
+ },
2446
+ remaining: buffer.subarray(bodyStart)
2447
+ };
2448
+ }
2449
+ const bodyEnd = bodyStart + contentLength;
2450
+ if (buffer.length < bodyEnd)
2451
+ return { kind: "incomplete" };
2452
+ const body = buffer.subarray(bodyStart, bodyEnd).toString("utf8");
2453
+ return {
2454
+ kind: "complete",
2455
+ message: parseJsonPayload(body, "framed"),
2456
+ remaining: buffer.subarray(bodyEnd)
2457
+ };
2458
+ }
2459
+ function startsWithContentLength(buffer) {
2460
+ const prefix = buffer.subarray(0, "content-length:".length).toString("ascii").toLowerCase();
2461
+ return prefix === "content-length:";
2462
+ }
2463
+ function parseContentLength(headers) {
2464
+ for (const line of headers.split(`\r
2465
+ `)) {
2466
+ const match = /^content-length:\s*(\d+)$/i.exec(line);
2467
+ if (match === null)
2468
+ continue;
2469
+ const value = match[1];
2470
+ if (value === undefined)
2471
+ return;
2472
+ return Number(value);
2473
+ }
2474
+ return;
2475
+ }
2476
+ function parseJsonPayload(payload, responseMode) {
2477
+ try {
2478
+ return { kind: "request", payload: JSON.parse(payload), responseMode };
2479
+ } catch (error) {
2480
+ return { kind: "parse_error", message: error instanceof Error ? error.message : String(error), responseMode };
2481
+ }
2482
+ }
2483
+ function bufferFromChunk(chunk) {
2484
+ if (Buffer.isBuffer(chunk))
2485
+ return chunk;
2486
+ if (typeof chunk === "string")
2487
+ return Buffer.from(chunk);
2488
+ throw new TypeError(`Unsupported stdio chunk type: ${typeof chunk}`);
2489
+ }
2490
+
2491
+ // ../../mcp-stdio-core/src/server.ts
2492
+ var DEFAULT_IDLE_TIMEOUT_MS = 10 * 60000;
2493
+ var noopLog = () => {};
2494
+ async function runJsonRpcStdioServer(config) {
2495
+ const log = config.log ?? noopLog;
2496
+ const idleTimeoutMs = config.idleTimeoutMs ?? DEFAULT_IDLE_TIMEOUT_MS;
2497
+ const idleTimer = createIdleTimer(idleTimeoutMs, log, config.onIdleTimeout);
2498
+ log("stdio_started", { cwd: process.cwd(), idle_timeout_ms: idleTimeoutMs });
2499
+ idleTimer.arm();
2500
+ try {
2501
+ for await (const message of readStdioJsonRpcMessages(config.input)) {
2502
+ if (idleTimer.closed())
2503
+ break;
2504
+ idleTimer.arm();
2505
+ if (message.kind === "parse_error") {
2506
+ handleParseError(message, config, log);
2507
+ continue;
2508
+ }
2509
+ await handleRequest(message, config, log);
2510
+ }
2511
+ } finally {
2512
+ idleTimer.clear();
2513
+ log("stdio_stopped");
2514
+ }
2515
+ }
2516
+ function handleParseError(message, config, log) {
2517
+ log("parse_error", { message: message.message });
2518
+ const response = config.parseErrorResponse?.(message.message) ?? errorResponse(null, -32700, "Parse error", message.message);
2519
+ if (response !== undefined) {
2520
+ writeStdioJsonRpcResponse(config.output, response, message.responseMode);
2521
+ }
2522
+ }
2523
+ async function handleRequest(message, config, log) {
2524
+ const parsed = message.payload;
2525
+ const id = isPlainRecord(parsed) ? jsonRpcId(parsed["id"]) : null;
2526
+ const method = isPlainRecord(parsed) && typeof parsed["method"] === "string" ? parsed["method"] : null;
2527
+ log("request", { id: id === null ? null : String(id), method });
2528
+ try {
2529
+ const response = await config.handler(parsed, config.handlerOptions);
2530
+ if (response === undefined)
2531
+ return;
2532
+ writeStdioJsonRpcResponse(config.output, response, message.responseMode);
2533
+ log("response", { id: String(response.id), method, is_error: response.error !== undefined });
2534
+ } catch (error) {
2535
+ if (config.onHandlerError === undefined)
2536
+ throw error;
2537
+ config.onHandlerError(error);
2538
+ }
2539
+ }
2540
+ function createIdleTimer(idleTimeoutMs, log, onIdleTimeout) {
2541
+ let timer = null;
2542
+ let isClosed = false;
2543
+ return {
2544
+ arm: () => {
2545
+ if (timer !== null)
2546
+ clearTimeout(timer);
2547
+ if (idleTimeoutMs <= 0)
2548
+ return;
2549
+ timer = setTimeout(() => {
2550
+ isClosed = true;
2551
+ log("idle_timeout", { idle_timeout_ms: idleTimeoutMs });
2552
+ onIdleTimeout?.();
2553
+ }, idleTimeoutMs);
2554
+ timer.unref();
2555
+ },
2556
+ clear: () => {
2557
+ if (timer === null)
2558
+ return;
2559
+ clearTimeout(timer);
2560
+ timer = null;
2561
+ },
2562
+ closed: () => isClosed
2563
+ };
2564
+ }
2565
+ // components/codegraph/src/serve-invocation.ts
2566
+ import { extname as extname2 } from "node:path";
2567
+ import { execPath as processExecPath2 } from "node:process";
2568
+ var WINDOWS_CMD_EXTENSIONS2 = new Set([".bat", ".cmd"]);
2569
+ var WINDOWS_NODE_SCRIPT_EXTENSIONS2 = new Set([".cjs", ".js", ".mjs"]);
2570
+ function resolveServeProcessInvocation(command, args, platform = process.platform) {
2571
+ if (platform !== "win32")
2572
+ return { args: [...args], command };
2573
+ const extension = extname2(command).toLowerCase();
2574
+ if (WINDOWS_NODE_SCRIPT_EXTENSIONS2.has(extension)) {
2575
+ return { args: [command, ...args], command: processExecPath2 };
2576
+ }
2577
+ if (WINDOWS_CMD_EXTENSIONS2.has(extension)) {
2578
+ return { args: ["/d", "/s", "/c", command, ...args], command: "cmd.exe" };
2579
+ }
2580
+ return { args: [...args], command };
2581
+ }
2582
+
2583
+ // components/codegraph/src/mcp-bridge.ts
2584
+ class CodegraphBridgeStdioError extends Error {
2585
+ streamName;
2586
+ name = "CodegraphBridgeStdioError";
2587
+ constructor(streamName) {
2588
+ super(`CodeGraph MCP bridge missing child ${streamName}`);
2589
+ this.streamName = streamName;
2590
+ }
2591
+ }
2592
+ async function runBridgedCodegraphProcess(command, args, options) {
2593
+ const invocation = resolveServeProcessInvocation(command, args);
2594
+ const child = spawn2(invocation.command, invocation.args, {
2595
+ cwd: options.cwd,
2596
+ env: options.env,
2597
+ stdio: ["pipe", "pipe", "inherit"]
2598
+ });
2599
+ const childInput = child.stdin;
2600
+ const childOutput = child.stdout;
2601
+ if (childInput === null)
2602
+ throw new CodegraphBridgeStdioError("stdin");
2603
+ if (childOutput === null)
2604
+ throw new CodegraphBridgeStdioError("stdout");
2605
+ const responseModes = new Map;
2606
+ let defaultResponseMode = "framed";
2607
+ const childExit = new Promise((resolveExit, reject) => {
2608
+ child.once("error", reject);
2609
+ child.once("exit", (code, signal) => {
2610
+ if (code !== null) {
2611
+ resolveExit(code);
2612
+ return;
2613
+ }
2614
+ resolveExit(signal === null ? 0 : 1);
2615
+ });
2616
+ });
2617
+ const bridgeDone = Promise.all([
2618
+ forwardClientToCodegraph(options.input, childInput, responseModes, (mode) => {
2619
+ defaultResponseMode = mode;
2620
+ }),
2621
+ forwardCodegraphToClient(childOutput, options.output, responseModes, () => defaultResponseMode)
2622
+ ]);
2623
+ const destroyChildPipes = () => {
2624
+ childInput.destroy();
2625
+ childOutput.destroy();
2626
+ };
2627
+ childExit.then(destroyChildPipes, destroyChildPipes);
2628
+ return Promise.race([childExit, bridgeDone.then(() => childExit)]);
2629
+ }
2630
+ async function forwardClientToCodegraph(input, childInput, responseModes, setDefaultResponseMode) {
2631
+ for await (const message of readStdioJsonRpcMessages(input)) {
2632
+ if (message.kind === "parse_error") {
2633
+ continue;
2634
+ }
2635
+ const responseMode = message.responseMode;
2636
+ setDefaultResponseMode(responseMode);
2637
+ const key = responseModeKey(message.payload);
2638
+ if (key !== null)
2639
+ responseModes.set(key, responseMode);
2640
+ await writeLine(childInput, JSON.stringify(message.payload));
2641
+ }
2642
+ childInput.end();
2643
+ }
2644
+ async function forwardCodegraphToClient(childOutput, output, responseModes, defaultResponseMode) {
2645
+ for await (const message of readStdioJsonRpcMessages(childOutput)) {
2646
+ if (message.kind === "parse_error") {
2647
+ writeStdioJsonRpcResponse(output, errorResponse(null, -32700, "Parse error", message.message), defaultResponseMode());
2648
+ continue;
2649
+ }
2650
+ const key = responseModeKey(message.payload);
2651
+ const responseMode = key === null ? defaultResponseMode() : responseModes.get(key) ?? defaultResponseMode();
2652
+ if (key !== null)
2653
+ responseModes.delete(key);
2654
+ writeStdioJsonRpcResponse(output, message.payload, responseMode);
2655
+ }
2656
+ }
2657
+ function responseModeKey(payload) {
2658
+ if (!isPlainRecord(payload) || !("id" in payload))
2659
+ return null;
2660
+ const id = jsonRpcId(payload["id"]);
2661
+ return `${typeof id}:${String(id)}`;
2662
+ }
2663
+ async function writeLine(output, line) {
2664
+ if (output.write(`${line}
2665
+ `))
2666
+ return;
2667
+ await new Promise((resolveDrain, reject) => {
2668
+ output.once("drain", resolveDrain);
2669
+ output.once("error", reject);
2670
+ });
2671
+ }
2672
+
2673
+ // components/codegraph/src/mcp-unavailable.ts
2674
+ async function runUnavailableCodegraphMcpServer(options) {
2675
+ await runJsonRpcStdioServer({
2676
+ handler: handleUnavailableCodegraphMcpRequest,
2677
+ handlerOptions: {
2678
+ reason: options.reason.trim(),
2679
+ serverVersion: options.serverVersion
2680
+ },
2681
+ input: options.input,
2682
+ output: options.output
2683
+ });
2684
+ }
2685
+ async function handleUnavailableCodegraphMcpRequest(input, options) {
2686
+ if (!isPlainRecord(input)) {
2687
+ return errorResponse(null, -32600, "Invalid Request");
2688
+ }
2689
+ const id = jsonRpcId(input["id"]);
2690
+ const method = input["method"];
2691
+ if (method === "notifications/initialized")
2692
+ return;
2693
+ if (method === "ping")
2694
+ return successResponse(id, {});
2695
+ if (method === "initialize") {
2696
+ return successResponse(id, {
2697
+ capabilities: { tools: { listChanged: false } },
2698
+ protocolVersion: requestedProtocolVersion(input["params"]),
2699
+ serverInfo: { name: "codegraph", version: options.serverVersion }
2700
+ });
2701
+ }
2702
+ if (method === "tools/list") {
2703
+ return successResponse(id, { tools: [] });
2704
+ }
2705
+ if (method === "tools/call") {
2706
+ return successResponse(id, {
2707
+ content: [{ text: options.reason, type: "text" }],
2708
+ isError: true
2709
+ });
2710
+ }
2711
+ return errorResponse(id, -32601, `Method not found: ${String(method)}`);
2712
+ }
2713
+ function requestedProtocolVersion(params) {
2714
+ if (!isPlainRecord(params) || typeof params["protocolVersion"] !== "string")
2715
+ return "2024-11-05";
2716
+ return params["protocolVersion"];
2717
+ }
2718
+
2719
+ // components/codegraph/src/serve.ts
2190
2720
  var CODEGRAPH_SKIP_HINT = `CodeGraph MCP skipped: codegraph binary not found. Install CodeGraph or set OMO_CODEGRAPH_BIN.
2191
2721
  `;
2192
2722
  var CODEGRAPH_DISABLED_HINT = `CodeGraph MCP skipped: disabled by OMO SOT config. Set [codex].codegraph.enabled=true to enable it.
2193
2723
  `;
2194
2724
  var CODEGRAPH_VERSION2 = "1.0.1";
2195
- var WINDOWS_CMD_EXTENSIONS2 = new Set([".bat", ".cmd"]);
2196
- var WINDOWS_NODE_SCRIPT_EXTENSIONS = new Set([".cjs", ".js", ".mjs"]);
2725
+ var PROJECT_CWD_ENV_KEYS = ["OMO_CODEGRAPH_PROJECT_CWD", SESSION_START_CWD_ENV, "PWD"];
2197
2726
  async function runCodegraphServe(options = {}) {
2198
2727
  const env = options.env ?? processEnv3;
2199
- const homeDir = options.homeDir ?? homedir9();
2200
- const config = options.config ?? getCodexOmoConfig({ cwd: options.cwd ?? processCwd3(), env, homeDir });
2728
+ const homeDir = options.homeDir ?? homedir10();
2729
+ const wrapperCwd = options.cwd ?? processCwd3();
2730
+ const projectCwd = resolveProjectCwd(env, wrapperCwd);
2731
+ const config = options.config ?? getCodexOmoConfig({ cwd: projectCwd, env, homeDir });
2201
2732
  const codegraphConfig = config.codegraph ?? {};
2202
2733
  if (codegraphConfig.enabled === false) {
2203
- (options.stderr ?? processStderr2).write(CODEGRAPH_DISABLED_HINT);
2204
- return 1;
2734
+ return runUnavailableMcp(CODEGRAPH_DISABLED_HINT, options);
2205
2735
  }
2736
+ const trustedInstallDir = config.trustedCodegraphInstallDir;
2206
2737
  const resolutionOptions = {
2207
2738
  env,
2208
2739
  homeDir,
2209
- provisioned: () => provisionedBinFromInstallDir2(codegraphConfig.install_dir)
2740
+ provisioned: () => provisionedBinFromInstallDir3(trustedInstallDir)
2210
2741
  };
2211
2742
  let resolution = options.resolve?.(resolutionOptions) ?? resolveCodegraphCommand(resolutionOptions);
2212
2743
  const nodeSupport = evaluateCodegraphNodeSupport({ env, nodeVersion: options.nodeVersion });
2213
2744
  if (!resolution.exists || shouldSkipResolvedCommand(resolution, options.commandExists ?? existsSync7)) {
2214
2745
  if (resolution.source === "path" && !nodeSupport.supported) {
2215
- (options.stderr ?? processStderr2).write(buildCodegraphNodeSkipHint(nodeSupport));
2216
- return 1;
2746
+ return runUnavailableMcp(buildCodegraphNodeSkipHint(nodeSupport), options);
2217
2747
  }
2218
2748
  const provisioned = await provisionMissingCodegraph({
2219
2749
  config: codegraphConfig,
2220
2750
  ensureProvisioned: options.ensureProvisioned ?? ensureCodegraphProvisioned,
2221
2751
  homeDir,
2222
- resolution
2752
+ resolution,
2753
+ ...trustedInstallDir === undefined ? {} : { trustedInstallDir }
2223
2754
  });
2224
2755
  if (provisioned === null) {
2225
- (options.stderr ?? processStderr2).write(CODEGRAPH_SKIP_HINT);
2226
- return 1;
2756
+ return runUnavailableMcp(CODEGRAPH_SKIP_HINT, options);
2227
2757
  }
2228
2758
  resolution = provisioned;
2229
2759
  }
2230
2760
  if (codegraphCommandRequiresSupportedLocalNode(resolution) && !nodeSupport.supported) {
2231
- (options.stderr ?? processStderr2).write(buildCodegraphNodeSkipHint(nodeSupport));
2232
- return 1;
2233
- }
2234
- const runProcess = options.runProcess ?? runChildProcess;
2235
- const codegraphEnv = codegraphEnvForConfig(codegraphConfig, homeDir, options.buildEnv);
2236
- const mergedEnv = {
2237
- ...env,
2238
- ...codegraphEnv
2239
- };
2761
+ return runUnavailableMcp(buildCodegraphNodeSkipHint(nodeSupport), options);
2762
+ }
2763
+ const runProcess = options.runProcess ?? runBridgedCodegraphProcess;
2764
+ const codegraphEnv = codegraphEnvForConfig2(trustedInstallDir, homeDir, options.buildEnv);
2765
+ const mergedEnv = buildCodegraphChildEnv({ ambientEnv: env, codegraphEnv, runtimeEnv: env });
2240
2766
  return runProcess(resolution.command, [...resolution.argsPrefix, "serve", "--mcp"], {
2767
+ cwd: projectCwd,
2241
2768
  env: mergedEnv,
2242
- stdio: "inherit"
2769
+ input: options.stdin ?? processStdin2,
2770
+ output: options.stdout ?? processStdout2,
2771
+ stderr: options.stderr ?? processStderr2,
2772
+ stdio: "pipe"
2243
2773
  });
2244
2774
  }
2775
+ async function runUnavailableMcp(reason, options) {
2776
+ (options.stderr ?? processStderr2).write(reason);
2777
+ await runUnavailableCodegraphMcpServer({
2778
+ input: options.stdin ?? processStdin2,
2779
+ output: options.stdout ?? processStdout2,
2780
+ reason,
2781
+ serverVersion: CODEGRAPH_VERSION2
2782
+ });
2783
+ return 0;
2784
+ }
2245
2785
  async function provisionMissingCodegraph(options) {
2246
2786
  if (options.resolution.source === "env")
2247
2787
  return null;
2248
2788
  if (options.config.auto_provision === false)
2249
2789
  return null;
2250
- const installDir = options.config.install_dir ?? join8(options.homeDir, ".omo", "codegraph");
2790
+ const installDir = options.trustedInstallDir ?? join9(options.homeDir, ".omo", "codegraph");
2251
2791
  const result = await options.ensureProvisioned({
2252
2792
  installDir,
2253
- lockDir: join8(installDir, ".locks"),
2793
+ lockDir: join9(installDir, ".locks"),
2254
2794
  version: CODEGRAPH_VERSION2
2255
2795
  });
2256
2796
  if (!result.provisioned || result.binPath === undefined)
@@ -2267,45 +2807,30 @@ function shouldSkipResolvedCommand(resolution, commandExists) {
2267
2807
  function looksLikePath2(command) {
2268
2808
  return command.includes("/") || command.includes("\\");
2269
2809
  }
2270
- function codegraphEnvForConfig(config, homeDir, buildEnv) {
2810
+ function codegraphEnvForConfig2(trustedInstallDir, homeDir, buildEnv) {
2271
2811
  const env = buildEnv?.({ homeDir }) ?? buildCodegraphEnv({ homeDir });
2272
- return config.install_dir === undefined ? env : { ...env, CODEGRAPH_INSTALL_DIR: config.install_dir };
2812
+ return trustedInstallDir === undefined ? env : { ...env, CODEGRAPH_INSTALL_DIR: trustedInstallDir };
2273
2813
  }
2274
- function provisionedBinFromInstallDir2(installDir) {
2814
+ function resolveProjectCwd(env, fallback) {
2815
+ for (const key of PROJECT_CWD_ENV_KEYS) {
2816
+ const candidate = env[key]?.trim();
2817
+ if (candidate === undefined || candidate.length === 0)
2818
+ continue;
2819
+ const resolved = resolve3(candidate);
2820
+ if (existsSync7(resolved))
2821
+ return resolved;
2822
+ }
2823
+ return resolve3(fallback);
2824
+ }
2825
+ function provisionedBinFromInstallDir3(installDir) {
2275
2826
  if (installDir === undefined)
2276
2827
  return null;
2277
- const candidate = join8(installDir, "bin", process.platform === "win32" ? "codegraph.cmd" : "codegraph");
2828
+ const candidate = join9(installDir, "bin", process.platform === "win32" ? "codegraph.cmd" : "codegraph");
2278
2829
  return existsSync7(candidate) ? candidate : null;
2279
2830
  }
2280
2831
  async function runCodegraphServeCli() {
2281
2832
  process.exitCode = await runCodegraphServe();
2282
2833
  }
2283
- async function runChildProcess(command, args, options) {
2284
- const invocation = resolveServeProcessInvocation(command, args);
2285
- const child = spawn2(invocation.command, invocation.args, { env: options.env, stdio: options.stdio });
2286
- return new Promise((resolve4, reject) => {
2287
- child.once("error", reject);
2288
- child.once("exit", (code, signal) => {
2289
- if (code !== null) {
2290
- resolve4(code);
2291
- return;
2292
- }
2293
- resolve4(signal === null ? 0 : 1);
2294
- });
2295
- });
2296
- }
2297
- function resolveServeProcessInvocation(command, args, platform = process.platform) {
2298
- if (platform !== "win32")
2299
- return { args: [...args], command };
2300
- const extension = extname2(command).toLowerCase();
2301
- if (WINDOWS_NODE_SCRIPT_EXTENSIONS.has(extension)) {
2302
- return { args: [command, ...args], command: processExecPath };
2303
- }
2304
- if (WINDOWS_CMD_EXTENSIONS2.has(extension)) {
2305
- return { args: ["/d", "/s", "/c", command, ...args], command: "cmd.exe" };
2306
- }
2307
- return { args: [...args], command };
2308
- }
2309
2834
  if (isDirectInvocation(process.argv[1])) {
2310
2835
  runCodegraphServeCli().catch((error) => {
2311
2836
  processStderr2.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}