oh-my-opencode 4.10.0 → 4.11.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 (1689) hide show
  1. package/.agents/skills/codex-qa/SKILL.md +96 -0
  2. package/.agents/skills/codex-qa/references/app-server.md +63 -0
  3. package/.agents/skills/codex-qa/references/components-hooks.md +38 -0
  4. package/.agents/skills/codex-qa/references/docker-qa.md +62 -0
  5. package/.agents/skills/codex-qa/references/install-verify.md +57 -0
  6. package/.agents/skills/codex-qa/references/isolation.md +57 -0
  7. package/.agents/skills/codex-qa/references/logging-debug.md +60 -0
  8. package/.agents/skills/codex-qa/scripts/app-server-drive.sh +76 -0
  9. package/.agents/skills/codex-qa/scripts/hook-unit-probe.sh +69 -0
  10. package/.agents/skills/codex-qa/scripts/install-verify.sh +60 -0
  11. package/.agents/skills/codex-qa/scripts/lib/app-server-client.mjs +117 -0
  12. package/.agents/skills/codex-qa/scripts/lib/common.sh +180 -0
  13. package/.agents/skills/codex-qa/scripts/lib/mock-model.mjs +56 -0
  14. package/.agents/skills/codex-qa/scripts/tui-smoke.sh +71 -0
  15. package/.agents/skills/opencode-qa/SKILL.md +8 -1
  16. package/.agents/skills/opencode-qa/references/docker-qa.md +72 -0
  17. package/.agents/skills/tech-debt-audit/SKILL.md +14 -14
  18. package/.agents/skills/work-with-pr/SKILL.md +77 -53
  19. package/.opencode/skills/work-with-pr/SKILL.md +79 -55
  20. package/README.ja.md +3 -3
  21. package/README.ko.md +3 -3
  22. package/README.md +2 -2
  23. package/README.ru.md +3 -3
  24. package/README.zh-cn.md +3 -3
  25. package/THIRD-PARTY-NOTICES.md +205 -0
  26. package/dist/agents/dynamic-agent-prompt-types.d.ts +1 -1
  27. package/dist/agents/index.d.ts +0 -1
  28. package/dist/agents/prometheus/index.d.ts +0 -1
  29. package/dist/agents/prometheus/system-prompt.d.ts +0 -2
  30. package/dist/cli/config-manager/add-tui-plugin-to-tui-config.d.ts +7 -0
  31. package/dist/cli/doctor/checks/codex-components.d.ts +4 -4
  32. package/dist/cli/doctor/checks/codex-runtime-wrapper.d.ts +7 -0
  33. package/dist/cli/doctor/checks/codex.d.ts +1 -1
  34. package/dist/cli/doctor/checks/config.d.ts +1 -1
  35. package/dist/cli/doctor/checks/dependencies.d.ts +1 -2
  36. package/dist/cli/doctor/checks/index.d.ts +1 -1
  37. package/dist/cli/doctor/checks/model-resolution.d.ts +1 -1
  38. package/dist/cli/doctor/checks/system.d.ts +1 -1
  39. package/dist/cli/doctor/checks/team-mode.d.ts +1 -1
  40. package/dist/cli/doctor/checks/tools-gh.d.ts +1 -1
  41. package/dist/cli/doctor/checks/tools-mcp.d.ts +1 -1
  42. package/dist/cli/doctor/checks/tools.d.ts +2 -1
  43. package/dist/cli/doctor/checks/tui-plugin-config.d.ts +7 -1
  44. package/dist/cli/doctor/framework/constants.d.ts +32 -0
  45. package/dist/cli/doctor/framework/spawn-with-timeout.d.ts +8 -0
  46. package/dist/cli/doctor/framework/types.d.ts +147 -0
  47. package/dist/cli/doctor/index.d.ts +4 -4
  48. package/dist/cli/doctor/runner.d.ts +1 -1
  49. package/dist/cli/index.js +9717 -7523
  50. package/dist/cli/install-ast-grep-sg.d.ts +10 -0
  51. package/dist/cli/install-codex/codex-cache-bins.d.ts +1 -21
  52. package/dist/cli/install-codex/codex-cache-bundled-mcps.d.ts +1 -5
  53. package/dist/cli/install-codex/codex-cache-command-shim.d.ts +1 -1
  54. package/dist/cli/install-codex/codex-cache-fs.d.ts +1 -3
  55. package/dist/cli/install-codex/codex-cache-install.d.ts +1 -13
  56. package/dist/cli/install-codex/codex-cache-legacy-bins.d.ts +1 -3
  57. package/dist/cli/install-codex/codex-cache-local-dependencies.d.ts +1 -1
  58. package/dist/cli/install-codex/codex-cache-mcp-manifest.d.ts +1 -2
  59. package/dist/cli/install-codex/codex-cache-paths.d.ts +1 -2
  60. package/dist/cli/install-codex/codex-cache-prune.d.ts +1 -10
  61. package/dist/cli/install-codex/codex-cache.d.ts +1 -4
  62. package/dist/cli/install-codex/codex-cached-marketplace-manifest.d.ts +1 -6
  63. package/dist/cli/install-codex/codex-cleanup-config.d.ts +1 -6
  64. package/dist/cli/install-codex/codex-cleanup.d.ts +1 -25
  65. package/dist/cli/install-codex/codex-config-agents.d.ts +1 -3
  66. package/dist/cli/install-codex/codex-config-features.d.ts +1 -1
  67. package/dist/cli/install-codex/codex-config-marketplaces.d.ts +1 -6
  68. package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
  69. package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -9
  70. package/dist/cli/install-codex/codex-config-reasoning.d.ts +1 -2
  71. package/dist/cli/install-codex/codex-config-toml-sections.d.ts +1 -9
  72. package/dist/cli/install-codex/codex-config-toml.d.ts +1 -13
  73. package/dist/cli/install-codex/codex-hook-trust.d.ts +1 -6
  74. package/dist/cli/install-codex/codex-installation-detection.d.ts +1 -36
  75. package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +1 -8
  76. package/dist/cli/install-codex/codex-marketplace-snapshot.d.ts +1 -15
  77. package/dist/cli/install-codex/codex-marketplace.d.ts +1 -9
  78. package/dist/cli/install-codex/codex-model-catalog.d.ts +1 -13
  79. package/dist/cli/install-codex/codex-multi-agent-v2-config.d.ts +1 -12
  80. package/dist/cli/install-codex/codex-package-layout.d.ts +1 -1
  81. package/dist/cli/install-codex/codex-process.d.ts +1 -7
  82. package/dist/cli/install-codex/codex-project-local-cleanup-best-effort.d.ts +1 -7
  83. package/dist/cli/install-codex/codex-project-local-cleanup.d.ts +1 -35
  84. package/dist/cli/install-codex/git-bash.d.ts +1 -35
  85. package/dist/cli/install-codex/index.d.ts +1 -11
  86. package/dist/cli/install-codex/install-codex.d.ts +1 -10
  87. package/dist/cli/install-codex/lazycodex-version-stamp.d.ts +1 -19
  88. package/dist/cli/install-codex/link-cached-plugin-agents.d.ts +1 -20
  89. package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +1 -5
  90. package/dist/cli/install-codex/toml-section-editor.d.ts +1 -11
  91. package/dist/cli/install-codex/types.d.ts +1 -76
  92. package/dist/cli/mcp-oauth/login.d.ts +1 -1
  93. package/dist/cli-node/index.js +9774 -7525
  94. package/dist/config/index.d.ts +1 -1
  95. package/dist/config/schema/agent-names.d.ts +1 -1
  96. package/dist/config/schema/codegraph.d.ts +9 -0
  97. package/dist/config/schema/git-env-prefix.d.ts +1 -5
  98. package/dist/config/schema/hooks.d.ts +3 -0
  99. package/dist/config/schema/monitor.d.ts +15 -0
  100. package/dist/config/schema/oh-my-opencode-config.d.ts +27 -16
  101. package/dist/config/schema/openclaw.d.ts +5 -4
  102. package/dist/config/schema/team-mode.d.ts +1 -16
  103. package/dist/config/schema/tmux.d.ts +4 -5
  104. package/dist/config/schema/tui.d.ts +10 -0
  105. package/dist/config/schema.d.ts +2 -0
  106. package/dist/config/validate.d.ts +8 -0
  107. package/dist/create-hooks.d.ts +5 -0
  108. package/dist/create-managers.d.ts +7 -0
  109. package/dist/create-runtime-tmux-config.d.ts +1 -1
  110. package/dist/create-tools.d.ts +1 -1
  111. package/dist/features/background-agent/error-classifier.d.ts +2 -2
  112. package/dist/features/background-agent/manager.d.ts +29 -2
  113. package/dist/features/background-agent/parent-wake-dispatched-tracker.d.ts +8 -0
  114. package/dist/features/background-agent/parent-wake-notifier.d.ts +4 -0
  115. package/dist/features/background-agent/spawner/fallback-agent.d.ts +3 -2
  116. package/dist/features/background-agent/spawner/task-prompt-body.d.ts +5 -6
  117. package/dist/features/background-agent/task-snapshot.d.ts +2 -0
  118. package/dist/features/background-agent/types.d.ts +7 -0
  119. package/dist/features/builtin-commands/templates/refactor-sections/intro-and-analysis.d.ts +1 -1
  120. package/dist/features/builtin-commands/templates/refactor-sections/plan-and-execution.d.ts +1 -1
  121. package/dist/features/builtin-commands/templates/refactor-sections/team-mode-addendum.d.ts +1 -1
  122. package/dist/features/builtin-commands/templates/refactor-sections/verification-and-tooling.d.ts +1 -1
  123. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
  124. package/dist/features/builtin-skills/index.d.ts +1 -2
  125. package/dist/features/builtin-skills/skill-file-loader.d.ts +1 -4
  126. package/dist/features/builtin-skills/skills/agent-browser-skill.d.ts +1 -2
  127. package/dist/features/builtin-skills/skills/agent-browser-template.d.ts +1 -2
  128. package/dist/features/builtin-skills/skills/debugging.d.ts +1 -2
  129. package/dist/features/builtin-skills/skills/dev-browser.d.ts +1 -2
  130. package/dist/features/builtin-skills/skills/frontend.d.ts +1 -0
  131. package/dist/features/builtin-skills/skills/git-master-sections/commit-atomic-planning.d.ts +1 -1
  132. package/dist/features/builtin-skills/skills/git-master-sections/commit-context-analysis.d.ts +1 -1
  133. package/dist/features/builtin-skills/skills/git-master-sections/commit-execution-verification.d.ts +1 -1
  134. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
  135. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
  136. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
  137. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
  138. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
  139. package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +1 -2
  140. package/dist/features/builtin-skills/skills/git-master.d.ts +1 -2
  141. package/dist/features/builtin-skills/skills/index.d.ts +1 -13
  142. package/dist/features/builtin-skills/skills/init-deep.d.ts +1 -2
  143. package/dist/features/builtin-skills/skills/playwright-cli.d.ts +1 -10
  144. package/dist/features/builtin-skills/skills/playwright-mcp-skill.d.ts +1 -2
  145. package/dist/features/builtin-skills/skills/playwright.d.ts +1 -2
  146. package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +1 -2
  147. package/dist/features/builtin-skills/skills/review-work.d.ts +1 -2
  148. package/dist/features/builtin-skills/skills/security-research.d.ts +1 -2
  149. package/dist/features/builtin-skills/skills/security-review.d.ts +1 -2
  150. package/dist/features/builtin-skills/skills/team-mode.d.ts +1 -2
  151. package/dist/features/builtin-skills/skills/visual-qa.d.ts +1 -2
  152. package/dist/features/builtin-skills/skills.d.ts +1 -12
  153. package/dist/features/builtin-skills/types.d.ts +1 -15
  154. package/dist/features/claude-code-agent-loader/agent-definitions-loader.d.ts +1 -3
  155. package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +1 -4
  156. package/dist/features/claude-code-agent-loader/index.d.ts +1 -5
  157. package/dist/features/claude-code-agent-loader/json-agent-loader.d.ts +1 -2
  158. package/dist/features/claude-code-agent-loader/loader.d.ts +1 -5
  159. package/dist/features/claude-code-agent-loader/opencode-config-agents-reader.d.ts +1 -2
  160. package/dist/features/claude-code-agent-loader/types.d.ts +1 -29
  161. package/dist/features/claude-code-command-loader/index.d.ts +1 -2
  162. package/dist/features/claude-code-command-loader/loader-cache.d.ts +1 -6
  163. package/dist/features/claude-code-command-loader/loader.d.ts +1 -8
  164. package/dist/features/claude-code-command-loader/types.d.ts +1 -42
  165. package/dist/features/claude-code-mcp-loader/configure-allowed-env-vars.d.ts +1 -5
  166. package/dist/features/claude-code-mcp-loader/index.d.ts +1 -11
  167. package/dist/features/claude-code-mcp-loader/loader.d.ts +1 -4
  168. package/dist/features/claude-code-mcp-loader/scope-filter.d.ts +1 -2
  169. package/dist/features/claude-code-mcp-loader/transformer.d.ts +1 -2
  170. package/dist/features/claude-code-mcp-loader/types.d.ts +1 -43
  171. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +1 -3
  172. package/dist/features/claude-code-plugin-loader/command-loader.d.ts +1 -3
  173. package/dist/features/claude-code-plugin-loader/discovery-core.d.ts +1 -2
  174. package/dist/features/claude-code-plugin-loader/discovery-paths.d.ts +1 -3
  175. package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -3
  176. package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +1 -2
  177. package/dist/features/claude-code-plugin-loader/index.d.ts +1 -10
  178. package/dist/features/claude-code-plugin-loader/install-path-resolver.d.ts +1 -1
  179. package/dist/features/claude-code-plugin-loader/installed-plugin-database.d.ts +1 -3
  180. package/dist/features/claude-code-plugin-loader/loaded-plugin.d.ts +1 -2
  181. package/dist/features/claude-code-plugin-loader/loader.d.ts +1 -36
  182. package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +1 -3
  183. package/dist/features/claude-code-plugin-loader/plugin-key.d.ts +1 -1
  184. package/dist/features/claude-code-plugin-loader/plugin-manifest.d.ts +1 -4
  185. package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +1 -2
  186. package/dist/features/claude-code-plugin-loader/plugin-settings.d.ts +1 -3
  187. package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +1 -2
  188. package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +1 -3
  189. package/dist/features/claude-code-plugin-loader/types.d.ts +1 -240
  190. package/dist/features/claude-tasks/types.d.ts +4 -4
  191. package/dist/features/hook-message-injector/sdk-message-lookup.d.ts +9 -2
  192. package/dist/features/mcp-oauth/callback-server.d.ts +1 -19
  193. package/dist/features/mcp-oauth/dcr.d.ts +1 -34
  194. package/dist/features/mcp-oauth/discovery.d.ts +1 -8
  195. package/dist/features/mcp-oauth/oauth-authorization-flow.d.ts +1 -26
  196. package/dist/features/mcp-oauth/provider.d.ts +1 -30
  197. package/dist/features/mcp-oauth/refresh-mutex.d.ts +1 -26
  198. package/dist/features/mcp-oauth/resource-indicator.d.ts +1 -0
  199. package/dist/features/mcp-oauth/schema.d.ts +1 -0
  200. package/dist/features/mcp-oauth/step-up.d.ts +1 -8
  201. package/dist/features/mcp-oauth/storage.d.ts +1 -17
  202. package/dist/features/monitor/batcher.d.ts +36 -0
  203. package/dist/features/monitor/envelope.d.ts +9 -0
  204. package/dist/features/monitor/filter.d.ts +10 -0
  205. package/dist/features/monitor/index.d.ts +2 -0
  206. package/dist/features/monitor/line-stream.d.ts +29 -0
  207. package/dist/features/monitor/manager-internals.d.ts +65 -0
  208. package/dist/features/monitor/manager.d.ts +35 -0
  209. package/dist/features/monitor/monitor-state-factory.d.ts +24 -0
  210. package/dist/features/monitor/output-injector-session-inspect.d.ts +9 -0
  211. package/dist/features/monitor/output-injector-types.d.ts +48 -0
  212. package/dist/features/monitor/output-injector.d.ts +21 -0
  213. package/dist/features/monitor/permission.d.ts +33 -0
  214. package/dist/features/monitor/pipeline.d.ts +26 -0
  215. package/dist/features/monitor/process.d.ts +21 -0
  216. package/dist/features/monitor/ring-buffer.d.ts +25 -0
  217. package/dist/features/monitor/types.d.ts +83 -0
  218. package/dist/features/opencode-runtime-skills/index.d.ts +1 -2
  219. package/dist/features/opencode-runtime-skills/runtime-skill-config.d.ts +1 -17
  220. package/dist/features/opencode-runtime-skills/skill-markdown.d.ts +1 -7
  221. package/dist/features/opencode-runtime-skills/source-server.d.ts +1 -24
  222. package/dist/features/opencode-skill-loader/allowed-tools-parser.d.ts +1 -1
  223. package/dist/features/opencode-skill-loader/config-source-discovery.d.ts +1 -7
  224. package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -20
  225. package/dist/features/opencode-skill-loader/index.d.ts +1 -16
  226. package/dist/features/opencode-skill-loader/loaded-skill-from-path.d.ts +1 -9
  227. package/dist/features/opencode-skill-loader/loaded-skill-template-extractor.d.ts +1 -2
  228. package/dist/features/opencode-skill-loader/loader.d.ts +1 -21
  229. package/dist/features/opencode-skill-loader/merger/builtin-skill-converter.d.ts +1 -3
  230. package/dist/features/opencode-skill-loader/merger/config-skill-entry-loader.d.ts +1 -3
  231. package/dist/features/opencode-skill-loader/merger/scope-priority.d.ts +1 -2
  232. package/dist/features/opencode-skill-loader/merger/skill-definition-merger.d.ts +1 -3
  233. package/dist/features/opencode-skill-loader/merger/skills-config-normalizer.d.ts +1 -11
  234. package/dist/features/opencode-skill-loader/merger.d.ts +1 -7
  235. package/dist/features/opencode-skill-loader/opencode-config-skills-reader.d.ts +1 -5
  236. package/dist/features/opencode-skill-loader/skill-content.d.ts +1 -5
  237. package/dist/features/opencode-skill-loader/skill-deduplication.d.ts +1 -2
  238. package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +1 -5
  239. package/dist/features/opencode-skill-loader/skill-directory-loader.d.ts +1 -8
  240. package/dist/features/opencode-skill-loader/skill-discovery.d.ts +1 -4
  241. package/dist/features/opencode-skill-loader/skill-mcp-config.d.ts +1 -3
  242. package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -9
  243. package/dist/features/opencode-skill-loader/skill-template-resolver.d.ts +1 -11
  244. package/dist/features/opencode-skill-loader/types.d.ts +1 -34
  245. package/dist/features/skill-mcp-manager/cleanup.d.ts +1 -8
  246. package/dist/features/skill-mcp-manager/connection-type.d.ts +1 -7
  247. package/dist/features/skill-mcp-manager/connection.d.ts +1 -14
  248. package/dist/features/skill-mcp-manager/env-cleaner.d.ts +1 -2
  249. package/dist/features/skill-mcp-manager/error-redaction.d.ts +1 -10
  250. package/dist/features/skill-mcp-manager/http-client.d.ts +1 -19
  251. package/dist/features/skill-mcp-manager/index.d.ts +1 -2
  252. package/dist/features/skill-mcp-manager/manager.d.ts +1 -27
  253. package/dist/features/skill-mcp-manager/oauth-handler.d.ts +1 -17
  254. package/dist/features/skill-mcp-manager/stdio-client.d.ts +1 -16
  255. package/dist/features/skill-mcp-manager/types.d.ts +1 -79
  256. package/dist/features/team-mode/member-parser.d.ts +1 -16
  257. package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +1 -4
  258. package/dist/features/team-mode/team-layout-tmux/index.d.ts +1 -1
  259. package/dist/features/team-mode/team-layout-tmux/layout.d.ts +1 -37
  260. package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +1 -9
  261. package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +1 -9
  262. package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +1 -8
  263. package/dist/features/team-mode/team-mailbox/ack.d.ts +1 -2
  264. package/dist/features/team-mode/team-mailbox/inbox.d.ts +1 -3
  265. package/dist/features/team-mode/team-mailbox/index.d.ts +1 -7
  266. package/dist/features/team-mode/team-mailbox/pending-delivery-recovery.d.ts +1 -31
  267. package/dist/features/team-mode/team-mailbox/poll.d.ts +1 -10
  268. package/dist/features/team-mode/team-mailbox/reservation.d.ts +1 -11
  269. package/dist/features/team-mode/team-mailbox/send.d.ts +1 -30
  270. package/dist/features/team-mode/team-registry/index.d.ts +1 -3
  271. package/dist/features/team-mode/team-registry/loader.d.ts +1 -12
  272. package/dist/features/team-mode/team-registry/paths.d.ts +1 -28
  273. package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +1 -6
  274. package/dist/features/team-mode/team-registry/validator.d.ts +1 -10
  275. package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +1 -1
  276. package/dist/features/team-mode/team-state-store/active-resume.d.ts +1 -5
  277. package/dist/features/team-mode/team-state-store/creating-resume.d.ts +1 -4
  278. package/dist/features/team-mode/team-state-store/deleting-resume.d.ts +1 -4
  279. package/dist/features/team-mode/team-state-store/error-normalization.d.ts +1 -2
  280. package/dist/features/team-mode/team-state-store/index.d.ts +1 -1
  281. package/dist/features/team-mode/team-state-store/locks.d.ts +1 -15
  282. package/dist/features/team-mode/team-state-store/reservation-reconciliation.d.ts +1 -4
  283. package/dist/features/team-mode/team-state-store/resume-report.d.ts +1 -7
  284. package/dist/features/team-mode/team-state-store/resume.d.ts +1 -5
  285. package/dist/features/team-mode/team-state-store/runtime-cleanup.d.ts +1 -4
  286. package/dist/features/team-mode/team-state-store/session-liveness.d.ts +1 -9
  287. package/dist/features/team-mode/team-state-store/store.d.ts +1 -21
  288. package/dist/features/team-mode/team-state-store/worker-resume-status.d.ts +1 -9
  289. package/dist/features/team-mode/team-tasklist/claim.d.ts +1 -10
  290. package/dist/features/team-mode/team-tasklist/dependencies.d.ts +1 -2
  291. package/dist/features/team-mode/team-tasklist/get.d.ts +1 -3
  292. package/dist/features/team-mode/team-tasklist/index.d.ts +1 -6
  293. package/dist/features/team-mode/team-tasklist/list.d.ts +1 -8
  294. package/dist/features/team-mode/team-tasklist/store.d.ts +1 -3
  295. package/dist/features/team-mode/team-tasklist/test-support.d.ts +1 -9
  296. package/dist/features/team-mode/team-tasklist/update.d.ts +1 -9
  297. package/dist/features/team-mode/team-worktree/cleanup.d.ts +1 -3
  298. package/dist/features/team-mode/team-worktree/index.d.ts +1 -2
  299. package/dist/features/team-mode/team-worktree/manager.d.ts +1 -15
  300. package/dist/features/team-mode/tools/lifecycle-create-tool.d.ts +2 -2
  301. package/dist/features/team-mode/tools/lifecycle-inline-spec.d.ts +2 -2
  302. package/dist/features/team-mode/tools/lifecycle-participant.d.ts +2 -2
  303. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +8 -8
  304. package/dist/features/team-mode/tools/messaging-live-delivery-recipient.d.ts +2 -2
  305. package/dist/features/team-mode/tools/messaging-live-delivery-reservation.d.ts +1 -1
  306. package/dist/features/team-mode/tools/messaging-live-delivery-state.d.ts +1 -1
  307. package/dist/features/team-mode/tools/messaging-live-delivery.d.ts +1 -1
  308. package/dist/features/team-mode/tools/messaging-runtime.d.ts +2 -2
  309. package/dist/features/team-mode/tools/query.d.ts +3 -3
  310. package/dist/features/team-mode/tools/tasks.d.ts +2 -2
  311. package/dist/features/team-mode/types.d.ts +1 -343
  312. package/dist/features/tui-sidebar/compute-view.d.ts +10 -0
  313. package/dist/features/tui-sidebar/config-validator.d.ts +2 -0
  314. package/dist/features/tui-sidebar/constants.d.ts +10 -0
  315. package/dist/features/tui-sidebar/derivers.d.ts +10 -0
  316. package/dist/features/tui-sidebar/element-helpers.d.ts +9 -0
  317. package/dist/features/tui-sidebar/loop-reader.d.ts +2 -0
  318. package/dist/features/tui-sidebar/mirror-io.d.ts +3 -0
  319. package/dist/features/tui-sidebar/mirror-manager.d.ts +28 -0
  320. package/dist/features/tui-sidebar/mirror-path.d.ts +3 -0
  321. package/dist/features/tui-sidebar/render-view.d.ts +15 -0
  322. package/dist/features/tui-sidebar/roster-resolver.d.ts +2 -0
  323. package/dist/features/tui-sidebar/snapshot-builder.d.ts +28 -0
  324. package/dist/features/tui-sidebar/snapshot-schema.d.ts +41 -0
  325. package/dist/features/tui-sidebar/state-types.d.ts +72 -0
  326. package/dist/hooks/ast-grep-sg-provision/hook.d.ts +19 -0
  327. package/dist/hooks/ast-grep-sg-provision/index.d.ts +1 -0
  328. package/dist/hooks/auto-slash-command/constants.d.ts +1 -5
  329. package/dist/hooks/auto-slash-command/detector.d.ts +1 -15
  330. package/dist/hooks/auto-slash-command/processed-command-store.d.ts +1 -7
  331. package/dist/hooks/auto-slash-command/types.d.ts +1 -48
  332. package/dist/hooks/auto-update-checker/constants.d.ts +3 -3
  333. package/dist/hooks/codegraph-bootstrap/command-runner.d.ts +16 -0
  334. package/dist/hooks/codegraph-bootstrap/hook.d.ts +34 -0
  335. package/dist/hooks/codegraph-bootstrap/index.d.ts +1 -0
  336. package/dist/hooks/codegraph-bootstrap/project-root.d.ts +1 -0
  337. package/dist/hooks/codegraph-bootstrap/status.d.ts +11 -0
  338. package/dist/hooks/delegate-task-retry/guidance.d.ts +1 -2
  339. package/dist/hooks/delegate-task-retry/patterns.d.ts +2 -11
  340. package/dist/hooks/index.d.ts +3 -0
  341. package/dist/hooks/monitor-status-injector/hook.d.ts +30 -0
  342. package/dist/hooks/monitor-status-injector/index.d.ts +2 -0
  343. package/dist/hooks/runtime-fallback/auto-retry-signal.d.ts +1 -4
  344. package/dist/hooks/runtime-fallback/error-classifier.d.ts +7 -6
  345. package/dist/hooks/runtime-fallback/fallback-state.d.ts +3 -2
  346. package/dist/hooks/runtime-fallback/test-timeout-clock.test-support.d.ts +6 -0
  347. package/dist/hooks/tool-pair-validator/tool-part-ids.d.ts +2 -1
  348. package/dist/index.js +89513 -95172
  349. package/dist/interactive-bash-availability.d.ts +1 -0
  350. package/dist/mcp/codegraph.d.ts +16 -0
  351. package/dist/mcp/index.d.ts +10 -2
  352. package/dist/mcp/shared/ancestor-cli-resolver.d.ts +25 -0
  353. package/dist/mcp/types.d.ts +1 -1
  354. package/dist/oh-my-opencode.schema.json +139 -16
  355. package/dist/openclaw/config.d.ts +1 -8
  356. package/dist/openclaw/daemon.d.ts +1 -1
  357. package/dist/openclaw/dispatcher.d.ts +1 -12
  358. package/dist/openclaw/gateway-url-validation.d.ts +1 -1
  359. package/dist/openclaw/index.d.ts +1 -5
  360. package/dist/openclaw/reply-listener-discord.d.ts +1 -4
  361. package/dist/openclaw/reply-listener-injection.d.ts +1 -10
  362. package/dist/openclaw/reply-listener-log.d.ts +1 -2
  363. package/dist/openclaw/reply-listener-paths.d.ts +1 -7
  364. package/dist/openclaw/reply-listener-poll-loop.d.ts +1 -3
  365. package/dist/openclaw/reply-listener-process.d.ts +1 -4
  366. package/dist/openclaw/reply-listener-signature.d.ts +1 -2
  367. package/dist/openclaw/reply-listener-sleep.d.ts +1 -1
  368. package/dist/openclaw/reply-listener-spawn.d.ts +1 -5
  369. package/dist/openclaw/reply-listener-start.d.ts +1 -9
  370. package/dist/openclaw/reply-listener-startup.d.ts +1 -12
  371. package/dist/openclaw/reply-listener-state.d.ts +1 -29
  372. package/dist/openclaw/reply-listener-status.d.ts +1 -4
  373. package/dist/openclaw/reply-listener-stop.d.ts +1 -7
  374. package/dist/openclaw/reply-listener-telegram.d.ts +1 -4
  375. package/dist/openclaw/reply-listener.d.ts +1 -5
  376. package/dist/openclaw/runtime-dispatch.d.ts +1 -17
  377. package/dist/openclaw/session-registry-lock.d.ts +1 -2
  378. package/dist/openclaw/session-registry-paths.d.ts +1 -9
  379. package/dist/openclaw/session-registry-storage.d.ts +1 -4
  380. package/dist/openclaw/session-registry-types.d.ts +1 -11
  381. package/dist/openclaw/session-registry.d.ts +1 -8
  382. package/dist/openclaw/tmux.d.ts +1 -8
  383. package/dist/openclaw/types.d.ts +1 -42
  384. package/dist/plugin/event-error-utils.d.ts +2 -1
  385. package/dist/plugin/hooks/create-core-hooks.d.ts +5 -0
  386. package/dist/plugin/hooks/create-session-hooks.d.ts +3 -1
  387. package/dist/plugin/hooks/create-transform-hooks.d.ts +4 -1
  388. package/dist/plugin/messages-transform.d.ts +1 -0
  389. package/dist/plugin/skill-context.d.ts +2 -0
  390. package/dist/plugin/tool-registry-factories.d.ts +2 -1
  391. package/dist/plugin/tool-registry-gated-tools.d.ts +7 -0
  392. package/dist/plugin/tool-registry.d.ts +1 -1
  393. package/dist/plugin/types.d.ts +2 -9
  394. package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -0
  395. package/dist/shared/archive-entry-validator.d.ts +1 -6
  396. package/dist/shared/bun-file-shim.d.ts +1 -8
  397. package/dist/shared/bun-spawn-shim.d.ts +1 -43
  398. package/dist/shared/bun-which-shim.d.ts +1 -1
  399. package/dist/shared/classify-path-environment.d.ts +1 -3
  400. package/dist/shared/command-executor/embedded-commands.d.ts +1 -7
  401. package/dist/shared/command-executor/execute-command.d.ts +1 -1
  402. package/dist/shared/command-executor/execute-hook-command.d.ts +1 -23
  403. package/dist/shared/command-executor/home-directory.d.ts +1 -1
  404. package/dist/shared/command-executor/resolve-commands-in-text.d.ts +1 -1
  405. package/dist/shared/command-executor/shell-path.d.ts +1 -2
  406. package/dist/shared/command-executor.d.ts +1 -4
  407. package/dist/shared/git-worktree/collect-git-diff-stats.d.ts +1 -2
  408. package/dist/shared/git-worktree/format-file-changes.d.ts +1 -2
  409. package/dist/shared/git-worktree/index.d.ts +1 -7
  410. package/dist/shared/git-worktree/parse-diff-numstat.d.ts +1 -2
  411. package/dist/shared/git-worktree/parse-status-porcelain-line.d.ts +1 -6
  412. package/dist/shared/git-worktree/parse-status-porcelain.d.ts +1 -2
  413. package/dist/shared/git-worktree/types.d.ts +1 -7
  414. package/dist/shared/internal-initiator-marker.d.ts +1 -46
  415. package/dist/shared/logger.d.ts +3 -11
  416. package/dist/shared/migration/agent-category.d.ts +1 -19
  417. package/dist/shared/migration/agent-names.d.ts +1 -6
  418. package/dist/shared/migration/config-migration.d.ts +1 -1
  419. package/dist/shared/migration/hook-names.d.ts +1 -6
  420. package/dist/shared/migration/migrations-sidecar.d.ts +1 -41
  421. package/dist/shared/migration/model-versions.d.ts +1 -22
  422. package/dist/shared/migration.d.ts +1 -5
  423. package/dist/shared/model-suggestion-retry.d.ts +39 -17
  424. package/dist/shared/plugin-identity.d.ts +8 -8
  425. package/dist/shared/posthog.d.ts +3 -0
  426. package/dist/shared/process-stream-reader.d.ts +1 -3
  427. package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +1 -1
  428. package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +1 -11
  429. package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +1 -9
  430. package/dist/shared/prompt-async-gate/queue.d.ts +1 -8
  431. package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +1 -14
  432. package/dist/shared/prompt-async-gate/reservations.d.ts +1 -9
  433. package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +1 -7
  434. package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +1 -16
  435. package/dist/shared/prompt-async-gate/timing.d.ts +1 -9
  436. package/dist/shared/prompt-async-gate/types.d.ts +1 -123
  437. package/dist/shared/prompt-async-gate.d.ts +3 -7
  438. package/dist/shared/prompt-failure-classifier.d.ts +1 -9
  439. package/dist/shared/session-idle-settle.d.ts +1 -12
  440. package/dist/shared/shell-env.d.ts +1 -1
  441. package/dist/shared/skill-path-resolver.d.ts +1 -1
  442. package/dist/shared/tmux/cmux-detect.d.ts +1 -8
  443. package/dist/shared/tmux/constants.d.ts +1 -5
  444. package/dist/shared/tmux/runner.d.ts +2 -13
  445. package/dist/shared/tmux/tmux-utils/adapter-deps.d.ts +9 -0
  446. package/dist/shared/tmux/tmux-utils/environment.d.ts +2 -4
  447. package/dist/shared/tmux/tmux-utils/layout.d.ts +4 -17
  448. package/dist/shared/tmux/tmux-utils/pane-close.d.ts +3 -10
  449. package/dist/shared/tmux/tmux-utils/pane-command.d.ts +1 -2
  450. package/dist/shared/tmux/tmux-utils/pane-dimensions.d.ts +2 -4
  451. package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -11
  452. package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +1 -13
  453. package/dist/shared/tmux/tmux-utils/server-health.d.ts +2 -15
  454. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +3 -14
  455. package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -1
  456. package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +4 -17
  457. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +1 -13
  458. package/dist/shared/tmux/types.d.ts +1 -4
  459. package/dist/shared/write-file-atomically.d.ts +2 -0
  460. package/dist/shared/zip-entry-listing/powershell-zip-entry-listing.d.ts +1 -4
  461. package/dist/shared/zip-entry-listing/python-zip-entry-listing.d.ts +1 -3
  462. package/dist/shared/zip-entry-listing/read-zip-symlink-target.d.ts +1 -1
  463. package/dist/shared/zip-entry-listing/tar-zip-entry-listing.d.ts +1 -3
  464. package/dist/shared/zip-entry-listing/zipinfo-zip-entry-listing.d.ts +1 -4
  465. package/dist/shared/zip-entry-listing.d.ts +1 -4
  466. package/dist/skills/ast-grep/LICENSE +21 -0
  467. package/dist/skills/ast-grep/README.md +136 -0
  468. package/dist/skills/ast-grep/SKILL.md +272 -0
  469. package/dist/skills/ast-grep/SOURCE +1 -0
  470. package/dist/skills/ast-grep/install.ps1 +235 -0
  471. package/dist/skills/ast-grep/install.sh +286 -0
  472. package/dist/skills/ast-grep/references/cli.md +231 -0
  473. package/dist/skills/ast-grep/references/install.md +166 -0
  474. package/dist/skills/ast-grep/references/patterns.md +147 -0
  475. package/dist/skills/ast-grep/references/pitfalls.md +303 -0
  476. package/dist/skills/ast-grep/references/recipes.md +402 -0
  477. package/dist/skills/ast-grep/references/sgconfig.md +248 -0
  478. package/dist/skills/ast-grep/references/yaml-rules.md +509 -0
  479. package/dist/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
  480. package/dist/skills/ast-grep/tests/smoke.ps1 +123 -0
  481. package/dist/skills/ast-grep/tests/smoke.sh +212 -0
  482. package/dist/skills/debugging/SKILL.md +116 -0
  483. package/dist/skills/debugging/references/methodology/00-setup.md +108 -0
  484. package/dist/skills/debugging/references/methodology/02-investigate.md +130 -0
  485. package/dist/skills/debugging/references/methodology/04-oracle-triple.md +136 -0
  486. package/dist/skills/debugging/references/methodology/05-escalate.md +69 -0
  487. package/dist/skills/debugging/references/methodology/06-fix.md +116 -0
  488. package/dist/skills/debugging/references/methodology/08-qa.md +94 -0
  489. package/dist/skills/debugging/references/methodology/09-cleanup.md +164 -0
  490. package/dist/skills/debugging/references/methodology/partial-runtime-evidence.md +229 -0
  491. package/dist/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
  492. package/dist/skills/debugging/references/runtimes/go.md +252 -0
  493. package/dist/skills/debugging/references/runtimes/native-binary.md +484 -0
  494. package/dist/skills/debugging/references/runtimes/node.md +260 -0
  495. package/dist/skills/debugging/references/runtimes/python.md +248 -0
  496. package/dist/skills/debugging/references/runtimes/rust.md +234 -0
  497. package/dist/skills/debugging/references/tools/ghidra.md +212 -0
  498. package/dist/skills/debugging/references/tools/playwright-cli.md +194 -0
  499. package/dist/skills/debugging/references/tools/pwndbg.md +263 -0
  500. package/dist/skills/debugging/references/tools/pwntools.md +265 -0
  501. package/dist/skills/frontend/ATTRIBUTION.md +127 -0
  502. package/dist/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  503. package/dist/skills/frontend/SKILL.md +113 -0
  504. package/dist/skills/frontend/references/design/README.md +240 -0
  505. package/dist/skills/frontend/references/design/_INDEX.md +189 -0
  506. package/dist/skills/frontend/references/design/airbnb.md +390 -0
  507. package/dist/skills/frontend/references/design/airtable.md +89 -0
  508. package/dist/skills/frontend/references/design/apple.md +247 -0
  509. package/dist/skills/frontend/references/design/binance.md +345 -0
  510. package/dist/skills/frontend/references/design/bmw.md +180 -0
  511. package/dist/skills/frontend/references/design/brutalist-skill.md +92 -0
  512. package/dist/skills/frontend/references/design/bugatti.md +268 -0
  513. package/dist/skills/frontend/references/design/cal.md +259 -0
  514. package/dist/skills/frontend/references/design/claude.md +312 -0
  515. package/dist/skills/frontend/references/design/clay.md +304 -0
  516. package/dist/skills/frontend/references/design/clickhouse.md +281 -0
  517. package/dist/skills/frontend/references/design/cohere.md +266 -0
  518. package/dist/skills/frontend/references/design/coinbase.md +129 -0
  519. package/dist/skills/frontend/references/design/composio.md +307 -0
  520. package/dist/skills/frontend/references/design/cursor.md +309 -0
  521. package/dist/skills/frontend/references/design/design-system-architecture.md +217 -0
  522. package/dist/skills/frontend/references/design/elevenlabs.md +265 -0
  523. package/dist/skills/frontend/references/design/expo.md +281 -0
  524. package/dist/skills/frontend/references/design/ferrari.md +314 -0
  525. package/dist/skills/frontend/references/design/figma.md +220 -0
  526. package/dist/skills/frontend/references/design/framer.md +246 -0
  527. package/dist/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  528. package/dist/skills/frontend/references/design/hashicorp.md +278 -0
  529. package/dist/skills/frontend/references/design/ibm.md +332 -0
  530. package/dist/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  531. package/dist/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  532. package/dist/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  533. package/dist/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
  534. package/dist/skills/frontend/references/design/intercom.md +146 -0
  535. package/dist/skills/frontend/references/design/kraken.md +125 -0
  536. package/dist/skills/frontend/references/design/lamborghini.md +288 -0
  537. package/dist/skills/frontend/references/design/linear.app.md +367 -0
  538. package/dist/skills/frontend/references/design/lovable.md +298 -0
  539. package/dist/skills/frontend/references/design/mastercard.md +365 -0
  540. package/dist/skills/frontend/references/design/meta.md +366 -0
  541. package/dist/skills/frontend/references/design/minimalist-skill.md +85 -0
  542. package/dist/skills/frontend/references/design/minimax.md +257 -0
  543. package/dist/skills/frontend/references/design/mintlify.md +326 -0
  544. package/dist/skills/frontend/references/design/miro.md +108 -0
  545. package/dist/skills/frontend/references/design/mistral.ai.md +261 -0
  546. package/dist/skills/frontend/references/design/mongodb.md +266 -0
  547. package/dist/skills/frontend/references/design/nike.md +363 -0
  548. package/dist/skills/frontend/references/design/notion.md +309 -0
  549. package/dist/skills/frontend/references/design/nvidia.md +293 -0
  550. package/dist/skills/frontend/references/design/ollama.md +267 -0
  551. package/dist/skills/frontend/references/design/opencode.ai.md +281 -0
  552. package/dist/skills/frontend/references/design/output-skill.md +49 -0
  553. package/dist/skills/frontend/references/design/pinterest.md +230 -0
  554. package/dist/skills/frontend/references/design/playstation.md +364 -0
  555. package/dist/skills/frontend/references/design/posthog.md +256 -0
  556. package/dist/skills/frontend/references/design/raycast.md +268 -0
  557. package/dist/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
  558. package/dist/skills/frontend/references/design/redesign-skill.md +178 -0
  559. package/dist/skills/frontend/references/design/renault.md +311 -0
  560. package/dist/skills/frontend/references/design/replicate.md +261 -0
  561. package/dist/skills/frontend/references/design/resend.md +303 -0
  562. package/dist/skills/frontend/references/design/revolut.md +185 -0
  563. package/dist/skills/frontend/references/design/runwayml.md +244 -0
  564. package/dist/skills/frontend/references/design/sanity.md +357 -0
  565. package/dist/skills/frontend/references/design/sentry.md +262 -0
  566. package/dist/skills/frontend/references/design/shopify.md +350 -0
  567. package/dist/skills/frontend/references/design/soft-skill.md +98 -0
  568. package/dist/skills/frontend/references/design/spacex.md +194 -0
  569. package/dist/skills/frontend/references/design/spotify.md +246 -0
  570. package/dist/skills/frontend/references/design/starbucks.md +580 -0
  571. package/dist/skills/frontend/references/design/stitch-skill.md +184 -0
  572. package/dist/skills/frontend/references/design/stripe.md +322 -0
  573. package/dist/skills/frontend/references/design/supabase.md +255 -0
  574. package/dist/skills/frontend/references/design/superhuman.md +252 -0
  575. package/dist/skills/frontend/references/design/taste-skill.md +226 -0
  576. package/dist/skills/frontend/references/design/tesla.md +286 -0
  577. package/dist/skills/frontend/references/design/theverge.md +339 -0
  578. package/dist/skills/frontend/references/design/together.ai.md +263 -0
  579. package/dist/skills/frontend/references/design/uber.md +295 -0
  580. package/dist/skills/frontend/references/design/vercel.md +310 -0
  581. package/dist/skills/frontend/references/design/vodafone.md +423 -0
  582. package/dist/skills/frontend/references/design/voltagent.md +323 -0
  583. package/dist/skills/frontend/references/design/warp.md +253 -0
  584. package/dist/skills/frontend/references/design/webflow.md +92 -0
  585. package/dist/skills/frontend/references/design/wired.md +278 -0
  586. package/dist/skills/frontend/references/design/wise.md +173 -0
  587. package/dist/skills/frontend/references/design/x.ai.md +257 -0
  588. package/dist/skills/frontend/references/design/zapier.md +328 -0
  589. package/dist/skills/frontend/references/perfection/README.md +160 -0
  590. package/dist/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
  591. package/dist/skills/frontend/references/ui-ux-db/README.md +273 -0
  592. package/dist/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  593. package/dist/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
  594. package/dist/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
  595. package/dist/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
  596. package/dist/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
  597. package/dist/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  598. package/dist/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  599. package/dist/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  600. package/dist/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  601. package/dist/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  602. package/dist/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  603. package/dist/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  604. package/dist/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  605. package/dist/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  606. package/dist/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  607. package/dist/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  608. package/dist/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  609. package/dist/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  610. package/dist/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  611. package/dist/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
  612. package/dist/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
  613. package/dist/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
  614. package/dist/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  615. package/dist/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  616. package/dist/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
  617. package/dist/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
  618. package/dist/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  619. package/dist/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  620. package/dist/skills/git-master/SKILL.md +100 -0
  621. package/dist/skills/git-master/agents/openai.yaml +13 -0
  622. package/dist/skills/init-deep/SKILL.md +309 -0
  623. package/dist/skills/lcx-contribute-bug-fix/SKILL.md +242 -0
  624. package/dist/skills/lcx-contribute-bug-fix/agents/openai.yaml +12 -0
  625. package/dist/skills/lcx-contribute-bug-fix/scripts/create-pr-body.mjs +107 -0
  626. package/dist/skills/lcx-doctor/SKILL.md +93 -0
  627. package/dist/skills/lcx-doctor/agents/openai.yaml +11 -0
  628. package/dist/skills/lcx-report-bug/SKILL.md +237 -0
  629. package/dist/skills/lcx-report-bug/agents/openai.yaml +11 -0
  630. package/dist/skills/lsp-setup/SKILL.md +139 -0
  631. package/dist/skills/lsp-setup/references/bash/README.md +60 -0
  632. package/dist/skills/lsp-setup/references/c-cpp/README.md +61 -0
  633. package/dist/skills/lsp-setup/references/csharp/README.md +71 -0
  634. package/dist/skills/lsp-setup/references/dart/README.md +48 -0
  635. package/dist/skills/lsp-setup/references/elixir/README.md +51 -0
  636. package/dist/skills/lsp-setup/references/go/README.md +57 -0
  637. package/dist/skills/lsp-setup/references/haskell/README.md +57 -0
  638. package/dist/skills/lsp-setup/references/java/README.md +57 -0
  639. package/dist/skills/lsp-setup/references/julia/README.md +60 -0
  640. package/dist/skills/lsp-setup/references/kotlin/README.md +59 -0
  641. package/dist/skills/lsp-setup/references/lua/README.md +66 -0
  642. package/dist/skills/lsp-setup/references/php/README.md +62 -0
  643. package/dist/skills/lsp-setup/references/python/README.md +71 -0
  644. package/dist/skills/lsp-setup/references/ruby/README.md +53 -0
  645. package/dist/skills/lsp-setup/references/rust/README.md +59 -0
  646. package/dist/skills/lsp-setup/references/swift/README.md +51 -0
  647. package/dist/skills/lsp-setup/references/terraform/README.md +62 -0
  648. package/dist/skills/lsp-setup/references/typescript/README.md +77 -0
  649. package/dist/skills/lsp-setup/references/yaml/README.md +70 -0
  650. package/dist/skills/lsp-setup/references/zig/README.md +49 -0
  651. package/dist/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
  652. package/dist/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
  653. package/dist/skills/lsp-setup/scripts/tsconfig.json +17 -0
  654. package/dist/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
  655. package/dist/skills/programming/SKILL.md +463 -0
  656. package/dist/skills/programming/references/go/README.md +90 -0
  657. package/dist/skills/programming/references/go/backend-stack.md +641 -0
  658. package/dist/skills/programming/references/go/bootstrap.md +328 -0
  659. package/dist/skills/programming/references/go/bubbletea-v2.md +360 -0
  660. package/dist/skills/programming/references/go/cobra-stack.md +468 -0
  661. package/dist/skills/programming/references/go/concurrency.md +362 -0
  662. package/dist/skills/programming/references/go/data-modeling.md +329 -0
  663. package/dist/skills/programming/references/go/error-handling.md +359 -0
  664. package/dist/skills/programming/references/go/golangci-strict.md +236 -0
  665. package/dist/skills/programming/references/go/grpc-connect.md +375 -0
  666. package/dist/skills/programming/references/go/libraries.md +337 -0
  667. package/dist/skills/programming/references/go/one-liners.md +202 -0
  668. package/dist/skills/programming/references/go/sqlc-pgx.md +471 -0
  669. package/dist/skills/programming/references/go/testing.md +467 -0
  670. package/dist/skills/programming/references/go/type-patterns.md +298 -0
  671. package/dist/skills/programming/references/python/README.md +314 -0
  672. package/dist/skills/programming/references/python/async-anyio.md +442 -0
  673. package/dist/skills/programming/references/python/data-modeling.md +233 -0
  674. package/dist/skills/programming/references/python/data-processing.md +133 -0
  675. package/dist/skills/programming/references/python/error-handling.md +218 -0
  676. package/dist/skills/programming/references/python/fastapi-stack.md +316 -0
  677. package/dist/skills/programming/references/python/httpx2-optimization.md +360 -0
  678. package/dist/skills/programming/references/python/libraries.md +307 -0
  679. package/dist/skills/programming/references/python/one-liners.md +268 -0
  680. package/dist/skills/programming/references/python/orjson-stack.md +378 -0
  681. package/dist/skills/programming/references/python/pydantic-ai.md +285 -0
  682. package/dist/skills/programming/references/python/pyproject-strict.md +232 -0
  683. package/dist/skills/programming/references/python/textual-tui.md +201 -0
  684. package/dist/skills/programming/references/python/type-patterns.md +176 -0
  685. package/dist/skills/programming/references/rust/README.md +317 -0
  686. package/dist/skills/programming/references/rust/async-tokio.md +299 -0
  687. package/dist/skills/programming/references/rust/axum-stack.md +467 -0
  688. package/dist/skills/programming/references/rust/cargo-strict.md +317 -0
  689. package/dist/skills/programming/references/rust/clap-stack.md +409 -0
  690. package/dist/skills/programming/references/rust/concurrency.md +375 -0
  691. package/dist/skills/programming/references/rust/libraries.md +439 -0
  692. package/dist/skills/programming/references/rust/one-liners.md +291 -0
  693. package/dist/skills/programming/references/rust/proptest-insta.md +429 -0
  694. package/dist/skills/programming/references/rust/type-state.md +354 -0
  695. package/dist/skills/programming/references/rust/unsafe-discipline.md +250 -0
  696. package/dist/skills/programming/references/rust/zero-cost-safety.md +527 -0
  697. package/dist/skills/programming/references/rust-ub/README.md +289 -0
  698. package/dist/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
  699. package/dist/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
  700. package/dist/skills/programming/references/typescript/README.md +195 -0
  701. package/dist/skills/programming/references/typescript/backend-hono.md +672 -0
  702. package/dist/skills/programming/references/typescript/bootstrap.md +199 -0
  703. package/dist/skills/programming/references/typescript/data-modeling.md +202 -0
  704. package/dist/skills/programming/references/typescript/error-handling.md +169 -0
  705. package/dist/skills/programming/references/typescript/tsconfig-strict.md +152 -0
  706. package/dist/skills/programming/references/typescript/type-patterns.md +196 -0
  707. package/dist/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
  708. package/dist/skills/programming/scripts/go/new-project.py +138 -0
  709. package/dist/skills/programming/scripts/go/templates/.editorconfig +13 -0
  710. package/dist/skills/programming/scripts/go/templates/.golangci.yml +95 -0
  711. package/dist/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
  712. package/dist/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
  713. package/dist/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
  714. package/dist/skills/programming/scripts/go/templates/ci.yml +37 -0
  715. package/dist/skills/programming/scripts/go/templates/config.go +24 -0
  716. package/dist/skills/programming/scripts/go/templates/gitignore +15 -0
  717. package/dist/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
  718. package/dist/skills/programming/scripts/go/templates/run.go +15 -0
  719. package/dist/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
  720. package/dist/skills/programming/scripts/python/new-project.py +172 -0
  721. package/dist/skills/programming/scripts/python/new-script.py +116 -0
  722. package/dist/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
  723. package/dist/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
  724. package/dist/skills/programming/scripts/rust/new-project.py +175 -0
  725. package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
  726. package/dist/skills/programming/scripts/typescript/new-project.ts +177 -0
  727. package/dist/skills/refactor/SKILL.md +754 -0
  728. package/dist/skills/remove-ai-slops/SKILL.md +317 -0
  729. package/dist/skills/review-work/SKILL.md +594 -0
  730. package/dist/skills/start-work/SKILL.md +178 -0
  731. package/dist/skills/ultraresearch/SKILL.md +230 -0
  732. package/dist/skills/ulw-plan/SKILL.md +69 -0
  733. package/dist/skills/ulw-plan/agents/openai.yaml +7 -0
  734. package/dist/skills/ulw-plan/references/full-workflow.md +99 -0
  735. package/dist/skills/ulw-plan/references/intent-clear.md +44 -0
  736. package/dist/skills/ulw-plan/references/intent-unclear.md +44 -0
  737. package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  738. package/dist/skills/visual-qa/SKILL.md +235 -0
  739. package/dist/skills/visual-qa/references/agent-browser-setup.md +44 -0
  740. package/dist/skills/visual-qa/scripts/ansi.test.ts +45 -0
  741. package/dist/skills/visual-qa/scripts/ansi.ts +17 -0
  742. package/dist/skills/visual-qa/scripts/cli.test.ts +73 -0
  743. package/dist/skills/visual-qa/scripts/cli.ts +82 -0
  744. package/dist/skills/visual-qa/scripts/east-asian-width.test.ts +60 -0
  745. package/dist/skills/visual-qa/scripts/east-asian-width.ts +72 -0
  746. package/dist/skills/visual-qa/scripts/image-diff.test.ts +70 -0
  747. package/dist/skills/visual-qa/scripts/image-diff.ts +109 -0
  748. package/dist/skills/visual-qa/scripts/png-crc.ts +27 -0
  749. package/dist/skills/visual-qa/scripts/png-decode.test.ts +44 -0
  750. package/dist/skills/visual-qa/scripts/png-decode.ts +206 -0
  751. package/dist/skills/visual-qa/scripts/png-synth.ts +57 -0
  752. package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +127 -0
  753. package/dist/skills/visual-qa/scripts/tui-grid.test.ts +57 -0
  754. package/dist/skills/visual-qa/scripts/tui-grid.ts +88 -0
  755. package/dist/skills/visual-qa/scripts/types.ts +54 -0
  756. package/dist/tools/delegate-task/background-task-description.d.ts +2 -0
  757. package/dist/tools/delegate-task/constants.d.ts +13 -1
  758. package/dist/tools/delegate-task/model-selection.d.ts +3 -17
  759. package/dist/tools/delegate-task/model-string-parser.d.ts +1 -9
  760. package/dist/tools/delegate-task/sync-result-fetcher.d.ts +1 -0
  761. package/dist/tools/delegate-task/sync-session-poller.d.ts +1 -0
  762. package/dist/tools/delegate-task/types.d.ts +59 -2
  763. package/dist/tools/index.d.ts +1 -0
  764. package/dist/tools/monitor/create-monitor-tools.d.ts +4 -0
  765. package/dist/tools/monitor/index.d.ts +1 -0
  766. package/dist/tools/monitor/monitor-list.d.ts +7 -0
  767. package/dist/tools/monitor/monitor-output.d.ts +3 -0
  768. package/dist/tools/monitor/monitor-start.d.ts +9 -0
  769. package/dist/tools/monitor/monitor-stop.d.ts +16 -0
  770. package/dist/tools/skill/native-skills.d.ts +2 -2
  771. package/dist/tools/skill/scope-priority.d.ts +1 -4
  772. package/dist/tools/skill/skill-matcher.d.ts +1 -5
  773. package/dist/tools/task/types.d.ts +10 -10
  774. package/dist/tui.d.ts +4 -0
  775. package/dist/tui.js +69330 -0
  776. package/package.json +57 -36
  777. package/packages/git-bash-mcp/dist/cli.js +225 -55
  778. package/packages/lsp-core/package.json +41 -0
  779. package/packages/lsp-core/src/index.ts +28 -0
  780. package/packages/lsp-core/src/lsp/cleanup-errors.ts +5 -0
  781. package/packages/lsp-core/src/lsp/client-wrapper.ts +173 -0
  782. package/packages/lsp-core/src/lsp/client.ts +172 -0
  783. package/packages/lsp-core/src/lsp/config-loader.ts +266 -0
  784. package/packages/lsp-core/src/lsp/connection.ts +73 -0
  785. package/packages/lsp-core/src/lsp/constants.ts +11 -0
  786. package/packages/lsp-core/src/lsp/directory-diagnostics.ts +154 -0
  787. package/packages/lsp-core/src/lsp/effective-extension.ts +10 -0
  788. package/packages/lsp-core/src/lsp/errors.ts +63 -0
  789. package/packages/lsp-core/src/lsp/formatters.ts +141 -0
  790. package/packages/lsp-core/src/lsp/infer-extension.ts +66 -0
  791. package/packages/lsp-core/src/lsp/json-rpc-connection.ts +296 -0
  792. package/packages/lsp-core/src/lsp/language-mappings.ts +173 -0
  793. package/packages/lsp-core/src/lsp/manager.ts +369 -0
  794. package/packages/lsp-core/src/lsp/process-signal-cleanup.ts +21 -0
  795. package/packages/lsp-core/src/lsp/process.ts +202 -0
  796. package/packages/lsp-core/src/lsp/server-definitions.ts +176 -0
  797. package/packages/lsp-core/src/lsp/server-install-state.ts +70 -0
  798. package/packages/lsp-core/src/lsp/server-installation.ts +45 -0
  799. package/packages/lsp-core/src/lsp/server-resolution.ts +104 -0
  800. package/packages/lsp-core/src/lsp/startup-failure.ts +1 -0
  801. package/packages/lsp-core/src/lsp/transport.ts +299 -0
  802. package/packages/lsp-core/src/lsp/types.ts +126 -0
  803. package/packages/lsp-core/src/lsp/utils.test.ts +72 -0
  804. package/packages/lsp-core/src/lsp/utils.ts +40 -0
  805. package/packages/lsp-core/src/lsp/workspace-edit.ts +206 -0
  806. package/packages/lsp-core/src/mcp-protocol-pin.test.ts +68 -0
  807. package/packages/lsp-core/src/mcp.ts +95 -0
  808. package/packages/lsp-core/src/missing-dependency-result.ts +19 -0
  809. package/packages/lsp-core/src/request-context.ts +22 -0
  810. package/packages/lsp-core/src/tool-surface.test.ts +157 -0
  811. package/packages/lsp-core/src/tools/definitions.ts +141 -0
  812. package/packages/lsp-core/src/tools/diagnostics.ts +97 -0
  813. package/packages/lsp-core/src/tools/index.ts +10 -0
  814. package/packages/lsp-core/src/tools/install-decision.ts +39 -0
  815. package/packages/lsp-core/src/tools/navigation.ts +86 -0
  816. package/packages/lsp-core/src/tools/parameters.ts +49 -0
  817. package/packages/lsp-core/src/tools/rename.ts +72 -0
  818. package/packages/lsp-core/src/tools/result.ts +5 -0
  819. package/packages/lsp-core/src/tools/runtime.ts +21 -0
  820. package/packages/lsp-core/src/tools/schema.ts +9 -0
  821. package/packages/lsp-core/src/tools/status.ts +28 -0
  822. package/packages/lsp-core/src/tools/symbols.ts +99 -0
  823. package/packages/lsp-core/src/tools/types.ts +104 -0
  824. package/packages/lsp-core/src/tools.ts +1 -0
  825. package/packages/lsp-daemon/dist/cli.js +712 -527
  826. package/packages/lsp-daemon/dist/daemon-client.d.ts +1 -1
  827. package/packages/lsp-daemon/dist/daemon-server.js +1 -1
  828. package/packages/lsp-daemon/dist/index.d.ts +1 -1
  829. package/packages/lsp-daemon/dist/index.js +687 -500
  830. package/packages/lsp-daemon/dist/proxy.d.ts +3 -2
  831. package/packages/lsp-daemon/dist/proxy.js +16 -40
  832. package/packages/lsp-daemon/dist/request-routing.d.ts +2 -2
  833. package/packages/lsp-daemon/dist/request-routing.js +2 -2
  834. package/packages/lsp-daemon/package.json +2 -1
  835. package/packages/lsp-tools-mcp/dist/cli.js +3348 -15
  836. package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts +1 -1
  837. package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.d.ts +1 -13
  838. package/packages/lsp-tools-mcp/dist/lsp/client.d.ts +1 -20
  839. package/packages/lsp-tools-mcp/dist/lsp/config-loader.d.ts +1 -16
  840. package/packages/lsp-tools-mcp/dist/lsp/connection.d.ts +1 -4
  841. package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts +1 -10
  842. package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.d.ts +1 -3
  843. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -1
  844. package/packages/lsp-tools-mcp/dist/lsp/errors.d.ts +1 -35
  845. package/packages/lsp-tools-mcp/dist/lsp/formatters.d.ts +1 -12
  846. package/packages/lsp-tools-mcp/dist/lsp/infer-extension.d.ts +1 -1
  847. package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.d.ts +1 -36
  848. package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts +1 -4
  849. package/packages/lsp-tools-mcp/dist/lsp/manager.d.ts +1 -46
  850. package/packages/lsp-tools-mcp/dist/lsp/manager.js +1390 -265
  851. package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.d.ts +1 -1
  852. package/packages/lsp-tools-mcp/dist/lsp/process.d.ts +1 -25
  853. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.d.ts +1 -4
  854. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +1 -12
  855. package/packages/lsp-tools-mcp/dist/lsp/server-installation.d.ts +1 -1
  856. package/packages/lsp-tools-mcp/dist/lsp/server-resolution.d.ts +1 -11
  857. package/packages/lsp-tools-mcp/dist/lsp/startup-failure.d.ts +1 -3
  858. package/packages/lsp-tools-mcp/dist/lsp/transport.d.ts +1 -35
  859. package/packages/lsp-tools-mcp/dist/lsp/types.d.ts +1 -124
  860. package/packages/lsp-tools-mcp/dist/lsp/utils.d.ts +1 -0
  861. package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.d.ts +1 -11
  862. package/packages/lsp-tools-mcp/dist/mcp.d.ts +1 -30
  863. package/packages/lsp-tools-mcp/dist/mcp.js +3312 -70
  864. package/packages/lsp-tools-mcp/dist/missing-dependency-result.d.ts +1 -2
  865. package/packages/lsp-tools-mcp/dist/request-context.d.ts +1 -7
  866. package/packages/lsp-tools-mcp/dist/request-context.js +16 -10
  867. package/packages/lsp-tools-mcp/dist/tools.d.ts +1 -90
  868. package/packages/lsp-tools-mcp/dist/tools.js +3028 -439
  869. package/packages/lsp-tools-mcp/package.json +3 -1
  870. package/packages/omo-codex/THIRD-PARTY-NOTICES.md +155 -0
  871. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  872. package/packages/omo-codex/plugin/.mcp.json +6 -5
  873. package/packages/omo-codex/plugin/README.md +1 -1
  874. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +1637 -1245
  875. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  876. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  877. package/packages/omo-codex/plugin/components/bootstrap/scripts/generate-manifests.mjs +8 -52
  878. package/packages/omo-codex/plugin/components/bootstrap/src/provision.ts +35 -143
  879. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +11 -11
  880. package/packages/omo-codex/plugin/components/bootstrap/test/environment.test.ts +3 -2
  881. package/packages/omo-codex/plugin/components/bootstrap/test/provision.test.ts +37 -37
  882. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +2205 -0
  883. package/packages/omo-codex/plugin/components/codegraph/dist/serve.d.ts +32 -0
  884. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +1603 -0
  885. package/packages/omo-codex/plugin/components/codegraph/package.json +27 -0
  886. package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +55 -0
  887. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +83 -0
  888. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +108 -0
  889. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +191 -0
  890. package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +213 -0
  891. package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +563 -0
  892. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +401 -0
  893. package/packages/omo-codex/plugin/components/codegraph/tsconfig.build.json +13 -0
  894. package/packages/omo-codex/plugin/components/codegraph/tsconfig.json +25 -0
  895. package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +610 -7
  896. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  897. package/packages/omo-codex/plugin/components/comment-checker/package.json +4 -3
  898. package/packages/omo-codex/plugin/components/comment-checker/src/apply-patch.ts +28 -156
  899. package/packages/omo-codex/plugin/components/comment-checker/src/core-values.ts +1 -1
  900. package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +2 -2
  901. package/packages/omo-codex/plugin/components/comment-checker/src/request-extractor.ts +1 -1
  902. package/packages/omo-codex/plugin/components/comment-checker/src/runner.ts +6 -2
  903. package/packages/omo-codex/plugin/components/comment-checker/test/core.test.ts +38 -35
  904. package/packages/omo-codex/plugin/components/comment-checker/test/fixtures/apply-patch-mixed-requests.ts +60 -0
  905. package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +155 -26
  906. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  907. package/packages/omo-codex/plugin/components/git-bash/package.json +2 -1
  908. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +48 -0
  909. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/directive.md +11 -0
  910. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +223 -0
  911. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.d.ts +2 -0
  912. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +123 -0
  913. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/directive.d.ts +2 -0
  914. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/directive.js +5 -0
  915. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/index.d.ts +4 -0
  916. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/index.js +3 -0
  917. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/state.d.ts +9 -0
  918. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/state.js +45 -0
  919. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.d.ts +39 -0
  920. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.js +1 -0
  921. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +17 -0
  922. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +44 -0
  923. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/cli.ts +56 -0
  924. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +129 -0
  925. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/directive.ts +13 -0
  926. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/index.ts +4 -0
  927. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/state.ts +62 -0
  928. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/types.ts +38 -0
  929. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/cli.test.ts +124 -0
  930. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +346 -0
  931. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/tsconfig.build.json +12 -0
  932. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/tsconfig.json +27 -0
  933. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/vitest.config.ts +10 -0
  934. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +3738 -28
  935. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  936. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  937. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +1 -1
  938. package/packages/omo-codex/plugin/components/rules/dist/cli.js +4565 -89
  939. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  940. package/packages/omo-codex/plugin/components/rules/package.json +4 -3
  941. package/packages/omo-codex/plugin/components/rules/src/cli.ts +16 -3
  942. package/packages/omo-codex/plugin/components/rules/src/config.ts +3 -3
  943. package/packages/omo-codex/plugin/components/rules/src/dynamic-target-fingerprints.ts +6 -6
  944. package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +1 -1
  945. package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +1 -1
  946. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +1 -1
  947. package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +9 -4
  948. package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +3 -3
  949. package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +1 -1
  950. package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +4 -4
  951. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +1 -1
  952. package/packages/omo-codex/plugin/components/rules/test/dynamic-target-fingerprints.test.ts +1 -1
  953. package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +3 -3
  954. package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +2 -2
  955. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +2 -2
  956. package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +2 -2
  957. package/packages/omo-codex/plugin/components/rules/test/parser.test.ts +1 -1
  958. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +1 -1
  959. package/packages/omo-codex/plugin/components/rules/test/rules-engine-consumption.test.ts +92 -0
  960. package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +1 -1
  961. package/packages/omo-codex/plugin/components/rules/test/sources.test.ts +4 -4
  962. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -1
  963. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +394 -37
  964. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  965. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +4 -3
  966. package/packages/omo-codex/plugin/components/start-work-continuation/src/boulder-reader.ts +20 -147
  967. package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +1 -1
  968. package/packages/omo-codex/plugin/components/start-work-continuation/src/index.ts +1 -1
  969. package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +151 -27
  970. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +87 -49
  971. package/packages/omo-codex/plugin/components/telemetry/LICENSE +21 -0
  972. package/packages/omo-codex/plugin/components/telemetry/NOTICE +6 -0
  973. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +5869 -42
  974. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +5783 -108
  975. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  976. package/packages/omo-codex/plugin/components/telemetry/package.json +4 -5
  977. package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +3 -3
  978. package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +92 -142
  979. package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +59 -3
  980. package/packages/omo-codex/plugin/components/telemetry/test/codex-hook-diagnostics.test.ts +3 -3
  981. package/packages/omo-codex/plugin/components/telemetry/test/diagnostics.test.ts +13 -7
  982. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +2 -2
  983. package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
  984. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
  985. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +31 -0
  986. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +29 -0
  987. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-executor.toml +24 -0
  988. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +23 -0
  989. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +22 -0
  990. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +1 -1
  991. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  992. package/packages/omo-codex/plugin/components/ultrawork/directive.md +104 -156
  993. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +162 -37
  994. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  995. package/packages/omo-codex/plugin/components/ultrawork/package.json +4 -3
  996. package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +11 -0
  997. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +47 -20
  998. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +55 -88
  999. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +44 -0
  1000. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +44 -0
  1001. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  1002. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +2 -2
  1003. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-test-helpers.ts +101 -0
  1004. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +111 -0
  1005. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +24 -128
  1006. package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +16 -0
  1007. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +4 -2
  1008. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +5 -0
  1009. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +79 -0
  1010. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +1 -1
  1011. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +56 -82
  1012. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +38 -144
  1013. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +10 -0
  1014. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +173 -0
  1015. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +2419 -32
  1016. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +13 -9
  1017. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +60 -12
  1018. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +3 -0
  1019. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +67 -10
  1020. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +3 -0
  1021. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +14 -0
  1022. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +2 -6
  1023. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +49 -39
  1024. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.d.ts +8 -0
  1025. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.js +109 -0
  1026. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-blockers.d.ts +5 -0
  1027. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-blockers.js +41 -0
  1028. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.d.ts +8 -0
  1029. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +39 -0
  1030. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +13 -6
  1031. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +176 -105
  1032. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  1033. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  1034. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +17 -17
  1035. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +100 -0
  1036. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +162 -85
  1037. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +62 -136
  1038. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +250 -0
  1039. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +18 -9
  1040. package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +67 -4
  1041. package/packages/omo-codex/plugin/components/ulw-loop/src/evidence.ts +124 -18
  1042. package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +16 -0
  1043. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +131 -54
  1044. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-goal-factory.ts +124 -0
  1045. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-blockers.ts +48 -0
  1046. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +44 -0
  1047. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +230 -138
  1048. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +186 -0
  1049. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-status.test.ts +85 -0
  1050. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint.test.ts +120 -192
  1051. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint.test.ts +215 -0
  1052. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +1 -195
  1053. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-complete-goals.test.ts +15 -0
  1054. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +172 -0
  1055. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-helpers.test.ts +0 -6
  1056. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +39 -8
  1057. package/packages/omo-codex/plugin/components/ulw-loop/test/evidence-criteria-gate.test.ts +29 -1
  1058. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/browser-screenshot.txt +1 -0
  1059. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/cli-pass.txt +1 -0
  1060. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/code-review.md +1 -0
  1061. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/data-diff.txt +5 -0
  1062. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/gate-review.md +1 -0
  1063. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/http-dump.txt +4 -0
  1064. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/rejection.txt +1 -0
  1065. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/checkpoint-builders.ts +98 -0
  1066. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +91 -0
  1067. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/sample-quality-gate.json +110 -8
  1068. package/packages/omo-codex/plugin/components/ulw-loop/test/goal-status.test.ts +35 -0
  1069. package/packages/omo-codex/plugin/components/ulw-loop/test/plan-crud.test.ts +11 -1
  1070. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-blockers.test.ts +102 -0
  1071. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-doc.test.ts +38 -0
  1072. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +131 -0
  1073. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +150 -176
  1074. package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +12 -0
  1075. package/packages/omo-codex/plugin/hooks/hooks.json +38 -17
  1076. package/packages/omo-codex/plugin/package-lock.json +144 -49
  1077. package/packages/omo-codex/plugin/package.json +4 -2
  1078. package/packages/omo-codex/plugin/scripts/auto-update.mjs +2 -0
  1079. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +0 -5
  1080. package/packages/omo-codex/plugin/scripts/build-components.mjs +29 -5
  1081. package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +2 -0
  1082. package/packages/omo-codex/plugin/scripts/migrate-omo-sot/editor.mjs +125 -0
  1083. package/packages/omo-codex/plugin/scripts/migrate-omo-sot/jsonc.mjs +43 -0
  1084. package/packages/omo-codex/plugin/scripts/migrate-omo-sot/scaffold.mjs +29 -0
  1085. package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +121 -0
  1086. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +5 -5
  1087. package/packages/omo-codex/plugin/shared/package.json +24 -0
  1088. package/packages/omo-codex/plugin/shared/src/config-loader.ts +28 -0
  1089. package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +105 -0
  1090. package/packages/omo-codex/plugin/shared/tsconfig.build.json +9 -0
  1091. package/packages/omo-codex/plugin/shared/tsconfig.json +16 -0
  1092. package/packages/omo-codex/plugin/skills/ast-grep/LICENSE +21 -0
  1093. package/packages/omo-codex/plugin/skills/ast-grep/README.md +136 -0
  1094. package/packages/omo-codex/plugin/skills/ast-grep/SKILL.md +272 -0
  1095. package/packages/omo-codex/plugin/skills/ast-grep/SOURCE +1 -0
  1096. package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +235 -0
  1097. package/packages/omo-codex/plugin/skills/ast-grep/install.sh +286 -0
  1098. package/packages/omo-codex/plugin/skills/ast-grep/references/cli.md +231 -0
  1099. package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +166 -0
  1100. package/packages/omo-codex/plugin/skills/ast-grep/references/patterns.md +147 -0
  1101. package/packages/omo-codex/plugin/skills/ast-grep/references/pitfalls.md +303 -0
  1102. package/packages/omo-codex/plugin/skills/ast-grep/references/recipes.md +402 -0
  1103. package/packages/omo-codex/plugin/skills/ast-grep/references/sgconfig.md +248 -0
  1104. package/packages/omo-codex/plugin/skills/ast-grep/references/yaml-rules.md +509 -0
  1105. package/packages/omo-codex/plugin/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
  1106. package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.ps1 +123 -0
  1107. package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.sh +212 -0
  1108. package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +127 -0
  1109. package/packages/omo-codex/plugin/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  1110. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +113 -0
  1111. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +240 -0
  1112. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +189 -0
  1113. package/packages/omo-codex/plugin/skills/frontend/references/design/airbnb.md +390 -0
  1114. package/packages/omo-codex/plugin/skills/frontend/references/design/airtable.md +89 -0
  1115. package/packages/omo-codex/plugin/skills/frontend/references/design/apple.md +247 -0
  1116. package/packages/omo-codex/plugin/skills/frontend/references/design/binance.md +345 -0
  1117. package/packages/omo-codex/plugin/skills/frontend/references/design/bmw.md +180 -0
  1118. package/packages/omo-codex/plugin/skills/frontend/references/design/brutalist-skill.md +92 -0
  1119. package/packages/omo-codex/plugin/skills/frontend/references/design/bugatti.md +268 -0
  1120. package/packages/omo-codex/plugin/skills/frontend/references/design/cal.md +259 -0
  1121. package/packages/omo-codex/plugin/skills/frontend/references/design/claude.md +312 -0
  1122. package/packages/omo-codex/plugin/skills/frontend/references/design/clay.md +304 -0
  1123. package/packages/omo-codex/plugin/skills/frontend/references/design/clickhouse.md +281 -0
  1124. package/packages/omo-codex/plugin/skills/frontend/references/design/cohere.md +266 -0
  1125. package/packages/omo-codex/plugin/skills/frontend/references/design/coinbase.md +129 -0
  1126. package/packages/omo-codex/plugin/skills/frontend/references/design/composio.md +307 -0
  1127. package/packages/omo-codex/plugin/skills/frontend/references/design/cursor.md +309 -0
  1128. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +217 -0
  1129. package/packages/omo-codex/plugin/skills/frontend/references/design/elevenlabs.md +265 -0
  1130. package/packages/omo-codex/plugin/skills/frontend/references/design/expo.md +281 -0
  1131. package/packages/omo-codex/plugin/skills/frontend/references/design/ferrari.md +314 -0
  1132. package/packages/omo-codex/plugin/skills/frontend/references/design/figma.md +220 -0
  1133. package/packages/omo-codex/plugin/skills/frontend/references/design/framer.md +246 -0
  1134. package/packages/omo-codex/plugin/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  1135. package/packages/omo-codex/plugin/skills/frontend/references/design/hashicorp.md +278 -0
  1136. package/packages/omo-codex/plugin/skills/frontend/references/design/ibm.md +332 -0
  1137. package/packages/omo-codex/plugin/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  1138. package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  1139. package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  1140. package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
  1141. package/packages/omo-codex/plugin/skills/frontend/references/design/intercom.md +146 -0
  1142. package/packages/omo-codex/plugin/skills/frontend/references/design/kraken.md +125 -0
  1143. package/packages/omo-codex/plugin/skills/frontend/references/design/lamborghini.md +288 -0
  1144. package/packages/omo-codex/plugin/skills/frontend/references/design/linear.app.md +367 -0
  1145. package/packages/omo-codex/plugin/skills/frontend/references/design/lovable.md +298 -0
  1146. package/packages/omo-codex/plugin/skills/frontend/references/design/mastercard.md +365 -0
  1147. package/packages/omo-codex/plugin/skills/frontend/references/design/meta.md +366 -0
  1148. package/packages/omo-codex/plugin/skills/frontend/references/design/minimalist-skill.md +85 -0
  1149. package/packages/omo-codex/plugin/skills/frontend/references/design/minimax.md +257 -0
  1150. package/packages/omo-codex/plugin/skills/frontend/references/design/mintlify.md +326 -0
  1151. package/packages/omo-codex/plugin/skills/frontend/references/design/miro.md +108 -0
  1152. package/packages/omo-codex/plugin/skills/frontend/references/design/mistral.ai.md +261 -0
  1153. package/packages/omo-codex/plugin/skills/frontend/references/design/mongodb.md +266 -0
  1154. package/packages/omo-codex/plugin/skills/frontend/references/design/nike.md +363 -0
  1155. package/packages/omo-codex/plugin/skills/frontend/references/design/notion.md +309 -0
  1156. package/packages/omo-codex/plugin/skills/frontend/references/design/nvidia.md +293 -0
  1157. package/packages/omo-codex/plugin/skills/frontend/references/design/ollama.md +267 -0
  1158. package/packages/omo-codex/plugin/skills/frontend/references/design/opencode.ai.md +281 -0
  1159. package/packages/omo-codex/plugin/skills/frontend/references/design/output-skill.md +49 -0
  1160. package/packages/omo-codex/plugin/skills/frontend/references/design/pinterest.md +230 -0
  1161. package/packages/omo-codex/plugin/skills/frontend/references/design/playstation.md +364 -0
  1162. package/packages/omo-codex/plugin/skills/frontend/references/design/posthog.md +256 -0
  1163. package/packages/omo-codex/plugin/skills/frontend/references/design/raycast.md +268 -0
  1164. package/packages/omo-codex/plugin/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
  1165. package/packages/omo-codex/plugin/skills/frontend/references/design/redesign-skill.md +178 -0
  1166. package/packages/omo-codex/plugin/skills/frontend/references/design/renault.md +311 -0
  1167. package/packages/omo-codex/plugin/skills/frontend/references/design/replicate.md +261 -0
  1168. package/packages/omo-codex/plugin/skills/frontend/references/design/resend.md +303 -0
  1169. package/packages/omo-codex/plugin/skills/frontend/references/design/revolut.md +185 -0
  1170. package/packages/omo-codex/plugin/skills/frontend/references/design/runwayml.md +244 -0
  1171. package/packages/omo-codex/plugin/skills/frontend/references/design/sanity.md +357 -0
  1172. package/packages/omo-codex/plugin/skills/frontend/references/design/sentry.md +262 -0
  1173. package/packages/omo-codex/plugin/skills/frontend/references/design/shopify.md +350 -0
  1174. package/packages/omo-codex/plugin/skills/frontend/references/design/soft-skill.md +98 -0
  1175. package/packages/omo-codex/plugin/skills/frontend/references/design/spacex.md +194 -0
  1176. package/packages/omo-codex/plugin/skills/frontend/references/design/spotify.md +246 -0
  1177. package/packages/omo-codex/plugin/skills/frontend/references/design/starbucks.md +580 -0
  1178. package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-skill.md +184 -0
  1179. package/packages/omo-codex/plugin/skills/frontend/references/design/stripe.md +322 -0
  1180. package/packages/omo-codex/plugin/skills/frontend/references/design/supabase.md +255 -0
  1181. package/packages/omo-codex/plugin/skills/frontend/references/design/superhuman.md +252 -0
  1182. package/packages/omo-codex/plugin/skills/frontend/references/design/taste-skill.md +226 -0
  1183. package/packages/omo-codex/plugin/skills/frontend/references/design/tesla.md +286 -0
  1184. package/packages/omo-codex/plugin/skills/frontend/references/design/theverge.md +339 -0
  1185. package/packages/omo-codex/plugin/skills/frontend/references/design/together.ai.md +263 -0
  1186. package/packages/omo-codex/plugin/skills/frontend/references/design/uber.md +295 -0
  1187. package/packages/omo-codex/plugin/skills/frontend/references/design/vercel.md +310 -0
  1188. package/packages/omo-codex/plugin/skills/frontend/references/design/vodafone.md +423 -0
  1189. package/packages/omo-codex/plugin/skills/frontend/references/design/voltagent.md +323 -0
  1190. package/packages/omo-codex/plugin/skills/frontend/references/design/warp.md +253 -0
  1191. package/packages/omo-codex/plugin/skills/frontend/references/design/webflow.md +92 -0
  1192. package/packages/omo-codex/plugin/skills/frontend/references/design/wired.md +278 -0
  1193. package/packages/omo-codex/plugin/skills/frontend/references/design/wise.md +173 -0
  1194. package/packages/omo-codex/plugin/skills/frontend/references/design/x.ai.md +257 -0
  1195. package/packages/omo-codex/plugin/skills/frontend/references/design/zapier.md +328 -0
  1196. package/packages/omo-codex/plugin/skills/frontend/references/perfection/README.md +160 -0
  1197. package/packages/omo-codex/plugin/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
  1198. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/README.md +273 -0
  1199. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  1200. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
  1201. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
  1202. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
  1203. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
  1204. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  1205. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  1206. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  1207. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  1208. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  1209. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  1210. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  1211. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  1212. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  1213. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  1214. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  1215. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  1216. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  1217. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  1218. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
  1219. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
  1220. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
  1221. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  1222. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  1223. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
  1224. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
  1225. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  1226. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  1227. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +3 -3
  1228. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +14 -23
  1229. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +2 -2
  1230. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +2 -2
  1231. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +3 -3
  1232. package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +2 -2
  1233. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +17 -17
  1234. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +47 -20
  1235. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +55 -88
  1236. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +44 -0
  1237. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +44 -0
  1238. package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  1239. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +19 -3
  1240. package/packages/omo-codex/plugin/skills/visual-qa/references/agent-browser-setup.md +44 -0
  1241. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +119 -11
  1242. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -4
  1243. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +29 -2
  1244. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +2 -0
  1245. package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +12 -12
  1246. package/packages/omo-codex/plugin/test/auto-update.test.mjs +26 -0
  1247. package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +287 -0
  1248. package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +199 -0
  1249. package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +38 -2
  1250. package/packages/omo-codex/plugin/test/index.js +13 -0
  1251. package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +4 -5
  1252. package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +5 -3
  1253. package/packages/omo-codex/plugin/test/migrate-omo-sot.test.mjs +179 -0
  1254. package/packages/omo-codex/plugin/test/payload-equivalence.test.mjs +109 -0
  1255. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +165 -0
  1256. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +6 -6
  1257. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -3
  1258. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +37 -1
  1259. package/packages/omo-codex/scripts/install-bin-links.test.mjs +3 -3
  1260. package/packages/omo-codex/scripts/install-cache-copy.test.mjs +1 -1
  1261. package/packages/omo-codex/scripts/install-cli-args.test.mjs +1 -1
  1262. package/packages/omo-codex/scripts/install-config-autonomous-features.test.mjs +1 -1
  1263. package/packages/omo-codex/scripts/install-config-autonomous.test.mjs +1 -1
  1264. package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +1 -1
  1265. package/packages/omo-codex/scripts/install-config-preservation.test.mjs +1 -1
  1266. package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +1 -2
  1267. package/packages/omo-codex/scripts/install-config.test.mjs +8 -6
  1268. package/packages/omo-codex/scripts/install-delegated-command.test.mjs +1 -1
  1269. package/packages/omo-codex/scripts/install-dist/install-local.mjs +13377 -0
  1270. package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +55 -0
  1271. package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +3 -4
  1272. package/packages/omo-codex/scripts/install-hook-targets.test.mjs +1 -1
  1273. package/packages/omo-codex/scripts/install-local.mjs +54 -237
  1274. package/packages/omo-codex/scripts/install-local.test.mjs +8 -1
  1275. package/packages/omo-codex/scripts/install-marketplace-cache.test.mjs +3 -3
  1276. package/packages/omo-codex/scripts/install-mcp-runtime.test.mjs +34 -77
  1277. package/packages/omo-codex/scripts/install-packaged-local.test.mjs +8 -4
  1278. package/packages/omo-codex/scripts/install-project-local-cleanup.test.mjs +1 -1
  1279. package/packages/shared-skills/package.json +6 -1
  1280. package/packages/shared-skills/skills/ast-grep/LICENSE +21 -0
  1281. package/packages/shared-skills/skills/ast-grep/README.md +136 -0
  1282. package/packages/shared-skills/skills/ast-grep/SKILL.md +272 -0
  1283. package/packages/shared-skills/skills/ast-grep/SOURCE +1 -0
  1284. package/packages/shared-skills/skills/ast-grep/install.ps1 +235 -0
  1285. package/packages/shared-skills/skills/ast-grep/install.sh +286 -0
  1286. package/packages/shared-skills/skills/ast-grep/references/cli.md +231 -0
  1287. package/packages/shared-skills/skills/ast-grep/references/install.md +166 -0
  1288. package/packages/shared-skills/skills/ast-grep/references/patterns.md +147 -0
  1289. package/packages/shared-skills/skills/ast-grep/references/pitfalls.md +303 -0
  1290. package/packages/shared-skills/skills/ast-grep/references/recipes.md +402 -0
  1291. package/packages/shared-skills/skills/ast-grep/references/sgconfig.md +248 -0
  1292. package/packages/shared-skills/skills/ast-grep/references/yaml-rules.md +509 -0
  1293. package/packages/shared-skills/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
  1294. package/packages/shared-skills/skills/ast-grep/tests/smoke.ps1 +123 -0
  1295. package/packages/shared-skills/skills/ast-grep/tests/smoke.sh +212 -0
  1296. package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +127 -0
  1297. package/packages/shared-skills/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  1298. package/packages/shared-skills/skills/frontend/SKILL.md +113 -0
  1299. package/packages/shared-skills/skills/frontend/references/design/README.md +240 -0
  1300. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +189 -0
  1301. package/packages/shared-skills/skills/frontend/references/design/airbnb.md +390 -0
  1302. package/packages/shared-skills/skills/frontend/references/design/airtable.md +89 -0
  1303. package/packages/shared-skills/skills/frontend/references/design/apple.md +247 -0
  1304. package/packages/shared-skills/skills/frontend/references/design/binance.md +345 -0
  1305. package/packages/shared-skills/skills/frontend/references/design/bmw.md +180 -0
  1306. package/packages/shared-skills/skills/frontend/references/design/brutalist-skill.md +92 -0
  1307. package/packages/shared-skills/skills/frontend/references/design/bugatti.md +268 -0
  1308. package/packages/shared-skills/skills/frontend/references/design/cal.md +259 -0
  1309. package/packages/shared-skills/skills/frontend/references/design/claude.md +312 -0
  1310. package/packages/shared-skills/skills/frontend/references/design/clay.md +304 -0
  1311. package/packages/shared-skills/skills/frontend/references/design/clickhouse.md +281 -0
  1312. package/packages/shared-skills/skills/frontend/references/design/cohere.md +266 -0
  1313. package/packages/shared-skills/skills/frontend/references/design/coinbase.md +129 -0
  1314. package/packages/shared-skills/skills/frontend/references/design/composio.md +307 -0
  1315. package/packages/shared-skills/skills/frontend/references/design/cursor.md +309 -0
  1316. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +217 -0
  1317. package/packages/shared-skills/skills/frontend/references/design/elevenlabs.md +265 -0
  1318. package/packages/shared-skills/skills/frontend/references/design/expo.md +281 -0
  1319. package/packages/shared-skills/skills/frontend/references/design/ferrari.md +314 -0
  1320. package/packages/shared-skills/skills/frontend/references/design/figma.md +220 -0
  1321. package/packages/shared-skills/skills/frontend/references/design/framer.md +246 -0
  1322. package/packages/shared-skills/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  1323. package/packages/shared-skills/skills/frontend/references/design/hashicorp.md +278 -0
  1324. package/packages/shared-skills/skills/frontend/references/design/ibm.md +332 -0
  1325. package/packages/shared-skills/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  1326. package/packages/shared-skills/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  1327. package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  1328. package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
  1329. package/packages/shared-skills/skills/frontend/references/design/intercom.md +146 -0
  1330. package/packages/shared-skills/skills/frontend/references/design/kraken.md +125 -0
  1331. package/packages/shared-skills/skills/frontend/references/design/lamborghini.md +288 -0
  1332. package/packages/shared-skills/skills/frontend/references/design/linear.app.md +367 -0
  1333. package/packages/shared-skills/skills/frontend/references/design/lovable.md +298 -0
  1334. package/packages/shared-skills/skills/frontend/references/design/mastercard.md +365 -0
  1335. package/packages/shared-skills/skills/frontend/references/design/meta.md +366 -0
  1336. package/packages/shared-skills/skills/frontend/references/design/minimalist-skill.md +85 -0
  1337. package/packages/shared-skills/skills/frontend/references/design/minimax.md +257 -0
  1338. package/packages/shared-skills/skills/frontend/references/design/mintlify.md +326 -0
  1339. package/packages/shared-skills/skills/frontend/references/design/miro.md +108 -0
  1340. package/packages/shared-skills/skills/frontend/references/design/mistral.ai.md +261 -0
  1341. package/packages/shared-skills/skills/frontend/references/design/mongodb.md +266 -0
  1342. package/packages/shared-skills/skills/frontend/references/design/nike.md +363 -0
  1343. package/packages/shared-skills/skills/frontend/references/design/notion.md +309 -0
  1344. package/packages/shared-skills/skills/frontend/references/design/nvidia.md +293 -0
  1345. package/packages/shared-skills/skills/frontend/references/design/ollama.md +267 -0
  1346. package/packages/shared-skills/skills/frontend/references/design/opencode.ai.md +281 -0
  1347. package/packages/shared-skills/skills/frontend/references/design/output-skill.md +49 -0
  1348. package/packages/shared-skills/skills/frontend/references/design/pinterest.md +230 -0
  1349. package/packages/shared-skills/skills/frontend/references/design/playstation.md +364 -0
  1350. package/packages/shared-skills/skills/frontend/references/design/posthog.md +256 -0
  1351. package/packages/shared-skills/skills/frontend/references/design/raycast.md +268 -0
  1352. package/packages/shared-skills/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
  1353. package/packages/shared-skills/skills/frontend/references/design/redesign-skill.md +178 -0
  1354. package/packages/shared-skills/skills/frontend/references/design/renault.md +311 -0
  1355. package/packages/shared-skills/skills/frontend/references/design/replicate.md +261 -0
  1356. package/packages/shared-skills/skills/frontend/references/design/resend.md +303 -0
  1357. package/packages/shared-skills/skills/frontend/references/design/revolut.md +185 -0
  1358. package/packages/shared-skills/skills/frontend/references/design/runwayml.md +244 -0
  1359. package/packages/shared-skills/skills/frontend/references/design/sanity.md +357 -0
  1360. package/packages/shared-skills/skills/frontend/references/design/sentry.md +262 -0
  1361. package/packages/shared-skills/skills/frontend/references/design/shopify.md +350 -0
  1362. package/packages/shared-skills/skills/frontend/references/design/soft-skill.md +98 -0
  1363. package/packages/shared-skills/skills/frontend/references/design/spacex.md +194 -0
  1364. package/packages/shared-skills/skills/frontend/references/design/spotify.md +246 -0
  1365. package/packages/shared-skills/skills/frontend/references/design/starbucks.md +580 -0
  1366. package/packages/shared-skills/skills/frontend/references/design/stitch-skill.md +184 -0
  1367. package/packages/shared-skills/skills/frontend/references/design/stripe.md +322 -0
  1368. package/packages/shared-skills/skills/frontend/references/design/supabase.md +255 -0
  1369. package/packages/shared-skills/skills/frontend/references/design/superhuman.md +252 -0
  1370. package/packages/shared-skills/skills/frontend/references/design/taste-skill.md +226 -0
  1371. package/packages/shared-skills/skills/frontend/references/design/tesla.md +286 -0
  1372. package/packages/shared-skills/skills/frontend/references/design/theverge.md +339 -0
  1373. package/packages/shared-skills/skills/frontend/references/design/together.ai.md +263 -0
  1374. package/packages/shared-skills/skills/frontend/references/design/uber.md +295 -0
  1375. package/packages/shared-skills/skills/frontend/references/design/vercel.md +310 -0
  1376. package/packages/shared-skills/skills/frontend/references/design/vodafone.md +423 -0
  1377. package/packages/shared-skills/skills/frontend/references/design/voltagent.md +323 -0
  1378. package/packages/shared-skills/skills/frontend/references/design/warp.md +253 -0
  1379. package/packages/shared-skills/skills/frontend/references/design/webflow.md +92 -0
  1380. package/packages/shared-skills/skills/frontend/references/design/wired.md +278 -0
  1381. package/packages/shared-skills/skills/frontend/references/design/wise.md +173 -0
  1382. package/packages/shared-skills/skills/frontend/references/design/x.ai.md +257 -0
  1383. package/packages/shared-skills/skills/frontend/references/design/zapier.md +328 -0
  1384. package/packages/shared-skills/skills/frontend/references/perfection/README.md +160 -0
  1385. package/packages/shared-skills/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
  1386. package/packages/shared-skills/skills/frontend/references/ui-ux-db/README.md +273 -0
  1387. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  1388. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
  1389. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
  1390. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
  1391. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
  1392. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  1393. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  1394. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  1395. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  1396. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  1397. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  1398. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  1399. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  1400. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  1401. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  1402. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  1403. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  1404. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  1405. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  1406. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
  1407. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
  1408. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
  1409. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  1410. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  1411. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
  1412. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
  1413. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  1414. package/packages/shared-skills/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  1415. package/packages/shared-skills/skills/init-deep/SKILL.md +1 -1
  1416. package/packages/shared-skills/skills/refactor/SKILL.md +12 -21
  1417. package/packages/shared-skills/skills/review-work/SKILL.md +11 -9
  1418. package/packages/shared-skills/skills/start-work/SKILL.md +5 -4
  1419. package/packages/shared-skills/skills/ultraresearch/SKILL.md +9 -8
  1420. package/packages/shared-skills/skills/ulw-plan/SKILL.md +69 -0
  1421. package/packages/shared-skills/skills/ulw-plan/agents/openai.yaml +7 -0
  1422. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +99 -0
  1423. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +44 -0
  1424. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +44 -0
  1425. package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  1426. package/packages/shared-skills/skills/visual-qa/SKILL.md +17 -1
  1427. package/packages/shared-skills/skills/visual-qa/references/agent-browser-setup.md +44 -0
  1428. package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +48 -4
  1429. package/dist/cli/doctor/constants.d.ts +0 -32
  1430. package/dist/cli/doctor/spawn-with-timeout.d.ts +0 -8
  1431. package/dist/cli/doctor/types.d.ts +0 -148
  1432. package/dist/features/builtin-skills/skills/frontend-ui-ux.d.ts +0 -2
  1433. package/dist/mcp/ast-grep.d.ts +0 -11
  1434. package/packages/ast-grep-mcp/dist/cli.js +0 -1159
  1435. package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.js +0 -6
  1436. package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +0 -132
  1437. package/packages/lsp-tools-mcp/dist/lsp/client.js +0 -131
  1438. package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +0 -220
  1439. package/packages/lsp-tools-mcp/dist/lsp/connection.js +0 -66
  1440. package/packages/lsp-tools-mcp/dist/lsp/constants.js +0 -10
  1441. package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +0 -125
  1442. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +0 -8
  1443. package/packages/lsp-tools-mcp/dist/lsp/errors.js +0 -56
  1444. package/packages/lsp-tools-mcp/dist/lsp/formatters.js +0 -106
  1445. package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +0 -59
  1446. package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.js +0 -247
  1447. package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +0 -170
  1448. package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.js +0 -17
  1449. package/packages/lsp-tools-mcp/dist/lsp/process.js +0 -153
  1450. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +0 -170
  1451. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +0 -51
  1452. package/packages/lsp-tools-mcp/dist/lsp/server-installation.js +0 -40
  1453. package/packages/lsp-tools-mcp/dist/lsp/server-resolution.js +0 -86
  1454. package/packages/lsp-tools-mcp/dist/lsp/startup-failure.js +0 -35
  1455. package/packages/lsp-tools-mcp/dist/lsp/transport.js +0 -241
  1456. package/packages/lsp-tools-mcp/dist/lsp/types.js +0 -1
  1457. package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +0 -175
  1458. package/packages/lsp-tools-mcp/dist/missing-dependency-result.js +0 -14
  1459. package/packages/omo-codex/plugin/components/bootstrap/manifests/ast-grep.json +0 -22
  1460. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +0 -7
  1461. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +0 -173
  1462. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +0 -22
  1463. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +0 -165
  1464. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +0 -1
  1465. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +0 -1
  1466. package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +0 -5
  1467. package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +0 -4
  1468. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +0 -6
  1469. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +0 -10
  1470. package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +0 -2
  1471. package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +0 -11
  1472. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +0 -3
  1473. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +0 -104
  1474. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +0 -26
  1475. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +0 -144
  1476. package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +0 -43
  1477. package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +0 -1
  1478. package/packages/omo-codex/plugin/components/comment-checker/src/record.ts +0 -11
  1479. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +0 -5
  1480. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +0 -1
  1481. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +0 -47
  1482. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +0 -127
  1483. package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +0 -2
  1484. package/packages/omo-codex/plugin/components/rules/dist/config.js +0 -100
  1485. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +0 -2
  1486. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +0 -26
  1487. package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +0 -8
  1488. package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +0 -36
  1489. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +0 -7
  1490. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +0 -65
  1491. package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +0 -3
  1492. package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +0 -14
  1493. package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +0 -2
  1494. package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +0 -24
  1495. package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +0 -4
  1496. package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +0 -24
  1497. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +0 -13
  1498. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +0 -172
  1499. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +0 -6
  1500. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +0 -74
  1501. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +0 -4
  1502. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +0 -6
  1503. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +0 -1
  1504. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +0 -32
  1505. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +0 -13
  1506. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +0 -29
  1507. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +0 -9
  1508. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +0 -51
  1509. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +0 -70
  1510. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +0 -101
  1511. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +0 -5
  1512. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +0 -60
  1513. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +0 -6
  1514. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +0 -61
  1515. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +0 -7
  1516. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +0 -60
  1517. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +0 -11
  1518. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +0 -75
  1519. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +0 -6
  1520. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +0 -29
  1521. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +0 -44
  1522. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +0 -1
  1523. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +0 -5
  1524. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +0 -85
  1525. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +0 -6
  1526. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +0 -12
  1527. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +0 -14
  1528. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +0 -51
  1529. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +0 -6
  1530. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +0 -33
  1531. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +0 -5
  1532. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +0 -40
  1533. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +0 -28
  1534. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +0 -146
  1535. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +0 -7
  1536. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +0 -112
  1537. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +0 -18
  1538. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +0 -93
  1539. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +0 -3
  1540. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +0 -27
  1541. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +0 -7
  1542. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +0 -30
  1543. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +0 -2
  1544. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +0 -237
  1545. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +0 -3
  1546. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +0 -31
  1547. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +0 -1
  1548. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +0 -48
  1549. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +0 -1
  1550. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +0 -23
  1551. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +0 -14
  1552. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +0 -111
  1553. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +0 -3
  1554. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +0 -9
  1555. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +0 -18
  1556. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +0 -59
  1557. package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +0 -126
  1558. package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +0 -8
  1559. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +0 -6
  1560. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +0 -20
  1561. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +0 -3
  1562. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +0 -41
  1563. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +0 -10
  1564. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +0 -90
  1565. package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +0 -3
  1566. package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +0 -128
  1567. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +0 -6
  1568. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +0 -168
  1569. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +0 -4
  1570. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +0 -49
  1571. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +0 -4
  1572. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +0 -91
  1573. package/packages/omo-codex/plugin/components/rules/src/rules/cache.ts +0 -64
  1574. package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +0 -122
  1575. package/packages/omo-codex/plugin/components/rules/src/rules/engine-dynamic-cache.ts +0 -87
  1576. package/packages/omo-codex/plugin/components/rules/src/rules/engine-dynamic-loader.ts +0 -94
  1577. package/packages/omo-codex/plugin/components/rules/src/rules/engine-loader.ts +0 -84
  1578. package/packages/omo-codex/plugin/components/rules/src/rules/engine-paths.ts +0 -103
  1579. package/packages/omo-codex/plugin/components/rules/src/rules/engine-static-loader.ts +0 -43
  1580. package/packages/omo-codex/plugin/components/rules/src/rules/engine-types.ts +0 -45
  1581. package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +0 -123
  1582. package/packages/omo-codex/plugin/components/rules/src/rules/errors.ts +0 -13
  1583. package/packages/omo-codex/plugin/components/rules/src/rules/finder-cache.ts +0 -73
  1584. package/packages/omo-codex/plugin/components/rules/src/rules/finder-paths.ts +0 -47
  1585. package/packages/omo-codex/plugin/components/rules/src/rules/finder-sources.ts +0 -45
  1586. package/packages/omo-codex/plugin/components/rules/src/rules/finder.ts +0 -220
  1587. package/packages/omo-codex/plugin/components/rules/src/rules/formatter.ts +0 -149
  1588. package/packages/omo-codex/plugin/components/rules/src/rules/matcher.ts +0 -142
  1589. package/packages/omo-codex/plugin/components/rules/src/rules/ordering.ts +0 -33
  1590. package/packages/omo-codex/plugin/components/rules/src/rules/parser-frontmatter.ts +0 -39
  1591. package/packages/omo-codex/plugin/components/rules/src/rules/parser-yaml.ts +0 -271
  1592. package/packages/omo-codex/plugin/components/rules/src/rules/parser.ts +0 -35
  1593. package/packages/omo-codex/plugin/components/rules/src/rules/plugin-root.ts +0 -55
  1594. package/packages/omo-codex/plugin/components/rules/src/rules/project-root.ts +0 -30
  1595. package/packages/omo-codex/plugin/components/rules/src/rules/scanner.ts +0 -162
  1596. package/packages/omo-codex/plugin/components/rules/src/rules/sources.ts +0 -13
  1597. package/packages/omo-codex/plugin/components/rules/src/rules/truncator.ts +0 -84
  1598. package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +0 -141
  1599. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +0 -16
  1600. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +0 -146
  1601. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +0 -2
  1602. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +0 -2
  1603. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +0 -80
  1604. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +0 -1
  1605. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +0 -2
  1606. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +0 -5
  1607. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +0 -3
  1608. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +0 -20
  1609. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +0 -1
  1610. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +0 -1
  1611. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +0 -18
  1612. package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +0 -2
  1613. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +0 -15
  1614. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +0 -42
  1615. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +0 -10
  1616. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +0 -35
  1617. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +0 -12
  1618. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +0 -108
  1619. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +0 -4
  1620. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +0 -31
  1621. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +0 -8
  1622. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +0 -68
  1623. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +0 -21
  1624. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +0 -8
  1625. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +0 -29
  1626. package/packages/omo-codex/plugin/components/telemetry/src/atomic-write.ts +0 -22
  1627. package/packages/omo-codex/plugin/components/telemetry/src/data-path.ts +0 -45
  1628. package/packages/omo-codex/plugin/components/telemetry/src/diagnostics.ts +0 -154
  1629. package/packages/omo-codex/plugin/components/telemetry/src/env-flags.ts +0 -43
  1630. package/packages/omo-codex/plugin/components/telemetry/src/posthog-activity-state.ts +0 -97
  1631. package/packages/omo-codex/plugin/components/ultrawork/agents/codex-ultrawork-reviewer.toml +0 -21
  1632. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +0 -2
  1633. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +0 -7
  1634. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +0 -122
  1635. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +0 -1
  1636. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +0 -2
  1637. package/packages/omo-codex/plugin/skills/frontend-ui-ux/SKILL.md +0 -77
  1638. package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +0 -85
  1639. package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +0 -89
  1640. package/packages/omo-codex/scripts/atomic-write.test.mjs +0 -82
  1641. package/packages/omo-codex/scripts/install/agent-source-roots.mjs +0 -13
  1642. package/packages/omo-codex/scripts/install/agents.d.mts +0 -18
  1643. package/packages/omo-codex/scripts/install/agents.mjs +0 -227
  1644. package/packages/omo-codex/scripts/install/atomic-write.mjs +0 -59
  1645. package/packages/omo-codex/scripts/install/bin-dir.d.mts +0 -7
  1646. package/packages/omo-codex/scripts/install/bin-dir.mjs +0 -20
  1647. package/packages/omo-codex/scripts/install/bin-links.d.mts +0 -18
  1648. package/packages/omo-codex/scripts/install/bin-links.mjs +0 -276
  1649. package/packages/omo-codex/scripts/install/cache.mjs +0 -295
  1650. package/packages/omo-codex/scripts/install/cached-marketplace-manifest.mjs +0 -21
  1651. package/packages/omo-codex/scripts/install/cli-args.mjs +0 -149
  1652. package/packages/omo-codex/scripts/install/command-shim.mjs +0 -1
  1653. package/packages/omo-codex/scripts/install/config.d.mts +0 -35
  1654. package/packages/omo-codex/scripts/install/config.mjs +0 -267
  1655. package/packages/omo-codex/scripts/install/delegated-command.mjs +0 -29
  1656. package/packages/omo-codex/scripts/install/git-bash-mcp-env.d.mts +0 -5
  1657. package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +0 -28
  1658. package/packages/omo-codex/scripts/install/git-bash.d.mts +0 -23
  1659. package/packages/omo-codex/scripts/install/git-bash.mjs +0 -107
  1660. package/packages/omo-codex/scripts/install/git-bash.test.mjs +0 -209
  1661. package/packages/omo-codex/scripts/install/hook-targets.mjs +0 -46
  1662. package/packages/omo-codex/scripts/install/hook-trust.d.mts +0 -10
  1663. package/packages/omo-codex/scripts/install/hook-trust.mjs +0 -84
  1664. package/packages/omo-codex/scripts/install/lazycodex-version-stamp.mjs +0 -102
  1665. package/packages/omo-codex/scripts/install/legacy-bins.mjs +0 -66
  1666. package/packages/omo-codex/scripts/install/marketplace.mjs +0 -104
  1667. package/packages/omo-codex/scripts/install/mcp-runtime-cache.mjs +0 -81
  1668. package/packages/omo-codex/scripts/install/model-catalog.mjs +0 -74
  1669. package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +0 -50
  1670. package/packages/omo-codex/scripts/install/permissions.d.mts +0 -1
  1671. package/packages/omo-codex/scripts/install/permissions.mjs +0 -37
  1672. package/packages/omo-codex/scripts/install/process.mjs +0 -22
  1673. package/packages/omo-codex/scripts/install/project-local-cleanup.mjs +0 -228
  1674. package/packages/omo-codex/scripts/install/reasoning-config.mjs +0 -72
  1675. package/packages/omo-codex/scripts/install/snapshot.mjs +0 -53
  1676. package/packages/omo-codex/scripts/install/source-package-build.mjs +0 -20
  1677. package/packages/omo-codex/scripts/install/toml-editor.mjs +0 -64
  1678. package/packages/omo-codex/scripts/install/utils.mjs +0 -15
  1679. package/packages/omo-codex/scripts/sync-telemetry-component.mjs +0 -116
  1680. package/packages/omo-codex/scripts/sync-telemetry-component.test.mjs +0 -94
  1681. package/packages/shared-skills/skills/frontend-ui-ux/SKILL.md +0 -77
  1682. /package/dist/cli/doctor/{doctor-target.d.ts → framework/doctor-target.d.ts} +0 -0
  1683. /package/dist/cli/doctor/{format-default.d.ts → framework/format-default.d.ts} +0 -0
  1684. /package/dist/cli/doctor/{format-shared.d.ts → framework/format-shared.d.ts} +0 -0
  1685. /package/dist/cli/doctor/{format-status.d.ts → framework/format-status.d.ts} +0 -0
  1686. /package/dist/cli/doctor/{format-verbose.d.ts → framework/format-verbose.d.ts} +0 -0
  1687. /package/dist/cli/doctor/{formatter.d.ts → framework/formatter.d.ts} +0 -0
  1688. /package/packages/omo-codex/plugin/components/{comment-checker → codegraph}/dist/cli.d.ts +0 -0
  1689. /package/packages/omo-codex/plugin/components/{rules → lazycodex-executor-verify}/dist/cli.d.ts +0 -0
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // src/cli.ts
3
+ // components/bootstrap/src/cli.ts
4
4
  import { realpathSync } from "node:fs";
5
5
  import { fileURLToPath as fileURLToPath4 } from "node:url";
6
6
 
7
- // src/download.ts
7
+ // components/bootstrap/src/download.ts
8
8
  import { createHash, randomUUID } from "node:crypto";
9
9
  import { createWriteStream } from "node:fs";
10
10
  import { mkdir, readFile, rename, rm } from "node:fs/promises";
@@ -12,44 +12,42 @@ import { basename, dirname, join } from "node:path";
12
12
  import { Readable } from "node:stream";
13
13
  import { pipeline } from "node:stream/promises";
14
14
  import { fileURLToPath } from "node:url";
15
- var DownloadError = class extends Error {
15
+
16
+ class DownloadError extends Error {
16
17
  code;
17
18
  constructor(code, message) {
18
19
  super(message);
19
20
  this.name = "DownloadError";
20
21
  this.code = code;
21
22
  }
22
- };
23
- var ChecksumMismatchError = class extends DownloadError {
23
+ }
24
+
25
+ class ChecksumMismatchError extends DownloadError {
24
26
  expectedSha256;
25
27
  actualSha256;
26
28
  constructor(options) {
27
- super(
28
- "checksum-mismatch",
29
- `Checksum mismatch for ${options.url}: expected sha256 ${options.expectedSha256} but downloaded sha256 ${options.actualSha256}; deleted the partial download.`
30
- );
29
+ super("checksum-mismatch", `Checksum mismatch for ${options.url}: expected sha256 ${options.expectedSha256} but downloaded sha256 ${options.actualSha256}; deleted the partial download.`);
31
30
  this.name = "ChecksumMismatchError";
32
31
  this.expectedSha256 = options.expectedSha256;
33
32
  this.actualSha256 = options.actualSha256;
34
33
  }
35
- };
36
- var UnsupportedPlatformError = class extends DownloadError {
34
+ }
35
+
36
+ class UnsupportedPlatformError extends DownloadError {
37
37
  manifestName;
38
38
  platformKey;
39
39
  constructor(options) {
40
- super(
41
- "unsupported-platform",
42
- `Manifest "${options.manifestName}" has no asset for unsupported platform "${options.platformKey}" (available: ${options.availablePlatforms.join(", ")}).`
43
- );
40
+ super("unsupported-platform", `Manifest "${options.manifestName}" has no asset for unsupported platform "${options.platformKey}" (available: ${options.availablePlatforms.join(", ")}).`);
44
41
  this.name = "UnsupportedPlatformError";
45
42
  this.manifestName = options.manifestName;
46
43
  this.platformKey = options.platformKey;
47
44
  }
48
- };
45
+ }
49
46
  var PROXY_ENV_KEYS = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy"];
50
47
  function proxyLimitationNote(env) {
51
48
  const configuredKey = PROXY_ENV_KEYS.find((key) => (env[key] ?? "").trim().length > 0);
52
- if (configuredKey === void 0) return "";
49
+ if (configuredKey === undefined)
50
+ return "";
53
51
  return ` Note: ${configuredKey} is set, but the bootstrap downloader does not tunnel through HTTP(S) proxies in v1; the download was attempted directly.`;
54
52
  }
55
53
  function describeFailure(error) {
@@ -61,17 +59,13 @@ async function writeBodyToFile(body, tempPath) {
61
59
  await pipeline(Readable.from([]), createWriteStream(tempPath));
62
60
  return hash.digest("hex");
63
61
  }
64
- await pipeline(
65
- Readable.fromWeb(body),
66
- async function* hashChunks(source) {
67
- for await (const chunk of source) {
68
- const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
69
- hash.update(buffer);
70
- yield buffer;
71
- }
72
- },
73
- createWriteStream(tempPath)
74
- );
62
+ await pipeline(Readable.fromWeb(body), async function* hashChunks(source) {
63
+ for await (const chunk of source) {
64
+ const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
65
+ hash.update(buffer);
66
+ yield buffer;
67
+ }
68
+ }, createWriteStream(tempPath));
75
69
  return hash.digest("hex");
76
70
  }
77
71
  async function downloadChecksummedAsset(options) {
@@ -84,26 +78,17 @@ async function downloadChecksummedAsset(options) {
84
78
  try {
85
79
  response = await fetchImpl(options.url);
86
80
  } catch (error) {
87
- throw new DownloadError(
88
- "download-failed",
89
- `Download failed for ${options.url}: ${describeFailure(error)}.${proxyLimitationNote(env)}`
90
- );
81
+ throw new DownloadError("download-failed", `Download failed for ${options.url}: ${describeFailure(error)}.${proxyLimitationNote(env)}`);
91
82
  }
92
83
  if (!response.ok) {
93
- throw new DownloadError(
94
- "download-failed",
95
- `Download failed for ${options.url}: HTTP ${response.status}.${proxyLimitationNote(env)}`
96
- );
84
+ throw new DownloadError("download-failed", `Download failed for ${options.url}: HTTP ${response.status}.${proxyLimitationNote(env)}`);
97
85
  }
98
86
  let actualSha256;
99
87
  try {
100
88
  actualSha256 = await writeBodyToFile(response.body, tempPath);
101
89
  } catch (error) {
102
90
  await rm(tempPath, { force: true });
103
- throw new DownloadError(
104
- "download-failed",
105
- `Download failed for ${options.url} while writing the response body: ${describeFailure(error)}.${proxyLimitationNote(env)}`
106
- );
91
+ throw new DownloadError("download-failed", `Download failed for ${options.url} while writing the response body: ${describeFailure(error)}.${proxyLimitationNote(env)}`);
107
92
  }
108
93
  if (actualSha256 !== expectedSha256) {
109
94
  await rm(tempPath, { force: true });
@@ -143,7 +128,7 @@ async function loadAssetManifest(manifestName, manifestsDir) {
143
128
  async function downloadFromManifest(options) {
144
129
  const manifest = await loadAssetManifest(options.manifestName, options.manifestsDir);
145
130
  const asset = manifest.platforms[options.platformKey];
146
- if (asset === void 0) {
131
+ if (asset === undefined) {
147
132
  throw new UnsupportedPlatformError({
148
133
  availablePlatforms: Object.keys(manifest.platforms),
149
134
  manifestName: options.manifestName,
@@ -155,28 +140,30 @@ async function downloadFromManifest(options) {
155
140
  destination,
156
141
  sha256: asset.sha256,
157
142
  url: asset.url,
158
- ...options.fetchImpl === void 0 ? {} : { fetchImpl: options.fetchImpl },
159
- ...options.env === void 0 ? {} : { env: options.env }
143
+ ...options.fetchImpl === undefined ? {} : { fetchImpl: options.fetchImpl },
144
+ ...options.env === undefined ? {} : { env: options.env }
160
145
  });
161
146
  }
162
147
 
163
- // src/hook.ts
164
- import { spawn } from "node:child_process";
148
+ // components/bootstrap/src/hook.ts
149
+ import { spawn as spawn2 } from "node:child_process";
165
150
  import { stat as stat5 } from "node:fs/promises";
166
151
  import { fileURLToPath as fileURLToPath3 } from "node:url";
167
152
 
168
- // ../../scripts/auto-update-state.mjs
153
+ // scripts/auto-update-state.mjs
169
154
  import { appendFile, mkdir as mkdir2, open, readFile as readFile2, rm as rm2, stat, writeFile } from "node:fs/promises";
170
155
  import { homedir } from "node:os";
171
156
  import { dirname as dirname2, join as join2 } from "node:path";
172
- var DEFAULT_LOCK_STALE_MS = 10 * 60 * 1e3;
157
+ var DEFAULT_LOCK_STALE_MS = 10 * 60 * 1000;
173
158
  function resolveStatePath(env) {
174
- if (env.LAZYCODEX_AUTO_UPDATE_STATE_PATH?.trim()) return env.LAZYCODEX_AUTO_UPDATE_STATE_PATH;
159
+ if (env.LAZYCODEX_AUTO_UPDATE_STATE_PATH?.trim())
160
+ return env.LAZYCODEX_AUTO_UPDATE_STATE_PATH;
175
161
  const dataRoot = env.PLUGIN_DATA?.trim() || join2(homedir(), ".local", "share", "lazycodex");
176
162
  return join2(dataRoot, "auto-update.json");
177
163
  }
178
164
  function resolveLockPath(env, statePath) {
179
- if (env.LAZYCODEX_AUTO_UPDATE_LOCK_PATH?.trim()) return env.LAZYCODEX_AUTO_UPDATE_LOCK_PATH;
165
+ if (env.LAZYCODEX_AUTO_UPDATE_LOCK_PATH?.trim())
166
+ return env.LAZYCODEX_AUTO_UPDATE_LOCK_PATH;
180
167
  return `${statePath}.lock`;
181
168
  }
182
169
  async function acquireLock(lockPath, now, staleMs = DEFAULT_LOCK_STALE_MS) {
@@ -190,8 +177,10 @@ async function acquireLock(lockPath, now, staleMs = DEFAULT_LOCK_STALE_MS) {
190
177
  release: () => rm2(lockPath, { force: true })
191
178
  };
192
179
  } catch (error) {
193
- if (!(error instanceof Error && "code" in error && error.code === "EEXIST")) throw error;
194
- if (!await removeStaleLock(lockPath, now, staleMs)) return null;
180
+ if (!(error instanceof Error && ("code" in error) && error.code === "EEXIST"))
181
+ throw error;
182
+ if (!await removeStaleLock(lockPath, now, staleMs))
183
+ return null;
195
184
  return acquireLock(lockPath, now, 0);
196
185
  }
197
186
  }
@@ -201,7 +190,8 @@ async function readState(statePath) {
201
190
  const parsed = JSON.parse(raw);
202
191
  return typeof parsed === "object" && parsed !== null ? parsed : {};
203
192
  } catch (error) {
204
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return {};
193
+ if (error instanceof Error && "code" in error && error.code === "ENOENT")
194
+ return {};
205
195
  return {};
206
196
  }
207
197
  }
@@ -211,19 +201,22 @@ async function writeState(statePath, state) {
211
201
  `);
212
202
  }
213
203
  async function removeStaleLock(lockPath, now, staleMs) {
214
- if (staleMs <= 0) return false;
204
+ if (staleMs <= 0)
205
+ return false;
215
206
  try {
216
207
  const lockStat = await stat(lockPath);
217
- if (now - lockStat.mtimeMs < staleMs) return false;
208
+ if (now - lockStat.mtimeMs < staleMs)
209
+ return false;
218
210
  await rm2(lockPath, { force: true });
219
211
  return true;
220
212
  } catch (error) {
221
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return true;
213
+ if (error instanceof Error && "code" in error && error.code === "ENOENT")
214
+ return true;
222
215
  throw error;
223
216
  }
224
217
  }
225
218
 
226
- // src/environment.ts
219
+ // components/bootstrap/src/environment.ts
227
220
  import { stat as stat2 } from "node:fs/promises";
228
221
  import { readFile as readFile3 } from "node:fs/promises";
229
222
  import { homedir as homedir2 } from "node:os";
@@ -236,11 +229,11 @@ async function detectInstallFlowDetailed(options) {
236
229
  const snapshotPresent = await isFile(join3(options.pluginRoot, INSTALL_SNAPSHOT_FILENAME));
237
230
  const snapshotSignal = snapshotPresent ? "npx-local" : "marketplace";
238
231
  const snapshotReason = snapshotPresent ? `${INSTALL_SNAPSHOT_FILENAME} present at plugin root (written only by the npx installer)` : `${INSTALL_SNAPSHOT_FILENAME} absent from plugin root`;
239
- const scan = options.configToml === void 0 ? { kind: "absent" } : scanMarketplaceSource(options.configToml, marketplaceName);
232
+ const scan = options.configToml === undefined ? { kind: "absent" } : scanMarketplaceSource(options.configToml, marketplaceName);
240
233
  if (scan.kind === "absent") {
241
234
  return {
242
- configSignal: void 0,
243
- configSource: void 0,
235
+ configSignal: undefined,
236
+ configSource: undefined,
244
237
  flow: snapshotSignal,
245
238
  reason: `${snapshotReason}; no [marketplaces.${marketplaceName}] source to cross-check`,
246
239
  snapshotPresent
@@ -249,7 +242,7 @@ async function detectInstallFlowDetailed(options) {
249
242
  if (scan.kind === "unparsable") {
250
243
  return {
251
244
  configSignal: "unparsable",
252
- configSource: void 0,
245
+ configSource: undefined,
253
246
  flow: "unknown",
254
247
  reason: `${snapshotReason}; [marketplaces.${marketplaceName}] source value is unparsable`,
255
248
  snapshotPresent
@@ -290,25 +283,26 @@ async function detectInstallFlowFromEnvironment(options) {
290
283
  const configToml = await readOptionalFile(join3(home.path, "config.toml"));
291
284
  return detectInstallFlowDetailed({
292
285
  pluginRoot: options.pluginRoot,
293
- ...configToml === void 0 ? {} : { configToml },
294
- ...options.marketplaceName === void 0 ? {} : { marketplaceName: options.marketplaceName }
286
+ ...configToml === undefined ? {} : { configToml },
287
+ ...options.marketplaceName === undefined ? {} : { marketplaceName: options.marketplaceName }
295
288
  });
296
289
  }
297
290
  async function detectInstallFlowForTest(pluginRoot) {
298
291
  const home = await resolveCodexHome({ env: {}, pluginRoot });
299
- const configToml = home.source === "walk-up" ? await readOptionalFile(join3(home.path, "config.toml")) : void 0;
300
- return detectInstallFlow({ pluginRoot, ...configToml === void 0 ? {} : { configToml } });
292
+ const configToml = home.source === "walk-up" ? await readOptionalFile(join3(home.path, "config.toml")) : undefined;
293
+ return detectInstallFlow({ pluginRoot, ...configToml === undefined ? {} : { configToml } });
301
294
  }
302
295
  async function resolveCodexHome(options) {
303
296
  const envHome = options.env["CODEX_HOME"]?.trim();
304
- if (envHome !== void 0 && envHome.length > 0) {
297
+ if (envHome !== undefined && envHome.length > 0) {
305
298
  return { path: resolve(envHome), source: "env" };
306
299
  }
307
- if (options.pluginRoot !== void 0) {
300
+ if (options.pluginRoot !== undefined) {
308
301
  let current = resolve(options.pluginRoot);
309
- for (let level = 0; level < MAX_CODEX_HOME_WALK_UP_LEVELS; level += 1) {
302
+ for (let level = 0;level < MAX_CODEX_HOME_WALK_UP_LEVELS; level += 1) {
310
303
  const parent = dirname3(current);
311
- if (parent === current) break;
304
+ if (parent === current)
305
+ break;
312
306
  current = parent;
313
307
  if (await isFile(join3(current, "config.toml"))) {
314
308
  return { path: current, source: "walk-up" };
@@ -330,7 +324,8 @@ async function bootstrapLocks(options) {
330
324
  const bootstrapLockPath = resolveBootstrapLockPath(options.pluginData);
331
325
  const autoUpdateLockPath = resolveLockPath(options.env, resolveStatePath(options.env));
332
326
  const bootstrapLock = await acquireLock(bootstrapLockPath, now, staleMs);
333
- if (bootstrapLock === null) return null;
327
+ if (bootstrapLock === null)
328
+ return null;
334
329
  if (autoUpdateLockPath === bootstrapLockPath) {
335
330
  return { autoUpdateLockPath, bootstrapLockPath, release: () => bootstrapLock.release(), statePath };
336
331
  }
@@ -350,26 +345,31 @@ async function bootstrapLocks(options) {
350
345
  };
351
346
  }
352
347
  function scanMarketplaceSource(configToml, marketplaceName) {
353
- const expectedHeaders = /* @__PURE__ */ new Set([`marketplaces.${marketplaceName}`, `marketplaces.${JSON.stringify(marketplaceName)}`]);
348
+ const expectedHeaders = new Set([`marketplaces.${marketplaceName}`, `marketplaces.${JSON.stringify(marketplaceName)}`]);
354
349
  let inMarketplaceSection = false;
355
- for (const line of configToml.split("\n")) {
350
+ for (const line of configToml.split(`
351
+ `)) {
356
352
  const header = parseTomlHeader(line);
357
353
  if (header !== null) {
358
354
  inMarketplaceSection = expectedHeaders.has(header);
359
355
  continue;
360
356
  }
361
- if (!inMarketplaceSection) continue;
357
+ if (!inMarketplaceSection)
358
+ continue;
362
359
  const valueText = parseSourceAssignment(line);
363
- if (valueText === null) continue;
360
+ if (valueText === null)
361
+ continue;
364
362
  const source = parseTomlStringValue(valueText);
365
- return source === void 0 ? { kind: "unparsable" } : { kind: "source", source };
363
+ return source === undefined ? { kind: "unparsable" } : { kind: "source", source };
366
364
  }
367
365
  return { kind: "absent" };
368
366
  }
369
367
  function parseTomlHeader(line) {
370
368
  const trimmed = line.trim();
371
- if (!trimmed.startsWith("[") || !trimmed.endsWith("]")) return null;
372
- if (trimmed.startsWith("[[")) return null;
369
+ if (!trimmed.startsWith("[") || !trimmed.endsWith("]"))
370
+ return null;
371
+ if (trimmed.startsWith("[["))
372
+ return null;
373
373
  return trimmed.slice(1, -1).trim();
374
374
  }
375
375
  function parseSourceAssignment(line) {
@@ -378,16 +378,17 @@ function parseSourceAssignment(line) {
378
378
  }
379
379
  function parseTomlStringValue(valueText) {
380
380
  const trimmed = valueText.trim();
381
- if (trimmed.startsWith('"')) return parseLeadingJsonString(trimmed);
381
+ if (trimmed.startsWith('"'))
382
+ return parseLeadingJsonString(trimmed);
382
383
  if (trimmed.startsWith("'")) {
383
384
  const closingIndex = trimmed.indexOf("'", 1);
384
- return closingIndex === -1 ? void 0 : trimmed.slice(1, closingIndex);
385
+ return closingIndex === -1 ? undefined : trimmed.slice(1, closingIndex);
385
386
  }
386
- return void 0;
387
+ return;
387
388
  }
388
389
  function parseLeadingJsonString(value) {
389
390
  let escaped = false;
390
- for (let index = 1; index < value.length; index += 1) {
391
+ for (let index = 1;index < value.length; index += 1) {
391
392
  if (escaped) {
392
393
  escaped = false;
393
394
  continue;
@@ -400,22 +401,25 @@ function parseLeadingJsonString(value) {
400
401
  if (char === '"') {
401
402
  try {
402
403
  const parsed = JSON.parse(value.slice(0, index + 1));
403
- return typeof parsed === "string" ? parsed : void 0;
404
+ return typeof parsed === "string" ? parsed : undefined;
404
405
  } catch {
405
- return void 0;
406
+ return;
406
407
  }
407
408
  }
408
409
  }
409
- return void 0;
410
+ return;
410
411
  }
411
412
  function classifyMarketplaceSource(source) {
412
413
  const trimmed = source.trim();
413
- if (trimmed.length === 0) return "unparsable";
414
- if (/^(https?|ssh|git):\/\//i.test(trimmed) || trimmed.startsWith("git@")) return "marketplace";
414
+ if (trimmed.length === 0)
415
+ return "unparsable";
416
+ if (/^(https?|ssh|git):\/\//i.test(trimmed) || trimmed.startsWith("git@"))
417
+ return "marketplace";
415
418
  if (trimmed.startsWith("/") || trimmed.startsWith("~") || trimmed.startsWith("\\\\") || /^[A-Za-z]:[\\/]/.test(trimmed)) {
416
419
  return "npx-local";
417
420
  }
418
- if (trimmed.toLowerCase().endsWith(".git")) return "marketplace";
421
+ if (trimmed.toLowerCase().endsWith(".git"))
422
+ return "marketplace";
419
423
  return "unparsable";
420
424
  }
421
425
  async function isFile(path) {
@@ -429,165 +433,362 @@ async function readOptionalFile(path) {
429
433
  try {
430
434
  return await readFile3(path, "utf8");
431
435
  } catch {
432
- return void 0;
436
+ return;
433
437
  }
434
438
  }
435
439
 
436
- // src/worker.ts
440
+ // components/bootstrap/src/worker.ts
437
441
  import { appendFile as appendFile2, mkdir as mkdir8, readFile as readFile12 } from "node:fs/promises";
438
442
  import { homedir as homedir4 } from "node:os";
439
- import { dirname as dirname8, join as join15, resolve as resolve5 } from "node:path";
443
+ import { dirname as dirname7, join as join19, resolve as resolve6 } from "node:path";
440
444
  import { fileURLToPath as fileURLToPath2 } from "node:url";
441
445
 
442
- // src/provision.ts
446
+ // components/bootstrap/src/provision.ts
443
447
  import { execFile } from "node:child_process";
444
- import { randomUUID as randomUUID2 } from "node:crypto";
445
- import { chmod, mkdir as mkdir3, readFile as readFile4, rename as rename2, rm as rm3, writeFile as writeFile2 } from "node:fs/promises";
446
- import { basename as basename2, dirname as dirname5, join as join5 } from "node:path";
448
+ import { rm as rm4 } from "node:fs/promises";
449
+ import { dirname as dirname4, join as join7 } from "node:path";
447
450
  import { promisify } from "node:util";
451
+
452
+ // ../../utils/src/ast-grep/sg-manifest.ts
453
+ var SG_PINNED_VERSION = "0.43.0";
454
+ var SG_RELEASE_ASSETS = {
455
+ "darwin-arm64": {
456
+ sha256: "8c847d0a29aa4b3101b3361e0b3ee7fb53c7e497adc9ed1afc9615538cd40782",
457
+ url: "https://github.com/ast-grep/ast-grep/releases/download/0.43.0/app-aarch64-apple-darwin.zip"
458
+ },
459
+ "darwin-x64": {
460
+ sha256: "6d703090b106747b2f56086b6ccc7e798fe78bcae70257aa20519b220153555b",
461
+ url: "https://github.com/ast-grep/ast-grep/releases/download/0.43.0/app-x86_64-apple-darwin.zip"
462
+ },
463
+ "linux-arm64": {
464
+ sha256: "e706846148493967f3ab8011334817edd86ce5acbec10718b2a7b40799c640ff",
465
+ url: "https://github.com/ast-grep/ast-grep/releases/download/0.43.0/app-aarch64-unknown-linux-gnu.zip"
466
+ },
467
+ "linux-x64": {
468
+ sha256: "a26253a9c821d935f7e383e40f0de7c2ca62a4121de1f73a6d81ec32eae631e0",
469
+ url: "https://github.com/ast-grep/ast-grep/releases/download/0.43.0/app-x86_64-unknown-linux-gnu.zip"
470
+ },
471
+ "win32-arm64": {
472
+ sha256: "a519fdd90324bf6858fde2d3feb2b862d67b834dc11af8f5b6c2c8143ab6a6c5",
473
+ url: "https://github.com/ast-grep/ast-grep/releases/download/0.43.0/app-aarch64-pc-windows-msvc.zip"
474
+ },
475
+ "win32-x64": {
476
+ sha256: "a4febbc8c48671e5729d85e29e4ebe5a051b7250d19545bca18e725ccf40ef61",
477
+ url: "https://github.com/ast-grep/ast-grep/releases/download/0.43.0/app-x86_64-pc-windows-msvc.zip"
478
+ }
479
+ };
480
+ function normalizeRuntimePlatform(platform = process.platform) {
481
+ if (platform === "darwin" || platform === "linux" || platform === "win32")
482
+ return platform;
483
+ return "linux";
484
+ }
485
+ function normalizeRuntimeArch(arch = process.arch) {
486
+ if (arch === "arm64" || arch === "aarch64")
487
+ return "arm64";
488
+ return "x64";
489
+ }
490
+ function runtimeSlug(platform = process.platform, arch = process.arch) {
491
+ return `${normalizeRuntimePlatform(platform)}-${normalizeRuntimeArch(arch)}`;
492
+ }
493
+ function sgBinaryName(platform = process.platform) {
494
+ return normalizeRuntimePlatform(platform) === "win32" ? "sg.exe" : "sg";
495
+ }
496
+ // ../../utils/src/ast-grep/sg-provisioner.ts
497
+ import { createHash as createHash2, randomUUID as randomUUID2 } from "node:crypto";
498
+ import { chmod, mkdir as mkdir3, rename as rename2, rm as rm3, writeFile as writeFile2 } from "node:fs/promises";
499
+ import { basename as basename2, isAbsolute, join as join4, relative, resolve as resolve2 } from "node:path";
448
500
  import { inflateRawSync } from "node:zlib";
501
+ var DEFAULT_DOWNLOAD_TIMEOUT_MS = 60000;
502
+ var EOCD_SIGNATURE = 101010256;
503
+ var CENTRAL_SIGNATURE = 33639248;
504
+ var LOCAL_SIGNATURE = 67324752;
505
+ var ZIP64_SENTINEL = 4294967295;
449
506
 
450
- // ../../../../ast-grep-mcp/src/sg-cli-path.ts
451
- import { createRequire } from "node:module";
452
- import { homedir as defaultHomedir } from "node:os";
453
- import { dirname as dirname4, join as join4 } from "node:path";
454
- import { existsSync, statSync } from "node:fs";
455
- var SG_PATH_ENV_KEY = "OMO_AST_GREP_SG_PATH";
456
- var WINDOWS_EXECUTABLE_EXTENSIONS = [".exe", ".cmd", ".bat"];
457
- function isValidBinary(filePath) {
458
- try {
459
- const stats = statSync(filePath);
460
- if (!stats.isFile()) {
461
- return false;
462
- }
463
- const size = stats.size;
464
- const lowerPath = filePath.toLowerCase();
465
- if (lowerPath.endsWith(".cmd") || lowerPath.endsWith(".bat")) {
466
- return size > 0;
467
- }
468
- return size > 1e4;
469
- } catch {
470
- return false;
507
+ class SgProvisionError extends Error {
508
+ code;
509
+ constructor(code, message, options = {}) {
510
+ super(message, options);
511
+ this.name = "SgProvisionError";
512
+ this.code = code;
471
513
  }
472
514
  }
473
- function executableCandidates(filePath, platform = process.platform) {
474
- if (platform !== "win32") return [filePath];
475
- const candidates = [filePath];
476
- const lowerPath = filePath.toLowerCase();
477
- if (WINDOWS_EXECUTABLE_EXTENSIONS.some((extension) => lowerPath.endsWith(extension))) {
478
- return candidates;
515
+ function describeFailure2(error) {
516
+ return error instanceof Error ? error.message : String(error);
517
+ }
518
+ function sha256(bytes) {
519
+ return createHash2("sha256").update(bytes).digest("hex");
520
+ }
521
+ function timeoutSignal(signal) {
522
+ const timeout = AbortSignal.timeout(DEFAULT_DOWNLOAD_TIMEOUT_MS);
523
+ return signal === undefined ? timeout : AbortSignal.any([signal, timeout]);
524
+ }
525
+ async function downloadAsset(url, fetchImpl, signal) {
526
+ const activeFetch = fetchImpl ?? globalThis.fetch;
527
+ let response;
528
+ try {
529
+ response = await activeFetch(url, { signal });
530
+ } catch (error) {
531
+ throw new SgProvisionError("download_failed", `failed to download ast-grep ${SG_PINNED_VERSION} from ${url}: ${describeFailure2(error)}`, { cause: error });
479
532
  }
480
- for (const extension of WINDOWS_EXECUTABLE_EXTENSIONS) {
481
- candidates.push(`${filePath}${extension}`);
533
+ if (!response.ok) {
534
+ throw new SgProvisionError("download_failed", `failed to download ast-grep ${SG_PINNED_VERSION} from ${url}: HTTP ${response.status}`);
482
535
  }
483
- return candidates;
484
- }
485
- function findValidExecutable(filePath, platform = process.platform) {
486
- for (const candidate of executableCandidates(filePath, platform)) {
487
- if (existsSync(candidate) && isValidBinary(candidate)) {
488
- return candidate;
489
- }
536
+ try {
537
+ return Buffer.from(await response.arrayBuffer());
538
+ } catch (error) {
539
+ throw new SgProvisionError("download_failed", `failed to read ast-grep ${SG_PINNED_VERSION} download from ${url}: ${describeFailure2(error)}`, { cause: error });
490
540
  }
491
- return null;
492
541
  }
493
- function getPlatformPackageName(platform, arch) {
494
- const platformMap = {
495
- "darwin-arm64": "@ast-grep/cli-darwin-arm64",
496
- "darwin-x64": "@ast-grep/cli-darwin-x64",
497
- "linux-arm64": "@ast-grep/cli-linux-arm64-gnu",
498
- "linux-x64": "@ast-grep/cli-linux-x64-gnu",
499
- "win32-x64": "@ast-grep/cli-win32-x64-msvc",
500
- "win32-arm64": "@ast-grep/cli-win32-arm64-msvc",
501
- "win32-ia32": "@ast-grep/cli-win32-ia32-msvc"
502
- };
503
- return platformMap[`${platform}-${arch}`] ?? null;
542
+ function zipEntryBaseName(entryName) {
543
+ const segments = entryName.split("/");
544
+ return segments[segments.length - 1] ?? entryName;
545
+ }
546
+ function findEndOfCentralDirectory(zip) {
547
+ const lowestOffset = Math.max(0, zip.length - 22 - 65535);
548
+ for (let offset = zip.length - 22;offset >= lowestOffset; offset -= 1) {
549
+ if (zip.readUInt32LE(offset) === EOCD_SIGNATURE)
550
+ return offset;
551
+ }
552
+ throw new SgProvisionError("extract_failed", "downloaded ast-grep asset is not a zip archive");
504
553
  }
505
- function isModuleResolutionFailure(error) {
506
- return error instanceof Error && (error.message.includes("Cannot find module") || error.message.includes("Cannot find package"));
554
+ function listZipEntries(zip) {
555
+ const eocdOffset = findEndOfCentralDirectory(zip);
556
+ const entryCount = zip.readUInt16LE(eocdOffset + 10);
557
+ let cursor = zip.readUInt32LE(eocdOffset + 16);
558
+ const entries = [];
559
+ for (let index = 0;index < entryCount; index += 1) {
560
+ if (cursor + 46 > zip.length || zip.readUInt32LE(cursor) !== CENTRAL_SIGNATURE) {
561
+ throw new SgProvisionError("extract_failed", "downloaded ast-grep zip central directory is corrupt");
562
+ }
563
+ const nameLength = zip.readUInt16LE(cursor + 28);
564
+ const extraLength = zip.readUInt16LE(cursor + 30);
565
+ const commentLength = zip.readUInt16LE(cursor + 32);
566
+ entries.push({
567
+ compressedSize: zip.readUInt32LE(cursor + 20),
568
+ localHeaderOffset: zip.readUInt32LE(cursor + 42),
569
+ method: zip.readUInt16LE(cursor + 10),
570
+ name: zip.subarray(cursor + 46, cursor + 46 + nameLength).toString("utf8"),
571
+ uncompressedSize: zip.readUInt32LE(cursor + 24)
572
+ });
573
+ cursor += 46 + nameLength + extraLength + commentLength;
574
+ }
575
+ return entries;
507
576
  }
508
- function defaultResolveModulePath(specifier) {
509
- const require2 = createRequire(import.meta.url);
510
- return require2.resolve(specifier);
577
+ function decompressZipEntry(raw, entry) {
578
+ if (entry.method === 0)
579
+ return Buffer.from(raw);
580
+ if (entry.method === 8)
581
+ return inflateRawSync(raw);
582
+ throw new SgProvisionError("extract_failed", `ast-grep zip entry ${entry.name} uses unsupported compression method ${entry.method}`);
511
583
  }
512
- function nonEmptyValue(value) {
513
- if (value === void 0) return void 0;
514
- const trimmed = value.trim();
515
- return trimmed.length === 0 ? void 0 : trimmed;
584
+ function readZipEntryBytes(zip, entry) {
585
+ if (entry.compressedSize === ZIP64_SENTINEL || entry.uncompressedSize === ZIP64_SENTINEL || entry.localHeaderOffset === ZIP64_SENTINEL) {
586
+ throw new SgProvisionError("extract_failed", `ast-grep zip entry ${entry.name} uses unsupported zip64 extensions`);
587
+ }
588
+ if (zip.readUInt32LE(entry.localHeaderOffset) !== LOCAL_SIGNATURE) {
589
+ throw new SgProvisionError("extract_failed", `ast-grep zip entry ${entry.name} has a corrupt local header`);
590
+ }
591
+ const nameLength = zip.readUInt16LE(entry.localHeaderOffset + 26);
592
+ const extraLength = zip.readUInt16LE(entry.localHeaderOffset + 28);
593
+ const dataStart = entry.localHeaderOffset + 30 + nameLength + extraLength;
594
+ const bytes = decompressZipEntry(zip.subarray(dataStart, dataStart + entry.compressedSize), entry);
595
+ if (bytes.length !== entry.uncompressedSize) {
596
+ throw new SgProvisionError("extract_failed", `ast-grep zip entry ${entry.name} inflated to ${bytes.length} bytes, expected ${entry.uncompressedSize}`);
597
+ }
598
+ return bytes;
516
599
  }
517
- function findEnvOverrideSgPath(env, platform) {
518
- const overridePath = nonEmptyValue(env[SG_PATH_ENV_KEY]);
519
- if (overridePath === void 0) return null;
520
- return findValidExecutable(overridePath, platform);
600
+ function extractStandaloneSgBinary(zip, platform) {
601
+ const suffix = platform === "win32" ? ".exe" : "";
602
+ const entries = listZipEntries(zip);
603
+ const preferredNames = [`ast-grep${suffix}`, `sg${suffix}`];
604
+ for (const preferred of preferredNames) {
605
+ const entry = entries.find((candidate) => zipEntryBaseName(candidate.name) === preferred);
606
+ if (entry !== undefined)
607
+ return readZipEntryBytes(zip, entry);
608
+ }
609
+ throw new SgProvisionError("extract_failed", `ast-grep release zip has no standalone ${preferredNames.join(" or ")} binary`);
521
610
  }
522
- function findRuntimeDirSgPath(env, platform, arch, homedir5) {
523
- const codexHome = nonEmptyValue(env["CODEX_HOME"]) ?? join4(homedir5(), ".codex");
524
- const binaryName = platform === "win32" ? "sg.exe" : "sg";
525
- const runtimePath = join4(codexHome, "runtime", "ast-grep", `${platform}-${arch}`, binaryName);
526
- return findValidExecutable(runtimePath, platform);
611
+ function assertInsideTarget(targetDir, filePath) {
612
+ const relativePath = relative(targetDir, filePath);
613
+ if (relativePath.startsWith("..") || isAbsolute(relativePath)) {
614
+ throw new SgProvisionError("write_failed", `refusing to write ast-grep binary outside targetDir: ${filePath}`);
615
+ }
527
616
  }
528
- function findSgCliPathSync(options = {}) {
529
- const env = options.env ?? process.env;
617
+ async function provisionSgBinary(options) {
530
618
  const platform = options.platform ?? process.platform;
531
- const arch = options.arch ?? process.arch;
532
- const homedir5 = options.homedir ?? defaultHomedir;
533
- const resolveModulePath = options.resolveModulePath ?? defaultResolveModulePath;
534
- const envOverridePath = findEnvOverrideSgPath(env, platform);
535
- if (envOverridePath) {
536
- return envOverridePath;
537
- }
538
- const runtimeDirPath = findRuntimeDirSgPath(env, platform, arch, homedir5);
539
- if (runtimeDirPath) {
540
- return runtimeDirPath;
541
- }
542
- const binaryName = "sg";
619
+ const slug = runtimeSlug(platform, options.arch ?? process.arch);
620
+ const asset = options.releaseAssets?.[slug] ?? SG_RELEASE_ASSETS[slug];
621
+ if (asset === undefined) {
622
+ throw new SgProvisionError("unsupported_platform", `ast-grep ${SG_PINNED_VERSION} has no asset for ${slug}`);
623
+ }
624
+ const targetDir = resolve2(options.targetDir);
625
+ const destination = join4(targetDir, sgBinaryName(platform));
626
+ const tempPath = join4(targetDir, `.sg-${randomUUID2().slice(0, 8)}.partial`);
627
+ assertInsideTarget(targetDir, destination);
628
+ assertInsideTarget(targetDir, tempPath);
543
629
  try {
544
- const cliPackageJsonPath = resolveModulePath("@ast-grep/cli/package.json");
545
- const cliDirectory = dirname4(cliPackageJsonPath);
546
- const sgPath = join4(cliDirectory, binaryName);
547
- const validSgPath = findValidExecutable(sgPath, platform);
548
- if (validSgPath) {
549
- return validSgPath;
630
+ await mkdir3(targetDir, { recursive: true });
631
+ const archive = await downloadAsset(asset.url, options.fetchImpl, timeoutSignal(options.signal));
632
+ const actualSha256 = sha256(archive);
633
+ if (actualSha256 !== asset.sha256) {
634
+ throw new SgProvisionError("bad_checksum", `checksum mismatch for ${basename2(asset.url)}: expected ${asset.sha256}, got ${actualSha256}`);
550
635
  }
636
+ await writeFile2(tempPath, extractStandaloneSgBinary(archive, platform));
637
+ await chmod(tempPath, 493);
638
+ await rename2(tempPath, destination);
639
+ return destination;
551
640
  } catch (error) {
552
- if (!isModuleResolutionFailure(error)) {
641
+ await rm3(tempPath, { force: true });
642
+ if (error instanceof SgProvisionError)
553
643
  throw error;
554
- }
644
+ throw new SgProvisionError("write_failed", `failed to provision ast-grep ${SG_PINNED_VERSION} into ${targetDir}: ${describeFailure2(error)}`, { cause: error });
555
645
  }
556
- const platformPackage = getPlatformPackageName(platform, arch);
557
- if (platformPackage) {
558
- try {
559
- const packageJsonPath = resolveModulePath(`${platformPackage}/package.json`);
560
- const packageDirectory = dirname4(packageJsonPath);
561
- const astGrepBinaryName = "ast-grep";
562
- const binaryPath = join4(packageDirectory, astGrepBinaryName);
563
- const validBinaryPath = findValidExecutable(binaryPath, platform);
564
- if (validBinaryPath) {
565
- return validBinaryPath;
566
- }
567
- } catch (error) {
568
- if (!isModuleResolutionFailure(error)) {
569
- throw error;
570
- }
646
+ }
647
+ // ../../utils/src/ast-grep/sg-resolver.ts
648
+ import { execFileSync } from "node:child_process";
649
+ import { existsSync, statSync } from "node:fs";
650
+ import { join as join6 } from "node:path";
651
+
652
+ // ../../utils/src/runtime/which.ts
653
+ import { accessSync, constants } from "node:fs";
654
+ import { delimiter, join as join5 } from "node:path";
655
+ var runtime = globalThis;
656
+ function isUnsafeCommandName(commandName) {
657
+ if (commandName.includes("/") || commandName.includes("\\"))
658
+ return true;
659
+ if (commandName === "." || commandName === ".." || commandName.includes(".."))
660
+ return true;
661
+ if (/^[a-zA-Z]:/.test(commandName))
662
+ return true;
663
+ if (commandName.includes("\x00"))
664
+ return true;
665
+ return false;
666
+ }
667
+ function isExecutable(filePath) {
668
+ try {
669
+ accessSync(filePath, process.platform === "win32" ? constants.F_OK : constants.X_OK);
670
+ return true;
671
+ } catch (error) {
672
+ if (!(error instanceof Error) && Object.prototype.toString.call(error) !== "[object Error]") {
673
+ throw error;
571
674
  }
675
+ return false;
572
676
  }
573
- if (platform === "darwin") {
574
- const homebrewPaths = ["/opt/homebrew/bin/sg", "/usr/local/bin/sg"];
575
- for (const path of homebrewPaths) {
576
- if (existsSync(path) && isValidBinary(path)) {
577
- return path;
578
- }
677
+ }
678
+ function resolvePathValue() {
679
+ if (process.platform === "win32")
680
+ return process.env["Path"] ?? process.env["PATH"];
681
+ return process.env["PATH"];
682
+ }
683
+ function getWindowsCandidates(commandName) {
684
+ if (process.platform !== "win32")
685
+ return [commandName];
686
+ if (/\.[^\\/]+$/.test(commandName))
687
+ return [commandName];
688
+ return [commandName, `${commandName}.exe`, `${commandName}.cmd`, `${commandName}.bat`, `${commandName}.com`];
689
+ }
690
+ function bunWhich(commandName) {
691
+ if (!commandName)
692
+ return null;
693
+ if (isUnsafeCommandName(commandName))
694
+ return null;
695
+ const candidateNames = getWindowsCandidates(commandName);
696
+ for (const candidateName of candidateNames) {
697
+ const resolvedPath = runtime.Bun?.which(candidateName) ?? null;
698
+ if (resolvedPath !== null)
699
+ return resolvedPath;
700
+ }
701
+ const pathValue = resolvePathValue();
702
+ if (!pathValue)
703
+ return null;
704
+ const pathEntries = pathValue.split(delimiter).filter((pathEntry) => pathEntry.length > 0);
705
+ if (pathEntries.length === 0)
706
+ return null;
707
+ for (const pathEntry of pathEntries) {
708
+ for (const candidateName of candidateNames) {
709
+ const candidatePath = join5(pathEntry, candidateName);
710
+ if (isExecutable(candidatePath))
711
+ return candidatePath;
579
712
  }
580
713
  }
581
714
  return null;
582
715
  }
583
716
 
584
- // src/provision.ts
717
+ // ../../utils/src/ast-grep/types.ts
718
+ var SG_PATH_ENV_KEY = "OMO_AST_GREP_SG_PATH";
719
+
720
+ // ../../utils/src/ast-grep/sg-resolver.ts
721
+ function nonEmptyValue(value) {
722
+ const trimmed = value?.trim();
723
+ return trimmed === undefined || trimmed.length === 0 ? null : trimmed;
724
+ }
725
+ function defaultFileExists(filePath) {
726
+ if (!existsSync(filePath))
727
+ return false;
728
+ try {
729
+ const stats = statSync(filePath);
730
+ return stats.isFile() && stats.size > 0;
731
+ } catch (error) {
732
+ if (error instanceof Error)
733
+ return false;
734
+ return false;
735
+ }
736
+ }
737
+ function defaultVersionProbe(binaryPath) {
738
+ return String(execFileSync(binaryPath, ["--version"], { encoding: "utf8", timeout: 5000 }));
739
+ }
740
+ function isAstGrepVersionOutput(output) {
741
+ return output.toLowerCase().includes("ast-grep");
742
+ }
743
+ function hasAstGrepVersion(binaryPath, runVersionProbeSync) {
744
+ try {
745
+ return isAstGrepVersionOutput(runVersionProbeSync(binaryPath));
746
+ } catch (error) {
747
+ if (error instanceof Error)
748
+ return false;
749
+ return false;
750
+ }
751
+ }
752
+ function pathCommandCandidates(platform) {
753
+ return platform === "linux" ? ["ast-grep", "sg"] : ["sg", "ast-grep"];
754
+ }
755
+ function findSgBinarySync(options = {}) {
756
+ const env = options.env ?? process.env;
757
+ const platform = options.platform ?? process.platform;
758
+ const fileExists = options.fileExists ?? defaultFileExists;
759
+ const runVersionProbeSync = options.runVersionProbeSync ?? defaultVersionProbe;
760
+ const which = options.which ?? bunWhich;
761
+ try {
762
+ const envOverride = nonEmptyValue(env[SG_PATH_ENV_KEY]);
763
+ if (envOverride !== null && fileExists(envOverride))
764
+ return envOverride;
765
+ if (options.runtimeDir !== undefined) {
766
+ const runtimeCandidate = join6(options.runtimeDir, sgBinaryName(platform));
767
+ if (fileExists(runtimeCandidate))
768
+ return runtimeCandidate;
769
+ }
770
+ for (const commandName of pathCommandCandidates(platform)) {
771
+ const pathCandidate = which(commandName);
772
+ if (pathCandidate === null || !fileExists(pathCandidate))
773
+ continue;
774
+ if (commandName !== "sg" || hasAstGrepVersion(pathCandidate, runVersionProbeSync))
775
+ return pathCandidate;
776
+ }
777
+ return null;
778
+ } catch (error) {
779
+ if (error instanceof Error)
780
+ return null;
781
+ return null;
782
+ }
783
+ }
784
+ // components/bootstrap/src/provision.ts
585
785
  var SG_PROVISION_COMPONENT = "ast_grep";
586
786
  var SG_FORCE_PROVISION_ENV_KEY = "OMO_BOOTSTRAP_FORCE_PROVISION";
587
- var SG_MANIFEST_NAME = "ast-grep";
588
787
  function sgProvisionDestination(context, arch) {
589
- const binaryName = context.platform === "win32" ? "sg.exe" : "sg";
590
- return join5(context.codexHome, "runtime", "ast-grep", `${context.platform}-${arch}`, binaryName);
788
+ return join7(sgRuntimeDir(context.codexHome, context.platform, arch), sgBinaryName(context.platform));
789
+ }
790
+ function sgRuntimeDir(codexHome, platform, arch) {
791
+ return join7(codexHome, "runtime", "ast-grep", runtimeSlug(platform, arch));
591
792
  }
592
793
  async function runSgProvision(context, seams = {}) {
593
794
  const arch = seams.arch ?? process.arch;
@@ -604,9 +805,8 @@ async function runSgProvision(context, seams = {}) {
604
805
  return { degraded: [] };
605
806
  }
606
807
  }
607
- const stagingDir = join5(dirname5(destination), `.staging-${randomUUID2().slice(0, 8)}`);
608
808
  try {
609
- const version = await provisionFromManifest(context, seams, { arch, destination, stagingDir });
809
+ const version = await provisionFromSharedManifest(context, seams, { arch, destination });
610
810
  await appendBootstrapLog(context.pluginData, context.now, "sg-provision", {
611
811
  sg: `provisioned:${destination}`,
612
812
  version
@@ -616,239 +816,213 @@ async function runSgProvision(context, seams = {}) {
616
816
  const reason = error instanceof Error ? error.message : String(error);
617
817
  await appendBootstrapLog(context.pluginData, context.now, "sg-provision-failed", { reason });
618
818
  return { degraded: [{ component: SG_PROVISION_COMPONENT, hint: BOOTSTRAP_DOCTOR_HINT, reason }] };
619
- } finally {
620
- await rm3(stagingDir, { force: true, recursive: true });
621
- }
622
- }
623
- async function provisionFromManifest(context, seams, layout) {
624
- const manifest = await loadAssetManifest(SG_MANIFEST_NAME, context.flags.manifestDir);
625
- const platformKey = `${context.platform}-${layout.arch}`;
626
- const asset = manifest.platforms[platformKey];
627
- if (asset === void 0) {
628
- throw new Error(
629
- `ast-grep ${manifest.version} has no asset for unsupported platform "${platformKey}" (available: ${Object.keys(manifest.platforms).join(", ")}).`
630
- );
631
- }
632
- await mkdir3(layout.stagingDir, { recursive: true });
633
- const archivePath = await downloadChecksummedAsset({
634
- destination: join5(layout.stagingDir, basename2(new URL(asset.url).pathname)),
635
- env: context.env,
636
- sha256: asset.sha256,
637
- url: asset.url,
638
- ...seams.fetchImpl === void 0 ? {} : { fetchImpl: seams.fetchImpl }
819
+ }
820
+ }
821
+ async function provisionFromSharedManifest(context, seams, layout) {
822
+ const provisionedPath = await provisionSgBinary({
823
+ arch: layout.arch,
824
+ platform: context.platform,
825
+ targetDir: dirname4(layout.destination),
826
+ ...seams.fetchImpl === undefined ? {} : { fetchImpl: seams.fetchImpl },
827
+ ...seams.releaseAssets === undefined ? {} : { releaseAssets: seams.releaseAssets }
639
828
  });
640
- const binaryBytes = extractStandaloneSgBinary(await readFile4(archivePath), context.platform);
641
- const stagedBinary = join5(layout.stagingDir, basename2(layout.destination));
642
- await writeFile2(stagedBinary, binaryBytes);
643
- await chmod(stagedBinary, 493);
644
- await rename2(stagedBinary, layout.destination);
645
- await verifyProvisionedVersion(layout.destination, manifest.version, seams);
646
- return manifest.version;
829
+ if (provisionedPath !== layout.destination) {
830
+ await rm4(provisionedPath, { force: true });
831
+ throw new Error(`provisioned sg at ${provisionedPath} but expected ${layout.destination}; removed the binary.`);
832
+ }
833
+ await verifyProvisionedVersion(layout.destination, SG_PINNED_VERSION, seams);
834
+ return SG_PINNED_VERSION;
647
835
  }
648
836
  async function verifyProvisionedVersion(destination, pinnedVersion, seams) {
649
837
  let reported;
650
838
  try {
651
- reported = (await (seams.runVersionProbe ?? defaultVersionProbe)(destination)).trim();
839
+ reported = (await (seams.runVersionProbe ?? defaultVersionProbe2)(destination)).trim();
652
840
  } catch (error) {
653
- await rm3(destination, { force: true });
654
- throw new Error(
655
- `provisioned sg at ${destination} failed its --version probe: ${error instanceof Error ? error.message : String(error)}`
656
- );
841
+ await rm4(destination, { force: true });
842
+ throw new Error(`provisioned sg at ${destination} failed its --version probe: ${error instanceof Error ? error.message : String(error)}`);
657
843
  }
658
844
  if (!reported.includes(pinnedVersion)) {
659
- await rm3(destination, { force: true });
660
- throw new Error(
661
- `provisioned sg at ${destination} reported "${reported}" but the manifest pins version ${pinnedVersion}; removed the binary.`
662
- );
845
+ await rm4(destination, { force: true });
846
+ throw new Error(`provisioned sg at ${destination} reported "${reported}" but the manifest pins version ${pinnedVersion}; removed the binary.`);
663
847
  }
664
848
  }
665
849
  function defaultResolvePreexistingSg(options) {
666
- return findSgCliPathSync({
850
+ return findSgBinarySync({
667
851
  arch: options.arch,
668
852
  env: { ...options.env, CODEX_HOME: options.codexHome },
669
- platform: options.platform
853
+ platform: options.platform,
854
+ runtimeDir: sgRuntimeDir(options.codexHome, options.platform, options.arch)
670
855
  });
671
856
  }
672
857
  var execFileAsync = promisify(execFile);
673
- async function defaultVersionProbe(binaryPath) {
858
+ async function defaultVersionProbe2(binaryPath) {
674
859
  const { stdout } = await execFileAsync(binaryPath, ["--version"]);
675
860
  return String(stdout);
676
861
  }
677
- function extractStandaloneSgBinary(zip, platform) {
678
- const suffix = platform === "win32" ? ".exe" : "";
679
- const entries = listZipEntries(zip);
680
- const preferredNames = [`ast-grep${suffix}`, `sg${suffix}`];
681
- for (const preferred of preferredNames) {
682
- const entry = entries.find((candidate) => zipEntryBaseName(candidate.name) === preferred);
683
- if (entry !== void 0) return readZipEntryBytes(zip, entry);
862
+
863
+ // components/bootstrap/src/setup.ts
864
+ import { execFile as execFile2 } from "node:child_process";
865
+ import { copyFile as copyFile2, mkdir as mkdir7, readdir as readdir3, rm as rm9, stat as stat4 } from "node:fs/promises";
866
+ import { join as join18 } from "node:path";
867
+ import { promisify as promisify2 } from "node:util";
868
+
869
+ // ../src/install/link-cached-plugin-agents.ts
870
+ import { copyFile, lstat as lstat2, mkdir as mkdir4, readFile as readFile5, readdir, rm as rm6, writeFile as writeFile3 } from "node:fs/promises";
871
+ import { basename as basename3, join as join9 } from "node:path";
872
+
873
+ // ../src/install/retired-managed-agent-purge.ts
874
+ import { lstat, readFile as readFile4, rm as rm5 } from "node:fs/promises";
875
+ import { join as join8 } from "node:path";
876
+ var RETIRED_MANAGED_AGENT_FILES = [
877
+ {
878
+ fileName: "codex-ultrawork-reviewer.toml",
879
+ requiredMarkers: [
880
+ 'name = "codex-ultrawork-reviewer"',
881
+ 'description = "Strict ultrawork verification reviewer.',
882
+ 'developer_instructions = """You are the ultrawork verification reviewer.'
883
+ ]
684
884
  }
685
- throw new Error(
686
- `ast-grep release zip has no ${preferredNames.join(" or ")} entry (found: ${entries.map((entry) => entry.name).join(", ")}).`
687
- );
688
- }
689
- function zipEntryBaseName(entryName) {
690
- const segments = entryName.split("/");
691
- return segments[segments.length - 1] ?? entryName;
692
- }
693
- var EOCD_SIGNATURE = 101010256;
694
- var CENTRAL_SIGNATURE = 33639248;
695
- var LOCAL_SIGNATURE = 67324752;
696
- var ZIP64_SENTINEL = 4294967295;
697
- function listZipEntries(zip) {
698
- const eocdOffset = findEndOfCentralDirectory(zip);
699
- const entryCount = zip.readUInt16LE(eocdOffset + 10);
700
- let cursor = zip.readUInt32LE(eocdOffset + 16);
701
- const entries = [];
702
- for (let index = 0; index < entryCount; index += 1) {
703
- if (cursor + 46 > zip.length || zip.readUInt32LE(cursor) !== CENTRAL_SIGNATURE) {
704
- throw new Error("zip central directory is corrupt (bad entry signature)");
705
- }
706
- const nameLength = zip.readUInt16LE(cursor + 28);
707
- const extraLength = zip.readUInt16LE(cursor + 30);
708
- const commentLength = zip.readUInt16LE(cursor + 32);
709
- entries.push({
710
- compressedSize: zip.readUInt32LE(cursor + 20),
711
- localHeaderOffset: zip.readUInt32LE(cursor + 42),
712
- method: zip.readUInt16LE(cursor + 10),
713
- name: zip.subarray(cursor + 46, cursor + 46 + nameLength).toString("utf8"),
714
- uncompressedSize: zip.readUInt32LE(cursor + 24)
715
- });
716
- cursor += 46 + nameLength + extraLength + commentLength;
885
+ ];
886
+ async function purgeRetiredManagedAgentFiles(input) {
887
+ const agentsDir = join8(input.codexHome, "agents");
888
+ if (!await exists(agentsDir))
889
+ return;
890
+ for (const retiredAgent of RETIRED_MANAGED_AGENT_FILES) {
891
+ const agentPath = join8(agentsDir, retiredAgent.fileName);
892
+ if (!await exists(agentPath))
893
+ continue;
894
+ const agentStat = await lstat(agentPath);
895
+ if (agentStat.isDirectory() && !agentStat.isSymbolicLink())
896
+ continue;
897
+ const content = await readTextIfExists(agentPath);
898
+ if (content === null || !hasRequiredMarkers(content, retiredAgent.requiredMarkers))
899
+ continue;
900
+ await rm5(agentPath, { force: true });
717
901
  }
718
- return entries;
719
902
  }
720
- function findEndOfCentralDirectory(zip) {
721
- const lowestOffset = Math.max(0, zip.length - 22 - 65535);
722
- for (let offset = zip.length - 22; offset >= lowestOffset; offset -= 1) {
723
- if (zip.readUInt32LE(offset) === EOCD_SIGNATURE) return offset;
724
- }
725
- throw new Error("downloaded asset is not a zip archive (end-of-central-directory record missing)");
903
+ function hasRequiredMarkers(content, markers) {
904
+ return markers.every((marker) => content.includes(marker));
726
905
  }
727
- function readZipEntryBytes(zip, entry) {
728
- if (entry.compressedSize === ZIP64_SENTINEL || entry.uncompressedSize === ZIP64_SENTINEL || entry.localHeaderOffset === ZIP64_SENTINEL) {
729
- throw new Error(`zip entry ${entry.name} uses unsupported zip64 extensions`);
730
- }
731
- if (zip.readUInt32LE(entry.localHeaderOffset) !== LOCAL_SIGNATURE) {
732
- throw new Error(`zip entry ${entry.name} has a corrupt local header`);
733
- }
734
- const nameLength = zip.readUInt16LE(entry.localHeaderOffset + 26);
735
- const extraLength = zip.readUInt16LE(entry.localHeaderOffset + 28);
736
- const dataStart = entry.localHeaderOffset + 30 + nameLength + extraLength;
737
- const raw = zip.subarray(dataStart, dataStart + entry.compressedSize);
738
- const bytes = decompressZipEntry(raw, entry);
739
- if (bytes.length !== entry.uncompressedSize) {
740
- throw new Error(
741
- `zip entry ${entry.name} inflated to ${bytes.length} bytes but the archive declares ${entry.uncompressedSize}`
742
- );
906
+ async function readTextIfExists(path) {
907
+ try {
908
+ return await readFile4(path, "utf8");
909
+ } catch (error) {
910
+ if (nodeErrorCode(error) === "ENOENT")
911
+ return null;
912
+ throw error;
743
913
  }
744
- return bytes;
745
- }
746
- function decompressZipEntry(raw, entry) {
747
- if (entry.method === 0) return Buffer.from(raw);
748
- if (entry.method === 8) return inflateRawSync(raw);
749
- throw new Error(`zip entry ${entry.name} uses unsupported compression method ${entry.method}`);
750
914
  }
751
-
752
- // src/setup.ts
753
- import { execFile as execFile2 } from "node:child_process";
754
- import { copyFile as copyFile2, mkdir as mkdir7, readdir as readdir3, rm as rm7, stat as stat4 } from "node:fs/promises";
755
- import { join as join14 } from "node:path";
756
- import { promisify as promisify2 } from "node:util";
757
-
758
- // ../../../scripts/install/agents.mjs
759
- import { basename as basename3, join as join6 } from "node:path";
760
- import { copyFile, lstat, mkdir as mkdir4, readFile as readFile5, readdir, rm as rm4, writeFile as writeFile3 } from "node:fs/promises";
761
-
762
- // ../../../scripts/install/utils.mjs
763
- import { constants as fsConstants } from "node:fs";
764
- import { access } from "node:fs/promises";
765
915
  async function exists(path) {
766
916
  try {
767
- await access(path, fsConstants.F_OK);
917
+ await lstat(path);
768
918
  return true;
769
- } catch {
919
+ } catch (error) {
920
+ if (nodeErrorCode(error) !== "ENOENT")
921
+ throw error;
770
922
  return false;
771
923
  }
772
924
  }
773
- function isRecord2(value) {
774
- return typeof value === "object" && value !== null && !Array.isArray(value);
925
+ function nodeErrorCode(error) {
926
+ if (!(error instanceof Error) || !("code" in error))
927
+ return null;
928
+ return typeof error.code === "string" ? error.code : null;
775
929
  }
776
930
 
777
- // ../../../scripts/install/agents.mjs
931
+ // ../src/install/link-cached-plugin-agents.ts
778
932
  var MANIFEST_FILE = ".installed-agents.json";
779
- async function capturePreservedAgentReasoning({ codexHome }) {
780
- const agentsDir = join6(codexHome, "agents");
781
- if (!await exists(agentsDir)) return /* @__PURE__ */ new Map();
782
- const preserved = /* @__PURE__ */ new Map();
933
+ async function capturePreservedAgentReasoning(input) {
934
+ const agentsDir = join9(input.codexHome, "agents");
935
+ if (!await exists2(agentsDir))
936
+ return new Map;
937
+ const preserved = new Map;
783
938
  const agentEntries = await readdir(agentsDir, { withFileTypes: true });
784
939
  for (const entry of agentEntries) {
785
- if (!entry.name.endsWith(".toml")) continue;
786
- const content = await readTextIfExists(join6(agentsDir, entry.name));
787
- if (content === null) continue;
940
+ if (!entry.name.endsWith(".toml"))
941
+ continue;
942
+ const content = await readTextIfExists2(join9(agentsDir, entry.name));
943
+ if (content === null)
944
+ continue;
788
945
  const effort = extractReasoningEffort(content);
789
- if (effort !== null) preserved.set(agentNameFromToml(entry.name), effort);
946
+ if (effort !== null)
947
+ preserved.set(agentNameFromToml(entry.name), effort);
790
948
  }
791
949
  return preserved;
792
950
  }
793
- async function capturePreservedAgentServiceTier({ codexHome }) {
794
- const agentsDir = join6(codexHome, "agents");
795
- if (!await exists(agentsDir)) return /* @__PURE__ */ new Map();
796
- const preserved = /* @__PURE__ */ new Map();
951
+ async function capturePreservedAgentServiceTier(input) {
952
+ const agentsDir = join9(input.codexHome, "agents");
953
+ if (!await exists2(agentsDir))
954
+ return new Map;
955
+ const preserved = new Map;
797
956
  const agentEntries = await readdir(agentsDir, { withFileTypes: true });
798
957
  for (const entry of agentEntries) {
799
- if (!entry.name.endsWith(".toml")) continue;
800
- const content = await readTextIfExists(join6(agentsDir, entry.name));
801
- if (content === null) continue;
802
- preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
958
+ if (!entry.name.endsWith(".toml"))
959
+ continue;
960
+ const content = await readTextIfExists2(join9(agentsDir, entry.name));
961
+ if (content === null)
962
+ continue;
963
+ preserved.set(agentNameFromToml(entry.name), extractServiceTier(content));
803
964
  }
804
965
  return preserved;
805
966
  }
806
- async function linkCachedPluginAgents({ codexHome, pluginRoot, preservedReasoning = /* @__PURE__ */ new Map(), preservedServiceTier = /* @__PURE__ */ new Map() }) {
807
- const bundledAgents = await discoverBundledAgents(pluginRoot);
967
+ async function linkCachedPluginAgents(input) {
968
+ const bundledAgents = await discoverBundledAgents(input.pluginRoot);
969
+ await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
808
970
  if (bundledAgents.length === 0) {
809
- await writeManifest(pluginRoot, []);
971
+ await writeManifest(input.pluginRoot, []);
810
972
  return [];
811
973
  }
812
- const agentsDir = join6(codexHome, "agents");
974
+ const agentsDir = join9(input.codexHome, "agents");
813
975
  await mkdir4(agentsDir, { recursive: true });
814
976
  const linked = [];
815
977
  for (const agentPath of bundledAgents) {
816
978
  const agentFileName = basename3(agentPath);
817
979
  const agentName = agentNameFromToml(agentFileName);
818
- const linkPath = join6(agentsDir, agentFileName);
980
+ const linkPath = join9(agentsDir, agentFileName);
819
981
  await replaceWithCopy(linkPath, agentPath);
820
- await restorePreservedReasoning({ linkPath, target: agentPath, value: preservedReasoning.get(agentName) });
982
+ await restorePreservedReasoning({
983
+ agentName,
984
+ linkPath,
985
+ target: agentPath,
986
+ value: input.preservedReasoning?.get(agentName)
987
+ });
821
988
  await restorePreservedServiceTier({
822
989
  linkPath,
823
- preserved: preservedServiceTier.has(agentName),
824
- value: preservedServiceTier.get(agentName) ?? null
990
+ preserved: input.preservedServiceTier?.has(agentName) ?? false,
991
+ value: input.preservedServiceTier?.get(agentName) ?? null
825
992
  });
826
993
  linked.push({ name: agentFileName, path: linkPath, target: agentPath });
827
994
  }
828
- await writeManifest(pluginRoot, linked.map((entry) => entry.path));
995
+ await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
829
996
  return linked;
830
997
  }
831
- async function restorePreservedServiceTier({ linkPath, preserved, value }) {
832
- if (!preserved) return;
833
- const content = await readFile5(linkPath, "utf8");
834
- if (extractServiceTier(content) === value) return;
835
- const replacement = replaceServiceTier(content, value);
836
- if (!replacement.replaced) return;
837
- await writeFile3(linkPath, replacement.content);
998
+ async function restorePreservedServiceTier(input) {
999
+ if (!input.preserved)
1000
+ return;
1001
+ const content = await readFile5(input.linkPath, "utf8");
1002
+ if (extractServiceTier(content) === input.value)
1003
+ return;
1004
+ const replacement = replaceServiceTier(content, input.value);
1005
+ if (!replacement.replaced)
1006
+ return;
1007
+ await writeFile3(input.linkPath, replacement.content);
838
1008
  }
839
1009
  async function discoverBundledAgents(pluginRoot) {
840
- const componentsRoot = join6(pluginRoot, "components");
841
- if (!await exists(componentsRoot)) return [];
1010
+ const componentsRoot = join9(pluginRoot, "components");
1011
+ if (!await exists2(componentsRoot))
1012
+ return [];
842
1013
  const componentEntries = await readdir(componentsRoot, { withFileTypes: true });
843
1014
  const agents = [];
844
1015
  for (const entry of componentEntries) {
845
- if (!entry.isDirectory()) continue;
846
- const agentsRoot = join6(componentsRoot, entry.name, "agents");
847
- if (!await exists(agentsRoot)) continue;
1016
+ if (!entry.isDirectory())
1017
+ continue;
1018
+ const agentsRoot = join9(componentsRoot, entry.name, "agents");
1019
+ if (!await exists2(agentsRoot))
1020
+ continue;
848
1021
  const agentEntries = await readdir(agentsRoot, { withFileTypes: true });
849
1022
  for (const file of agentEntries) {
850
- if (!file.isFile() || !file.name.endsWith(".toml")) continue;
851
- agents.push(join6(agentsRoot, file.name));
1023
+ if (!file.isFile() || !file.name.endsWith(".toml"))
1024
+ continue;
1025
+ agents.push(join9(agentsRoot, file.name));
852
1026
  }
853
1027
  }
854
1028
  agents.sort();
@@ -859,35 +1033,38 @@ async function replaceWithCopy(linkPath, target) {
859
1033
  await copyFile(target, linkPath);
860
1034
  }
861
1035
  async function prepareReplacement(linkPath) {
862
- if (!await lstatExists(linkPath)) return;
863
- const entryStat = await lstat(linkPath);
1036
+ if (!await exists2(linkPath))
1037
+ return;
1038
+ const entryStat = await lstat2(linkPath);
864
1039
  if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
865
1040
  throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
866
1041
  }
867
- await rm4(linkPath, { force: true });
1042
+ await rm6(linkPath, { force: true });
868
1043
  }
869
1044
  async function writeManifest(pluginRoot, agentPaths) {
870
- const manifestPath = join6(pluginRoot, MANIFEST_FILE);
1045
+ const manifestPath = join9(pluginRoot, MANIFEST_FILE);
871
1046
  const payload = { agents: [...agentPaths].sort() };
872
- await writeFile3(manifestPath, `${JSON.stringify(payload, null, " ")}
1047
+ await writeFile3(manifestPath, `${JSON.stringify(payload, null, "\t")}
873
1048
  `);
874
1049
  }
875
- async function restorePreservedReasoning({ linkPath, target, value }) {
876
- if (value === void 0) return;
877
- const content = await readFile5(target, "utf8");
878
- if (extractReasoningEffort(content) === value) return;
879
- const replacement = replaceReasoningEffort(content, value);
880
- if (!replacement.replaced) return;
881
- if (await lstatExists(linkPath)) {
882
- await rm4(linkPath, { force: true });
883
- }
884
- await writeFile3(linkPath, replacement.content);
1050
+ async function restorePreservedReasoning(input) {
1051
+ if (input.value === undefined)
1052
+ return;
1053
+ const content = await readFile5(input.target, "utf8");
1054
+ const bundledEffort = extractReasoningEffort(content);
1055
+ if (bundledEffort === input.value)
1056
+ return;
1057
+ const replacement = replaceReasoningEffort(content, input.value);
1058
+ if (!replacement.replaced)
1059
+ return;
1060
+ await writeFile3(input.linkPath, replacement.content);
885
1061
  }
886
- async function readTextIfExists(path) {
1062
+ async function readTextIfExists2(path) {
887
1063
  try {
888
1064
  return await readFile5(path, "utf8");
889
1065
  } catch (error) {
890
- if (nodeErrorCode(error) === "ENOENT") return null;
1066
+ if (nodeErrorCode2(error) === "ENOENT")
1067
+ return null;
891
1068
  throw error;
892
1069
  }
893
1070
  }
@@ -899,10 +1076,14 @@ function extractServiceTier(content) {
899
1076
  }
900
1077
  function extractTopLevelStringSetting(content, key) {
901
1078
  for (const line of content.split(/\n/)) {
902
- if (isSectionHeader(line)) return null;
1079
+ if (isSectionHeader(line))
1080
+ return null;
903
1081
  const rawValue = topLevelStringSettingRawValue(line, key);
904
- if (rawValue === void 0) continue;
905
- return JSON.parse(rawValue);
1082
+ if (rawValue === undefined)
1083
+ continue;
1084
+ const parsed = parseJsonString(rawValue);
1085
+ if (parsed !== null)
1086
+ return parsed;
906
1087
  }
907
1088
  return null;
908
1089
  }
@@ -913,33 +1094,36 @@ function replaceServiceTier(content, value) {
913
1094
  return replaceTopLevelStringSetting(content, "service_tier", value, { insertIfMissing: true });
914
1095
  }
915
1096
  function replaceTopLevelStringSetting(content, key, value, options) {
916
- let replaced = false;
917
1097
  const lines = content.split(/\n/);
918
- for (let index = 0; index < lines.length; index += 1) {
1098
+ for (let index = 0;index < lines.length; index += 1) {
919
1099
  const line = lines[index];
920
- if (isSectionHeader(line)) break;
921
- if (topLevelStringSettingRawValue(line, key) === void 0) continue;
1100
+ if (line === undefined || isSectionHeader(line))
1101
+ break;
1102
+ if (topLevelStringSettingRawValue(line, key) === undefined)
1103
+ continue;
922
1104
  if (value === null) {
923
1105
  lines.splice(index, 1);
924
- replaced = true;
925
- break;
1106
+ return { content: lines.join(`
1107
+ `), replaced: true };
926
1108
  }
927
1109
  lines[index] = line.replace(/=\s*"(?:[^"\\]|\\.)*"/, `= ${JSON.stringify(value)}`);
928
- replaced = true;
929
- break;
1110
+ return { content: lines.join(`
1111
+ `), replaced: true };
930
1112
  }
931
- if (!replaced && value !== null && options.insertIfMissing) {
932
- lines.splice(topLevelInsertionIndex(lines), 0, `${key} = ${JSON.stringify(value)}`);
933
- replaced = true;
934
- }
935
- return { content: lines.join("\n"), replaced };
1113
+ if (value === null || !options.insertIfMissing)
1114
+ return { content, replaced: false };
1115
+ lines.splice(topLevelInsertionIndex(lines), 0, `${key} = ${JSON.stringify(value)}`);
1116
+ return { content: lines.join(`
1117
+ `), replaced: true };
936
1118
  }
937
1119
  function topLevelStringSettingRawValue(line, key) {
938
1120
  const match = line.match(/^\s*([A-Za-z0-9_]+)\s*=\s*("(?:[^"\\]|\\.)*")/);
939
- if (match === null) return void 0;
1121
+ if (match === null)
1122
+ return;
940
1123
  const settingKey = match[1];
941
1124
  const rawValue = match[2];
942
- if (settingKey !== key || rawValue === void 0) return void 0;
1125
+ if (settingKey !== key || rawValue === undefined)
1126
+ return;
943
1127
  return rawValue;
944
1128
  }
945
1129
  function topLevelInsertionIndex(lines) {
@@ -958,49 +1142,61 @@ function isSectionHeader(line) {
958
1142
  function agentNameFromToml(fileName) {
959
1143
  return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
960
1144
  }
961
- async function lstatExists(path) {
1145
+ function parseJsonString(value) {
962
1146
  try {
963
- await lstat(path);
1147
+ const parsed = JSON.parse(value);
1148
+ return typeof parsed === "string" ? parsed : null;
1149
+ } catch (error) {
1150
+ if (error instanceof Error)
1151
+ return null;
1152
+ return null;
1153
+ }
1154
+ }
1155
+ async function exists2(path) {
1156
+ try {
1157
+ await lstat2(path);
964
1158
  return true;
965
1159
  } catch (error) {
966
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
967
- throw error;
1160
+ if (nodeErrorCode2(error) !== "ENOENT")
1161
+ throw error;
1162
+ return false;
968
1163
  }
969
1164
  }
970
- function nodeErrorCode(error) {
971
- if (!(error instanceof Error) || !("code" in error)) return null;
1165
+ function nodeErrorCode2(error) {
1166
+ if (!(error instanceof Error) || !("code" in error))
1167
+ return null;
972
1168
  return typeof error.code === "string" ? error.code : null;
973
1169
  }
974
1170
 
975
- // ../../../scripts/install/bin-dir.mjs
976
- import { homedir as homedir3 } from "node:os";
977
- import { join as join7, resolve as resolve2 } from "node:path";
978
- function resolveCodexInstallerBinDir(options = {}) {
979
- const homeDir = resolve2(options.homeDir ?? homedir3());
980
- const env = options.env ?? process.env;
981
- const explicitBinDir = nonEmptyEnvValue(env, "CODEX_LOCAL_BIN_DIR");
982
- if (explicitBinDir !== void 0) return explicitBinDir;
983
- const codexHome = resolve2(options.codexHome ?? nonEmptyEnvValue(env, "CODEX_HOME") ?? join7(homeDir, ".codex"));
984
- const defaultCodexHome = resolve2(join7(homeDir, ".codex"));
985
- return codexHome === defaultCodexHome ? join7(homeDir, ".local", "bin") : join7(codexHome, "bin");
986
- }
987
- function nonEmptyEnvValue(env, key) {
988
- const value = env[key];
989
- if (typeof value !== "string") return void 0;
990
- const trimmed = value.trim();
991
- return trimmed.length === 0 ? void 0 : trimmed;
992
- }
993
-
994
- // ../../../scripts/install/bin-links.mjs
995
- import { chmod as chmod2, lstat as lstat3, mkdir as mkdir5, readFile as readFile7, readdir as readdir2, readlink as readlink2, rm as rm6, stat as stat3, symlink, writeFile as writeFile4 } from "node:fs/promises";
996
- import { basename as basename4, join as join9, relative, resolve as resolve3 } from "node:path";
1171
+ // ../src/install/codex-cache-bins.ts
1172
+ import { chmod as chmod2, lstat as lstat5, mkdir as mkdir5, readFile as readFile7, readdir as readdir2, readlink as readlink2, rm as rm8, stat as stat3, symlink, writeFile as writeFile4 } from "node:fs/promises";
1173
+ import { basename as basename4, isAbsolute as isAbsolute2, join as join12, relative as relative2, resolve as resolve3, sep } from "node:path";
997
1174
 
998
- // ../../../scripts/install/command-shim.mjs
1175
+ // ../src/install/codex-cache-command-shim.ts
999
1176
  var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
1000
1177
 
1001
- // ../../../scripts/install/legacy-bins.mjs
1002
- import { lstat as lstat2, readFile as readFile6, readlink, rm as rm5 } from "node:fs/promises";
1003
- import { join as join8 } from "node:path";
1178
+ // ../src/install/codex-cache-fs.ts
1179
+ import { lstat as lstat3 } from "node:fs/promises";
1180
+ async function fileExistsStrict(path) {
1181
+ try {
1182
+ await lstat3(path);
1183
+ return true;
1184
+ } catch (error) {
1185
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1186
+ return false;
1187
+ throw error;
1188
+ }
1189
+ }
1190
+ function isPlainRecord(value) {
1191
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1192
+ }
1193
+ function isNodeErrorWithCode(error) {
1194
+ return typeof error === "object" && error !== null && "code" in error;
1195
+ }
1196
+
1197
+ // ../src/install/codex-cache-legacy-bins.ts
1198
+ import { lstat as lstat4, readFile as readFile6, readlink, rm as rm7 } from "node:fs/promises";
1199
+ import { join as join10 } from "node:path";
1004
1200
  var LEGACY_CODEX_COMPONENT_BINS = [
1005
1201
  { name: "omo", component: "ulw-loop" },
1006
1202
  { name: "codex-comment-checker", component: "comment-checker" },
@@ -1012,24 +1208,29 @@ var LEGACY_CODEX_COMPONENT_BINS = [
1012
1208
  ];
1013
1209
  async function removeLegacyCodexComponentBins(binDir, platform) {
1014
1210
  for (const entry of LEGACY_CODEX_COMPONENT_BINS) {
1015
- const linkPath = join8(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
1211
+ const linkPath = join10(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
1016
1212
  await removeLegacyCodexComponentBin(linkPath, entry.component, platform);
1017
1213
  }
1018
1214
  }
1019
1215
  async function removeLegacyCodexComponentBin(linkPath, component, platform) {
1020
1216
  try {
1021
- const stat6 = await lstat2(linkPath);
1217
+ const stat3 = await lstat4(linkPath);
1022
1218
  if (platform !== "win32") {
1023
- if (!stat6.isSymbolicLink()) return;
1219
+ if (!stat3.isSymbolicLink())
1220
+ return;
1024
1221
  const target = await readlink(linkPath);
1025
- if (isManagedLegacyComponentTarget(target, component)) await rm5(linkPath, { force: true });
1222
+ if (isManagedLegacyComponentTarget(target, component))
1223
+ await rm7(linkPath, { force: true });
1026
1224
  return;
1027
1225
  }
1028
- if (!stat6.isFile()) return;
1226
+ if (!stat3.isFile())
1227
+ return;
1029
1228
  const content = await readFile6(linkPath, "utf8");
1030
- if (content.includes(COMMAND_SHIM_MARKER)) await rm5(linkPath, { force: true });
1229
+ if (content.includes(COMMAND_SHIM_MARKER))
1230
+ await rm7(linkPath, { force: true });
1031
1231
  } catch (error) {
1032
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return;
1232
+ if (isNodeErrorWithCode2(error) && error.code === "ENOENT")
1233
+ return;
1033
1234
  throw error;
1034
1235
  }
1035
1236
  }
@@ -1040,54 +1241,152 @@ function isManagedLegacyComponentTarget(target, component) {
1040
1241
  return suffix[0] === "components" && suffix[1] === component && suffix[2] === "dist" && suffix[3] === "cli.js" && (hasPluginCachePrefix(parts, suffixStart) || hasOmoCodexPluginPrefix(parts, suffixStart));
1041
1242
  }
1042
1243
  function hasPluginCachePrefix(parts, endExclusive) {
1043
- for (let index = 0; index < endExclusive - 1; index += 1) {
1044
- if (parts[index] === "plugins" && parts[index + 1] === "cache") return true;
1244
+ for (let index = 0;index < endExclusive - 1; index += 1) {
1245
+ if (parts[index] === "plugins" && parts[index + 1] === "cache")
1246
+ return true;
1045
1247
  }
1046
1248
  return false;
1047
1249
  }
1048
1250
  function hasOmoCodexPluginPrefix(parts, endExclusive) {
1049
- for (let index = 0; index <= endExclusive - 3; index += 1) {
1050
- if (parts[index] === "packages" && parts[index + 1] === "omo-codex" && parts[index + 2] === "plugin") return true;
1251
+ for (let index = 0;index <= endExclusive - 3; index += 1) {
1252
+ if (parts[index] === "packages" && parts[index + 1] === "omo-codex" && parts[index + 2] === "plugin")
1253
+ return true;
1051
1254
  }
1052
1255
  return false;
1053
1256
  }
1257
+ function isNodeErrorWithCode2(error) {
1258
+ return typeof error === "object" && error !== null && "code" in error;
1259
+ }
1054
1260
 
1055
- // ../../../scripts/install/bin-links.mjs
1056
- var RESERVED_NESTED_BIN_NAMES = /* @__PURE__ */ new Set(["omo", "lazycodex", "lazycodex-ai", "oh-my-opencode", "oh-my-openagent"]);
1261
+ // ../src/install/codex-cache-runtime-wrapper.ts
1262
+ import { join as join11 } from "node:path";
1057
1263
  var RUNTIME_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
1058
- async function linkCachedPluginBins({ binDir, pluginRoot, platform = process.platform }) {
1059
- const binLinks = await discoverPackageBins(pluginRoot);
1060
- await mkdir5(binDir, { recursive: true });
1061
- await removeLegacyCodexComponentBins(binDir, platform);
1264
+ function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
1265
+ const ulwLoopBin = toPosixPath(join11(binDir, "omo-ulw-loop"));
1266
+ const nodeCli = escapePosixDoubleQuoted(toPosixPath(nodeCliPath));
1267
+ const escapedCliPath = escapePosixDoubleQuoted(toPosixPath(cliPath));
1268
+ const escapedCodexHome = escapePosixDoubleQuoted(toPosixPath(codexHome));
1269
+ const escapedUlwLoopBin = escapePosixDoubleQuoted(ulwLoopBin);
1270
+ return [
1271
+ "#!/bin/sh",
1272
+ `# ${RUNTIME_WRAPPER_MARKER}`,
1273
+ `export CODEX_HOME="\${CODEX_HOME:-${escapedCodexHome}}"`,
1274
+ 'export OMO_SPARKSHELL_APP_SERVER_SOCKET="${OMO_SPARKSHELL_APP_SERVER_SOCKET:-$CODEX_HOME/app-server-control/app-server-control.sock}"',
1275
+ 'if [ "$1" = "ulw-loop" ] && [ -x "' + escapedUlwLoopBin + '" ]; then',
1276
+ " shift",
1277
+ ' exec "' + escapedUlwLoopBin + '" "$@"',
1278
+ "fi",
1279
+ `if [ "\${OMO_RUNTIME:-}" = "node" ] && [ -f "${nodeCli}" ]; then`,
1280
+ ` exec node "${nodeCli}" "$@"`,
1281
+ "fi",
1282
+ 'BUN_BINARY="${BUN_BINARY:-}"',
1283
+ 'if [ -z "$BUN_BINARY" ] && command -v bun >/dev/null 2>&1; then',
1284
+ " BUN_BINARY=bun",
1285
+ "fi",
1286
+ 'if [ -z "$BUN_BINARY" ]; then',
1287
+ ' for omo_bun_candidate in "$HOME/.bun/bin/bun" /opt/homebrew/bin/bun /usr/local/bin/bun; do',
1288
+ ' if [ -x "$omo_bun_candidate" ]; then',
1289
+ ' BUN_BINARY="$omo_bun_candidate"',
1290
+ " break",
1291
+ " fi",
1292
+ " done",
1293
+ "fi",
1294
+ 'if [ -z "$BUN_BINARY" ]; then',
1295
+ ` if [ -f "${nodeCli}" ] && command -v node >/dev/null 2>&1; then`,
1296
+ ` exec node "${nodeCli}" "$@"`,
1297
+ " fi",
1298
+ ` echo "omo: bun runtime not found (checked PATH, ~/.bun/bin, /opt/homebrew/bin, /usr/local/bin) and the node fallback CLI is missing at ${nodeCli}; install bun from https://bun.sh, or reinstall omo and force the fallback with OMO_RUNTIME=node" >&2`,
1299
+ " exit 127",
1300
+ "fi",
1301
+ `if [ ! -f "${escapedCliPath}" ]; then`,
1302
+ ` echo "omo: runtime target missing at ${escapedCliPath}; reinstall with: npx --yes lazycodex-ai@latest install --no-tui" >&2`,
1303
+ " exit 1",
1304
+ "fi",
1305
+ `exec "$BUN_BINARY" "${escapedCliPath}" "$@"`,
1306
+ ""
1307
+ ].join(`
1308
+ `);
1309
+ }
1310
+ function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
1311
+ const ulwLoopBin = join11(binDir, "omo-ulw-loop.cmd");
1312
+ return [
1313
+ "@echo off",
1314
+ `rem ${RUNTIME_WRAPPER_MARKER}`,
1315
+ `if not defined CODEX_HOME set "CODEX_HOME=${codexHome}"`,
1316
+ 'if not defined OMO_SPARKSHELL_APP_SERVER_SOCKET set "OMO_SPARKSHELL_APP_SERVER_SOCKET=%CODEX_HOME%\\app-server-control\\app-server-control.sock"',
1317
+ `if "%~1"=="ulw-loop" if exist "${ulwLoopBin}" (`,
1318
+ " shift /1",
1319
+ ` "${ulwLoopBin}" %*`,
1320
+ " exit /b %ERRORLEVEL%",
1321
+ ")",
1322
+ `if "%OMO_RUNTIME%"=="node" if exist "${nodeCliPath}" (`,
1323
+ ` node "${nodeCliPath}" %*`,
1324
+ " exit /b %ERRORLEVEL%",
1325
+ ")",
1326
+ 'if not defined BUN_BINARY where bun >nul 2>nul && set "BUN_BINARY=bun"',
1327
+ 'if not defined BUN_BINARY if exist "%USERPROFILE%\\.bun\\bin\\bun.exe" set "BUN_BINARY=%USERPROFILE%\\.bun\\bin\\bun.exe"',
1328
+ "if not defined BUN_BINARY (",
1329
+ ` if exist "${nodeCliPath}" (`,
1330
+ ` node "${nodeCliPath}" %*`,
1331
+ " exit /b %ERRORLEVEL%",
1332
+ " )",
1333
+ ` echo omo: bun runtime not found and the node fallback CLI is missing at ${nodeCliPath}; install bun from https://bun.sh or reinstall omo and force OMO_RUNTIME=node 1>&2`,
1334
+ " exit /b 127",
1335
+ ")",
1336
+ `if not exist "${cliPath}" (`,
1337
+ ` echo omo: runtime target missing at ${cliPath}; reinstall with: npx --yes lazycodex-ai@latest install --no-tui 1>&2`,
1338
+ " exit /b 1",
1339
+ ")",
1340
+ `"%BUN_BINARY%" "${cliPath}" %*`,
1341
+ ""
1342
+ ].join(`\r
1343
+ `);
1344
+ }
1345
+ function toPosixPath(path) {
1346
+ return path.replaceAll("\\", "/");
1347
+ }
1348
+ function escapePosixDoubleQuoted(value) {
1349
+ return value.replaceAll("\\", "\\\\").replaceAll('"', "\\\"").replaceAll("$", "\\$").replaceAll("`", "\\`");
1350
+ }
1351
+
1352
+ // ../src/install/codex-cache-bins.ts
1353
+ var RESERVED_NESTED_BIN_NAMES = new Set(["omo", "lazycodex", "lazycodex-ai", "oh-my-opencode", "oh-my-openagent"]);
1354
+ async function linkCachedPluginBins(input) {
1355
+ const binLinks = await discoverPackageBins(input.pluginRoot);
1356
+ const platform = input.platform ?? process.platform;
1357
+ await mkdir5(input.binDir, { recursive: true });
1358
+ await removeLegacyCodexComponentBins(input.binDir, platform);
1062
1359
  const linked = [];
1063
1360
  for (const link of binLinks) {
1064
- const linkPath = await linkCachedPluginBin(binDir, link, platform);
1361
+ const linkPath = await linkCachedPluginBin(input.binDir, link, platform);
1065
1362
  linked.push({ name: link.name, path: linkPath, target: link.target });
1066
1363
  }
1067
1364
  return linked;
1068
1365
  }
1069
- async function linkRootRuntimeBin({ binDir, codexHome, repoRoot, platform = process.platform }) {
1070
- const cliPath = join9(repoRoot, "dist", "cli", "index.js");
1071
- if (!await isFile2(cliPath)) return null;
1072
- const nodeCliPath = join9(repoRoot, "dist", "cli-node", "index.js");
1073
- await mkdir5(binDir, { recursive: true });
1366
+ async function linkRootRuntimeBin(input) {
1367
+ const cliPath = join12(input.repoRoot, "dist", "cli", "index.js");
1368
+ if (!await isFile2(cliPath))
1369
+ return null;
1370
+ const nodeCliPath = join12(input.repoRoot, "dist", "cli-node", "index.js");
1371
+ const platform = input.platform ?? process.platform;
1372
+ await mkdir5(input.binDir, { recursive: true });
1074
1373
  if (platform === "win32") {
1075
- const linkPath2 = join9(binDir, "omo.cmd");
1076
- await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath));
1374
+ const linkPath2 = join12(input.binDir, "omo.cmd");
1375
+ await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
1077
1376
  return { name: "omo", path: linkPath2, target: cliPath };
1078
1377
  }
1079
- const linkPath = join9(binDir, "omo");
1080
- await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath));
1378
+ const linkPath = join12(input.binDir, "omo");
1379
+ await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
1081
1380
  await chmod2(linkPath, 493);
1082
1381
  return { name: "omo", path: linkPath, target: cliPath };
1083
1382
  }
1084
1383
  async function linkCachedPluginBin(binDir, link, platform) {
1085
1384
  if (platform === "win32") {
1086
- const linkPath2 = join9(binDir, `${link.name}.cmd`);
1385
+ const linkPath2 = join12(binDir, `${link.name}.cmd`);
1087
1386
  await replaceCommandShim(linkPath2, link.target);
1088
1387
  return linkPath2;
1089
1388
  }
1090
- const linkPath = join9(binDir, link.name);
1389
+ const linkPath = join12(binDir, link.name);
1091
1390
  await replaceSymlink(linkPath, link.target);
1092
1391
  return linkPath;
1093
1392
  }
@@ -1095,7 +1394,8 @@ async function isFile2(path) {
1095
1394
  try {
1096
1395
  return (await stat3(path)).isFile();
1097
1396
  } catch (error) {
1098
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
1397
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1398
+ return false;
1099
1399
  throw error;
1100
1400
  }
1101
1401
  }
@@ -1106,272 +1406,152 @@ async function discoverPackageBins(root) {
1106
1406
  }
1107
1407
  async function collectPackageBins(directory, root, links) {
1108
1408
  const entries = await readdir2(directory, { withFileTypes: true });
1109
- const packageJsonPath = join9(directory, "package.json");
1110
1409
  if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
1111
- await appendPackageBinLinks(packageJsonPath, directory, root, links);
1410
+ await appendPackageBinLinks(join12(directory, "package.json"), directory, root, links);
1112
1411
  }
1113
1412
  for (const entry of entries) {
1114
- if (!entry.isDirectory()) continue;
1115
- if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist") continue;
1116
- const childPath = join9(directory, entry.name);
1117
- if (!isPathInside(childPath, root)) continue;
1413
+ if (!entry.isDirectory())
1414
+ continue;
1415
+ if (entry.name === "node_modules" || entry.name === ".git" || entry.name === "dist")
1416
+ continue;
1417
+ const childPath = join12(directory, entry.name);
1418
+ if (!childPath.startsWith(root))
1419
+ continue;
1118
1420
  await collectPackageBins(childPath, root, links);
1119
1421
  }
1120
1422
  }
1121
1423
  async function appendPackageBinLinks(packageJsonPath, packageRoot, root, links) {
1122
1424
  const packageJson = JSON.parse(await readFile7(packageJsonPath, "utf8"));
1123
- if (!isRecord3(packageJson)) return;
1124
- const bin = packageJson.bin;
1125
- if (typeof bin === "string" && typeof packageJson.name === "string") {
1126
- const name = basename4(packageJson.name);
1425
+ if (!isPlainRecord(packageJson))
1426
+ return;
1427
+ const packageName = packageJson.name;
1428
+ const packageBin = packageJson.bin;
1429
+ if (typeof packageBin === "string" && typeof packageName === "string") {
1430
+ const name = assertSafeCommandName(basename4(packageName));
1127
1431
  if (!isReservedNestedBinName(name, packageRoot, root)) {
1128
- links.push(createPackageBinLink(name, bin, packageRoot));
1432
+ links.push({ name, target: resolvePackageBinTarget(packageRoot, packageBin) });
1129
1433
  }
1130
1434
  return;
1131
1435
  }
1132
- if (!isRecord3(bin)) return;
1133
- for (const [name, target] of Object.entries(bin)) {
1134
- if (typeof target !== "string") continue;
1135
- if (isReservedNestedBinName(name, packageRoot, root)) continue;
1136
- links.push(createPackageBinLink(name, target, packageRoot));
1137
- }
1138
- }
1139
- function createPackageBinLink(name, target, packageRoot) {
1140
- assertSafeBinName(name);
1141
- if (target.includes("\0")) {
1142
- throw new Error(`package bin target for ${name} contains a NUL byte`);
1143
- }
1144
- const resolvedTarget = resolve3(packageRoot, target);
1145
- if (!isPathInside(resolvedTarget, packageRoot)) {
1146
- throw new Error(`package bin target for ${name} escapes package root`);
1436
+ if (!isPlainRecord(packageBin))
1437
+ return;
1438
+ for (const [name, target] of Object.entries(packageBin)) {
1439
+ if (typeof target !== "string")
1440
+ continue;
1441
+ const commandName = assertSafeCommandName(name);
1442
+ if (isReservedNestedBinName(commandName, packageRoot, root))
1443
+ continue;
1444
+ links.push({ name: commandName, target: resolvePackageBinTarget(packageRoot, target) });
1147
1445
  }
1148
- return { name, target: resolvedTarget };
1149
1446
  }
1150
- function assertSafeBinName(name) {
1151
- if (name.length === 0 || name === "." || name === ".." || name.includes("\0") || name.includes("/") || name.includes("\\")) {
1152
- throw new Error(`invalid package bin name: ${name}`);
1447
+ function assertSafeCommandName(name) {
1448
+ if (name.length === 0 || name === "." || name === ".." || name.includes("/") || name.includes("\\") || name.includes("\x00")) {
1449
+ throw new Error(`Invalid package bin command name: ${name}`);
1153
1450
  }
1451
+ return name;
1154
1452
  }
1155
1453
  function isReservedNestedBinName(name, packageRoot, root) {
1156
1454
  return packageRoot !== root && RESERVED_NESTED_BIN_NAMES.has(name);
1157
1455
  }
1456
+ function resolvePackageBinTarget(packageRoot, target) {
1457
+ if (target.includes("\x00"))
1458
+ throw new Error("Package bin target must stay inside package root");
1459
+ const root = resolve3(packageRoot);
1460
+ const resolvedTarget = resolve3(root, target);
1461
+ const relativeTarget = relative2(root, resolvedTarget);
1462
+ if (relativeTarget === "" || relativeTarget !== ".." && !relativeTarget.startsWith(`..${sep}`) && !isAbsolute2(relativeTarget)) {
1463
+ return resolvedTarget;
1464
+ }
1465
+ throw new Error("Package bin target must stay inside package root");
1466
+ }
1158
1467
  async function replaceSymlink(linkPath, targetPath) {
1159
- if (await existingNonSymlink(linkPath)) {
1468
+ if (await existingNonSymlink(linkPath))
1160
1469
  throw new Error(`${linkPath} already exists and is not a symlink`);
1161
- }
1162
- await rm6(linkPath, { force: true });
1470
+ await rm8(linkPath, { force: true });
1163
1471
  await symlink(targetPath, linkPath);
1164
1472
  }
1165
1473
  async function replaceCommandShim(linkPath, targetPath) {
1166
- if (await existingNonShim(linkPath)) {
1474
+ if (await existingNonShim(linkPath))
1167
1475
  throw new Error(`${linkPath} already exists and is not a command shim`);
1168
- }
1169
1476
  await writeFile4(linkPath, `@echo off\r
1170
1477
  ${COMMAND_SHIM_MARKER}\r
1171
1478
  node "${targetPath}" %*\r
1172
1479
  `);
1173
1480
  }
1174
1481
  async function replaceRuntimeWrapper(linkPath, content) {
1175
- if (await existingNonRuntimeWrapper(linkPath)) {
1482
+ if (await existingNonRuntimeWrapper(linkPath))
1176
1483
  throw new Error(`${linkPath} already exists and is not a generated OMO runtime wrapper`);
1177
- }
1178
- await rm6(linkPath, { force: true });
1484
+ await rm8(linkPath, { force: true });
1179
1485
  await writeFile4(linkPath, content);
1180
1486
  }
1181
1487
  async function existingNonRuntimeWrapper(path) {
1182
1488
  try {
1183
- const stat6 = await lstat3(path);
1184
- if (stat6.isSymbolicLink()) return false;
1185
- if (!stat6.isFile()) return true;
1489
+ const stat4 = await lstat5(path);
1490
+ if (stat4.isSymbolicLink())
1491
+ return false;
1492
+ if (!stat4.isFile())
1493
+ return true;
1186
1494
  const content = await readFile7(path, "utf8");
1187
1495
  return !content.includes(RUNTIME_WRAPPER_MARKER);
1188
1496
  } catch (error) {
1189
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
1497
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1498
+ return false;
1190
1499
  throw error;
1191
1500
  }
1192
1501
  }
1193
- function posixRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
1194
- const ulwLoopBin = join9(binDir, "omo-ulw-loop");
1195
- const nodeCli = escapePosixDoubleQuoted(nodeCliPath);
1196
- return [
1197
- "#!/bin/sh",
1198
- `# ${RUNTIME_WRAPPER_MARKER}`,
1199
- `export CODEX_HOME="\${CODEX_HOME:-${escapePosixDoubleQuoted(codexHome)}}"`,
1200
- 'export OMO_SPARKSHELL_APP_SERVER_SOCKET="${OMO_SPARKSHELL_APP_SERVER_SOCKET:-$CODEX_HOME/app-server-control/app-server-control.sock}"',
1201
- 'if [ "$1" = "ulw-loop" ] && [ -x "' + escapePosixDoubleQuoted(ulwLoopBin) + '" ]; then',
1202
- " shift",
1203
- ' exec "' + escapePosixDoubleQuoted(ulwLoopBin) + '" "$@"',
1204
- "fi",
1205
- `if [ "\${OMO_RUNTIME:-}" = "node" ] && [ -f "${nodeCli}" ]; then`,
1206
- ` exec node "${nodeCli}" "$@"`,
1207
- "fi",
1208
- 'BUN_BINARY="${BUN_BINARY:-}"',
1209
- 'if [ -z "$BUN_BINARY" ] && command -v bun >/dev/null 2>&1; then',
1210
- " BUN_BINARY=bun",
1211
- "fi",
1212
- 'if [ -z "$BUN_BINARY" ]; then',
1213
- ' for omo_bun_candidate in "$HOME/.bun/bin/bun" /opt/homebrew/bin/bun /usr/local/bin/bun; do',
1214
- ' if [ -x "$omo_bun_candidate" ]; then',
1215
- ' BUN_BINARY="$omo_bun_candidate"',
1216
- " break",
1217
- " fi",
1218
- " done",
1219
- "fi",
1220
- 'if [ -z "$BUN_BINARY" ]; then',
1221
- ` if [ -f "${nodeCli}" ] && command -v node >/dev/null 2>&1; then`,
1222
- ` exec node "${nodeCli}" "$@"`,
1223
- " fi",
1224
- ` echo "omo: bun runtime not found (checked PATH, ~/.bun/bin, /opt/homebrew/bin, /usr/local/bin) and the node fallback CLI is missing at ${nodeCli}; install bun from https://bun.sh, or reinstall omo and force the fallback with OMO_RUNTIME=node" >&2`,
1225
- " exit 127",
1226
- "fi",
1227
- `exec "$BUN_BINARY" "${escapePosixDoubleQuoted(cliPath)}" "$@"`,
1228
- ""
1229
- ].join("\n");
1230
- }
1231
- function windowsRuntimeWrapper(cliPath, codexHome, binDir, nodeCliPath) {
1232
- const ulwLoopBin = join9(binDir, "omo-ulw-loop.cmd");
1233
- return [
1234
- "@echo off",
1235
- `rem ${RUNTIME_WRAPPER_MARKER}`,
1236
- `if not defined CODEX_HOME set "CODEX_HOME=${codexHome}"`,
1237
- 'if not defined OMO_SPARKSHELL_APP_SERVER_SOCKET set "OMO_SPARKSHELL_APP_SERVER_SOCKET=%CODEX_HOME%\\app-server-control\\app-server-control.sock"',
1238
- `if "%~1"=="ulw-loop" if exist "${ulwLoopBin}" (`,
1239
- " shift /1",
1240
- ` "${ulwLoopBin}" %*`,
1241
- " exit /b %ERRORLEVEL%",
1242
- ")",
1243
- `if "%OMO_RUNTIME%"=="node" if exist "${nodeCliPath}" (`,
1244
- ` node "${nodeCliPath}" %*`,
1245
- " exit /b %ERRORLEVEL%",
1246
- ")",
1247
- 'if not defined BUN_BINARY where bun >nul 2>nul && set "BUN_BINARY=bun"',
1248
- 'if not defined BUN_BINARY if exist "%USERPROFILE%\\.bun\\bin\\bun.exe" set "BUN_BINARY=%USERPROFILE%\\.bun\\bin\\bun.exe"',
1249
- "if not defined BUN_BINARY (",
1250
- ` if exist "${nodeCliPath}" (`,
1251
- ` node "${nodeCliPath}" %*`,
1252
- " exit /b %ERRORLEVEL%",
1253
- " )",
1254
- ` echo omo: bun runtime not found and the node fallback CLI is missing at ${nodeCliPath}; install bun from https://bun.sh or reinstall omo and force OMO_RUNTIME=node 1>&2`,
1255
- " exit /b 127",
1256
- ")",
1257
- `"%BUN_BINARY%" "${cliPath}" %*`,
1258
- ""
1259
- ].join("\r\n");
1260
- }
1261
- function escapePosixDoubleQuoted(value) {
1262
- return value.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replaceAll("$", "\\$").replaceAll("`", "\\`");
1263
- }
1264
1502
  async function existingNonShim(path) {
1265
1503
  try {
1266
- const stat6 = await lstat3(path);
1267
- if (!stat6.isFile()) return true;
1504
+ const stat4 = await lstat5(path);
1505
+ if (!stat4.isFile())
1506
+ return true;
1268
1507
  const content = await readFile7(path, "utf8");
1269
- if (content.includes(COMMAND_SHIM_MARKER)) return false;
1508
+ if (content.includes(COMMAND_SHIM_MARKER))
1509
+ return false;
1270
1510
  throw new Error(`${path} already exists and is not a generated command shim`);
1271
1511
  } catch (error) {
1272
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
1512
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1513
+ return false;
1273
1514
  throw error;
1274
1515
  }
1275
1516
  }
1276
1517
  async function existingNonSymlink(path) {
1277
1518
  try {
1278
- const stat6 = await lstat3(path);
1279
- if (!stat6.isSymbolicLink()) return true;
1519
+ const stat4 = await lstat5(path);
1520
+ if (!stat4.isSymbolicLink())
1521
+ return true;
1280
1522
  await readlink2(path);
1281
1523
  return false;
1282
1524
  } catch (error) {
1283
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return false;
1525
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1526
+ return false;
1284
1527
  throw error;
1285
1528
  }
1286
1529
  }
1287
- function isRecord3(value) {
1288
- return typeof value === "object" && value !== null && !Array.isArray(value);
1289
- }
1290
- function isPathInside(candidatePath, rootPath) {
1291
- const pathFromRoot = relative(rootPath, candidatePath);
1292
- return pathFromRoot === "" || !pathFromRoot.startsWith("..") && !pathFromRoot.startsWith(`..\\`) && !isDriveRelative(pathFromRoot);
1293
- }
1294
- function isDriveRelative(path) {
1295
- return /^[a-zA-Z]:/.test(path);
1296
- }
1297
1530
 
1298
- // ../../../scripts/install/config.mjs
1531
+ // ../src/install/codex-config-toml.ts
1299
1532
  import { mkdir as mkdir6, readFile as readFile9 } from "node:fs/promises";
1300
- import { dirname as dirname7 } from "node:path";
1301
-
1302
- // ../../../scripts/install/atomic-write.mjs
1303
- import { lstat as lstat4, readlink as readlink3, realpath, rename as rename3, unlink, writeFile as writeFile5 } from "node:fs/promises";
1304
- import { basename as basename5, dirname as dirname6, isAbsolute, join as join10, resolve as resolve4 } from "node:path";
1305
- var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
1306
- var RETRIABLE_RENAME_CODES = /* @__PURE__ */ new Set(["EPERM", "EBUSY"]);
1307
- function isRetriableRenameError(error) {
1308
- if (!(error instanceof Error)) return false;
1309
- return RETRIABLE_RENAME_CODES.has(Reflect.get(error, "code"));
1310
- }
1311
- async function writeFileAtomic(targetPath, data) {
1312
- const writeTarget = await resolveSymlinkTarget(targetPath);
1313
- const temporaryPath = join10(
1314
- dirname6(writeTarget),
1315
- `.tmp-${basename5(writeTarget)}-${process.pid}-${Date.now()}`
1316
- );
1317
- await writeFile5(temporaryPath, data);
1318
- try {
1319
- await renameWithRetry(temporaryPath, writeTarget);
1320
- } catch (renameError) {
1321
- await unlink(temporaryPath).catch(() => {
1322
- });
1323
- throw renameError;
1324
- }
1325
- }
1326
- async function resolveSymlinkTarget(targetPath) {
1327
- let linkStats;
1328
- try {
1329
- linkStats = await lstat4(targetPath);
1330
- } catch {
1331
- return targetPath;
1332
- }
1333
- if (!linkStats.isSymbolicLink()) return targetPath;
1334
- try {
1335
- return await realpath(targetPath);
1336
- } catch {
1337
- const linkValue = await readlink3(targetPath);
1338
- return isAbsolute(linkValue) ? linkValue : resolve4(dirname6(targetPath), linkValue);
1339
- }
1340
- }
1341
- async function renameWithRetry(fromPath, toPath) {
1342
- for (let attempt = 0; ; attempt += 1) {
1343
- try {
1344
- await rename3(fromPath, toPath);
1345
- return;
1346
- } catch (renameError) {
1347
- if (!isRetriableRenameError(renameError) || attempt >= RENAME_RETRY_DELAYS_MS.length) {
1348
- throw renameError;
1349
- }
1350
- await delay(RENAME_RETRY_DELAYS_MS[attempt]);
1351
- }
1352
- }
1353
- }
1354
- function delay(milliseconds) {
1355
- return new Promise((resolve6) => setTimeout(resolve6, milliseconds));
1356
- }
1533
+ import { dirname as dirname6 } from "node:path";
1357
1534
 
1358
- // ../../../scripts/install/toml-editor.mjs
1535
+ // ../src/install/toml-section-editor.ts
1359
1536
  function findTomlSection(config, header) {
1360
1537
  const headerLine = `[${header}]`;
1361
1538
  const lines = config.match(/[^\n]*\n?|$/g) ?? [];
1362
1539
  let offset = 0;
1363
1540
  let start = -1;
1364
1541
  for (const line of lines) {
1365
- if (line.length === 0) break;
1542
+ if (line.length === 0)
1543
+ break;
1366
1544
  const trimmed = line.trim();
1367
1545
  if (start === -1) {
1368
- if (trimmed === headerLine) start = offset;
1546
+ if (trimmed === headerLine)
1547
+ start = offset;
1369
1548
  } else if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
1370
1549
  return { start, end: offset, text: config.slice(start, offset) };
1371
1550
  }
1372
1551
  offset += line.length;
1373
1552
  }
1374
- if (start === -1) return null;
1553
+ if (start === -1)
1554
+ return null;
1375
1555
  return { start, end: config.length, text: config.slice(start) };
1376
1556
  }
1377
1557
  function replaceOrInsertSetting(config, section, key, value) {
@@ -1389,16 +1569,20 @@ function replaceOrInsertRootSetting(config, key, value) {
1389
1569
  const root = config.slice(0, sectionStart);
1390
1570
  const suffix = config.slice(sectionStart);
1391
1571
  const linePattern = new RegExp(`^${escapeRegExp(key)}\\s*=.*$`, "m");
1392
- const replacement = linePattern.test(root) ? root.replace(linePattern, `${key} = ${value}`) : `${root.trimEnd()}${root.trimEnd().length > 0 ? "\n" : ""}${key} = ${value}
1572
+ const replacement = linePattern.test(root) ? root.replace(linePattern, `${key} = ${value}`) : `${root.trimEnd()}${root.trimEnd().length > 0 ? `
1573
+ ` : ""}${key} = ${value}
1393
1574
  `;
1394
- if (suffix.length === 0) return replacement;
1575
+ if (suffix.length === 0)
1576
+ return replacement;
1395
1577
  return `${replacement.trimEnd()}
1396
1578
 
1397
1579
  ${suffix.trimStart()}`;
1398
1580
  }
1399
1581
  function appendBlock(config, block) {
1400
1582
  const prefix = config.trimEnd();
1401
- return `${prefix}${prefix.length > 0 ? "\n\n" : ""}${block.trimEnd()}
1583
+ return `${prefix}${prefix.length > 0 ? `
1584
+
1585
+ ` : ""}${block.trimEnd()}
1402
1586
  `;
1403
1587
  }
1404
1588
  function findFirstTableStart(config) {
@@ -1406,475 +1590,712 @@ function findFirstTableStart(config) {
1406
1590
  return match?.index ?? config.length;
1407
1591
  }
1408
1592
  function insertSetting(sectionText, key, value) {
1409
- const lines = sectionText.split("\n");
1593
+ const lines = sectionText.split(`
1594
+ `);
1410
1595
  lines.splice(1, 0, `${key} = ${value}`);
1411
- return lines.join("\n");
1596
+ return lines.join(`
1597
+ `);
1412
1598
  }
1413
1599
  function escapeRegExp(value) {
1414
1600
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1415
1601
  }
1416
1602
 
1417
- // ../../../scripts/install/multi-agent-v2-config.mjs
1418
- var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
1419
- var CODEX_MULTI_AGENT_V2_MAX_CONCURRENT_THREADS_PER_SESSION = 1e4;
1420
- function ensureCodexMultiAgentV2Config(config) {
1421
- const normalizedConfig = removeLegacyAgentsMaxThreadsSetting(removeFeatureFlagSetting(config, "multi_agent_v2"));
1422
- const section = findTomlSection(normalizedConfig, CODEX_MULTI_AGENT_V2_HEADER);
1423
- const maxThreadsValue = CODEX_MULTI_AGENT_V2_MAX_CONCURRENT_THREADS_PER_SESSION.toString();
1424
- if (!section) {
1425
- return appendBlock(
1426
- normalizedConfig,
1427
- `[${CODEX_MULTI_AGENT_V2_HEADER}]
1428
- max_concurrent_threads_per_session = ${maxThreadsValue}
1429
- hide_spawn_agent_metadata = false
1430
- `
1431
- );
1432
- }
1433
- const withMaxThreads = replaceOrInsertSetting(
1434
- normalizedConfig,
1435
- section,
1436
- "max_concurrent_threads_per_session",
1437
- maxThreadsValue
1438
- );
1439
- const updatedSection = findTomlSection(withMaxThreads, CODEX_MULTI_AGENT_V2_HEADER);
1440
- return replaceOrInsertSetting(withMaxThreads, updatedSection, "hide_spawn_agent_metadata", "false");
1603
+ // ../src/install/codex-config-toml-sections.ts
1604
+ function removeTomlSections(config, shouldRemove) {
1605
+ return splitTomlSections(config).filter((section) => section.header === null || !shouldRemove(section.header)).map((section) => section.text).join("").replace(/\n{3,}/g, `
1606
+
1607
+ `);
1441
1608
  }
1442
- function removeFeatureFlagSetting(config, featureName) {
1443
- const section = findTomlSection(config, "features");
1444
- if (!section) return config;
1445
- return removeSetting(config, section, featureName);
1609
+ function splitTomlSections(config) {
1610
+ const lines = config.match(/[^\n]*\n?|$/g) ?? [];
1611
+ const sections = [];
1612
+ let current = { header: null, text: "" };
1613
+ for (const line of lines) {
1614
+ if (line.length === 0)
1615
+ break;
1616
+ const header = parseTomlHeader2(line);
1617
+ if (header !== null) {
1618
+ if (current.text.length > 0)
1619
+ sections.push(current);
1620
+ current = { header, text: line };
1621
+ } else {
1622
+ current = { ...current, text: current.text + line };
1623
+ }
1624
+ }
1625
+ if (current.text.length > 0)
1626
+ sections.push(current);
1627
+ return sections;
1446
1628
  }
1447
- function removeLegacyAgentsMaxThreadsSetting(config) {
1448
- const section = findTomlSection(config, "agents");
1449
- if (!section) return config;
1450
- return removeSetting(config, section, "max_threads");
1629
+ function parsePluginHeaderKey(header) {
1630
+ const prefix = "plugins.";
1631
+ if (!header.startsWith(prefix))
1632
+ return null;
1633
+ return parseLeadingJsonString2(header.slice(prefix.length));
1451
1634
  }
1452
-
1453
- // ../../../scripts/install/model-catalog.mjs
1454
- import { readFile as readFile8 } from "node:fs/promises";
1455
- import { join as join11 } from "node:path";
1456
- var FALLBACK_CODEX_MODEL_CATALOG = {
1457
- current: {
1458
- model: "gpt-5.5",
1459
- modelContextWindow: 4e5,
1460
- modelReasoningEffort: "high",
1461
- planModeReasoningEffort: "xhigh"
1462
- },
1463
- managedProfiles: [
1464
- {
1465
- model: "gpt-5.5",
1466
- modelContextWindow: 1e6,
1467
- modelReasoningEffort: "high",
1468
- planModeReasoningEffort: "xhigh"
1469
- },
1470
- { model: "gpt-5.5", modelContextWindow: 272e3 }
1471
- ]
1472
- };
1473
- async function readCodexModelCatalog(codexPackageRoot) {
1635
+ function parseAgentHeaderName(header) {
1636
+ const prefix = "agents.";
1637
+ if (!header.startsWith(prefix))
1638
+ return null;
1639
+ const key = header.slice(prefix.length);
1640
+ return key.startsWith('"') ? parseLeadingJsonString2(key) : key;
1641
+ }
1642
+ function parseJsonString2(value) {
1474
1643
  try {
1475
- const parsed = JSON.parse(await readFile8(join11(codexPackageRoot, "plugin", "model-catalog.json"), "utf8"));
1476
- return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
1644
+ const parsed = JSON.parse(value);
1645
+ return typeof parsed === "string" ? parsed : null;
1477
1646
  } catch (error) {
1478
- if (!(error instanceof Error)) throw error;
1479
- return FALLBACK_CODEX_MODEL_CATALOG;
1647
+ if (error instanceof Error)
1648
+ return null;
1649
+ return null;
1480
1650
  }
1481
1651
  }
1482
- function parseCodexModelCatalog(value) {
1483
- if (!isRecord4(value) || !isRecord4(value.current) || !Array.isArray(value.managedProfiles)) return null;
1484
- const { current } = value;
1485
- if (typeof current.model !== "string" || typeof current.model_context_window !== "number" || typeof current.model_reasoning_effort !== "string" || typeof current.plan_mode_reasoning_effort !== "string") {
1652
+ function parseTomlHeader2(line) {
1653
+ const trimmed = line.trim();
1654
+ if (!trimmed.startsWith("[") || !trimmed.endsWith("]") || trimmed.startsWith("[["))
1486
1655
  return null;
1656
+ return trimmed.slice(1, -1);
1657
+ }
1658
+ function parseLeadingJsonString2(value) {
1659
+ if (!value.startsWith('"'))
1660
+ return parseJsonString2(value);
1661
+ let escaped = false;
1662
+ for (let index = 1;index < value.length; index += 1) {
1663
+ const char = value[index];
1664
+ if (escaped) {
1665
+ escaped = false;
1666
+ continue;
1667
+ }
1668
+ if (char === "\\") {
1669
+ escaped = true;
1670
+ continue;
1671
+ }
1672
+ if (char === '"')
1673
+ return parseJsonString2(value.slice(0, index + 1));
1487
1674
  }
1488
- const managedProfiles = [];
1489
- for (const profile of value.managedProfiles) {
1490
- if (!isRecord4(profile) || !isRecord4(profile.match)) return null;
1491
- managedProfiles.push(parseProfileMatch(profile.match));
1492
- }
1493
- return {
1494
- current: {
1495
- model: current.model,
1496
- modelContextWindow: current.model_context_window,
1497
- modelReasoningEffort: current.model_reasoning_effort,
1498
- planModeReasoningEffort: current.plan_mode_reasoning_effort
1499
- },
1500
- managedProfiles
1501
- };
1675
+ return null;
1502
1676
  }
1503
- function parseProfileMatch(match) {
1504
- const profile = {};
1505
- if (typeof match.model === "string") profile.model = match.model;
1506
- if (typeof match.model_context_window === "number") profile.modelContextWindow = match.model_context_window;
1507
- if (typeof match.model_reasoning_effort === "string") profile.modelReasoningEffort = match.model_reasoning_effort;
1508
- if (typeof match.plan_mode_reasoning_effort === "string") profile.planModeReasoningEffort = match.plan_mode_reasoning_effort;
1509
- return profile;
1677
+
1678
+ // ../src/install/codex-config-agents.ts
1679
+ var LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE = ["codex-ultrawork-reviewer"];
1680
+ var CURRENT_MANAGED_CODEX_AGENT_NAMES = [
1681
+ "explorer",
1682
+ "librarian",
1683
+ "metis",
1684
+ "momus",
1685
+ "plan"
1686
+ ];
1687
+ var MANAGED_CODEX_AGENT_NAMES = [
1688
+ ...LEGACY_MANAGED_CODEX_AGENT_NAMES_TO_PURGE,
1689
+ ...CURRENT_MANAGED_CODEX_AGENT_NAMES
1690
+ ];
1691
+ function removeStaleManagedAgentBlocks(config, keepAgentNames) {
1692
+ const managedAgentNames = new Set(MANAGED_CODEX_AGENT_NAMES);
1693
+ return splitTomlSections(config).filter((section) => {
1694
+ if (section.header === null)
1695
+ return true;
1696
+ const agentName = parseAgentHeaderName(section.header);
1697
+ if (agentName === null || !managedAgentNames.has(agentName) || keepAgentNames.has(agentName))
1698
+ return true;
1699
+ return !section.text.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`);
1700
+ }).map((section) => section.text).join("").replace(/\n{3,}/g, `
1701
+
1702
+ `);
1510
1703
  }
1511
- function isRecord4(value) {
1512
- return typeof value === "object" && value !== null && !Array.isArray(value);
1704
+ function ensureAgentConfig(config, agentConfig) {
1705
+ const header = `agents.${tomlKeySegment(agentConfig.name)}`;
1706
+ const section = findTomlSection(config, header);
1707
+ const configFile = JSON.stringify(agentConfig.configFile);
1708
+ if (!section)
1709
+ return appendBlock(config, `[${header}]
1710
+ config_file = ${configFile}
1711
+ `);
1712
+ return replaceOrInsertSetting(config, section, "config_file", configFile);
1713
+ }
1714
+ function tomlKeySegment(value) {
1715
+ return /^[A-Za-z0-9_-]+$/.test(value) ? value : JSON.stringify(value);
1513
1716
  }
1514
1717
 
1515
- // ../../../scripts/install/reasoning-config.mjs
1516
- var MANAGED_KEYS = ["model", "model_context_window", "model_reasoning_effort", "plan_mode_reasoning_effort"];
1517
- function ensureCodexReasoningConfig(config, catalog) {
1518
- const current = readRootReasoningSettings(config);
1519
- if (Object.keys(current).length > 0 && !matchesProfile(current, catalog.current) && !catalog.managedProfiles.some((profile) => matchesProfile(current, profile))) {
1520
- return config;
1718
+ // ../src/install/codex-config-atomic-write.ts
1719
+ import { lstat as lstat6, readlink as readlink3, realpath, rename as rename3, unlink, writeFile as writeFile5 } from "node:fs/promises";
1720
+ import { basename as basename5, dirname as dirname5, isAbsolute as isAbsolute3, join as join13, resolve as resolve4 } from "node:path";
1721
+ var RENAME_RETRY_DELAYS_MS = [10, 25, 50];
1722
+ var RETRIABLE_RENAME_CODES = new Set(["EPERM", "EBUSY"]);
1723
+ async function writeFileAtomic(targetPath, data) {
1724
+ const writeTarget = await resolveSymlinkTarget(targetPath);
1725
+ const temporaryPath = join13(dirname5(writeTarget), `.tmp-${basename5(writeTarget)}-${process.pid}-${Date.now()}`);
1726
+ await writeFile5(temporaryPath, data);
1727
+ try {
1728
+ await renameWithRetry(temporaryPath, writeTarget);
1729
+ } catch (error) {
1730
+ await unlink(temporaryPath).catch((unlinkError) => {
1731
+ if (unlinkError instanceof Error)
1732
+ return;
1733
+ return;
1734
+ });
1735
+ throw error;
1521
1736
  }
1522
- let next = replaceOrInsertRootSetting(config, "model", JSON.stringify(catalog.current.model));
1523
- next = replaceOrInsertRootSetting(next, "model_context_window", catalog.current.modelContextWindow.toString());
1524
- next = replaceOrInsertRootSetting(
1525
- next,
1526
- "model_reasoning_effort",
1527
- JSON.stringify(catalog.current.modelReasoningEffort)
1528
- );
1529
- next = replaceOrInsertRootSetting(next, "plan_mode_reasoning_effort", JSON.stringify(catalog.current.planModeReasoningEffort));
1530
- return next;
1531
1737
  }
1532
- function readRootReasoningSettings(config) {
1533
- const settings = {};
1534
- for (const line of config.split(/\n/)) {
1535
- if (isSectionHeader2(line)) break;
1536
- for (const key of MANAGED_KEYS) {
1537
- if (!isRootSetting(line, key)) continue;
1538
- const value = parseTomlScalar(line.slice(line.indexOf("=") + 1));
1539
- if (key === "model" && typeof value === "string") settings.model = value;
1540
- if (key === "model_context_window" && typeof value === "number") settings.modelContextWindow = value;
1541
- if (key === "model_reasoning_effort" && typeof value === "string") settings.modelReasoningEffort = value;
1542
- if (key === "plan_mode_reasoning_effort" && typeof value === "string") settings.planModeReasoningEffort = value;
1543
- }
1738
+ async function resolveSymlinkTarget(targetPath) {
1739
+ try {
1740
+ const linkStats = await lstat6(targetPath);
1741
+ if (!linkStats.isSymbolicLink())
1742
+ return targetPath;
1743
+ } catch (error) {
1744
+ if (error instanceof Error)
1745
+ return targetPath;
1746
+ return targetPath;
1544
1747
  }
1545
- return settings;
1546
- }
1547
- function matchesProfile(current, profile) {
1548
- for (const [key, value] of Object.entries(profile)) {
1549
- if (current[key] !== value) return false;
1748
+ try {
1749
+ return await realpath(targetPath);
1750
+ } catch (error) {
1751
+ if (!(error instanceof Error))
1752
+ throw error;
1753
+ const linkValue = await readlink3(targetPath);
1754
+ return isAbsolute3(linkValue) ? linkValue : resolve4(dirname5(targetPath), linkValue);
1550
1755
  }
1551
- return true;
1552
1756
  }
1553
- function parseTomlScalar(value) {
1554
- const trimmed = value.trim();
1555
- if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
1757
+ async function renameWithRetry(fromPath, toPath) {
1758
+ for (let attempt = 0;; attempt += 1) {
1556
1759
  try {
1557
- return JSON.parse(trimmed);
1760
+ await rename3(fromPath, toPath);
1761
+ return;
1558
1762
  } catch (error) {
1559
- if (error instanceof SyntaxError) return void 0;
1560
- throw error;
1763
+ if (!isRetriableRenameError(error) || attempt >= RENAME_RETRY_DELAYS_MS.length) {
1764
+ throw error;
1765
+ }
1766
+ await delay(RENAME_RETRY_DELAYS_MS[attempt] ?? 0);
1561
1767
  }
1562
1768
  }
1563
- const numeric = Number(trimmed);
1564
- return Number.isFinite(numeric) ? numeric : void 0;
1565
1769
  }
1566
- function isSectionHeader2(line) {
1567
- const trimmed = line.trim();
1568
- return trimmed.startsWith("[") && trimmed.endsWith("]");
1770
+ function isRetriableRenameError(error) {
1771
+ if (!(error instanceof Error) || !("code" in error))
1772
+ return false;
1773
+ return typeof error.code === "string" && RETRIABLE_RENAME_CODES.has(error.code);
1569
1774
  }
1570
- function isRootSetting(line, key) {
1571
- const trimmed = line.trimStart();
1572
- if (trimmed.startsWith("#") || trimmed.startsWith("[")) return false;
1573
- const match = trimmed.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=/);
1574
- return match?.[1] === key;
1775
+ function delay(milliseconds) {
1776
+ return new Promise((resolveDelay) => setTimeout(resolveDelay, milliseconds));
1575
1777
  }
1576
1778
 
1577
- // ../../../scripts/install/permissions.mjs
1578
- var AUTONOMOUS_FEATURES = ["multi_agent", "child_agents_md", "unified_exec", "goals"];
1579
- function ensureAutonomousPermissions(config) {
1580
- let next = replaceOrInsertRootSetting(config, "approval_policy", JSON.stringify("never"));
1581
- next = replaceOrInsertRootSetting(next, "sandbox_mode", JSON.stringify("danger-full-access"));
1582
- next = replaceOrInsertRootSetting(next, "network_access", JSON.stringify("enabled"));
1583
- for (const featureName of AUTONOMOUS_FEATURES) {
1584
- next = ensureFeatureEnabled(next, featureName);
1585
- }
1586
- next = removeWindowsSandboxSetting(next);
1587
- next = ensureNoticeEnabled(next, "hide_full_access_warning");
1588
- return ensureNoticeEnabled(next, "hide_world_writable_warning");
1589
- }
1590
- function removeWindowsSandboxSetting(config) {
1591
- const section = findTomlSection(config, "windows");
1592
- if (!section) return config;
1593
- return removeSetting(config, section, "sandbox");
1594
- }
1595
- function ensureNoticeEnabled(config, key) {
1596
- const section = findTomlSection(config, "notice");
1597
- if (!section) return appendNoticeBlock(config, key);
1598
- return replaceOrInsertSetting(config, section, key, "true");
1599
- }
1600
- function ensureFeatureEnabled(config, key) {
1779
+ // ../src/install/codex-config-features.ts
1780
+ function ensureFeatureEnabled(config, featureName) {
1601
1781
  const section = findTomlSection(config, "features");
1602
- if (!section) return appendBlock(config, `[features]
1603
- ${key} = true
1604
- `);
1605
- return replaceOrInsertSetting(config, section, key, "true");
1606
- }
1607
- function appendNoticeBlock(config, key) {
1608
- return appendBlock(config, `[notice]
1609
- ${key} = true
1782
+ if (!section)
1783
+ return appendBlock(config, `[features]
1784
+ ${featureName} = true
1610
1785
  `);
1786
+ return replaceOrInsertSetting(config, section, featureName, "true");
1611
1787
  }
1612
1788
 
1613
- // ../../../scripts/install/config.mjs
1614
- var LEGACY_CODEX_PLUGIN_MARKETPLACE = ["code", "yeongyu", "codex", "plugins"].join("-");
1615
- var SISYPHUS_LEGACY_MARKETPLACES = ["lazycodex", LEGACY_CODEX_PLUGIN_MARKETPLACE];
1616
- var MANAGED_CODEX_AGENT_NAMES = [
1617
- "codex-ultrawork-reviewer",
1618
- "explorer",
1619
- "librarian",
1620
- "metis",
1621
- "momus",
1622
- "plan"
1623
- ];
1624
- async function updateCodexConfig({
1625
- configPath,
1626
- repoRoot,
1627
- marketplaceName,
1628
- marketplaceSource = defaultMarketplaceSource(repoRoot),
1629
- preserveMarketplaceSource = false,
1630
- pluginNames,
1631
- platform = process.platform,
1632
- trustedHookStates = [],
1633
- agentConfigs = [],
1634
- autonomousPermissions = false,
1635
- gitBashEnabled = false
1636
- }) {
1637
- await mkdir6(dirname7(configPath), { recursive: true });
1638
- let config = "";
1639
- if (await exists(configPath)) config = await readFile9(configPath, "utf8");
1640
- for (const legacyMarketplaceName of legacyMarketplaceNames(marketplaceName)) {
1641
- config = removeMarketplaceBlock(config, legacyMarketplaceName);
1642
- config = removeStaleMarketplacePluginBlocks(config, legacyMarketplaceName, /* @__PURE__ */ new Set());
1643
- config = removeStaleMarketplaceHookStateBlocks(config, legacyMarketplaceName, /* @__PURE__ */ new Set());
1644
- }
1645
- config = removeStaleMarketplacePluginBlocks(config, marketplaceName, new Set(pluginNames));
1646
- config = removeStaleMarketplaceHookStateBlocks(config, marketplaceName, new Set(pluginNames));
1647
- config = removeStaleManagedAgentBlocks(config, new Set(agentConfigs.map((agentConfig) => agentConfig.name)));
1648
- config = ensureFeatureEnabled2(config, "plugins");
1649
- config = ensureFeatureEnabled2(config, "plugin_hooks");
1650
- config = ensureFeatureEnabled2(config, "multi_agent");
1651
- config = ensureFeatureEnabled2(config, "child_agents_md");
1652
- config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(repoRoot));
1653
- config = ensureCodexMultiAgentV2Config(config);
1654
- if (autonomousPermissions === true) config = ensureAutonomousPermissions(config);
1655
- if (preserveMarketplaceSource !== true) {
1656
- config = ensureMarketplaceBlock(config, marketplaceName, marketplaceSource);
1657
- }
1658
- for (const pluginName of pluginNames) {
1659
- config = ensurePluginEnabled(config, `${pluginName}@${marketplaceName}`);
1660
- }
1661
- config = ensureOmoBuiltinMcpPolicies(config, { marketplaceName, pluginNames, platform, gitBashEnabled });
1662
- for (const state of trustedHookStates) {
1663
- config = ensureHookTrusted(config, state.key, state.trustedHash);
1664
- }
1665
- for (const agentConfig of agentConfigs) {
1666
- config = ensureAgentConfig(config, agentConfig);
1667
- }
1668
- await writeFileAtomic(configPath, config.trimEnd() + "\n");
1669
- }
1789
+ // ../src/install/codex-config-marketplaces.ts
1790
+ var SISYPHUS_LEGACY_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"];
1670
1791
  function legacyMarketplaceNames(marketplaceName) {
1671
1792
  return marketplaceName === "sisyphuslabs" ? SISYPHUS_LEGACY_MARKETPLACES : [];
1672
1793
  }
1673
1794
  function removeMarketplaceBlock(config, marketplaceName) {
1674
1795
  return removeTomlSections(config, (header) => header === `marketplaces.${marketplaceName}`);
1675
1796
  }
1676
- function defaultMarketplaceSource(repoRoot) {
1677
- return {
1678
- sourceType: "local",
1679
- source: repoRoot
1680
- };
1797
+ function hasMarketplaceBlock(config, marketplaceName) {
1798
+ return findTomlSection(config, `marketplaces.${marketplaceName}`) !== null;
1681
1799
  }
1682
1800
  function removeStaleMarketplacePluginBlocks(config, marketplaceName, keepPluginNames) {
1683
1801
  return removeTomlSections(config, (header) => {
1684
1802
  const pluginKey = parsePluginHeaderKey(header);
1685
- if (pluginKey === null) return false;
1803
+ if (pluginKey === null)
1804
+ return false;
1686
1805
  const suffix = `@${marketplaceName}`;
1687
- if (!pluginKey.endsWith(suffix)) return false;
1806
+ if (!pluginKey.endsWith(suffix))
1807
+ return false;
1688
1808
  return !keepPluginNames.has(pluginKey.slice(0, -suffix.length));
1689
1809
  });
1690
1810
  }
1691
1811
  function removeStaleMarketplaceHookStateBlocks(config, marketplaceName, keepPluginNames) {
1692
1812
  return removeTomlSections(config, (header) => {
1693
1813
  const prefix = "hooks.state.";
1694
- if (!header.startsWith(prefix)) return false;
1695
- const hookKey = parseJsonString(header.slice(prefix.length));
1696
- if (hookKey === null) return false;
1814
+ if (!header.startsWith(prefix))
1815
+ return false;
1816
+ const hookKey = parseJsonString2(header.slice(prefix.length));
1817
+ if (hookKey === null)
1818
+ return false;
1697
1819
  const separator = hookKey.indexOf(":");
1698
- if (separator === -1) return false;
1820
+ if (separator === -1)
1821
+ return false;
1699
1822
  const pluginKey = hookKey.slice(0, separator);
1700
1823
  const suffix = `@${marketplaceName}`;
1701
- if (!pluginKey.endsWith(suffix)) return false;
1824
+ if (!pluginKey.endsWith(suffix))
1825
+ return false;
1702
1826
  return !keepPluginNames.has(pluginKey.slice(0, -suffix.length));
1703
1827
  });
1704
1828
  }
1705
- function removeStaleManagedAgentBlocks(config, keepAgentNames) {
1706
- const managedAgentNames = new Set(MANAGED_CODEX_AGENT_NAMES);
1707
- return splitTomlSections(config).filter((section) => {
1708
- if (section.header === null) return true;
1709
- const agentName = parseAgentHeaderName(section.header);
1710
- if (agentName === null || !managedAgentNames.has(agentName) || keepAgentNames.has(agentName)) return true;
1711
- return !section.text.includes(`config_file = ${JSON.stringify(`./agents/${agentName}.toml`)}`);
1712
- }).map((section) => section.text).join("").replace(/\n{3,}/g, "\n\n");
1713
- }
1714
- function ensureFeatureEnabled2(config, featureName) {
1715
- const section = findTomlSection(config, "features");
1716
- if (!section) return appendBlock(config, `[features]
1717
- ${featureName} = true
1718
- `);
1719
- return replaceOrInsertSetting(config, section, featureName, "true");
1720
- }
1721
1829
  function ensureMarketplaceBlock(config, marketplaceName, source) {
1722
1830
  const header = `marketplaces.${marketplaceName}`;
1723
- const block = [
1831
+ const lines = [
1724
1832
  `[${header}]`,
1725
- `last_updated = "${(/* @__PURE__ */ new Date()).toISOString().replace(/\.\d{3}Z$/, "Z")}"`,
1833
+ `last_updated = "${new Date().toISOString().replace(/\.\d{3}Z$/, "Z")}"`,
1726
1834
  `source_type = ${JSON.stringify(source.sourceType)}`,
1727
- `source = ${JSON.stringify(source.source)}`,
1728
- source.ref === void 0 ? null : `ref = ${JSON.stringify(source.ref)}`,
1729
- ""
1730
- ].filter((line) => line !== null).join("\n");
1835
+ `source = ${JSON.stringify(source.source)}`
1836
+ ];
1837
+ if (source.sourceType === "git") {
1838
+ lines.push(`ref = ${JSON.stringify(source.ref)}`);
1839
+ }
1840
+ lines.push("");
1841
+ const block = lines.join(`
1842
+ `);
1731
1843
  const section = findTomlSection(config, header);
1732
- if (section) return config.slice(0, section.start) + block + config.slice(section.end);
1844
+ if (section)
1845
+ return config.slice(0, section.start) + block + config.slice(section.end);
1733
1846
  return appendBlock(config, block);
1734
1847
  }
1848
+
1849
+ // ../src/install/codex-config-permissions.ts
1850
+ var AUTONOMOUS_FEATURES = ["multi_agent", "child_agents_md", "unified_exec", "goals"];
1851
+ function ensureAutonomousPermissions(config) {
1852
+ let next = replaceOrInsertRootSetting(config, "approval_policy", JSON.stringify("never"));
1853
+ next = replaceOrInsertRootSetting(next, "sandbox_mode", JSON.stringify("danger-full-access"));
1854
+ next = replaceOrInsertRootSetting(next, "network_access", JSON.stringify("enabled"));
1855
+ for (const featureName of AUTONOMOUS_FEATURES) {
1856
+ next = ensureFeatureEnabled2(next, featureName);
1857
+ }
1858
+ next = removeWindowsSandboxSetting(next);
1859
+ next = ensureNoticeEnabled(next, "hide_full_access_warning");
1860
+ return ensureNoticeEnabled(next, "hide_world_writable_warning");
1861
+ }
1862
+ function removeWindowsSandboxSetting(config) {
1863
+ const section = findTomlSection(config, "windows");
1864
+ if (section === null)
1865
+ return config;
1866
+ return removeSetting(config, section, "sandbox");
1867
+ }
1868
+ function ensureNoticeEnabled(config, key) {
1869
+ const section = findTomlSection(config, "notice");
1870
+ if (section === null)
1871
+ return appendNoticeBlock(config, key);
1872
+ return replaceOrInsertSetting(config, section, key, "true");
1873
+ }
1874
+ function ensureFeatureEnabled2(config, key) {
1875
+ const section = findTomlSection(config, "features");
1876
+ if (section === null)
1877
+ return appendBlock(config, `[features]
1878
+ ${key} = true
1879
+ `);
1880
+ return replaceOrInsertSetting(config, section, key, "true");
1881
+ }
1882
+ function appendNoticeBlock(config, key) {
1883
+ return appendBlock(config, `[notice]
1884
+ ${key} = true
1885
+ `);
1886
+ }
1887
+
1888
+ // ../src/install/codex-config-plugins.ts
1735
1889
  function ensurePluginEnabled(config, pluginKey) {
1736
1890
  const header = `plugins.${JSON.stringify(pluginKey)}`;
1737
1891
  const section = findTomlSection(config, header);
1738
- if (!section) return appendBlock(config, `[${header}]
1892
+ if (!section)
1893
+ return appendBlock(config, `[${header}]
1739
1894
  enabled = true
1740
1895
  `);
1741
1896
  return replaceOrInsertSetting(config, section, "enabled", "true");
1742
1897
  }
1743
- function ensurePluginMcpEnabled(config, pluginKey, serverName, enabled) {
1744
- const header = `plugins.${JSON.stringify(pluginKey)}.mcp_servers.${serverName}`;
1745
- const section = findTomlSection(config, header);
1746
- const enabledValue = enabled ? "true" : "false";
1747
- if (!section) return appendBlock(config, `[${header}]
1748
- enabled = ${enabledValue}
1749
- `);
1750
- return replaceOrInsertSetting(config, section, "enabled", enabledValue);
1751
- }
1752
- function ensureOmoBuiltinMcpPolicies(config, { marketplaceName, pluginNames, platform, gitBashEnabled }) {
1753
- if (marketplaceName !== "sisyphuslabs" || !pluginNames.includes("omo")) return config;
1898
+ function ensureOmoBuiltinMcpPolicies(config, input) {
1899
+ if (input.marketplaceName !== "sisyphuslabs" || !input.pluginNames.includes("omo"))
1900
+ return config;
1901
+ const gitBashEnabled = (input.platform ?? process.platform) === "win32" && input.gitBashEnabled === true;
1754
1902
  let nextConfig = ensurePluginMcpEnabled(config, "omo@sisyphuslabs", "context7", true);
1755
- nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", platform === "win32" && gitBashEnabled === true);
1903
+ nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph", true);
1904
+ nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", gitBashEnabled);
1756
1905
  return nextConfig;
1757
1906
  }
1758
- function ensureHookTrusted(config, key, trustedHash) {
1759
- const header = `hooks.state.${JSON.stringify(key)}`;
1907
+ function ensureHookTrusted(config, state) {
1908
+ const header = `hooks.state.${JSON.stringify(state.key)}`;
1760
1909
  const section = findTomlSection(config, header);
1761
- if (!section) return appendBlock(config, `[${header}]
1762
- trusted_hash = ${JSON.stringify(trustedHash)}
1910
+ if (!section)
1911
+ return appendBlock(config, `[${header}]
1912
+ trusted_hash = ${JSON.stringify(state.trustedHash)}
1763
1913
  `);
1764
- return replaceOrInsertSetting(config, section, "trusted_hash", JSON.stringify(trustedHash));
1914
+ return replaceOrInsertSetting(config, section, "trusted_hash", JSON.stringify(state.trustedHash));
1765
1915
  }
1766
- function ensureAgentConfig(config, agentConfig) {
1767
- const header = `agents.${tomlKeySegment(agentConfig.name)}`;
1916
+ function ensurePluginMcpEnabled(config, pluginKey, serverName, enabled) {
1917
+ const header = `plugins.${JSON.stringify(pluginKey)}.mcp_servers.${serverName}`;
1768
1918
  const section = findTomlSection(config, header);
1769
- const configFile = JSON.stringify(agentConfig.configFile);
1770
- if (!section) return appendBlock(config, `[${header}]
1771
- config_file = ${configFile}
1919
+ const enabledValue = enabled ? "true" : "false";
1920
+ if (!section)
1921
+ return appendBlock(config, `[${header}]
1922
+ enabled = ${enabledValue}
1772
1923
  `);
1773
- return replaceOrInsertSetting(config, section, "config_file", configFile);
1924
+ return replaceOrInsertSetting(config, section, "enabled", enabledValue);
1774
1925
  }
1775
- function tomlKeySegment(value) {
1776
- return /^[A-Za-z0-9_-]+$/.test(value) ? value : JSON.stringify(value);
1926
+
1927
+ // ../src/install/codex-config-reasoning.ts
1928
+ var MANAGED_KEYS = ["model", "model_context_window", "model_reasoning_effort", "plan_mode_reasoning_effort"];
1929
+ function ensureCodexReasoningConfig(config, catalog) {
1930
+ const current = readRootReasoningSettings(config);
1931
+ if (Object.keys(current).length > 0 && !matchesProfile(current, catalog.current) && !catalog.managedProfiles.some((profile) => matchesProfile(current, profile))) {
1932
+ return config;
1933
+ }
1934
+ let next = replaceOrInsertRootSetting(config, "model", JSON.stringify(catalog.current.model));
1935
+ next = replaceOrInsertRootSetting(next, "model_context_window", catalog.current.modelContextWindow.toString());
1936
+ next = replaceOrInsertRootSetting(next, "model_reasoning_effort", JSON.stringify(catalog.current.modelReasoningEffort));
1937
+ next = replaceOrInsertRootSetting(next, "plan_mode_reasoning_effort", JSON.stringify(catalog.current.planModeReasoningEffort));
1938
+ return next;
1777
1939
  }
1778
- function removeTomlSections(config, shouldRemove) {
1779
- return splitTomlSections(config).filter((section) => section.header === null || !shouldRemove(section.header)).map((section) => section.text).join("").replace(/\n{3,}/g, "\n\n");
1940
+ function readRootReasoningSettings(config) {
1941
+ const settings = {};
1942
+ for (const line of config.split(/\n/)) {
1943
+ if (isSectionHeader2(line))
1944
+ break;
1945
+ for (const key of MANAGED_KEYS) {
1946
+ if (!isRootSetting(line, key))
1947
+ continue;
1948
+ const value = parseTomlScalar(line.slice(line.indexOf("=") + 1));
1949
+ if (key === "model" && typeof value === "string")
1950
+ settings.model = value;
1951
+ if (key === "model_context_window" && typeof value === "number")
1952
+ settings.modelContextWindow = value;
1953
+ if (key === "model_reasoning_effort" && typeof value === "string")
1954
+ settings.modelReasoningEffort = value;
1955
+ if (key === "plan_mode_reasoning_effort" && typeof value === "string")
1956
+ settings.planModeReasoningEffort = value;
1957
+ }
1958
+ }
1959
+ return settings;
1780
1960
  }
1781
- function splitTomlSections(config) {
1782
- const lines = config.match(/[^\n]*\n?|$/g) ?? [];
1783
- const sections = [];
1784
- let current = { header: null, text: "" };
1785
- for (const line of lines) {
1786
- if (line.length === 0) break;
1787
- const header = parseTomlHeader2(line);
1788
- if (header !== null) {
1789
- if (current.text.length > 0) sections.push(current);
1790
- current = { header, text: line };
1791
- } else {
1792
- current.text += line;
1961
+ function matchesProfile(current, profile) {
1962
+ for (const [key, value] of Object.entries(profile)) {
1963
+ if (current[key] !== value)
1964
+ return false;
1965
+ }
1966
+ return true;
1967
+ }
1968
+ function parseTomlScalar(value) {
1969
+ const trimmed = value.trim();
1970
+ if (trimmed.startsWith('"') && trimmed.endsWith('"')) {
1971
+ try {
1972
+ return JSON.parse(trimmed);
1973
+ } catch (error) {
1974
+ if (error instanceof SyntaxError)
1975
+ return;
1976
+ throw error;
1793
1977
  }
1794
1978
  }
1795
- if (current.text.length > 0) sections.push(current);
1796
- return sections;
1979
+ const numeric = Number(trimmed);
1980
+ return Number.isFinite(numeric) ? numeric : undefined;
1797
1981
  }
1798
- function parseTomlHeader2(line) {
1982
+ function isSectionHeader2(line) {
1799
1983
  const trimmed = line.trim();
1800
- if (!trimmed.startsWith("[") || !trimmed.endsWith("]")) return null;
1801
- if (trimmed.startsWith("[[")) return null;
1802
- return trimmed.slice(1, -1);
1984
+ return trimmed.startsWith("[") && trimmed.endsWith("]");
1803
1985
  }
1804
- function parsePluginHeaderKey(header) {
1805
- const prefix = "plugins.";
1806
- if (!header.startsWith(prefix)) return null;
1807
- return parseLeadingJsonString2(header.slice(prefix.length));
1986
+ function isRootSetting(line, key) {
1987
+ const trimmed = line.trimStart();
1988
+ if (trimmed.startsWith("#") || trimmed.startsWith("["))
1989
+ return false;
1990
+ const match = trimmed.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=/);
1991
+ return match?.[1] === key;
1992
+ }
1993
+
1994
+ // ../src/install/codex-model-catalog.ts
1995
+ import { readFile as readFile8 } from "node:fs/promises";
1996
+ import { join as join14 } from "node:path";
1997
+ var FALLBACK_CODEX_MODEL_CATALOG = {
1998
+ current: {
1999
+ model: "gpt-5.5",
2000
+ modelContextWindow: 400000,
2001
+ modelReasoningEffort: "high",
2002
+ planModeReasoningEffort: "xhigh"
2003
+ },
2004
+ managedProfiles: [
2005
+ {
2006
+ model: "gpt-5.5",
2007
+ modelContextWindow: 1e6,
2008
+ modelReasoningEffort: "high",
2009
+ planModeReasoningEffort: "xhigh"
2010
+ },
2011
+ { model: "gpt-5.5", modelContextWindow: 272000 }
2012
+ ]
2013
+ };
2014
+ async function readCodexModelCatalog(codexPackageRoot) {
2015
+ const catalogPath = join14(codexPackageRoot, "plugin", "model-catalog.json");
2016
+ try {
2017
+ const parsed = JSON.parse(await readFile8(catalogPath, "utf8"));
2018
+ return parseCodexModelCatalog(parsed) ?? FALLBACK_CODEX_MODEL_CATALOG;
2019
+ } catch (error) {
2020
+ if (error instanceof Error)
2021
+ return FALLBACK_CODEX_MODEL_CATALOG;
2022
+ throw error;
2023
+ }
2024
+ }
2025
+ function parseCodexModelCatalog(value) {
2026
+ if (!isPlainRecord(value))
2027
+ return null;
2028
+ const current = value["current"];
2029
+ const managedProfiles = value["managedProfiles"];
2030
+ if (!isPlainRecord(current) || !Array.isArray(managedProfiles))
2031
+ return null;
2032
+ const model = current["model"];
2033
+ const modelContextWindow = current["model_context_window"];
2034
+ const modelReasoningEffort = current["model_reasoning_effort"];
2035
+ const planModeReasoningEffort = current["plan_mode_reasoning_effort"];
2036
+ if (typeof model !== "string" || typeof modelContextWindow !== "number" || typeof modelReasoningEffort !== "string" || typeof planModeReasoningEffort !== "string") {
2037
+ return null;
2038
+ }
2039
+ const parsedManagedProfiles = [];
2040
+ for (const profile of managedProfiles) {
2041
+ if (!isPlainRecord(profile))
2042
+ return null;
2043
+ const match = profile["match"];
2044
+ if (!isPlainRecord(match))
2045
+ return null;
2046
+ parsedManagedProfiles.push(parseProfileMatch(match));
2047
+ }
2048
+ return {
2049
+ current: { model, modelContextWindow, modelReasoningEffort, planModeReasoningEffort },
2050
+ managedProfiles: parsedManagedProfiles
2051
+ };
2052
+ }
2053
+ function parseProfileMatch(match) {
2054
+ const profile = {};
2055
+ if (typeof match["model"] === "string")
2056
+ profile.model = match["model"];
2057
+ if (typeof match["model_context_window"] === "number")
2058
+ profile.modelContextWindow = match["model_context_window"];
2059
+ if (typeof match["model_reasoning_effort"] === "string")
2060
+ profile.modelReasoningEffort = match["model_reasoning_effort"];
2061
+ if (typeof match["plan_mode_reasoning_effort"] === "string")
2062
+ profile.planModeReasoningEffort = match["plan_mode_reasoning_effort"];
2063
+ return profile;
2064
+ }
2065
+
2066
+ // ../src/install/codex-multi-agent-v2-config.ts
2067
+ var CODEX_MULTI_AGENT_V2_HEADER = "features.multi_agent_v2";
2068
+ var CODEX_MULTI_AGENT_V2_MAX_CONCURRENT_THREADS_PER_SESSION = 1e4;
2069
+ function ensureCodexMultiAgentV2Config(config) {
2070
+ const normalizedConfig = removeLegacyAgentsMaxThreadsSetting(removeFeatureFlagSetting(config, "multi_agent_v2"));
2071
+ const section = findTomlSection(normalizedConfig, CODEX_MULTI_AGENT_V2_HEADER);
2072
+ const maxThreadsValue = CODEX_MULTI_AGENT_V2_MAX_CONCURRENT_THREADS_PER_SESSION.toString();
2073
+ if (!section) {
2074
+ return appendBlock(normalizedConfig, `[${CODEX_MULTI_AGENT_V2_HEADER}]
2075
+ max_concurrent_threads_per_session = ${maxThreadsValue}
2076
+ `);
2077
+ }
2078
+ return replaceOrInsertSetting(normalizedConfig, section, "max_concurrent_threads_per_session", maxThreadsValue);
1808
2079
  }
1809
- function parseAgentHeaderName(header) {
1810
- const prefix = "agents.";
1811
- if (!header.startsWith(prefix)) return null;
1812
- const key = header.slice(prefix.length);
1813
- return key.startsWith('"') ? parseLeadingJsonString2(key) : key;
2080
+ function removeFeatureFlagSetting(config, featureName) {
2081
+ const section = findTomlSection(config, "features");
2082
+ if (!section)
2083
+ return config;
2084
+ return removeSetting(config, section, featureName);
1814
2085
  }
1815
- function parseLeadingJsonString2(value) {
1816
- if (!value.startsWith('"')) return parseJsonString(value);
1817
- let escaped = false;
1818
- for (let index = 1; index < value.length; index += 1) {
1819
- const char = value[index];
1820
- if (escaped) {
1821
- escaped = false;
1822
- continue;
1823
- }
1824
- if (char === "\\") {
1825
- escaped = true;
1826
- continue;
1827
- }
1828
- if (char === '"') return parseJsonString(value.slice(0, index + 1));
2086
+ function removeLegacyAgentsMaxThreadsSetting(config) {
2087
+ const section = findTomlSection(config, "agents");
2088
+ if (!section)
2089
+ return config;
2090
+ return removeSetting(config, section, "max_threads");
2091
+ }
2092
+
2093
+ // ../src/install/codex-config-toml.ts
2094
+ async function updateCodexConfig(input) {
2095
+ await mkdir6(dirname6(input.configPath), { recursive: true });
2096
+ let config = "";
2097
+ if (await exists3(input.configPath))
2098
+ config = await readFile9(input.configPath, "utf8");
2099
+ const pluginSet = new Set(input.pluginNames);
2100
+ for (const legacyMarketplaceName of legacyMarketplaceNames(input.marketplaceName)) {
2101
+ config = removeMarketplaceBlock(config, legacyMarketplaceName);
2102
+ config = removeStaleMarketplacePluginBlocks(config, legacyMarketplaceName, new Set);
2103
+ config = removeStaleMarketplaceHookStateBlocks(config, legacyMarketplaceName, new Set);
2104
+ }
2105
+ config = removeStaleMarketplacePluginBlocks(config, input.marketplaceName, pluginSet);
2106
+ config = removeStaleMarketplaceHookStateBlocks(config, input.marketplaceName, pluginSet);
2107
+ config = removeStaleManagedAgentBlocks(config, new Set((input.agentConfigs ?? []).map((agentConfig) => agentConfig.name)));
2108
+ config = ensureFeatureEnabled(config, "plugins");
2109
+ config = ensureFeatureEnabled(config, "plugin_hooks");
2110
+ config = ensureFeatureEnabled(config, "multi_agent");
2111
+ config = ensureFeatureEnabled(config, "child_agents_md");
2112
+ config = ensureCodexReasoningConfig(config, await readCodexModelCatalog(input.repoRoot));
2113
+ config = ensureCodexMultiAgentV2Config(config);
2114
+ if (input.autonomousPermissions === true)
2115
+ config = ensureAutonomousPermissions(config);
2116
+ if (!(input.preserveMarketplaceSource === true && hasMarketplaceBlock(config, input.marketplaceName))) {
2117
+ config = ensureMarketplaceBlock(config, input.marketplaceName, input.marketplaceSource);
1829
2118
  }
1830
- return null;
2119
+ for (const pluginName of input.pluginNames) {
2120
+ config = ensurePluginEnabled(config, `${pluginName}@${input.marketplaceName}`);
2121
+ }
2122
+ config = ensureOmoBuiltinMcpPolicies(config, input);
2123
+ for (const state of input.trustedHookStates ?? []) {
2124
+ config = ensureHookTrusted(config, state);
2125
+ }
2126
+ for (const agentConfig of input.agentConfigs ?? []) {
2127
+ config = ensureAgentConfig(config, agentConfig);
2128
+ }
2129
+ await writeFileAtomic(input.configPath, `${config.trimEnd()}
2130
+ `);
1831
2131
  }
1832
- function parseJsonString(value) {
2132
+ async function exists3(path) {
1833
2133
  try {
1834
- const parsed = JSON.parse(value);
1835
- return typeof parsed === "string" ? parsed : null;
2134
+ await readFile9(path, "utf8");
2135
+ return true;
1836
2136
  } catch (error) {
1837
- if (error instanceof Error) return null;
1838
- return null;
2137
+ if (error instanceof Error)
2138
+ return false;
2139
+ return false;
1839
2140
  }
1840
2141
  }
1841
2142
 
1842
- // ../../../scripts/install/git-bash-mcp-env.mjs
2143
+ // ../src/install/codex-git-bash-mcp-env.ts
1843
2144
  import { readFile as readFile10, writeFile as writeFile6 } from "node:fs/promises";
1844
- import { join as join12 } from "node:path";
2145
+ import { join as join15 } from "node:path";
1845
2146
  var GIT_BASH_ENV_KEY = "OMO_CODEX_GIT_BASH_PATH";
1846
- async function stampGitBashMcpEnv({ pluginRoot, env = process.env, platform = process.platform }) {
1847
- if (platform !== "win32") return false;
1848
- const override = typeof env[GIT_BASH_ENV_KEY] === "string" ? env[GIT_BASH_ENV_KEY].trim() : "";
1849
- if (override === "") return false;
1850
- const manifestPath = join12(pluginRoot, ".mcp.json");
1851
- if (!await exists(manifestPath)) return false;
2147
+ async function stampGitBashMcpEnv(input) {
2148
+ if (input.platform !== "win32")
2149
+ return false;
2150
+ const rawOverride = input.env?.[GIT_BASH_ENV_KEY];
2151
+ const override = typeof rawOverride === "string" ? rawOverride.trim() : "";
2152
+ if (override === "")
2153
+ return false;
2154
+ const manifestPath = join15(input.pluginRoot, ".mcp.json");
2155
+ if (!await fileExistsStrict(manifestPath))
2156
+ return false;
1852
2157
  const parsed = JSON.parse(await readFile10(manifestPath, "utf8"));
1853
- if (!isRecord2(parsed) || !isRecord2(parsed.mcpServers) || !isRecord2(parsed.mcpServers.git_bash)) return false;
1854
- const server = parsed.mcpServers.git_bash;
1855
- const serverEnv = isRecord2(server.env) ? server.env : {};
1856
- if (serverEnv[GIT_BASH_ENV_KEY] === override) return false;
1857
- server.env = { ...serverEnv, [GIT_BASH_ENV_KEY]: override };
1858
- await writeFile6(manifestPath, `${JSON.stringify(parsed, null, " ")}
2158
+ if (!isPlainRecord(parsed) || !isPlainRecord(parsed["mcpServers"]))
2159
+ return false;
2160
+ const gitBashServer = parsed["mcpServers"]["git_bash"];
2161
+ if (!isPlainRecord(gitBashServer))
2162
+ return false;
2163
+ const serverEnv = isPlainRecord(gitBashServer["env"]) ? gitBashServer["env"] : {};
2164
+ if (serverEnv[GIT_BASH_ENV_KEY] === override)
2165
+ return false;
2166
+ gitBashServer["env"] = { ...serverEnv, [GIT_BASH_ENV_KEY]: override };
2167
+ await writeFile6(manifestPath, `${JSON.stringify(parsed, null, "\t")}
1859
2168
  `);
1860
2169
  return true;
1861
2170
  }
1862
2171
 
1863
- // ../../../scripts/install/git-bash.mjs
1864
- import { execFileSync } from "node:child_process";
2172
+ // ../src/install/codex-hook-trust.ts
2173
+ import { createHash as createHash3 } from "node:crypto";
2174
+ import { readFile as readFile11 } from "node:fs/promises";
2175
+ import { join as join16 } from "node:path";
2176
+ var EVENT_LABELS = new Map([
2177
+ ["PreToolUse", "pre_tool_use"],
2178
+ ["PermissionRequest", "permission_request"],
2179
+ ["PostToolUse", "post_tool_use"],
2180
+ ["PreCompact", "pre_compact"],
2181
+ ["PostCompact", "post_compact"],
2182
+ ["SessionStart", "session_start"],
2183
+ ["UserPromptSubmit", "user_prompt_submit"],
2184
+ ["SubagentStart", "subagent_start"],
2185
+ ["SubagentStop", "subagent_stop"],
2186
+ ["Stop", "stop"]
2187
+ ]);
2188
+ async function trustedHookStatesForPlugin(input) {
2189
+ const manifestPath = join16(input.pluginRoot, ".codex-plugin", "plugin.json");
2190
+ if (!await exists4(manifestPath))
2191
+ return [];
2192
+ const manifest = JSON.parse(await readFile11(manifestPath, "utf8"));
2193
+ if (!isPlainRecord(manifest) || typeof manifest.hooks !== "string")
2194
+ return [];
2195
+ const hooksPath = join16(input.pluginRoot, manifest.hooks);
2196
+ if (!await exists4(hooksPath))
2197
+ return [];
2198
+ const parsed = JSON.parse(await readFile11(hooksPath, "utf8"));
2199
+ if (!isPlainRecord(parsed) || !isPlainRecord(parsed.hooks))
2200
+ return [];
2201
+ const keySource = `${input.pluginName}@${input.marketplaceName}:${stripDotSlash(manifest.hooks)}`;
2202
+ const states = [];
2203
+ for (const [eventName, groups] of Object.entries(parsed.hooks)) {
2204
+ if (!Array.isArray(groups))
2205
+ continue;
2206
+ const eventLabel = EVENT_LABELS.get(eventName);
2207
+ if (eventLabel === undefined)
2208
+ continue;
2209
+ for (const [groupIndex, group] of groups.entries()) {
2210
+ if (!isPlainRecord(group) || !Array.isArray(group.hooks))
2211
+ continue;
2212
+ for (const [handlerIndex, handler] of group.hooks.entries()) {
2213
+ if (!isPlainRecord(handler) || handler.type !== "command")
2214
+ continue;
2215
+ if (handler.async === true)
2216
+ continue;
2217
+ if (typeof handler.command !== "string" || handler.command.trim() === "")
2218
+ continue;
2219
+ const key = `${keySource}:${eventLabel}:${groupIndex}:${handlerIndex}`;
2220
+ states.push({ key, trustedHash: commandHookHash(eventLabel, group.matcher, handler) });
2221
+ }
2222
+ }
2223
+ }
2224
+ return states;
2225
+ }
2226
+ function commandHookHash(eventName, matcher, handler) {
2227
+ const timeout = Math.max(Number(handler.timeout ?? 600), 1);
2228
+ const normalizedHandler = {
2229
+ type: "command",
2230
+ command: handler.command,
2231
+ timeout,
2232
+ async: false
2233
+ };
2234
+ if (typeof handler.statusMessage === "string")
2235
+ normalizedHandler.statusMessage = handler.statusMessage;
2236
+ const identity = { event_name: eventName, hooks: [normalizedHandler] };
2237
+ if (typeof matcher === "string")
2238
+ identity.matcher = matcher;
2239
+ const canonical = JSON.stringify(canonicalJson(identity));
2240
+ return `sha256:${createHash3("sha256").update(canonical).digest("hex")}`;
2241
+ }
2242
+ function canonicalJson(value) {
2243
+ if (Array.isArray(value))
2244
+ return value.map(canonicalJson);
2245
+ if (!isPlainRecord(value))
2246
+ return value;
2247
+ const result = {};
2248
+ for (const key of Object.keys(value).sort()) {
2249
+ result[key] = canonicalJson(value[key]);
2250
+ }
2251
+ return result;
2252
+ }
2253
+ function stripDotSlash(value) {
2254
+ return value.startsWith("./") ? value.slice(2) : value;
2255
+ }
2256
+ async function exists4(path) {
2257
+ try {
2258
+ await readFile11(path, "utf8");
2259
+ return true;
2260
+ } catch (error) {
2261
+ if (error instanceof Error)
2262
+ return false;
2263
+ return false;
2264
+ }
2265
+ }
2266
+
2267
+ // ../src/install/codex-installer-bin-dir.ts
2268
+ import { homedir as homedir3 } from "node:os";
2269
+ import { join as join17, resolve as resolve5 } from "node:path";
2270
+ function resolveCodexInstallerBinDir(input) {
2271
+ const explicitBinDir = input.binDir ?? input.env?.CODEX_LOCAL_BIN_DIR;
2272
+ if (explicitBinDir !== undefined && explicitBinDir.trim().length > 0)
2273
+ return resolve5(explicitBinDir.trim());
2274
+ const homeDir = input.homeDir ?? homedir3();
2275
+ const defaultCodexHome = resolve5(homeDir, ".codex");
2276
+ const resolvedCodexHome = resolve5(input.codexHome);
2277
+ if (resolvedCodexHome !== defaultCodexHome)
2278
+ return join17(resolvedCodexHome, "bin");
2279
+ return resolve5(homeDir, ".local", "bin");
2280
+ }
2281
+ // ../../utils/src/runtime/git-bash.ts
2282
+ import { execFileSync as execFileSync2 } from "node:child_process";
1865
2283
  import { existsSync as existsSync2 } from "node:fs";
1866
2284
  var GIT_BASH_ENV_KEY2 = "OMO_CODEX_GIT_BASH_PATH";
1867
- var SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY = "OMO_CODEX_SKIP_GIT_BASH_AUTO_INSTALL";
2285
+ var WINGET_INSTALL_ARGS = ["install", "--id", "Git.Git", "-e", "--source", "winget"];
1868
2286
  var PROGRAM_FILES_GIT_BASH = "C:\\Program Files\\Git\\bin\\bash.exe";
1869
2287
  var PROGRAM_FILES_X86_GIT_BASH = "C:\\Program Files (x86)\\Git\\bin\\bash.exe";
1870
- var WINGET_INSTALL_ARGS = ["install", "--id", "Git.Git", "-e", "--source", "winget"];
1871
- function resolveGitBash({ platform, env, exists: exists2, where }) {
1872
- if (platform !== "win32") return { found: true, path: null, source: "not-required", checkedPaths: [] };
2288
+ var NON_GIT_BASH_LAUNCHER_DIR_SEGMENTS = ["\\windows\\system32\\", "\\microsoft\\windowsapps\\"];
2289
+ function resolveGitBash(input) {
2290
+ if (input.platform !== "win32")
2291
+ return { found: true, path: null, source: "not-required", checkedPaths: [] };
1873
2292
  const checkedPaths = [];
1874
- const envPath = nonEmptyEnvValue2(env, GIT_BASH_ENV_KEY2);
1875
- if (envPath !== void 0) {
2293
+ const envPath = nonEmptyEnvValue(input.env, GIT_BASH_ENV_KEY2);
2294
+ if (envPath !== undefined) {
1876
2295
  checkedPaths.push(envPath);
1877
- if (isBashExePath(envPath) && exists2(envPath)) return { found: true, path: envPath, source: "env", checkedPaths };
2296
+ if (isBashExePath(envPath) && input.exists(envPath)) {
2297
+ return { found: true, path: envPath, source: "env", checkedPaths };
2298
+ }
1878
2299
  return missingGitBash(checkedPaths);
1879
2300
  }
1880
2301
  for (const candidate of [
@@ -1882,151 +2303,106 @@ function resolveGitBash({ platform, env, exists: exists2, where }) {
1882
2303
  { path: PROGRAM_FILES_X86_GIT_BASH, source: "program-files-x86" }
1883
2304
  ]) {
1884
2305
  checkedPaths.push(candidate.path);
1885
- if (exists2(candidate.path)) return { found: true, path: candidate.path, source: candidate.source, checkedPaths };
2306
+ if (input.exists(candidate.path))
2307
+ return { found: true, path: candidate.path, source: candidate.source, checkedPaths };
1886
2308
  }
1887
- for (const pathCandidate of where("bash")) {
2309
+ for (const pathCandidate of input.where("bash")) {
1888
2310
  const candidate = pathCandidate.trim();
1889
- if (candidate.length === 0) continue;
2311
+ if (candidate.length === 0)
2312
+ continue;
1890
2313
  checkedPaths.push(candidate);
1891
- if (isKnownNonGitBashLauncher(candidate)) continue;
1892
- if (isBashExePath(candidate) && exists2(candidate)) return { found: true, path: candidate, source: "path", checkedPaths };
2314
+ if (isKnownNonGitBashLauncher(candidate))
2315
+ continue;
2316
+ if (isBashExePath(candidate) && input.exists(candidate))
2317
+ return { found: true, path: candidate, source: "path", checkedPaths };
1893
2318
  }
1894
2319
  return missingGitBash(checkedPaths);
1895
2320
  }
1896
- function resolveGitBashForCurrentProcess(options = {}) {
2321
+ var resolveGitBashForCurrentProcess = (input = {}) => {
1897
2322
  return resolveGitBash({
1898
- platform: options.platform ?? process.platform,
1899
- env: options.env ?? process.env,
2323
+ platform: input.platform ?? process.platform,
2324
+ env: input.env ?? process.env,
1900
2325
  exists: existsSync2,
1901
2326
  where: whereCommand
1902
2327
  });
1903
- }
1904
- async function prepareGitBashForInstall(options) {
1905
- const resolveGitBashWithDefaults = options.resolveGitBash ?? (() => resolveGitBashForCurrentProcess({ platform: options.platform, env: options.env }));
1906
- const initialResolution = resolveGitBashWithDefaults();
1907
- if (options.platform !== "win32" || initialResolution.found) return initialResolution;
1908
- if (options.env[SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY] === "1") return initialResolution;
1909
- try {
1910
- await options.runCommand("winget", WINGET_INSTALL_ARGS, { cwd: options.cwd });
1911
- } catch (error) {
1912
- if (!(error instanceof Error)) throw error;
1913
- return initialResolution;
1914
- }
1915
- return resolveGitBashWithDefaults();
1916
- }
2328
+ };
1917
2329
  function missingGitBash(checkedPaths) {
1918
2330
  return {
1919
2331
  found: false,
1920
2332
  checkedPaths,
1921
2333
  installHint: [
1922
- "Git Bash is required for native Windows Codex profile installs.",
2334
+ "Git Bash is required on native Windows.",
1923
2335
  "Install it with: winget install --id Git.Git -e --source winget",
1924
- `For a custom install, set ${GIT_BASH_ENV_KEY2}=C:\\path\\to\\bash.exe`,
1925
- "Then rerun `npx lazycodex-ai install`."
1926
- ].join("\n")
2336
+ `For a custom install, set ${GIT_BASH_ENV_KEY2}=C:\\path\\to\\bash.exe`
2337
+ ].join(`
2338
+ `)
1927
2339
  };
1928
2340
  }
1929
- function nonEmptyEnvValue2(env, key) {
2341
+ function nonEmptyEnvValue(env, key) {
1930
2342
  const value = env[key];
1931
- if (typeof value !== "string") return void 0;
2343
+ if (value === undefined)
2344
+ return;
1932
2345
  const trimmed = value.trim();
1933
- return trimmed.length === 0 ? void 0 : trimmed;
2346
+ return trimmed.length === 0 ? undefined : trimmed;
1934
2347
  }
1935
2348
  function isBashExePath(path) {
1936
2349
  return path.toLowerCase().endsWith("bash.exe");
1937
2350
  }
1938
- var NON_GIT_BASH_LAUNCHER_DIR_SEGMENTS = ["\\windows\\system32\\", "\\microsoft\\windowsapps\\"];
1939
2351
  function isKnownNonGitBashLauncher(path) {
1940
2352
  const normalized = path.replaceAll("/", "\\").toLowerCase();
1941
2353
  return NON_GIT_BASH_LAUNCHER_DIR_SEGMENTS.some((segment) => normalized.includes(segment));
1942
2354
  }
1943
2355
  function whereCommand(command) {
1944
2356
  try {
1945
- return execFileSync("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
2357
+ return execFileSync2("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
1946
2358
  } catch (error) {
1947
- if (error instanceof Error) return [];
2359
+ if (error instanceof Error)
2360
+ return [];
1948
2361
  throw error;
1949
2362
  }
1950
2363
  }
1951
-
1952
- // ../../../scripts/install/hook-trust.mjs
1953
- import { createHash as createHash2 } from "node:crypto";
1954
- import { readFile as readFile11 } from "node:fs/promises";
1955
- import { join as join13 } from "node:path";
1956
- var EVENT_LABELS = /* @__PURE__ */ new Map([
1957
- ["PreToolUse", "pre_tool_use"],
1958
- ["PermissionRequest", "permission_request"],
1959
- ["PostToolUse", "post_tool_use"],
1960
- ["PreCompact", "pre_compact"],
1961
- ["PostCompact", "post_compact"],
1962
- ["SessionStart", "session_start"],
1963
- ["UserPromptSubmit", "user_prompt_submit"],
1964
- ["SubagentStart", "subagent_start"],
1965
- ["SubagentStop", "subagent_stop"],
1966
- ["Stop", "stop"]
1967
- ]);
1968
- async function trustedHookStatesForPlugin({ marketplaceName, pluginName, pluginRoot }) {
1969
- const manifestPath = join13(pluginRoot, ".codex-plugin", "plugin.json");
1970
- if (!await exists(manifestPath)) return [];
1971
- const manifest = JSON.parse(await readFile11(manifestPath, "utf8"));
1972
- if (!isRecord2(manifest) || typeof manifest.hooks !== "string") return [];
1973
- const hooksPath = join13(pluginRoot, manifest.hooks);
1974
- if (!await exists(hooksPath)) return [];
1975
- const parsed = JSON.parse(await readFile11(hooksPath, "utf8"));
1976
- if (!isRecord2(parsed) || !isRecord2(parsed.hooks)) return [];
1977
- const keySource = `${pluginName}@${marketplaceName}:${stripDotSlash(manifest.hooks)}`;
1978
- const states = [];
1979
- for (const [eventName, groups] of Object.entries(parsed.hooks)) {
1980
- if (!Array.isArray(groups)) continue;
1981
- const eventLabel = EVENT_LABELS.get(eventName);
1982
- if (eventLabel === void 0) continue;
1983
- for (const [groupIndex, group] of groups.entries()) {
1984
- if (!isRecord2(group) || !Array.isArray(group.hooks)) continue;
1985
- for (const [handlerIndex, handler] of group.hooks.entries()) {
1986
- if (!isRecord2(handler) || handler.type !== "command") continue;
1987
- if (handler.async === true) continue;
1988
- if (typeof handler.command !== "string" || handler.command.trim() === "") continue;
1989
- const key = `${keySource}:${eventLabel}:${groupIndex}:${handlerIndex}`;
1990
- states.push({
1991
- key,
1992
- trustedHash: commandHookHash(eventLabel, group.matcher, handler)
1993
- });
1994
- }
1995
- }
2364
+ // ../src/install/git-bash.ts
2365
+ var SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY = "OMO_CODEX_SKIP_GIT_BASH_AUTO_INSTALL";
2366
+ var resolveGitBashForCurrentProcess2 = (input = {}) => {
2367
+ return toCodexResolution(resolveGitBashForCurrentProcess(input));
2368
+ };
2369
+ async function prepareGitBashForInstall(input) {
2370
+ const resolve6 = input.resolveGitBash ?? (() => resolveGitBashForCurrentProcess2({ platform: input.platform, env: input.env }));
2371
+ const initialResolution = resolve6();
2372
+ if (input.platform !== "win32" || initialResolution.found)
2373
+ return initialResolution;
2374
+ if (input.env[SKIP_GIT_BASH_AUTO_INSTALL_ENV_KEY] === "1")
2375
+ return initialResolution;
2376
+ try {
2377
+ await input.runCommand("winget", WINGET_INSTALL_ARGS, { cwd: input.cwd });
2378
+ } catch (error) {
2379
+ if (!(error instanceof Error))
2380
+ throw error;
2381
+ return initialResolution;
1996
2382
  }
1997
- return states;
1998
- }
1999
- function commandHookHash(eventName, matcher, handler) {
2000
- const command = handler.command;
2001
- const timeout = Math.max(Number(handler.timeout ?? 600), 1);
2002
- const normalizedHandler = {
2003
- type: "command",
2004
- command,
2005
- timeout,
2006
- async: false
2007
- };
2008
- if (typeof handler.statusMessage === "string") normalizedHandler.statusMessage = handler.statusMessage;
2009
- const identity = {
2010
- event_name: eventName,
2011
- hooks: [normalizedHandler]
2012
- };
2013
- if (typeof matcher === "string") identity.matcher = matcher;
2014
- return `sha256:${createHash2("sha256").update(JSON.stringify(canonicalJson(identity))).digest("hex")}`;
2383
+ return resolve6();
2015
2384
  }
2016
- function canonicalJson(value) {
2017
- if (Array.isArray(value)) return value.map(canonicalJson);
2018
- if (!isRecord2(value)) return value;
2019
- const result = {};
2020
- for (const key of Object.keys(value).sort()) {
2021
- result[key] = canonicalJson(value[key]);
2385
+ function toCodexResolution(resolution) {
2386
+ if (resolution.found) {
2387
+ return {
2388
+ found: true,
2389
+ path: resolution.path,
2390
+ source: resolution.source
2391
+ };
2022
2392
  }
2023
- return result;
2024
- }
2025
- function stripDotSlash(value) {
2026
- return value.startsWith("./") ? value.slice(2) : value;
2393
+ return {
2394
+ ...resolution,
2395
+ installHint: [
2396
+ "Git Bash is required for native Windows Codex profile installs.",
2397
+ "Install it with: winget install --id Git.Git -e --source winget",
2398
+ `For a custom install, set ${GIT_BASH_ENV_KEY2}=C:\\path\\to\\bash.exe`,
2399
+ "Then rerun `npx lazycodex-ai install`."
2400
+ ].join(`
2401
+ `)
2402
+ };
2027
2403
  }
2028
2404
 
2029
- // src/setup.ts
2405
+ // components/bootstrap/src/setup.ts
2030
2406
  var SETUP_MARKETPLACE_NAME = "sisyphuslabs";
2031
2407
  var SETUP_PLUGIN_NAME = "omo";
2032
2408
  var GIT_BASH_INSTALL_HINT = "winget install --id Git.Git -e --source winget";
@@ -2041,16 +2417,18 @@ async function runWorkerSetup(options) {
2041
2417
  return { degraded };
2042
2418
  }
2043
2419
  async function resolveGitBashStep(options, degraded) {
2044
- if (options.platform !== "win32") return false;
2420
+ if (options.platform !== "win32")
2421
+ return false;
2045
2422
  try {
2046
2423
  const resolution = await prepareGitBashForInstall({
2047
2424
  cwd: options.pluginRoot,
2048
2425
  env: options.env,
2049
2426
  platform: options.platform,
2050
2427
  runCommand: options.runCommand ?? defaultRunCommand,
2051
- ...options.resolveGitBash === void 0 ? {} : { resolveGitBash: options.resolveGitBash }
2428
+ ...options.resolveGitBash === undefined ? {} : { resolveGitBash: options.resolveGitBash }
2052
2429
  });
2053
- if (resolution.found) return true;
2430
+ if (resolution.found)
2431
+ return true;
2054
2432
  degraded.push({
2055
2433
  component: "git-bash",
2056
2434
  hint: GIT_BASH_INSTALL_HINT,
@@ -2066,9 +2444,9 @@ async function resolveGitBashStep(options, degraded) {
2066
2444
  return false;
2067
2445
  }
2068
2446
  async function linkBundledAgentsStep(options) {
2069
- const agentsTarget = join14(options.codexHome, "agents");
2447
+ const agentsTarget = join18(options.codexHome, "agents");
2070
2448
  try {
2071
- const stageRoot = join14(options.pluginData, "bootstrap", "agents-stage");
2449
+ const stageRoot = join18(options.pluginData, "bootstrap", "agents-stage");
2072
2450
  await stageBundledAgents(options.pluginRoot, stageRoot);
2073
2451
  const preservedReasoning = await capturePreservedAgentReasoning({ codexHome: options.codexHome });
2074
2452
  const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome: options.codexHome });
@@ -2094,22 +2472,23 @@ async function linkBundledAgentsStep(options) {
2094
2472
  }
2095
2473
  }
2096
2474
  async function stageBundledAgents(pluginRoot, stageRoot) {
2097
- await rm7(stageRoot, { force: true, recursive: true });
2475
+ await rm9(stageRoot, { force: true, recursive: true });
2098
2476
  await mkdir7(stageRoot, { recursive: true });
2099
- const componentsRoot = join14(pluginRoot, "components");
2477
+ const componentsRoot = join18(pluginRoot, "components");
2100
2478
  for (const componentName of await directoryNames(componentsRoot)) {
2101
- const agentsDir = join14(componentsRoot, componentName, "agents");
2479
+ const agentsDir = join18(componentsRoot, componentName, "agents");
2102
2480
  const agentFiles = (await fileNames(agentsDir)).filter((name) => name.endsWith(".toml"));
2103
- if (agentFiles.length === 0) continue;
2104
- const stagedAgentsDir = join14(stageRoot, "components", componentName, "agents");
2481
+ if (agentFiles.length === 0)
2482
+ continue;
2483
+ const stagedAgentsDir = join18(stageRoot, "components", componentName, "agents");
2105
2484
  await mkdir7(stagedAgentsDir, { recursive: true });
2106
2485
  for (const agentFile of agentFiles) {
2107
- await copyFile2(join14(agentsDir, agentFile), join14(stagedAgentsDir, agentFile));
2486
+ await copyFile2(join18(agentsDir, agentFile), join18(stagedAgentsDir, agentFile));
2108
2487
  }
2109
2488
  }
2110
2489
  }
2111
2490
  async function updateConfigStep(options, inputs, degraded) {
2112
- const configPath = join14(options.codexHome, "config.toml");
2491
+ const configPath = join18(options.codexHome, "config.toml");
2113
2492
  try {
2114
2493
  await assertWritableConfigIfPresent(configPath);
2115
2494
  const trustedHookStates = await trustedHookStatesForPlugin({
@@ -2119,18 +2498,14 @@ async function updateConfigStep(options, inputs, degraded) {
2119
2498
  });
2120
2499
  await updateCodexConfig({
2121
2500
  agentConfigs: inputs.agentConfigs,
2122
- // Hard invariant: the bootstrap worker NEVER writes permission keys
2123
- // (approval/sandbox/network policies stay installer-flag-only).
2124
2501
  autonomousPermissions: false,
2125
2502
  configPath,
2126
2503
  gitBashEnabled: inputs.gitBashEnabled,
2127
2504
  marketplaceName: SETUP_MARKETPLACE_NAME,
2505
+ marketplaceSource: { sourceType: "local", source: options.pluginRoot },
2128
2506
  platform: options.platform,
2129
2507
  pluginNames: [SETUP_PLUGIN_NAME],
2130
2508
  preserveMarketplaceSource: true,
2131
- // The marketplace plugin tree has no <root>/plugin/model-catalog.json,
2132
- // so updateCodexConfig falls back to the catalog bundled into this
2133
- // dist; bootstrap-setup.test.mjs guards against drift between the two.
2134
2509
  repoRoot: options.pluginRoot,
2135
2510
  trustedHookStates
2136
2511
  });
@@ -2144,14 +2519,16 @@ async function updateConfigStep(options, inputs, degraded) {
2144
2519
  }
2145
2520
  async function assertWritableConfigIfPresent(configPath) {
2146
2521
  try {
2147
- if (((await stat4(configPath)).mode & 146) === 0) throw new Error(`${configPath} has no write permission bits set`);
2522
+ if (((await stat4(configPath)).mode & 146) === 0)
2523
+ throw new Error(`${configPath} has no write permission bits set`);
2148
2524
  } catch (error) {
2149
- if (errorCode(error) === "ENOENT") return;
2525
+ if (errorCode(error) === "ENOENT")
2526
+ return;
2150
2527
  throw error;
2151
2528
  }
2152
2529
  }
2153
2530
  function errorCode(error) {
2154
- return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : void 0;
2531
+ return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : undefined;
2155
2532
  }
2156
2533
  async function linkComponentBinsStep(options, degraded) {
2157
2534
  const binDir = resolveCodexInstallerBinDir({ codexHome: options.codexHome, env: options.env });
@@ -2167,7 +2544,7 @@ async function linkComponentBinsStep(options, degraded) {
2167
2544
  await linkRuntimeWrapperStep(options, binDir, degraded);
2168
2545
  }
2169
2546
  async function linkRuntimeWrapperStep(options, binDir, degraded) {
2170
- const cliPath = join14(options.pluginRoot, "dist", "cli", "index.js");
2547
+ const cliPath = join18(options.pluginRoot, "dist", "cli", "index.js");
2171
2548
  try {
2172
2549
  const linked = await linkRootRuntimeBin({
2173
2550
  binDir,
@@ -2175,7 +2552,8 @@ async function linkRuntimeWrapperStep(options, binDir, degraded) {
2175
2552
  platform: options.platform,
2176
2553
  repoRoot: options.pluginRoot
2177
2554
  });
2178
- if (linked !== null) return;
2555
+ if (linked !== null)
2556
+ return;
2179
2557
  degraded.push({
2180
2558
  component: "omo-cli",
2181
2559
  hint: "use npx lazycodex-ai for the omo CLI",
@@ -2199,7 +2577,7 @@ async function stampGitBashEnvStep(options, degraded) {
2199
2577
  degraded.push({
2200
2578
  component: "git-bash-env",
2201
2579
  hint: BOOTSTRAP_DOCTOR_HINT,
2202
- reason: `failed to stamp ${join14(options.pluginRoot, ".mcp.json")}: ${errorMessage(error)}`
2580
+ reason: `failed to stamp ${join18(options.pluginRoot, ".mcp.json")}: ${errorMessage(error)}`
2203
2581
  });
2204
2582
  }
2205
2583
  }
@@ -2218,7 +2596,8 @@ async function entryNames(root, keep) {
2218
2596
  const entries = await readdir3(root, { withFileTypes: true });
2219
2597
  return entries.filter((entry) => keep(entry)).map((entry) => entry.name).sort();
2220
2598
  } catch (error) {
2221
- if (error instanceof Error && "code" in error && error.code === "ENOENT") return [];
2599
+ if (error instanceof Error && "code" in error && error.code === "ENOENT")
2600
+ return [];
2222
2601
  throw error;
2223
2602
  }
2224
2603
  }
@@ -2229,14 +2608,14 @@ function errorMessage(error) {
2229
2608
  return error instanceof Error ? error.message : String(error);
2230
2609
  }
2231
2610
 
2232
- // src/worker.ts
2611
+ // components/bootstrap/src/worker.ts
2233
2612
  var BOOTSTRAP_DOCTOR_HINT = "npx lazycodex-ai doctor";
2234
2613
  function parseWorkerFlags(argv) {
2235
2614
  let codexHome;
2236
2615
  let manifestDir;
2237
2616
  let once = false;
2238
2617
  let only;
2239
- for (let index = 0; index < argv.length; index += 1) {
2618
+ for (let index = 0;index < argv.length; index += 1) {
2240
2619
  const flag = argv[index];
2241
2620
  if (flag === "--once") {
2242
2621
  once = true;
@@ -2261,41 +2640,44 @@ function parseWorkerFlags(argv) {
2261
2640
  }
2262
2641
  return {
2263
2642
  once,
2264
- ...codexHome === void 0 ? {} : { codexHome },
2265
- ...manifestDir === void 0 ? {} : { manifestDir },
2266
- ...only === void 0 ? {} : { only }
2643
+ ...codexHome === undefined ? {} : { codexHome },
2644
+ ...manifestDir === undefined ? {} : { manifestDir },
2645
+ ...only === undefined ? {} : { only }
2267
2646
  };
2268
2647
  }
2269
2648
  function resolvePluginDataRoot(env) {
2270
2649
  const fromEnv = env["PLUGIN_DATA"]?.trim();
2271
- if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
2272
- return join15(homedir4(), ".local", "share", "lazycodex");
2650
+ if (fromEnv !== undefined && fromEnv.length > 0)
2651
+ return fromEnv;
2652
+ return join19(homedir4(), ".local", "share", "lazycodex");
2273
2653
  }
2274
2654
  async function readPluginVersion(pluginRoot) {
2275
2655
  try {
2276
- const parsed = JSON.parse(await readFile12(join15(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
2277
- if (typeof parsed !== "object" || parsed === null) return void 0;
2656
+ const parsed = JSON.parse(await readFile12(join19(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
2657
+ if (typeof parsed !== "object" || parsed === null)
2658
+ return;
2278
2659
  const version = parsed["version"];
2279
- if (typeof version !== "string") return void 0;
2660
+ if (typeof version !== "string")
2661
+ return;
2280
2662
  const trimmed = version.trim();
2281
- return trimmed.length > 0 ? trimmed : void 0;
2663
+ return trimmed.length > 0 ? trimmed : undefined;
2282
2664
  } catch {
2283
- return void 0;
2665
+ return;
2284
2666
  }
2285
2667
  }
2286
2668
  async function readBootstrapState(statePath) {
2287
2669
  return parseBootstrapState(await readState(statePath));
2288
2670
  }
2289
2671
  function parseBootstrapState(raw) {
2290
- const completedForVersion = typeof raw["completedForVersion"] === "string" ? raw["completedForVersion"] : void 0;
2291
- const lastAttemptAt = typeof raw["lastAttemptAt"] === "number" ? raw["lastAttemptAt"] : void 0;
2292
- const lastStatus = raw["lastStatus"] === "success" || raw["lastStatus"] === "degraded" ? raw["lastStatus"] : void 0;
2672
+ const completedForVersion = typeof raw["completedForVersion"] === "string" ? raw["completedForVersion"] : undefined;
2673
+ const lastAttemptAt = typeof raw["lastAttemptAt"] === "number" ? raw["lastAttemptAt"] : undefined;
2674
+ const lastStatus = raw["lastStatus"] === "success" || raw["lastStatus"] === "degraded" ? raw["lastStatus"] : undefined;
2293
2675
  const degraded = parseDegradedEntries(raw["degraded"]);
2294
2676
  return {
2295
- ...completedForVersion === void 0 ? {} : { completedForVersion },
2296
- ...lastAttemptAt === void 0 ? {} : { lastAttemptAt },
2297
- ...lastStatus === void 0 ? {} : { lastStatus },
2298
- ...degraded === void 0 ? {} : { degraded }
2677
+ ...completedForVersion === undefined ? {} : { completedForVersion },
2678
+ ...lastAttemptAt === undefined ? {} : { lastAttemptAt },
2679
+ ...lastStatus === undefined ? {} : { lastStatus },
2680
+ ...degraded === undefined ? {} : { degraded }
2299
2681
  };
2300
2682
  }
2301
2683
  function defaultWorkerSteps(seams = {}) {
@@ -2321,11 +2703,12 @@ async function runBootstrapWorker(options = {}) {
2321
2703
  const statePath = resolveBootstrapStatePath(pluginData);
2322
2704
  const lockEnv = { ...env, PLUGIN_DATA: pluginData };
2323
2705
  const locks = await bootstrapLocks({ env: lockEnv, now, pluginData });
2324
- if (locks === null) return { ran: false, reason: "locked" };
2706
+ if (locks === null)
2707
+ return { ran: false, reason: "locked" };
2325
2708
  try {
2326
2709
  const pluginVersion = await readPluginVersion(pluginRoot);
2327
2710
  const marker = await readBootstrapState(statePath);
2328
- if (!flags.once && pluginVersion !== void 0 && marker.completedForVersion === pluginVersion) {
2711
+ if (!flags.once && pluginVersion !== undefined && marker.completedForVersion === pluginVersion) {
2329
2712
  await appendBootstrapLog(pluginData, now, "worker-skipped", { reason: "already-completed", version: pluginVersion });
2330
2713
  return { ran: false, reason: "already-completed" };
2331
2714
  }
@@ -2333,20 +2716,21 @@ async function runBootstrapWorker(options = {}) {
2333
2716
  const context = { codexHome, env, flags, now, platform, pluginData, pluginRoot, pluginVersion };
2334
2717
  await appendBootstrapLog(pluginData, now, "worker-started", { version: pluginVersion ?? "unknown" });
2335
2718
  const degraded = [];
2336
- if (pluginVersion === void 0) {
2719
+ if (pluginVersion === undefined) {
2337
2720
  degraded.push({
2338
2721
  component: "bootstrap",
2339
2722
  hint: BOOTSTRAP_DOCTOR_HINT,
2340
- reason: `plugin version unresolved from ${join15(pluginRoot, ".codex-plugin", "plugin.json")}`
2723
+ reason: `plugin version unresolved from ${join19(pluginRoot, ".codex-plugin", "plugin.json")}`
2341
2724
  });
2342
2725
  }
2343
2726
  for (const step of steps) {
2344
- if (flags.only !== void 0 && step.name !== flags.only) continue;
2727
+ if (flags.only !== undefined && step.name !== flags.only)
2728
+ continue;
2345
2729
  degraded.push(...await runStep(step, context));
2346
2730
  }
2347
2731
  const status = degraded.length === 0 ? "success" : "degraded";
2348
2732
  const state = {
2349
- ...pluginVersion === void 0 ? {} : { completedForVersion: pluginVersion },
2733
+ ...pluginVersion === undefined ? {} : { completedForVersion: pluginVersion },
2350
2734
  degraded,
2351
2735
  lastAttemptAt: now,
2352
2736
  lastStatus: status
@@ -2373,25 +2757,28 @@ async function runStep(step, context) {
2373
2757
  }
2374
2758
  function resolvePluginRoot(env) {
2375
2759
  const fromEnv = env["PLUGIN_ROOT"]?.trim();
2376
- if (fromEnv !== void 0 && fromEnv.length > 0) return fromEnv;
2377
- return resolve5(dirname8(fileURLToPath2(import.meta.url)), "..", "..", "..");
2760
+ if (fromEnv !== undefined && fromEnv.length > 0)
2761
+ return fromEnv;
2762
+ return resolve6(dirname7(fileURLToPath2(import.meta.url)), "..", "..", "..");
2378
2763
  }
2379
2764
  async function appendBootstrapLog(pluginData, now, event, details) {
2380
2765
  try {
2381
- const logPath = join15(pluginData, "bootstrap", "bootstrap.log");
2382
- await mkdir8(dirname8(logPath), { recursive: true });
2766
+ const logPath = join19(pluginData, "bootstrap", "bootstrap.log");
2767
+ await mkdir8(dirname7(logPath), { recursive: true });
2383
2768
  await appendFile2(logPath, `${JSON.stringify({ timestamp: new Date(now).toISOString(), event, ...details })}
2384
2769
  `);
2385
- } catch {
2386
- }
2770
+ } catch {}
2387
2771
  }
2388
2772
  function parseDegradedEntries(raw) {
2389
- if (!Array.isArray(raw)) return void 0;
2773
+ if (!Array.isArray(raw))
2774
+ return;
2390
2775
  const entries = [];
2391
2776
  for (const candidate of raw) {
2392
- if (typeof candidate !== "object" || candidate === null) continue;
2777
+ if (typeof candidate !== "object" || candidate === null)
2778
+ continue;
2393
2779
  const record = candidate;
2394
- if (typeof record["component"] !== "string" || typeof record["reason"] !== "string") continue;
2780
+ if (typeof record["component"] !== "string" || typeof record["reason"] !== "string")
2781
+ continue;
2395
2782
  entries.push({
2396
2783
  component: record["component"],
2397
2784
  reason: record["reason"],
@@ -2402,30 +2789,34 @@ function parseDegradedEntries(raw) {
2402
2789
  }
2403
2790
  function requireFlagValue(argv, index, flag) {
2404
2791
  const value = argv[index + 1];
2405
- if (value === void 0 || value.startsWith("--")) {
2792
+ if (value === undefined || value.startsWith("--")) {
2406
2793
  throw new Error(`${flag} requires a value`);
2407
2794
  }
2408
2795
  return value;
2409
2796
  }
2410
2797
 
2411
- // src/hook.ts
2412
- var BOOTSTRAP_RESTART_NOTICE = "LazyCodex bootstrap running in background \u2014 restart the session when it completes";
2798
+ // components/bootstrap/src/hook.ts
2799
+ var BOOTSTRAP_RESTART_NOTICE = "LazyCodex bootstrap running in background restart the session when it completes";
2413
2800
  async function runSessionStartHook(options) {
2414
2801
  return (await executeSessionStartHook(options)).exitCode;
2415
2802
  }
2416
2803
  async function executeSessionStartHook(options) {
2417
- if (options.stdin !== void 0) await drainStdin(options.stdin);
2804
+ if (options.stdin !== undefined)
2805
+ await drainStdin(options.stdin);
2418
2806
  const now = options.now ?? Date.now();
2419
2807
  const pluginRoot = options.env["PLUGIN_ROOT"]?.trim();
2420
2808
  const pluginData = options.env["PLUGIN_DATA"]?.trim();
2421
- if (pluginRoot === void 0 || pluginRoot.length === 0 || pluginData === void 0 || pluginData.length === 0) {
2809
+ if (pluginRoot === undefined || pluginRoot.length === 0 || pluginData === undefined || pluginData.length === 0) {
2422
2810
  return { action: "skip-missing-env", exitCode: 0 };
2423
2811
  }
2424
2812
  const pluginVersion = await readPluginVersion(pluginRoot);
2425
- if (pluginVersion === void 0) return { action: "skip-version-unresolved", exitCode: 0 };
2813
+ if (pluginVersion === undefined)
2814
+ return { action: "skip-version-unresolved", exitCode: 0 };
2426
2815
  const state = await readBootstrapState(resolveBootstrapStatePath(pluginData));
2427
- if (state.completedForVersion === pluginVersion) return { action: "skip-completed", exitCode: 0 };
2428
- if (await isLockFresh(resolveBootstrapLockPath(pluginData), now)) return { action: "skip-locked", exitCode: 0 };
2816
+ if (state.completedForVersion === pluginVersion)
2817
+ return { action: "skip-completed", exitCode: 0 };
2818
+ if (await isLockFresh(resolveBootstrapLockPath(pluginData), now))
2819
+ return { action: "skip-locked", exitCode: 0 };
2429
2820
  const spawnWorker = options.spawnWorker ?? spawnDetachedWorker;
2430
2821
  spawnWorker({
2431
2822
  args: [options.workerCliPath ?? defaultWorkerCliPath(), "worker"],
@@ -2434,18 +2825,16 @@ async function executeSessionStartHook(options) {
2434
2825
  });
2435
2826
  const writeNotice = options.writeNotice ?? ((line) => process.stdout.write(`${line}
2436
2827
  `));
2437
- writeNotice(
2438
- JSON.stringify({
2439
- hookSpecificOutput: {
2440
- hookEventName: "SessionStart",
2441
- additionalContext: BOOTSTRAP_RESTART_NOTICE
2442
- }
2443
- })
2444
- );
2828
+ writeNotice(JSON.stringify({
2829
+ hookSpecificOutput: {
2830
+ hookEventName: "SessionStart",
2831
+ additionalContext: BOOTSTRAP_RESTART_NOTICE
2832
+ }
2833
+ }));
2445
2834
  return { action: "spawned", exitCode: 0 };
2446
2835
  }
2447
2836
  function spawnDetachedWorker(invocation) {
2448
- const child = spawn(invocation.command, [...invocation.args], {
2837
+ const child = spawn2(invocation.command, [...invocation.args], {
2449
2838
  detached: true,
2450
2839
  env: invocation.env,
2451
2840
  stdio: "ignore"
@@ -2464,17 +2853,21 @@ async function isLockFresh(lockPath, now) {
2464
2853
  }
2465
2854
  }
2466
2855
  async function drainStdin(stdin) {
2467
- if (stdin.isTTY === true) return;
2468
- for await (const chunk of stdin) {
2469
- void chunk;
2470
- }
2856
+ if (stdin.isTTY === true)
2857
+ return;
2858
+ for await (const chunk of stdin) {}
2471
2859
  }
2472
2860
 
2473
- // src/cli.ts
2474
- var TOP_LEVEL_HELP = "Usage:\n omo-bootstrap hook session-start\n omo-bootstrap worker [--codex-home <dir>] [--once] [--only <step>] [--manifest-dir <dir>]\n omo-bootstrap download <manifest> <platform> <destination-dir>\n omo-bootstrap help | --help | -h\n";
2861
+ // components/bootstrap/src/cli.ts
2862
+ var TOP_LEVEL_HELP = `Usage:
2863
+ omo-bootstrap hook session-start
2864
+ omo-bootstrap worker [--codex-home <dir>] [--once] [--only <step>] [--manifest-dir <dir>]
2865
+ omo-bootstrap download <manifest> <platform> <destination-dir>
2866
+ omo-bootstrap help | --help | -h
2867
+ `;
2475
2868
  async function runDownloadCommand(args) {
2476
2869
  const [manifestName, platformKey, destinationDir] = args;
2477
- if (manifestName === void 0 || platformKey === void 0 || destinationDir === void 0) {
2870
+ if (manifestName === undefined || platformKey === undefined || destinationDir === undefined) {
2478
2871
  process.stderr.write(`[omo-bootstrap] download requires <manifest> <platform> <destination-dir>
2479
2872
  ${TOP_LEVEL_HELP}`);
2480
2873
  return 1;
@@ -2505,17 +2898,15 @@ ${TOP_LEVEL_HELP}`);
2505
2898
  `);
2506
2899
  return 0;
2507
2900
  }
2508
- process.stdout.write(
2509
- result.ran ? `[omo-bootstrap] worker finished: ${result.status}
2901
+ process.stdout.write(result.ran ? `[omo-bootstrap] worker finished: ${result.status}
2510
2902
  ` : `[omo-bootstrap] worker skipped: ${result.reason}
2511
- `
2512
- );
2903
+ `);
2513
2904
  return 0;
2514
2905
  }
2515
2906
  async function main() {
2516
2907
  const argv = process.argv.slice(2);
2517
2908
  const command = argv[0];
2518
- if (command === void 0 || command === "help" || command === "--help" || command === "-h") {
2909
+ if (command === undefined || command === "help" || command === "--help" || command === "-h") {
2519
2910
  process.stdout.write(TOP_LEVEL_HELP);
2520
2911
  return 0;
2521
2912
  }
@@ -2534,7 +2925,8 @@ ${TOP_LEVEL_HELP}`);
2534
2925
  }
2535
2926
  function isProcessEntry() {
2536
2927
  const entry = process.argv[1];
2537
- if (entry === void 0) return false;
2928
+ if (entry === undefined)
2929
+ return false;
2538
2930
  try {
2539
2931
  return realpathSync(entry) === realpathSync(fileURLToPath4(import.meta.url));
2540
2932
  } catch {
@@ -2551,33 +2943,33 @@ if (isProcessEntry()) {
2551
2943
  });
2552
2944
  }
2553
2945
  export {
2554
- BOOTSTRAP_DOCTOR_HINT,
2555
- BOOTSTRAP_RESTART_NOTICE,
2556
- GIT_BASH_INSTALL_HINT,
2557
- INSTALL_SNAPSHOT_FILENAME,
2558
- SETUP_MARKETPLACE_NAME,
2559
- SETUP_PLUGIN_NAME,
2560
- SG_FORCE_PROVISION_ENV_KEY,
2561
- SG_PROVISION_COMPONENT,
2562
- appendBootstrapLog,
2563
- bootstrapLocks,
2564
- defaultWorkerSteps,
2565
- detectInstallFlow,
2566
- detectInstallFlowDetailed,
2567
- detectInstallFlowForTest,
2568
- detectInstallFlowFromEnvironment,
2569
- executeSessionStartHook,
2570
- parseBootstrapState,
2571
- parseWorkerFlags,
2572
- readBootstrapState,
2573
- readPluginVersion,
2574
- resolveBootstrapLockPath,
2575
- resolveBootstrapStatePath,
2576
- resolveCodexHome,
2577
- resolvePluginDataRoot,
2578
- runBootstrapWorker,
2579
- runSessionStartHook,
2580
- runSgProvision,
2946
+ sgProvisionDestination,
2581
2947
  runWorkerSetup,
2582
- sgProvisionDestination
2948
+ runSgProvision,
2949
+ runSessionStartHook,
2950
+ runBootstrapWorker,
2951
+ resolvePluginDataRoot,
2952
+ resolveCodexHome,
2953
+ resolveBootstrapStatePath,
2954
+ resolveBootstrapLockPath,
2955
+ readPluginVersion,
2956
+ readBootstrapState,
2957
+ parseWorkerFlags,
2958
+ parseBootstrapState,
2959
+ executeSessionStartHook,
2960
+ detectInstallFlowFromEnvironment,
2961
+ detectInstallFlowForTest,
2962
+ detectInstallFlowDetailed,
2963
+ detectInstallFlow,
2964
+ defaultWorkerSteps,
2965
+ bootstrapLocks,
2966
+ appendBootstrapLog,
2967
+ SG_PROVISION_COMPONENT,
2968
+ SG_FORCE_PROVISION_ENV_KEY,
2969
+ SETUP_PLUGIN_NAME,
2970
+ SETUP_MARKETPLACE_NAME,
2971
+ INSTALL_SNAPSHOT_FILENAME,
2972
+ GIT_BASH_INSTALL_HINT,
2973
+ BOOTSTRAP_RESTART_NOTICE,
2974
+ BOOTSTRAP_DOCTOR_HINT
2583
2975
  };