oh-my-codex 0.14.4 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (614) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/Cargo.lock +6 -6
  3. package/Cargo.toml +2 -1
  4. package/README.md +40 -7
  5. package/crates/omx-explore/Cargo.toml +1 -0
  6. package/crates/omx-explore/src/main.rs +246 -24
  7. package/crates/omx-mux/Cargo.toml +1 -0
  8. package/crates/omx-runtime/Cargo.toml +1 -0
  9. package/crates/omx-runtime-core/Cargo.toml +1 -0
  10. package/crates/omx-runtime-core/src/dispatch.rs +2 -1
  11. package/crates/omx-runtime-core/src/engine.rs +2 -2
  12. package/crates/omx-runtime-core/src/mailbox.rs +2 -1
  13. package/crates/omx-sparkshell/Cargo.toml +1 -0
  14. package/crates/omx-sparkshell/src/codex_bridge.rs +1 -0
  15. package/crates/omx-sparkshell/src/prompt.rs +1 -0
  16. package/crates/omx-sparkshell/src/threshold.rs +1 -0
  17. package/dist/agents/__tests__/native-config.test.js +98 -4
  18. package/dist/agents/__tests__/native-config.test.js.map +1 -1
  19. package/dist/agents/native-config.d.ts +4 -0
  20. package/dist/agents/native-config.d.ts.map +1 -1
  21. package/dist/agents/native-config.js +19 -3
  22. package/dist/agents/native-config.js.map +1 -1
  23. package/dist/agents/policy.d.ts +10 -0
  24. package/dist/agents/policy.d.ts.map +1 -0
  25. package/dist/agents/policy.js +61 -0
  26. package/dist/agents/policy.js.map +1 -0
  27. package/dist/catalog/__tests__/generator.test.js +2 -0
  28. package/dist/catalog/__tests__/generator.test.js.map +1 -1
  29. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +2 -0
  30. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +1 -0
  31. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +72 -0
  32. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -0
  33. package/dist/catalog/installable.d.ts +5 -0
  34. package/dist/catalog/installable.d.ts.map +1 -0
  35. package/dist/catalog/installable.js +13 -0
  36. package/dist/catalog/installable.js.map +1 -0
  37. package/dist/catalog/skill-mirror.d.ts +20 -0
  38. package/dist/catalog/skill-mirror.d.ts.map +1 -0
  39. package/dist/catalog/skill-mirror.js +104 -0
  40. package/dist/catalog/skill-mirror.js.map +1 -0
  41. package/dist/cli/__tests__/ask.test.js +4 -1
  42. package/dist/cli/__tests__/ask.test.js.map +1 -1
  43. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +2 -0
  44. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +1 -0
  45. package/dist/cli/__tests__/codex-plugin-layout.test.js +210 -0
  46. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -0
  47. package/dist/cli/__tests__/doctor-team.test.js +46 -1
  48. package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
  49. package/dist/cli/__tests__/doctor-warning-copy.test.js +225 -111
  50. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  51. package/dist/cli/__tests__/exec.test.js +96 -1
  52. package/dist/cli/__tests__/exec.test.js.map +1 -1
  53. package/dist/cli/__tests__/explore.test.js +26 -9
  54. package/dist/cli/__tests__/explore.test.js.map +1 -1
  55. package/dist/cli/__tests__/index.test.js +301 -7
  56. package/dist/cli/__tests__/index.test.js.map +1 -1
  57. package/dist/cli/__tests__/launch-fallback.test.js +358 -4
  58. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
  59. package/dist/cli/__tests__/list.test.d.ts +2 -0
  60. package/dist/cli/__tests__/list.test.d.ts.map +1 -0
  61. package/dist/cli/__tests__/list.test.js +38 -0
  62. package/dist/cli/__tests__/list.test.js.map +1 -0
  63. package/dist/cli/__tests__/mcp-parity.test.js +86 -0
  64. package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
  65. package/dist/cli/__tests__/mcp-serve.test.d.ts +2 -0
  66. package/dist/cli/__tests__/mcp-serve.test.d.ts.map +1 -0
  67. package/dist/cli/__tests__/mcp-serve.test.js +38 -0
  68. package/dist/cli/__tests__/mcp-serve.test.js.map +1 -0
  69. package/dist/cli/__tests__/nested-help-routing.test.js +1 -0
  70. package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -1
  71. package/dist/cli/__tests__/package-bin-contract.test.js +58 -3
  72. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
  73. package/dist/cli/__tests__/question.test.js +209 -5
  74. package/dist/cli/__tests__/question.test.js.map +1 -1
  75. package/dist/cli/__tests__/setup-agents-overwrite.test.js +146 -3
  76. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
  77. package/dist/cli/__tests__/setup-install-mode.test.d.ts +2 -0
  78. package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +1 -0
  79. package/dist/cli/__tests__/setup-install-mode.test.js +873 -0
  80. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -0
  81. package/dist/cli/__tests__/setup-prompts-overwrite.test.js +83 -22
  82. package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
  83. package/dist/cli/__tests__/setup-refresh.test.js +120 -2
  84. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
  85. package/dist/cli/__tests__/setup-skills-overwrite.test.js +32 -13
  86. package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -1
  87. package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
  88. package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
  89. package/dist/cli/__tests__/sidecar.test.js +24 -0
  90. package/dist/cli/__tests__/sidecar.test.js.map +1 -0
  91. package/dist/cli/__tests__/team.test.js +90 -42
  92. package/dist/cli/__tests__/team.test.js.map +1 -1
  93. package/dist/cli/__tests__/version-sync-contract.test.js +11 -0
  94. package/dist/cli/__tests__/version-sync-contract.test.js.map +1 -1
  95. package/dist/cli/codex-home.d.ts +4 -5
  96. package/dist/cli/codex-home.d.ts.map +1 -1
  97. package/dist/cli/codex-home.js +9 -37
  98. package/dist/cli/codex-home.js.map +1 -1
  99. package/dist/cli/doctor.d.ts +1 -1
  100. package/dist/cli/doctor.d.ts.map +1 -1
  101. package/dist/cli/doctor.js +509 -278
  102. package/dist/cli/doctor.js.map +1 -1
  103. package/dist/cli/index.d.ts +13 -5
  104. package/dist/cli/index.d.ts.map +1 -1
  105. package/dist/cli/index.js +351 -60
  106. package/dist/cli/index.js.map +1 -1
  107. package/dist/cli/list.d.ts +2 -0
  108. package/dist/cli/list.d.ts.map +1 -0
  109. package/dist/cli/list.js +40 -0
  110. package/dist/cli/list.js.map +1 -0
  111. package/dist/cli/mcp-serve.d.ts +12 -0
  112. package/dist/cli/mcp-serve.d.ts.map +1 -0
  113. package/dist/cli/mcp-serve.js +63 -0
  114. package/dist/cli/mcp-serve.js.map +1 -0
  115. package/dist/cli/plugin-marketplace.d.ts +13 -0
  116. package/dist/cli/plugin-marketplace.d.ts.map +1 -0
  117. package/dist/cli/plugin-marketplace.js +77 -0
  118. package/dist/cli/plugin-marketplace.js.map +1 -0
  119. package/dist/cli/question.d.ts.map +1 -1
  120. package/dist/cli/question.js +27 -2
  121. package/dist/cli/question.js.map +1 -1
  122. package/dist/cli/setup-preferences.d.ts +20 -0
  123. package/dist/cli/setup-preferences.d.ts.map +1 -0
  124. package/dist/cli/setup-preferences.js +71 -0
  125. package/dist/cli/setup-preferences.js.map +1 -0
  126. package/dist/cli/setup.d.ts +12 -3
  127. package/dist/cli/setup.d.ts.map +1 -1
  128. package/dist/cli/setup.js +1080 -254
  129. package/dist/cli/setup.js.map +1 -1
  130. package/dist/cli/team.d.ts +1 -0
  131. package/dist/cli/team.d.ts.map +1 -1
  132. package/dist/cli/team.js +22 -3
  133. package/dist/cli/team.js.map +1 -1
  134. package/dist/cli/uninstall.d.ts.map +1 -1
  135. package/dist/cli/uninstall.js +2 -8
  136. package/dist/cli/uninstall.js.map +1 -1
  137. package/dist/config/__tests__/generator-idempotent.test.js +100 -3
  138. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  139. package/dist/config/__tests__/generator-notify.test.js +6 -5
  140. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  141. package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
  142. package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
  143. package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
  144. package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
  145. package/dist/config/__tests__/models.test.js +35 -2
  146. package/dist/config/__tests__/models.test.js.map +1 -1
  147. package/dist/config/codex-hooks.d.ts.map +1 -1
  148. package/dist/config/codex-hooks.js +2 -7
  149. package/dist/config/codex-hooks.js.map +1 -1
  150. package/dist/config/generator.d.ts +10 -0
  151. package/dist/config/generator.d.ts.map +1 -1
  152. package/dist/config/generator.js +259 -76
  153. package/dist/config/generator.js.map +1 -1
  154. package/dist/config/models.d.ts +13 -3
  155. package/dist/config/models.d.ts.map +1 -1
  156. package/dist/config/models.js +25 -5
  157. package/dist/config/models.js.map +1 -1
  158. package/dist/config/omx-first-party-mcp.d.ts +18 -0
  159. package/dist/config/omx-first-party-mcp.d.ts.map +1 -0
  160. package/dist/config/omx-first-party-mcp.js +76 -0
  161. package/dist/config/omx-first-party-mcp.js.map +1 -0
  162. package/dist/document-refresh/__tests__/enforcer.test.d.ts +2 -0
  163. package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +1 -0
  164. package/dist/document-refresh/__tests__/enforcer.test.js +128 -0
  165. package/dist/document-refresh/__tests__/enforcer.test.js.map +1 -0
  166. package/dist/document-refresh/config.d.ts +9 -0
  167. package/dist/document-refresh/config.d.ts.map +1 -0
  168. package/dist/document-refresh/config.js +70 -0
  169. package/dist/document-refresh/config.js.map +1 -0
  170. package/dist/document-refresh/enforcer.d.ts +43 -0
  171. package/dist/document-refresh/enforcer.d.ts.map +1 -0
  172. package/dist/document-refresh/enforcer.js +329 -0
  173. package/dist/document-refresh/enforcer.js.map +1 -0
  174. package/dist/exec/followup.d.ts +44 -0
  175. package/dist/exec/followup.d.ts.map +1 -0
  176. package/dist/exec/followup.js +349 -0
  177. package/dist/exec/followup.js.map +1 -0
  178. package/dist/hooks/__tests__/codebase-map.test.js +63 -1
  179. package/dist/hooks/__tests__/codebase-map.test.js.map +1 -1
  180. package/dist/hooks/__tests__/deep-interview-contract.test.js +10 -7
  181. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
  182. package/dist/hooks/__tests__/keyword-detector.test.js +89 -0
  183. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  184. package/dist/hooks/__tests__/notify-fallback-watcher.test.js +84 -1
  185. package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
  186. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +23 -2
  187. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
  188. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +43 -0
  189. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
  190. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +17 -0
  191. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
  192. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +53 -0
  193. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
  194. package/dist/hooks/__tests__/notify-hook-regression-205.test.js +4 -4
  195. package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
  196. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +103 -0
  197. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
  198. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +27 -13
  199. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -1
  200. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
  201. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
  202. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
  203. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
  204. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +70 -3
  205. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
  206. package/dist/hooks/__tests__/pre-context-gate-skills.test.js +5 -0
  207. package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
  208. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +3 -2
  209. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -1
  210. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
  211. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
  212. package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
  213. package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
  214. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +2 -0
  215. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +1 -0
  216. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +28 -0
  217. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -0
  218. package/dist/hooks/__tests__/triage-heuristic.test.js +59 -4
  219. package/dist/hooks/__tests__/triage-heuristic.test.js.map +1 -1
  220. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +2 -0
  221. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +1 -0
  222. package/dist/hooks/__tests__/visual-ralph-skill.test.js +44 -0
  223. package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -0
  224. package/dist/hooks/codebase-map.d.ts.map +1 -1
  225. package/dist/hooks/codebase-map.js +83 -6
  226. package/dist/hooks/codebase-map.js.map +1 -1
  227. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  228. package/dist/hooks/keyword-detector.js +19 -14
  229. package/dist/hooks/keyword-detector.js.map +1 -1
  230. package/dist/hooks/prompt-guidance-contract.d.ts +6 -0
  231. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  232. package/dist/hooks/prompt-guidance-contract.js +89 -0
  233. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  234. package/dist/hooks/session.d.ts +2 -0
  235. package/dist/hooks/session.d.ts.map +1 -1
  236. package/dist/hooks/session.js +6 -0
  237. package/dist/hooks/session.js.map +1 -1
  238. package/dist/hooks/triage-heuristic.d.ts +2 -2
  239. package/dist/hooks/triage-heuristic.d.ts.map +1 -1
  240. package/dist/hooks/triage-heuristic.js +97 -20
  241. package/dist/hooks/triage-heuristic.js.map +1 -1
  242. package/dist/hooks/triage-state.d.ts +1 -1
  243. package/dist/hooks/triage-state.d.ts.map +1 -1
  244. package/dist/hooks/triage-state.js +2 -1
  245. package/dist/hooks/triage-state.js.map +1 -1
  246. package/dist/hud/__tests__/index.test.js +4 -4
  247. package/dist/hud/__tests__/index.test.js.map +1 -1
  248. package/dist/hud/__tests__/state.test.js +4 -0
  249. package/dist/hud/__tests__/state.test.js.map +1 -1
  250. package/dist/hud/__tests__/types.test.js +27 -0
  251. package/dist/hud/__tests__/types.test.js.map +1 -1
  252. package/dist/hud/state.d.ts.map +1 -1
  253. package/dist/hud/state.js +8 -0
  254. package/dist/hud/state.js.map +1 -1
  255. package/dist/hud/types.d.ts +9 -0
  256. package/dist/hud/types.d.ts.map +1 -1
  257. package/dist/hud/types.js +3 -0
  258. package/dist/hud/types.js.map +1 -1
  259. package/dist/mcp/__tests__/bootstrap.test.js +45 -5
  260. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
  261. package/dist/mcp/__tests__/server-lifecycle.test.js +50 -7
  262. package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -1
  263. package/dist/mcp/__tests__/state-server.test.js +67 -9
  264. package/dist/mcp/__tests__/state-server.test.js.map +1 -1
  265. package/dist/mcp/bootstrap.d.ts +12 -1
  266. package/dist/mcp/bootstrap.d.ts.map +1 -1
  267. package/dist/mcp/bootstrap.js +87 -29
  268. package/dist/mcp/bootstrap.js.map +1 -1
  269. package/dist/mcp/state-server.d.ts +5 -11
  270. package/dist/mcp/state-server.d.ts.map +1 -1
  271. package/dist/mcp/state-server.js +16 -432
  272. package/dist/mcp/state-server.js.map +1 -1
  273. package/dist/planning/__tests__/artifacts.test.js +152 -1
  274. package/dist/planning/__tests__/artifacts.test.js.map +1 -1
  275. package/dist/planning/artifacts.d.ts +9 -0
  276. package/dist/planning/artifacts.d.ts.map +1 -1
  277. package/dist/planning/artifacts.js +60 -1
  278. package/dist/planning/artifacts.js.map +1 -1
  279. package/dist/question/__tests__/deep-interview.test.js +1 -1
  280. package/dist/question/__tests__/deep-interview.test.js.map +1 -1
  281. package/dist/question/__tests__/renderer.test.js +70 -0
  282. package/dist/question/__tests__/renderer.test.js.map +1 -1
  283. package/dist/question/__tests__/ui.test.js +49 -0
  284. package/dist/question/__tests__/ui.test.js.map +1 -1
  285. package/dist/question/renderer.d.ts +14 -1
  286. package/dist/question/renderer.d.ts.map +1 -1
  287. package/dist/question/renderer.js +109 -10
  288. package/dist/question/renderer.js.map +1 -1
  289. package/dist/question/state.d.ts +2 -0
  290. package/dist/question/state.d.ts.map +1 -1
  291. package/dist/question/state.js +4 -0
  292. package/dist/question/state.js.map +1 -1
  293. package/dist/question/types.d.ts +2 -1
  294. package/dist/question/types.d.ts.map +1 -1
  295. package/dist/question/types.js.map +1 -1
  296. package/dist/question/ui.d.ts.map +1 -1
  297. package/dist/question/ui.js +28 -8
  298. package/dist/question/ui.js.map +1 -1
  299. package/dist/runtime/__tests__/bridge.test.js +143 -1
  300. package/dist/runtime/__tests__/bridge.test.js.map +1 -1
  301. package/dist/runtime/bridge.d.ts +21 -0
  302. package/dist/runtime/bridge.d.ts.map +1 -1
  303. package/dist/runtime/bridge.js +54 -4
  304. package/dist/runtime/bridge.js.map +1 -1
  305. package/dist/scripts/__tests__/codex-native-hook.test.js +1904 -230
  306. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  307. package/dist/scripts/__tests__/generate-release-body.test.js +90 -1
  308. package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -1
  309. package/dist/scripts/__tests__/hook-derived-watcher.test.js +110 -2
  310. package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -1
  311. package/dist/scripts/__tests__/postinstall.test.js +7 -93
  312. package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
  313. package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
  314. package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
  315. package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
  316. package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
  317. package/dist/scripts/__tests__/run-test-files.test.d.ts +2 -0
  318. package/dist/scripts/__tests__/run-test-files.test.d.ts.map +1 -0
  319. package/dist/scripts/__tests__/run-test-files.test.js +62 -0
  320. package/dist/scripts/__tests__/run-test-files.test.js.map +1 -0
  321. package/dist/scripts/__tests__/smoke-packed-install.test.js +13 -1
  322. package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
  323. package/dist/scripts/__tests__/verify-native-agents.test.d.ts +2 -0
  324. package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +1 -0
  325. package/dist/scripts/__tests__/verify-native-agents.test.js +166 -0
  326. package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -0
  327. package/dist/scripts/codex-execution-surface.d.ts +16 -0
  328. package/dist/scripts/codex-execution-surface.d.ts.map +1 -0
  329. package/dist/scripts/codex-execution-surface.js +42 -0
  330. package/dist/scripts/codex-execution-surface.js.map +1 -0
  331. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  332. package/dist/scripts/codex-native-hook.js +418 -76
  333. package/dist/scripts/codex-native-hook.js.map +1 -1
  334. package/dist/scripts/codex-native-pre-post.d.ts +8 -0
  335. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
  336. package/dist/scripts/codex-native-pre-post.js +133 -19
  337. package/dist/scripts/codex-native-pre-post.js.map +1 -1
  338. package/dist/scripts/generate-release-body.d.ts +1 -0
  339. package/dist/scripts/generate-release-body.d.ts.map +1 -1
  340. package/dist/scripts/generate-release-body.js +32 -3
  341. package/dist/scripts/generate-release-body.js.map +1 -1
  342. package/dist/scripts/hook-derived-watcher.js +46 -7
  343. package/dist/scripts/hook-derived-watcher.js.map +1 -1
  344. package/dist/scripts/notify-fallback-watcher.js +59 -9
  345. package/dist/scripts/notify-fallback-watcher.js.map +1 -1
  346. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
  347. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
  348. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
  349. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
  350. package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -1
  351. package/dist/scripts/notify-hook/managed-tmux.js +18 -1
  352. package/dist/scripts/notify-hook/managed-tmux.js.map +1 -1
  353. package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -1
  354. package/dist/scripts/notify-hook/process-runner.js +7 -3
  355. package/dist/scripts/notify-hook/process-runner.js.map +1 -1
  356. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
  357. package/dist/scripts/notify-hook/team-dispatch.js +96 -11
  358. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
  359. package/dist/scripts/notify-hook/team-tmux-guard.js +3 -3
  360. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
  361. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
  362. package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
  363. package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
  364. package/dist/scripts/notify-hook/team-worker.d.ts +1 -1
  365. package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
  366. package/dist/scripts/notify-hook/team-worker.js +3 -43
  367. package/dist/scripts/notify-hook/team-worker.js.map +1 -1
  368. package/dist/scripts/notify-hook.js +36 -5
  369. package/dist/scripts/notify-hook.js.map +1 -1
  370. package/dist/scripts/postinstall.d.ts +1 -5
  371. package/dist/scripts/postinstall.d.ts.map +1 -1
  372. package/dist/scripts/postinstall.js +3 -42
  373. package/dist/scripts/postinstall.js.map +1 -1
  374. package/dist/scripts/prompt-inventory.d.ts +29 -0
  375. package/dist/scripts/prompt-inventory.d.ts.map +1 -0
  376. package/dist/scripts/prompt-inventory.js +178 -0
  377. package/dist/scripts/prompt-inventory.js.map +1 -0
  378. package/dist/scripts/run-test-files.js +32 -2
  379. package/dist/scripts/run-test-files.js.map +1 -1
  380. package/dist/scripts/smoke-packed-install.d.ts +3 -0
  381. package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
  382. package/dist/scripts/smoke-packed-install.js +9 -1
  383. package/dist/scripts/smoke-packed-install.js.map +1 -1
  384. package/dist/scripts/sync-plugin-mirror.d.ts +13 -0
  385. package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -0
  386. package/dist/scripts/sync-plugin-mirror.js +242 -0
  387. package/dist/scripts/sync-plugin-mirror.js.map +1 -0
  388. package/dist/scripts/verify-native-agents.d.ts +16 -0
  389. package/dist/scripts/verify-native-agents.d.ts.map +1 -0
  390. package/dist/scripts/verify-native-agents.js +188 -0
  391. package/dist/scripts/verify-native-agents.js.map +1 -0
  392. package/dist/session-history/search.d.ts.map +1 -1
  393. package/dist/session-history/search.js +7 -2
  394. package/dist/session-history/search.js.map +1 -1
  395. package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
  396. package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
  397. package/dist/sidecar/__tests__/boundary.test.js +48 -0
  398. package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
  399. package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
  400. package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
  401. package/dist/sidecar/__tests__/collector.test.js +162 -0
  402. package/dist/sidecar/__tests__/collector.test.js.map +1 -0
  403. package/dist/sidecar/__tests__/render.test.d.ts +2 -0
  404. package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
  405. package/dist/sidecar/__tests__/render.test.js +67 -0
  406. package/dist/sidecar/__tests__/render.test.js.map +1 -0
  407. package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
  408. package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
  409. package/dist/sidecar/__tests__/tmux.test.js +30 -0
  410. package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
  411. package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
  412. package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
  413. package/dist/sidecar/__tests__/watch.test.js +42 -0
  414. package/dist/sidecar/__tests__/watch.test.js.map +1 -0
  415. package/dist/sidecar/collector.d.ts +4 -0
  416. package/dist/sidecar/collector.d.ts.map +1 -0
  417. package/dist/sidecar/collector.js +377 -0
  418. package/dist/sidecar/collector.js.map +1 -0
  419. package/dist/sidecar/index.d.ts +25 -0
  420. package/dist/sidecar/index.d.ts.map +1 -0
  421. package/dist/sidecar/index.js +165 -0
  422. package/dist/sidecar/index.js.map +1 -0
  423. package/dist/sidecar/render.d.ts +3 -0
  424. package/dist/sidecar/render.d.ts.map +1 -0
  425. package/dist/sidecar/render.js +72 -0
  426. package/dist/sidecar/render.js.map +1 -0
  427. package/dist/sidecar/tmux.d.ts +13 -0
  428. package/dist/sidecar/tmux.d.ts.map +1 -0
  429. package/dist/sidecar/tmux.js +44 -0
  430. package/dist/sidecar/tmux.js.map +1 -0
  431. package/dist/sidecar/types.d.ts +125 -0
  432. package/dist/sidecar/types.d.ts.map +1 -0
  433. package/dist/sidecar/types.js +2 -0
  434. package/dist/sidecar/types.js.map +1 -0
  435. package/dist/state/__tests__/operations.test.js +50 -22
  436. package/dist/state/__tests__/operations.test.js.map +1 -1
  437. package/dist/state/operations.d.ts +1 -1
  438. package/dist/state/operations.d.ts.map +1 -1
  439. package/dist/state/operations.js +19 -7
  440. package/dist/state/operations.js.map +1 -1
  441. package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
  442. package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
  443. package/dist/team/__tests__/commit-hygiene.test.js +93 -0
  444. package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
  445. package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
  446. package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
  447. package/dist/team/__tests__/delegation-policy.test.js +69 -0
  448. package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
  449. package/dist/team/__tests__/events.test.js +54 -4
  450. package/dist/team/__tests__/events.test.js.map +1 -1
  451. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
  452. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
  453. package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
  454. package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
  455. package/dist/team/__tests__/model-contract.test.js +18 -2
  456. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  457. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
  458. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
  459. package/dist/team/__tests__/repo-aware-decomposition.test.js +95 -0
  460. package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -0
  461. package/dist/team/__tests__/runtime.test.js +677 -17
  462. package/dist/team/__tests__/runtime.test.js.map +1 -1
  463. package/dist/team/__tests__/state-root.test.js +177 -1
  464. package/dist/team/__tests__/state-root.test.js.map +1 -1
  465. package/dist/team/__tests__/state.test.js +110 -0
  466. package/dist/team/__tests__/state.test.js.map +1 -1
  467. package/dist/team/__tests__/tmux-session.test.js +301 -2
  468. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  469. package/dist/team/__tests__/worker-bootstrap.test.js +94 -0
  470. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  471. package/dist/team/commit-hygiene.d.ts +22 -3
  472. package/dist/team/commit-hygiene.d.ts.map +1 -1
  473. package/dist/team/commit-hygiene.js +134 -2
  474. package/dist/team/commit-hygiene.js.map +1 -1
  475. package/dist/team/contracts.d.ts +1 -1
  476. package/dist/team/contracts.d.ts.map +1 -1
  477. package/dist/team/contracts.js +2 -0
  478. package/dist/team/contracts.js.map +1 -1
  479. package/dist/team/dag-schema.d.ts +38 -0
  480. package/dist/team/dag-schema.d.ts.map +1 -0
  481. package/dist/team/dag-schema.js +221 -0
  482. package/dist/team/dag-schema.js.map +1 -0
  483. package/dist/team/delegation-policy.d.ts +3 -0
  484. package/dist/team/delegation-policy.d.ts.map +1 -0
  485. package/dist/team/delegation-policy.js +82 -0
  486. package/dist/team/delegation-policy.js.map +1 -0
  487. package/dist/team/model-contract.d.ts +3 -1
  488. package/dist/team/model-contract.d.ts.map +1 -1
  489. package/dist/team/model-contract.js +44 -5
  490. package/dist/team/model-contract.js.map +1 -1
  491. package/dist/team/repo-aware-decomposition.d.ts +60 -0
  492. package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
  493. package/dist/team/repo-aware-decomposition.js +229 -0
  494. package/dist/team/repo-aware-decomposition.js.map +1 -0
  495. package/dist/team/runtime.d.ts +34 -0
  496. package/dist/team/runtime.d.ts.map +1 -1
  497. package/dist/team/runtime.js +191 -50
  498. package/dist/team/runtime.js.map +1 -1
  499. package/dist/team/state/tasks.d.ts.map +1 -1
  500. package/dist/team/state/tasks.js +33 -0
  501. package/dist/team/state/tasks.js.map +1 -1
  502. package/dist/team/state/types.d.ts +23 -1
  503. package/dist/team/state/types.d.ts.map +1 -1
  504. package/dist/team/state/types.js.map +1 -1
  505. package/dist/team/state-root.d.ts +35 -0
  506. package/dist/team/state-root.d.ts.map +1 -1
  507. package/dist/team/state-root.js +281 -1
  508. package/dist/team/state-root.js.map +1 -1
  509. package/dist/team/state.d.ts +27 -1
  510. package/dist/team/state.d.ts.map +1 -1
  511. package/dist/team/state.js +6 -0
  512. package/dist/team/state.js.map +1 -1
  513. package/dist/team/tmux-session.d.ts +1 -0
  514. package/dist/team/tmux-session.d.ts.map +1 -1
  515. package/dist/team/tmux-session.js +83 -6
  516. package/dist/team/tmux-session.js.map +1 -1
  517. package/dist/team/worker-bootstrap.d.ts +3 -0
  518. package/dist/team/worker-bootstrap.d.ts.map +1 -1
  519. package/dist/team/worker-bootstrap.js +77 -4
  520. package/dist/team/worker-bootstrap.js.map +1 -1
  521. package/dist/utils/__tests__/agents-model-table.test.js +8 -0
  522. package/dist/utils/__tests__/agents-model-table.test.js.map +1 -1
  523. package/dist/utils/__tests__/paths.test.js +42 -9
  524. package/dist/utils/__tests__/paths.test.js.map +1 -1
  525. package/dist/utils/agents-md.d.ts +3 -0
  526. package/dist/utils/agents-md.d.ts.map +1 -1
  527. package/dist/utils/agents-md.js +25 -0
  528. package/dist/utils/agents-md.js.map +1 -1
  529. package/dist/utils/agents-model-table.d.ts.map +1 -1
  530. package/dist/utils/agents-model-table.js +2 -3
  531. package/dist/utils/agents-model-table.js.map +1 -1
  532. package/package.json +14 -7
  533. package/plugins/oh-my-codex/.app.json +3 -0
  534. package/plugins/oh-my-codex/.codex-plugin/plugin.json +30 -0
  535. package/plugins/oh-my-codex/.mcp.json +44 -0
  536. package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +114 -0
  537. package/plugins/oh-my-codex/skills/analyze/SKILL.md +148 -0
  538. package/plugins/oh-my-codex/skills/ask-claude/SKILL.md +61 -0
  539. package/plugins/oh-my-codex/skills/ask-gemini/SKILL.md +61 -0
  540. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +231 -0
  541. package/plugins/oh-my-codex/skills/autoresearch/SKILL.md +68 -0
  542. package/plugins/oh-my-codex/skills/cancel/SKILL.md +399 -0
  543. package/plugins/oh-my-codex/skills/code-review/SKILL.md +290 -0
  544. package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +287 -0
  545. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +464 -0
  546. package/plugins/oh-my-codex/skills/doctor/SKILL.md +239 -0
  547. package/plugins/oh-my-codex/skills/help/SKILL.md +202 -0
  548. package/plugins/oh-my-codex/skills/hud/SKILL.md +98 -0
  549. package/plugins/oh-my-codex/skills/note/SKILL.md +62 -0
  550. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +135 -0
  551. package/plugins/oh-my-codex/skills/pipeline/SKILL.md +86 -0
  552. package/plugins/oh-my-codex/skills/plan/SKILL.md +276 -0
  553. package/plugins/oh-my-codex/skills/ralph/SKILL.md +269 -0
  554. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +162 -0
  555. package/plugins/oh-my-codex/skills/security-review/SKILL.md +300 -0
  556. package/plugins/oh-my-codex/skills/skill/SKILL.md +835 -0
  557. package/plugins/oh-my-codex/skills/team/SKILL.md +510 -0
  558. package/plugins/oh-my-codex/skills/trace/SKILL.md +33 -0
  559. package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +143 -0
  560. package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +175 -0
  561. package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +153 -0
  562. package/plugins/oh-my-codex/skills/visual-verdict/SKILL.md +76 -0
  563. package/plugins/oh-my-codex/skills/wiki/SKILL.md +57 -0
  564. package/plugins/oh-my-codex/skills/worker/SKILL.md +106 -0
  565. package/prompts/critic.md +35 -83
  566. package/prompts/executor.md +32 -109
  567. package/prompts/explore-harness.md +1 -1
  568. package/prompts/explore.md +37 -90
  569. package/prompts/planner.md +28 -58
  570. package/prompts/researcher.md +46 -78
  571. package/prompts/verifier.md +23 -31
  572. package/skills/autopilot/SKILL.md +1 -4
  573. package/skills/deep-interview/SKILL.md +8 -5
  574. package/skills/doctor/SKILL.md +45 -17
  575. package/skills/help/SKILL.md +2 -2
  576. package/skills/omx-setup/SKILL.md +52 -9
  577. package/skills/plan/SKILL.md +1 -4
  578. package/skills/ralph/SKILL.md +3 -5
  579. package/skills/ralplan/SKILL.md +2 -6
  580. package/skills/team/SKILL.md +2 -5
  581. package/skills/ultraqa/SKILL.md +1 -4
  582. package/skills/ultrawork/SKILL.md +2 -3
  583. package/skills/visual-ralph/SKILL.md +153 -0
  584. package/skills/web-clone/SKILL.md +12 -354
  585. package/src/scripts/__tests__/codex-native-hook.test.ts +2306 -224
  586. package/src/scripts/__tests__/generate-release-body.test.ts +109 -0
  587. package/src/scripts/__tests__/hook-derived-watcher.test.ts +132 -2
  588. package/src/scripts/__tests__/postinstall.test.ts +7 -104
  589. package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
  590. package/src/scripts/__tests__/run-test-files.test.ts +72 -0
  591. package/src/scripts/__tests__/smoke-packed-install.test.ts +15 -0
  592. package/src/scripts/__tests__/verify-native-agents.test.ts +204 -0
  593. package/src/scripts/codex-execution-surface.ts +73 -0
  594. package/src/scripts/codex-native-hook.ts +579 -82
  595. package/src/scripts/codex-native-pre-post.ts +157 -19
  596. package/src/scripts/generate-release-body.ts +34 -2
  597. package/src/scripts/hook-derived-watcher.ts +51 -8
  598. package/src/scripts/notify-fallback-watcher.ts +65 -9
  599. package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
  600. package/src/scripts/notify-hook/managed-tmux.ts +22 -4
  601. package/src/scripts/notify-hook/process-runner.ts +7 -3
  602. package/src/scripts/notify-hook/team-dispatch.ts +103 -11
  603. package/src/scripts/notify-hook/team-tmux-guard.ts +3 -3
  604. package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
  605. package/src/scripts/notify-hook/team-worker.ts +4 -48
  606. package/src/scripts/notify-hook.ts +36 -5
  607. package/src/scripts/postinstall.ts +4 -58
  608. package/src/scripts/prompt-inventory.ts +218 -0
  609. package/src/scripts/run-test-files.ts +41 -2
  610. package/src/scripts/smoke-packed-install.ts +10 -1
  611. package/src/scripts/sync-plugin-mirror.ts +360 -0
  612. package/src/scripts/verify-native-agents.ts +245 -0
  613. package/templates/AGENTS.md +26 -91
  614. package/templates/catalog-manifest.json +16 -1
@@ -0,0 +1,360 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync } from "node:fs";
3
+ import { cp, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
4
+ import { dirname, join } from "node:path";
5
+ import process from "node:process";
6
+ import {
7
+ getSetupInstallableSkillNames,
8
+ isCatalogInstallableStatus,
9
+ } from "../catalog/installable.js";
10
+ import { readCatalogManifest } from "../catalog/reader.js";
11
+ import {
12
+ assertSkillMirror,
13
+ compareSkillMirror,
14
+ } from "../catalog/skill-mirror.js";
15
+ import { buildOmxPluginMcpManifest } from "../config/omx-first-party-mcp.js";
16
+
17
+ export interface SyncPluginMirrorOptions {
18
+ root?: string;
19
+ check?: boolean;
20
+ verbose?: boolean;
21
+ }
22
+
23
+ export interface SyncPluginMirrorResult {
24
+ checked: boolean;
25
+ mirroredSkillNames: string[];
26
+ changed: boolean;
27
+ }
28
+
29
+ type JsonValue =
30
+ | null
31
+ | boolean
32
+ | number
33
+ | string
34
+ | JsonValue[]
35
+ | { [key: string]: JsonValue };
36
+
37
+ type PluginManifest = {
38
+ name?: string;
39
+ version?: string;
40
+ skills?: string;
41
+ mcpServers?: string;
42
+ apps?: string;
43
+ agents?: string;
44
+ prompts?: string;
45
+ hooks?: string;
46
+ [key: string]: JsonValue | undefined;
47
+ };
48
+
49
+ type PackageJson = {
50
+ version?: string;
51
+ };
52
+
53
+ const PLUGIN_NAME = "oh-my-codex";
54
+ const SETUP_OWNED_PLUGIN_MANIFEST_FIELDS = [
55
+ "agents",
56
+ "prompts",
57
+ "hooks",
58
+ ] as const;
59
+
60
+ async function readJsonFile<T>(path: string): Promise<T> {
61
+ return JSON.parse(await readFile(path, "utf-8")) as T;
62
+ }
63
+
64
+ function stringifyJson(value: unknown): string {
65
+ return `${JSON.stringify(value, null, 2)}\n`;
66
+ }
67
+
68
+ function assertDeepJsonEqual(
69
+ actual: unknown,
70
+ expected: unknown,
71
+ label: string,
72
+ ): void {
73
+ const actualJson = stringifyJson(actual);
74
+ const expectedJson = stringifyJson(expected);
75
+ if (actualJson !== expectedJson) {
76
+ throw new Error(
77
+ [
78
+ "plugin_bundle_metadata_out_of_sync",
79
+ `kind=${label}`,
80
+ `expected=${expectedJson.trim()}`,
81
+ `actual=${actualJson.trim()}`,
82
+ ].join("\n"),
83
+ );
84
+ }
85
+ }
86
+
87
+ function getPluginPaths(root: string): {
88
+ pluginRoot: string;
89
+ pluginSkillsDir: string;
90
+ pluginMcpPath: string;
91
+ pluginAppsPath: string;
92
+ pluginManifestPath: string;
93
+ } {
94
+ const pluginRoot = join(root, "plugins", PLUGIN_NAME);
95
+ return {
96
+ pluginRoot,
97
+ pluginSkillsDir: join(pluginRoot, "skills"),
98
+ pluginMcpPath: join(pluginRoot, ".mcp.json"),
99
+ pluginAppsPath: join(pluginRoot, ".app.json"),
100
+ pluginManifestPath: join(pluginRoot, ".codex-plugin", "plugin.json"),
101
+ };
102
+ }
103
+
104
+ async function assertRootSkillCatalogConsistency(
105
+ root: string,
106
+ skillNames: readonly string[],
107
+ ): Promise<void> {
108
+ const manifest = readCatalogManifest(root);
109
+ const rootSkillsDir = join(root, "skills");
110
+ const manifestByName = new Map(
111
+ manifest.skills.map((skill) => [skill.name, skill]),
112
+ );
113
+ const expectedSkillNames = new Set(skillNames);
114
+
115
+ for (const skillName of skillNames) {
116
+ const skillMd = join(rootSkillsDir, skillName, "SKILL.md");
117
+ if (!existsSync(skillMd)) {
118
+ throw new Error(`canonical_skill_missing: skills/${skillName}/SKILL.md`);
119
+ }
120
+ }
121
+
122
+ const rootEntries = await readdir(rootSkillsDir, { withFileTypes: true });
123
+ const unlistedSkillDirs = rootEntries
124
+ .filter((entry) => entry.isDirectory())
125
+ .map((entry) => entry.name)
126
+ .filter(
127
+ (skillName) =>
128
+ !manifestByName.has(skillName) && !expectedSkillNames.has(skillName),
129
+ )
130
+ .sort();
131
+ if (unlistedSkillDirs.length > 0) {
132
+ throw new Error(
133
+ [
134
+ "canonical_skill_catalog_out_of_sync",
135
+ "message=root skill directories must be listed in the catalog or explicitly included by setup policy",
136
+ `skills=${JSON.stringify(unlistedSkillDirs)}`,
137
+ ].join("\n"),
138
+ );
139
+ }
140
+
141
+ const nonInstallableRootSkillDirs = rootEntries
142
+ .filter((entry) => entry.isDirectory())
143
+ .map((entry) => entry.name)
144
+ .filter((skillName) => {
145
+ if (expectedSkillNames.has(skillName)) return false;
146
+ const status = manifestByName.get(skillName)?.status;
147
+ return status !== "alias" && status !== "merged";
148
+ })
149
+ .sort();
150
+ if (nonInstallableRootSkillDirs.length > 0) {
151
+ throw new Error(
152
+ [
153
+ "canonical_skill_catalog_out_of_sync",
154
+ "message=root skill directories excluded from plugin must be alias or merged catalog entries",
155
+ `skills=${JSON.stringify(nonInstallableRootSkillDirs)}`,
156
+ ].join("\n"),
157
+ );
158
+ }
159
+
160
+ const installableMissingFromSetup = manifest.skills
161
+ .filter((skill) => isCatalogInstallableStatus(skill.status))
162
+ .map((skill) => skill.name)
163
+ .filter((skillName) => !expectedSkillNames.has(skillName))
164
+ .sort();
165
+ if (installableMissingFromSetup.length > 0) {
166
+ throw new Error(
167
+ [
168
+ "canonical_skill_catalog_out_of_sync",
169
+ "message=installable catalog skills must be included in plugin/setup installable skill set",
170
+ `skills=${JSON.stringify(installableMissingFromSetup)}`,
171
+ ].join("\n"),
172
+ );
173
+ }
174
+ }
175
+
176
+ async function buildExpectedPluginManifest(
177
+ root: string,
178
+ ): Promise<PluginManifest> {
179
+ const { pluginManifestPath } = getPluginPaths(root);
180
+ const [manifest, pkg] = await Promise.all([
181
+ readJsonFile<PluginManifest>(pluginManifestPath),
182
+ readJsonFile<PackageJson>(join(root, "package.json")),
183
+ ]);
184
+ return {
185
+ ...manifest,
186
+ name: PLUGIN_NAME,
187
+ version: pkg.version,
188
+ skills: "./skills/",
189
+ mcpServers: "./.mcp.json",
190
+ apps: "./.app.json",
191
+ };
192
+ }
193
+
194
+ async function assertPluginManifestPolicy(
195
+ root: string,
196
+ manifest: PluginManifest,
197
+ ): Promise<void> {
198
+ const pkg = await readJsonFile<PackageJson>(join(root, "package.json"));
199
+ const expectedFields: Pick<
200
+ PluginManifest,
201
+ "name" | "version" | "skills" | "mcpServers" | "apps"
202
+ > = {
203
+ name: PLUGIN_NAME,
204
+ version: pkg.version,
205
+ skills: "./skills/",
206
+ mcpServers: "./.mcp.json",
207
+ apps: "./.app.json",
208
+ };
209
+
210
+ for (const [field, expectedValue] of Object.entries(expectedFields)) {
211
+ if (manifest[field] !== expectedValue) {
212
+ throw new Error(
213
+ [
214
+ "plugin_bundle_metadata_out_of_sync",
215
+ "kind=plugin-manifest",
216
+ `field=${field}`,
217
+ `expected=${JSON.stringify(expectedValue)}`,
218
+ `actual=${JSON.stringify(manifest[field])}`,
219
+ ].join("\n"),
220
+ );
221
+ }
222
+ }
223
+
224
+ for (const field of SETUP_OWNED_PLUGIN_MANIFEST_FIELDS) {
225
+ if (manifest[field] !== undefined) {
226
+ throw new Error(
227
+ [
228
+ "plugin_bundle_metadata_out_of_sync",
229
+ "kind=plugin-manifest",
230
+ `field=${field}`,
231
+ "message=setup-owned agents/prompts/hooks must not be plugin-scoped",
232
+ ].join("\n"),
233
+ );
234
+ }
235
+ }
236
+ }
237
+
238
+ async function assertPluginMetadata(root: string): Promise<void> {
239
+ const { pluginMcpPath, pluginAppsPath, pluginManifestPath } =
240
+ getPluginPaths(root);
241
+ const [actualMcp, actualApps, actualManifest] = await Promise.all([
242
+ readJsonFile<unknown>(pluginMcpPath),
243
+ readJsonFile<unknown>(pluginAppsPath),
244
+ readJsonFile<PluginManifest>(pluginManifestPath),
245
+ ]);
246
+
247
+ assertDeepJsonEqual(actualMcp, buildOmxPluginMcpManifest(), "mcp-manifest");
248
+ assertDeepJsonEqual(actualApps, { apps: {} }, "apps-manifest");
249
+ await assertPluginManifestPolicy(root, actualManifest);
250
+ }
251
+
252
+ async function writePluginMetadata(
253
+ root: string,
254
+ verbose = false,
255
+ ): Promise<boolean> {
256
+ const { pluginMcpPath, pluginAppsPath, pluginManifestPath } =
257
+ getPluginPaths(root);
258
+ const expectedMcp = buildOmxPluginMcpManifest();
259
+ const expectedApps = { apps: {} };
260
+ const expectedManifest = await buildExpectedPluginManifest(root);
261
+ const writes = [
262
+ {
263
+ path: pluginMcpPath,
264
+ content: stringifyJson(expectedMcp),
265
+ label: "plugin MCP manifest",
266
+ },
267
+ {
268
+ path: pluginAppsPath,
269
+ content: stringifyJson(expectedApps),
270
+ label: "plugin apps manifest",
271
+ },
272
+ {
273
+ path: pluginManifestPath,
274
+ content: stringifyJson(expectedManifest),
275
+ label: "plugin manifest",
276
+ },
277
+ ];
278
+ let changed = false;
279
+
280
+ for (const write of writes) {
281
+ const existing = existsSync(write.path)
282
+ ? await readFile(write.path, "utf-8")
283
+ : null;
284
+ if (existing !== write.content) {
285
+ await mkdir(dirname(write.path), { recursive: true });
286
+ await writeFile(write.path, write.content);
287
+ changed = true;
288
+ if (verbose) console.log(`synced ${write.label}`);
289
+ }
290
+ }
291
+
292
+ return changed;
293
+ }
294
+
295
+ export async function syncPluginMirror(
296
+ options: SyncPluginMirrorOptions = {},
297
+ ): Promise<SyncPluginMirrorResult> {
298
+ const root = options.root ?? process.cwd();
299
+ const manifest = readCatalogManifest(root);
300
+ const skillNames = [...getSetupInstallableSkillNames(manifest)].sort();
301
+ const rootSkillsDir = join(root, "skills");
302
+ const { pluginSkillsDir } = getPluginPaths(root);
303
+
304
+ await assertRootSkillCatalogConsistency(root, skillNames);
305
+
306
+ if (options.check) {
307
+ await assertSkillMirror(rootSkillsDir, pluginSkillsDir, skillNames);
308
+ await assertPluginMetadata(root);
309
+ return { checked: true, mirroredSkillNames: skillNames, changed: false };
310
+ }
311
+
312
+ const beforeSkillsMatch =
313
+ (await compareSkillMirror(rootSkillsDir, pluginSkillsDir, skillNames)) ===
314
+ null;
315
+
316
+ await rm(pluginSkillsDir, { recursive: true, force: true });
317
+ await mkdir(pluginSkillsDir, { recursive: true });
318
+
319
+ for (const skillName of skillNames) {
320
+ await cp(join(rootSkillsDir, skillName), join(pluginSkillsDir, skillName), {
321
+ recursive: true,
322
+ });
323
+ if (options.verbose) {
324
+ console.log(
325
+ `mirrored skills/${skillName} -> plugins/${PLUGIN_NAME}/skills/${skillName}`,
326
+ );
327
+ }
328
+ }
329
+
330
+ const metadataChanged = await writePluginMetadata(root, options.verbose);
331
+
332
+ await assertSkillMirror(rootSkillsDir, pluginSkillsDir, skillNames);
333
+ await assertPluginMetadata(root);
334
+ return {
335
+ checked: false,
336
+ mirroredSkillNames: skillNames,
337
+ changed: !beforeSkillsMatch || metadataChanged,
338
+ };
339
+ }
340
+
341
+ function parseArgs(argv: string[]): SyncPluginMirrorOptions {
342
+ return {
343
+ check: argv.includes("--check"),
344
+ verbose: argv.includes("--verbose"),
345
+ };
346
+ }
347
+
348
+ if (import.meta.url === `file://${process.argv[1]}`) {
349
+ syncPluginMirror(parseArgs(process.argv.slice(2)))
350
+ .then((result) => {
351
+ const action = result.checked ? "verified" : "synced";
352
+ console.log(
353
+ `[sync-plugin-mirror] ${action} ${result.mirroredSkillNames.length} canonical skill director${result.mirroredSkillNames.length === 1 ? "y" : "ies"} and plugin metadata`,
354
+ );
355
+ })
356
+ .catch((error: unknown) => {
357
+ console.error(error instanceof Error ? error.message : String(error));
358
+ process.exitCode = 1;
359
+ });
360
+ }
@@ -0,0 +1,245 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync } from "node:fs";
3
+ import { readFile, readdir } from "node:fs/promises";
4
+ import { join, resolve } from "node:path";
5
+ import process from "node:process";
6
+ import TOML from "@iarna/toml";
7
+ import { AGENT_DEFINITIONS, type AgentDefinition } from "../agents/definitions.js";
8
+ import { generateAgentToml } from "../agents/native-config.js";
9
+ import {
10
+ NON_NATIVE_AGENT_PROMPT_ASSETS,
11
+ assertNativeAgentCanonicalTargets,
12
+ getCatalogAgentByName,
13
+ getInstallableNativeAgentNames,
14
+ isNativeAgentInstallableStatus,
15
+ } from "../agents/policy.js";
16
+ import { readCatalogManifest } from "../catalog/reader.js";
17
+ import type { CatalogManifest } from "../catalog/schema.js";
18
+
19
+ export interface VerifyNativeAgentsOptions {
20
+ root?: string;
21
+ manifest?: CatalogManifest;
22
+ definitions?: Record<string, AgentDefinition>;
23
+ promptNames?: Set<string>;
24
+ pluginManifest?: Record<string, unknown>;
25
+ }
26
+
27
+ export interface VerifyNativeAgentsResult {
28
+ installableAgentNames: string[];
29
+ promptAssetNames: string[];
30
+ }
31
+
32
+ function errorBlock(code: string, fields: Record<string, unknown>): Error {
33
+ return new Error(
34
+ [
35
+ code,
36
+ ...Object.entries(fields).map(
37
+ ([key, value]) => `${key}=${JSON.stringify(value)}`,
38
+ ),
39
+ ].join("\n"),
40
+ );
41
+ }
42
+
43
+ async function readPromptNames(root: string): Promise<Set<string>> {
44
+ const promptsDir = join(root, "prompts");
45
+ const entries = await readdir(promptsDir, { withFileTypes: true });
46
+ return new Set(
47
+ entries
48
+ .filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
49
+ .map((entry) => entry.name.slice(0, -3)),
50
+ );
51
+ }
52
+
53
+ async function readPluginManifest(
54
+ root: string,
55
+ ): Promise<Record<string, unknown> | null> {
56
+ const pluginManifestPath = join(
57
+ root,
58
+ "plugins",
59
+ "oh-my-codex",
60
+ ".codex-plugin",
61
+ "plugin.json",
62
+ );
63
+ if (!existsSync(pluginManifestPath)) return null;
64
+ return JSON.parse(await readFile(pluginManifestPath, "utf-8")) as Record<
65
+ string,
66
+ unknown
67
+ >;
68
+ }
69
+
70
+ function assertTomlStructure(
71
+ agentName: string,
72
+ agent: AgentDefinition,
73
+ toml: string,
74
+ ): void {
75
+ let parsed: Record<string, unknown>;
76
+ try {
77
+ parsed = TOML.parse(toml) as Record<string, unknown>;
78
+ } catch (cause) {
79
+ throw errorBlock("native_agent_toml_invalid", {
80
+ agent: agentName,
81
+ message: cause instanceof Error ? cause.message : String(cause),
82
+ });
83
+ }
84
+
85
+ if (parsed.name !== agentName) {
86
+ throw errorBlock("native_agent_toml_invalid", {
87
+ agent: agentName,
88
+ field: "name",
89
+ expected: agentName,
90
+ actual: parsed.name,
91
+ });
92
+ }
93
+ if (parsed.description !== agent.description) {
94
+ throw errorBlock("native_agent_toml_invalid", {
95
+ agent: agentName,
96
+ field: "description",
97
+ expected: agent.description,
98
+ actual: parsed.description,
99
+ });
100
+ }
101
+ if (parsed.model_reasoning_effort !== agent.reasoningEffort) {
102
+ throw errorBlock("native_agent_toml_invalid", {
103
+ agent: agentName,
104
+ field: "model_reasoning_effort",
105
+ expected: agent.reasoningEffort,
106
+ actual: parsed.model_reasoning_effort,
107
+ });
108
+ }
109
+
110
+ const instructions = parsed.developer_instructions;
111
+ if (typeof instructions !== "string" || instructions.trim() === "") {
112
+ throw errorBlock("native_agent_toml_invalid", {
113
+ agent: agentName,
114
+ field: "developer_instructions",
115
+ message: "developer instructions must be non-empty",
116
+ });
117
+ }
118
+
119
+ for (const expected of [
120
+ `- role: ${agentName}`,
121
+ `- posture: ${agent.posture}`,
122
+ `- model_class: ${agent.modelClass}`,
123
+ `- routing_role: ${agent.routingRole}`,
124
+ ]) {
125
+ if (!instructions.includes(expected)) {
126
+ throw errorBlock("native_agent_toml_invalid", {
127
+ agent: agentName,
128
+ field: "developer_instructions",
129
+ missing: expected,
130
+ });
131
+ }
132
+ }
133
+ }
134
+
135
+ export async function verifyNativeAgents(
136
+ options: VerifyNativeAgentsOptions = {},
137
+ ): Promise<VerifyNativeAgentsResult> {
138
+ const root = resolve(options.root ?? process.cwd());
139
+ const manifest = options.manifest ?? readCatalogManifest(root);
140
+ const definitions = options.definitions ?? AGENT_DEFINITIONS;
141
+ const promptNames = options.promptNames ?? (await readPromptNames(root));
142
+ const catalogByName = getCatalogAgentByName(manifest);
143
+ const installableAgentNames = [...getInstallableNativeAgentNames(manifest)].sort();
144
+
145
+ assertNativeAgentCanonicalTargets(manifest);
146
+
147
+ for (const agent of manifest.agents) {
148
+ if (!isNativeAgentInstallableStatus(agent.status)) continue;
149
+ if (!definitions[agent.name]) {
150
+ throw errorBlock("native_agent_definition_missing", {
151
+ agent: agent.name,
152
+ status: agent.status,
153
+ });
154
+ }
155
+ if (!promptNames.has(agent.name)) {
156
+ throw errorBlock("native_agent_prompt_missing", {
157
+ agent: agent.name,
158
+ status: agent.status,
159
+ path: `prompts/${agent.name}.md`,
160
+ });
161
+ }
162
+ }
163
+
164
+ for (const name of Object.keys(definitions).sort()) {
165
+ if (!catalogByName.has(name)) {
166
+ throw errorBlock("native_agent_catalog_out_of_sync", {
167
+ agent: name,
168
+ message: "agent definition must be listed in catalog agents",
169
+ });
170
+ }
171
+ }
172
+
173
+ for (const name of [...promptNames].sort()) {
174
+ if (catalogByName.has(name)) continue;
175
+ if (NON_NATIVE_AGENT_PROMPT_ASSETS.has(name)) continue;
176
+ throw errorBlock("native_agent_prompt_unclassified", {
177
+ prompt: name,
178
+ path: `prompts/${name}.md`,
179
+ message:
180
+ "prompt files must be cataloged native agents or explicit non-native prompt assets",
181
+ });
182
+ }
183
+
184
+ for (const name of installableAgentNames) {
185
+ const agent = definitions[name];
186
+ if (!agent) continue;
187
+ const promptPath = join(root, "prompts", `${name}.md`);
188
+ const promptContent = options.promptNames
189
+ ? `${name} prompt fixture`
190
+ : await readFile(promptPath, "utf-8");
191
+ const toml = generateAgentToml(agent, promptContent);
192
+ assertTomlStructure(name, agent, toml);
193
+ }
194
+
195
+ const pluginManifest =
196
+ options.pluginManifest === undefined
197
+ ? await readPluginManifest(root)
198
+ : options.pluginManifest;
199
+ if (pluginManifest) {
200
+ for (const field of ["agents", "prompts", "hooks"]) {
201
+ if (pluginManifest[field] !== undefined) {
202
+ throw errorBlock("native_agent_plugin_boundary_violation", {
203
+ field,
204
+ message: "native agents/prompts/hooks are setup-owned, not plugin-scoped",
205
+ });
206
+ }
207
+ }
208
+ }
209
+
210
+ return {
211
+ installableAgentNames,
212
+ promptAssetNames: [...promptNames].sort(),
213
+ };
214
+ }
215
+
216
+ function parseArgs(argv: string[]): { root: string } {
217
+ let root = process.cwd();
218
+ for (let i = 0; i < argv.length; i += 1) {
219
+ const arg = argv[i];
220
+ if (arg === "--root") {
221
+ const value = argv[i + 1];
222
+ if (!value) throw new Error("missing --root value");
223
+ root = value;
224
+ i += 1;
225
+ continue;
226
+ }
227
+ throw new Error(`unknown argument: ${arg}`);
228
+ }
229
+ return { root };
230
+ }
231
+
232
+ async function main(): Promise<void> {
233
+ const { root } = parseArgs(process.argv.slice(2));
234
+ const result = await verifyNativeAgents({ root });
235
+ console.log(
236
+ `verified ${result.installableAgentNames.length} installable native agents and ${result.promptAssetNames.length} setup prompt assets`,
237
+ );
238
+ }
239
+
240
+ if (process.argv[1]?.endsWith("verify-native-agents.js")) {
241
+ main().catch((error) => {
242
+ console.error(error instanceof Error ? error.message : String(error));
243
+ process.exitCode = 1;
244
+ });
245
+ }