oh-my-opencode 4.9.2 → 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 (1799) 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/opencode-qa/scripts/lib/common.sh +39 -1
  18. package/.agents/skills/tech-debt-audit/SKILL.md +277 -0
  19. package/.agents/skills/work-with-pr/SKILL.md +77 -53
  20. package/.agents/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +1 -1
  21. package/.opencode/skills/work-with-pr/SKILL.md +79 -55
  22. package/.opencode/skills/work-with-pr-workspace/iteration-1/eval-5/with_skill/outputs/execution-plan.md +1 -1
  23. package/README.ja.md +3 -3
  24. package/README.ko.md +3 -3
  25. package/README.md +2 -2
  26. package/README.ru.md +3 -3
  27. package/README.zh-cn.md +3 -3
  28. package/THIRD-PARTY-NOTICES.md +205 -0
  29. package/bin/platform.js +5 -0
  30. package/bin/platform.test.ts +56 -0
  31. package/dist/agents/atlas/agent.d.ts +4 -3
  32. package/dist/agents/dynamic-agent-prompt-types.d.ts +1 -1
  33. package/dist/agents/gpt-apply-patch-guard.d.ts +2 -2
  34. package/dist/agents/hephaestus/agent.d.ts +5 -0
  35. package/dist/agents/hephaestus/index.d.ts +1 -1
  36. package/dist/agents/index.d.ts +0 -1
  37. package/dist/agents/metis.d.ts +1 -0
  38. package/dist/agents/prometheus/index.d.ts +0 -1
  39. package/dist/agents/prometheus/system-prompt.d.ts +0 -2
  40. package/dist/agents/sisyphus/kimi-k2-7.d.ts +17 -0
  41. package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
  42. package/dist/agents/sisyphus-junior/kimi-k2-7.d.ts +11 -0
  43. package/dist/agents/types.d.ts +2 -2
  44. package/dist/cli/config-manager/add-tui-plugin-to-tui-config.d.ts +7 -0
  45. package/dist/cli/doctor/checks/codex-components.d.ts +13 -0
  46. package/dist/cli/doctor/checks/codex-runtime-wrapper.d.ts +7 -0
  47. package/dist/cli/doctor/checks/codex.d.ts +1 -1
  48. package/dist/cli/doctor/checks/config.d.ts +1 -1
  49. package/dist/cli/doctor/checks/dependencies.d.ts +1 -2
  50. package/dist/cli/doctor/checks/index.d.ts +1 -1
  51. package/dist/cli/doctor/checks/model-resolution.d.ts +1 -1
  52. package/dist/cli/doctor/checks/system.d.ts +1 -1
  53. package/dist/cli/doctor/checks/team-mode.d.ts +1 -1
  54. package/dist/cli/doctor/checks/tools-gh.d.ts +1 -1
  55. package/dist/cli/doctor/checks/tools-mcp.d.ts +1 -1
  56. package/dist/cli/doctor/checks/tools.d.ts +2 -1
  57. package/dist/cli/doctor/checks/tui-plugin-config.d.ts +8 -1
  58. package/dist/cli/doctor/framework/constants.d.ts +32 -0
  59. package/dist/cli/doctor/framework/spawn-with-timeout.d.ts +8 -0
  60. package/dist/cli/doctor/framework/types.d.ts +147 -0
  61. package/dist/cli/doctor/index.d.ts +4 -4
  62. package/dist/cli/doctor/runner.d.ts +1 -1
  63. package/dist/cli/index.js +10353 -7521
  64. package/dist/cli/install-ast-grep-sg.d.ts +10 -0
  65. package/dist/cli/install-codex/codex-cache-bins.d.ts +1 -21
  66. package/dist/cli/install-codex/codex-cache-bundled-mcps.d.ts +1 -5
  67. package/dist/cli/install-codex/codex-cache-command-shim.d.ts +1 -1
  68. package/dist/cli/install-codex/codex-cache-fs.d.ts +1 -3
  69. package/dist/cli/install-codex/codex-cache-install.d.ts +1 -13
  70. package/dist/cli/install-codex/codex-cache-legacy-bins.d.ts +1 -3
  71. package/dist/cli/install-codex/codex-cache-local-dependencies.d.ts +1 -1
  72. package/dist/cli/install-codex/codex-cache-mcp-manifest.d.ts +1 -2
  73. package/dist/cli/install-codex/codex-cache-paths.d.ts +1 -2
  74. package/dist/cli/install-codex/codex-cache-prune.d.ts +1 -10
  75. package/dist/cli/install-codex/codex-cache.d.ts +1 -4
  76. package/dist/cli/install-codex/codex-cached-marketplace-manifest.d.ts +1 -6
  77. package/dist/cli/install-codex/codex-cleanup-config.d.ts +1 -6
  78. package/dist/cli/install-codex/codex-cleanup.d.ts +1 -21
  79. package/dist/cli/install-codex/codex-config-agents.d.ts +1 -3
  80. package/dist/cli/install-codex/codex-config-features.d.ts +1 -1
  81. package/dist/cli/install-codex/codex-config-marketplaces.d.ts +1 -6
  82. package/dist/cli/install-codex/codex-config-permissions.d.ts +1 -1
  83. package/dist/cli/install-codex/codex-config-plugins.d.ts +1 -9
  84. package/dist/cli/install-codex/codex-config-reasoning.d.ts +1 -2
  85. package/dist/cli/install-codex/codex-config-toml-sections.d.ts +1 -9
  86. package/dist/cli/install-codex/codex-config-toml.d.ts +1 -13
  87. package/dist/cli/install-codex/codex-hook-trust.d.ts +1 -6
  88. package/dist/cli/install-codex/codex-installation-detection.d.ts +1 -36
  89. package/dist/cli/install-codex/codex-installer-bin-dir.d.ts +1 -8
  90. package/dist/cli/install-codex/codex-marketplace-snapshot.d.ts +1 -15
  91. package/dist/cli/install-codex/codex-marketplace.d.ts +1 -9
  92. package/dist/cli/install-codex/codex-model-catalog.d.ts +1 -13
  93. package/dist/cli/install-codex/codex-multi-agent-v2-config.d.ts +1 -12
  94. package/dist/cli/install-codex/codex-package-layout.d.ts +1 -1
  95. package/dist/cli/install-codex/codex-process.d.ts +1 -7
  96. package/dist/cli/install-codex/codex-project-local-cleanup-best-effort.d.ts +1 -7
  97. package/dist/cli/install-codex/codex-project-local-cleanup.d.ts +1 -35
  98. package/dist/cli/install-codex/git-bash.d.ts +1 -35
  99. package/dist/cli/install-codex/index.d.ts +1 -11
  100. package/dist/cli/install-codex/install-codex-test-fixtures.d.ts +34 -0
  101. package/dist/cli/install-codex/install-codex.d.ts +1 -10
  102. package/dist/cli/install-codex/lazycodex-version-stamp.d.ts +1 -19
  103. package/dist/cli/install-codex/link-cached-plugin-agents.d.ts +1 -16
  104. package/dist/cli/install-codex/lsp-daemon-reaper.d.ts +1 -5
  105. package/dist/cli/install-codex/toml-section-editor.d.ts +1 -11
  106. package/dist/cli/install-codex/types.d.ts +1 -76
  107. package/dist/cli/mcp-oauth/login.d.ts +1 -1
  108. package/dist/cli/model-fallback.d.ts +1 -0
  109. package/dist/cli/provider-availability.d.ts +2 -0
  110. package/dist/cli-node/index.js +10433 -7546
  111. package/dist/config/index.d.ts +1 -1
  112. package/dist/config/schema/agent-names.d.ts +1 -1
  113. package/dist/config/schema/agent-overrides.d.ts +80 -16
  114. package/dist/config/schema/codegraph.d.ts +9 -0
  115. package/dist/config/schema/experimental.d.ts +0 -1
  116. package/dist/config/schema/git-env-prefix.d.ts +1 -5
  117. package/dist/config/schema/hooks.d.ts +3 -1
  118. package/dist/config/schema/internal/permission.d.ts +5 -1
  119. package/dist/config/schema/monitor.d.ts +15 -0
  120. package/dist/config/schema/oh-my-opencode-config.d.ts +102 -32
  121. package/dist/config/schema/openclaw.d.ts +5 -4
  122. package/dist/config/schema/team-mode.d.ts +1 -16
  123. package/dist/config/schema/tmux.d.ts +4 -5
  124. package/dist/config/schema/tui.d.ts +10 -0
  125. package/dist/config/schema.d.ts +2 -0
  126. package/dist/config/validate.d.ts +8 -0
  127. package/dist/create-hooks.d.ts +5 -1
  128. package/dist/create-managers.d.ts +7 -0
  129. package/dist/create-runtime-tmux-config.d.ts +1 -1
  130. package/dist/create-tools.d.ts +1 -1
  131. package/dist/features/background-agent/error-classifier.d.ts +2 -2
  132. package/dist/features/background-agent/index.d.ts +1 -1
  133. package/dist/features/background-agent/manager.d.ts +35 -2
  134. package/dist/features/background-agent/parent-wake-dispatched-tracker.d.ts +8 -0
  135. package/dist/features/background-agent/parent-wake-notifier.d.ts +4 -0
  136. package/dist/features/background-agent/spawner/fallback-agent.d.ts +3 -2
  137. package/dist/features/background-agent/spawner/task-prompt-body.d.ts +5 -6
  138. package/dist/features/background-agent/task-snapshot.d.ts +2 -0
  139. package/dist/features/background-agent/types.d.ts +9 -0
  140. package/dist/features/builtin-commands/templates/refactor-sections/intro-and-analysis.d.ts +1 -1
  141. package/dist/features/builtin-commands/templates/refactor-sections/plan-and-execution.d.ts +1 -1
  142. package/dist/features/builtin-commands/templates/refactor-sections/team-mode-addendum.d.ts +1 -1
  143. package/dist/features/builtin-commands/templates/refactor-sections/verification-and-tooling.d.ts +1 -1
  144. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
  145. package/dist/features/builtin-skills/index.d.ts +1 -2
  146. package/dist/features/builtin-skills/skill-file-loader.d.ts +1 -4
  147. package/dist/features/builtin-skills/skills/agent-browser-skill.d.ts +1 -2
  148. package/dist/features/builtin-skills/skills/agent-browser-template.d.ts +1 -2
  149. package/dist/features/builtin-skills/skills/debugging.d.ts +1 -2
  150. package/dist/features/builtin-skills/skills/dev-browser.d.ts +1 -2
  151. package/dist/features/builtin-skills/skills/frontend.d.ts +1 -0
  152. package/dist/features/builtin-skills/skills/git-master-sections/commit-atomic-planning.d.ts +1 -1
  153. package/dist/features/builtin-skills/skills/git-master-sections/commit-context-analysis.d.ts +1 -1
  154. package/dist/features/builtin-skills/skills/git-master-sections/commit-execution-verification.d.ts +1 -1
  155. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
  156. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +1 -1
  157. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +1 -1
  158. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +1 -1
  159. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +1 -1
  160. package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +1 -2
  161. package/dist/features/builtin-skills/skills/git-master.d.ts +1 -2
  162. package/dist/features/builtin-skills/skills/index.d.ts +1 -13
  163. package/dist/features/builtin-skills/skills/init-deep.d.ts +1 -2
  164. package/dist/features/builtin-skills/skills/playwright-cli.d.ts +1 -10
  165. package/dist/features/builtin-skills/skills/playwright-mcp-skill.d.ts +1 -2
  166. package/dist/features/builtin-skills/skills/playwright.d.ts +1 -2
  167. package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +1 -2
  168. package/dist/features/builtin-skills/skills/review-work.d.ts +1 -2
  169. package/dist/features/builtin-skills/skills/security-research.d.ts +1 -2
  170. package/dist/features/builtin-skills/skills/security-review.d.ts +1 -2
  171. package/dist/features/builtin-skills/skills/team-mode.d.ts +1 -2
  172. package/dist/features/builtin-skills/skills/visual-qa.d.ts +1 -2
  173. package/dist/features/builtin-skills/skills.d.ts +1 -12
  174. package/dist/features/builtin-skills/types.d.ts +1 -15
  175. package/dist/features/claude-code-agent-loader/agent-definitions-loader.d.ts +1 -3
  176. package/dist/features/claude-code-agent-loader/claude-model-mapper.d.ts +1 -4
  177. package/dist/features/claude-code-agent-loader/index.d.ts +1 -5
  178. package/dist/features/claude-code-agent-loader/json-agent-loader.d.ts +1 -2
  179. package/dist/features/claude-code-agent-loader/loader.d.ts +1 -5
  180. package/dist/features/claude-code-agent-loader/opencode-config-agents-reader.d.ts +1 -2
  181. package/dist/features/claude-code-agent-loader/types.d.ts +1 -29
  182. package/dist/features/claude-code-command-loader/index.d.ts +1 -2
  183. package/dist/features/claude-code-command-loader/loader-cache.d.ts +1 -6
  184. package/dist/features/claude-code-command-loader/loader.d.ts +1 -8
  185. package/dist/features/claude-code-command-loader/types.d.ts +1 -42
  186. package/dist/features/claude-code-mcp-loader/configure-allowed-env-vars.d.ts +1 -5
  187. package/dist/features/claude-code-mcp-loader/index.d.ts +1 -11
  188. package/dist/features/claude-code-mcp-loader/loader.d.ts +1 -4
  189. package/dist/features/claude-code-mcp-loader/scope-filter.d.ts +1 -2
  190. package/dist/features/claude-code-mcp-loader/transformer.d.ts +1 -2
  191. package/dist/features/claude-code-mcp-loader/types.d.ts +1 -43
  192. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +1 -3
  193. package/dist/features/claude-code-plugin-loader/command-loader.d.ts +1 -3
  194. package/dist/features/claude-code-plugin-loader/discovery-core.d.ts +1 -2
  195. package/dist/features/claude-code-plugin-loader/discovery-paths.d.ts +1 -3
  196. package/dist/features/claude-code-plugin-loader/discovery.d.ts +1 -3
  197. package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +1 -2
  198. package/dist/features/claude-code-plugin-loader/index.d.ts +1 -10
  199. package/dist/features/claude-code-plugin-loader/install-path-resolver.d.ts +1 -1
  200. package/dist/features/claude-code-plugin-loader/installed-plugin-database.d.ts +1 -3
  201. package/dist/features/claude-code-plugin-loader/loaded-plugin.d.ts +1 -2
  202. package/dist/features/claude-code-plugin-loader/loader.d.ts +1 -36
  203. package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +1 -3
  204. package/dist/features/claude-code-plugin-loader/plugin-key.d.ts +1 -1
  205. package/dist/features/claude-code-plugin-loader/plugin-manifest.d.ts +1 -4
  206. package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +1 -2
  207. package/dist/features/claude-code-plugin-loader/plugin-settings.d.ts +1 -3
  208. package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +1 -2
  209. package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +1 -3
  210. package/dist/features/claude-code-plugin-loader/types.d.ts +1 -237
  211. package/dist/features/claude-code-session-state/state.d.ts +1 -0
  212. package/dist/features/claude-tasks/types.d.ts +4 -4
  213. package/dist/features/hook-message-injector/sdk-message-lookup.d.ts +9 -2
  214. package/dist/features/mcp-oauth/callback-server.d.ts +1 -19
  215. package/dist/features/mcp-oauth/dcr.d.ts +1 -34
  216. package/dist/features/mcp-oauth/discovery.d.ts +1 -8
  217. package/dist/features/mcp-oauth/oauth-authorization-flow.d.ts +1 -26
  218. package/dist/features/mcp-oauth/provider.d.ts +1 -30
  219. package/dist/features/mcp-oauth/refresh-mutex.d.ts +1 -26
  220. package/dist/features/mcp-oauth/resource-indicator.d.ts +1 -0
  221. package/dist/features/mcp-oauth/schema.d.ts +1 -0
  222. package/dist/features/mcp-oauth/step-up.d.ts +1 -8
  223. package/dist/features/mcp-oauth/storage.d.ts +1 -17
  224. package/dist/features/monitor/batcher.d.ts +36 -0
  225. package/dist/features/monitor/envelope.d.ts +9 -0
  226. package/dist/features/monitor/filter.d.ts +10 -0
  227. package/dist/features/monitor/index.d.ts +2 -0
  228. package/dist/features/monitor/line-stream.d.ts +29 -0
  229. package/dist/features/monitor/manager-internals.d.ts +65 -0
  230. package/dist/features/monitor/manager.d.ts +35 -0
  231. package/dist/features/monitor/monitor-state-factory.d.ts +24 -0
  232. package/dist/features/monitor/output-injector-session-inspect.d.ts +9 -0
  233. package/dist/features/monitor/output-injector-types.d.ts +48 -0
  234. package/dist/features/monitor/output-injector.d.ts +21 -0
  235. package/dist/features/monitor/permission.d.ts +33 -0
  236. package/dist/features/monitor/pipeline.d.ts +26 -0
  237. package/dist/features/monitor/process.d.ts +21 -0
  238. package/dist/features/monitor/ring-buffer.d.ts +25 -0
  239. package/dist/features/monitor/types.d.ts +83 -0
  240. package/dist/features/opencode-runtime-skills/index.d.ts +1 -2
  241. package/dist/features/opencode-runtime-skills/runtime-skill-config.d.ts +1 -17
  242. package/dist/features/opencode-runtime-skills/skill-markdown.d.ts +1 -7
  243. package/dist/features/opencode-runtime-skills/source-server.d.ts +1 -24
  244. package/dist/features/opencode-skill-loader/allowed-tools-parser.d.ts +1 -1
  245. package/dist/features/opencode-skill-loader/config-source-discovery.d.ts +1 -7
  246. package/dist/features/opencode-skill-loader/git-master-template-injection.d.ts +1 -20
  247. package/dist/features/opencode-skill-loader/index.d.ts +1 -16
  248. package/dist/features/opencode-skill-loader/loaded-skill-from-path.d.ts +1 -9
  249. package/dist/features/opencode-skill-loader/loaded-skill-template-extractor.d.ts +1 -2
  250. package/dist/features/opencode-skill-loader/loader.d.ts +1 -21
  251. package/dist/features/opencode-skill-loader/merger/builtin-skill-converter.d.ts +1 -3
  252. package/dist/features/opencode-skill-loader/merger/config-skill-entry-loader.d.ts +1 -3
  253. package/dist/features/opencode-skill-loader/merger/scope-priority.d.ts +1 -2
  254. package/dist/features/opencode-skill-loader/merger/skill-definition-merger.d.ts +1 -3
  255. package/dist/features/opencode-skill-loader/merger/skills-config-normalizer.d.ts +1 -11
  256. package/dist/features/opencode-skill-loader/merger.d.ts +1 -7
  257. package/dist/features/opencode-skill-loader/opencode-config-skills-reader.d.ts +1 -5
  258. package/dist/features/opencode-skill-loader/skill-content.d.ts +1 -5
  259. package/dist/features/opencode-skill-loader/skill-deduplication.d.ts +1 -2
  260. package/dist/features/opencode-skill-loader/skill-definition-record.d.ts +1 -5
  261. package/dist/features/opencode-skill-loader/skill-directory-loader.d.ts +1 -8
  262. package/dist/features/opencode-skill-loader/skill-discovery.d.ts +1 -4
  263. package/dist/features/opencode-skill-loader/skill-mcp-config.d.ts +1 -3
  264. package/dist/features/opencode-skill-loader/skill-resolution-options.d.ts +1 -9
  265. package/dist/features/opencode-skill-loader/skill-template-resolver.d.ts +1 -11
  266. package/dist/features/opencode-skill-loader/types.d.ts +1 -34
  267. package/dist/features/skill-mcp-manager/cleanup.d.ts +1 -8
  268. package/dist/features/skill-mcp-manager/connection-type.d.ts +1 -7
  269. package/dist/features/skill-mcp-manager/connection.d.ts +1 -14
  270. package/dist/features/skill-mcp-manager/env-cleaner.d.ts +1 -2
  271. package/dist/features/skill-mcp-manager/error-redaction.d.ts +1 -10
  272. package/dist/features/skill-mcp-manager/http-client.d.ts +1 -19
  273. package/dist/features/skill-mcp-manager/index.d.ts +1 -2
  274. package/dist/features/skill-mcp-manager/manager.d.ts +1 -23
  275. package/dist/features/skill-mcp-manager/oauth-handler.d.ts +1 -17
  276. package/dist/features/skill-mcp-manager/stdio-client.d.ts +1 -16
  277. package/dist/features/skill-mcp-manager/types.d.ts +1 -79
  278. package/dist/features/team-mode/member-parser.d.ts +1 -16
  279. package/dist/features/team-mode/team-layout-tmux/close-team-member-pane.d.ts +1 -4
  280. package/dist/features/team-mode/team-layout-tmux/index.d.ts +1 -1
  281. package/dist/features/team-mode/team-layout-tmux/layout.d.ts +1 -37
  282. package/dist/features/team-mode/team-layout-tmux/rebalance-team-window.d.ts +1 -9
  283. package/dist/features/team-mode/team-layout-tmux/resolve-caller-tmux-session.d.ts +1 -9
  284. package/dist/features/team-mode/team-layout-tmux/sweep-stale-team-sessions.d.ts +1 -8
  285. package/dist/features/team-mode/team-mailbox/ack.d.ts +1 -2
  286. package/dist/features/team-mode/team-mailbox/inbox.d.ts +1 -3
  287. package/dist/features/team-mode/team-mailbox/index.d.ts +1 -7
  288. package/dist/features/team-mode/team-mailbox/pending-delivery-recovery.d.ts +1 -0
  289. package/dist/features/team-mode/team-mailbox/poll.d.ts +1 -10
  290. package/dist/features/team-mode/team-mailbox/reservation.d.ts +1 -11
  291. package/dist/features/team-mode/team-mailbox/send.d.ts +1 -30
  292. package/dist/features/team-mode/team-registry/index.d.ts +1 -3
  293. package/dist/features/team-mode/team-registry/loader.d.ts +1 -12
  294. package/dist/features/team-mode/team-registry/paths.d.ts +1 -28
  295. package/dist/features/team-mode/team-registry/team-spec-input-normalizer.d.ts +1 -6
  296. package/dist/features/team-mode/team-registry/validator.d.ts +1 -10
  297. package/dist/features/team-mode/team-runtime/delete-team.d.ts +2 -1
  298. package/dist/features/team-mode/team-runtime/shutdown-helpers.d.ts +1 -1
  299. package/dist/features/team-mode/team-state-store/active-resume.d.ts +1 -5
  300. package/dist/features/team-mode/team-state-store/creating-resume.d.ts +1 -4
  301. package/dist/features/team-mode/team-state-store/deleting-resume.d.ts +1 -4
  302. package/dist/features/team-mode/team-state-store/error-normalization.d.ts +1 -2
  303. package/dist/features/team-mode/team-state-store/index.d.ts +1 -1
  304. package/dist/features/team-mode/team-state-store/locks.d.ts +1 -15
  305. package/dist/features/team-mode/team-state-store/reservation-reconciliation.d.ts +1 -4
  306. package/dist/features/team-mode/team-state-store/resume-report.d.ts +1 -7
  307. package/dist/features/team-mode/team-state-store/resume.d.ts +1 -5
  308. package/dist/features/team-mode/team-state-store/runtime-cleanup.d.ts +1 -4
  309. package/dist/features/team-mode/team-state-store/session-liveness.d.ts +1 -9
  310. package/dist/features/team-mode/team-state-store/store.d.ts +1 -21
  311. package/dist/features/team-mode/team-state-store/worker-resume-status.d.ts +1 -9
  312. package/dist/features/team-mode/team-tasklist/claim.d.ts +1 -10
  313. package/dist/features/team-mode/team-tasklist/dependencies.d.ts +1 -2
  314. package/dist/features/team-mode/team-tasklist/get.d.ts +1 -3
  315. package/dist/features/team-mode/team-tasklist/index.d.ts +1 -6
  316. package/dist/features/team-mode/team-tasklist/list.d.ts +1 -8
  317. package/dist/features/team-mode/team-tasklist/store.d.ts +1 -3
  318. package/dist/features/team-mode/team-tasklist/test-support.d.ts +1 -9
  319. package/dist/features/team-mode/team-tasklist/update.d.ts +1 -9
  320. package/dist/features/team-mode/team-worktree/cleanup.d.ts +1 -3
  321. package/dist/features/team-mode/team-worktree/index.d.ts +1 -2
  322. package/dist/features/team-mode/team-worktree/manager.d.ts +1 -15
  323. package/dist/features/team-mode/tools/lifecycle-create-tool.d.ts +2 -2
  324. package/dist/features/team-mode/tools/lifecycle-inline-spec.d.ts +4 -4
  325. package/dist/features/team-mode/tools/lifecycle-participant.d.ts +2 -2
  326. package/dist/features/team-mode/tools/lifecycle-test-fixture.d.ts +8 -8
  327. package/dist/features/team-mode/tools/messaging-live-delivery-recipient.d.ts +2 -2
  328. package/dist/features/team-mode/tools/messaging-live-delivery-reservation.d.ts +1 -1
  329. package/dist/features/team-mode/tools/messaging-live-delivery-state.d.ts +1 -1
  330. package/dist/features/team-mode/tools/messaging-live-delivery.d.ts +1 -1
  331. package/dist/features/team-mode/tools/messaging-runtime.d.ts +2 -2
  332. package/dist/features/team-mode/tools/query.d.ts +3 -3
  333. package/dist/features/team-mode/tools/tasks.d.ts +2 -2
  334. package/dist/features/team-mode/types.d.ts +1 -343
  335. package/dist/features/tmux-subagent/stale-tmux-resource-sweeper.d.ts +12 -0
  336. package/dist/features/tool-metadata-store/store.d.ts +5 -0
  337. package/dist/features/tui-sidebar/compute-view.d.ts +10 -0
  338. package/dist/features/tui-sidebar/config-validator.d.ts +2 -0
  339. package/dist/features/tui-sidebar/constants.d.ts +10 -0
  340. package/dist/features/tui-sidebar/derivers.d.ts +10 -0
  341. package/dist/features/tui-sidebar/element-helpers.d.ts +9 -0
  342. package/dist/features/tui-sidebar/loop-reader.d.ts +2 -0
  343. package/dist/features/tui-sidebar/mirror-io.d.ts +3 -0
  344. package/dist/features/tui-sidebar/mirror-manager.d.ts +28 -0
  345. package/dist/features/tui-sidebar/mirror-path.d.ts +3 -0
  346. package/dist/features/tui-sidebar/render-view.d.ts +15 -0
  347. package/dist/features/tui-sidebar/roster-resolver.d.ts +2 -0
  348. package/dist/features/tui-sidebar/snapshot-builder.d.ts +28 -0
  349. package/dist/features/tui-sidebar/snapshot-schema.d.ts +41 -0
  350. package/dist/features/tui-sidebar/state-types.d.ts +72 -0
  351. package/dist/hooks/anthropic-context-window-limit-recovery/storage/constants.d.ts +3 -0
  352. package/dist/hooks/anthropic-context-window-limit-recovery/storage/messages-reader.d.ts +6 -0
  353. package/dist/hooks/anthropic-context-window-limit-recovery/storage/part-content.d.ts +3 -0
  354. package/dist/hooks/anthropic-context-window-limit-recovery/storage/parts-reader.d.ts +6 -0
  355. package/dist/hooks/anthropic-context-window-limit-recovery/storage/types.d.ts +92 -0
  356. package/dist/hooks/ast-grep-sg-provision/hook.d.ts +19 -0
  357. package/dist/hooks/ast-grep-sg-provision/index.d.ts +1 -0
  358. package/dist/hooks/auto-slash-command/constants.d.ts +1 -5
  359. package/dist/hooks/auto-slash-command/detector.d.ts +1 -15
  360. package/dist/hooks/auto-slash-command/processed-command-store.d.ts +1 -7
  361. package/dist/hooks/auto-slash-command/types.d.ts +1 -48
  362. package/dist/hooks/auto-update-checker/checker/bundled-version.d.ts +1 -0
  363. package/dist/hooks/auto-update-checker/checker.d.ts +1 -0
  364. package/dist/hooks/auto-update-checker/constants.d.ts +3 -3
  365. package/dist/hooks/auto-update-checker/hook.d.ts +2 -1
  366. package/dist/hooks/claude-code-hooks/types.d.ts +4 -0
  367. package/dist/hooks/codegraph-bootstrap/command-runner.d.ts +16 -0
  368. package/dist/hooks/codegraph-bootstrap/hook.d.ts +34 -0
  369. package/dist/hooks/codegraph-bootstrap/index.d.ts +1 -0
  370. package/dist/hooks/codegraph-bootstrap/project-root.d.ts +1 -0
  371. package/dist/hooks/codegraph-bootstrap/status.d.ts +11 -0
  372. package/dist/hooks/delegate-task-retry/guidance.d.ts +1 -2
  373. package/dist/hooks/delegate-task-retry/patterns.d.ts +2 -11
  374. package/dist/hooks/index.d.ts +3 -1
  375. package/dist/hooks/monitor-status-injector/hook.d.ts +30 -0
  376. package/dist/hooks/monitor-status-injector/index.d.ts +2 -0
  377. package/dist/hooks/runtime-fallback/auto-retry-signal.d.ts +1 -4
  378. package/dist/hooks/runtime-fallback/error-classifier.d.ts +7 -6
  379. package/dist/hooks/runtime-fallback/fallback-state.d.ts +3 -2
  380. package/dist/hooks/runtime-fallback/test-timeout-clock.test-support.d.ts +6 -0
  381. package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +5 -0
  382. package/dist/hooks/tool-pair-validator/tool-part-ids.d.ts +2 -1
  383. package/dist/index.js +89683 -94718
  384. package/dist/interactive-bash-availability.d.ts +1 -0
  385. package/dist/mcp/codegraph.d.ts +16 -0
  386. package/dist/mcp/index.d.ts +10 -2
  387. package/dist/mcp/shared/ancestor-cli-resolver.d.ts +25 -0
  388. package/dist/mcp/types.d.ts +1 -1
  389. package/dist/oh-my-opencode.schema.json +259 -34
  390. package/dist/openclaw/config.d.ts +1 -8
  391. package/dist/openclaw/daemon.d.ts +1 -1
  392. package/dist/openclaw/dispatcher.d.ts +1 -12
  393. package/dist/openclaw/gateway-url-validation.d.ts +1 -1
  394. package/dist/openclaw/index.d.ts +1 -5
  395. package/dist/openclaw/reply-listener-discord.d.ts +1 -4
  396. package/dist/openclaw/reply-listener-injection.d.ts +1 -10
  397. package/dist/openclaw/reply-listener-log.d.ts +1 -2
  398. package/dist/openclaw/reply-listener-paths.d.ts +1 -7
  399. package/dist/openclaw/reply-listener-poll-loop.d.ts +1 -3
  400. package/dist/openclaw/reply-listener-process.d.ts +1 -4
  401. package/dist/openclaw/reply-listener-signature.d.ts +1 -2
  402. package/dist/openclaw/reply-listener-sleep.d.ts +1 -1
  403. package/dist/openclaw/reply-listener-spawn.d.ts +1 -5
  404. package/dist/openclaw/reply-listener-start.d.ts +1 -9
  405. package/dist/openclaw/reply-listener-startup.d.ts +1 -12
  406. package/dist/openclaw/reply-listener-state.d.ts +1 -29
  407. package/dist/openclaw/reply-listener-status.d.ts +1 -4
  408. package/dist/openclaw/reply-listener-stop.d.ts +1 -7
  409. package/dist/openclaw/reply-listener-telegram.d.ts +1 -4
  410. package/dist/openclaw/reply-listener.d.ts +1 -5
  411. package/dist/openclaw/runtime-dispatch.d.ts +1 -17
  412. package/dist/openclaw/session-registry-lock.d.ts +1 -2
  413. package/dist/openclaw/session-registry-paths.d.ts +1 -9
  414. package/dist/openclaw/session-registry-storage.d.ts +1 -4
  415. package/dist/openclaw/session-registry-types.d.ts +1 -11
  416. package/dist/openclaw/session-registry.d.ts +1 -8
  417. package/dist/openclaw/tmux.d.ts +1 -8
  418. package/dist/openclaw/types.d.ts +1 -42
  419. package/dist/plugin/build-team-idle-wake-hint-client.d.ts +2 -0
  420. package/dist/plugin/event-error-utils.d.ts +2 -1
  421. package/dist/plugin/event-session-lifecycle.d.ts +0 -3
  422. package/dist/plugin/hooks/create-continuation-hooks.d.ts +0 -6
  423. package/dist/plugin/hooks/create-core-hooks.d.ts +5 -1
  424. package/dist/plugin/hooks/create-session-hooks.d.ts +3 -2
  425. package/dist/plugin/hooks/create-transform-hooks.d.ts +4 -1
  426. package/dist/plugin/messages-transform.d.ts +1 -0
  427. package/dist/plugin/skill-context.d.ts +2 -0
  428. package/dist/plugin/tool-registry-factories.d.ts +2 -1
  429. package/dist/plugin/tool-registry-gated-tools.d.ts +7 -0
  430. package/dist/plugin/tool-registry.d.ts +1 -1
  431. package/dist/plugin/types.d.ts +2 -9
  432. package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -0
  433. package/dist/shared/archive-entry-validator.d.ts +1 -6
  434. package/dist/shared/bun-file-shim.d.ts +1 -8
  435. package/dist/shared/bun-spawn-shim.d.ts +1 -43
  436. package/dist/shared/bun-which-shim.d.ts +1 -1
  437. package/dist/shared/classify-path-environment.d.ts +1 -3
  438. package/dist/shared/command-executor/embedded-commands.d.ts +1 -7
  439. package/dist/shared/command-executor/execute-command.d.ts +1 -1
  440. package/dist/shared/command-executor/execute-hook-command.d.ts +1 -16
  441. package/dist/shared/command-executor/home-directory.d.ts +1 -1
  442. package/dist/shared/command-executor/resolve-commands-in-text.d.ts +1 -1
  443. package/dist/shared/command-executor/shell-path.d.ts +1 -2
  444. package/dist/shared/command-executor.d.ts +1 -4
  445. package/dist/shared/git-worktree/collect-git-diff-stats.d.ts +1 -2
  446. package/dist/shared/git-worktree/format-file-changes.d.ts +1 -2
  447. package/dist/shared/git-worktree/index.d.ts +1 -7
  448. package/dist/shared/git-worktree/parse-diff-numstat.d.ts +1 -2
  449. package/dist/shared/git-worktree/parse-status-porcelain-line.d.ts +1 -6
  450. package/dist/shared/git-worktree/parse-status-porcelain.d.ts +1 -2
  451. package/dist/shared/git-worktree/types.d.ts +1 -7
  452. package/dist/shared/internal-initiator-marker.d.ts +1 -46
  453. package/dist/shared/logger.d.ts +3 -11
  454. package/dist/shared/migration/agent-category.d.ts +1 -19
  455. package/dist/shared/migration/agent-names.d.ts +1 -6
  456. package/dist/shared/migration/config-migration.d.ts +1 -1
  457. package/dist/shared/migration/hook-names.d.ts +1 -6
  458. package/dist/shared/migration/migrations-sidecar.d.ts +1 -41
  459. package/dist/shared/migration/model-versions.d.ts +1 -22
  460. package/dist/shared/migration.d.ts +1 -5
  461. package/dist/shared/model-suggestion-retry.d.ts +39 -17
  462. package/dist/shared/plugin-identity.d.ts +8 -8
  463. package/dist/shared/posthog.d.ts +3 -0
  464. package/dist/shared/process-stream-reader.d.ts +1 -3
  465. package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +1 -1
  466. package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +1 -11
  467. package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +1 -9
  468. package/dist/shared/prompt-async-gate/queue.d.ts +1 -8
  469. package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +1 -14
  470. package/dist/shared/prompt-async-gate/reservations.d.ts +1 -9
  471. package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +1 -7
  472. package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +1 -16
  473. package/dist/shared/prompt-async-gate/timing.d.ts +1 -9
  474. package/dist/shared/prompt-async-gate/types.d.ts +1 -123
  475. package/dist/shared/prompt-async-gate.d.ts +3 -7
  476. package/dist/shared/prompt-failure-classifier.d.ts +1 -9
  477. package/dist/shared/session-idle-settle.d.ts +1 -12
  478. package/dist/shared/shell-env.d.ts +1 -1
  479. package/dist/shared/skill-path-resolver.d.ts +1 -1
  480. package/dist/shared/tmux/cmux-detect.d.ts +1 -8
  481. package/dist/shared/tmux/constants.d.ts +1 -5
  482. package/dist/shared/tmux/runner.d.ts +2 -13
  483. package/dist/shared/tmux/tmux-utils/adapter-deps.d.ts +9 -0
  484. package/dist/shared/tmux/tmux-utils/environment.d.ts +2 -4
  485. package/dist/shared/tmux/tmux-utils/layout.d.ts +4 -17
  486. package/dist/shared/tmux/tmux-utils/pane-close.d.ts +3 -10
  487. package/dist/shared/tmux/tmux-utils/pane-command.d.ts +1 -2
  488. package/dist/shared/tmux/tmux-utils/pane-dimensions.d.ts +2 -4
  489. package/dist/shared/tmux/tmux-utils/pane-replace.d.ts +1 -11
  490. package/dist/shared/tmux/tmux-utils/pane-spawn.d.ts +1 -13
  491. package/dist/shared/tmux/tmux-utils/server-health.d.ts +2 -14
  492. package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +3 -14
  493. package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -1
  494. package/dist/shared/tmux/tmux-utils/stale-attach-pane-sweep.d.ts +16 -0
  495. package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +4 -17
  496. package/dist/shared/tmux/tmux-utils/window-spawn.d.ts +1 -13
  497. package/dist/shared/tmux/tmux-utils.d.ts +1 -0
  498. package/dist/shared/tmux/types.d.ts +1 -4
  499. package/dist/shared/write-file-atomically.d.ts +2 -0
  500. package/dist/shared/zip-entry-listing/powershell-zip-entry-listing.d.ts +1 -4
  501. package/dist/shared/zip-entry-listing/python-zip-entry-listing.d.ts +1 -3
  502. package/dist/shared/zip-entry-listing/read-zip-symlink-target.d.ts +1 -1
  503. package/dist/shared/zip-entry-listing/tar-zip-entry-listing.d.ts +1 -3
  504. package/dist/shared/zip-entry-listing/zipinfo-zip-entry-listing.d.ts +1 -4
  505. package/dist/shared/zip-entry-listing.d.ts +1 -4
  506. package/dist/skills/ast-grep/LICENSE +21 -0
  507. package/dist/skills/ast-grep/README.md +136 -0
  508. package/dist/skills/ast-grep/SKILL.md +272 -0
  509. package/dist/skills/ast-grep/SOURCE +1 -0
  510. package/dist/skills/ast-grep/install.ps1 +235 -0
  511. package/dist/skills/ast-grep/install.sh +286 -0
  512. package/dist/skills/ast-grep/references/cli.md +231 -0
  513. package/dist/skills/ast-grep/references/install.md +166 -0
  514. package/dist/skills/ast-grep/references/patterns.md +147 -0
  515. package/dist/skills/ast-grep/references/pitfalls.md +303 -0
  516. package/dist/skills/ast-grep/references/recipes.md +402 -0
  517. package/dist/skills/ast-grep/references/sgconfig.md +248 -0
  518. package/dist/skills/ast-grep/references/yaml-rules.md +509 -0
  519. package/dist/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
  520. package/dist/skills/ast-grep/tests/smoke.ps1 +123 -0
  521. package/dist/skills/ast-grep/tests/smoke.sh +212 -0
  522. package/dist/skills/debugging/SKILL.md +116 -0
  523. package/dist/skills/debugging/references/methodology/00-setup.md +108 -0
  524. package/dist/skills/debugging/references/methodology/02-investigate.md +130 -0
  525. package/dist/skills/debugging/references/methodology/04-oracle-triple.md +136 -0
  526. package/dist/skills/debugging/references/methodology/05-escalate.md +69 -0
  527. package/dist/skills/debugging/references/methodology/06-fix.md +116 -0
  528. package/dist/skills/debugging/references/methodology/08-qa.md +94 -0
  529. package/dist/skills/debugging/references/methodology/09-cleanup.md +164 -0
  530. package/dist/skills/debugging/references/methodology/partial-runtime-evidence.md +229 -0
  531. package/dist/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
  532. package/dist/skills/debugging/references/runtimes/go.md +252 -0
  533. package/dist/skills/debugging/references/runtimes/native-binary.md +484 -0
  534. package/dist/skills/debugging/references/runtimes/node.md +260 -0
  535. package/dist/skills/debugging/references/runtimes/python.md +248 -0
  536. package/dist/skills/debugging/references/runtimes/rust.md +234 -0
  537. package/dist/skills/debugging/references/tools/ghidra.md +212 -0
  538. package/dist/skills/debugging/references/tools/playwright-cli.md +194 -0
  539. package/dist/skills/debugging/references/tools/pwndbg.md +263 -0
  540. package/dist/skills/debugging/references/tools/pwntools.md +265 -0
  541. package/dist/skills/frontend/ATTRIBUTION.md +127 -0
  542. package/dist/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  543. package/dist/skills/frontend/SKILL.md +113 -0
  544. package/dist/skills/frontend/references/design/README.md +240 -0
  545. package/dist/skills/frontend/references/design/_INDEX.md +189 -0
  546. package/dist/skills/frontend/references/design/airbnb.md +390 -0
  547. package/dist/skills/frontend/references/design/airtable.md +89 -0
  548. package/dist/skills/frontend/references/design/apple.md +247 -0
  549. package/dist/skills/frontend/references/design/binance.md +345 -0
  550. package/dist/skills/frontend/references/design/bmw.md +180 -0
  551. package/dist/skills/frontend/references/design/brutalist-skill.md +92 -0
  552. package/dist/skills/frontend/references/design/bugatti.md +268 -0
  553. package/dist/skills/frontend/references/design/cal.md +259 -0
  554. package/dist/skills/frontend/references/design/claude.md +312 -0
  555. package/dist/skills/frontend/references/design/clay.md +304 -0
  556. package/dist/skills/frontend/references/design/clickhouse.md +281 -0
  557. package/dist/skills/frontend/references/design/cohere.md +266 -0
  558. package/dist/skills/frontend/references/design/coinbase.md +129 -0
  559. package/dist/skills/frontend/references/design/composio.md +307 -0
  560. package/dist/skills/frontend/references/design/cursor.md +309 -0
  561. package/dist/skills/frontend/references/design/design-system-architecture.md +217 -0
  562. package/dist/skills/frontend/references/design/elevenlabs.md +265 -0
  563. package/dist/skills/frontend/references/design/expo.md +281 -0
  564. package/dist/skills/frontend/references/design/ferrari.md +314 -0
  565. package/dist/skills/frontend/references/design/figma.md +220 -0
  566. package/dist/skills/frontend/references/design/framer.md +246 -0
  567. package/dist/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  568. package/dist/skills/frontend/references/design/hashicorp.md +278 -0
  569. package/dist/skills/frontend/references/design/ibm.md +332 -0
  570. package/dist/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  571. package/dist/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  572. package/dist/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  573. package/dist/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
  574. package/dist/skills/frontend/references/design/intercom.md +146 -0
  575. package/dist/skills/frontend/references/design/kraken.md +125 -0
  576. package/dist/skills/frontend/references/design/lamborghini.md +288 -0
  577. package/dist/skills/frontend/references/design/linear.app.md +367 -0
  578. package/dist/skills/frontend/references/design/lovable.md +298 -0
  579. package/dist/skills/frontend/references/design/mastercard.md +365 -0
  580. package/dist/skills/frontend/references/design/meta.md +366 -0
  581. package/dist/skills/frontend/references/design/minimalist-skill.md +85 -0
  582. package/dist/skills/frontend/references/design/minimax.md +257 -0
  583. package/dist/skills/frontend/references/design/mintlify.md +326 -0
  584. package/dist/skills/frontend/references/design/miro.md +108 -0
  585. package/dist/skills/frontend/references/design/mistral.ai.md +261 -0
  586. package/dist/skills/frontend/references/design/mongodb.md +266 -0
  587. package/dist/skills/frontend/references/design/nike.md +363 -0
  588. package/dist/skills/frontend/references/design/notion.md +309 -0
  589. package/dist/skills/frontend/references/design/nvidia.md +293 -0
  590. package/dist/skills/frontend/references/design/ollama.md +267 -0
  591. package/dist/skills/frontend/references/design/opencode.ai.md +281 -0
  592. package/dist/skills/frontend/references/design/output-skill.md +49 -0
  593. package/dist/skills/frontend/references/design/pinterest.md +230 -0
  594. package/dist/skills/frontend/references/design/playstation.md +364 -0
  595. package/dist/skills/frontend/references/design/posthog.md +256 -0
  596. package/dist/skills/frontend/references/design/raycast.md +268 -0
  597. package/dist/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
  598. package/dist/skills/frontend/references/design/redesign-skill.md +178 -0
  599. package/dist/skills/frontend/references/design/renault.md +311 -0
  600. package/dist/skills/frontend/references/design/replicate.md +261 -0
  601. package/dist/skills/frontend/references/design/resend.md +303 -0
  602. package/dist/skills/frontend/references/design/revolut.md +185 -0
  603. package/dist/skills/frontend/references/design/runwayml.md +244 -0
  604. package/dist/skills/frontend/references/design/sanity.md +357 -0
  605. package/dist/skills/frontend/references/design/sentry.md +262 -0
  606. package/dist/skills/frontend/references/design/shopify.md +350 -0
  607. package/dist/skills/frontend/references/design/soft-skill.md +98 -0
  608. package/dist/skills/frontend/references/design/spacex.md +194 -0
  609. package/dist/skills/frontend/references/design/spotify.md +246 -0
  610. package/dist/skills/frontend/references/design/starbucks.md +580 -0
  611. package/dist/skills/frontend/references/design/stitch-skill.md +184 -0
  612. package/dist/skills/frontend/references/design/stripe.md +322 -0
  613. package/dist/skills/frontend/references/design/supabase.md +255 -0
  614. package/dist/skills/frontend/references/design/superhuman.md +252 -0
  615. package/dist/skills/frontend/references/design/taste-skill.md +226 -0
  616. package/dist/skills/frontend/references/design/tesla.md +286 -0
  617. package/dist/skills/frontend/references/design/theverge.md +339 -0
  618. package/dist/skills/frontend/references/design/together.ai.md +263 -0
  619. package/dist/skills/frontend/references/design/uber.md +295 -0
  620. package/dist/skills/frontend/references/design/vercel.md +310 -0
  621. package/dist/skills/frontend/references/design/vodafone.md +423 -0
  622. package/dist/skills/frontend/references/design/voltagent.md +323 -0
  623. package/dist/skills/frontend/references/design/warp.md +253 -0
  624. package/dist/skills/frontend/references/design/webflow.md +92 -0
  625. package/dist/skills/frontend/references/design/wired.md +278 -0
  626. package/dist/skills/frontend/references/design/wise.md +173 -0
  627. package/dist/skills/frontend/references/design/x.ai.md +257 -0
  628. package/dist/skills/frontend/references/design/zapier.md +328 -0
  629. package/dist/skills/frontend/references/perfection/README.md +160 -0
  630. package/dist/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
  631. package/dist/skills/frontend/references/ui-ux-db/README.md +273 -0
  632. package/dist/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  633. package/dist/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
  634. package/dist/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
  635. package/dist/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
  636. package/dist/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
  637. package/dist/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  638. package/dist/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  639. package/dist/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  640. package/dist/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  641. package/dist/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  642. package/dist/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  643. package/dist/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  644. package/dist/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  645. package/dist/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  646. package/dist/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  647. package/dist/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  648. package/dist/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  649. package/dist/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  650. package/dist/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  651. package/dist/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
  652. package/dist/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
  653. package/dist/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
  654. package/dist/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  655. package/dist/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  656. package/dist/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
  657. package/dist/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
  658. package/dist/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  659. package/dist/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  660. package/dist/skills/git-master/SKILL.md +100 -0
  661. package/dist/skills/git-master/agents/openai.yaml +13 -0
  662. package/dist/skills/init-deep/SKILL.md +309 -0
  663. package/dist/skills/lcx-contribute-bug-fix/SKILL.md +242 -0
  664. package/dist/skills/lcx-contribute-bug-fix/agents/openai.yaml +12 -0
  665. package/dist/skills/lcx-contribute-bug-fix/scripts/create-pr-body.mjs +107 -0
  666. package/dist/skills/lcx-doctor/SKILL.md +93 -0
  667. package/dist/skills/lcx-doctor/agents/openai.yaml +11 -0
  668. package/dist/skills/lcx-report-bug/SKILL.md +237 -0
  669. package/dist/skills/lcx-report-bug/agents/openai.yaml +11 -0
  670. package/dist/skills/lsp-setup/SKILL.md +139 -0
  671. package/dist/skills/lsp-setup/references/bash/README.md +60 -0
  672. package/dist/skills/lsp-setup/references/c-cpp/README.md +61 -0
  673. package/dist/skills/lsp-setup/references/csharp/README.md +71 -0
  674. package/dist/skills/lsp-setup/references/dart/README.md +48 -0
  675. package/dist/skills/lsp-setup/references/elixir/README.md +51 -0
  676. package/dist/skills/lsp-setup/references/go/README.md +57 -0
  677. package/dist/skills/lsp-setup/references/haskell/README.md +57 -0
  678. package/dist/skills/lsp-setup/references/java/README.md +57 -0
  679. package/dist/skills/lsp-setup/references/julia/README.md +60 -0
  680. package/dist/skills/lsp-setup/references/kotlin/README.md +59 -0
  681. package/dist/skills/lsp-setup/references/lua/README.md +66 -0
  682. package/dist/skills/lsp-setup/references/php/README.md +62 -0
  683. package/dist/skills/lsp-setup/references/python/README.md +71 -0
  684. package/dist/skills/lsp-setup/references/ruby/README.md +53 -0
  685. package/dist/skills/lsp-setup/references/rust/README.md +59 -0
  686. package/dist/skills/lsp-setup/references/swift/README.md +51 -0
  687. package/dist/skills/lsp-setup/references/terraform/README.md +62 -0
  688. package/dist/skills/lsp-setup/references/typescript/README.md +77 -0
  689. package/dist/skills/lsp-setup/references/yaml/README.md +70 -0
  690. package/dist/skills/lsp-setup/references/zig/README.md +49 -0
  691. package/dist/skills/lsp-setup/scripts/detect-lsp.ts +210 -0
  692. package/dist/skills/lsp-setup/scripts/lsp-server-table.ts +177 -0
  693. package/dist/skills/lsp-setup/scripts/tsconfig.json +17 -0
  694. package/dist/skills/lsp-setup/scripts/verify-lsp.ts +147 -0
  695. package/dist/skills/programming/SKILL.md +463 -0
  696. package/dist/skills/programming/references/go/README.md +90 -0
  697. package/dist/skills/programming/references/go/backend-stack.md +641 -0
  698. package/dist/skills/programming/references/go/bootstrap.md +328 -0
  699. package/dist/skills/programming/references/go/bubbletea-v2.md +360 -0
  700. package/dist/skills/programming/references/go/cobra-stack.md +468 -0
  701. package/dist/skills/programming/references/go/concurrency.md +362 -0
  702. package/dist/skills/programming/references/go/data-modeling.md +329 -0
  703. package/dist/skills/programming/references/go/error-handling.md +359 -0
  704. package/dist/skills/programming/references/go/golangci-strict.md +236 -0
  705. package/dist/skills/programming/references/go/grpc-connect.md +375 -0
  706. package/dist/skills/programming/references/go/libraries.md +337 -0
  707. package/dist/skills/programming/references/go/one-liners.md +202 -0
  708. package/dist/skills/programming/references/go/sqlc-pgx.md +471 -0
  709. package/dist/skills/programming/references/go/testing.md +467 -0
  710. package/dist/skills/programming/references/go/type-patterns.md +298 -0
  711. package/dist/skills/programming/references/python/README.md +314 -0
  712. package/dist/skills/programming/references/python/async-anyio.md +442 -0
  713. package/dist/skills/programming/references/python/data-modeling.md +233 -0
  714. package/dist/skills/programming/references/python/data-processing.md +133 -0
  715. package/dist/skills/programming/references/python/error-handling.md +218 -0
  716. package/dist/skills/programming/references/python/fastapi-stack.md +316 -0
  717. package/dist/skills/programming/references/python/httpx2-optimization.md +360 -0
  718. package/dist/skills/programming/references/python/libraries.md +307 -0
  719. package/dist/skills/programming/references/python/one-liners.md +268 -0
  720. package/dist/skills/programming/references/python/orjson-stack.md +378 -0
  721. package/dist/skills/programming/references/python/pydantic-ai.md +285 -0
  722. package/dist/skills/programming/references/python/pyproject-strict.md +232 -0
  723. package/dist/skills/programming/references/python/textual-tui.md +201 -0
  724. package/dist/skills/programming/references/python/type-patterns.md +176 -0
  725. package/dist/skills/programming/references/rust/README.md +317 -0
  726. package/dist/skills/programming/references/rust/async-tokio.md +299 -0
  727. package/dist/skills/programming/references/rust/axum-stack.md +467 -0
  728. package/dist/skills/programming/references/rust/cargo-strict.md +317 -0
  729. package/dist/skills/programming/references/rust/clap-stack.md +409 -0
  730. package/dist/skills/programming/references/rust/concurrency.md +375 -0
  731. package/dist/skills/programming/references/rust/libraries.md +439 -0
  732. package/dist/skills/programming/references/rust/one-liners.md +291 -0
  733. package/dist/skills/programming/references/rust/proptest-insta.md +429 -0
  734. package/dist/skills/programming/references/rust/type-state.md +354 -0
  735. package/dist/skills/programming/references/rust/unsafe-discipline.md +250 -0
  736. package/dist/skills/programming/references/rust/zero-cost-safety.md +527 -0
  737. package/dist/skills/programming/references/rust-ub/README.md +289 -0
  738. package/dist/skills/programming/references/rust-ub/miri-sanitizers-loom.md +411 -0
  739. package/dist/skills/programming/references/rust-ub/ub-taxonomy.md +269 -0
  740. package/dist/skills/programming/references/typescript/README.md +195 -0
  741. package/dist/skills/programming/references/typescript/backend-hono.md +672 -0
  742. package/dist/skills/programming/references/typescript/bootstrap.md +199 -0
  743. package/dist/skills/programming/references/typescript/data-modeling.md +202 -0
  744. package/dist/skills/programming/references/typescript/error-handling.md +169 -0
  745. package/dist/skills/programming/references/typescript/tsconfig-strict.md +152 -0
  746. package/dist/skills/programming/references/typescript/type-patterns.md +196 -0
  747. package/dist/skills/programming/scripts/go/check-no-excuse-rules.sh +173 -0
  748. package/dist/skills/programming/scripts/go/new-project.py +138 -0
  749. package/dist/skills/programming/scripts/go/templates/.editorconfig +13 -0
  750. package/dist/skills/programming/scripts/go/templates/.golangci.yml +95 -0
  751. package/dist/skills/programming/scripts/go/templates/AGENTS.md.tmpl +24 -0
  752. package/dist/skills/programming/scripts/go/templates/README.md.tmpl +12 -0
  753. package/dist/skills/programming/scripts/go/templates/Taskfile.yml +40 -0
  754. package/dist/skills/programming/scripts/go/templates/ci.yml +37 -0
  755. package/dist/skills/programming/scripts/go/templates/config.go +24 -0
  756. package/dist/skills/programming/scripts/go/templates/gitignore +15 -0
  757. package/dist/skills/programming/scripts/go/templates/main.go.tmpl +22 -0
  758. package/dist/skills/programming/scripts/go/templates/run.go +15 -0
  759. package/dist/skills/programming/scripts/python/check-no-excuse-rules.py +687 -0
  760. package/dist/skills/programming/scripts/python/new-project.py +172 -0
  761. package/dist/skills/programming/scripts/python/new-script.py +116 -0
  762. package/dist/skills/programming/scripts/rust/check-no-excuse-rules.py +296 -0
  763. package/dist/skills/programming/scripts/rust/check-no-excuse-rules.sh +158 -0
  764. package/dist/skills/programming/scripts/rust/new-project.py +175 -0
  765. package/dist/skills/programming/scripts/typescript/check-no-excuse-rules.ts +282 -0
  766. package/dist/skills/programming/scripts/typescript/new-project.ts +177 -0
  767. package/dist/skills/refactor/SKILL.md +754 -0
  768. package/dist/skills/remove-ai-slops/SKILL.md +317 -0
  769. package/dist/skills/review-work/SKILL.md +594 -0
  770. package/dist/skills/start-work/SKILL.md +178 -0
  771. package/dist/skills/ultraresearch/SKILL.md +230 -0
  772. package/dist/skills/ulw-plan/SKILL.md +69 -0
  773. package/dist/skills/ulw-plan/agents/openai.yaml +7 -0
  774. package/dist/skills/ulw-plan/references/full-workflow.md +99 -0
  775. package/dist/skills/ulw-plan/references/intent-clear.md +44 -0
  776. package/dist/skills/ulw-plan/references/intent-unclear.md +44 -0
  777. package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  778. package/dist/skills/visual-qa/SKILL.md +235 -0
  779. package/dist/skills/visual-qa/references/agent-browser-setup.md +44 -0
  780. package/dist/skills/visual-qa/scripts/ansi.test.ts +45 -0
  781. package/dist/skills/visual-qa/scripts/ansi.ts +17 -0
  782. package/dist/skills/visual-qa/scripts/cli.test.ts +73 -0
  783. package/dist/skills/visual-qa/scripts/cli.ts +82 -0
  784. package/dist/skills/visual-qa/scripts/east-asian-width.test.ts +60 -0
  785. package/dist/skills/visual-qa/scripts/east-asian-width.ts +72 -0
  786. package/dist/skills/visual-qa/scripts/image-diff.test.ts +70 -0
  787. package/dist/skills/visual-qa/scripts/image-diff.ts +109 -0
  788. package/dist/skills/visual-qa/scripts/png-crc.ts +27 -0
  789. package/dist/skills/visual-qa/scripts/png-decode.test.ts +44 -0
  790. package/dist/skills/visual-qa/scripts/png-decode.ts +206 -0
  791. package/dist/skills/visual-qa/scripts/png-synth.ts +57 -0
  792. package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +127 -0
  793. package/dist/skills/visual-qa/scripts/tui-grid.test.ts +57 -0
  794. package/dist/skills/visual-qa/scripts/tui-grid.ts +88 -0
  795. package/dist/skills/visual-qa/scripts/types.ts +54 -0
  796. package/dist/tools/background-task/clients.d.ts +2 -0
  797. package/dist/tools/background-task/full-session-format.d.ts +1 -0
  798. package/dist/tools/background-task/types.d.ts +1 -0
  799. package/dist/tools/delegate-task/background-task-description.d.ts +2 -0
  800. package/dist/tools/delegate-task/constants.d.ts +13 -1
  801. package/dist/tools/delegate-task/model-selection.d.ts +3 -17
  802. package/dist/tools/delegate-task/model-string-parser.d.ts +1 -9
  803. package/dist/tools/delegate-task/sync-prompt-sender.d.ts +1 -1
  804. package/dist/tools/delegate-task/sync-result-fetcher.d.ts +1 -0
  805. package/dist/tools/delegate-task/sync-session-lifecycle.d.ts +2 -1
  806. package/dist/tools/delegate-task/sync-session-poller.d.ts +1 -0
  807. package/dist/tools/delegate-task/types.d.ts +59 -2
  808. package/dist/tools/index.d.ts +1 -0
  809. package/dist/tools/look-at/look-at-input-preparer.d.ts +6 -2
  810. package/dist/tools/look-at/look-at-prompt.d.ts +2 -1
  811. package/dist/tools/look-at/look-at-session-runner.d.ts +3 -4
  812. package/dist/tools/look-at/types.d.ts +2 -0
  813. package/dist/tools/monitor/create-monitor-tools.d.ts +4 -0
  814. package/dist/tools/monitor/index.d.ts +1 -0
  815. package/dist/tools/monitor/monitor-list.d.ts +7 -0
  816. package/dist/tools/monitor/monitor-output.d.ts +3 -0
  817. package/dist/tools/monitor/monitor-start.d.ts +9 -0
  818. package/dist/tools/monitor/monitor-stop.d.ts +16 -0
  819. package/dist/tools/session-manager/types.d.ts +1 -0
  820. package/dist/tools/skill/native-skills.d.ts +2 -2
  821. package/dist/tools/skill/scope-priority.d.ts +1 -4
  822. package/dist/tools/skill/skill-matcher.d.ts +1 -5
  823. package/dist/tools/skill-mcp/types.d.ts +1 -0
  824. package/dist/tools/task/types.d.ts +10 -10
  825. package/dist/tui.d.ts +4 -0
  826. package/dist/tui.js +69330 -0
  827. package/package.json +58 -36
  828. package/packages/git-bash-mcp/dist/cli.js +225 -55
  829. package/packages/lsp-core/package.json +41 -0
  830. package/packages/lsp-core/src/index.ts +28 -0
  831. package/packages/lsp-core/src/lsp/cleanup-errors.ts +5 -0
  832. package/packages/lsp-core/src/lsp/client-wrapper.ts +173 -0
  833. package/packages/lsp-core/src/lsp/client.ts +172 -0
  834. package/packages/lsp-core/src/lsp/config-loader.ts +266 -0
  835. package/packages/lsp-core/src/lsp/connection.ts +73 -0
  836. package/packages/lsp-core/src/lsp/constants.ts +11 -0
  837. package/packages/lsp-core/src/lsp/directory-diagnostics.ts +154 -0
  838. package/packages/lsp-core/src/lsp/effective-extension.ts +10 -0
  839. package/packages/lsp-core/src/lsp/errors.ts +63 -0
  840. package/packages/lsp-core/src/lsp/formatters.ts +141 -0
  841. package/packages/lsp-core/src/lsp/infer-extension.ts +66 -0
  842. package/packages/lsp-core/src/lsp/json-rpc-connection.ts +296 -0
  843. package/packages/lsp-core/src/lsp/language-mappings.ts +173 -0
  844. package/packages/lsp-core/src/lsp/manager.ts +369 -0
  845. package/packages/lsp-core/src/lsp/process-signal-cleanup.ts +21 -0
  846. package/packages/lsp-core/src/lsp/process.ts +202 -0
  847. package/packages/lsp-core/src/lsp/server-definitions.ts +176 -0
  848. package/packages/lsp-core/src/lsp/server-install-state.ts +70 -0
  849. package/packages/lsp-core/src/lsp/server-installation.ts +45 -0
  850. package/packages/lsp-core/src/lsp/server-resolution.ts +104 -0
  851. package/packages/lsp-core/src/lsp/startup-failure.ts +1 -0
  852. package/packages/lsp-core/src/lsp/transport.ts +299 -0
  853. package/packages/lsp-core/src/lsp/types.ts +126 -0
  854. package/packages/lsp-core/src/lsp/utils.test.ts +72 -0
  855. package/packages/lsp-core/src/lsp/utils.ts +40 -0
  856. package/packages/lsp-core/src/lsp/workspace-edit.ts +206 -0
  857. package/packages/lsp-core/src/mcp-protocol-pin.test.ts +68 -0
  858. package/packages/lsp-core/src/mcp.ts +95 -0
  859. package/packages/lsp-core/src/missing-dependency-result.ts +19 -0
  860. package/packages/lsp-core/src/request-context.ts +22 -0
  861. package/packages/lsp-core/src/tool-surface.test.ts +157 -0
  862. package/packages/lsp-core/src/tools/definitions.ts +141 -0
  863. package/packages/lsp-core/src/tools/diagnostics.ts +97 -0
  864. package/packages/lsp-core/src/tools/index.ts +10 -0
  865. package/packages/lsp-core/src/tools/install-decision.ts +39 -0
  866. package/packages/lsp-core/src/tools/navigation.ts +86 -0
  867. package/packages/lsp-core/src/tools/parameters.ts +49 -0
  868. package/packages/lsp-core/src/tools/rename.ts +72 -0
  869. package/packages/lsp-core/src/tools/result.ts +5 -0
  870. package/packages/lsp-core/src/tools/runtime.ts +21 -0
  871. package/packages/lsp-core/src/tools/schema.ts +9 -0
  872. package/packages/lsp-core/src/tools/status.ts +28 -0
  873. package/packages/lsp-core/src/tools/symbols.ts +99 -0
  874. package/packages/lsp-core/src/tools/types.ts +104 -0
  875. package/packages/lsp-core/src/tools.ts +1 -0
  876. package/packages/lsp-daemon/dist/cli.js +800 -612
  877. package/packages/lsp-daemon/dist/daemon-client.d.ts +1 -1
  878. package/packages/lsp-daemon/dist/daemon-server.js +1 -1
  879. package/packages/lsp-daemon/dist/index.d.ts +1 -1
  880. package/packages/lsp-daemon/dist/index.js +695 -505
  881. package/packages/lsp-daemon/dist/proxy.d.ts +3 -2
  882. package/packages/lsp-daemon/dist/proxy.js +16 -40
  883. package/packages/lsp-daemon/dist/request-routing.d.ts +2 -2
  884. package/packages/lsp-daemon/dist/request-routing.js +2 -2
  885. package/packages/lsp-daemon/package.json +2 -1
  886. package/packages/lsp-tools-mcp/dist/cli.js +3348 -15
  887. package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts +1 -1
  888. package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.d.ts +1 -13
  889. package/packages/lsp-tools-mcp/dist/lsp/client.d.ts +1 -20
  890. package/packages/lsp-tools-mcp/dist/lsp/config-loader.d.ts +1 -16
  891. package/packages/lsp-tools-mcp/dist/lsp/connection.d.ts +1 -4
  892. package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts +1 -10
  893. package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.d.ts +1 -3
  894. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.d.ts +1 -1
  895. package/packages/lsp-tools-mcp/dist/lsp/errors.d.ts +1 -35
  896. package/packages/lsp-tools-mcp/dist/lsp/formatters.d.ts +1 -12
  897. package/packages/lsp-tools-mcp/dist/lsp/infer-extension.d.ts +1 -1
  898. package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.d.ts +1 -36
  899. package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts +1 -4
  900. package/packages/lsp-tools-mcp/dist/lsp/manager.d.ts +1 -46
  901. package/packages/lsp-tools-mcp/dist/lsp/manager.js +1390 -265
  902. package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.d.ts +1 -1
  903. package/packages/lsp-tools-mcp/dist/lsp/process.d.ts +1 -25
  904. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.d.ts +1 -4
  905. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.d.ts +1 -12
  906. package/packages/lsp-tools-mcp/dist/lsp/server-installation.d.ts +1 -1
  907. package/packages/lsp-tools-mcp/dist/lsp/server-resolution.d.ts +1 -11
  908. package/packages/lsp-tools-mcp/dist/lsp/startup-failure.d.ts +1 -3
  909. package/packages/lsp-tools-mcp/dist/lsp/transport.d.ts +1 -26
  910. package/packages/lsp-tools-mcp/dist/lsp/types.d.ts +1 -124
  911. package/packages/lsp-tools-mcp/dist/lsp/utils.d.ts +1 -0
  912. package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.d.ts +1 -11
  913. package/packages/lsp-tools-mcp/dist/mcp.d.ts +1 -30
  914. package/packages/lsp-tools-mcp/dist/mcp.js +3312 -70
  915. package/packages/lsp-tools-mcp/dist/missing-dependency-result.d.ts +1 -2
  916. package/packages/lsp-tools-mcp/dist/request-context.d.ts +1 -7
  917. package/packages/lsp-tools-mcp/dist/request-context.js +16 -10
  918. package/packages/lsp-tools-mcp/dist/tools.d.ts +1 -90
  919. package/packages/lsp-tools-mcp/dist/tools.js +3028 -439
  920. package/packages/lsp-tools-mcp/package.json +3 -1
  921. package/packages/omo-codex/THIRD-PARTY-NOTICES.md +155 -0
  922. package/packages/omo-codex/lazycodex-repository/.github/workflows/pr-source-guidance.yml +11 -12
  923. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  924. package/packages/omo-codex/plugin/.mcp.json +6 -5
  925. package/packages/omo-codex/plugin/README.md +1 -1
  926. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +2975 -0
  927. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +17 -0
  928. package/packages/omo-codex/plugin/components/bootstrap/manifests/node.json +10 -0
  929. package/packages/omo-codex/plugin/components/bootstrap/package.json +20 -0
  930. package/packages/omo-codex/plugin/components/bootstrap/scripts/bootstrap.ps1 +310 -0
  931. package/packages/omo-codex/plugin/components/bootstrap/scripts/build.mjs +35 -0
  932. package/packages/omo-codex/plugin/components/bootstrap/scripts/generate-manifests.mjs +71 -0
  933. package/packages/omo-codex/plugin/components/bootstrap/src/cli.ts +153 -0
  934. package/packages/omo-codex/plugin/components/bootstrap/src/download.ts +212 -0
  935. package/packages/omo-codex/plugin/components/bootstrap/src/environment.ts +286 -0
  936. package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +108 -0
  937. package/packages/omo-codex/plugin/components/bootstrap/src/provision.ts +135 -0
  938. package/packages/omo-codex/plugin/components/bootstrap/src/setup.ts +294 -0
  939. package/packages/omo-codex/plugin/components/bootstrap/src/worker.ts +279 -0
  940. package/packages/omo-codex/plugin/components/bootstrap/test/download.test.ts +295 -0
  941. package/packages/omo-codex/plugin/components/bootstrap/test/environment.test.ts +376 -0
  942. package/packages/omo-codex/plugin/components/bootstrap/test/provision.test.ts +464 -0
  943. package/packages/omo-codex/plugin/components/bootstrap/tsconfig.json +25 -0
  944. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +2205 -0
  945. package/packages/omo-codex/plugin/components/codegraph/dist/serve.d.ts +32 -0
  946. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +1603 -0
  947. package/packages/omo-codex/plugin/components/codegraph/package.json +27 -0
  948. package/packages/omo-codex/plugin/components/codegraph/src/cli.ts +55 -0
  949. package/packages/omo-codex/plugin/components/codegraph/src/hook-types.ts +83 -0
  950. package/packages/omo-codex/plugin/components/codegraph/src/hook.ts +108 -0
  951. package/packages/omo-codex/plugin/components/codegraph/src/serve.ts +191 -0
  952. package/packages/omo-codex/plugin/components/codegraph/src/session-start-worker.ts +213 -0
  953. package/packages/omo-codex/plugin/components/codegraph/test/hook.test.ts +563 -0
  954. package/packages/omo-codex/plugin/components/codegraph/test/serve.test.ts +401 -0
  955. package/packages/omo-codex/plugin/components/codegraph/tsconfig.build.json +13 -0
  956. package/packages/omo-codex/plugin/components/codegraph/tsconfig.json +25 -0
  957. package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +610 -7
  958. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  959. package/packages/omo-codex/plugin/components/comment-checker/package.json +7 -6
  960. package/packages/omo-codex/plugin/components/comment-checker/src/apply-patch.ts +28 -156
  961. package/packages/omo-codex/plugin/components/comment-checker/src/core-values.ts +1 -1
  962. package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +2 -2
  963. package/packages/omo-codex/plugin/components/comment-checker/src/request-extractor.ts +1 -1
  964. package/packages/omo-codex/plugin/components/comment-checker/src/runner.ts +6 -2
  965. package/packages/omo-codex/plugin/components/comment-checker/test/core.test.ts +38 -35
  966. package/packages/omo-codex/plugin/components/comment-checker/test/fixtures/apply-patch-mixed-requests.ts +60 -0
  967. package/packages/omo-codex/plugin/components/git-bash/dist/cli.js +155 -26
  968. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  969. package/packages/omo-codex/plugin/components/git-bash/package.json +3 -2
  970. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +48 -0
  971. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/directive.md +11 -0
  972. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +223 -0
  973. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.d.ts +2 -0
  974. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +123 -0
  975. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/directive.d.ts +2 -0
  976. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/directive.js +5 -0
  977. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/index.d.ts +4 -0
  978. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/index.js +3 -0
  979. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/state.d.ts +9 -0
  980. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/state.js +45 -0
  981. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.d.ts +39 -0
  982. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/types.js +1 -0
  983. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +17 -0
  984. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +44 -0
  985. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/cli.ts +56 -0
  986. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +129 -0
  987. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/directive.ts +13 -0
  988. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/index.ts +4 -0
  989. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/state.ts +62 -0
  990. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/types.ts +38 -0
  991. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/cli.test.ts +124 -0
  992. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +346 -0
  993. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/tsconfig.build.json +12 -0
  994. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/tsconfig.json +27 -0
  995. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/vitest.config.ts +10 -0
  996. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +3738 -28
  997. package/packages/omo-codex/plugin/components/lsp/dist/codex-hook-cli.js +6 -10
  998. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  999. package/packages/omo-codex/plugin/components/lsp/package.json +4 -4
  1000. package/packages/omo-codex/plugin/components/lsp/scripts/build-lsp-tools.test.mjs +8 -3
  1001. package/packages/omo-codex/plugin/components/lsp/src/codex-hook-cli.ts +5 -8
  1002. package/packages/omo-codex/plugin/components/lsp/test/codex-hook-cli.test.ts +24 -1
  1003. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus.md +1 -1
  1004. package/packages/omo-codex/plugin/components/rules/bundled-rules/windows-git-bash.md +3 -1
  1005. package/packages/omo-codex/plugin/components/rules/dist/cli.js +4565 -89
  1006. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  1007. package/packages/omo-codex/plugin/components/rules/package.json +7 -6
  1008. package/packages/omo-codex/plugin/components/rules/src/cli.ts +16 -3
  1009. package/packages/omo-codex/plugin/components/rules/src/config.ts +3 -3
  1010. package/packages/omo-codex/plugin/components/rules/src/dynamic-target-fingerprints.ts +6 -6
  1011. package/packages/omo-codex/plugin/components/rules/src/event-budget.ts +1 -1
  1012. package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +1 -1
  1013. package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +1 -1
  1014. package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +9 -4
  1015. package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +3 -3
  1016. package/packages/omo-codex/plugin/components/rules/src/transcript-rule-filter.ts +1 -1
  1017. package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +4 -4
  1018. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +1 -1
  1019. package/packages/omo-codex/plugin/components/rules/test/dynamic-target-fingerprints.test.ts +1 -1
  1020. package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +3 -3
  1021. package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +2 -2
  1022. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +2 -2
  1023. package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +2 -2
  1024. package/packages/omo-codex/plugin/components/rules/test/parser.test.ts +1 -1
  1025. package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +1 -1
  1026. package/packages/omo-codex/plugin/components/rules/test/rules-engine-consumption.test.ts +92 -0
  1027. package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +1 -1
  1028. package/packages/omo-codex/plugin/components/rules/test/sources.test.ts +4 -4
  1029. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +36 -2
  1030. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.js +394 -37
  1031. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  1032. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +7 -6
  1033. package/packages/omo-codex/plugin/components/start-work-continuation/src/boulder-reader.ts +20 -147
  1034. package/packages/omo-codex/plugin/components/start-work-continuation/src/codex-hook.ts +1 -1
  1035. package/packages/omo-codex/plugin/components/start-work-continuation/src/index.ts +1 -1
  1036. package/packages/omo-codex/plugin/components/start-work-continuation/test/boulder-reader.test.ts +151 -27
  1037. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +87 -49
  1038. package/packages/omo-codex/plugin/components/telemetry/LICENSE +21 -0
  1039. package/packages/omo-codex/plugin/components/telemetry/NOTICE +6 -0
  1040. package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +5869 -42
  1041. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +5783 -108
  1042. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  1043. package/packages/omo-codex/plugin/components/telemetry/package.json +7 -8
  1044. package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +3 -3
  1045. package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +92 -142
  1046. package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +59 -3
  1047. package/packages/omo-codex/plugin/components/telemetry/test/codex-hook-diagnostics.test.ts +3 -3
  1048. package/packages/omo-codex/plugin/components/telemetry/test/diagnostics.test.ts +13 -7
  1049. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +2 -2
  1050. package/packages/omo-codex/plugin/components/ultrawork/README.md +1 -1
  1051. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +1 -1
  1052. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-clone-fidelity-reviewer.toml +31 -0
  1053. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +29 -0
  1054. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-executor.toml +24 -0
  1055. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +23 -0
  1056. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +22 -0
  1057. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +1 -1
  1058. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +1 -1
  1059. package/packages/omo-codex/plugin/components/ultrawork/biome.json +1 -1
  1060. package/packages/omo-codex/plugin/components/ultrawork/directive.md +5 -1
  1061. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +162 -37
  1062. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  1063. package/packages/omo-codex/plugin/components/ultrawork/package.json +7 -6
  1064. package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +11 -0
  1065. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/SKILL.md +42 -47
  1066. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/full-workflow.md +64 -102
  1067. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-clear.md +44 -0
  1068. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/references/intent-unclear.md +44 -0
  1069. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  1070. package/packages/omo-codex/plugin/components/ultrawork/src/codex-hook.ts +2 -2
  1071. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-test-helpers.ts +101 -0
  1072. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +111 -0
  1073. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +39 -124
  1074. package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +16 -0
  1075. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +4 -3
  1076. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +5 -0
  1077. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +79 -0
  1078. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.d.ts +1 -1
  1079. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +56 -82
  1080. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +45 -143
  1081. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -0
  1082. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +18 -0
  1083. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +10 -0
  1084. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +173 -0
  1085. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +2419 -32
  1086. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +13 -9
  1087. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +60 -12
  1088. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.d.ts +3 -0
  1089. package/packages/omo-codex/plugin/components/ulw-loop/dist/evidence.js +67 -10
  1090. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.d.ts +3 -0
  1091. package/packages/omo-codex/plugin/components/ulw-loop/dist/goal-status.js +14 -0
  1092. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.d.ts +2 -6
  1093. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +50 -42
  1094. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.d.ts +8 -0
  1095. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-goal-factory.js +109 -0
  1096. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-blockers.d.ts +5 -0
  1097. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-blockers.js +41 -0
  1098. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.d.ts +8 -0
  1099. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +39 -0
  1100. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +13 -6
  1101. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +176 -105
  1102. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +2 -2
  1103. package/packages/omo-codex/plugin/components/ulw-loop/package.json +4 -4
  1104. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +17 -17
  1105. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +100 -0
  1106. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +162 -85
  1107. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +64 -134
  1108. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +19 -0
  1109. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +250 -0
  1110. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +18 -9
  1111. package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +67 -4
  1112. package/packages/omo-codex/plugin/components/ulw-loop/src/evidence.ts +124 -18
  1113. package/packages/omo-codex/plugin/components/ulw-loop/src/goal-status.ts +16 -0
  1114. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +132 -55
  1115. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-goal-factory.ts +124 -0
  1116. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-blockers.ts +48 -0
  1117. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +44 -0
  1118. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +230 -138
  1119. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +186 -0
  1120. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-status.test.ts +85 -0
  1121. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint.test.ts +120 -192
  1122. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-checkpoint.test.ts +215 -0
  1123. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-commands.test.ts +7 -195
  1124. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-complete-goals.test.ts +41 -1
  1125. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +172 -0
  1126. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-helpers.test.ts +0 -6
  1127. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-json-errors.test.ts +89 -0
  1128. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +39 -8
  1129. package/packages/omo-codex/plugin/components/ulw-loop/test/evidence-criteria-gate.test.ts +29 -1
  1130. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/browser-screenshot.txt +1 -0
  1131. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/cli-pass.txt +1 -0
  1132. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/code-review.md +1 -0
  1133. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/data-diff.txt +5 -0
  1134. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/gate-review.md +1 -0
  1135. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/http-dump.txt +4 -0
  1136. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/artifacts/rejection.txt +1 -0
  1137. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/checkpoint-builders.ts +98 -0
  1138. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +91 -0
  1139. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/sample-quality-gate.json +110 -8
  1140. package/packages/omo-codex/plugin/components/ulw-loop/test/goal-status.test.ts +35 -0
  1141. package/packages/omo-codex/plugin/components/ulw-loop/test/plan-crud.test.ts +11 -1
  1142. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-blockers.test.ts +102 -0
  1143. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-doc.test.ts +38 -0
  1144. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +131 -0
  1145. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +150 -176
  1146. package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +12 -0
  1147. package/packages/omo-codex/plugin/hooks/hooks.json +48 -16
  1148. package/packages/omo-codex/plugin/package-lock.json +327 -232
  1149. package/packages/omo-codex/plugin/package.json +4 -2
  1150. package/packages/omo-codex/plugin/scripts/auto-update-state.d.mts +20 -0
  1151. package/packages/omo-codex/plugin/scripts/auto-update.mjs +30 -8
  1152. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +0 -5
  1153. package/packages/omo-codex/plugin/scripts/build-components.mjs +60 -5
  1154. package/packages/omo-codex/plugin/scripts/hook-status-message.mjs +2 -0
  1155. package/packages/omo-codex/plugin/scripts/install-flow.mjs +43 -0
  1156. package/packages/omo-codex/plugin/scripts/migrate-omo-sot/editor.mjs +125 -0
  1157. package/packages/omo-codex/plugin/scripts/migrate-omo-sot/jsonc.mjs +43 -0
  1158. package/packages/omo-codex/plugin/scripts/migrate-omo-sot/scaffold.mjs +29 -0
  1159. package/packages/omo-codex/plugin/scripts/migrate-omo-sot.mjs +121 -0
  1160. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +5 -5
  1161. package/packages/omo-codex/plugin/shared/package.json +24 -0
  1162. package/packages/omo-codex/plugin/shared/src/config-loader.ts +28 -0
  1163. package/packages/omo-codex/plugin/shared/test/config-loader.test.ts +105 -0
  1164. package/packages/omo-codex/plugin/shared/tsconfig.build.json +9 -0
  1165. package/packages/omo-codex/plugin/shared/tsconfig.json +16 -0
  1166. package/packages/omo-codex/plugin/skills/ast-grep/LICENSE +21 -0
  1167. package/packages/omo-codex/plugin/skills/ast-grep/README.md +136 -0
  1168. package/packages/omo-codex/plugin/skills/ast-grep/SKILL.md +272 -0
  1169. package/packages/omo-codex/plugin/skills/ast-grep/SOURCE +1 -0
  1170. package/packages/omo-codex/plugin/skills/ast-grep/install.ps1 +235 -0
  1171. package/packages/omo-codex/plugin/skills/ast-grep/install.sh +286 -0
  1172. package/packages/omo-codex/plugin/skills/ast-grep/references/cli.md +231 -0
  1173. package/packages/omo-codex/plugin/skills/ast-grep/references/install.md +166 -0
  1174. package/packages/omo-codex/plugin/skills/ast-grep/references/patterns.md +147 -0
  1175. package/packages/omo-codex/plugin/skills/ast-grep/references/pitfalls.md +303 -0
  1176. package/packages/omo-codex/plugin/skills/ast-grep/references/recipes.md +402 -0
  1177. package/packages/omo-codex/plugin/skills/ast-grep/references/sgconfig.md +248 -0
  1178. package/packages/omo-codex/plugin/skills/ast-grep/references/yaml-rules.md +509 -0
  1179. package/packages/omo-codex/plugin/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
  1180. package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.ps1 +123 -0
  1181. package/packages/omo-codex/plugin/skills/ast-grep/tests/smoke.sh +212 -0
  1182. package/packages/omo-codex/plugin/skills/frontend/ATTRIBUTION.md +127 -0
  1183. package/packages/omo-codex/plugin/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  1184. package/packages/omo-codex/plugin/skills/frontend/SKILL.md +113 -0
  1185. package/packages/omo-codex/plugin/skills/frontend/references/design/README.md +240 -0
  1186. package/packages/omo-codex/plugin/skills/frontend/references/design/_INDEX.md +189 -0
  1187. package/packages/omo-codex/plugin/skills/frontend/references/design/airbnb.md +390 -0
  1188. package/packages/omo-codex/plugin/skills/frontend/references/design/airtable.md +89 -0
  1189. package/packages/omo-codex/plugin/skills/frontend/references/design/apple.md +247 -0
  1190. package/packages/omo-codex/plugin/skills/frontend/references/design/binance.md +345 -0
  1191. package/packages/omo-codex/plugin/skills/frontend/references/design/bmw.md +180 -0
  1192. package/packages/omo-codex/plugin/skills/frontend/references/design/brutalist-skill.md +92 -0
  1193. package/packages/omo-codex/plugin/skills/frontend/references/design/bugatti.md +268 -0
  1194. package/packages/omo-codex/plugin/skills/frontend/references/design/cal.md +259 -0
  1195. package/packages/omo-codex/plugin/skills/frontend/references/design/claude.md +312 -0
  1196. package/packages/omo-codex/plugin/skills/frontend/references/design/clay.md +304 -0
  1197. package/packages/omo-codex/plugin/skills/frontend/references/design/clickhouse.md +281 -0
  1198. package/packages/omo-codex/plugin/skills/frontend/references/design/cohere.md +266 -0
  1199. package/packages/omo-codex/plugin/skills/frontend/references/design/coinbase.md +129 -0
  1200. package/packages/omo-codex/plugin/skills/frontend/references/design/composio.md +307 -0
  1201. package/packages/omo-codex/plugin/skills/frontend/references/design/cursor.md +309 -0
  1202. package/packages/omo-codex/plugin/skills/frontend/references/design/design-system-architecture.md +217 -0
  1203. package/packages/omo-codex/plugin/skills/frontend/references/design/elevenlabs.md +265 -0
  1204. package/packages/omo-codex/plugin/skills/frontend/references/design/expo.md +281 -0
  1205. package/packages/omo-codex/plugin/skills/frontend/references/design/ferrari.md +314 -0
  1206. package/packages/omo-codex/plugin/skills/frontend/references/design/figma.md +220 -0
  1207. package/packages/omo-codex/plugin/skills/frontend/references/design/framer.md +246 -0
  1208. package/packages/omo-codex/plugin/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  1209. package/packages/omo-codex/plugin/skills/frontend/references/design/hashicorp.md +278 -0
  1210. package/packages/omo-codex/plugin/skills/frontend/references/design/ibm.md +332 -0
  1211. package/packages/omo-codex/plugin/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  1212. package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  1213. package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  1214. package/packages/omo-codex/plugin/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
  1215. package/packages/omo-codex/plugin/skills/frontend/references/design/intercom.md +146 -0
  1216. package/packages/omo-codex/plugin/skills/frontend/references/design/kraken.md +125 -0
  1217. package/packages/omo-codex/plugin/skills/frontend/references/design/lamborghini.md +288 -0
  1218. package/packages/omo-codex/plugin/skills/frontend/references/design/linear.app.md +367 -0
  1219. package/packages/omo-codex/plugin/skills/frontend/references/design/lovable.md +298 -0
  1220. package/packages/omo-codex/plugin/skills/frontend/references/design/mastercard.md +365 -0
  1221. package/packages/omo-codex/plugin/skills/frontend/references/design/meta.md +366 -0
  1222. package/packages/omo-codex/plugin/skills/frontend/references/design/minimalist-skill.md +85 -0
  1223. package/packages/omo-codex/plugin/skills/frontend/references/design/minimax.md +257 -0
  1224. package/packages/omo-codex/plugin/skills/frontend/references/design/mintlify.md +326 -0
  1225. package/packages/omo-codex/plugin/skills/frontend/references/design/miro.md +108 -0
  1226. package/packages/omo-codex/plugin/skills/frontend/references/design/mistral.ai.md +261 -0
  1227. package/packages/omo-codex/plugin/skills/frontend/references/design/mongodb.md +266 -0
  1228. package/packages/omo-codex/plugin/skills/frontend/references/design/nike.md +363 -0
  1229. package/packages/omo-codex/plugin/skills/frontend/references/design/notion.md +309 -0
  1230. package/packages/omo-codex/plugin/skills/frontend/references/design/nvidia.md +293 -0
  1231. package/packages/omo-codex/plugin/skills/frontend/references/design/ollama.md +267 -0
  1232. package/packages/omo-codex/plugin/skills/frontend/references/design/opencode.ai.md +281 -0
  1233. package/packages/omo-codex/plugin/skills/frontend/references/design/output-skill.md +49 -0
  1234. package/packages/omo-codex/plugin/skills/frontend/references/design/pinterest.md +230 -0
  1235. package/packages/omo-codex/plugin/skills/frontend/references/design/playstation.md +364 -0
  1236. package/packages/omo-codex/plugin/skills/frontend/references/design/posthog.md +256 -0
  1237. package/packages/omo-codex/plugin/skills/frontend/references/design/raycast.md +268 -0
  1238. package/packages/omo-codex/plugin/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
  1239. package/packages/omo-codex/plugin/skills/frontend/references/design/redesign-skill.md +178 -0
  1240. package/packages/omo-codex/plugin/skills/frontend/references/design/renault.md +311 -0
  1241. package/packages/omo-codex/plugin/skills/frontend/references/design/replicate.md +261 -0
  1242. package/packages/omo-codex/plugin/skills/frontend/references/design/resend.md +303 -0
  1243. package/packages/omo-codex/plugin/skills/frontend/references/design/revolut.md +185 -0
  1244. package/packages/omo-codex/plugin/skills/frontend/references/design/runwayml.md +244 -0
  1245. package/packages/omo-codex/plugin/skills/frontend/references/design/sanity.md +357 -0
  1246. package/packages/omo-codex/plugin/skills/frontend/references/design/sentry.md +262 -0
  1247. package/packages/omo-codex/plugin/skills/frontend/references/design/shopify.md +350 -0
  1248. package/packages/omo-codex/plugin/skills/frontend/references/design/soft-skill.md +98 -0
  1249. package/packages/omo-codex/plugin/skills/frontend/references/design/spacex.md +194 -0
  1250. package/packages/omo-codex/plugin/skills/frontend/references/design/spotify.md +246 -0
  1251. package/packages/omo-codex/plugin/skills/frontend/references/design/starbucks.md +580 -0
  1252. package/packages/omo-codex/plugin/skills/frontend/references/design/stitch-skill.md +184 -0
  1253. package/packages/omo-codex/plugin/skills/frontend/references/design/stripe.md +322 -0
  1254. package/packages/omo-codex/plugin/skills/frontend/references/design/supabase.md +255 -0
  1255. package/packages/omo-codex/plugin/skills/frontend/references/design/superhuman.md +252 -0
  1256. package/packages/omo-codex/plugin/skills/frontend/references/design/taste-skill.md +226 -0
  1257. package/packages/omo-codex/plugin/skills/frontend/references/design/tesla.md +286 -0
  1258. package/packages/omo-codex/plugin/skills/frontend/references/design/theverge.md +339 -0
  1259. package/packages/omo-codex/plugin/skills/frontend/references/design/together.ai.md +263 -0
  1260. package/packages/omo-codex/plugin/skills/frontend/references/design/uber.md +295 -0
  1261. package/packages/omo-codex/plugin/skills/frontend/references/design/vercel.md +310 -0
  1262. package/packages/omo-codex/plugin/skills/frontend/references/design/vodafone.md +423 -0
  1263. package/packages/omo-codex/plugin/skills/frontend/references/design/voltagent.md +323 -0
  1264. package/packages/omo-codex/plugin/skills/frontend/references/design/warp.md +253 -0
  1265. package/packages/omo-codex/plugin/skills/frontend/references/design/webflow.md +92 -0
  1266. package/packages/omo-codex/plugin/skills/frontend/references/design/wired.md +278 -0
  1267. package/packages/omo-codex/plugin/skills/frontend/references/design/wise.md +173 -0
  1268. package/packages/omo-codex/plugin/skills/frontend/references/design/x.ai.md +257 -0
  1269. package/packages/omo-codex/plugin/skills/frontend/references/design/zapier.md +328 -0
  1270. package/packages/omo-codex/plugin/skills/frontend/references/perfection/README.md +160 -0
  1271. package/packages/omo-codex/plugin/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
  1272. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/README.md +273 -0
  1273. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  1274. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
  1275. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
  1276. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
  1277. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
  1278. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  1279. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  1280. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  1281. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  1282. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  1283. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  1284. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  1285. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  1286. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  1287. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  1288. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  1289. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  1290. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  1291. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  1292. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
  1293. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
  1294. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
  1295. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  1296. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  1297. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
  1298. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
  1299. package/packages/omo-codex/plugin/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  1300. package/packages/omo-codex/plugin/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  1301. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +3 -3
  1302. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/SKILL.md +79 -28
  1303. package/packages/omo-codex/plugin/skills/lcx-contribute-bug-fix/agents/openai.yaml +2 -2
  1304. package/packages/omo-codex/plugin/skills/lcx-report-bug/SKILL.md +7 -6
  1305. package/packages/omo-codex/plugin/skills/lcx-report-bug/agents/openai.yaml +1 -1
  1306. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +14 -23
  1307. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +2 -2
  1308. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +2 -2
  1309. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +3 -3
  1310. package/packages/omo-codex/plugin/skills/ultraresearch/SKILL.md +2 -2
  1311. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +17 -17
  1312. package/packages/omo-codex/plugin/skills/ulw-plan/SKILL.md +42 -47
  1313. package/packages/omo-codex/plugin/skills/ulw-plan/references/full-workflow.md +64 -102
  1314. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-clear.md +44 -0
  1315. package/packages/omo-codex/plugin/skills/ulw-plan/references/intent-unclear.md +44 -0
  1316. package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  1317. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +19 -3
  1318. package/packages/omo-codex/plugin/skills/visual-qa/references/agent-browser-setup.md +44 -0
  1319. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +119 -11
  1320. package/packages/omo-codex/plugin/test/aggregate-build.test.mjs +2 -4
  1321. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +29 -2
  1322. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +3 -0
  1323. package/packages/omo-codex/plugin/test/aggregate-mcp.test.mjs +12 -12
  1324. package/packages/omo-codex/plugin/test/auto-update.test.mjs +171 -0
  1325. package/packages/omo-codex/plugin/test/bootstrap-binlinks.test.mjs +250 -0
  1326. package/packages/omo-codex/plugin/test/bootstrap-hooks.test.mjs +166 -0
  1327. package/packages/omo-codex/plugin/test/bootstrap-orchestration.test.mjs +371 -0
  1328. package/packages/omo-codex/plugin/test/bootstrap-ps-guard.test.mjs +134 -0
  1329. package/packages/omo-codex/plugin/test/bootstrap-setup.test.mjs +249 -0
  1330. package/packages/omo-codex/plugin/test/component-bundled-cli.test.mjs +287 -0
  1331. package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +199 -0
  1332. package/packages/omo-codex/plugin/test/hook-status-message.test.mjs +38 -2
  1333. package/packages/omo-codex/plugin/test/index.js +13 -0
  1334. package/packages/omo-codex/plugin/test/install-time-build-runtime.test.mjs +4 -5
  1335. package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +10 -1
  1336. package/packages/omo-codex/plugin/test/mcp-research-servers.test.mjs +5 -3
  1337. package/packages/omo-codex/plugin/test/migrate-omo-sot.test.mjs +179 -0
  1338. package/packages/omo-codex/plugin/test/payload-equivalence.test.mjs +109 -0
  1339. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +165 -0
  1340. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +6 -6
  1341. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +2 -3
  1342. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +37 -1
  1343. package/packages/omo-codex/scripts/install-agent-links.test.mjs +41 -0
  1344. package/packages/omo-codex/scripts/install-bin-links.test.mjs +3 -3
  1345. package/packages/omo-codex/scripts/install-cache-copy.test.mjs +1 -1
  1346. package/packages/omo-codex/scripts/install-cli-args.test.mjs +1 -1
  1347. package/packages/omo-codex/scripts/install-config-autonomous-features.test.mjs +1 -1
  1348. package/packages/omo-codex/scripts/install-config-autonomous.test.mjs +1 -1
  1349. package/packages/omo-codex/scripts/install-config-git-bash.test.mjs +1 -1
  1350. package/packages/omo-codex/scripts/install-config-preservation.test.mjs +1 -1
  1351. package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +1 -2
  1352. package/packages/omo-codex/scripts/install-config.test.mjs +8 -6
  1353. package/packages/omo-codex/scripts/install-delegated-command.test.mjs +1 -1
  1354. package/packages/omo-codex/scripts/install-dist/install-local.mjs +13377 -0
  1355. package/packages/omo-codex/scripts/install-generated-bundle.test.mjs +55 -0
  1356. package/packages/omo-codex/scripts/install-git-bash-mcp-env.test.mjs +3 -4
  1357. package/packages/omo-codex/scripts/install-hook-targets.test.mjs +1 -1
  1358. package/packages/omo-codex/scripts/install-local.mjs +54 -236
  1359. package/packages/omo-codex/scripts/install-local.test.mjs +8 -1
  1360. package/packages/omo-codex/scripts/install-marketplace-cache.test.mjs +3 -3
  1361. package/packages/omo-codex/scripts/install-mcp-runtime.test.mjs +34 -77
  1362. package/packages/omo-codex/scripts/install-packaged-local.test.mjs +8 -4
  1363. package/packages/omo-codex/scripts/install-project-local-cleanup.test.mjs +1 -1
  1364. package/packages/shared-skills/package.json +6 -1
  1365. package/packages/shared-skills/skills/ast-grep/LICENSE +21 -0
  1366. package/packages/shared-skills/skills/ast-grep/README.md +136 -0
  1367. package/packages/shared-skills/skills/ast-grep/SKILL.md +272 -0
  1368. package/packages/shared-skills/skills/ast-grep/SOURCE +1 -0
  1369. package/packages/shared-skills/skills/ast-grep/install.ps1 +235 -0
  1370. package/packages/shared-skills/skills/ast-grep/install.sh +286 -0
  1371. package/packages/shared-skills/skills/ast-grep/references/cli.md +231 -0
  1372. package/packages/shared-skills/skills/ast-grep/references/install.md +166 -0
  1373. package/packages/shared-skills/skills/ast-grep/references/patterns.md +147 -0
  1374. package/packages/shared-skills/skills/ast-grep/references/pitfalls.md +303 -0
  1375. package/packages/shared-skills/skills/ast-grep/references/recipes.md +402 -0
  1376. package/packages/shared-skills/skills/ast-grep/references/sgconfig.md +248 -0
  1377. package/packages/shared-skills/skills/ast-grep/references/yaml-rules.md +509 -0
  1378. package/packages/shared-skills/skills/ast-grep/scripts/ast_grep_helper.py +748 -0
  1379. package/packages/shared-skills/skills/ast-grep/tests/smoke.ps1 +123 -0
  1380. package/packages/shared-skills/skills/ast-grep/tests/smoke.sh +212 -0
  1381. package/packages/shared-skills/skills/frontend/ATTRIBUTION.md +127 -0
  1382. package/packages/shared-skills/skills/frontend/LICENSE-Apache-2.0.txt +201 -0
  1383. package/packages/shared-skills/skills/frontend/SKILL.md +113 -0
  1384. package/packages/shared-skills/skills/frontend/references/design/README.md +240 -0
  1385. package/packages/shared-skills/skills/frontend/references/design/_INDEX.md +189 -0
  1386. package/packages/shared-skills/skills/frontend/references/design/airbnb.md +390 -0
  1387. package/packages/shared-skills/skills/frontend/references/design/airtable.md +89 -0
  1388. package/packages/shared-skills/skills/frontend/references/design/apple.md +247 -0
  1389. package/packages/shared-skills/skills/frontend/references/design/binance.md +345 -0
  1390. package/packages/shared-skills/skills/frontend/references/design/bmw.md +180 -0
  1391. package/packages/shared-skills/skills/frontend/references/design/brutalist-skill.md +92 -0
  1392. package/packages/shared-skills/skills/frontend/references/design/bugatti.md +268 -0
  1393. package/packages/shared-skills/skills/frontend/references/design/cal.md +259 -0
  1394. package/packages/shared-skills/skills/frontend/references/design/claude.md +312 -0
  1395. package/packages/shared-skills/skills/frontend/references/design/clay.md +304 -0
  1396. package/packages/shared-skills/skills/frontend/references/design/clickhouse.md +281 -0
  1397. package/packages/shared-skills/skills/frontend/references/design/cohere.md +266 -0
  1398. package/packages/shared-skills/skills/frontend/references/design/coinbase.md +129 -0
  1399. package/packages/shared-skills/skills/frontend/references/design/composio.md +307 -0
  1400. package/packages/shared-skills/skills/frontend/references/design/cursor.md +309 -0
  1401. package/packages/shared-skills/skills/frontend/references/design/design-system-architecture.md +217 -0
  1402. package/packages/shared-skills/skills/frontend/references/design/elevenlabs.md +265 -0
  1403. package/packages/shared-skills/skills/frontend/references/design/expo.md +281 -0
  1404. package/packages/shared-skills/skills/frontend/references/design/ferrari.md +314 -0
  1405. package/packages/shared-skills/skills/frontend/references/design/figma.md +220 -0
  1406. package/packages/shared-skills/skills/frontend/references/design/framer.md +246 -0
  1407. package/packages/shared-skills/skills/frontend/references/design/gpt-tasteskill.md +74 -0
  1408. package/packages/shared-skills/skills/frontend/references/design/hashicorp.md +278 -0
  1409. package/packages/shared-skills/skills/frontend/references/design/ibm.md +332 -0
  1410. package/packages/shared-skills/skills/frontend/references/design/image-to-code-skill.md +1228 -0
  1411. package/packages/shared-skills/skills/frontend/references/design/imagegen-brandkit.md +798 -0
  1412. package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-mobile.md +1465 -0
  1413. package/packages/shared-skills/skills/frontend/references/design/imagegen-frontend-web.md +686 -0
  1414. package/packages/shared-skills/skills/frontend/references/design/intercom.md +146 -0
  1415. package/packages/shared-skills/skills/frontend/references/design/kraken.md +125 -0
  1416. package/packages/shared-skills/skills/frontend/references/design/lamborghini.md +288 -0
  1417. package/packages/shared-skills/skills/frontend/references/design/linear.app.md +367 -0
  1418. package/packages/shared-skills/skills/frontend/references/design/lovable.md +298 -0
  1419. package/packages/shared-skills/skills/frontend/references/design/mastercard.md +365 -0
  1420. package/packages/shared-skills/skills/frontend/references/design/meta.md +366 -0
  1421. package/packages/shared-skills/skills/frontend/references/design/minimalist-skill.md +85 -0
  1422. package/packages/shared-skills/skills/frontend/references/design/minimax.md +257 -0
  1423. package/packages/shared-skills/skills/frontend/references/design/mintlify.md +326 -0
  1424. package/packages/shared-skills/skills/frontend/references/design/miro.md +108 -0
  1425. package/packages/shared-skills/skills/frontend/references/design/mistral.ai.md +261 -0
  1426. package/packages/shared-skills/skills/frontend/references/design/mongodb.md +266 -0
  1427. package/packages/shared-skills/skills/frontend/references/design/nike.md +363 -0
  1428. package/packages/shared-skills/skills/frontend/references/design/notion.md +309 -0
  1429. package/packages/shared-skills/skills/frontend/references/design/nvidia.md +293 -0
  1430. package/packages/shared-skills/skills/frontend/references/design/ollama.md +267 -0
  1431. package/packages/shared-skills/skills/frontend/references/design/opencode.ai.md +281 -0
  1432. package/packages/shared-skills/skills/frontend/references/design/output-skill.md +49 -0
  1433. package/packages/shared-skills/skills/frontend/references/design/pinterest.md +230 -0
  1434. package/packages/shared-skills/skills/frontend/references/design/playstation.md +364 -0
  1435. package/packages/shared-skills/skills/frontend/references/design/posthog.md +256 -0
  1436. package/packages/shared-skills/skills/frontend/references/design/raycast.md +268 -0
  1437. package/packages/shared-skills/skills/frontend/references/design/react-dev-tooling-skill.md +230 -0
  1438. package/packages/shared-skills/skills/frontend/references/design/redesign-skill.md +178 -0
  1439. package/packages/shared-skills/skills/frontend/references/design/renault.md +311 -0
  1440. package/packages/shared-skills/skills/frontend/references/design/replicate.md +261 -0
  1441. package/packages/shared-skills/skills/frontend/references/design/resend.md +303 -0
  1442. package/packages/shared-skills/skills/frontend/references/design/revolut.md +185 -0
  1443. package/packages/shared-skills/skills/frontend/references/design/runwayml.md +244 -0
  1444. package/packages/shared-skills/skills/frontend/references/design/sanity.md +357 -0
  1445. package/packages/shared-skills/skills/frontend/references/design/sentry.md +262 -0
  1446. package/packages/shared-skills/skills/frontend/references/design/shopify.md +350 -0
  1447. package/packages/shared-skills/skills/frontend/references/design/soft-skill.md +98 -0
  1448. package/packages/shared-skills/skills/frontend/references/design/spacex.md +194 -0
  1449. package/packages/shared-skills/skills/frontend/references/design/spotify.md +246 -0
  1450. package/packages/shared-skills/skills/frontend/references/design/starbucks.md +580 -0
  1451. package/packages/shared-skills/skills/frontend/references/design/stitch-skill.md +184 -0
  1452. package/packages/shared-skills/skills/frontend/references/design/stripe.md +322 -0
  1453. package/packages/shared-skills/skills/frontend/references/design/supabase.md +255 -0
  1454. package/packages/shared-skills/skills/frontend/references/design/superhuman.md +252 -0
  1455. package/packages/shared-skills/skills/frontend/references/design/taste-skill.md +226 -0
  1456. package/packages/shared-skills/skills/frontend/references/design/tesla.md +286 -0
  1457. package/packages/shared-skills/skills/frontend/references/design/theverge.md +339 -0
  1458. package/packages/shared-skills/skills/frontend/references/design/together.ai.md +263 -0
  1459. package/packages/shared-skills/skills/frontend/references/design/uber.md +295 -0
  1460. package/packages/shared-skills/skills/frontend/references/design/vercel.md +310 -0
  1461. package/packages/shared-skills/skills/frontend/references/design/vodafone.md +423 -0
  1462. package/packages/shared-skills/skills/frontend/references/design/voltagent.md +323 -0
  1463. package/packages/shared-skills/skills/frontend/references/design/warp.md +253 -0
  1464. package/packages/shared-skills/skills/frontend/references/design/webflow.md +92 -0
  1465. package/packages/shared-skills/skills/frontend/references/design/wired.md +278 -0
  1466. package/packages/shared-skills/skills/frontend/references/design/wise.md +173 -0
  1467. package/packages/shared-skills/skills/frontend/references/design/x.ai.md +257 -0
  1468. package/packages/shared-skills/skills/frontend/references/design/zapier.md +328 -0
  1469. package/packages/shared-skills/skills/frontend/references/perfection/README.md +160 -0
  1470. package/packages/shared-skills/skills/frontend/references/perfection/react-perf-tooling.md +127 -0
  1471. package/packages/shared-skills/skills/frontend/references/ui-ux-db/README.md +273 -0
  1472. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/charts.csv +26 -0
  1473. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/colors.csv +97 -0
  1474. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/icons.csv +101 -0
  1475. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/landing.csv +31 -0
  1476. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/products.csv +97 -0
  1477. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/react-performance.csv +45 -0
  1478. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/astro.csv +54 -0
  1479. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/flutter.csv +53 -0
  1480. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/html-tailwind.csv +56 -0
  1481. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/jetpack-compose.csv +53 -0
  1482. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nextjs.csv +53 -0
  1483. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nuxt-ui.csv +51 -0
  1484. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/nuxtjs.csv +59 -0
  1485. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react-native.csv +52 -0
  1486. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/react.csv +54 -0
  1487. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/shadcn.csv +61 -0
  1488. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/svelte.csv +54 -0
  1489. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/swiftui.csv +51 -0
  1490. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/stacks/vue.csv +50 -0
  1491. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/styles.csv +68 -0
  1492. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/typography.csv +58 -0
  1493. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ui-reasoning.csv +101 -0
  1494. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/ux-guidelines.csv +100 -0
  1495. package/packages/shared-skills/skills/frontend/references/ui-ux-db/data/web-interface.csv +31 -0
  1496. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/core.py +253 -0
  1497. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/design_system.py +1067 -0
  1498. package/packages/shared-skills/skills/frontend/references/ui-ux-db/scripts/search.py +114 -0
  1499. package/packages/shared-skills/skills/frontend/scripts/perfection/lighthouse-audit.py +201 -0
  1500. package/packages/shared-skills/skills/init-deep/SKILL.md +1 -1
  1501. package/packages/shared-skills/skills/lcx-contribute-bug-fix/SKILL.md +79 -28
  1502. package/packages/shared-skills/skills/lcx-contribute-bug-fix/agents/openai.yaml +2 -2
  1503. package/packages/shared-skills/skills/lcx-report-bug/SKILL.md +7 -6
  1504. package/packages/shared-skills/skills/lcx-report-bug/agents/openai.yaml +1 -1
  1505. package/packages/shared-skills/skills/refactor/SKILL.md +12 -21
  1506. package/packages/shared-skills/skills/review-work/SKILL.md +11 -9
  1507. package/packages/shared-skills/skills/start-work/SKILL.md +5 -4
  1508. package/packages/shared-skills/skills/ultraresearch/SKILL.md +9 -8
  1509. package/packages/shared-skills/skills/ulw-plan/SKILL.md +69 -0
  1510. package/packages/shared-skills/skills/ulw-plan/agents/openai.yaml +7 -0
  1511. package/packages/shared-skills/skills/ulw-plan/references/full-workflow.md +99 -0
  1512. package/packages/shared-skills/skills/ulw-plan/references/intent-clear.md +44 -0
  1513. package/packages/shared-skills/skills/ulw-plan/references/intent-unclear.md +44 -0
  1514. package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +301 -0
  1515. package/packages/shared-skills/skills/visual-qa/SKILL.md +17 -1
  1516. package/packages/shared-skills/skills/visual-qa/references/agent-browser-setup.md +44 -0
  1517. package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +48 -4
  1518. package/dist/cli/doctor/constants.d.ts +0 -32
  1519. package/dist/cli/doctor/spawn-with-timeout.d.ts +0 -8
  1520. package/dist/cli/doctor/types.d.ts +0 -148
  1521. package/dist/features/builtin-skills/skills/frontend-ui-ux.d.ts +0 -2
  1522. package/dist/hooks/session-recovery/constants.d.ts +0 -4
  1523. package/dist/hooks/session-recovery/detect-error-type.d.ts +0 -4
  1524. package/dist/hooks/session-recovery/error-recovery.d.ts +0 -4
  1525. package/dist/hooks/session-recovery/hook-types.d.ts +0 -22
  1526. package/dist/hooks/session-recovery/hook.d.ts +0 -4
  1527. package/dist/hooks/session-recovery/index.d.ts +0 -5
  1528. package/dist/hooks/session-recovery/interrupted-idle-message-fetch-timeout.d.ts +0 -7
  1529. package/dist/hooks/session-recovery/interrupted-tool-results.d.ts +0 -3
  1530. package/dist/hooks/session-recovery/message-state.d.ts +0 -4
  1531. package/dist/hooks/session-recovery/recover-thinking-block-order.d.ts +0 -5
  1532. package/dist/hooks/session-recovery/recover-thinking-disabled-violation.d.ts +0 -5
  1533. package/dist/hooks/session-recovery/recover-tool-result-missing.d.ts +0 -10
  1534. package/dist/hooks/session-recovery/recover-unavailable-tool.d.ts +0 -5
  1535. package/dist/hooks/session-recovery/resume.d.ts +0 -7
  1536. package/dist/hooks/session-recovery/storage/latest-assistant-message.d.ts +0 -5
  1537. package/dist/hooks/session-recovery/storage/messages-reader.d.ts +0 -6
  1538. package/dist/hooks/session-recovery/storage/orphan-thinking-search.d.ts +0 -2
  1539. package/dist/hooks/session-recovery/storage/part-content.d.ts +0 -3
  1540. package/dist/hooks/session-recovery/storage/parts-reader.d.ts +0 -6
  1541. package/dist/hooks/session-recovery/storage/thinking-block-search.d.ts +0 -2
  1542. package/dist/hooks/session-recovery/storage/thinking-prepend.d.ts +0 -33
  1543. package/dist/hooks/session-recovery/storage/thinking-strip.d.ts +0 -11
  1544. package/dist/hooks/session-recovery/storage.d.ts +0 -20
  1545. package/dist/hooks/session-recovery/types.d.ts +0 -105
  1546. package/dist/mcp/ast-grep.d.ts +0 -11
  1547. package/dist/plugin/event-session-recovery.d.ts +0 -9
  1548. package/dist/plugin/user-abort-interrupted-recovery-guard.d.ts +0 -6
  1549. package/packages/ast-grep-mcp/dist/cli.js +0 -1126
  1550. package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.js +0 -6
  1551. package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +0 -132
  1552. package/packages/lsp-tools-mcp/dist/lsp/client.js +0 -131
  1553. package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +0 -220
  1554. package/packages/lsp-tools-mcp/dist/lsp/connection.js +0 -66
  1555. package/packages/lsp-tools-mcp/dist/lsp/constants.js +0 -10
  1556. package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +0 -125
  1557. package/packages/lsp-tools-mcp/dist/lsp/effective-extension.js +0 -8
  1558. package/packages/lsp-tools-mcp/dist/lsp/errors.js +0 -56
  1559. package/packages/lsp-tools-mcp/dist/lsp/formatters.js +0 -106
  1560. package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +0 -59
  1561. package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.js +0 -247
  1562. package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +0 -170
  1563. package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.js +0 -17
  1564. package/packages/lsp-tools-mcp/dist/lsp/process.js +0 -153
  1565. package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +0 -170
  1566. package/packages/lsp-tools-mcp/dist/lsp/server-install-state.js +0 -51
  1567. package/packages/lsp-tools-mcp/dist/lsp/server-installation.js +0 -40
  1568. package/packages/lsp-tools-mcp/dist/lsp/server-resolution.js +0 -86
  1569. package/packages/lsp-tools-mcp/dist/lsp/startup-failure.js +0 -35
  1570. package/packages/lsp-tools-mcp/dist/lsp/transport.js +0 -238
  1571. package/packages/lsp-tools-mcp/dist/lsp/types.js +0 -1
  1572. package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +0 -175
  1573. package/packages/lsp-tools-mcp/dist/missing-dependency-result.js +0 -14
  1574. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.d.ts +0 -7
  1575. package/packages/omo-codex/plugin/components/comment-checker/dist/apply-patch.js +0 -173
  1576. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.d.ts +0 -22
  1577. package/packages/omo-codex/plugin/components/comment-checker/dist/codex-hook.js +0 -165
  1578. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.d.ts +0 -1
  1579. package/packages/omo-codex/plugin/components/comment-checker/dist/core-values.js +0 -1
  1580. package/packages/omo-codex/plugin/components/comment-checker/dist/core.d.ts +0 -5
  1581. package/packages/omo-codex/plugin/components/comment-checker/dist/core.js +0 -4
  1582. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.d.ts +0 -6
  1583. package/packages/omo-codex/plugin/components/comment-checker/dist/hook-input.js +0 -10
  1584. package/packages/omo-codex/plugin/components/comment-checker/dist/record.d.ts +0 -2
  1585. package/packages/omo-codex/plugin/components/comment-checker/dist/record.js +0 -11
  1586. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.d.ts +0 -3
  1587. package/packages/omo-codex/plugin/components/comment-checker/dist/request-extractor.js +0 -104
  1588. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.d.ts +0 -26
  1589. package/packages/omo-codex/plugin/components/comment-checker/dist/runner.js +0 -144
  1590. package/packages/omo-codex/plugin/components/comment-checker/dist/types.d.ts +0 -43
  1591. package/packages/omo-codex/plugin/components/comment-checker/dist/types.js +0 -1
  1592. package/packages/omo-codex/plugin/components/comment-checker/src/record.ts +0 -11
  1593. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.d.ts +0 -5
  1594. package/packages/omo-codex/plugin/components/rules/dist/codex-hook-options.js +0 -1
  1595. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.d.ts +0 -47
  1596. package/packages/omo-codex/plugin/components/rules/dist/codex-hook.js +0 -127
  1597. package/packages/omo-codex/plugin/components/rules/dist/config.d.ts +0 -2
  1598. package/packages/omo-codex/plugin/components/rules/dist/config.js +0 -100
  1599. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.d.ts +0 -2
  1600. package/packages/omo-codex/plugin/components/rules/dist/context-pressure.js +0 -26
  1601. package/packages/omo-codex/plugin/components/rules/dist/debug-log.d.ts +0 -8
  1602. package/packages/omo-codex/plugin/components/rules/dist/debug-log.js +0 -36
  1603. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.d.ts +0 -7
  1604. package/packages/omo-codex/plugin/components/rules/dist/dynamic-target-fingerprints.js +0 -65
  1605. package/packages/omo-codex/plugin/components/rules/dist/event-budget.d.ts +0 -3
  1606. package/packages/omo-codex/plugin/components/rules/dist/event-budget.js +0 -14
  1607. package/packages/omo-codex/plugin/components/rules/dist/hook-output.d.ts +0 -2
  1608. package/packages/omo-codex/plugin/components/rules/dist/hook-output.js +0 -24
  1609. package/packages/omo-codex/plugin/components/rules/dist/path-utils.d.ts +0 -4
  1610. package/packages/omo-codex/plugin/components/rules/dist/path-utils.js +0 -24
  1611. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.d.ts +0 -13
  1612. package/packages/omo-codex/plugin/components/rules/dist/persistent-cache.js +0 -172
  1613. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.d.ts +0 -6
  1614. package/packages/omo-codex/plugin/components/rules/dist/post-compact-budget.js +0 -74
  1615. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.d.ts +0 -4
  1616. package/packages/omo-codex/plugin/components/rules/dist/post-compact-claim.js +0 -6
  1617. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.d.ts +0 -1
  1618. package/packages/omo-codex/plugin/components/rules/dist/post-compact-directive.js +0 -32
  1619. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.d.ts +0 -13
  1620. package/packages/omo-codex/plugin/components/rules/dist/post-compact-state.js +0 -29
  1621. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.d.ts +0 -9
  1622. package/packages/omo-codex/plugin/components/rules/dist/rules/cache.js +0 -51
  1623. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.d.ts +0 -70
  1624. package/packages/omo-codex/plugin/components/rules/dist/rules/constants.js +0 -101
  1625. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.d.ts +0 -5
  1626. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-cache.js +0 -60
  1627. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.d.ts +0 -6
  1628. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-dynamic-loader.js +0 -61
  1629. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.d.ts +0 -7
  1630. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-loader.js +0 -60
  1631. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.d.ts +0 -11
  1632. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-paths.js +0 -75
  1633. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.d.ts +0 -6
  1634. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-static-loader.js +0 -29
  1635. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.d.ts +0 -44
  1636. package/packages/omo-codex/plugin/components/rules/dist/rules/engine-types.js +0 -1
  1637. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.d.ts +0 -5
  1638. package/packages/omo-codex/plugin/components/rules/dist/rules/engine.js +0 -85
  1639. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.d.ts +0 -6
  1640. package/packages/omo-codex/plugin/components/rules/dist/rules/errors.js +0 -12
  1641. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.d.ts +0 -14
  1642. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-cache.js +0 -51
  1643. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.d.ts +0 -6
  1644. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-paths.js +0 -33
  1645. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.d.ts +0 -5
  1646. package/packages/omo-codex/plugin/components/rules/dist/rules/finder-sources.js +0 -40
  1647. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.d.ts +0 -28
  1648. package/packages/omo-codex/plugin/components/rules/dist/rules/finder.js +0 -146
  1649. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.d.ts +0 -7
  1650. package/packages/omo-codex/plugin/components/rules/dist/rules/formatter.js +0 -112
  1651. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.d.ts +0 -18
  1652. package/packages/omo-codex/plugin/components/rules/dist/rules/matcher.js +0 -93
  1653. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.d.ts +0 -3
  1654. package/packages/omo-codex/plugin/components/rules/dist/rules/ordering.js +0 -27
  1655. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.d.ts +0 -7
  1656. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-frontmatter.js +0 -30
  1657. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.d.ts +0 -2
  1658. package/packages/omo-codex/plugin/components/rules/dist/rules/parser-yaml.js +0 -237
  1659. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.d.ts +0 -3
  1660. package/packages/omo-codex/plugin/components/rules/dist/rules/parser.js +0 -31
  1661. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.d.ts +0 -1
  1662. package/packages/omo-codex/plugin/components/rules/dist/rules/plugin-root.js +0 -48
  1663. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.d.ts +0 -1
  1664. package/packages/omo-codex/plugin/components/rules/dist/rules/project-root.js +0 -23
  1665. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.d.ts +0 -14
  1666. package/packages/omo-codex/plugin/components/rules/dist/rules/scanner.js +0 -111
  1667. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.d.ts +0 -3
  1668. package/packages/omo-codex/plugin/components/rules/dist/rules/sources.js +0 -9
  1669. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.d.ts +0 -18
  1670. package/packages/omo-codex/plugin/components/rules/dist/rules/truncator.js +0 -59
  1671. package/packages/omo-codex/plugin/components/rules/dist/rules/types.d.ts +0 -126
  1672. package/packages/omo-codex/plugin/components/rules/dist/rules/types.js +0 -8
  1673. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.d.ts +0 -6
  1674. package/packages/omo-codex/plugin/components/rules/dist/rules-engine-factory.js +0 -20
  1675. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.d.ts +0 -3
  1676. package/packages/omo-codex/plugin/components/rules/dist/session-state-lock.js +0 -41
  1677. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.d.ts +0 -10
  1678. package/packages/omo-codex/plugin/components/rules/dist/sparkshell-awareness.js +0 -90
  1679. package/packages/omo-codex/plugin/components/rules/dist/static-injection.d.ts +0 -3
  1680. package/packages/omo-codex/plugin/components/rules/dist/static-injection.js +0 -128
  1681. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.d.ts +0 -6
  1682. package/packages/omo-codex/plugin/components/rules/dist/tool-paths.js +0 -168
  1683. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.d.ts +0 -4
  1684. package/packages/omo-codex/plugin/components/rules/dist/transcript-rule-filter.js +0 -49
  1685. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.d.ts +0 -4
  1686. package/packages/omo-codex/plugin/components/rules/dist/transcript-search.js +0 -91
  1687. package/packages/omo-codex/plugin/components/rules/src/rules/cache.ts +0 -64
  1688. package/packages/omo-codex/plugin/components/rules/src/rules/constants.ts +0 -122
  1689. package/packages/omo-codex/plugin/components/rules/src/rules/engine-dynamic-cache.ts +0 -87
  1690. package/packages/omo-codex/plugin/components/rules/src/rules/engine-dynamic-loader.ts +0 -94
  1691. package/packages/omo-codex/plugin/components/rules/src/rules/engine-loader.ts +0 -84
  1692. package/packages/omo-codex/plugin/components/rules/src/rules/engine-paths.ts +0 -103
  1693. package/packages/omo-codex/plugin/components/rules/src/rules/engine-static-loader.ts +0 -43
  1694. package/packages/omo-codex/plugin/components/rules/src/rules/engine-types.ts +0 -45
  1695. package/packages/omo-codex/plugin/components/rules/src/rules/engine.ts +0 -123
  1696. package/packages/omo-codex/plugin/components/rules/src/rules/errors.ts +0 -13
  1697. package/packages/omo-codex/plugin/components/rules/src/rules/finder-cache.ts +0 -73
  1698. package/packages/omo-codex/plugin/components/rules/src/rules/finder-paths.ts +0 -47
  1699. package/packages/omo-codex/plugin/components/rules/src/rules/finder-sources.ts +0 -45
  1700. package/packages/omo-codex/plugin/components/rules/src/rules/finder.ts +0 -220
  1701. package/packages/omo-codex/plugin/components/rules/src/rules/formatter.ts +0 -149
  1702. package/packages/omo-codex/plugin/components/rules/src/rules/matcher.ts +0 -142
  1703. package/packages/omo-codex/plugin/components/rules/src/rules/ordering.ts +0 -33
  1704. package/packages/omo-codex/plugin/components/rules/src/rules/parser-frontmatter.ts +0 -39
  1705. package/packages/omo-codex/plugin/components/rules/src/rules/parser-yaml.ts +0 -271
  1706. package/packages/omo-codex/plugin/components/rules/src/rules/parser.ts +0 -35
  1707. package/packages/omo-codex/plugin/components/rules/src/rules/plugin-root.ts +0 -55
  1708. package/packages/omo-codex/plugin/components/rules/src/rules/project-root.ts +0 -30
  1709. package/packages/omo-codex/plugin/components/rules/src/rules/scanner.ts +0 -162
  1710. package/packages/omo-codex/plugin/components/rules/src/rules/sources.ts +0 -13
  1711. package/packages/omo-codex/plugin/components/rules/src/rules/truncator.ts +0 -84
  1712. package/packages/omo-codex/plugin/components/rules/src/rules/types.ts +0 -141
  1713. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.d.ts +0 -16
  1714. package/packages/omo-codex/plugin/components/start-work-continuation/dist/boulder-reader.js +0 -146
  1715. package/packages/omo-codex/plugin/components/start-work-continuation/dist/cli.d.ts +0 -2
  1716. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.d.ts +0 -2
  1717. package/packages/omo-codex/plugin/components/start-work-continuation/dist/codex-hook.js +0 -80
  1718. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.d.ts +0 -1
  1719. package/packages/omo-codex/plugin/components/start-work-continuation/dist/directive.js +0 -2
  1720. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.d.ts +0 -5
  1721. package/packages/omo-codex/plugin/components/start-work-continuation/dist/index.js +0 -3
  1722. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.d.ts +0 -20
  1723. package/packages/omo-codex/plugin/components/start-work-continuation/dist/types.js +0 -1
  1724. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.d.ts +0 -1
  1725. package/packages/omo-codex/plugin/components/telemetry/dist/atomic-write.js +0 -18
  1726. package/packages/omo-codex/plugin/components/telemetry/dist/cli.d.ts +0 -2
  1727. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.d.ts +0 -15
  1728. package/packages/omo-codex/plugin/components/telemetry/dist/codex-hook.js +0 -42
  1729. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.d.ts +0 -10
  1730. package/packages/omo-codex/plugin/components/telemetry/dist/data-path.js +0 -35
  1731. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.d.ts +0 -12
  1732. package/packages/omo-codex/plugin/components/telemetry/dist/diagnostics.js +0 -108
  1733. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.d.ts +0 -4
  1734. package/packages/omo-codex/plugin/components/telemetry/dist/env-flags.js +0 -31
  1735. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.d.ts +0 -8
  1736. package/packages/omo-codex/plugin/components/telemetry/dist/posthog-activity-state.js +0 -68
  1737. package/packages/omo-codex/plugin/components/telemetry/dist/posthog.d.ts +0 -21
  1738. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.d.ts +0 -8
  1739. package/packages/omo-codex/plugin/components/telemetry/dist/product-identity.js +0 -29
  1740. package/packages/omo-codex/plugin/components/telemetry/src/atomic-write.ts +0 -22
  1741. package/packages/omo-codex/plugin/components/telemetry/src/data-path.ts +0 -45
  1742. package/packages/omo-codex/plugin/components/telemetry/src/diagnostics.ts +0 -154
  1743. package/packages/omo-codex/plugin/components/telemetry/src/env-flags.ts +0 -43
  1744. package/packages/omo-codex/plugin/components/telemetry/src/posthog-activity-state.ts +0 -97
  1745. package/packages/omo-codex/plugin/components/ultrawork/agents/codex-ultrawork-reviewer.toml +0 -21
  1746. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.d.ts +0 -2
  1747. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.d.ts +0 -7
  1748. package/packages/omo-codex/plugin/components/ultrawork/dist/codex-hook.js +0 -122
  1749. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.d.ts +0 -1
  1750. package/packages/omo-codex/plugin/components/ultrawork/dist/directive.js +0 -2
  1751. package/packages/omo-codex/plugin/skills/frontend-ui-ux/SKILL.md +0 -77
  1752. package/packages/omo-codex/plugin/test/start-work-skill.test.mjs +0 -85
  1753. package/packages/omo-codex/plugin/test/ulw-plan-skill.test.mjs +0 -43
  1754. package/packages/omo-codex/scripts/install/agent-source-roots.mjs +0 -13
  1755. package/packages/omo-codex/scripts/install/agents.mjs +0 -154
  1756. package/packages/omo-codex/scripts/install/bin-dir.mjs +0 -20
  1757. package/packages/omo-codex/scripts/install/bin-links.mjs +0 -276
  1758. package/packages/omo-codex/scripts/install/cache.mjs +0 -295
  1759. package/packages/omo-codex/scripts/install/cached-marketplace-manifest.mjs +0 -21
  1760. package/packages/omo-codex/scripts/install/cli-args.mjs +0 -149
  1761. package/packages/omo-codex/scripts/install/command-shim.mjs +0 -1
  1762. package/packages/omo-codex/scripts/install/config.mjs +0 -257
  1763. package/packages/omo-codex/scripts/install/delegated-command.mjs +0 -29
  1764. package/packages/omo-codex/scripts/install/git-bash-mcp-env.mjs +0 -28
  1765. package/packages/omo-codex/scripts/install/git-bash.mjs +0 -107
  1766. package/packages/omo-codex/scripts/install/git-bash.test.mjs +0 -209
  1767. package/packages/omo-codex/scripts/install/hook-targets.mjs +0 -46
  1768. package/packages/omo-codex/scripts/install/hook-trust.mjs +0 -84
  1769. package/packages/omo-codex/scripts/install/lazycodex-version-stamp.mjs +0 -102
  1770. package/packages/omo-codex/scripts/install/legacy-bins.mjs +0 -66
  1771. package/packages/omo-codex/scripts/install/marketplace.mjs +0 -104
  1772. package/packages/omo-codex/scripts/install/mcp-runtime-cache.mjs +0 -81
  1773. package/packages/omo-codex/scripts/install/model-catalog.mjs +0 -74
  1774. package/packages/omo-codex/scripts/install/multi-agent-v2-config.mjs +0 -50
  1775. package/packages/omo-codex/scripts/install/permissions.d.mts +0 -1
  1776. package/packages/omo-codex/scripts/install/permissions.mjs +0 -37
  1777. package/packages/omo-codex/scripts/install/process.mjs +0 -22
  1778. package/packages/omo-codex/scripts/install/project-local-cleanup.mjs +0 -228
  1779. package/packages/omo-codex/scripts/install/reasoning-config.mjs +0 -72
  1780. package/packages/omo-codex/scripts/install/snapshot.mjs +0 -53
  1781. package/packages/omo-codex/scripts/install/source-package-build.mjs +0 -20
  1782. package/packages/omo-codex/scripts/install/toml-editor.mjs +0 -64
  1783. package/packages/omo-codex/scripts/install/utils.mjs +0 -15
  1784. package/packages/omo-codex/scripts/sync-telemetry-component.mjs +0 -116
  1785. package/packages/omo-codex/scripts/sync-telemetry-component.test.mjs +0 -94
  1786. package/packages/shared-skills/skills/frontend-ui-ux/SKILL.md +0 -77
  1787. /package/dist/cli/doctor/{doctor-target.d.ts → framework/doctor-target.d.ts} +0 -0
  1788. /package/dist/cli/doctor/{format-default.d.ts → framework/format-default.d.ts} +0 -0
  1789. /package/dist/cli/doctor/{format-shared.d.ts → framework/format-shared.d.ts} +0 -0
  1790. /package/dist/cli/doctor/{format-status.d.ts → framework/format-status.d.ts} +0 -0
  1791. /package/dist/cli/doctor/{format-verbose.d.ts → framework/format-verbose.d.ts} +0 -0
  1792. /package/dist/cli/doctor/{formatter.d.ts → framework/formatter.d.ts} +0 -0
  1793. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/empty-messages.d.ts +0 -0
  1794. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/empty-text.d.ts +0 -0
  1795. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/message-dir.d.ts +0 -0
  1796. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/part-id.d.ts +0 -0
  1797. /package/dist/hooks/{session-recovery → anthropic-context-window-limit-recovery}/storage/text-part-injector.d.ts +0 -0
  1798. /package/packages/omo-codex/plugin/components/{comment-checker → codegraph}/dist/cli.d.ts +0 -0
  1799. /package/packages/omo-codex/plugin/components/{rules → lazycodex-executor-verify}/dist/cli.d.ts +0 -0
@@ -0,0 +1,2975 @@
1
+ #!/usr/bin/env node
2
+
3
+ // components/bootstrap/src/cli.ts
4
+ import { realpathSync } from "node:fs";
5
+ import { fileURLToPath as fileURLToPath4 } from "node:url";
6
+
7
+ // components/bootstrap/src/download.ts
8
+ import { createHash, randomUUID } from "node:crypto";
9
+ import { createWriteStream } from "node:fs";
10
+ import { mkdir, readFile, rename, rm } from "node:fs/promises";
11
+ import { basename, dirname, join } from "node:path";
12
+ import { Readable } from "node:stream";
13
+ import { pipeline } from "node:stream/promises";
14
+ import { fileURLToPath } from "node:url";
15
+
16
+ class DownloadError extends Error {
17
+ code;
18
+ constructor(code, message) {
19
+ super(message);
20
+ this.name = "DownloadError";
21
+ this.code = code;
22
+ }
23
+ }
24
+
25
+ class ChecksumMismatchError extends DownloadError {
26
+ expectedSha256;
27
+ actualSha256;
28
+ constructor(options) {
29
+ super("checksum-mismatch", `Checksum mismatch for ${options.url}: expected sha256 ${options.expectedSha256} but downloaded sha256 ${options.actualSha256}; deleted the partial download.`);
30
+ this.name = "ChecksumMismatchError";
31
+ this.expectedSha256 = options.expectedSha256;
32
+ this.actualSha256 = options.actualSha256;
33
+ }
34
+ }
35
+
36
+ class UnsupportedPlatformError extends DownloadError {
37
+ manifestName;
38
+ platformKey;
39
+ constructor(options) {
40
+ super("unsupported-platform", `Manifest "${options.manifestName}" has no asset for unsupported platform "${options.platformKey}" (available: ${options.availablePlatforms.join(", ")}).`);
41
+ this.name = "UnsupportedPlatformError";
42
+ this.manifestName = options.manifestName;
43
+ this.platformKey = options.platformKey;
44
+ }
45
+ }
46
+ var PROXY_ENV_KEYS = ["HTTPS_PROXY", "https_proxy", "HTTP_PROXY", "http_proxy"];
47
+ function proxyLimitationNote(env) {
48
+ const configuredKey = PROXY_ENV_KEYS.find((key) => (env[key] ?? "").trim().length > 0);
49
+ if (configuredKey === undefined)
50
+ return "";
51
+ return ` Note: ${configuredKey} is set, but the bootstrap downloader does not tunnel through HTTP(S) proxies in v1; the download was attempted directly.`;
52
+ }
53
+ function describeFailure(error) {
54
+ return error instanceof Error ? error.message : String(error);
55
+ }
56
+ async function writeBodyToFile(body, tempPath) {
57
+ const hash = createHash("sha256");
58
+ if (body === null) {
59
+ await pipeline(Readable.from([]), createWriteStream(tempPath));
60
+ return hash.digest("hex");
61
+ }
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));
69
+ return hash.digest("hex");
70
+ }
71
+ async function downloadChecksummedAsset(options) {
72
+ const fetchImpl = options.fetchImpl ?? globalThis.fetch;
73
+ const env = options.env ?? process.env;
74
+ const expectedSha256 = options.sha256.toLowerCase();
75
+ await mkdir(dirname(options.destination), { recursive: true });
76
+ const tempPath = `${options.destination}.${randomUUID().slice(0, 8)}.partial`;
77
+ let response;
78
+ try {
79
+ response = await fetchImpl(options.url);
80
+ } catch (error) {
81
+ throw new DownloadError("download-failed", `Download failed for ${options.url}: ${describeFailure(error)}.${proxyLimitationNote(env)}`);
82
+ }
83
+ if (!response.ok) {
84
+ throw new DownloadError("download-failed", `Download failed for ${options.url}: HTTP ${response.status}.${proxyLimitationNote(env)}`);
85
+ }
86
+ let actualSha256;
87
+ try {
88
+ actualSha256 = await writeBodyToFile(response.body, tempPath);
89
+ } catch (error) {
90
+ await rm(tempPath, { force: true });
91
+ throw new DownloadError("download-failed", `Download failed for ${options.url} while writing the response body: ${describeFailure(error)}.${proxyLimitationNote(env)}`);
92
+ }
93
+ if (actualSha256 !== expectedSha256) {
94
+ await rm(tempPath, { force: true });
95
+ throw new ChecksumMismatchError({ actualSha256, expectedSha256, url: options.url });
96
+ }
97
+ await rename(tempPath, options.destination);
98
+ return options.destination;
99
+ }
100
+ function resolveDefaultManifestsDir() {
101
+ return join(dirname(fileURLToPath(import.meta.url)), "..", "manifests");
102
+ }
103
+ function isRecord(value) {
104
+ return typeof value === "object" && value !== null && !Array.isArray(value);
105
+ }
106
+ function parseManifestAsset(value, manifestName, platformKey) {
107
+ if (!isRecord(value) || typeof value["url"] !== "string" || typeof value["sha256"] !== "string") {
108
+ throw new Error(`Manifest "${manifestName}" platform "${platformKey}" must pin both url and sha256 strings.`);
109
+ }
110
+ return { sha256: value["sha256"], url: value["url"] };
111
+ }
112
+ function parseAssetManifest(raw, manifestName) {
113
+ const data = JSON.parse(raw);
114
+ if (!isRecord(data) || typeof data["name"] !== "string" || typeof data["version"] !== "string" || !isRecord(data["platforms"])) {
115
+ throw new Error(`Manifest "${manifestName}" must declare name, version, and a platforms object.`);
116
+ }
117
+ const platforms = {};
118
+ for (const [platformKey, asset] of Object.entries(data["platforms"])) {
119
+ platforms[platformKey] = parseManifestAsset(asset, manifestName, platformKey);
120
+ }
121
+ return { name: data["name"], platforms, version: data["version"] };
122
+ }
123
+ async function loadAssetManifest(manifestName, manifestsDir) {
124
+ const directory = manifestsDir ?? resolveDefaultManifestsDir();
125
+ const raw = await readFile(join(directory, `${manifestName}.json`), "utf8");
126
+ return parseAssetManifest(raw, manifestName);
127
+ }
128
+ async function downloadFromManifest(options) {
129
+ const manifest = await loadAssetManifest(options.manifestName, options.manifestsDir);
130
+ const asset = manifest.platforms[options.platformKey];
131
+ if (asset === undefined) {
132
+ throw new UnsupportedPlatformError({
133
+ availablePlatforms: Object.keys(manifest.platforms),
134
+ manifestName: options.manifestName,
135
+ platformKey: options.platformKey
136
+ });
137
+ }
138
+ const destination = join(options.destinationDir, basename(new URL(asset.url).pathname));
139
+ return downloadChecksummedAsset({
140
+ destination,
141
+ sha256: asset.sha256,
142
+ url: asset.url,
143
+ ...options.fetchImpl === undefined ? {} : { fetchImpl: options.fetchImpl },
144
+ ...options.env === undefined ? {} : { env: options.env }
145
+ });
146
+ }
147
+
148
+ // components/bootstrap/src/hook.ts
149
+ import { spawn as spawn2 } from "node:child_process";
150
+ import { stat as stat5 } from "node:fs/promises";
151
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
152
+
153
+ // scripts/auto-update-state.mjs
154
+ import { appendFile, mkdir as mkdir2, open, readFile as readFile2, rm as rm2, stat, writeFile } from "node:fs/promises";
155
+ import { homedir } from "node:os";
156
+ import { dirname as dirname2, join as join2 } from "node:path";
157
+ var DEFAULT_LOCK_STALE_MS = 10 * 60 * 1000;
158
+ function resolveStatePath(env) {
159
+ if (env.LAZYCODEX_AUTO_UPDATE_STATE_PATH?.trim())
160
+ return env.LAZYCODEX_AUTO_UPDATE_STATE_PATH;
161
+ const dataRoot = env.PLUGIN_DATA?.trim() || join2(homedir(), ".local", "share", "lazycodex");
162
+ return join2(dataRoot, "auto-update.json");
163
+ }
164
+ function resolveLockPath(env, statePath) {
165
+ if (env.LAZYCODEX_AUTO_UPDATE_LOCK_PATH?.trim())
166
+ return env.LAZYCODEX_AUTO_UPDATE_LOCK_PATH;
167
+ return `${statePath}.lock`;
168
+ }
169
+ async function acquireLock(lockPath, now, staleMs = DEFAULT_LOCK_STALE_MS) {
170
+ await mkdir2(dirname2(lockPath), { recursive: true });
171
+ try {
172
+ const handle = await open(lockPath, "wx");
173
+ await handle.writeFile(`${now}
174
+ `);
175
+ await handle.close();
176
+ return {
177
+ release: () => rm2(lockPath, { force: true })
178
+ };
179
+ } catch (error) {
180
+ if (!(error instanceof Error && ("code" in error) && error.code === "EEXIST"))
181
+ throw error;
182
+ if (!await removeStaleLock(lockPath, now, staleMs))
183
+ return null;
184
+ return acquireLock(lockPath, now, 0);
185
+ }
186
+ }
187
+ async function readState(statePath) {
188
+ try {
189
+ const raw = await readFile2(statePath, "utf8");
190
+ const parsed = JSON.parse(raw);
191
+ return typeof parsed === "object" && parsed !== null ? parsed : {};
192
+ } catch (error) {
193
+ if (error instanceof Error && "code" in error && error.code === "ENOENT")
194
+ return {};
195
+ return {};
196
+ }
197
+ }
198
+ async function writeState(statePath, state) {
199
+ await mkdir2(dirname2(statePath), { recursive: true });
200
+ await writeFile(statePath, `${JSON.stringify(state, null, 2)}
201
+ `);
202
+ }
203
+ async function removeStaleLock(lockPath, now, staleMs) {
204
+ if (staleMs <= 0)
205
+ return false;
206
+ try {
207
+ const lockStat = await stat(lockPath);
208
+ if (now - lockStat.mtimeMs < staleMs)
209
+ return false;
210
+ await rm2(lockPath, { force: true });
211
+ return true;
212
+ } catch (error) {
213
+ if (error instanceof Error && "code" in error && error.code === "ENOENT")
214
+ return true;
215
+ throw error;
216
+ }
217
+ }
218
+
219
+ // components/bootstrap/src/environment.ts
220
+ import { stat as stat2 } from "node:fs/promises";
221
+ import { readFile as readFile3 } from "node:fs/promises";
222
+ import { homedir as homedir2 } from "node:os";
223
+ import { dirname as dirname3, join as join3, resolve } from "node:path";
224
+ var INSTALL_SNAPSHOT_FILENAME = "lazycodex-install.json";
225
+ var DEFAULT_MARKETPLACE_NAME = "sisyphuslabs";
226
+ var MAX_CODEX_HOME_WALK_UP_LEVELS = 6;
227
+ async function detectInstallFlowDetailed(options) {
228
+ const marketplaceName = options.marketplaceName ?? DEFAULT_MARKETPLACE_NAME;
229
+ const snapshotPresent = await isFile(join3(options.pluginRoot, INSTALL_SNAPSHOT_FILENAME));
230
+ const snapshotSignal = snapshotPresent ? "npx-local" : "marketplace";
231
+ const snapshotReason = snapshotPresent ? `${INSTALL_SNAPSHOT_FILENAME} present at plugin root (written only by the npx installer)` : `${INSTALL_SNAPSHOT_FILENAME} absent from plugin root`;
232
+ const scan = options.configToml === undefined ? { kind: "absent" } : scanMarketplaceSource(options.configToml, marketplaceName);
233
+ if (scan.kind === "absent") {
234
+ return {
235
+ configSignal: undefined,
236
+ configSource: undefined,
237
+ flow: snapshotSignal,
238
+ reason: `${snapshotReason}; no [marketplaces.${marketplaceName}] source to cross-check`,
239
+ snapshotPresent
240
+ };
241
+ }
242
+ if (scan.kind === "unparsable") {
243
+ return {
244
+ configSignal: "unparsable",
245
+ configSource: undefined,
246
+ flow: "unknown",
247
+ reason: `${snapshotReason}; [marketplaces.${marketplaceName}] source value is unparsable`,
248
+ snapshotPresent
249
+ };
250
+ }
251
+ const configSignal = classifyMarketplaceSource(scan.source);
252
+ if (configSignal === "unparsable") {
253
+ return {
254
+ configSignal,
255
+ configSource: scan.source,
256
+ flow: "unknown",
257
+ reason: `${snapshotReason}; marketplace source ${JSON.stringify(scan.source)} is neither a local absolute path nor a git URL`,
258
+ snapshotPresent
259
+ };
260
+ }
261
+ if (configSignal !== snapshotSignal) {
262
+ return {
263
+ configSignal,
264
+ configSource: scan.source,
265
+ flow: "unknown",
266
+ reason: `${snapshotReason}, but marketplace source ${JSON.stringify(scan.source)} indicates ${configSignal}; signals disagree`,
267
+ snapshotPresent
268
+ };
269
+ }
270
+ return {
271
+ configSignal,
272
+ configSource: scan.source,
273
+ flow: snapshotSignal,
274
+ reason: `${snapshotReason}; marketplace source ${JSON.stringify(scan.source)} agrees`,
275
+ snapshotPresent
276
+ };
277
+ }
278
+ async function detectInstallFlow(options) {
279
+ return (await detectInstallFlowDetailed(options)).flow;
280
+ }
281
+ async function detectInstallFlowFromEnvironment(options) {
282
+ const home = await resolveCodexHome({ env: options.env, pluginRoot: options.pluginRoot });
283
+ const configToml = await readOptionalFile(join3(home.path, "config.toml"));
284
+ return detectInstallFlowDetailed({
285
+ pluginRoot: options.pluginRoot,
286
+ ...configToml === undefined ? {} : { configToml },
287
+ ...options.marketplaceName === undefined ? {} : { marketplaceName: options.marketplaceName }
288
+ });
289
+ }
290
+ async function detectInstallFlowForTest(pluginRoot) {
291
+ const home = await resolveCodexHome({ env: {}, pluginRoot });
292
+ const configToml = home.source === "walk-up" ? await readOptionalFile(join3(home.path, "config.toml")) : undefined;
293
+ return detectInstallFlow({ pluginRoot, ...configToml === undefined ? {} : { configToml } });
294
+ }
295
+ async function resolveCodexHome(options) {
296
+ const envHome = options.env["CODEX_HOME"]?.trim();
297
+ if (envHome !== undefined && envHome.length > 0) {
298
+ return { path: resolve(envHome), source: "env" };
299
+ }
300
+ if (options.pluginRoot !== undefined) {
301
+ let current = resolve(options.pluginRoot);
302
+ for (let level = 0;level < MAX_CODEX_HOME_WALK_UP_LEVELS; level += 1) {
303
+ const parent = dirname3(current);
304
+ if (parent === current)
305
+ break;
306
+ current = parent;
307
+ if (await isFile(join3(current, "config.toml"))) {
308
+ return { path: current, source: "walk-up" };
309
+ }
310
+ }
311
+ }
312
+ return { path: join3(homedir2(), ".codex"), source: "default" };
313
+ }
314
+ function resolveBootstrapStatePath(pluginData) {
315
+ return join3(pluginData, "bootstrap", "state.json");
316
+ }
317
+ function resolveBootstrapLockPath(pluginData) {
318
+ return `${resolveBootstrapStatePath(pluginData)}.lock`;
319
+ }
320
+ async function bootstrapLocks(options) {
321
+ const now = options.now ?? Date.now();
322
+ const staleMs = options.staleMs ?? DEFAULT_LOCK_STALE_MS;
323
+ const statePath = resolveBootstrapStatePath(options.pluginData);
324
+ const bootstrapLockPath = resolveBootstrapLockPath(options.pluginData);
325
+ const autoUpdateLockPath = resolveLockPath(options.env, resolveStatePath(options.env));
326
+ const bootstrapLock = await acquireLock(bootstrapLockPath, now, staleMs);
327
+ if (bootstrapLock === null)
328
+ return null;
329
+ if (autoUpdateLockPath === bootstrapLockPath) {
330
+ return { autoUpdateLockPath, bootstrapLockPath, release: () => bootstrapLock.release(), statePath };
331
+ }
332
+ const autoUpdateLock = await acquireLock(autoUpdateLockPath, now, staleMs);
333
+ if (autoUpdateLock === null) {
334
+ await bootstrapLock.release();
335
+ return null;
336
+ }
337
+ return {
338
+ autoUpdateLockPath,
339
+ bootstrapLockPath,
340
+ release: async () => {
341
+ await autoUpdateLock.release();
342
+ await bootstrapLock.release();
343
+ },
344
+ statePath
345
+ };
346
+ }
347
+ function scanMarketplaceSource(configToml, marketplaceName) {
348
+ const expectedHeaders = new Set([`marketplaces.${marketplaceName}`, `marketplaces.${JSON.stringify(marketplaceName)}`]);
349
+ let inMarketplaceSection = false;
350
+ for (const line of configToml.split(`
351
+ `)) {
352
+ const header = parseTomlHeader(line);
353
+ if (header !== null) {
354
+ inMarketplaceSection = expectedHeaders.has(header);
355
+ continue;
356
+ }
357
+ if (!inMarketplaceSection)
358
+ continue;
359
+ const valueText = parseSourceAssignment(line);
360
+ if (valueText === null)
361
+ continue;
362
+ const source = parseTomlStringValue(valueText);
363
+ return source === undefined ? { kind: "unparsable" } : { kind: "source", source };
364
+ }
365
+ return { kind: "absent" };
366
+ }
367
+ function parseTomlHeader(line) {
368
+ const trimmed = line.trim();
369
+ if (!trimmed.startsWith("[") || !trimmed.endsWith("]"))
370
+ return null;
371
+ if (trimmed.startsWith("[["))
372
+ return null;
373
+ return trimmed.slice(1, -1).trim();
374
+ }
375
+ function parseSourceAssignment(line) {
376
+ const match = /^\s*source\s*=\s*(.+)$/.exec(line);
377
+ return match === null ? null : match[1] ?? null;
378
+ }
379
+ function parseTomlStringValue(valueText) {
380
+ const trimmed = valueText.trim();
381
+ if (trimmed.startsWith('"'))
382
+ return parseLeadingJsonString(trimmed);
383
+ if (trimmed.startsWith("'")) {
384
+ const closingIndex = trimmed.indexOf("'", 1);
385
+ return closingIndex === -1 ? undefined : trimmed.slice(1, closingIndex);
386
+ }
387
+ return;
388
+ }
389
+ function parseLeadingJsonString(value) {
390
+ let escaped = false;
391
+ for (let index = 1;index < value.length; index += 1) {
392
+ if (escaped) {
393
+ escaped = false;
394
+ continue;
395
+ }
396
+ const char = value[index];
397
+ if (char === "\\") {
398
+ escaped = true;
399
+ continue;
400
+ }
401
+ if (char === '"') {
402
+ try {
403
+ const parsed = JSON.parse(value.slice(0, index + 1));
404
+ return typeof parsed === "string" ? parsed : undefined;
405
+ } catch {
406
+ return;
407
+ }
408
+ }
409
+ }
410
+ return;
411
+ }
412
+ function classifyMarketplaceSource(source) {
413
+ const trimmed = source.trim();
414
+ if (trimmed.length === 0)
415
+ return "unparsable";
416
+ if (/^(https?|ssh|git):\/\//i.test(trimmed) || trimmed.startsWith("git@"))
417
+ return "marketplace";
418
+ if (trimmed.startsWith("/") || trimmed.startsWith("~") || trimmed.startsWith("\\\\") || /^[A-Za-z]:[\\/]/.test(trimmed)) {
419
+ return "npx-local";
420
+ }
421
+ if (trimmed.toLowerCase().endsWith(".git"))
422
+ return "marketplace";
423
+ return "unparsable";
424
+ }
425
+ async function isFile(path) {
426
+ try {
427
+ return (await stat2(path)).isFile();
428
+ } catch {
429
+ return false;
430
+ }
431
+ }
432
+ async function readOptionalFile(path) {
433
+ try {
434
+ return await readFile3(path, "utf8");
435
+ } catch {
436
+ return;
437
+ }
438
+ }
439
+
440
+ // components/bootstrap/src/worker.ts
441
+ import { appendFile as appendFile2, mkdir as mkdir8, readFile as readFile12 } from "node:fs/promises";
442
+ import { homedir as homedir4 } from "node:os";
443
+ import { dirname as dirname7, join as join19, resolve as resolve6 } from "node:path";
444
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
445
+
446
+ // components/bootstrap/src/provision.ts
447
+ import { execFile } from "node:child_process";
448
+ import { rm as rm4 } from "node:fs/promises";
449
+ import { dirname as dirname4, join as join7 } from "node:path";
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";
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;
506
+
507
+ class SgProvisionError extends Error {
508
+ code;
509
+ constructor(code, message, options = {}) {
510
+ super(message, options);
511
+ this.name = "SgProvisionError";
512
+ this.code = code;
513
+ }
514
+ }
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 });
532
+ }
533
+ if (!response.ok) {
534
+ throw new SgProvisionError("download_failed", `failed to download ast-grep ${SG_PINNED_VERSION} from ${url}: HTTP ${response.status}`);
535
+ }
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 });
540
+ }
541
+ }
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");
553
+ }
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;
576
+ }
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}`);
583
+ }
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;
599
+ }
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`);
610
+ }
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
+ }
616
+ }
617
+ async function provisionSgBinary(options) {
618
+ const platform = options.platform ?? process.platform;
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);
629
+ try {
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}`);
635
+ }
636
+ await writeFile2(tempPath, extractStandaloneSgBinary(archive, platform));
637
+ await chmod(tempPath, 493);
638
+ await rename2(tempPath, destination);
639
+ return destination;
640
+ } catch (error) {
641
+ await rm3(tempPath, { force: true });
642
+ if (error instanceof SgProvisionError)
643
+ throw error;
644
+ throw new SgProvisionError("write_failed", `failed to provision ast-grep ${SG_PINNED_VERSION} into ${targetDir}: ${describeFailure2(error)}`, { cause: error });
645
+ }
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;
674
+ }
675
+ return false;
676
+ }
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;
712
+ }
713
+ }
714
+ return null;
715
+ }
716
+
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
785
+ var SG_PROVISION_COMPONENT = "ast_grep";
786
+ var SG_FORCE_PROVISION_ENV_KEY = "OMO_BOOTSTRAP_FORCE_PROVISION";
787
+ function sgProvisionDestination(context, arch) {
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));
792
+ }
793
+ async function runSgProvision(context, seams = {}) {
794
+ const arch = seams.arch ?? process.arch;
795
+ const destination = sgProvisionDestination(context, arch);
796
+ if (context.env[SG_FORCE_PROVISION_ENV_KEY] !== "1") {
797
+ const preexisting = (seams.resolvePreexistingSg ?? defaultResolvePreexistingSg)({
798
+ arch,
799
+ codexHome: context.codexHome,
800
+ env: context.env,
801
+ platform: context.platform
802
+ });
803
+ if (preexisting !== null) {
804
+ await appendBootstrapLog(context.pluginData, context.now, "sg-provision", { sg: `preexisting:${preexisting}` });
805
+ return { degraded: [] };
806
+ }
807
+ }
808
+ try {
809
+ const version = await provisionFromSharedManifest(context, seams, { arch, destination });
810
+ await appendBootstrapLog(context.pluginData, context.now, "sg-provision", {
811
+ sg: `provisioned:${destination}`,
812
+ version
813
+ });
814
+ return { degraded: [] };
815
+ } catch (error) {
816
+ const reason = error instanceof Error ? error.message : String(error);
817
+ await appendBootstrapLog(context.pluginData, context.now, "sg-provision-failed", { reason });
818
+ return { degraded: [{ component: SG_PROVISION_COMPONENT, hint: BOOTSTRAP_DOCTOR_HINT, reason }] };
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 }
828
+ });
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;
835
+ }
836
+ async function verifyProvisionedVersion(destination, pinnedVersion, seams) {
837
+ let reported;
838
+ try {
839
+ reported = (await (seams.runVersionProbe ?? defaultVersionProbe2)(destination)).trim();
840
+ } catch (error) {
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)}`);
843
+ }
844
+ if (!reported.includes(pinnedVersion)) {
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.`);
847
+ }
848
+ }
849
+ function defaultResolvePreexistingSg(options) {
850
+ return findSgBinarySync({
851
+ arch: options.arch,
852
+ env: { ...options.env, CODEX_HOME: options.codexHome },
853
+ platform: options.platform,
854
+ runtimeDir: sgRuntimeDir(options.codexHome, options.platform, options.arch)
855
+ });
856
+ }
857
+ var execFileAsync = promisify(execFile);
858
+ async function defaultVersionProbe2(binaryPath) {
859
+ const { stdout } = await execFileAsync(binaryPath, ["--version"]);
860
+ return String(stdout);
861
+ }
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
+ ]
884
+ }
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 });
901
+ }
902
+ }
903
+ function hasRequiredMarkers(content, markers) {
904
+ return markers.every((marker) => content.includes(marker));
905
+ }
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;
913
+ }
914
+ }
915
+ async function exists(path) {
916
+ try {
917
+ await lstat(path);
918
+ return true;
919
+ } catch (error) {
920
+ if (nodeErrorCode(error) !== "ENOENT")
921
+ throw error;
922
+ return false;
923
+ }
924
+ }
925
+ function nodeErrorCode(error) {
926
+ if (!(error instanceof Error) || !("code" in error))
927
+ return null;
928
+ return typeof error.code === "string" ? error.code : null;
929
+ }
930
+
931
+ // ../src/install/link-cached-plugin-agents.ts
932
+ var MANIFEST_FILE = ".installed-agents.json";
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;
938
+ const agentEntries = await readdir(agentsDir, { withFileTypes: true });
939
+ for (const entry of agentEntries) {
940
+ if (!entry.name.endsWith(".toml"))
941
+ continue;
942
+ const content = await readTextIfExists2(join9(agentsDir, entry.name));
943
+ if (content === null)
944
+ continue;
945
+ const effort = extractReasoningEffort(content);
946
+ if (effort !== null)
947
+ preserved.set(agentNameFromToml(entry.name), effort);
948
+ }
949
+ return preserved;
950
+ }
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;
956
+ const agentEntries = await readdir(agentsDir, { withFileTypes: true });
957
+ for (const entry of agentEntries) {
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));
964
+ }
965
+ return preserved;
966
+ }
967
+ async function linkCachedPluginAgents(input) {
968
+ const bundledAgents = await discoverBundledAgents(input.pluginRoot);
969
+ await purgeRetiredManagedAgentFiles({ codexHome: input.codexHome });
970
+ if (bundledAgents.length === 0) {
971
+ await writeManifest(input.pluginRoot, []);
972
+ return [];
973
+ }
974
+ const agentsDir = join9(input.codexHome, "agents");
975
+ await mkdir4(agentsDir, { recursive: true });
976
+ const linked = [];
977
+ for (const agentPath of bundledAgents) {
978
+ const agentFileName = basename3(agentPath);
979
+ const agentName = agentNameFromToml(agentFileName);
980
+ const linkPath = join9(agentsDir, agentFileName);
981
+ await replaceWithCopy(linkPath, agentPath);
982
+ await restorePreservedReasoning({
983
+ agentName,
984
+ linkPath,
985
+ target: agentPath,
986
+ value: input.preservedReasoning?.get(agentName)
987
+ });
988
+ await restorePreservedServiceTier({
989
+ linkPath,
990
+ preserved: input.preservedServiceTier?.has(agentName) ?? false,
991
+ value: input.preservedServiceTier?.get(agentName) ?? null
992
+ });
993
+ linked.push({ name: agentFileName, path: linkPath, target: agentPath });
994
+ }
995
+ await writeManifest(input.pluginRoot, linked.map((entry) => entry.path));
996
+ return linked;
997
+ }
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);
1008
+ }
1009
+ async function discoverBundledAgents(pluginRoot) {
1010
+ const componentsRoot = join9(pluginRoot, "components");
1011
+ if (!await exists2(componentsRoot))
1012
+ return [];
1013
+ const componentEntries = await readdir(componentsRoot, { withFileTypes: true });
1014
+ const agents = [];
1015
+ for (const entry of componentEntries) {
1016
+ if (!entry.isDirectory())
1017
+ continue;
1018
+ const agentsRoot = join9(componentsRoot, entry.name, "agents");
1019
+ if (!await exists2(agentsRoot))
1020
+ continue;
1021
+ const agentEntries = await readdir(agentsRoot, { withFileTypes: true });
1022
+ for (const file of agentEntries) {
1023
+ if (!file.isFile() || !file.name.endsWith(".toml"))
1024
+ continue;
1025
+ agents.push(join9(agentsRoot, file.name));
1026
+ }
1027
+ }
1028
+ agents.sort();
1029
+ return agents;
1030
+ }
1031
+ async function replaceWithCopy(linkPath, target) {
1032
+ await prepareReplacement(linkPath);
1033
+ await copyFile(target, linkPath);
1034
+ }
1035
+ async function prepareReplacement(linkPath) {
1036
+ if (!await exists2(linkPath))
1037
+ return;
1038
+ const entryStat = await lstat2(linkPath);
1039
+ if (entryStat.isDirectory() && !entryStat.isSymbolicLink()) {
1040
+ throw new Error(`${linkPath} already exists and is a directory; refusing to replace`);
1041
+ }
1042
+ await rm6(linkPath, { force: true });
1043
+ }
1044
+ async function writeManifest(pluginRoot, agentPaths) {
1045
+ const manifestPath = join9(pluginRoot, MANIFEST_FILE);
1046
+ const payload = { agents: [...agentPaths].sort() };
1047
+ await writeFile3(manifestPath, `${JSON.stringify(payload, null, "\t")}
1048
+ `);
1049
+ }
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);
1061
+ }
1062
+ async function readTextIfExists2(path) {
1063
+ try {
1064
+ return await readFile5(path, "utf8");
1065
+ } catch (error) {
1066
+ if (nodeErrorCode2(error) === "ENOENT")
1067
+ return null;
1068
+ throw error;
1069
+ }
1070
+ }
1071
+ function extractReasoningEffort(content) {
1072
+ return extractTopLevelStringSetting(content, "model_reasoning_effort");
1073
+ }
1074
+ function extractServiceTier(content) {
1075
+ return extractTopLevelStringSetting(content, "service_tier");
1076
+ }
1077
+ function extractTopLevelStringSetting(content, key) {
1078
+ for (const line of content.split(/\n/)) {
1079
+ if (isSectionHeader(line))
1080
+ return null;
1081
+ const rawValue = topLevelStringSettingRawValue(line, key);
1082
+ if (rawValue === undefined)
1083
+ continue;
1084
+ const parsed = parseJsonString(rawValue);
1085
+ if (parsed !== null)
1086
+ return parsed;
1087
+ }
1088
+ return null;
1089
+ }
1090
+ function replaceReasoningEffort(content, value) {
1091
+ return replaceTopLevelStringSetting(content, "model_reasoning_effort", value, { insertIfMissing: false });
1092
+ }
1093
+ function replaceServiceTier(content, value) {
1094
+ return replaceTopLevelStringSetting(content, "service_tier", value, { insertIfMissing: true });
1095
+ }
1096
+ function replaceTopLevelStringSetting(content, key, value, options) {
1097
+ const lines = content.split(/\n/);
1098
+ for (let index = 0;index < lines.length; index += 1) {
1099
+ const line = lines[index];
1100
+ if (line === undefined || isSectionHeader(line))
1101
+ break;
1102
+ if (topLevelStringSettingRawValue(line, key) === undefined)
1103
+ continue;
1104
+ if (value === null) {
1105
+ lines.splice(index, 1);
1106
+ return { content: lines.join(`
1107
+ `), replaced: true };
1108
+ }
1109
+ lines[index] = line.replace(/=\s*"(?:[^"\\]|\\.)*"/, `= ${JSON.stringify(value)}`);
1110
+ return { content: lines.join(`
1111
+ `), replaced: true };
1112
+ }
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 };
1118
+ }
1119
+ function topLevelStringSettingRawValue(line, key) {
1120
+ const match = line.match(/^\s*([A-Za-z0-9_]+)\s*=\s*("(?:[^"\\]|\\.)*")/);
1121
+ if (match === null)
1122
+ return;
1123
+ const settingKey = match[1];
1124
+ const rawValue = match[2];
1125
+ if (settingKey !== key || rawValue === undefined)
1126
+ return;
1127
+ return rawValue;
1128
+ }
1129
+ function topLevelInsertionIndex(lines) {
1130
+ const sectionIndex = lines.findIndex((line) => isSectionHeader(line));
1131
+ const topLevelEnd = sectionIndex === -1 ? lines.length : sectionIndex;
1132
+ let insertionIndex = topLevelEnd;
1133
+ while (insertionIndex > 0 && lines[insertionIndex - 1] === "") {
1134
+ insertionIndex -= 1;
1135
+ }
1136
+ return insertionIndex;
1137
+ }
1138
+ function isSectionHeader(line) {
1139
+ const trimmed = line.trim();
1140
+ return trimmed.startsWith("[") && trimmed.endsWith("]");
1141
+ }
1142
+ function agentNameFromToml(fileName) {
1143
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
1144
+ }
1145
+ function parseJsonString(value) {
1146
+ try {
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);
1158
+ return true;
1159
+ } catch (error) {
1160
+ if (nodeErrorCode2(error) !== "ENOENT")
1161
+ throw error;
1162
+ return false;
1163
+ }
1164
+ }
1165
+ function nodeErrorCode2(error) {
1166
+ if (!(error instanceof Error) || !("code" in error))
1167
+ return null;
1168
+ return typeof error.code === "string" ? error.code : null;
1169
+ }
1170
+
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";
1174
+
1175
+ // ../src/install/codex-cache-command-shim.ts
1176
+ var COMMAND_SHIM_MARKER = ":: generated by oh-my-openagent Codex installer";
1177
+
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";
1200
+ var LEGACY_CODEX_COMPONENT_BINS = [
1201
+ { name: "omo", component: "ulw-loop" },
1202
+ { name: "codex-comment-checker", component: "comment-checker" },
1203
+ { name: "codex-lsp", component: "lsp" },
1204
+ { name: "codex-rules", component: "rules" },
1205
+ { name: "codex-start-work-continuation", component: "start-work-continuation" },
1206
+ { name: "codex-telemetry", component: "telemetry" },
1207
+ { name: "codex-ultrawork", component: "ultrawork" }
1208
+ ];
1209
+ async function removeLegacyCodexComponentBins(binDir, platform) {
1210
+ for (const entry of LEGACY_CODEX_COMPONENT_BINS) {
1211
+ const linkPath = join10(binDir, platform === "win32" ? `${entry.name}.cmd` : entry.name);
1212
+ await removeLegacyCodexComponentBin(linkPath, entry.component, platform);
1213
+ }
1214
+ }
1215
+ async function removeLegacyCodexComponentBin(linkPath, component, platform) {
1216
+ try {
1217
+ const stat3 = await lstat4(linkPath);
1218
+ if (platform !== "win32") {
1219
+ if (!stat3.isSymbolicLink())
1220
+ return;
1221
+ const target = await readlink(linkPath);
1222
+ if (isManagedLegacyComponentTarget(target, component))
1223
+ await rm7(linkPath, { force: true });
1224
+ return;
1225
+ }
1226
+ if (!stat3.isFile())
1227
+ return;
1228
+ const content = await readFile6(linkPath, "utf8");
1229
+ if (content.includes(COMMAND_SHIM_MARKER))
1230
+ await rm7(linkPath, { force: true });
1231
+ } catch (error) {
1232
+ if (isNodeErrorWithCode2(error) && error.code === "ENOENT")
1233
+ return;
1234
+ throw error;
1235
+ }
1236
+ }
1237
+ function isManagedLegacyComponentTarget(target, component) {
1238
+ const parts = target.split(/[\\/]+/);
1239
+ const suffixStart = parts.length - 4;
1240
+ const suffix = parts.slice(-4);
1241
+ return suffix[0] === "components" && suffix[1] === component && suffix[2] === "dist" && suffix[3] === "cli.js" && (hasPluginCachePrefix(parts, suffixStart) || hasOmoCodexPluginPrefix(parts, suffixStart));
1242
+ }
1243
+ function hasPluginCachePrefix(parts, endExclusive) {
1244
+ for (let index = 0;index < endExclusive - 1; index += 1) {
1245
+ if (parts[index] === "plugins" && parts[index + 1] === "cache")
1246
+ return true;
1247
+ }
1248
+ return false;
1249
+ }
1250
+ function hasOmoCodexPluginPrefix(parts, endExclusive) {
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;
1254
+ }
1255
+ return false;
1256
+ }
1257
+ function isNodeErrorWithCode2(error) {
1258
+ return typeof error === "object" && error !== null && "code" in error;
1259
+ }
1260
+
1261
+ // ../src/install/codex-cache-runtime-wrapper.ts
1262
+ import { join as join11 } from "node:path";
1263
+ var RUNTIME_WRAPPER_MARKER = "OMO_GENERATED_RUNTIME_WRAPPER";
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);
1359
+ const linked = [];
1360
+ for (const link of binLinks) {
1361
+ const linkPath = await linkCachedPluginBin(input.binDir, link, platform);
1362
+ linked.push({ name: link.name, path: linkPath, target: link.target });
1363
+ }
1364
+ return linked;
1365
+ }
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 });
1373
+ if (platform === "win32") {
1374
+ const linkPath2 = join12(input.binDir, "omo.cmd");
1375
+ await replaceRuntimeWrapper(linkPath2, windowsRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
1376
+ return { name: "omo", path: linkPath2, target: cliPath };
1377
+ }
1378
+ const linkPath = join12(input.binDir, "omo");
1379
+ await replaceRuntimeWrapper(linkPath, posixRuntimeWrapper(cliPath, input.codexHome, input.binDir, nodeCliPath));
1380
+ await chmod2(linkPath, 493);
1381
+ return { name: "omo", path: linkPath, target: cliPath };
1382
+ }
1383
+ async function linkCachedPluginBin(binDir, link, platform) {
1384
+ if (platform === "win32") {
1385
+ const linkPath2 = join12(binDir, `${link.name}.cmd`);
1386
+ await replaceCommandShim(linkPath2, link.target);
1387
+ return linkPath2;
1388
+ }
1389
+ const linkPath = join12(binDir, link.name);
1390
+ await replaceSymlink(linkPath, link.target);
1391
+ return linkPath;
1392
+ }
1393
+ async function isFile2(path) {
1394
+ try {
1395
+ return (await stat3(path)).isFile();
1396
+ } catch (error) {
1397
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1398
+ return false;
1399
+ throw error;
1400
+ }
1401
+ }
1402
+ async function discoverPackageBins(root) {
1403
+ const links = [];
1404
+ await collectPackageBins(root, root, links);
1405
+ return links;
1406
+ }
1407
+ async function collectPackageBins(directory, root, links) {
1408
+ const entries = await readdir2(directory, { withFileTypes: true });
1409
+ if (entries.some((entry) => entry.isFile() && entry.name === "package.json")) {
1410
+ await appendPackageBinLinks(join12(directory, "package.json"), directory, root, links);
1411
+ }
1412
+ for (const entry of entries) {
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;
1420
+ await collectPackageBins(childPath, root, links);
1421
+ }
1422
+ }
1423
+ async function appendPackageBinLinks(packageJsonPath, packageRoot, root, links) {
1424
+ const packageJson = JSON.parse(await readFile7(packageJsonPath, "utf8"));
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));
1431
+ if (!isReservedNestedBinName(name, packageRoot, root)) {
1432
+ links.push({ name, target: resolvePackageBinTarget(packageRoot, packageBin) });
1433
+ }
1434
+ return;
1435
+ }
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) });
1445
+ }
1446
+ }
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}`);
1450
+ }
1451
+ return name;
1452
+ }
1453
+ function isReservedNestedBinName(name, packageRoot, root) {
1454
+ return packageRoot !== root && RESERVED_NESTED_BIN_NAMES.has(name);
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
+ }
1467
+ async function replaceSymlink(linkPath, targetPath) {
1468
+ if (await existingNonSymlink(linkPath))
1469
+ throw new Error(`${linkPath} already exists and is not a symlink`);
1470
+ await rm8(linkPath, { force: true });
1471
+ await symlink(targetPath, linkPath);
1472
+ }
1473
+ async function replaceCommandShim(linkPath, targetPath) {
1474
+ if (await existingNonShim(linkPath))
1475
+ throw new Error(`${linkPath} already exists and is not a command shim`);
1476
+ await writeFile4(linkPath, `@echo off\r
1477
+ ${COMMAND_SHIM_MARKER}\r
1478
+ node "${targetPath}" %*\r
1479
+ `);
1480
+ }
1481
+ async function replaceRuntimeWrapper(linkPath, content) {
1482
+ if (await existingNonRuntimeWrapper(linkPath))
1483
+ throw new Error(`${linkPath} already exists and is not a generated OMO runtime wrapper`);
1484
+ await rm8(linkPath, { force: true });
1485
+ await writeFile4(linkPath, content);
1486
+ }
1487
+ async function existingNonRuntimeWrapper(path) {
1488
+ try {
1489
+ const stat4 = await lstat5(path);
1490
+ if (stat4.isSymbolicLink())
1491
+ return false;
1492
+ if (!stat4.isFile())
1493
+ return true;
1494
+ const content = await readFile7(path, "utf8");
1495
+ return !content.includes(RUNTIME_WRAPPER_MARKER);
1496
+ } catch (error) {
1497
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1498
+ return false;
1499
+ throw error;
1500
+ }
1501
+ }
1502
+ async function existingNonShim(path) {
1503
+ try {
1504
+ const stat4 = await lstat5(path);
1505
+ if (!stat4.isFile())
1506
+ return true;
1507
+ const content = await readFile7(path, "utf8");
1508
+ if (content.includes(COMMAND_SHIM_MARKER))
1509
+ return false;
1510
+ throw new Error(`${path} already exists and is not a generated command shim`);
1511
+ } catch (error) {
1512
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1513
+ return false;
1514
+ throw error;
1515
+ }
1516
+ }
1517
+ async function existingNonSymlink(path) {
1518
+ try {
1519
+ const stat4 = await lstat5(path);
1520
+ if (!stat4.isSymbolicLink())
1521
+ return true;
1522
+ await readlink2(path);
1523
+ return false;
1524
+ } catch (error) {
1525
+ if (isNodeErrorWithCode(error) && error.code === "ENOENT")
1526
+ return false;
1527
+ throw error;
1528
+ }
1529
+ }
1530
+
1531
+ // ../src/install/codex-config-toml.ts
1532
+ import { mkdir as mkdir6, readFile as readFile9 } from "node:fs/promises";
1533
+ import { dirname as dirname6 } from "node:path";
1534
+
1535
+ // ../src/install/toml-section-editor.ts
1536
+ function findTomlSection(config, header) {
1537
+ const headerLine = `[${header}]`;
1538
+ const lines = config.match(/[^\n]*\n?|$/g) ?? [];
1539
+ let offset = 0;
1540
+ let start = -1;
1541
+ for (const line of lines) {
1542
+ if (line.length === 0)
1543
+ break;
1544
+ const trimmed = line.trim();
1545
+ if (start === -1) {
1546
+ if (trimmed === headerLine)
1547
+ start = offset;
1548
+ } else if (trimmed.startsWith("[") && trimmed.endsWith("]")) {
1549
+ return { start, end: offset, text: config.slice(start, offset) };
1550
+ }
1551
+ offset += line.length;
1552
+ }
1553
+ if (start === -1)
1554
+ return null;
1555
+ return { start, end: config.length, text: config.slice(start) };
1556
+ }
1557
+ function replaceOrInsertSetting(config, section, key, value) {
1558
+ const linePattern = new RegExp(`^${escapeRegExp(key)}\\s*=.*$`, "m");
1559
+ const replacement = linePattern.test(section.text) ? section.text.replace(linePattern, `${key} = ${value}`) : insertSetting(section.text, key, value);
1560
+ return config.slice(0, section.start) + replacement + config.slice(section.end);
1561
+ }
1562
+ function removeSetting(config, section, key) {
1563
+ const linePattern = new RegExp(`^\\s*${escapeRegExp(key)}\\s*=.*(?:\\n|$)`, "m");
1564
+ const replacement = section.text.replace(linePattern, "");
1565
+ return config.slice(0, section.start) + replacement + config.slice(section.end);
1566
+ }
1567
+ function replaceOrInsertRootSetting(config, key, value) {
1568
+ const sectionStart = findFirstTableStart(config);
1569
+ const root = config.slice(0, sectionStart);
1570
+ const suffix = config.slice(sectionStart);
1571
+ const linePattern = new RegExp(`^${escapeRegExp(key)}\\s*=.*$`, "m");
1572
+ const replacement = linePattern.test(root) ? root.replace(linePattern, `${key} = ${value}`) : `${root.trimEnd()}${root.trimEnd().length > 0 ? `
1573
+ ` : ""}${key} = ${value}
1574
+ `;
1575
+ if (suffix.length === 0)
1576
+ return replacement;
1577
+ return `${replacement.trimEnd()}
1578
+
1579
+ ${suffix.trimStart()}`;
1580
+ }
1581
+ function appendBlock(config, block) {
1582
+ const prefix = config.trimEnd();
1583
+ return `${prefix}${prefix.length > 0 ? `
1584
+
1585
+ ` : ""}${block.trimEnd()}
1586
+ `;
1587
+ }
1588
+ function findFirstTableStart(config) {
1589
+ const match = config.match(/^[[].*$/m);
1590
+ return match?.index ?? config.length;
1591
+ }
1592
+ function insertSetting(sectionText, key, value) {
1593
+ const lines = sectionText.split(`
1594
+ `);
1595
+ lines.splice(1, 0, `${key} = ${value}`);
1596
+ return lines.join(`
1597
+ `);
1598
+ }
1599
+ function escapeRegExp(value) {
1600
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1601
+ }
1602
+
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
+ `);
1608
+ }
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;
1628
+ }
1629
+ function parsePluginHeaderKey(header) {
1630
+ const prefix = "plugins.";
1631
+ if (!header.startsWith(prefix))
1632
+ return null;
1633
+ return parseLeadingJsonString2(header.slice(prefix.length));
1634
+ }
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) {
1643
+ try {
1644
+ const parsed = JSON.parse(value);
1645
+ return typeof parsed === "string" ? parsed : null;
1646
+ } catch (error) {
1647
+ if (error instanceof Error)
1648
+ return null;
1649
+ return null;
1650
+ }
1651
+ }
1652
+ function parseTomlHeader2(line) {
1653
+ const trimmed = line.trim();
1654
+ if (!trimmed.startsWith("[") || !trimmed.endsWith("]") || trimmed.startsWith("[["))
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));
1674
+ }
1675
+ return null;
1676
+ }
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
+ `);
1703
+ }
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);
1716
+ }
1717
+
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;
1736
+ }
1737
+ }
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;
1747
+ }
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);
1755
+ }
1756
+ }
1757
+ async function renameWithRetry(fromPath, toPath) {
1758
+ for (let attempt = 0;; attempt += 1) {
1759
+ try {
1760
+ await rename3(fromPath, toPath);
1761
+ return;
1762
+ } catch (error) {
1763
+ if (!isRetriableRenameError(error) || attempt >= RENAME_RETRY_DELAYS_MS.length) {
1764
+ throw error;
1765
+ }
1766
+ await delay(RENAME_RETRY_DELAYS_MS[attempt] ?? 0);
1767
+ }
1768
+ }
1769
+ }
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);
1774
+ }
1775
+ function delay(milliseconds) {
1776
+ return new Promise((resolveDelay) => setTimeout(resolveDelay, milliseconds));
1777
+ }
1778
+
1779
+ // ../src/install/codex-config-features.ts
1780
+ function ensureFeatureEnabled(config, featureName) {
1781
+ const section = findTomlSection(config, "features");
1782
+ if (!section)
1783
+ return appendBlock(config, `[features]
1784
+ ${featureName} = true
1785
+ `);
1786
+ return replaceOrInsertSetting(config, section, featureName, "true");
1787
+ }
1788
+
1789
+ // ../src/install/codex-config-marketplaces.ts
1790
+ var SISYPHUS_LEGACY_MARKETPLACES = ["lazycodex", "code-yeongyu-codex-plugins"];
1791
+ function legacyMarketplaceNames(marketplaceName) {
1792
+ return marketplaceName === "sisyphuslabs" ? SISYPHUS_LEGACY_MARKETPLACES : [];
1793
+ }
1794
+ function removeMarketplaceBlock(config, marketplaceName) {
1795
+ return removeTomlSections(config, (header) => header === `marketplaces.${marketplaceName}`);
1796
+ }
1797
+ function hasMarketplaceBlock(config, marketplaceName) {
1798
+ return findTomlSection(config, `marketplaces.${marketplaceName}`) !== null;
1799
+ }
1800
+ function removeStaleMarketplacePluginBlocks(config, marketplaceName, keepPluginNames) {
1801
+ return removeTomlSections(config, (header) => {
1802
+ const pluginKey = parsePluginHeaderKey(header);
1803
+ if (pluginKey === null)
1804
+ return false;
1805
+ const suffix = `@${marketplaceName}`;
1806
+ if (!pluginKey.endsWith(suffix))
1807
+ return false;
1808
+ return !keepPluginNames.has(pluginKey.slice(0, -suffix.length));
1809
+ });
1810
+ }
1811
+ function removeStaleMarketplaceHookStateBlocks(config, marketplaceName, keepPluginNames) {
1812
+ return removeTomlSections(config, (header) => {
1813
+ const prefix = "hooks.state.";
1814
+ if (!header.startsWith(prefix))
1815
+ return false;
1816
+ const hookKey = parseJsonString2(header.slice(prefix.length));
1817
+ if (hookKey === null)
1818
+ return false;
1819
+ const separator = hookKey.indexOf(":");
1820
+ if (separator === -1)
1821
+ return false;
1822
+ const pluginKey = hookKey.slice(0, separator);
1823
+ const suffix = `@${marketplaceName}`;
1824
+ if (!pluginKey.endsWith(suffix))
1825
+ return false;
1826
+ return !keepPluginNames.has(pluginKey.slice(0, -suffix.length));
1827
+ });
1828
+ }
1829
+ function ensureMarketplaceBlock(config, marketplaceName, source) {
1830
+ const header = `marketplaces.${marketplaceName}`;
1831
+ const lines = [
1832
+ `[${header}]`,
1833
+ `last_updated = "${new Date().toISOString().replace(/\.\d{3}Z$/, "Z")}"`,
1834
+ `source_type = ${JSON.stringify(source.sourceType)}`,
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
+ `);
1843
+ const section = findTomlSection(config, header);
1844
+ if (section)
1845
+ return config.slice(0, section.start) + block + config.slice(section.end);
1846
+ return appendBlock(config, block);
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
1889
+ function ensurePluginEnabled(config, pluginKey) {
1890
+ const header = `plugins.${JSON.stringify(pluginKey)}`;
1891
+ const section = findTomlSection(config, header);
1892
+ if (!section)
1893
+ return appendBlock(config, `[${header}]
1894
+ enabled = true
1895
+ `);
1896
+ return replaceOrInsertSetting(config, section, "enabled", "true");
1897
+ }
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;
1902
+ let nextConfig = ensurePluginMcpEnabled(config, "omo@sisyphuslabs", "context7", true);
1903
+ nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "codegraph", true);
1904
+ nextConfig = ensurePluginMcpEnabled(nextConfig, "omo@sisyphuslabs", "git_bash", gitBashEnabled);
1905
+ return nextConfig;
1906
+ }
1907
+ function ensureHookTrusted(config, state) {
1908
+ const header = `hooks.state.${JSON.stringify(state.key)}`;
1909
+ const section = findTomlSection(config, header);
1910
+ if (!section)
1911
+ return appendBlock(config, `[${header}]
1912
+ trusted_hash = ${JSON.stringify(state.trustedHash)}
1913
+ `);
1914
+ return replaceOrInsertSetting(config, section, "trusted_hash", JSON.stringify(state.trustedHash));
1915
+ }
1916
+ function ensurePluginMcpEnabled(config, pluginKey, serverName, enabled) {
1917
+ const header = `plugins.${JSON.stringify(pluginKey)}.mcp_servers.${serverName}`;
1918
+ const section = findTomlSection(config, header);
1919
+ const enabledValue = enabled ? "true" : "false";
1920
+ if (!section)
1921
+ return appendBlock(config, `[${header}]
1922
+ enabled = ${enabledValue}
1923
+ `);
1924
+ return replaceOrInsertSetting(config, section, "enabled", enabledValue);
1925
+ }
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;
1939
+ }
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;
1960
+ }
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;
1977
+ }
1978
+ }
1979
+ const numeric = Number(trimmed);
1980
+ return Number.isFinite(numeric) ? numeric : undefined;
1981
+ }
1982
+ function isSectionHeader2(line) {
1983
+ const trimmed = line.trim();
1984
+ return trimmed.startsWith("[") && trimmed.endsWith("]");
1985
+ }
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);
2079
+ }
2080
+ function removeFeatureFlagSetting(config, featureName) {
2081
+ const section = findTomlSection(config, "features");
2082
+ if (!section)
2083
+ return config;
2084
+ return removeSetting(config, section, featureName);
2085
+ }
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);
2118
+ }
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
+ `);
2131
+ }
2132
+ async function exists3(path) {
2133
+ try {
2134
+ await readFile9(path, "utf8");
2135
+ return true;
2136
+ } catch (error) {
2137
+ if (error instanceof Error)
2138
+ return false;
2139
+ return false;
2140
+ }
2141
+ }
2142
+
2143
+ // ../src/install/codex-git-bash-mcp-env.ts
2144
+ import { readFile as readFile10, writeFile as writeFile6 } from "node:fs/promises";
2145
+ import { join as join15 } from "node:path";
2146
+ var GIT_BASH_ENV_KEY = "OMO_CODEX_GIT_BASH_PATH";
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;
2157
+ const parsed = JSON.parse(await readFile10(manifestPath, "utf8"));
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")}
2168
+ `);
2169
+ return true;
2170
+ }
2171
+
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";
2283
+ import { existsSync as existsSync2 } from "node:fs";
2284
+ var GIT_BASH_ENV_KEY2 = "OMO_CODEX_GIT_BASH_PATH";
2285
+ var WINGET_INSTALL_ARGS = ["install", "--id", "Git.Git", "-e", "--source", "winget"];
2286
+ var PROGRAM_FILES_GIT_BASH = "C:\\Program Files\\Git\\bin\\bash.exe";
2287
+ var PROGRAM_FILES_X86_GIT_BASH = "C:\\Program Files (x86)\\Git\\bin\\bash.exe";
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: [] };
2292
+ const checkedPaths = [];
2293
+ const envPath = nonEmptyEnvValue(input.env, GIT_BASH_ENV_KEY2);
2294
+ if (envPath !== undefined) {
2295
+ checkedPaths.push(envPath);
2296
+ if (isBashExePath(envPath) && input.exists(envPath)) {
2297
+ return { found: true, path: envPath, source: "env", checkedPaths };
2298
+ }
2299
+ return missingGitBash(checkedPaths);
2300
+ }
2301
+ for (const candidate of [
2302
+ { path: PROGRAM_FILES_GIT_BASH, source: "program-files" },
2303
+ { path: PROGRAM_FILES_X86_GIT_BASH, source: "program-files-x86" }
2304
+ ]) {
2305
+ checkedPaths.push(candidate.path);
2306
+ if (input.exists(candidate.path))
2307
+ return { found: true, path: candidate.path, source: candidate.source, checkedPaths };
2308
+ }
2309
+ for (const pathCandidate of input.where("bash")) {
2310
+ const candidate = pathCandidate.trim();
2311
+ if (candidate.length === 0)
2312
+ continue;
2313
+ checkedPaths.push(candidate);
2314
+ if (isKnownNonGitBashLauncher(candidate))
2315
+ continue;
2316
+ if (isBashExePath(candidate) && input.exists(candidate))
2317
+ return { found: true, path: candidate, source: "path", checkedPaths };
2318
+ }
2319
+ return missingGitBash(checkedPaths);
2320
+ }
2321
+ var resolveGitBashForCurrentProcess = (input = {}) => {
2322
+ return resolveGitBash({
2323
+ platform: input.platform ?? process.platform,
2324
+ env: input.env ?? process.env,
2325
+ exists: existsSync2,
2326
+ where: whereCommand
2327
+ });
2328
+ };
2329
+ function missingGitBash(checkedPaths) {
2330
+ return {
2331
+ found: false,
2332
+ checkedPaths,
2333
+ installHint: [
2334
+ "Git Bash is required on native Windows.",
2335
+ "Install it with: winget install --id Git.Git -e --source winget",
2336
+ `For a custom install, set ${GIT_BASH_ENV_KEY2}=C:\\path\\to\\bash.exe`
2337
+ ].join(`
2338
+ `)
2339
+ };
2340
+ }
2341
+ function nonEmptyEnvValue(env, key) {
2342
+ const value = env[key];
2343
+ if (value === undefined)
2344
+ return;
2345
+ const trimmed = value.trim();
2346
+ return trimmed.length === 0 ? undefined : trimmed;
2347
+ }
2348
+ function isBashExePath(path) {
2349
+ return path.toLowerCase().endsWith("bash.exe");
2350
+ }
2351
+ function isKnownNonGitBashLauncher(path) {
2352
+ const normalized = path.replaceAll("/", "\\").toLowerCase();
2353
+ return NON_GIT_BASH_LAUNCHER_DIR_SEGMENTS.some((segment) => normalized.includes(segment));
2354
+ }
2355
+ function whereCommand(command) {
2356
+ try {
2357
+ return execFileSync2("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
2358
+ } catch (error) {
2359
+ if (error instanceof Error)
2360
+ return [];
2361
+ throw error;
2362
+ }
2363
+ }
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;
2382
+ }
2383
+ return resolve6();
2384
+ }
2385
+ function toCodexResolution(resolution) {
2386
+ if (resolution.found) {
2387
+ return {
2388
+ found: true,
2389
+ path: resolution.path,
2390
+ source: resolution.source
2391
+ };
2392
+ }
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
+ };
2403
+ }
2404
+
2405
+ // components/bootstrap/src/setup.ts
2406
+ var SETUP_MARKETPLACE_NAME = "sisyphuslabs";
2407
+ var SETUP_PLUGIN_NAME = "omo";
2408
+ var GIT_BASH_INSTALL_HINT = "winget install --id Git.Git -e --source winget";
2409
+ async function runWorkerSetup(options) {
2410
+ const degraded = [];
2411
+ const gitBashEnabled = await resolveGitBashStep(options, degraded);
2412
+ const agents = await linkBundledAgentsStep(options);
2413
+ degraded.push(...agents.degraded);
2414
+ await updateConfigStep(options, { agentConfigs: agents.agentConfigs, gitBashEnabled }, degraded);
2415
+ await stampGitBashEnvStep(options, degraded);
2416
+ await linkComponentBinsStep(options, degraded);
2417
+ return { degraded };
2418
+ }
2419
+ async function resolveGitBashStep(options, degraded) {
2420
+ if (options.platform !== "win32")
2421
+ return false;
2422
+ try {
2423
+ const resolution = await prepareGitBashForInstall({
2424
+ cwd: options.pluginRoot,
2425
+ env: options.env,
2426
+ platform: options.platform,
2427
+ runCommand: options.runCommand ?? defaultRunCommand,
2428
+ ...options.resolveGitBash === undefined ? {} : { resolveGitBash: options.resolveGitBash }
2429
+ });
2430
+ if (resolution.found)
2431
+ return true;
2432
+ degraded.push({
2433
+ component: "git-bash",
2434
+ hint: GIT_BASH_INSTALL_HINT,
2435
+ reason: "Git Bash was not found on this Windows machine; the omo git_bash MCP server stays disabled"
2436
+ });
2437
+ } catch (error) {
2438
+ degraded.push({
2439
+ component: "git-bash",
2440
+ hint: GIT_BASH_INSTALL_HINT,
2441
+ reason: `Git Bash preflight failed: ${errorMessage(error)}`
2442
+ });
2443
+ }
2444
+ return false;
2445
+ }
2446
+ async function linkBundledAgentsStep(options) {
2447
+ const agentsTarget = join18(options.codexHome, "agents");
2448
+ try {
2449
+ const stageRoot = join18(options.pluginData, "bootstrap", "agents-stage");
2450
+ await stageBundledAgents(options.pluginRoot, stageRoot);
2451
+ const preservedReasoning = await capturePreservedAgentReasoning({ codexHome: options.codexHome });
2452
+ const preservedServiceTier = await capturePreservedAgentServiceTier({ codexHome: options.codexHome });
2453
+ const linked = await linkCachedPluginAgents({
2454
+ codexHome: options.codexHome,
2455
+ pluginRoot: stageRoot,
2456
+ preservedReasoning,
2457
+ preservedServiceTier
2458
+ });
2459
+ const agentConfigs = linked.map((link) => ({ configFile: `./agents/${link.name}`, name: agentNameFromToml2(link.name) })).sort((left, right) => left.name.localeCompare(right.name));
2460
+ return { agentConfigs, degraded: [] };
2461
+ } catch (error) {
2462
+ return {
2463
+ agentConfigs: [],
2464
+ degraded: [
2465
+ {
2466
+ component: "agents",
2467
+ hint: BOOTSTRAP_DOCTOR_HINT,
2468
+ reason: `failed to link bundled agents into ${agentsTarget}: ${errorMessage(error)}`
2469
+ }
2470
+ ]
2471
+ };
2472
+ }
2473
+ }
2474
+ async function stageBundledAgents(pluginRoot, stageRoot) {
2475
+ await rm9(stageRoot, { force: true, recursive: true });
2476
+ await mkdir7(stageRoot, { recursive: true });
2477
+ const componentsRoot = join18(pluginRoot, "components");
2478
+ for (const componentName of await directoryNames(componentsRoot)) {
2479
+ const agentsDir = join18(componentsRoot, componentName, "agents");
2480
+ const agentFiles = (await fileNames(agentsDir)).filter((name) => name.endsWith(".toml"));
2481
+ if (agentFiles.length === 0)
2482
+ continue;
2483
+ const stagedAgentsDir = join18(stageRoot, "components", componentName, "agents");
2484
+ await mkdir7(stagedAgentsDir, { recursive: true });
2485
+ for (const agentFile of agentFiles) {
2486
+ await copyFile2(join18(agentsDir, agentFile), join18(stagedAgentsDir, agentFile));
2487
+ }
2488
+ }
2489
+ }
2490
+ async function updateConfigStep(options, inputs, degraded) {
2491
+ const configPath = join18(options.codexHome, "config.toml");
2492
+ try {
2493
+ await assertWritableConfigIfPresent(configPath);
2494
+ const trustedHookStates = await trustedHookStatesForPlugin({
2495
+ marketplaceName: SETUP_MARKETPLACE_NAME,
2496
+ pluginName: SETUP_PLUGIN_NAME,
2497
+ pluginRoot: options.pluginRoot
2498
+ });
2499
+ await updateCodexConfig({
2500
+ agentConfigs: inputs.agentConfigs,
2501
+ autonomousPermissions: false,
2502
+ configPath,
2503
+ gitBashEnabled: inputs.gitBashEnabled,
2504
+ marketplaceName: SETUP_MARKETPLACE_NAME,
2505
+ marketplaceSource: { sourceType: "local", source: options.pluginRoot },
2506
+ platform: options.platform,
2507
+ pluginNames: [SETUP_PLUGIN_NAME],
2508
+ preserveMarketplaceSource: true,
2509
+ repoRoot: options.pluginRoot,
2510
+ trustedHookStates
2511
+ });
2512
+ } catch (error) {
2513
+ degraded.push({
2514
+ component: "config",
2515
+ hint: BOOTSTRAP_DOCTOR_HINT,
2516
+ reason: `failed to update ${configPath}: ${errorMessage(error)}`
2517
+ });
2518
+ }
2519
+ }
2520
+ async function assertWritableConfigIfPresent(configPath) {
2521
+ try {
2522
+ if (((await stat4(configPath)).mode & 146) === 0)
2523
+ throw new Error(`${configPath} has no write permission bits set`);
2524
+ } catch (error) {
2525
+ if (errorCode(error) === "ENOENT")
2526
+ return;
2527
+ throw error;
2528
+ }
2529
+ }
2530
+ function errorCode(error) {
2531
+ return error instanceof Error && "code" in error && typeof error.code === "string" ? error.code : undefined;
2532
+ }
2533
+ async function linkComponentBinsStep(options, degraded) {
2534
+ const binDir = resolveCodexInstallerBinDir({ codexHome: options.codexHome, env: options.env });
2535
+ try {
2536
+ await linkCachedPluginBins({ binDir, pluginRoot: options.pluginRoot, platform: options.platform });
2537
+ } catch (error) {
2538
+ degraded.push({
2539
+ component: "bin-links",
2540
+ hint: BOOTSTRAP_DOCTOR_HINT,
2541
+ reason: `failed to link component bins into ${binDir}: ${errorMessage(error)}`
2542
+ });
2543
+ }
2544
+ await linkRuntimeWrapperStep(options, binDir, degraded);
2545
+ }
2546
+ async function linkRuntimeWrapperStep(options, binDir, degraded) {
2547
+ const cliPath = join18(options.pluginRoot, "dist", "cli", "index.js");
2548
+ try {
2549
+ const linked = await linkRootRuntimeBin({
2550
+ binDir,
2551
+ codexHome: options.codexHome,
2552
+ platform: options.platform,
2553
+ repoRoot: options.pluginRoot
2554
+ });
2555
+ if (linked !== null)
2556
+ return;
2557
+ degraded.push({
2558
+ component: "omo-cli",
2559
+ hint: "use npx lazycodex-ai for the omo CLI",
2560
+ reason: "marketplace payload has no dist/cli"
2561
+ });
2562
+ await appendBootstrapLog(options.pluginData, options.now ?? Date.now(), "omo-cli-degraded", {
2563
+ warning: `Warning: skipped the omo runtime wrapper because ${cliPath} is missing; omo sparkshell/ulw-loop commands will be unavailable until a package shipping dist/cli is installed`
2564
+ });
2565
+ } catch (error) {
2566
+ degraded.push({
2567
+ component: "omo-cli",
2568
+ hint: BOOTSTRAP_DOCTOR_HINT,
2569
+ reason: `failed to link the omo runtime wrapper into ${binDir}: ${errorMessage(error)}`
2570
+ });
2571
+ }
2572
+ }
2573
+ async function stampGitBashEnvStep(options, degraded) {
2574
+ try {
2575
+ await stampGitBashMcpEnv({ env: options.env, platform: options.platform, pluginRoot: options.pluginRoot });
2576
+ } catch (error) {
2577
+ degraded.push({
2578
+ component: "git-bash-env",
2579
+ hint: BOOTSTRAP_DOCTOR_HINT,
2580
+ reason: `failed to stamp ${join18(options.pluginRoot, ".mcp.json")}: ${errorMessage(error)}`
2581
+ });
2582
+ }
2583
+ }
2584
+ var execFileAsync2 = promisify2(execFile2);
2585
+ async function defaultRunCommand(command, args, options) {
2586
+ return execFileAsync2(command, [...args], { cwd: options.cwd });
2587
+ }
2588
+ async function directoryNames(root) {
2589
+ return entryNames(root, (entry) => entry.isDirectory());
2590
+ }
2591
+ async function fileNames(root) {
2592
+ return entryNames(root, (entry) => entry.isFile());
2593
+ }
2594
+ async function entryNames(root, keep) {
2595
+ try {
2596
+ const entries = await readdir3(root, { withFileTypes: true });
2597
+ return entries.filter((entry) => keep(entry)).map((entry) => entry.name).sort();
2598
+ } catch (error) {
2599
+ if (error instanceof Error && "code" in error && error.code === "ENOENT")
2600
+ return [];
2601
+ throw error;
2602
+ }
2603
+ }
2604
+ function agentNameFromToml2(fileName) {
2605
+ return fileName.endsWith(".toml") ? fileName.slice(0, -".toml".length) : fileName;
2606
+ }
2607
+ function errorMessage(error) {
2608
+ return error instanceof Error ? error.message : String(error);
2609
+ }
2610
+
2611
+ // components/bootstrap/src/worker.ts
2612
+ var BOOTSTRAP_DOCTOR_HINT = "npx lazycodex-ai doctor";
2613
+ function parseWorkerFlags(argv) {
2614
+ let codexHome;
2615
+ let manifestDir;
2616
+ let once = false;
2617
+ let only;
2618
+ for (let index = 0;index < argv.length; index += 1) {
2619
+ const flag = argv[index];
2620
+ if (flag === "--once") {
2621
+ once = true;
2622
+ continue;
2623
+ }
2624
+ if (flag === "--codex-home") {
2625
+ codexHome = requireFlagValue(argv, index, flag);
2626
+ index += 1;
2627
+ continue;
2628
+ }
2629
+ if (flag === "--only") {
2630
+ only = requireFlagValue(argv, index, flag);
2631
+ index += 1;
2632
+ continue;
2633
+ }
2634
+ if (flag === "--manifest-dir") {
2635
+ manifestDir = requireFlagValue(argv, index, flag);
2636
+ index += 1;
2637
+ continue;
2638
+ }
2639
+ throw new Error(`unknown worker flag: ${flag}`);
2640
+ }
2641
+ return {
2642
+ once,
2643
+ ...codexHome === undefined ? {} : { codexHome },
2644
+ ...manifestDir === undefined ? {} : { manifestDir },
2645
+ ...only === undefined ? {} : { only }
2646
+ };
2647
+ }
2648
+ function resolvePluginDataRoot(env) {
2649
+ const fromEnv = env["PLUGIN_DATA"]?.trim();
2650
+ if (fromEnv !== undefined && fromEnv.length > 0)
2651
+ return fromEnv;
2652
+ return join19(homedir4(), ".local", "share", "lazycodex");
2653
+ }
2654
+ async function readPluginVersion(pluginRoot) {
2655
+ try {
2656
+ const parsed = JSON.parse(await readFile12(join19(pluginRoot, ".codex-plugin", "plugin.json"), "utf8"));
2657
+ if (typeof parsed !== "object" || parsed === null)
2658
+ return;
2659
+ const version = parsed["version"];
2660
+ if (typeof version !== "string")
2661
+ return;
2662
+ const trimmed = version.trim();
2663
+ return trimmed.length > 0 ? trimmed : undefined;
2664
+ } catch {
2665
+ return;
2666
+ }
2667
+ }
2668
+ async function readBootstrapState(statePath) {
2669
+ return parseBootstrapState(await readState(statePath));
2670
+ }
2671
+ function parseBootstrapState(raw) {
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;
2675
+ const degraded = parseDegradedEntries(raw["degraded"]);
2676
+ return {
2677
+ ...completedForVersion === undefined ? {} : { completedForVersion },
2678
+ ...lastAttemptAt === undefined ? {} : { lastAttemptAt },
2679
+ ...lastStatus === undefined ? {} : { lastStatus },
2680
+ ...degraded === undefined ? {} : { degraded }
2681
+ };
2682
+ }
2683
+ function defaultWorkerSteps(seams = {}) {
2684
+ return [
2685
+ {
2686
+ name: "setup",
2687
+ run: (context) => runWorkerSetup(context)
2688
+ },
2689
+ {
2690
+ name: "sg",
2691
+ run: (context) => runSgProvision(context, seams.sg)
2692
+ }
2693
+ ];
2694
+ }
2695
+ async function runBootstrapWorker(options = {}) {
2696
+ const env = options.env ?? process.env;
2697
+ const now = options.now ?? Date.now();
2698
+ const platform = options.platform ?? process.platform;
2699
+ const flags = parseWorkerFlags(options.argv ?? []);
2700
+ const steps = options.steps ?? defaultWorkerSteps();
2701
+ const pluginRoot = resolvePluginRoot(env);
2702
+ const pluginData = resolvePluginDataRoot(env);
2703
+ const statePath = resolveBootstrapStatePath(pluginData);
2704
+ const lockEnv = { ...env, PLUGIN_DATA: pluginData };
2705
+ const locks = await bootstrapLocks({ env: lockEnv, now, pluginData });
2706
+ if (locks === null)
2707
+ return { ran: false, reason: "locked" };
2708
+ try {
2709
+ const pluginVersion = await readPluginVersion(pluginRoot);
2710
+ const marker = await readBootstrapState(statePath);
2711
+ if (!flags.once && pluginVersion !== undefined && marker.completedForVersion === pluginVersion) {
2712
+ await appendBootstrapLog(pluginData, now, "worker-skipped", { reason: "already-completed", version: pluginVersion });
2713
+ return { ran: false, reason: "already-completed" };
2714
+ }
2715
+ const codexHome = flags.codexHome ?? (await resolveCodexHome({ env, pluginRoot })).path;
2716
+ const context = { codexHome, env, flags, now, platform, pluginData, pluginRoot, pluginVersion };
2717
+ await appendBootstrapLog(pluginData, now, "worker-started", { version: pluginVersion ?? "unknown" });
2718
+ const degraded = [];
2719
+ if (pluginVersion === undefined) {
2720
+ degraded.push({
2721
+ component: "bootstrap",
2722
+ hint: BOOTSTRAP_DOCTOR_HINT,
2723
+ reason: `plugin version unresolved from ${join19(pluginRoot, ".codex-plugin", "plugin.json")}`
2724
+ });
2725
+ }
2726
+ for (const step of steps) {
2727
+ if (flags.only !== undefined && step.name !== flags.only)
2728
+ continue;
2729
+ degraded.push(...await runStep(step, context));
2730
+ }
2731
+ const status = degraded.length === 0 ? "success" : "degraded";
2732
+ const state = {
2733
+ ...pluginVersion === undefined ? {} : { completedForVersion: pluginVersion },
2734
+ degraded,
2735
+ lastAttemptAt: now,
2736
+ lastStatus: status
2737
+ };
2738
+ await writeState(statePath, state);
2739
+ await appendBootstrapLog(pluginData, now, "worker-finished", { degradedCount: degraded.length, status });
2740
+ return { degraded, ran: true, statePath, status };
2741
+ } finally {
2742
+ await locks.release();
2743
+ }
2744
+ }
2745
+ async function runStep(step, context) {
2746
+ try {
2747
+ return (await step.run(context)).degraded;
2748
+ } catch (error) {
2749
+ return [
2750
+ {
2751
+ component: step.name,
2752
+ hint: BOOTSTRAP_DOCTOR_HINT,
2753
+ reason: error instanceof Error ? error.message : String(error)
2754
+ }
2755
+ ];
2756
+ }
2757
+ }
2758
+ function resolvePluginRoot(env) {
2759
+ const fromEnv = env["PLUGIN_ROOT"]?.trim();
2760
+ if (fromEnv !== undefined && fromEnv.length > 0)
2761
+ return fromEnv;
2762
+ return resolve6(dirname7(fileURLToPath2(import.meta.url)), "..", "..", "..");
2763
+ }
2764
+ async function appendBootstrapLog(pluginData, now, event, details) {
2765
+ try {
2766
+ const logPath = join19(pluginData, "bootstrap", "bootstrap.log");
2767
+ await mkdir8(dirname7(logPath), { recursive: true });
2768
+ await appendFile2(logPath, `${JSON.stringify({ timestamp: new Date(now).toISOString(), event, ...details })}
2769
+ `);
2770
+ } catch {}
2771
+ }
2772
+ function parseDegradedEntries(raw) {
2773
+ if (!Array.isArray(raw))
2774
+ return;
2775
+ const entries = [];
2776
+ for (const candidate of raw) {
2777
+ if (typeof candidate !== "object" || candidate === null)
2778
+ continue;
2779
+ const record = candidate;
2780
+ if (typeof record["component"] !== "string" || typeof record["reason"] !== "string")
2781
+ continue;
2782
+ entries.push({
2783
+ component: record["component"],
2784
+ reason: record["reason"],
2785
+ ...typeof record["hint"] === "string" ? { hint: record["hint"] } : {}
2786
+ });
2787
+ }
2788
+ return entries;
2789
+ }
2790
+ function requireFlagValue(argv, index, flag) {
2791
+ const value = argv[index + 1];
2792
+ if (value === undefined || value.startsWith("--")) {
2793
+ throw new Error(`${flag} requires a value`);
2794
+ }
2795
+ return value;
2796
+ }
2797
+
2798
+ // components/bootstrap/src/hook.ts
2799
+ var BOOTSTRAP_RESTART_NOTICE = "LazyCodex bootstrap running in background — restart the session when it completes";
2800
+ async function runSessionStartHook(options) {
2801
+ return (await executeSessionStartHook(options)).exitCode;
2802
+ }
2803
+ async function executeSessionStartHook(options) {
2804
+ if (options.stdin !== undefined)
2805
+ await drainStdin(options.stdin);
2806
+ const now = options.now ?? Date.now();
2807
+ const pluginRoot = options.env["PLUGIN_ROOT"]?.trim();
2808
+ const pluginData = options.env["PLUGIN_DATA"]?.trim();
2809
+ if (pluginRoot === undefined || pluginRoot.length === 0 || pluginData === undefined || pluginData.length === 0) {
2810
+ return { action: "skip-missing-env", exitCode: 0 };
2811
+ }
2812
+ const pluginVersion = await readPluginVersion(pluginRoot);
2813
+ if (pluginVersion === undefined)
2814
+ return { action: "skip-version-unresolved", exitCode: 0 };
2815
+ const state = await readBootstrapState(resolveBootstrapStatePath(pluginData));
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 };
2820
+ const spawnWorker = options.spawnWorker ?? spawnDetachedWorker;
2821
+ spawnWorker({
2822
+ args: [options.workerCliPath ?? defaultWorkerCliPath(), "worker"],
2823
+ command: process.execPath,
2824
+ env: options.env
2825
+ });
2826
+ const writeNotice = options.writeNotice ?? ((line) => process.stdout.write(`${line}
2827
+ `));
2828
+ writeNotice(JSON.stringify({
2829
+ hookSpecificOutput: {
2830
+ hookEventName: "SessionStart",
2831
+ additionalContext: BOOTSTRAP_RESTART_NOTICE
2832
+ }
2833
+ }));
2834
+ return { action: "spawned", exitCode: 0 };
2835
+ }
2836
+ function spawnDetachedWorker(invocation) {
2837
+ const child = spawn2(invocation.command, [...invocation.args], {
2838
+ detached: true,
2839
+ env: invocation.env,
2840
+ stdio: "ignore"
2841
+ });
2842
+ child.unref();
2843
+ }
2844
+ function defaultWorkerCliPath() {
2845
+ return fileURLToPath3(import.meta.url);
2846
+ }
2847
+ async function isLockFresh(lockPath, now) {
2848
+ try {
2849
+ const lockStat = await stat5(lockPath);
2850
+ return now - lockStat.mtimeMs < DEFAULT_LOCK_STALE_MS;
2851
+ } catch {
2852
+ return false;
2853
+ }
2854
+ }
2855
+ async function drainStdin(stdin) {
2856
+ if (stdin.isTTY === true)
2857
+ return;
2858
+ for await (const chunk of stdin) {}
2859
+ }
2860
+
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
+ `;
2868
+ async function runDownloadCommand(args) {
2869
+ const [manifestName, platformKey, destinationDir] = args;
2870
+ if (manifestName === undefined || platformKey === undefined || destinationDir === undefined) {
2871
+ process.stderr.write(`[omo-bootstrap] download requires <manifest> <platform> <destination-dir>
2872
+ ${TOP_LEVEL_HELP}`);
2873
+ return 1;
2874
+ }
2875
+ try {
2876
+ const destination = await downloadFromManifest({ destinationDir, manifestName, platformKey });
2877
+ process.stdout.write(`OK:${destination}
2878
+ `);
2879
+ return 0;
2880
+ } catch (error) {
2881
+ process.stderr.write(`[omo-bootstrap] download failed: ${error instanceof Error ? error.message : String(error)}
2882
+ `);
2883
+ return 1;
2884
+ }
2885
+ }
2886
+ async function runWorkerCommand(args) {
2887
+ let result;
2888
+ try {
2889
+ result = await runBootstrapWorker({ argv: args, env: process.env });
2890
+ } catch (error) {
2891
+ const message = error instanceof Error ? error.message : String(error);
2892
+ if (/flag/.test(message)) {
2893
+ process.stderr.write(`[omo-bootstrap] ${message}
2894
+ ${TOP_LEVEL_HELP}`);
2895
+ return 1;
2896
+ }
2897
+ process.stderr.write(`[omo-bootstrap] worker error: ${message}
2898
+ `);
2899
+ return 0;
2900
+ }
2901
+ process.stdout.write(result.ran ? `[omo-bootstrap] worker finished: ${result.status}
2902
+ ` : `[omo-bootstrap] worker skipped: ${result.reason}
2903
+ `);
2904
+ return 0;
2905
+ }
2906
+ async function main() {
2907
+ const argv = process.argv.slice(2);
2908
+ const command = argv[0];
2909
+ if (command === undefined || command === "help" || command === "--help" || command === "-h") {
2910
+ process.stdout.write(TOP_LEVEL_HELP);
2911
+ return 0;
2912
+ }
2913
+ if (command === "hook" && argv[1] === "session-start") {
2914
+ return runSessionStartHook({ env: process.env, stdin: process.stdin });
2915
+ }
2916
+ if (command === "worker") {
2917
+ return runWorkerCommand(argv.slice(1));
2918
+ }
2919
+ if (command === "download") {
2920
+ return runDownloadCommand(argv.slice(1));
2921
+ }
2922
+ process.stderr.write(`[omo-bootstrap] unknown command: ${argv.join(" ")}
2923
+ ${TOP_LEVEL_HELP}`);
2924
+ return 1;
2925
+ }
2926
+ function isProcessEntry() {
2927
+ const entry = process.argv[1];
2928
+ if (entry === undefined)
2929
+ return false;
2930
+ try {
2931
+ return realpathSync(entry) === realpathSync(fileURLToPath4(import.meta.url));
2932
+ } catch {
2933
+ return false;
2934
+ }
2935
+ }
2936
+ if (isProcessEntry()) {
2937
+ main().then((code) => {
2938
+ process.exit(code);
2939
+ }).catch((error) => {
2940
+ process.stderr.write(`[omo-bootstrap] ${error instanceof Error ? error.message : String(error)}
2941
+ `);
2942
+ process.exit(0);
2943
+ });
2944
+ }
2945
+ export {
2946
+ sgProvisionDestination,
2947
+ runWorkerSetup,
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
2975
+ };