oh-my-codex-pennix 0.18.13

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 (3061) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/Cargo.lock +185 -0
  3. package/Cargo.toml +24 -0
  4. package/README.md +445 -0
  5. package/crates/omx-api/Cargo.toml +19 -0
  6. package/crates/omx-api/src/lib.rs +2997 -0
  7. package/crates/omx-api/src/main.rs +10 -0
  8. package/crates/omx-api/tests/cli.rs +558 -0
  9. package/crates/omx-explore/Cargo.toml +14 -0
  10. package/crates/omx-explore/src/main.rs +2972 -0
  11. package/crates/omx-mux/Cargo.toml +11 -0
  12. package/crates/omx-mux/src/lib.rs +91 -0
  13. package/crates/omx-mux/src/tmux.rs +282 -0
  14. package/crates/omx-mux/src/types.rs +306 -0
  15. package/crates/omx-runtime/Cargo.toml +13 -0
  16. package/crates/omx-runtime/src/main.rs +125 -0
  17. package/crates/omx-runtime/tests/execution.rs +212 -0
  18. package/crates/omx-runtime-core/Cargo.toml +13 -0
  19. package/crates/omx-runtime-core/src/authority.rs +239 -0
  20. package/crates/omx-runtime-core/src/dispatch.rs +330 -0
  21. package/crates/omx-runtime-core/src/engine.rs +853 -0
  22. package/crates/omx-runtime-core/src/lib.rs +653 -0
  23. package/crates/omx-runtime-core/src/mailbox.rs +261 -0
  24. package/crates/omx-runtime-core/src/replay.rs +104 -0
  25. package/crates/omx-sparkshell/Cargo.lock +7 -0
  26. package/crates/omx-sparkshell/Cargo.toml +14 -0
  27. package/crates/omx-sparkshell/src/codex_bridge.rs +768 -0
  28. package/crates/omx-sparkshell/src/error.rs +45 -0
  29. package/crates/omx-sparkshell/src/exec.rs +241 -0
  30. package/crates/omx-sparkshell/src/main.rs +1133 -0
  31. package/crates/omx-sparkshell/src/prompt.rs +364 -0
  32. package/crates/omx-sparkshell/src/redaction.rs +241 -0
  33. package/crates/omx-sparkshell/src/registry/c_cpp.rs +9 -0
  34. package/crates/omx-sparkshell/src/registry/csharp.rs +10 -0
  35. package/crates/omx-sparkshell/src/registry/generic_shell.rs +11 -0
  36. package/crates/omx-sparkshell/src/registry/git.rs +10 -0
  37. package/crates/omx-sparkshell/src/registry/go.rs +9 -0
  38. package/crates/omx-sparkshell/src/registry/java_kotlin.rs +9 -0
  39. package/crates/omx-sparkshell/src/registry/mod.rs +85 -0
  40. package/crates/omx-sparkshell/src/registry/node_js.rs +9 -0
  41. package/crates/omx-sparkshell/src/registry/python.rs +9 -0
  42. package/crates/omx-sparkshell/src/registry/ruby.rs +9 -0
  43. package/crates/omx-sparkshell/src/registry/rust.rs +9 -0
  44. package/crates/omx-sparkshell/src/registry/swift.rs +10 -0
  45. package/crates/omx-sparkshell/src/test_support.rs +10 -0
  46. package/crates/omx-sparkshell/src/threshold.rs +75 -0
  47. package/crates/omx-sparkshell/tests/execution.rs +986 -0
  48. package/crates/omx-sparkshell/tests/registry.rs +99 -0
  49. package/dist/adapt/__tests__/foundation.test.d.ts +2 -0
  50. package/dist/adapt/__tests__/foundation.test.d.ts.map +1 -0
  51. package/dist/adapt/__tests__/foundation.test.js +171 -0
  52. package/dist/adapt/__tests__/foundation.test.js.map +1 -0
  53. package/dist/adapt/__tests__/hermes.test.d.ts +2 -0
  54. package/dist/adapt/__tests__/hermes.test.d.ts.map +1 -0
  55. package/dist/adapt/__tests__/hermes.test.js +137 -0
  56. package/dist/adapt/__tests__/hermes.test.js.map +1 -0
  57. package/dist/adapt/contracts.d.ts +157 -0
  58. package/dist/adapt/contracts.d.ts.map +1 -0
  59. package/dist/adapt/contracts.js +10 -0
  60. package/dist/adapt/contracts.js.map +1 -0
  61. package/dist/adapt/hermes.d.ts +83 -0
  62. package/dist/adapt/hermes.d.ts.map +1 -0
  63. package/dist/adapt/hermes.js +371 -0
  64. package/dist/adapt/hermes.js.map +1 -0
  65. package/dist/adapt/index.d.ts +14 -0
  66. package/dist/adapt/index.d.ts.map +1 -0
  67. package/dist/adapt/index.js +293 -0
  68. package/dist/adapt/index.js.map +1 -0
  69. package/dist/adapt/openclaw.d.ts +7 -0
  70. package/dist/adapt/openclaw.d.ts.map +1 -0
  71. package/dist/adapt/openclaw.js +299 -0
  72. package/dist/adapt/openclaw.js.map +1 -0
  73. package/dist/adapt/paths.d.ts +3 -0
  74. package/dist/adapt/paths.d.ts.map +1 -0
  75. package/dist/adapt/paths.js +15 -0
  76. package/dist/adapt/paths.js.map +1 -0
  77. package/dist/adapt/registry.d.ts +4 -0
  78. package/dist/adapt/registry.d.ts.map +1 -0
  79. package/dist/adapt/registry.js +48 -0
  80. package/dist/adapt/registry.js.map +1 -0
  81. package/dist/agents/__tests__/definitions.test.d.ts +2 -0
  82. package/dist/agents/__tests__/definitions.test.d.ts.map +1 -0
  83. package/dist/agents/__tests__/definitions.test.js +96 -0
  84. package/dist/agents/__tests__/definitions.test.js.map +1 -0
  85. package/dist/agents/__tests__/native-config.test.d.ts +2 -0
  86. package/dist/agents/__tests__/native-config.test.d.ts.map +1 -0
  87. package/dist/agents/__tests__/native-config.test.js +398 -0
  88. package/dist/agents/__tests__/native-config.test.js.map +1 -0
  89. package/dist/agents/definitions.d.ts +35 -0
  90. package/dist/agents/definitions.d.ts.map +1 -0
  91. package/dist/agents/definitions.js +371 -0
  92. package/dist/agents/definitions.js.map +1 -0
  93. package/dist/agents/native-config.d.ts +56 -0
  94. package/dist/agents/native-config.d.ts.map +1 -0
  95. package/dist/agents/native-config.js +285 -0
  96. package/dist/agents/native-config.js.map +1 -0
  97. package/dist/agents/policy.d.ts +10 -0
  98. package/dist/agents/policy.d.ts.map +1 -0
  99. package/dist/agents/policy.js +61 -0
  100. package/dist/agents/policy.js.map +1 -0
  101. package/dist/auth/__tests__/config-sessions.test.d.ts +2 -0
  102. package/dist/auth/__tests__/config-sessions.test.d.ts.map +1 -0
  103. package/dist/auth/__tests__/config-sessions.test.js +48 -0
  104. package/dist/auth/__tests__/config-sessions.test.js.map +1 -0
  105. package/dist/auth/__tests__/quota-rotation.test.d.ts +2 -0
  106. package/dist/auth/__tests__/quota-rotation.test.d.ts.map +1 -0
  107. package/dist/auth/__tests__/quota-rotation.test.js +33 -0
  108. package/dist/auth/__tests__/quota-rotation.test.js.map +1 -0
  109. package/dist/auth/__tests__/redact.test.d.ts +2 -0
  110. package/dist/auth/__tests__/redact.test.d.ts.map +1 -0
  111. package/dist/auth/__tests__/redact.test.js +20 -0
  112. package/dist/auth/__tests__/redact.test.js.map +1 -0
  113. package/dist/auth/__tests__/storage.test.d.ts +2 -0
  114. package/dist/auth/__tests__/storage.test.d.ts.map +1 -0
  115. package/dist/auth/__tests__/storage.test.js +108 -0
  116. package/dist/auth/__tests__/storage.test.js.map +1 -0
  117. package/dist/auth/config.d.ts +9 -0
  118. package/dist/auth/config.d.ts.map +1 -0
  119. package/dist/auth/config.js +77 -0
  120. package/dist/auth/config.js.map +1 -0
  121. package/dist/auth/hotswap.d.ts +36 -0
  122. package/dist/auth/hotswap.d.ts.map +1 -0
  123. package/dist/auth/hotswap.js +159 -0
  124. package/dist/auth/hotswap.js.map +1 -0
  125. package/dist/auth/index.d.ts +8 -0
  126. package/dist/auth/index.d.ts.map +1 -0
  127. package/dist/auth/index.js +8 -0
  128. package/dist/auth/index.js.map +1 -0
  129. package/dist/auth/paths.d.ts +12 -0
  130. package/dist/auth/paths.d.ts.map +1 -0
  131. package/dist/auth/paths.js +78 -0
  132. package/dist/auth/paths.js.map +1 -0
  133. package/dist/auth/quota-detector.d.ts +10 -0
  134. package/dist/auth/quota-detector.d.ts.map +1 -0
  135. package/dist/auth/quota-detector.js +40 -0
  136. package/dist/auth/quota-detector.js.map +1 -0
  137. package/dist/auth/redact.d.ts +2 -0
  138. package/dist/auth/redact.d.ts.map +1 -0
  139. package/dist/auth/redact.js +26 -0
  140. package/dist/auth/redact.js.map +1 -0
  141. package/dist/auth/rotation.d.ts +9 -0
  142. package/dist/auth/rotation.d.ts.map +1 -0
  143. package/dist/auth/rotation.js +26 -0
  144. package/dist/auth/rotation.js.map +1 -0
  145. package/dist/auth/sessions.d.ts +15 -0
  146. package/dist/auth/sessions.d.ts.map +1 -0
  147. package/dist/auth/sessions.js +62 -0
  148. package/dist/auth/sessions.js.map +1 -0
  149. package/dist/auth/storage.d.ts +27 -0
  150. package/dist/auth/storage.d.ts.map +1 -0
  151. package/dist/auth/storage.js +111 -0
  152. package/dist/auth/storage.js.map +1 -0
  153. package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts +2 -0
  154. package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts.map +1 -0
  155. package/dist/autopilot/__tests__/deep-interview-gate.test.js +215 -0
  156. package/dist/autopilot/__tests__/deep-interview-gate.test.js.map +1 -0
  157. package/dist/autopilot/__tests__/fsm.test.d.ts +2 -0
  158. package/dist/autopilot/__tests__/fsm.test.d.ts.map +1 -0
  159. package/dist/autopilot/__tests__/fsm.test.js +78 -0
  160. package/dist/autopilot/__tests__/fsm.test.js.map +1 -0
  161. package/dist/autopilot/__tests__/ralplan-gate.test.d.ts +2 -0
  162. package/dist/autopilot/__tests__/ralplan-gate.test.d.ts.map +1 -0
  163. package/dist/autopilot/__tests__/ralplan-gate.test.js +274 -0
  164. package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -0
  165. package/dist/autopilot/completion-gate.d.ts +10 -0
  166. package/dist/autopilot/completion-gate.d.ts.map +1 -0
  167. package/dist/autopilot/completion-gate.js +154 -0
  168. package/dist/autopilot/completion-gate.js.map +1 -0
  169. package/dist/autopilot/deep-interview-gate.d.ts +18 -0
  170. package/dist/autopilot/deep-interview-gate.d.ts.map +1 -0
  171. package/dist/autopilot/deep-interview-gate.js +396 -0
  172. package/dist/autopilot/deep-interview-gate.js.map +1 -0
  173. package/dist/autopilot/fsm.d.ts +13 -0
  174. package/dist/autopilot/fsm.d.ts.map +1 -0
  175. package/dist/autopilot/fsm.js +70 -0
  176. package/dist/autopilot/fsm.js.map +1 -0
  177. package/dist/autopilot/ralplan-gate.d.ts +17 -0
  178. package/dist/autopilot/ralplan-gate.d.ts.map +1 -0
  179. package/dist/autopilot/ralplan-gate.js +68 -0
  180. package/dist/autopilot/ralplan-gate.js.map +1 -0
  181. package/dist/autoresearch/__tests__/contracts.test.d.ts +2 -0
  182. package/dist/autoresearch/__tests__/contracts.test.d.ts.map +1 -0
  183. package/dist/autoresearch/__tests__/contracts.test.js +127 -0
  184. package/dist/autoresearch/__tests__/contracts.test.js.map +1 -0
  185. package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts +2 -0
  186. package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts.map +1 -0
  187. package/dist/autoresearch/__tests__/runtime-parity-extra.test.js +349 -0
  188. package/dist/autoresearch/__tests__/runtime-parity-extra.test.js.map +1 -0
  189. package/dist/autoresearch/__tests__/runtime.test.d.ts +2 -0
  190. package/dist/autoresearch/__tests__/runtime.test.d.ts.map +1 -0
  191. package/dist/autoresearch/__tests__/runtime.test.js +211 -0
  192. package/dist/autoresearch/__tests__/runtime.test.js.map +1 -0
  193. package/dist/autoresearch/__tests__/skill-validation.test.d.ts +2 -0
  194. package/dist/autoresearch/__tests__/skill-validation.test.d.ts.map +1 -0
  195. package/dist/autoresearch/__tests__/skill-validation.test.js +91 -0
  196. package/dist/autoresearch/__tests__/skill-validation.test.js.map +1 -0
  197. package/dist/autoresearch/contracts.d.ts +31 -0
  198. package/dist/autoresearch/contracts.d.ts.map +1 -0
  199. package/dist/autoresearch/contracts.js +197 -0
  200. package/dist/autoresearch/contracts.js.map +1 -0
  201. package/dist/autoresearch/goal.d.ts +90 -0
  202. package/dist/autoresearch/goal.d.ts.map +1 -0
  203. package/dist/autoresearch/goal.js +237 -0
  204. package/dist/autoresearch/goal.js.map +1 -0
  205. package/dist/autoresearch/runtime.d.ts +132 -0
  206. package/dist/autoresearch/runtime.d.ts.map +1 -0
  207. package/dist/autoresearch/runtime.js +1022 -0
  208. package/dist/autoresearch/runtime.js.map +1 -0
  209. package/dist/autoresearch/skill-validation.d.ts +14 -0
  210. package/dist/autoresearch/skill-validation.d.ts.map +1 -0
  211. package/dist/autoresearch/skill-validation.js +172 -0
  212. package/dist/autoresearch/skill-validation.js.map +1 -0
  213. package/dist/catalog/__tests__/generator.test.d.ts +2 -0
  214. package/dist/catalog/__tests__/generator.test.d.ts.map +1 -0
  215. package/dist/catalog/__tests__/generator.test.js +60 -0
  216. package/dist/catalog/__tests__/generator.test.js.map +1 -0
  217. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +2 -0
  218. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +1 -0
  219. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +108 -0
  220. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -0
  221. package/dist/catalog/__tests__/schema.test.d.ts +2 -0
  222. package/dist/catalog/__tests__/schema.test.d.ts.map +1 -0
  223. package/dist/catalog/__tests__/schema.test.js +84 -0
  224. package/dist/catalog/__tests__/schema.test.js.map +1 -0
  225. package/dist/catalog/installable.d.ts +5 -0
  226. package/dist/catalog/installable.d.ts.map +1 -0
  227. package/dist/catalog/installable.js +13 -0
  228. package/dist/catalog/installable.js.map +1 -0
  229. package/dist/catalog/reader.d.ts +19 -0
  230. package/dist/catalog/reader.d.ts.map +1 -0
  231. package/dist/catalog/reader.js +63 -0
  232. package/dist/catalog/reader.js.map +1 -0
  233. package/dist/catalog/schema.d.ts +32 -0
  234. package/dist/catalog/schema.d.ts.map +1 -0
  235. package/dist/catalog/schema.js +107 -0
  236. package/dist/catalog/schema.js.map +1 -0
  237. package/dist/catalog/skill-mirror.d.ts +20 -0
  238. package/dist/catalog/skill-mirror.d.ts.map +1 -0
  239. package/dist/catalog/skill-mirror.js +104 -0
  240. package/dist/catalog/skill-mirror.js.map +1 -0
  241. package/dist/cli/__tests__/adapt-help.test.d.ts +2 -0
  242. package/dist/cli/__tests__/adapt-help.test.d.ts.map +1 -0
  243. package/dist/cli/__tests__/adapt-help.test.js +39 -0
  244. package/dist/cli/__tests__/adapt-help.test.js.map +1 -0
  245. package/dist/cli/__tests__/adapt.test.d.ts +2 -0
  246. package/dist/cli/__tests__/adapt.test.d.ts.map +1 -0
  247. package/dist/cli/__tests__/adapt.test.js +62 -0
  248. package/dist/cli/__tests__/adapt.test.js.map +1 -0
  249. package/dist/cli/__tests__/agents-init.test.d.ts +2 -0
  250. package/dist/cli/__tests__/agents-init.test.d.ts.map +1 -0
  251. package/dist/cli/__tests__/agents-init.test.js +184 -0
  252. package/dist/cli/__tests__/agents-init.test.js.map +1 -0
  253. package/dist/cli/__tests__/agents.test.d.ts +2 -0
  254. package/dist/cli/__tests__/agents.test.d.ts.map +1 -0
  255. package/dist/cli/__tests__/agents.test.js +137 -0
  256. package/dist/cli/__tests__/agents.test.js.map +1 -0
  257. package/dist/cli/__tests__/api.test.d.ts +2 -0
  258. package/dist/cli/__tests__/api.test.d.ts.map +1 -0
  259. package/dist/cli/__tests__/api.test.js +175 -0
  260. package/dist/cli/__tests__/api.test.js.map +1 -0
  261. package/dist/cli/__tests__/ask.test.d.ts +2 -0
  262. package/dist/cli/__tests__/ask.test.d.ts.map +1 -0
  263. package/dist/cli/__tests__/ask.test.js +332 -0
  264. package/dist/cli/__tests__/ask.test.js.map +1 -0
  265. package/dist/cli/__tests__/auth.test.d.ts +2 -0
  266. package/dist/cli/__tests__/auth.test.d.ts.map +1 -0
  267. package/dist/cli/__tests__/auth.test.js +203 -0
  268. package/dist/cli/__tests__/auth.test.js.map +1 -0
  269. package/dist/cli/__tests__/autoresearch-goal.test.d.ts +2 -0
  270. package/dist/cli/__tests__/autoresearch-goal.test.d.ts.map +1 -0
  271. package/dist/cli/__tests__/autoresearch-goal.test.js +207 -0
  272. package/dist/cli/__tests__/autoresearch-goal.test.js.map +1 -0
  273. package/dist/cli/__tests__/autoresearch-guided.test.d.ts +2 -0
  274. package/dist/cli/__tests__/autoresearch-guided.test.d.ts.map +1 -0
  275. package/dist/cli/__tests__/autoresearch-guided.test.js +365 -0
  276. package/dist/cli/__tests__/autoresearch-guided.test.js.map +1 -0
  277. package/dist/cli/__tests__/autoresearch.test.d.ts +2 -0
  278. package/dist/cli/__tests__/autoresearch.test.d.ts.map +1 -0
  279. package/dist/cli/__tests__/autoresearch.test.js +155 -0
  280. package/dist/cli/__tests__/autoresearch.test.js.map +1 -0
  281. package/dist/cli/__tests__/catalog-contract.test.d.ts +2 -0
  282. package/dist/cli/__tests__/catalog-contract.test.d.ts.map +1 -0
  283. package/dist/cli/__tests__/catalog-contract.test.js +18 -0
  284. package/dist/cli/__tests__/catalog-contract.test.js.map +1 -0
  285. package/dist/cli/__tests__/cleanup.test.d.ts +2 -0
  286. package/dist/cli/__tests__/cleanup.test.d.ts.map +1 -0
  287. package/dist/cli/__tests__/cleanup.test.js +527 -0
  288. package/dist/cli/__tests__/cleanup.test.js.map +1 -0
  289. package/dist/cli/__tests__/codex-feature-probe.test.d.ts +2 -0
  290. package/dist/cli/__tests__/codex-feature-probe.test.d.ts.map +1 -0
  291. package/dist/cli/__tests__/codex-feature-probe.test.js +46 -0
  292. package/dist/cli/__tests__/codex-feature-probe.test.js.map +1 -0
  293. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +2 -0
  294. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +1 -0
  295. package/dist/cli/__tests__/codex-plugin-layout.test.js +778 -0
  296. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -0
  297. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts +2 -0
  298. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts.map +1 -0
  299. package/dist/cli/__tests__/doctor-context-window-warning.test.js +122 -0
  300. package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +1 -0
  301. package/dist/cli/__tests__/doctor-invalid-config.test.d.ts +2 -0
  302. package/dist/cli/__tests__/doctor-invalid-config.test.d.ts.map +1 -0
  303. package/dist/cli/__tests__/doctor-invalid-config.test.js +52 -0
  304. package/dist/cli/__tests__/doctor-invalid-config.test.js.map +1 -0
  305. package/dist/cli/__tests__/doctor-spark-routing.test.d.ts +2 -0
  306. package/dist/cli/__tests__/doctor-spark-routing.test.d.ts.map +1 -0
  307. package/dist/cli/__tests__/doctor-spark-routing.test.js +79 -0
  308. package/dist/cli/__tests__/doctor-spark-routing.test.js.map +1 -0
  309. package/dist/cli/__tests__/doctor-team.test.d.ts +2 -0
  310. package/dist/cli/__tests__/doctor-team.test.d.ts.map +1 -0
  311. package/dist/cli/__tests__/doctor-team.test.js +299 -0
  312. package/dist/cli/__tests__/doctor-team.test.js.map +1 -0
  313. package/dist/cli/__tests__/doctor-warning-copy.test.d.ts +2 -0
  314. package/dist/cli/__tests__/doctor-warning-copy.test.d.ts.map +1 -0
  315. package/dist/cli/__tests__/doctor-warning-copy.test.js +1312 -0
  316. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -0
  317. package/dist/cli/__tests__/error-handling-warnings.test.d.ts +2 -0
  318. package/dist/cli/__tests__/error-handling-warnings.test.d.ts.map +1 -0
  319. package/dist/cli/__tests__/error-handling-warnings.test.js +52 -0
  320. package/dist/cli/__tests__/error-handling-warnings.test.js.map +1 -0
  321. package/dist/cli/__tests__/exec.test.d.ts +2 -0
  322. package/dist/cli/__tests__/exec.test.d.ts.map +1 -0
  323. package/dist/cli/__tests__/exec.test.js +213 -0
  324. package/dist/cli/__tests__/exec.test.js.map +1 -0
  325. package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts +2 -0
  326. package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts.map +1 -0
  327. package/dist/cli/__tests__/explore-windows-diagnostics.test.js +17 -0
  328. package/dist/cli/__tests__/explore-windows-diagnostics.test.js.map +1 -0
  329. package/dist/cli/__tests__/explore.test.d.ts +2 -0
  330. package/dist/cli/__tests__/explore.test.d.ts.map +1 -0
  331. package/dist/cli/__tests__/explore.test.js +104 -0
  332. package/dist/cli/__tests__/explore.test.js.map +1 -0
  333. package/dist/cli/__tests__/hooks.test.d.ts +2 -0
  334. package/dist/cli/__tests__/hooks.test.d.ts.map +1 -0
  335. package/dist/cli/__tests__/hooks.test.js +55 -0
  336. package/dist/cli/__tests__/hooks.test.js.map +1 -0
  337. package/dist/cli/__tests__/imagegen-continuation.test.d.ts +2 -0
  338. package/dist/cli/__tests__/imagegen-continuation.test.d.ts.map +1 -0
  339. package/dist/cli/__tests__/imagegen-continuation.test.js +135 -0
  340. package/dist/cli/__tests__/imagegen-continuation.test.js.map +1 -0
  341. package/dist/cli/__tests__/index.test.d.ts +2 -0
  342. package/dist/cli/__tests__/index.test.d.ts.map +1 -0
  343. package/dist/cli/__tests__/index.test.js +3619 -0
  344. package/dist/cli/__tests__/index.test.js.map +1 -0
  345. package/dist/cli/__tests__/install-docs-contract.test.d.ts +2 -0
  346. package/dist/cli/__tests__/install-docs-contract.test.d.ts.map +1 -0
  347. package/dist/cli/__tests__/install-docs-contract.test.js +55 -0
  348. package/dist/cli/__tests__/install-docs-contract.test.js.map +1 -0
  349. package/dist/cli/__tests__/launch-fallback.test.d.ts +2 -0
  350. package/dist/cli/__tests__/launch-fallback.test.d.ts.map +1 -0
  351. package/dist/cli/__tests__/launch-fallback.test.js +1285 -0
  352. package/dist/cli/__tests__/launch-fallback.test.js.map +1 -0
  353. package/dist/cli/__tests__/lifecycle-notifications.test.d.ts +2 -0
  354. package/dist/cli/__tests__/lifecycle-notifications.test.d.ts.map +1 -0
  355. package/dist/cli/__tests__/lifecycle-notifications.test.js +48 -0
  356. package/dist/cli/__tests__/lifecycle-notifications.test.js.map +1 -0
  357. package/dist/cli/__tests__/list.test.d.ts +2 -0
  358. package/dist/cli/__tests__/list.test.d.ts.map +1 -0
  359. package/dist/cli/__tests__/list.test.js +38 -0
  360. package/dist/cli/__tests__/list.test.js.map +1 -0
  361. package/dist/cli/__tests__/mcp-parity.test.d.ts +2 -0
  362. package/dist/cli/__tests__/mcp-parity.test.d.ts.map +1 -0
  363. package/dist/cli/__tests__/mcp-parity.test.js +228 -0
  364. package/dist/cli/__tests__/mcp-parity.test.js.map +1 -0
  365. package/dist/cli/__tests__/mcp-serve.test.d.ts +2 -0
  366. package/dist/cli/__tests__/mcp-serve.test.d.ts.map +1 -0
  367. package/dist/cli/__tests__/mcp-serve.test.js +68 -0
  368. package/dist/cli/__tests__/mcp-serve.test.js.map +1 -0
  369. package/dist/cli/__tests__/native-assets.test.d.ts +2 -0
  370. package/dist/cli/__tests__/native-assets.test.d.ts.map +1 -0
  371. package/dist/cli/__tests__/native-assets.test.js +296 -0
  372. package/dist/cli/__tests__/native-assets.test.js.map +1 -0
  373. package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts +2 -0
  374. package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts.map +1 -0
  375. package/dist/cli/__tests__/native-hook-dispatch-contract.test.js +11 -0
  376. package/dist/cli/__tests__/native-hook-dispatch-contract.test.js.map +1 -0
  377. package/dist/cli/__tests__/nested-help-routing.test.d.ts +2 -0
  378. package/dist/cli/__tests__/nested-help-routing.test.d.ts.map +1 -0
  379. package/dist/cli/__tests__/nested-help-routing.test.js +63 -0
  380. package/dist/cli/__tests__/nested-help-routing.test.js.map +1 -0
  381. package/dist/cli/__tests__/package-bin-contract.test.d.ts +2 -0
  382. package/dist/cli/__tests__/package-bin-contract.test.d.ts.map +1 -0
  383. package/dist/cli/__tests__/package-bin-contract.test.js +190 -0
  384. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -0
  385. package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts +3 -0
  386. package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts.map +1 -0
  387. package/dist/cli/__tests__/packaged-explore-harness-lock.js +67 -0
  388. package/dist/cli/__tests__/packaged-explore-harness-lock.js.map +1 -0
  389. package/dist/cli/__tests__/packaged-script-resolution.test.d.ts +2 -0
  390. package/dist/cli/__tests__/packaged-script-resolution.test.d.ts.map +1 -0
  391. package/dist/cli/__tests__/packaged-script-resolution.test.js +19 -0
  392. package/dist/cli/__tests__/packaged-script-resolution.test.js.map +1 -0
  393. package/dist/cli/__tests__/performance-goal.test.d.ts +2 -0
  394. package/dist/cli/__tests__/performance-goal.test.d.ts.map +1 -0
  395. package/dist/cli/__tests__/performance-goal.test.js +144 -0
  396. package/dist/cli/__tests__/performance-goal.test.js.map +1 -0
  397. package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts +2 -0
  398. package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts.map +1 -0
  399. package/dist/cli/__tests__/prompt-skill-sanitization.test.js +48 -0
  400. package/dist/cli/__tests__/prompt-skill-sanitization.test.js.map +1 -0
  401. package/dist/cli/__tests__/question.test.d.ts +2 -0
  402. package/dist/cli/__tests__/question.test.d.ts.map +1 -0
  403. package/dist/cli/__tests__/question.test.js +850 -0
  404. package/dist/cli/__tests__/question.test.js.map +1 -0
  405. package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts +2 -0
  406. package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts.map +1 -0
  407. package/dist/cli/__tests__/ralph-deslop-contract.test.js +28 -0
  408. package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +1 -0
  409. package/dist/cli/__tests__/ralph-goal-mode-contract.test.d.ts +2 -0
  410. package/dist/cli/__tests__/ralph-goal-mode-contract.test.d.ts.map +1 -0
  411. package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +49 -0
  412. package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -0
  413. package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts +2 -0
  414. package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts.map +1 -0
  415. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +25 -0
  416. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +1 -0
  417. package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts +2 -0
  418. package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts.map +1 -0
  419. package/dist/cli/__tests__/ralph-prd-smoke.test.js +174 -0
  420. package/dist/cli/__tests__/ralph-prd-smoke.test.js.map +1 -0
  421. package/dist/cli/__tests__/ralph.test.d.ts +2 -0
  422. package/dist/cli/__tests__/ralph.test.d.ts.map +1 -0
  423. package/dist/cli/__tests__/ralph.test.js +256 -0
  424. package/dist/cli/__tests__/ralph.test.js.map +1 -0
  425. package/dist/cli/__tests__/resume.test.d.ts +2 -0
  426. package/dist/cli/__tests__/resume.test.d.ts.map +1 -0
  427. package/dist/cli/__tests__/resume.test.js +133 -0
  428. package/dist/cli/__tests__/resume.test.js.map +1 -0
  429. package/dist/cli/__tests__/session-scoped-runtime.test.d.ts +2 -0
  430. package/dist/cli/__tests__/session-scoped-runtime.test.d.ts.map +1 -0
  431. package/dist/cli/__tests__/session-scoped-runtime.test.js +247 -0
  432. package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -0
  433. package/dist/cli/__tests__/session-search-help.test.d.ts +2 -0
  434. package/dist/cli/__tests__/session-search-help.test.d.ts.map +1 -0
  435. package/dist/cli/__tests__/session-search-help.test.js +37 -0
  436. package/dist/cli/__tests__/session-search-help.test.js.map +1 -0
  437. package/dist/cli/__tests__/session-search.test.d.ts +2 -0
  438. package/dist/cli/__tests__/session-search.test.d.ts.map +1 -0
  439. package/dist/cli/__tests__/session-search.test.js +77 -0
  440. package/dist/cli/__tests__/session-search.test.js.map +1 -0
  441. package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts +2 -0
  442. package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts.map +1 -0
  443. package/dist/cli/__tests__/setup-agents-overwrite.test.js +776 -0
  444. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -0
  445. package/dist/cli/__tests__/setup-gh-star.test.d.ts +2 -0
  446. package/dist/cli/__tests__/setup-gh-star.test.d.ts.map +1 -0
  447. package/dist/cli/__tests__/setup-gh-star.test.js +67 -0
  448. package/dist/cli/__tests__/setup-gh-star.test.js.map +1 -0
  449. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts +2 -0
  450. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts.map +1 -0
  451. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +202 -0
  452. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -0
  453. package/dist/cli/__tests__/setup-install-mode.test.d.ts +2 -0
  454. package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +1 -0
  455. package/dist/cli/__tests__/setup-install-mode.test.js +2103 -0
  456. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -0
  457. package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts +2 -0
  458. package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts.map +1 -0
  459. package/dist/cli/__tests__/setup-prompts-overwrite.test.js +191 -0
  460. package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -0
  461. package/dist/cli/__tests__/setup-refresh.test.d.ts +2 -0
  462. package/dist/cli/__tests__/setup-refresh.test.d.ts.map +1 -0
  463. package/dist/cli/__tests__/setup-refresh.test.js +779 -0
  464. package/dist/cli/__tests__/setup-refresh.test.js.map +1 -0
  465. package/dist/cli/__tests__/setup-scope.test.d.ts +2 -0
  466. package/dist/cli/__tests__/setup-scope.test.d.ts.map +1 -0
  467. package/dist/cli/__tests__/setup-scope.test.js +367 -0
  468. package/dist/cli/__tests__/setup-scope.test.js.map +1 -0
  469. package/dist/cli/__tests__/setup-skill-validation.test.d.ts +2 -0
  470. package/dist/cli/__tests__/setup-skill-validation.test.d.ts.map +1 -0
  471. package/dist/cli/__tests__/setup-skill-validation.test.js +44 -0
  472. package/dist/cli/__tests__/setup-skill-validation.test.js.map +1 -0
  473. package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts +2 -0
  474. package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts.map +1 -0
  475. package/dist/cli/__tests__/setup-skills-overwrite.test.js +292 -0
  476. package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +1 -0
  477. package/dist/cli/__tests__/sidecar.test.d.ts +2 -0
  478. package/dist/cli/__tests__/sidecar.test.d.ts.map +1 -0
  479. package/dist/cli/__tests__/sidecar.test.js +24 -0
  480. package/dist/cli/__tests__/sidecar.test.js.map +1 -0
  481. package/dist/cli/__tests__/sparkshell-cli.test.d.ts +2 -0
  482. package/dist/cli/__tests__/sparkshell-cli.test.d.ts.map +1 -0
  483. package/dist/cli/__tests__/sparkshell-cli.test.js +471 -0
  484. package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -0
  485. package/dist/cli/__tests__/sparkshell-packaging.test.d.ts +2 -0
  486. package/dist/cli/__tests__/sparkshell-packaging.test.d.ts.map +1 -0
  487. package/dist/cli/__tests__/sparkshell-packaging.test.js +105 -0
  488. package/dist/cli/__tests__/sparkshell-packaging.test.js.map +1 -0
  489. package/dist/cli/__tests__/star-prompt.test.d.ts +2 -0
  490. package/dist/cli/__tests__/star-prompt.test.d.ts.map +1 -0
  491. package/dist/cli/__tests__/star-prompt.test.js +172 -0
  492. package/dist/cli/__tests__/star-prompt.test.js.map +1 -0
  493. package/dist/cli/__tests__/state.test.d.ts +2 -0
  494. package/dist/cli/__tests__/state.test.d.ts.map +1 -0
  495. package/dist/cli/__tests__/state.test.js +160 -0
  496. package/dist/cli/__tests__/state.test.js.map +1 -0
  497. package/dist/cli/__tests__/team-decompose.test.d.ts +2 -0
  498. package/dist/cli/__tests__/team-decompose.test.d.ts.map +1 -0
  499. package/dist/cli/__tests__/team-decompose.test.js +138 -0
  500. package/dist/cli/__tests__/team-decompose.test.js.map +1 -0
  501. package/dist/cli/__tests__/team.test.d.ts +2 -0
  502. package/dist/cli/__tests__/team.test.d.ts.map +1 -0
  503. package/dist/cli/__tests__/team.test.js +2897 -0
  504. package/dist/cli/__tests__/team.test.js.map +1 -0
  505. package/dist/cli/__tests__/ultragoal.test.d.ts +2 -0
  506. package/dist/cli/__tests__/ultragoal.test.d.ts.map +1 -0
  507. package/dist/cli/__tests__/ultragoal.test.js +599 -0
  508. package/dist/cli/__tests__/ultragoal.test.js.map +1 -0
  509. package/dist/cli/__tests__/uninstall.test.d.ts +2 -0
  510. package/dist/cli/__tests__/uninstall.test.d.ts.map +1 -0
  511. package/dist/cli/__tests__/uninstall.test.js +865 -0
  512. package/dist/cli/__tests__/uninstall.test.js.map +1 -0
  513. package/dist/cli/__tests__/update.test.d.ts +2 -0
  514. package/dist/cli/__tests__/update.test.d.ts.map +1 -0
  515. package/dist/cli/__tests__/update.test.js +1182 -0
  516. package/dist/cli/__tests__/update.test.js.map +1 -0
  517. package/dist/cli/__tests__/version-sync-contract.test.d.ts +2 -0
  518. package/dist/cli/__tests__/version-sync-contract.test.d.ts.map +1 -0
  519. package/dist/cli/__tests__/version-sync-contract.test.js +47 -0
  520. package/dist/cli/__tests__/version-sync-contract.test.js.map +1 -0
  521. package/dist/cli/__tests__/version.test.d.ts +2 -0
  522. package/dist/cli/__tests__/version.test.d.ts.map +1 -0
  523. package/dist/cli/__tests__/version.test.js +21 -0
  524. package/dist/cli/__tests__/version.test.js.map +1 -0
  525. package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts +2 -0
  526. package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts.map +1 -0
  527. package/dist/cli/__tests__/windows-popup-loop-contract.test.js +31 -0
  528. package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -0
  529. package/dist/cli/adapt.d.ts +6 -0
  530. package/dist/cli/adapt.d.ts.map +1 -0
  531. package/dist/cli/adapt.js +135 -0
  532. package/dist/cli/adapt.js.map +1 -0
  533. package/dist/cli/agents-init.d.ts +14 -0
  534. package/dist/cli/agents-init.d.ts.map +1 -0
  535. package/dist/cli/agents-init.js +274 -0
  536. package/dist/cli/agents-init.js.map +1 -0
  537. package/dist/cli/agents.d.ts +14 -0
  538. package/dist/cli/agents.d.ts.map +1 -0
  539. package/dist/cli/agents.js +267 -0
  540. package/dist/cli/agents.js.map +1 -0
  541. package/dist/cli/api.d.ts +26 -0
  542. package/dist/cli/api.d.ts.map +1 -0
  543. package/dist/cli/api.js +153 -0
  544. package/dist/cli/api.js.map +1 -0
  545. package/dist/cli/ask.d.ts +13 -0
  546. package/dist/cli/ask.d.ts.map +1 -0
  547. package/dist/cli/ask.js +178 -0
  548. package/dist/cli/ask.js.map +1 -0
  549. package/dist/cli/auth.d.ts +4 -0
  550. package/dist/cli/auth.d.ts.map +1 -0
  551. package/dist/cli/auth.js +113 -0
  552. package/dist/cli/auth.js.map +1 -0
  553. package/dist/cli/autoresearch-goal.d.ts +3 -0
  554. package/dist/cli/autoresearch-goal.d.ts.map +1 -0
  555. package/dist/cli/autoresearch-goal.js +175 -0
  556. package/dist/cli/autoresearch-goal.js.map +1 -0
  557. package/dist/cli/autoresearch-guided.d.ts +43 -0
  558. package/dist/cli/autoresearch-guided.d.ts.map +1 -0
  559. package/dist/cli/autoresearch-guided.js +282 -0
  560. package/dist/cli/autoresearch-guided.js.map +1 -0
  561. package/dist/cli/autoresearch-intake.d.ts +62 -0
  562. package/dist/cli/autoresearch-intake.d.ts.map +1 -0
  563. package/dist/cli/autoresearch-intake.js +336 -0
  564. package/dist/cli/autoresearch-intake.js.map +1 -0
  565. package/dist/cli/autoresearch.d.ts +16 -0
  566. package/dist/cli/autoresearch.d.ts.map +1 -0
  567. package/dist/cli/autoresearch.js +91 -0
  568. package/dist/cli/autoresearch.js.map +1 -0
  569. package/dist/cli/catalog-contract.d.ts +10 -0
  570. package/dist/cli/catalog-contract.d.ts.map +1 -0
  571. package/dist/cli/catalog-contract.js +34 -0
  572. package/dist/cli/catalog-contract.js.map +1 -0
  573. package/dist/cli/cleanup.d.ts +58 -0
  574. package/dist/cli/cleanup.d.ts.map +1 -0
  575. package/dist/cli/cleanup.js +444 -0
  576. package/dist/cli/cleanup.js.map +1 -0
  577. package/dist/cli/codex-feature-probe.d.ts +17 -0
  578. package/dist/cli/codex-feature-probe.d.ts.map +1 -0
  579. package/dist/cli/codex-feature-probe.js +50 -0
  580. package/dist/cli/codex-feature-probe.js.map +1 -0
  581. package/dist/cli/codex-home.d.ts +7 -0
  582. package/dist/cli/codex-home.d.ts.map +1 -0
  583. package/dist/cli/codex-home.js +26 -0
  584. package/dist/cli/codex-home.js.map +1 -0
  585. package/dist/cli/constants.d.ts +11 -0
  586. package/dist/cli/constants.d.ts.map +1 -0
  587. package/dist/cli/constants.js +11 -0
  588. package/dist/cli/constants.js.map +1 -0
  589. package/dist/cli/doctor.d.ts +43 -0
  590. package/dist/cli/doctor.d.ts.map +1 -0
  591. package/dist/cli/doctor.js +1956 -0
  592. package/dist/cli/doctor.js.map +1 -0
  593. package/dist/cli/explore.d.ts +14 -0
  594. package/dist/cli/explore.d.ts.map +1 -0
  595. package/dist/cli/explore.js +72 -0
  596. package/dist/cli/explore.js.map +1 -0
  597. package/dist/cli/hooks.d.ts +4 -0
  598. package/dist/cli/hooks.d.ts.map +1 -0
  599. package/dist/cli/hooks.js +201 -0
  600. package/dist/cli/hooks.js.map +1 -0
  601. package/dist/cli/index.d.ts +247 -0
  602. package/dist/cli/index.d.ts.map +1 -0
  603. package/dist/cli/index.js +4590 -0
  604. package/dist/cli/index.js.map +1 -0
  605. package/dist/cli/list.d.ts +2 -0
  606. package/dist/cli/list.d.ts.map +1 -0
  607. package/dist/cli/list.js +40 -0
  608. package/dist/cli/list.js.map +1 -0
  609. package/dist/cli/mcp-parity.d.ts +22 -0
  610. package/dist/cli/mcp-parity.d.ts.map +1 -0
  611. package/dist/cli/mcp-parity.js +251 -0
  612. package/dist/cli/mcp-parity.js.map +1 -0
  613. package/dist/cli/mcp-serve.d.ts +13 -0
  614. package/dist/cli/mcp-serve.d.ts.map +1 -0
  615. package/dist/cli/mcp-serve.js +75 -0
  616. package/dist/cli/mcp-serve.js.map +1 -0
  617. package/dist/cli/native-assets.d.ts +52 -0
  618. package/dist/cli/native-assets.d.ts.map +1 -0
  619. package/dist/cli/native-assets.js +302 -0
  620. package/dist/cli/native-assets.js.map +1 -0
  621. package/dist/cli/omx.d.ts +3 -0
  622. package/dist/cli/omx.d.ts.map +1 -0
  623. package/dist/cli/omx.js +25 -0
  624. package/dist/cli/omx.js.map +1 -0
  625. package/dist/cli/performance-goal.d.ts +3 -0
  626. package/dist/cli/performance-goal.d.ts.map +1 -0
  627. package/dist/cli/performance-goal.js +186 -0
  628. package/dist/cli/performance-goal.js.map +1 -0
  629. package/dist/cli/plugin-marketplace.d.ts +54 -0
  630. package/dist/cli/plugin-marketplace.d.ts.map +1 -0
  631. package/dist/cli/plugin-marketplace.js +369 -0
  632. package/dist/cli/plugin-marketplace.js.map +1 -0
  633. package/dist/cli/question.d.ts +3 -0
  634. package/dist/cli/question.d.ts.map +1 -0
  635. package/dist/cli/question.js +376 -0
  636. package/dist/cli/question.js.map +1 -0
  637. package/dist/cli/ralph.d.ts +17 -0
  638. package/dist/cli/ralph.d.ts.map +1 -0
  639. package/dist/cli/ralph.js +330 -0
  640. package/dist/cli/ralph.js.map +1 -0
  641. package/dist/cli/session-search.d.ts +8 -0
  642. package/dist/cli/session-search.d.ts.map +1 -0
  643. package/dist/cli/session-search.js +133 -0
  644. package/dist/cli/session-search.js.map +1 -0
  645. package/dist/cli/setup-preferences.d.ts +26 -0
  646. package/dist/cli/setup-preferences.d.ts.map +1 -0
  647. package/dist/cli/setup-preferences.js +82 -0
  648. package/dist/cli/setup-preferences.js.map +1 -0
  649. package/dist/cli/setup.d.ts +60 -0
  650. package/dist/cli/setup.d.ts.map +1 -0
  651. package/dist/cli/setup.js +2748 -0
  652. package/dist/cli/setup.js.map +1 -0
  653. package/dist/cli/sparkshell.d.ts +39 -0
  654. package/dist/cli/sparkshell.d.ts.map +1 -0
  655. package/dist/cli/sparkshell.js +299 -0
  656. package/dist/cli/sparkshell.js.map +1 -0
  657. package/dist/cli/star-prompt.d.ts +31 -0
  658. package/dist/cli/star-prompt.d.ts.map +1 -0
  659. package/dist/cli/star-prompt.js +97 -0
  660. package/dist/cli/star-prompt.js.map +1 -0
  661. package/dist/cli/state.d.ts +8 -0
  662. package/dist/cli/state.d.ts.map +1 -0
  663. package/dist/cli/state.js +149 -0
  664. package/dist/cli/state.js.map +1 -0
  665. package/dist/cli/team.d.ts +49 -0
  666. package/dist/cli/team.d.ts.map +1 -0
  667. package/dist/cli/team.js +1453 -0
  668. package/dist/cli/team.js.map +1 -0
  669. package/dist/cli/tmux-hook.d.ts +3 -0
  670. package/dist/cli/tmux-hook.d.ts.map +1 -0
  671. package/dist/cli/tmux-hook.js +403 -0
  672. package/dist/cli/tmux-hook.js.map +1 -0
  673. package/dist/cli/ultragoal.d.ts +3 -0
  674. package/dist/cli/ultragoal.d.ts.map +1 -0
  675. package/dist/cli/ultragoal.js +494 -0
  676. package/dist/cli/ultragoal.js.map +1 -0
  677. package/dist/cli/uninstall.d.ts +15 -0
  678. package/dist/cli/uninstall.d.ts.map +1 -0
  679. package/dist/cli/uninstall.js +476 -0
  680. package/dist/cli/uninstall.js.map +1 -0
  681. package/dist/cli/update.d.ts +86 -0
  682. package/dist/cli/update.d.ts.map +1 -0
  683. package/dist/cli/update.js +754 -0
  684. package/dist/cli/update.js.map +1 -0
  685. package/dist/cli/version.d.ts +2 -0
  686. package/dist/cli/version.d.ts.map +1 -0
  687. package/dist/cli/version.js +13 -0
  688. package/dist/cli/version.js.map +1 -0
  689. package/dist/compat/__tests__/doctor-contract.test.d.ts +2 -0
  690. package/dist/compat/__tests__/doctor-contract.test.d.ts.map +1 -0
  691. package/dist/compat/__tests__/doctor-contract.test.js +122 -0
  692. package/dist/compat/__tests__/doctor-contract.test.js.map +1 -0
  693. package/dist/compat/__tests__/rust-runtime-compat.test.d.ts +2 -0
  694. package/dist/compat/__tests__/rust-runtime-compat.test.d.ts.map +1 -0
  695. package/dist/compat/__tests__/rust-runtime-compat.test.js +218 -0
  696. package/dist/compat/__tests__/rust-runtime-compat.test.js.map +1 -0
  697. package/dist/config/__tests__/codex-feature-flags.test.d.ts +2 -0
  698. package/dist/config/__tests__/codex-feature-flags.test.d.ts.map +1 -0
  699. package/dist/config/__tests__/codex-feature-flags.test.js +45 -0
  700. package/dist/config/__tests__/codex-feature-flags.test.js.map +1 -0
  701. package/dist/config/__tests__/codex-hooks.test.d.ts +2 -0
  702. package/dist/config/__tests__/codex-hooks.test.d.ts.map +1 -0
  703. package/dist/config/__tests__/codex-hooks.test.js +524 -0
  704. package/dist/config/__tests__/codex-hooks.test.js.map +1 -0
  705. package/dist/config/__tests__/commit-lore-guard.test.d.ts +2 -0
  706. package/dist/config/__tests__/commit-lore-guard.test.d.ts.map +1 -0
  707. package/dist/config/__tests__/commit-lore-guard.test.js +20 -0
  708. package/dist/config/__tests__/commit-lore-guard.test.js.map +1 -0
  709. package/dist/config/__tests__/deep-interview.test.d.ts +2 -0
  710. package/dist/config/__tests__/deep-interview.test.d.ts.map +1 -0
  711. package/dist/config/__tests__/deep-interview.test.js +240 -0
  712. package/dist/config/__tests__/deep-interview.test.js.map +1 -0
  713. package/dist/config/__tests__/generator-idempotent.test.d.ts +2 -0
  714. package/dist/config/__tests__/generator-idempotent.test.d.ts.map +1 -0
  715. package/dist/config/__tests__/generator-idempotent.test.js +1150 -0
  716. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -0
  717. package/dist/config/__tests__/generator-notify.test.d.ts +2 -0
  718. package/dist/config/__tests__/generator-notify.test.d.ts.map +1 -0
  719. package/dist/config/__tests__/generator-notify.test.js +512 -0
  720. package/dist/config/__tests__/generator-notify.test.js.map +1 -0
  721. package/dist/config/__tests__/generator-status-line-presets.test.d.ts +2 -0
  722. package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +1 -0
  723. package/dist/config/__tests__/generator-status-line-presets.test.js +203 -0
  724. package/dist/config/__tests__/generator-status-line-presets.test.js.map +1 -0
  725. package/dist/config/__tests__/mcp-registry.test.d.ts +2 -0
  726. package/dist/config/__tests__/mcp-registry.test.d.ts.map +1 -0
  727. package/dist/config/__tests__/mcp-registry.test.js +190 -0
  728. package/dist/config/__tests__/mcp-registry.test.js.map +1 -0
  729. package/dist/config/__tests__/models.test.d.ts +2 -0
  730. package/dist/config/__tests__/models.test.d.ts.map +1 -0
  731. package/dist/config/__tests__/models.test.js +241 -0
  732. package/dist/config/__tests__/models.test.js.map +1 -0
  733. package/dist/config/__tests__/wiki-config-contract.test.d.ts +2 -0
  734. package/dist/config/__tests__/wiki-config-contract.test.d.ts.map +1 -0
  735. package/dist/config/__tests__/wiki-config-contract.test.js +23 -0
  736. package/dist/config/__tests__/wiki-config-contract.test.js.map +1 -0
  737. package/dist/config/codex-feature-flags.d.ts +25 -0
  738. package/dist/config/codex-feature-flags.d.ts.map +1 -0
  739. package/dist/config/codex-feature-flags.js +60 -0
  740. package/dist/config/codex-feature-flags.js.map +1 -0
  741. package/dist/config/codex-hooks.d.ts +79 -0
  742. package/dist/config/codex-hooks.d.ts.map +1 -0
  743. package/dist/config/codex-hooks.js +578 -0
  744. package/dist/config/codex-hooks.js.map +1 -0
  745. package/dist/config/commit-lore-guard.d.ts +4 -0
  746. package/dist/config/commit-lore-guard.d.ts.map +1 -0
  747. package/dist/config/commit-lore-guard.js +35 -0
  748. package/dist/config/commit-lore-guard.js.map +1 -0
  749. package/dist/config/deep-interview.d.ts +22 -0
  750. package/dist/config/deep-interview.d.ts.map +1 -0
  751. package/dist/config/deep-interview.js +161 -0
  752. package/dist/config/deep-interview.js.map +1 -0
  753. package/dist/config/generator.d.ts +141 -0
  754. package/dist/config/generator.d.ts.map +1 -0
  755. package/dist/config/generator.js +1845 -0
  756. package/dist/config/generator.js.map +1 -0
  757. package/dist/config/mcp-registry.d.ts +35 -0
  758. package/dist/config/mcp-registry.d.ts.map +1 -0
  759. package/dist/config/mcp-registry.js +159 -0
  760. package/dist/config/mcp-registry.js.map +1 -0
  761. package/dist/config/models.d.ts +80 -0
  762. package/dist/config/models.d.ts.map +1 -0
  763. package/dist/config/models.js +251 -0
  764. package/dist/config/models.js.map +1 -0
  765. package/dist/config/omx-first-party-mcp.d.ts +21 -0
  766. package/dist/config/omx-first-party-mcp.d.ts.map +1 -0
  767. package/dist/config/omx-first-party-mcp.js +86 -0
  768. package/dist/config/omx-first-party-mcp.js.map +1 -0
  769. package/dist/config/team-mode.d.ts +12 -0
  770. package/dist/config/team-mode.d.ts.map +1 -0
  771. package/dist/config/team-mode.js +91 -0
  772. package/dist/config/team-mode.js.map +1 -0
  773. package/dist/document-refresh/__tests__/enforcer.test.d.ts +2 -0
  774. package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +1 -0
  775. package/dist/document-refresh/__tests__/enforcer.test.js +128 -0
  776. package/dist/document-refresh/__tests__/enforcer.test.js.map +1 -0
  777. package/dist/document-refresh/config.d.ts +9 -0
  778. package/dist/document-refresh/config.d.ts.map +1 -0
  779. package/dist/document-refresh/config.js +70 -0
  780. package/dist/document-refresh/config.js.map +1 -0
  781. package/dist/document-refresh/enforcer.d.ts +43 -0
  782. package/dist/document-refresh/enforcer.d.ts.map +1 -0
  783. package/dist/document-refresh/enforcer.js +329 -0
  784. package/dist/document-refresh/enforcer.js.map +1 -0
  785. package/dist/exec/followup.d.ts +45 -0
  786. package/dist/exec/followup.d.ts.map +1 -0
  787. package/dist/exec/followup.js +355 -0
  788. package/dist/exec/followup.js.map +1 -0
  789. package/dist/goal-workflows/__tests__/artifacts.test.d.ts +2 -0
  790. package/dist/goal-workflows/__tests__/artifacts.test.d.ts.map +1 -0
  791. package/dist/goal-workflows/__tests__/artifacts.test.js +96 -0
  792. package/dist/goal-workflows/__tests__/artifacts.test.js.map +1 -0
  793. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.d.ts +2 -0
  794. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.d.ts.map +1 -0
  795. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +75 -0
  796. package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -0
  797. package/dist/goal-workflows/artifacts.d.ts +62 -0
  798. package/dist/goal-workflows/artifacts.d.ts.map +1 -0
  799. package/dist/goal-workflows/artifacts.js +132 -0
  800. package/dist/goal-workflows/artifacts.js.map +1 -0
  801. package/dist/goal-workflows/codex-goal-snapshot.d.ts +32 -0
  802. package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -0
  803. package/dist/goal-workflows/codex-goal-snapshot.js +157 -0
  804. package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -0
  805. package/dist/goal-workflows/handoff.d.ts +10 -0
  806. package/dist/goal-workflows/handoff.d.ts.map +1 -0
  807. package/dist/goal-workflows/handoff.js +31 -0
  808. package/dist/goal-workflows/handoff.js.map +1 -0
  809. package/dist/goal-workflows/validation.d.ts +13 -0
  810. package/dist/goal-workflows/validation.d.ts.map +1 -0
  811. package/dist/goal-workflows/validation.js +36 -0
  812. package/dist/goal-workflows/validation.js.map +1 -0
  813. package/dist/hooks/__tests__/agents-overlay.test.d.ts +8 -0
  814. package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +1 -0
  815. package/dist/hooks/__tests__/agents-overlay.test.js +761 -0
  816. package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -0
  817. package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts +2 -0
  818. package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts.map +1 -0
  819. package/dist/hooks/__tests__/analyze-routing-contract.test.js +45 -0
  820. package/dist/hooks/__tests__/analyze-routing-contract.test.js.map +1 -0
  821. package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts +2 -0
  822. package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts.map +1 -0
  823. package/dist/hooks/__tests__/analyze-skill-contract.test.js +48 -0
  824. package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +1 -0
  825. package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts +2 -0
  826. package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts.map +1 -0
  827. package/dist/hooks/__tests__/anti-slop-workflow.test.js +165 -0
  828. package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -0
  829. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts +2 -0
  830. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts.map +1 -0
  831. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +90 -0
  832. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -0
  833. package/dist/hooks/__tests__/best-practice-research-skill.test.d.ts +2 -0
  834. package/dist/hooks/__tests__/best-practice-research-skill.test.d.ts.map +1 -0
  835. package/dist/hooks/__tests__/best-practice-research-skill.test.js +39 -0
  836. package/dist/hooks/__tests__/best-practice-research-skill.test.js.map +1 -0
  837. package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts +2 -0
  838. package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts.map +1 -0
  839. package/dist/hooks/__tests__/clawhip-event-contract.test.js +37 -0
  840. package/dist/hooks/__tests__/clawhip-event-contract.test.js.map +1 -0
  841. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts +2 -0
  842. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts.map +1 -0
  843. package/dist/hooks/__tests__/code-review-skill-contract.test.js +77 -0
  844. package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -0
  845. package/dist/hooks/__tests__/codebase-map.test.d.ts +8 -0
  846. package/dist/hooks/__tests__/codebase-map.test.d.ts.map +1 -0
  847. package/dist/hooks/__tests__/codebase-map.test.js +218 -0
  848. package/dist/hooks/__tests__/codebase-map.test.js.map +1 -0
  849. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +18 -0
  850. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +1 -0
  851. package/dist/hooks/__tests__/consensus-execution-handoff.test.js +266 -0
  852. package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -0
  853. package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts +2 -0
  854. package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts.map +1 -0
  855. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js +20 -0
  856. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js.map +1 -0
  857. package/dist/hooks/__tests__/deep-interview-contract.test.d.ts +2 -0
  858. package/dist/hooks/__tests__/deep-interview-contract.test.d.ts.map +1 -0
  859. package/dist/hooks/__tests__/deep-interview-contract.test.js +309 -0
  860. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -0
  861. package/dist/hooks/__tests__/design-skill.test.d.ts +2 -0
  862. package/dist/hooks/__tests__/design-skill.test.d.ts.map +1 -0
  863. package/dist/hooks/__tests__/design-skill.test.js +55 -0
  864. package/dist/hooks/__tests__/design-skill.test.js.map +1 -0
  865. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts +2 -0
  866. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts.map +1 -0
  867. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js +43 -0
  868. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js.map +1 -0
  869. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts +2 -0
  870. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts.map +1 -0
  871. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js +38 -0
  872. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js.map +1 -0
  873. package/dist/hooks/__tests__/explore-routing.test.d.ts +2 -0
  874. package/dist/hooks/__tests__/explore-routing.test.d.ts.map +1 -0
  875. package/dist/hooks/__tests__/explore-routing.test.js +38 -0
  876. package/dist/hooks/__tests__/explore-routing.test.js.map +1 -0
  877. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts +2 -0
  878. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts.map +1 -0
  879. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +67 -0
  880. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +1 -0
  881. package/dist/hooks/__tests__/foreground-isolation-contract.test.d.ts +2 -0
  882. package/dist/hooks/__tests__/foreground-isolation-contract.test.d.ts.map +1 -0
  883. package/dist/hooks/__tests__/foreground-isolation-contract.test.js +28 -0
  884. package/dist/hooks/__tests__/foreground-isolation-contract.test.js.map +1 -0
  885. package/dist/hooks/__tests__/keyword-detector.test.d.ts +2 -0
  886. package/dist/hooks/__tests__/keyword-detector.test.d.ts.map +1 -0
  887. package/dist/hooks/__tests__/keyword-detector.test.js +3323 -0
  888. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -0
  889. package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts +2 -0
  890. package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts.map +1 -0
  891. package/dist/hooks/__tests__/notify-fallback-watcher.test.js +3956 -0
  892. package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -0
  893. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts +2 -0
  894. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts.map +1 -0
  895. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +786 -0
  896. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -0
  897. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts +2 -0
  898. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts.map +1 -0
  899. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +2602 -0
  900. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -0
  901. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts +2 -0
  902. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts.map +1 -0
  903. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +161 -0
  904. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -0
  905. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts +2 -0
  906. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts.map +1 -0
  907. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +1178 -0
  908. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -0
  909. package/dist/hooks/__tests__/notify-hook-modules.test.d.ts +9 -0
  910. package/dist/hooks/__tests__/notify-hook-modules.test.d.ts.map +1 -0
  911. package/dist/hooks/__tests__/notify-hook-modules.test.js +529 -0
  912. package/dist/hooks/__tests__/notify-hook-modules.test.js.map +1 -0
  913. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts +2 -0
  914. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts.map +1 -0
  915. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js +14 -0
  916. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js.map +1 -0
  917. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts +2 -0
  918. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts.map +1 -0
  919. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js +176 -0
  920. package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js.map +1 -0
  921. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts +2 -0
  922. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts.map +1 -0
  923. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +890 -0
  924. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -0
  925. package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts +9 -0
  926. package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts.map +1 -0
  927. package/dist/hooks/__tests__/notify-hook-regression-205.test.js +255 -0
  928. package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -0
  929. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts +2 -0
  930. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts.map +1 -0
  931. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js +162 -0
  932. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js.map +1 -0
  933. package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts +2 -0
  934. package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts.map +1 -0
  935. package/dist/hooks/__tests__/notify-hook-session-scope.test.js +304 -0
  936. package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -0
  937. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts +2 -0
  938. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts.map +1 -0
  939. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +1511 -0
  940. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -0
  941. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts +2 -0
  942. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts.map +1 -0
  943. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +2911 -0
  944. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -0
  945. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts +2 -0
  946. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts.map +1 -0
  947. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +261 -0
  948. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +1 -0
  949. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +2 -0
  950. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +1 -0
  951. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +35 -0
  952. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -0
  953. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts +2 -0
  954. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts.map +1 -0
  955. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +1854 -0
  956. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +1 -0
  957. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts +10 -0
  958. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts.map +1 -0
  959. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +0 -0
  960. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +1 -0
  961. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts +11 -0
  962. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts.map +1 -0
  963. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js +266 -0
  964. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js.map +1 -0
  965. package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts +2 -0
  966. package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts.map +1 -0
  967. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +895 -0
  968. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -0
  969. package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts +2 -0
  970. package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts.map +1 -0
  971. package/dist/hooks/__tests__/openclaw-setup-contract.test.js +61 -0
  972. package/dist/hooks/__tests__/openclaw-setup-contract.test.js.map +1 -0
  973. package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts +2 -0
  974. package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts.map +1 -0
  975. package/dist/hooks/__tests__/pre-context-gate-skills.test.js +40 -0
  976. package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -0
  977. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts +2 -0
  978. package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts.map +1 -0
  979. package/dist/hooks/__tests__/prometheus-strict-contract.test.js +320 -0
  980. package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +1 -0
  981. package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts +2 -0
  982. package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts.map +1 -0
  983. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js +11 -0
  984. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js.map +1 -0
  985. package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts +2 -0
  986. package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts.map +1 -0
  987. package/dist/hooks/__tests__/prompt-guidance-contract.test.js +38 -0
  988. package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -0
  989. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts +2 -0
  990. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts.map +1 -0
  991. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +48 -0
  992. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -0
  993. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts +2 -0
  994. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts.map +1 -0
  995. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js +11 -0
  996. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js.map +1 -0
  997. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +5 -0
  998. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +1 -0
  999. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +34 -0
  1000. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -0
  1001. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts +2 -0
  1002. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts.map +1 -0
  1003. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +81 -0
  1004. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -0
  1005. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts +2 -0
  1006. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts.map +1 -0
  1007. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +38 -0
  1008. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +1 -0
  1009. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +2 -0
  1010. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +1 -0
  1011. package/dist/hooks/__tests__/prompt-refactor-contract.test.js +22 -0
  1012. package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +1 -0
  1013. package/dist/hooks/__tests__/prompt-team-routing.test.d.ts +2 -0
  1014. package/dist/hooks/__tests__/prompt-team-routing.test.d.ts.map +1 -0
  1015. package/dist/hooks/__tests__/prompt-team-routing.test.js +49 -0
  1016. package/dist/hooks/__tests__/prompt-team-routing.test.js.map +1 -0
  1017. package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts +2 -0
  1018. package/dist/hooks/__tests__/research-workflow-boundaries.test.d.ts.map +1 -0
  1019. package/dist/hooks/__tests__/research-workflow-boundaries.test.js +35 -0
  1020. package/dist/hooks/__tests__/research-workflow-boundaries.test.js.map +1 -0
  1021. package/dist/hooks/__tests__/session.test.d.ts +2 -0
  1022. package/dist/hooks/__tests__/session.test.d.ts.map +1 -0
  1023. package/dist/hooks/__tests__/session.test.js +504 -0
  1024. package/dist/hooks/__tests__/session.test.js.map +1 -0
  1025. package/dist/hooks/__tests__/skill-catalog-hygiene.test.d.ts +2 -0
  1026. package/dist/hooks/__tests__/skill-catalog-hygiene.test.d.ts.map +1 -0
  1027. package/dist/hooks/__tests__/skill-catalog-hygiene.test.js +84 -0
  1028. package/dist/hooks/__tests__/skill-catalog-hygiene.test.js.map +1 -0
  1029. package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts +2 -0
  1030. package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts.map +1 -0
  1031. package/dist/hooks/__tests__/skill-guidance-contract.test.js +89 -0
  1032. package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -0
  1033. package/dist/hooks/__tests__/task-size-detector.test.d.ts +2 -0
  1034. package/dist/hooks/__tests__/task-size-detector.test.d.ts.map +1 -0
  1035. package/dist/hooks/__tests__/task-size-detector.test.js +330 -0
  1036. package/dist/hooks/__tests__/task-size-detector.test.js.map +1 -0
  1037. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +2 -0
  1038. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +1 -0
  1039. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +28 -0
  1040. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -0
  1041. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts +2 -0
  1042. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts.map +1 -0
  1043. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js +24 -0
  1044. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js.map +1 -0
  1045. package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts +2 -0
  1046. package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts.map +1 -0
  1047. package/dist/hooks/__tests__/tmux-hook-engine.test.js +403 -0
  1048. package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +1 -0
  1049. package/dist/hooks/__tests__/triage-config.test.d.ts +2 -0
  1050. package/dist/hooks/__tests__/triage-config.test.d.ts.map +1 -0
  1051. package/dist/hooks/__tests__/triage-config.test.js +211 -0
  1052. package/dist/hooks/__tests__/triage-config.test.js.map +1 -0
  1053. package/dist/hooks/__tests__/triage-heuristic.test.d.ts +2 -0
  1054. package/dist/hooks/__tests__/triage-heuristic.test.d.ts.map +1 -0
  1055. package/dist/hooks/__tests__/triage-heuristic.test.js +285 -0
  1056. package/dist/hooks/__tests__/triage-heuristic.test.js.map +1 -0
  1057. package/dist/hooks/__tests__/triage-state.test.d.ts +2 -0
  1058. package/dist/hooks/__tests__/triage-state.test.d.ts.map +1 -0
  1059. package/dist/hooks/__tests__/triage-state.test.js +426 -0
  1060. package/dist/hooks/__tests__/triage-state.test.js.map +1 -0
  1061. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +2 -0
  1062. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +1 -0
  1063. package/dist/hooks/__tests__/visual-ralph-skill.test.js +44 -0
  1064. package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -0
  1065. package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts +2 -0
  1066. package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts.map +1 -0
  1067. package/dist/hooks/__tests__/visual-verdict-loop.test.js +31 -0
  1068. package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +1 -0
  1069. package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts +2 -0
  1070. package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts.map +1 -0
  1071. package/dist/hooks/__tests__/wiki-docs-contract.test.js +35 -0
  1072. package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +1 -0
  1073. package/dist/hooks/agents-overlay.d.ts +51 -0
  1074. package/dist/hooks/agents-overlay.d.ts.map +1 -0
  1075. package/dist/hooks/agents-overlay.js +547 -0
  1076. package/dist/hooks/agents-overlay.js.map +1 -0
  1077. package/dist/hooks/code-simplifier/__tests__/index.test.d.ts +2 -0
  1078. package/dist/hooks/code-simplifier/__tests__/index.test.d.ts.map +1 -0
  1079. package/dist/hooks/code-simplifier/__tests__/index.test.js +187 -0
  1080. package/dist/hooks/code-simplifier/__tests__/index.test.js.map +1 -0
  1081. package/dist/hooks/code-simplifier/index.d.ts +80 -0
  1082. package/dist/hooks/code-simplifier/index.d.ts.map +1 -0
  1083. package/dist/hooks/code-simplifier/index.js +172 -0
  1084. package/dist/hooks/code-simplifier/index.js.map +1 -0
  1085. package/dist/hooks/codebase-map.d.ts +23 -0
  1086. package/dist/hooks/codebase-map.d.ts.map +1 -0
  1087. package/dist/hooks/codebase-map.js +234 -0
  1088. package/dist/hooks/codebase-map.js.map +1 -0
  1089. package/dist/hooks/deep-interview-config-instruction.d.ts +3 -0
  1090. package/dist/hooks/deep-interview-config-instruction.d.ts.map +1 -0
  1091. package/dist/hooks/deep-interview-config-instruction.js +47 -0
  1092. package/dist/hooks/deep-interview-config-instruction.js.map +1 -0
  1093. package/dist/hooks/explore-routing.d.ts +5 -0
  1094. package/dist/hooks/explore-routing.d.ts.map +1 -0
  1095. package/dist/hooks/explore-routing.js +37 -0
  1096. package/dist/hooks/explore-routing.js.map +1 -0
  1097. package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts +2 -0
  1098. package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts.map +1 -0
  1099. package/dist/hooks/extensibility/__tests__/dispatcher.test.js +265 -0
  1100. package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -0
  1101. package/dist/hooks/extensibility/__tests__/events.test.d.ts +2 -0
  1102. package/dist/hooks/extensibility/__tests__/events.test.d.ts.map +1 -0
  1103. package/dist/hooks/extensibility/__tests__/events.test.js +125 -0
  1104. package/dist/hooks/extensibility/__tests__/events.test.js.map +1 -0
  1105. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts +2 -0
  1106. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts.map +1 -0
  1107. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js +153 -0
  1108. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js.map +1 -0
  1109. package/dist/hooks/extensibility/__tests__/loader.test.d.ts +2 -0
  1110. package/dist/hooks/extensibility/__tests__/loader.test.d.ts.map +1 -0
  1111. package/dist/hooks/extensibility/__tests__/loader.test.js +254 -0
  1112. package/dist/hooks/extensibility/__tests__/loader.test.js.map +1 -0
  1113. package/dist/hooks/extensibility/__tests__/logging.test.d.ts +2 -0
  1114. package/dist/hooks/extensibility/__tests__/logging.test.d.ts.map +1 -0
  1115. package/dist/hooks/extensibility/__tests__/logging.test.js +74 -0
  1116. package/dist/hooks/extensibility/__tests__/logging.test.js.map +1 -0
  1117. package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts +2 -0
  1118. package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts.map +1 -0
  1119. package/dist/hooks/extensibility/__tests__/plugin-runner.test.js +344 -0
  1120. package/dist/hooks/extensibility/__tests__/plugin-runner.test.js.map +1 -0
  1121. package/dist/hooks/extensibility/__tests__/runtime.test.d.ts +2 -0
  1122. package/dist/hooks/extensibility/__tests__/runtime.test.d.ts.map +1 -0
  1123. package/dist/hooks/extensibility/__tests__/runtime.test.js +198 -0
  1124. package/dist/hooks/extensibility/__tests__/runtime.test.js.map +1 -0
  1125. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts +2 -0
  1126. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts.map +1 -0
  1127. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js +32 -0
  1128. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js.map +1 -0
  1129. package/dist/hooks/extensibility/__tests__/sdk.test.d.ts +2 -0
  1130. package/dist/hooks/extensibility/__tests__/sdk.test.d.ts.map +1 -0
  1131. package/dist/hooks/extensibility/__tests__/sdk.test.js +479 -0
  1132. package/dist/hooks/extensibility/__tests__/sdk.test.js.map +1 -0
  1133. package/dist/hooks/extensibility/dispatcher.d.ts +4 -0
  1134. package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -0
  1135. package/dist/hooks/extensibility/dispatcher.js +302 -0
  1136. package/dist/hooks/extensibility/dispatcher.js.map +1 -0
  1137. package/dist/hooks/extensibility/events.d.ts +18 -0
  1138. package/dist/hooks/extensibility/events.d.ts.map +1 -0
  1139. package/dist/hooks/extensibility/events.js +53 -0
  1140. package/dist/hooks/extensibility/events.js.map +1 -0
  1141. package/dist/hooks/extensibility/index.d.ts +6 -0
  1142. package/dist/hooks/extensibility/index.d.ts.map +1 -0
  1143. package/dist/hooks/extensibility/index.js +6 -0
  1144. package/dist/hooks/extensibility/index.js.map +1 -0
  1145. package/dist/hooks/extensibility/loader.d.ts +14 -0
  1146. package/dist/hooks/extensibility/loader.d.ts.map +1 -0
  1147. package/dist/hooks/extensibility/loader.js +117 -0
  1148. package/dist/hooks/extensibility/loader.js.map +1 -0
  1149. package/dist/hooks/extensibility/logging.d.ts +4 -0
  1150. package/dist/hooks/extensibility/logging.d.ts.map +1 -0
  1151. package/dist/hooks/extensibility/logging.js +22 -0
  1152. package/dist/hooks/extensibility/logging.js.map +1 -0
  1153. package/dist/hooks/extensibility/plugin-runner-stdin.d.ts +2 -0
  1154. package/dist/hooks/extensibility/plugin-runner-stdin.d.ts.map +1 -0
  1155. package/dist/hooks/extensibility/plugin-runner-stdin.js +16 -0
  1156. package/dist/hooks/extensibility/plugin-runner-stdin.js.map +1 -0
  1157. package/dist/hooks/extensibility/plugin-runner.d.ts +2 -0
  1158. package/dist/hooks/extensibility/plugin-runner.d.ts.map +1 -0
  1159. package/dist/hooks/extensibility/plugin-runner.js +63 -0
  1160. package/dist/hooks/extensibility/plugin-runner.js.map +1 -0
  1161. package/dist/hooks/extensibility/runtime.d.ts +3 -0
  1162. package/dist/hooks/extensibility/runtime.d.ts.map +1 -0
  1163. package/dist/hooks/extensibility/runtime.js +42 -0
  1164. package/dist/hooks/extensibility/runtime.js.map +1 -0
  1165. package/dist/hooks/extensibility/sdk/logging.d.ts +6 -0
  1166. package/dist/hooks/extensibility/sdk/logging.d.ts.map +1 -0
  1167. package/dist/hooks/extensibility/sdk/logging.js +32 -0
  1168. package/dist/hooks/extensibility/sdk/logging.js.map +1 -0
  1169. package/dist/hooks/extensibility/sdk/paths.d.ts +7 -0
  1170. package/dist/hooks/extensibility/sdk/paths.d.ts.map +1 -0
  1171. package/dist/hooks/extensibility/sdk/paths.js +23 -0
  1172. package/dist/hooks/extensibility/sdk/paths.js.map +1 -0
  1173. package/dist/hooks/extensibility/sdk/plugin-state.d.ts +5 -0
  1174. package/dist/hooks/extensibility/sdk/plugin-state.d.ts.map +1 -0
  1175. package/dist/hooks/extensibility/sdk/plugin-state.js +66 -0
  1176. package/dist/hooks/extensibility/sdk/plugin-state.js.map +1 -0
  1177. package/dist/hooks/extensibility/sdk/runtime-state.d.ts +3 -0
  1178. package/dist/hooks/extensibility/sdk/runtime-state.d.ts.map +1 -0
  1179. package/dist/hooks/extensibility/sdk/runtime-state.js +47 -0
  1180. package/dist/hooks/extensibility/sdk/runtime-state.js.map +1 -0
  1181. package/dist/hooks/extensibility/sdk/tmux.d.ts +10 -0
  1182. package/dist/hooks/extensibility/sdk/tmux.d.ts.map +1 -0
  1183. package/dist/hooks/extensibility/sdk/tmux.js +181 -0
  1184. package/dist/hooks/extensibility/sdk/tmux.js.map +1 -0
  1185. package/dist/hooks/extensibility/sdk.d.ts +11 -0
  1186. package/dist/hooks/extensibility/sdk.d.ts.map +1 -0
  1187. package/dist/hooks/extensibility/sdk.js +21 -0
  1188. package/dist/hooks/extensibility/sdk.js.map +1 -0
  1189. package/dist/hooks/extensibility/types.d.ts +175 -0
  1190. package/dist/hooks/extensibility/types.d.ts.map +1 -0
  1191. package/dist/hooks/extensibility/types.js +2 -0
  1192. package/dist/hooks/extensibility/types.js.map +1 -0
  1193. package/dist/hooks/keyword-detector.d.ts +170 -0
  1194. package/dist/hooks/keyword-detector.d.ts.map +1 -0
  1195. package/dist/hooks/keyword-detector.js +1363 -0
  1196. package/dist/hooks/keyword-detector.js.map +1 -0
  1197. package/dist/hooks/keyword-registry.d.ts +15 -0
  1198. package/dist/hooks/keyword-registry.d.ts.map +1 -0
  1199. package/dist/hooks/keyword-registry.js +56 -0
  1200. package/dist/hooks/keyword-registry.js.map +1 -0
  1201. package/dist/hooks/prompt-guidance-contract.d.ts +20 -0
  1202. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -0
  1203. package/dist/hooks/prompt-guidance-contract.js +380 -0
  1204. package/dist/hooks/prompt-guidance-contract.js.map +1 -0
  1205. package/dist/hooks/session.d.ts +83 -0
  1206. package/dist/hooks/session.d.ts.map +1 -0
  1207. package/dist/hooks/session.js +412 -0
  1208. package/dist/hooks/session.js.map +1 -0
  1209. package/dist/hooks/task-size-detector.d.ts +72 -0
  1210. package/dist/hooks/task-size-detector.d.ts.map +1 -0
  1211. package/dist/hooks/task-size-detector.js +203 -0
  1212. package/dist/hooks/task-size-detector.js.map +1 -0
  1213. package/dist/hooks/triage-config.d.ts +33 -0
  1214. package/dist/hooks/triage-config.d.ts.map +1 -0
  1215. package/dist/hooks/triage-config.js +87 -0
  1216. package/dist/hooks/triage-config.js.map +1 -0
  1217. package/dist/hooks/triage-heuristic.d.ts +20 -0
  1218. package/dist/hooks/triage-heuristic.d.ts.map +1 -0
  1219. package/dist/hooks/triage-heuristic.js +287 -0
  1220. package/dist/hooks/triage-heuristic.js.map +1 -0
  1221. package/dist/hooks/triage-state.d.ts +63 -0
  1222. package/dist/hooks/triage-state.d.ts.map +1 -0
  1223. package/dist/hooks/triage-state.js +139 -0
  1224. package/dist/hooks/triage-state.js.map +1 -0
  1225. package/dist/hud/__tests__/authority.test.d.ts +2 -0
  1226. package/dist/hud/__tests__/authority.test.d.ts.map +1 -0
  1227. package/dist/hud/__tests__/authority.test.js +527 -0
  1228. package/dist/hud/__tests__/authority.test.js.map +1 -0
  1229. package/dist/hud/__tests__/colors.test.d.ts +2 -0
  1230. package/dist/hud/__tests__/colors.test.d.ts.map +1 -0
  1231. package/dist/hud/__tests__/colors.test.js +92 -0
  1232. package/dist/hud/__tests__/colors.test.js.map +1 -0
  1233. package/dist/hud/__tests__/hud-tmux-injection.test.d.ts +10 -0
  1234. package/dist/hud/__tests__/hud-tmux-injection.test.d.ts.map +1 -0
  1235. package/dist/hud/__tests__/hud-tmux-injection.test.js +185 -0
  1236. package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -0
  1237. package/dist/hud/__tests__/index.test.d.ts +2 -0
  1238. package/dist/hud/__tests__/index.test.d.ts.map +1 -0
  1239. package/dist/hud/__tests__/index.test.js +684 -0
  1240. package/dist/hud/__tests__/index.test.js.map +1 -0
  1241. package/dist/hud/__tests__/reconcile.test.d.ts +2 -0
  1242. package/dist/hud/__tests__/reconcile.test.d.ts.map +1 -0
  1243. package/dist/hud/__tests__/reconcile.test.js +1621 -0
  1244. package/dist/hud/__tests__/reconcile.test.js.map +1 -0
  1245. package/dist/hud/__tests__/render.test.d.ts +2 -0
  1246. package/dist/hud/__tests__/render.test.d.ts.map +1 -0
  1247. package/dist/hud/__tests__/render.test.js +983 -0
  1248. package/dist/hud/__tests__/render.test.js.map +1 -0
  1249. package/dist/hud/__tests__/resource-leak-watch.test.d.ts +2 -0
  1250. package/dist/hud/__tests__/resource-leak-watch.test.d.ts.map +1 -0
  1251. package/dist/hud/__tests__/resource-leak-watch.test.js +28 -0
  1252. package/dist/hud/__tests__/resource-leak-watch.test.js.map +1 -0
  1253. package/dist/hud/__tests__/state.test.d.ts +2 -0
  1254. package/dist/hud/__tests__/state.test.d.ts.map +1 -0
  1255. package/dist/hud/__tests__/state.test.js +1212 -0
  1256. package/dist/hud/__tests__/state.test.js.map +1 -0
  1257. package/dist/hud/__tests__/tmux.test.d.ts +2 -0
  1258. package/dist/hud/__tests__/tmux.test.d.ts.map +1 -0
  1259. package/dist/hud/__tests__/tmux.test.js +679 -0
  1260. package/dist/hud/__tests__/tmux.test.js.map +1 -0
  1261. package/dist/hud/__tests__/types.test.d.ts +2 -0
  1262. package/dist/hud/__tests__/types.test.d.ts.map +1 -0
  1263. package/dist/hud/__tests__/types.test.js +79 -0
  1264. package/dist/hud/__tests__/types.test.js.map +1 -0
  1265. package/dist/hud/__tests__/watch.test.d.ts +2 -0
  1266. package/dist/hud/__tests__/watch.test.d.ts.map +1 -0
  1267. package/dist/hud/__tests__/watch.test.js +63 -0
  1268. package/dist/hud/__tests__/watch.test.js.map +1 -0
  1269. package/dist/hud/authority.d.ts +22 -0
  1270. package/dist/hud/authority.d.ts.map +1 -0
  1271. package/dist/hud/authority.js +377 -0
  1272. package/dist/hud/authority.js.map +1 -0
  1273. package/dist/hud/colors.d.ts +20 -0
  1274. package/dist/hud/colors.d.ts.map +1 -0
  1275. package/dist/hud/colors.js +60 -0
  1276. package/dist/hud/colors.js.map +1 -0
  1277. package/dist/hud/constants.d.ts +16 -0
  1278. package/dist/hud/constants.d.ts.map +1 -0
  1279. package/dist/hud/constants.js +25 -0
  1280. package/dist/hud/constants.js.map +1 -0
  1281. package/dist/hud/index.d.ts +79 -0
  1282. package/dist/hud/index.d.ts.map +1 -0
  1283. package/dist/hud/index.js +384 -0
  1284. package/dist/hud/index.js.map +1 -0
  1285. package/dist/hud/reconcile.d.ts +37 -0
  1286. package/dist/hud/reconcile.d.ts.map +1 -0
  1287. package/dist/hud/reconcile.js +326 -0
  1288. package/dist/hud/reconcile.js.map +1 -0
  1289. package/dist/hud/render.d.ts +15 -0
  1290. package/dist/hud/render.d.ts.map +1 -0
  1291. package/dist/hud/render.js +453 -0
  1292. package/dist/hud/render.js.map +1 -0
  1293. package/dist/hud/state.d.ts +27 -0
  1294. package/dist/hud/state.d.ts.map +1 -0
  1295. package/dist/hud/state.js +477 -0
  1296. package/dist/hud/state.js.map +1 -0
  1297. package/dist/hud/tmux.d.ts +87 -0
  1298. package/dist/hud/tmux.d.ts.map +1 -0
  1299. package/dist/hud/tmux.js +572 -0
  1300. package/dist/hud/tmux.js.map +1 -0
  1301. package/dist/hud/types.d.ts +165 -0
  1302. package/dist/hud/types.d.ts.map +1 -0
  1303. package/dist/hud/types.js +14 -0
  1304. package/dist/hud/types.js.map +1 -0
  1305. package/dist/imagegen/continuation.d.ts +44 -0
  1306. package/dist/imagegen/continuation.d.ts.map +1 -0
  1307. package/dist/imagegen/continuation.js +220 -0
  1308. package/dist/imagegen/continuation.js.map +1 -0
  1309. package/dist/index.d.ts +19 -0
  1310. package/dist/index.d.ts.map +1 -0
  1311. package/dist/index.js +19 -0
  1312. package/dist/index.js.map +1 -0
  1313. package/dist/mcp/__tests__/bootstrap.test.d.ts +2 -0
  1314. package/dist/mcp/__tests__/bootstrap.test.d.ts.map +1 -0
  1315. package/dist/mcp/__tests__/bootstrap.test.js +372 -0
  1316. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -0
  1317. package/dist/mcp/__tests__/code-intel-server.test.d.ts +2 -0
  1318. package/dist/mcp/__tests__/code-intel-server.test.d.ts.map +1 -0
  1319. package/dist/mcp/__tests__/code-intel-server.test.js +70 -0
  1320. package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -0
  1321. package/dist/mcp/__tests__/hermes-bridge.test.d.ts +2 -0
  1322. package/dist/mcp/__tests__/hermes-bridge.test.d.ts.map +1 -0
  1323. package/dist/mcp/__tests__/hermes-bridge.test.js +651 -0
  1324. package/dist/mcp/__tests__/hermes-bridge.test.js.map +1 -0
  1325. package/dist/mcp/__tests__/memory-server.test.d.ts +2 -0
  1326. package/dist/mcp/__tests__/memory-server.test.d.ts.map +1 -0
  1327. package/dist/mcp/__tests__/memory-server.test.js +36 -0
  1328. package/dist/mcp/__tests__/memory-server.test.js.map +1 -0
  1329. package/dist/mcp/__tests__/memory-validation.test.d.ts +2 -0
  1330. package/dist/mcp/__tests__/memory-validation.test.d.ts.map +1 -0
  1331. package/dist/mcp/__tests__/memory-validation.test.js +29 -0
  1332. package/dist/mcp/__tests__/memory-validation.test.js.map +1 -0
  1333. package/dist/mcp/__tests__/path-traversal.test.d.ts +2 -0
  1334. package/dist/mcp/__tests__/path-traversal.test.d.ts.map +1 -0
  1335. package/dist/mcp/__tests__/path-traversal.test.js +83 -0
  1336. package/dist/mcp/__tests__/path-traversal.test.js.map +1 -0
  1337. package/dist/mcp/__tests__/server-lifecycle.test.d.ts +2 -0
  1338. package/dist/mcp/__tests__/server-lifecycle.test.d.ts.map +1 -0
  1339. package/dist/mcp/__tests__/server-lifecycle.test.js +308 -0
  1340. package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -0
  1341. package/dist/mcp/__tests__/state-paths.test.d.ts +2 -0
  1342. package/dist/mcp/__tests__/state-paths.test.d.ts.map +1 -0
  1343. package/dist/mcp/__tests__/state-paths.test.js +477 -0
  1344. package/dist/mcp/__tests__/state-paths.test.js.map +1 -0
  1345. package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts +2 -0
  1346. package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts.map +1 -0
  1347. package/dist/mcp/__tests__/state-server-ralph-phase.test.js +109 -0
  1348. package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +1 -0
  1349. package/dist/mcp/__tests__/state-server-schema.test.d.ts +2 -0
  1350. package/dist/mcp/__tests__/state-server-schema.test.d.ts.map +1 -0
  1351. package/dist/mcp/__tests__/state-server-schema.test.js +29 -0
  1352. package/dist/mcp/__tests__/state-server-schema.test.js.map +1 -0
  1353. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts +2 -0
  1354. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts.map +1 -0
  1355. package/dist/mcp/__tests__/state-server-team-tools.test.js +35 -0
  1356. package/dist/mcp/__tests__/state-server-team-tools.test.js.map +1 -0
  1357. package/dist/mcp/__tests__/state-server.test.d.ts +2 -0
  1358. package/dist/mcp/__tests__/state-server.test.d.ts.map +1 -0
  1359. package/dist/mcp/__tests__/state-server.test.js +1318 -0
  1360. package/dist/mcp/__tests__/state-server.test.js.map +1 -0
  1361. package/dist/mcp/__tests__/trace-server.test.d.ts +2 -0
  1362. package/dist/mcp/__tests__/trace-server.test.d.ts.map +1 -0
  1363. package/dist/mcp/__tests__/trace-server.test.js +119 -0
  1364. package/dist/mcp/__tests__/trace-server.test.js.map +1 -0
  1365. package/dist/mcp/__tests__/wiki-server.test.d.ts +2 -0
  1366. package/dist/mcp/__tests__/wiki-server.test.d.ts.map +1 -0
  1367. package/dist/mcp/__tests__/wiki-server.test.js +126 -0
  1368. package/dist/mcp/__tests__/wiki-server.test.js.map +1 -0
  1369. package/dist/mcp/bootstrap.d.ts +44 -0
  1370. package/dist/mcp/bootstrap.d.ts.map +1 -0
  1371. package/dist/mcp/bootstrap.js +520 -0
  1372. package/dist/mcp/bootstrap.js.map +1 -0
  1373. package/dist/mcp/code-intel-server.d.ts +333 -0
  1374. package/dist/mcp/code-intel-server.d.ts.map +1 -0
  1375. package/dist/mcp/code-intel-server.js +605 -0
  1376. package/dist/mcp/code-intel-server.js.map +1 -0
  1377. package/dist/mcp/hermes-bridge.d.ts +124 -0
  1378. package/dist/mcp/hermes-bridge.d.ts.map +1 -0
  1379. package/dist/mcp/hermes-bridge.js +549 -0
  1380. package/dist/mcp/hermes-bridge.js.map +1 -0
  1381. package/dist/mcp/hermes-server.d.ts +374 -0
  1382. package/dist/mcp/hermes-server.d.ts.map +1 -0
  1383. package/dist/mcp/hermes-server.js +158 -0
  1384. package/dist/mcp/hermes-server.js.map +1 -0
  1385. package/dist/mcp/lifecycle-telemetry.d.ts +16 -0
  1386. package/dist/mcp/lifecycle-telemetry.d.ts.map +1 -0
  1387. package/dist/mcp/lifecycle-telemetry.js +95 -0
  1388. package/dist/mcp/lifecycle-telemetry.js.map +1 -0
  1389. package/dist/mcp/memory-server.d.ts +201 -0
  1390. package/dist/mcp/memory-server.d.ts.map +1 -0
  1391. package/dist/mcp/memory-server.js +441 -0
  1392. package/dist/mcp/memory-server.js.map +1 -0
  1393. package/dist/mcp/memory-validation.d.ts +9 -0
  1394. package/dist/mcp/memory-validation.d.ts.map +1 -0
  1395. package/dist/mcp/memory-validation.js +11 -0
  1396. package/dist/mcp/memory-validation.js.map +1 -0
  1397. package/dist/mcp/state-paths.d.ts +91 -0
  1398. package/dist/mcp/state-paths.d.ts.map +1 -0
  1399. package/dist/mcp/state-paths.js +473 -0
  1400. package/dist/mcp/state-paths.js.map +1 -0
  1401. package/dist/mcp/state-server.d.ts +222 -0
  1402. package/dist/mcp/state-server.d.ts.map +1 -0
  1403. package/dist/mcp/state-server.js +181 -0
  1404. package/dist/mcp/state-server.js.map +1 -0
  1405. package/dist/mcp/trace-server.d.ts +81 -0
  1406. package/dist/mcp/trace-server.d.ts.map +1 -0
  1407. package/dist/mcp/trace-server.js +271 -0
  1408. package/dist/mcp/trace-server.js.map +1 -0
  1409. package/dist/mcp/wiki-server.d.ts +181 -0
  1410. package/dist/mcp/wiki-server.d.ts.map +1 -0
  1411. package/dist/mcp/wiki-server.js +244 -0
  1412. package/dist/mcp/wiki-server.js.map +1 -0
  1413. package/dist/modes/__tests__/base-autopilot-gates.test.d.ts +2 -0
  1414. package/dist/modes/__tests__/base-autopilot-gates.test.d.ts.map +1 -0
  1415. package/dist/modes/__tests__/base-autopilot-gates.test.js +154 -0
  1416. package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -0
  1417. package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts +2 -0
  1418. package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts.map +1 -0
  1419. package/dist/modes/__tests__/base-autoresearch-contract.test.js +129 -0
  1420. package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -0
  1421. package/dist/modes/__tests__/base-multi-state-compat.test.d.ts +2 -0
  1422. package/dist/modes/__tests__/base-multi-state-compat.test.d.ts.map +1 -0
  1423. package/dist/modes/__tests__/base-multi-state-compat.test.js +38 -0
  1424. package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -0
  1425. package/dist/modes/__tests__/base-ralph-contract.test.d.ts +2 -0
  1426. package/dist/modes/__tests__/base-ralph-contract.test.d.ts.map +1 -0
  1427. package/dist/modes/__tests__/base-ralph-contract.test.js +64 -0
  1428. package/dist/modes/__tests__/base-ralph-contract.test.js.map +1 -0
  1429. package/dist/modes/__tests__/base-session-scope.test.d.ts +2 -0
  1430. package/dist/modes/__tests__/base-session-scope.test.d.ts.map +1 -0
  1431. package/dist/modes/__tests__/base-session-scope.test.js +146 -0
  1432. package/dist/modes/__tests__/base-session-scope.test.js.map +1 -0
  1433. package/dist/modes/__tests__/base-tmux-pane.test.d.ts +2 -0
  1434. package/dist/modes/__tests__/base-tmux-pane.test.d.ts.map +1 -0
  1435. package/dist/modes/__tests__/base-tmux-pane.test.js +100 -0
  1436. package/dist/modes/__tests__/base-tmux-pane.test.js.map +1 -0
  1437. package/dist/modes/base.d.ts +60 -0
  1438. package/dist/modes/base.d.ts.map +1 -0
  1439. package/dist/modes/base.js +346 -0
  1440. package/dist/modes/base.js.map +1 -0
  1441. package/dist/notifications/__tests__/config.test.d.ts +2 -0
  1442. package/dist/notifications/__tests__/config.test.d.ts.map +1 -0
  1443. package/dist/notifications/__tests__/config.test.js +269 -0
  1444. package/dist/notifications/__tests__/config.test.js.map +1 -0
  1445. package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts +2 -0
  1446. package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts.map +1 -0
  1447. package/dist/notifications/__tests__/custom-alias-enablement.test.js +84 -0
  1448. package/dist/notifications/__tests__/custom-alias-enablement.test.js.map +1 -0
  1449. package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts +5 -0
  1450. package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts.map +1 -0
  1451. package/dist/notifications/__tests__/dispatch-cooldown.test.js +100 -0
  1452. package/dist/notifications/__tests__/dispatch-cooldown.test.js.map +1 -0
  1453. package/dist/notifications/__tests__/dispatcher.test.d.ts +2 -0
  1454. package/dist/notifications/__tests__/dispatcher.test.d.ts.map +1 -0
  1455. package/dist/notifications/__tests__/dispatcher.test.js +202 -0
  1456. package/dist/notifications/__tests__/dispatcher.test.js.map +1 -0
  1457. package/dist/notifications/__tests__/formatter.test.d.ts +2 -0
  1458. package/dist/notifications/__tests__/formatter.test.d.ts.map +1 -0
  1459. package/dist/notifications/__tests__/formatter.test.js +270 -0
  1460. package/dist/notifications/__tests__/formatter.test.js.map +1 -0
  1461. package/dist/notifications/__tests__/hook-config.test.d.ts +5 -0
  1462. package/dist/notifications/__tests__/hook-config.test.d.ts.map +1 -0
  1463. package/dist/notifications/__tests__/hook-config.test.js +139 -0
  1464. package/dist/notifications/__tests__/hook-config.test.js.map +1 -0
  1465. package/dist/notifications/__tests__/http-client-resource.test.d.ts +2 -0
  1466. package/dist/notifications/__tests__/http-client-resource.test.d.ts.map +1 -0
  1467. package/dist/notifications/__tests__/http-client-resource.test.js +41 -0
  1468. package/dist/notifications/__tests__/http-client-resource.test.js.map +1 -0
  1469. package/dist/notifications/__tests__/http-client.test.d.ts +2 -0
  1470. package/dist/notifications/__tests__/http-client.test.d.ts.map +1 -0
  1471. package/dist/notifications/__tests__/http-client.test.js +90 -0
  1472. package/dist/notifications/__tests__/http-client.test.js.map +1 -0
  1473. package/dist/notifications/__tests__/idle-cooldown.test.d.ts +5 -0
  1474. package/dist/notifications/__tests__/idle-cooldown.test.d.ts.map +1 -0
  1475. package/dist/notifications/__tests__/idle-cooldown.test.js +209 -0
  1476. package/dist/notifications/__tests__/idle-cooldown.test.js.map +1 -0
  1477. package/dist/notifications/__tests__/index.test.d.ts +2 -0
  1478. package/dist/notifications/__tests__/index.test.d.ts.map +1 -0
  1479. package/dist/notifications/__tests__/index.test.js +188 -0
  1480. package/dist/notifications/__tests__/index.test.js.map +1 -0
  1481. package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts +2 -0
  1482. package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts.map +1 -0
  1483. package/dist/notifications/__tests__/lifecycle-dedupe.test.js +86 -0
  1484. package/dist/notifications/__tests__/lifecycle-dedupe.test.js.map +1 -0
  1485. package/dist/notifications/__tests__/notifier.test.d.ts +2 -0
  1486. package/dist/notifications/__tests__/notifier.test.d.ts.map +1 -0
  1487. package/dist/notifications/__tests__/notifier.test.js +201 -0
  1488. package/dist/notifications/__tests__/notifier.test.js.map +1 -0
  1489. package/dist/notifications/__tests__/profiles.test.d.ts +2 -0
  1490. package/dist/notifications/__tests__/profiles.test.d.ts.map +1 -0
  1491. package/dist/notifications/__tests__/profiles.test.js +404 -0
  1492. package/dist/notifications/__tests__/profiles.test.js.map +1 -0
  1493. package/dist/notifications/__tests__/reply-config.test.d.ts +2 -0
  1494. package/dist/notifications/__tests__/reply-config.test.d.ts.map +1 -0
  1495. package/dist/notifications/__tests__/reply-config.test.js +79 -0
  1496. package/dist/notifications/__tests__/reply-config.test.js.map +1 -0
  1497. package/dist/notifications/__tests__/reply-listener.test.d.ts +2 -0
  1498. package/dist/notifications/__tests__/reply-listener.test.d.ts.map +1 -0
  1499. package/dist/notifications/__tests__/reply-listener.test.js +723 -0
  1500. package/dist/notifications/__tests__/reply-listener.test.js.map +1 -0
  1501. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts +2 -0
  1502. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts.map +1 -0
  1503. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js +93 -0
  1504. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js.map +1 -0
  1505. package/dist/notifications/__tests__/session-registry.test.d.ts +2 -0
  1506. package/dist/notifications/__tests__/session-registry.test.d.ts.map +1 -0
  1507. package/dist/notifications/__tests__/session-registry.test.js +234 -0
  1508. package/dist/notifications/__tests__/session-registry.test.js.map +1 -0
  1509. package/dist/notifications/__tests__/session-status.test.d.ts +2 -0
  1510. package/dist/notifications/__tests__/session-status.test.d.ts.map +1 -0
  1511. package/dist/notifications/__tests__/session-status.test.js +249 -0
  1512. package/dist/notifications/__tests__/session-status.test.js.map +1 -0
  1513. package/dist/notifications/__tests__/temp-mode.test.d.ts +2 -0
  1514. package/dist/notifications/__tests__/temp-mode.test.d.ts.map +1 -0
  1515. package/dist/notifications/__tests__/temp-mode.test.js +172 -0
  1516. package/dist/notifications/__tests__/temp-mode.test.js.map +1 -0
  1517. package/dist/notifications/__tests__/template-engine.test.d.ts +5 -0
  1518. package/dist/notifications/__tests__/template-engine.test.d.ts.map +1 -0
  1519. package/dist/notifications/__tests__/template-engine.test.js +158 -0
  1520. package/dist/notifications/__tests__/template-engine.test.js.map +1 -0
  1521. package/dist/notifications/__tests__/tmux-detector.test.d.ts +2 -0
  1522. package/dist/notifications/__tests__/tmux-detector.test.d.ts.map +1 -0
  1523. package/dist/notifications/__tests__/tmux-detector.test.js +204 -0
  1524. package/dist/notifications/__tests__/tmux-detector.test.js.map +1 -0
  1525. package/dist/notifications/__tests__/tmux.test.d.ts +2 -0
  1526. package/dist/notifications/__tests__/tmux.test.d.ts.map +1 -0
  1527. package/dist/notifications/__tests__/tmux.test.js +285 -0
  1528. package/dist/notifications/__tests__/tmux.test.js.map +1 -0
  1529. package/dist/notifications/__tests__/verbosity.test.d.ts +2 -0
  1530. package/dist/notifications/__tests__/verbosity.test.d.ts.map +1 -0
  1531. package/dist/notifications/__tests__/verbosity.test.js +257 -0
  1532. package/dist/notifications/__tests__/verbosity.test.js.map +1 -0
  1533. package/dist/notifications/config.d.ts +65 -0
  1534. package/dist/notifications/config.d.ts.map +1 -0
  1535. package/dist/notifications/config.js +615 -0
  1536. package/dist/notifications/config.js.map +1 -0
  1537. package/dist/notifications/dispatch-cooldown.d.ts +36 -0
  1538. package/dist/notifications/dispatch-cooldown.d.ts.map +1 -0
  1539. package/dist/notifications/dispatch-cooldown.js +109 -0
  1540. package/dist/notifications/dispatch-cooldown.js.map +1 -0
  1541. package/dist/notifications/dispatcher.d.ts +15 -0
  1542. package/dist/notifications/dispatcher.d.ts.map +1 -0
  1543. package/dist/notifications/dispatcher.js +385 -0
  1544. package/dist/notifications/dispatcher.js.map +1 -0
  1545. package/dist/notifications/formatter.d.ts +30 -0
  1546. package/dist/notifications/formatter.d.ts.map +1 -0
  1547. package/dist/notifications/formatter.js +234 -0
  1548. package/dist/notifications/formatter.js.map +1 -0
  1549. package/dist/notifications/hook-config-types.d.ts +43 -0
  1550. package/dist/notifications/hook-config-types.d.ts.map +1 -0
  1551. package/dist/notifications/hook-config-types.js +8 -0
  1552. package/dist/notifications/hook-config-types.js.map +1 -0
  1553. package/dist/notifications/hook-config.d.ts +40 -0
  1554. package/dist/notifications/hook-config.d.ts.map +1 -0
  1555. package/dist/notifications/hook-config.js +127 -0
  1556. package/dist/notifications/hook-config.js.map +1 -0
  1557. package/dist/notifications/http-client.d.ts +22 -0
  1558. package/dist/notifications/http-client.d.ts.map +1 -0
  1559. package/dist/notifications/http-client.js +349 -0
  1560. package/dist/notifications/http-client.js.map +1 -0
  1561. package/dist/notifications/idle-cooldown.d.ts +61 -0
  1562. package/dist/notifications/idle-cooldown.d.ts.map +1 -0
  1563. package/dist/notifications/idle-cooldown.js +207 -0
  1564. package/dist/notifications/idle-cooldown.js.map +1 -0
  1565. package/dist/notifications/index.d.ts +40 -0
  1566. package/dist/notifications/index.d.ts.map +1 -0
  1567. package/dist/notifications/index.js +228 -0
  1568. package/dist/notifications/index.js.map +1 -0
  1569. package/dist/notifications/lifecycle-dedupe.d.ts +8 -0
  1570. package/dist/notifications/lifecycle-dedupe.d.ts.map +1 -0
  1571. package/dist/notifications/lifecycle-dedupe.js +112 -0
  1572. package/dist/notifications/lifecycle-dedupe.js.map +1 -0
  1573. package/dist/notifications/notifier.d.ts +45 -0
  1574. package/dist/notifications/notifier.d.ts.map +1 -0
  1575. package/dist/notifications/notifier.js +146 -0
  1576. package/dist/notifications/notifier.js.map +1 -0
  1577. package/dist/notifications/reply-listener.d.ts +123 -0
  1578. package/dist/notifications/reply-listener.d.ts.map +1 -0
  1579. package/dist/notifications/reply-listener.js +846 -0
  1580. package/dist/notifications/reply-listener.js.map +1 -0
  1581. package/dist/notifications/session-registry.d.ts +26 -0
  1582. package/dist/notifications/session-registry.d.ts.map +1 -0
  1583. package/dist/notifications/session-registry.js +293 -0
  1584. package/dist/notifications/session-registry.js.map +1 -0
  1585. package/dist/notifications/session-status.d.ts +25 -0
  1586. package/dist/notifications/session-status.d.ts.map +1 -0
  1587. package/dist/notifications/session-status.js +202 -0
  1588. package/dist/notifications/session-status.js.map +1 -0
  1589. package/dist/notifications/temp-contract.d.ts +22 -0
  1590. package/dist/notifications/temp-contract.d.ts.map +1 -0
  1591. package/dist/notifications/temp-contract.js +147 -0
  1592. package/dist/notifications/temp-contract.js.map +1 -0
  1593. package/dist/notifications/template-engine.d.ts +34 -0
  1594. package/dist/notifications/template-engine.d.ts.map +1 -0
  1595. package/dist/notifications/template-engine.js +249 -0
  1596. package/dist/notifications/template-engine.js.map +1 -0
  1597. package/dist/notifications/tmux-detector.d.ts +59 -0
  1598. package/dist/notifications/tmux-detector.d.ts.map +1 -0
  1599. package/dist/notifications/tmux-detector.js +126 -0
  1600. package/dist/notifications/tmux-detector.js.map +1 -0
  1601. package/dist/notifications/tmux.d.ts +44 -0
  1602. package/dist/notifications/tmux.d.ts.map +1 -0
  1603. package/dist/notifications/tmux.js +293 -0
  1604. package/dist/notifications/tmux.js.map +1 -0
  1605. package/dist/notifications/types.d.ts +226 -0
  1606. package/dist/notifications/types.d.ts.map +1 -0
  1607. package/dist/notifications/types.js +9 -0
  1608. package/dist/notifications/types.js.map +1 -0
  1609. package/dist/openclaw/__tests__/config.test.d.ts +6 -0
  1610. package/dist/openclaw/__tests__/config.test.d.ts.map +1 -0
  1611. package/dist/openclaw/__tests__/config.test.js +344 -0
  1612. package/dist/openclaw/__tests__/config.test.js.map +1 -0
  1613. package/dist/openclaw/__tests__/dispatcher.test.d.ts +5 -0
  1614. package/dist/openclaw/__tests__/dispatcher.test.d.ts.map +1 -0
  1615. package/dist/openclaw/__tests__/dispatcher.test.js +278 -0
  1616. package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -0
  1617. package/dist/openclaw/__tests__/index.test.d.ts +6 -0
  1618. package/dist/openclaw/__tests__/index.test.d.ts.map +1 -0
  1619. package/dist/openclaw/__tests__/index.test.js +382 -0
  1620. package/dist/openclaw/__tests__/index.test.js.map +1 -0
  1621. package/dist/openclaw/config.d.ts +59 -0
  1622. package/dist/openclaw/config.d.ts.map +1 -0
  1623. package/dist/openclaw/config.js +400 -0
  1624. package/dist/openclaw/config.js.map +1 -0
  1625. package/dist/openclaw/dispatcher.d.ts +75 -0
  1626. package/dist/openclaw/dispatcher.d.ts.map +1 -0
  1627. package/dist/openclaw/dispatcher.js +223 -0
  1628. package/dist/openclaw/dispatcher.js.map +1 -0
  1629. package/dist/openclaw/index.d.ts +29 -0
  1630. package/dist/openclaw/index.d.ts.map +1 -0
  1631. package/dist/openclaw/index.js +149 -0
  1632. package/dist/openclaw/index.js.map +1 -0
  1633. package/dist/openclaw/types.d.ts +123 -0
  1634. package/dist/openclaw/types.d.ts.map +1 -0
  1635. package/dist/openclaw/types.js +12 -0
  1636. package/dist/openclaw/types.js.map +1 -0
  1637. package/dist/performance-goal/artifacts.d.ts +76 -0
  1638. package/dist/performance-goal/artifacts.d.ts.map +1 -0
  1639. package/dist/performance-goal/artifacts.js +221 -0
  1640. package/dist/performance-goal/artifacts.js.map +1 -0
  1641. package/dist/pipeline/__tests__/orchestrator.test.d.ts +2 -0
  1642. package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +1 -0
  1643. package/dist/pipeline/__tests__/orchestrator.test.js +645 -0
  1644. package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -0
  1645. package/dist/pipeline/__tests__/stages.test.d.ts +2 -0
  1646. package/dist/pipeline/__tests__/stages.test.d.ts.map +1 -0
  1647. package/dist/pipeline/__tests__/stages.test.js +1638 -0
  1648. package/dist/pipeline/__tests__/stages.test.js.map +1 -0
  1649. package/dist/pipeline/index.d.ts +25 -0
  1650. package/dist/pipeline/index.d.ts.map +1 -0
  1651. package/dist/pipeline/index.js +17 -0
  1652. package/dist/pipeline/index.js.map +1 -0
  1653. package/dist/pipeline/orchestrator.d.ts +52 -0
  1654. package/dist/pipeline/orchestrator.d.ts.map +1 -0
  1655. package/dist/pipeline/orchestrator.js +392 -0
  1656. package/dist/pipeline/orchestrator.js.map +1 -0
  1657. package/dist/pipeline/review-verdict.d.ts +3 -0
  1658. package/dist/pipeline/review-verdict.d.ts.map +1 -0
  1659. package/dist/pipeline/review-verdict.js +14 -0
  1660. package/dist/pipeline/review-verdict.js.map +1 -0
  1661. package/dist/pipeline/stages/code-review.d.ts +35 -0
  1662. package/dist/pipeline/stages/code-review.d.ts.map +1 -0
  1663. package/dist/pipeline/stages/code-review.js +55 -0
  1664. package/dist/pipeline/stages/code-review.js.map +1 -0
  1665. package/dist/pipeline/stages/deep-interview.d.ts +15 -0
  1666. package/dist/pipeline/stages/deep-interview.d.ts.map +1 -0
  1667. package/dist/pipeline/stages/deep-interview.js +32 -0
  1668. package/dist/pipeline/stages/deep-interview.js.map +1 -0
  1669. package/dist/pipeline/stages/ralph-verify.d.ts +53 -0
  1670. package/dist/pipeline/stages/ralph-verify.d.ts.map +1 -0
  1671. package/dist/pipeline/stages/ralph-verify.js +89 -0
  1672. package/dist/pipeline/stages/ralph-verify.js.map +1 -0
  1673. package/dist/pipeline/stages/ralplan.d.ts +26 -0
  1674. package/dist/pipeline/stages/ralplan.d.ts.map +1 -0
  1675. package/dist/pipeline/stages/ralplan.js +151 -0
  1676. package/dist/pipeline/stages/ralplan.js.map +1 -0
  1677. package/dist/pipeline/stages/team-exec.d.ts +52 -0
  1678. package/dist/pipeline/stages/team-exec.d.ts.map +1 -0
  1679. package/dist/pipeline/stages/team-exec.js +266 -0
  1680. package/dist/pipeline/stages/team-exec.js.map +1 -0
  1681. package/dist/pipeline/stages/ultragoal.d.ts +19 -0
  1682. package/dist/pipeline/stages/ultragoal.d.ts.map +1 -0
  1683. package/dist/pipeline/stages/ultragoal.js +38 -0
  1684. package/dist/pipeline/stages/ultragoal.js.map +1 -0
  1685. package/dist/pipeline/stages/ultraqa.d.ts +33 -0
  1686. package/dist/pipeline/stages/ultraqa.d.ts.map +1 -0
  1687. package/dist/pipeline/stages/ultraqa.js +49 -0
  1688. package/dist/pipeline/stages/ultraqa.js.map +1 -0
  1689. package/dist/pipeline/types.d.ts +124 -0
  1690. package/dist/pipeline/types.d.ts.map +1 -0
  1691. package/dist/pipeline/types.js +8 -0
  1692. package/dist/pipeline/types.js.map +1 -0
  1693. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.d.ts +2 -0
  1694. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.d.ts.map +1 -0
  1695. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js +158 -0
  1696. package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js.map +1 -0
  1697. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.d.ts +2 -0
  1698. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.d.ts.map +1 -0
  1699. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.js +440 -0
  1700. package/dist/planning/__tests__/approved-launch-hint-lineage-matrix.test.js.map +1 -0
  1701. package/dist/planning/__tests__/artifacts.test.d.ts +2 -0
  1702. package/dist/planning/__tests__/artifacts.test.d.ts.map +1 -0
  1703. package/dist/planning/__tests__/artifacts.test.js +942 -0
  1704. package/dist/planning/__tests__/artifacts.test.js.map +1 -0
  1705. package/dist/planning/__tests__/markdown-structure.test.d.ts +2 -0
  1706. package/dist/planning/__tests__/markdown-structure.test.d.ts.map +1 -0
  1707. package/dist/planning/__tests__/markdown-structure.test.js +459 -0
  1708. package/dist/planning/__tests__/markdown-structure.test.js.map +1 -0
  1709. package/dist/planning/artifact-names.d.ts +13 -0
  1710. package/dist/planning/artifact-names.d.ts.map +1 -0
  1711. package/dist/planning/artifact-names.js +108 -0
  1712. package/dist/planning/artifact-names.js.map +1 -0
  1713. package/dist/planning/artifacts.d.ts +65 -0
  1714. package/dist/planning/artifacts.d.ts.map +1 -0
  1715. package/dist/planning/artifacts.js +561 -0
  1716. package/dist/planning/artifacts.js.map +1 -0
  1717. package/dist/planning/markdown-structure.d.ts +20 -0
  1718. package/dist/planning/markdown-structure.d.ts.map +1 -0
  1719. package/dist/planning/markdown-structure.js +137 -0
  1720. package/dist/planning/markdown-structure.js.map +1 -0
  1721. package/dist/question/__tests__/client.test.d.ts +2 -0
  1722. package/dist/question/__tests__/client.test.d.ts.map +1 -0
  1723. package/dist/question/__tests__/client.test.js +90 -0
  1724. package/dist/question/__tests__/client.test.js.map +1 -0
  1725. package/dist/question/__tests__/deep-interview.test.d.ts +2 -0
  1726. package/dist/question/__tests__/deep-interview.test.d.ts.map +1 -0
  1727. package/dist/question/__tests__/deep-interview.test.js +440 -0
  1728. package/dist/question/__tests__/deep-interview.test.js.map +1 -0
  1729. package/dist/question/__tests__/policy.test.d.ts +2 -0
  1730. package/dist/question/__tests__/policy.test.d.ts.map +1 -0
  1731. package/dist/question/__tests__/policy.test.js +273 -0
  1732. package/dist/question/__tests__/policy.test.js.map +1 -0
  1733. package/dist/question/__tests__/renderer.test.d.ts +2 -0
  1734. package/dist/question/__tests__/renderer.test.d.ts.map +1 -0
  1735. package/dist/question/__tests__/renderer.test.js +1461 -0
  1736. package/dist/question/__tests__/renderer.test.js.map +1 -0
  1737. package/dist/question/__tests__/state.test.d.ts +2 -0
  1738. package/dist/question/__tests__/state.test.d.ts.map +1 -0
  1739. package/dist/question/__tests__/state.test.js +541 -0
  1740. package/dist/question/__tests__/state.test.js.map +1 -0
  1741. package/dist/question/__tests__/types.test.d.ts +2 -0
  1742. package/dist/question/__tests__/types.test.d.ts.map +1 -0
  1743. package/dist/question/__tests__/types.test.js +65 -0
  1744. package/dist/question/__tests__/types.test.js.map +1 -0
  1745. package/dist/question/__tests__/ui.test.d.ts +2 -0
  1746. package/dist/question/__tests__/ui.test.d.ts.map +1 -0
  1747. package/dist/question/__tests__/ui.test.js +483 -0
  1748. package/dist/question/__tests__/ui.test.js.map +1 -0
  1749. package/dist/question/autopilot-wait.d.ts +21 -0
  1750. package/dist/question/autopilot-wait.d.ts.map +1 -0
  1751. package/dist/question/autopilot-wait.js +251 -0
  1752. package/dist/question/autopilot-wait.js.map +1 -0
  1753. package/dist/question/client.d.ts +64 -0
  1754. package/dist/question/client.d.ts.map +1 -0
  1755. package/dist/question/client.js +77 -0
  1756. package/dist/question/client.js.map +1 -0
  1757. package/dist/question/deep-interview.d.ts +33 -0
  1758. package/dist/question/deep-interview.d.ts.map +1 -0
  1759. package/dist/question/deep-interview.js +216 -0
  1760. package/dist/question/deep-interview.js.map +1 -0
  1761. package/dist/question/events.d.ts +53 -0
  1762. package/dist/question/events.d.ts.map +1 -0
  1763. package/dist/question/events.js +201 -0
  1764. package/dist/question/events.js.map +1 -0
  1765. package/dist/question/policy.d.ts +19 -0
  1766. package/dist/question/policy.d.ts.map +1 -0
  1767. package/dist/question/policy.js +95 -0
  1768. package/dist/question/policy.js.map +1 -0
  1769. package/dist/question/renderer.d.ts +66 -0
  1770. package/dist/question/renderer.d.ts.map +1 -0
  1771. package/dist/question/renderer.js +748 -0
  1772. package/dist/question/renderer.js.map +1 -0
  1773. package/dist/question/state.d.ts +56 -0
  1774. package/dist/question/state.d.ts.map +1 -0
  1775. package/dist/question/state.js +432 -0
  1776. package/dist/question/state.js.map +1 -0
  1777. package/dist/question/types.d.ts +92 -0
  1778. package/dist/question/types.d.ts.map +1 -0
  1779. package/dist/question/types.js +117 -0
  1780. package/dist/question/types.js.map +1 -0
  1781. package/dist/question/ui.d.ts +66 -0
  1782. package/dist/question/ui.d.ts.map +1 -0
  1783. package/dist/question/ui.js +458 -0
  1784. package/dist/question/ui.js.map +1 -0
  1785. package/dist/ralph/__tests__/completion-audit.test.d.ts +2 -0
  1786. package/dist/ralph/__tests__/completion-audit.test.d.ts.map +1 -0
  1787. package/dist/ralph/__tests__/completion-audit.test.js +160 -0
  1788. package/dist/ralph/__tests__/completion-audit.test.js.map +1 -0
  1789. package/dist/ralph/__tests__/persistence.test.d.ts +2 -0
  1790. package/dist/ralph/__tests__/persistence.test.d.ts.map +1 -0
  1791. package/dist/ralph/__tests__/persistence.test.js +116 -0
  1792. package/dist/ralph/__tests__/persistence.test.js.map +1 -0
  1793. package/dist/ralph/completion-audit.d.ts +8 -0
  1794. package/dist/ralph/completion-audit.d.ts.map +1 -0
  1795. package/dist/ralph/completion-audit.js +99 -0
  1796. package/dist/ralph/completion-audit.js.map +1 -0
  1797. package/dist/ralph/contract.d.ts +17 -0
  1798. package/dist/ralph/contract.d.ts.map +1 -0
  1799. package/dist/ralph/contract.js +108 -0
  1800. package/dist/ralph/contract.js.map +1 -0
  1801. package/dist/ralph/persistence.d.ts +29 -0
  1802. package/dist/ralph/persistence.d.ts.map +1 -0
  1803. package/dist/ralph/persistence.js +273 -0
  1804. package/dist/ralph/persistence.js.map +1 -0
  1805. package/dist/ralplan/__tests__/consensus-gate.test.d.ts +2 -0
  1806. package/dist/ralplan/__tests__/consensus-gate.test.d.ts.map +1 -0
  1807. package/dist/ralplan/__tests__/consensus-gate.test.js +192 -0
  1808. package/dist/ralplan/__tests__/consensus-gate.test.js.map +1 -0
  1809. package/dist/ralplan/__tests__/runtime.test.d.ts +2 -0
  1810. package/dist/ralplan/__tests__/runtime.test.d.ts.map +1 -0
  1811. package/dist/ralplan/__tests__/runtime.test.js +548 -0
  1812. package/dist/ralplan/__tests__/runtime.test.js.map +1 -0
  1813. package/dist/ralplan/consensus-gate.d.ts +37 -0
  1814. package/dist/ralplan/consensus-gate.d.ts.map +1 -0
  1815. package/dist/ralplan/consensus-gate.js +422 -0
  1816. package/dist/ralplan/consensus-gate.js.map +1 -0
  1817. package/dist/ralplan/runtime.d.ts +86 -0
  1818. package/dist/ralplan/runtime.d.ts.map +1 -0
  1819. package/dist/ralplan/runtime.js +365 -0
  1820. package/dist/ralplan/runtime.js.map +1 -0
  1821. package/dist/runtime/__tests__/bridge.test.d.ts +2 -0
  1822. package/dist/runtime/__tests__/bridge.test.d.ts.map +1 -0
  1823. package/dist/runtime/__tests__/bridge.test.js +194 -0
  1824. package/dist/runtime/__tests__/bridge.test.js.map +1 -0
  1825. package/dist/runtime/__tests__/process-tree.test.d.ts +2 -0
  1826. package/dist/runtime/__tests__/process-tree.test.d.ts.map +1 -0
  1827. package/dist/runtime/__tests__/process-tree.test.js +107 -0
  1828. package/dist/runtime/__tests__/process-tree.test.js.map +1 -0
  1829. package/dist/runtime/__tests__/run-loop.test.d.ts +2 -0
  1830. package/dist/runtime/__tests__/run-loop.test.d.ts.map +1 -0
  1831. package/dist/runtime/__tests__/run-loop.test.js +35 -0
  1832. package/dist/runtime/__tests__/run-loop.test.js.map +1 -0
  1833. package/dist/runtime/__tests__/run-outcome.test.d.ts +2 -0
  1834. package/dist/runtime/__tests__/run-outcome.test.d.ts.map +1 -0
  1835. package/dist/runtime/__tests__/run-outcome.test.js +102 -0
  1836. package/dist/runtime/__tests__/run-outcome.test.js.map +1 -0
  1837. package/dist/runtime/__tests__/run-state.test.d.ts +2 -0
  1838. package/dist/runtime/__tests__/run-state.test.d.ts.map +1 -0
  1839. package/dist/runtime/__tests__/run-state.test.js +37 -0
  1840. package/dist/runtime/__tests__/run-state.test.js.map +1 -0
  1841. package/dist/runtime/bridge.d.ts +214 -0
  1842. package/dist/runtime/bridge.d.ts.map +1 -0
  1843. package/dist/runtime/bridge.js +223 -0
  1844. package/dist/runtime/bridge.js.map +1 -0
  1845. package/dist/runtime/process-tree.d.ts +28 -0
  1846. package/dist/runtime/process-tree.d.ts.map +1 -0
  1847. package/dist/runtime/process-tree.js +230 -0
  1848. package/dist/runtime/process-tree.js.map +1 -0
  1849. package/dist/runtime/run-loop.d.ts +45 -0
  1850. package/dist/runtime/run-loop.d.ts.map +1 -0
  1851. package/dist/runtime/run-loop.js +51 -0
  1852. package/dist/runtime/run-loop.js.map +1 -0
  1853. package/dist/runtime/run-outcome.d.ts +46 -0
  1854. package/dist/runtime/run-outcome.d.ts.map +1 -0
  1855. package/dist/runtime/run-outcome.js +285 -0
  1856. package/dist/runtime/run-outcome.js.map +1 -0
  1857. package/dist/runtime/run-state.d.ts +40 -0
  1858. package/dist/runtime/run-state.d.ts.map +1 -0
  1859. package/dist/runtime/run-state.js +120 -0
  1860. package/dist/runtime/run-state.js.map +1 -0
  1861. package/dist/runtime/terminal-lifecycle.d.ts +11 -0
  1862. package/dist/runtime/terminal-lifecycle.d.ts.map +1 -0
  1863. package/dist/runtime/terminal-lifecycle.js +52 -0
  1864. package/dist/runtime/terminal-lifecycle.js.map +1 -0
  1865. package/dist/scripts/__tests__/codex-native-hook.test.d.ts +2 -0
  1866. package/dist/scripts/__tests__/codex-native-hook.test.d.ts.map +1 -0
  1867. package/dist/scripts/__tests__/codex-native-hook.test.js +14253 -0
  1868. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -0
  1869. package/dist/scripts/__tests__/docs-site-contract.test.d.ts +2 -0
  1870. package/dist/scripts/__tests__/docs-site-contract.test.d.ts.map +1 -0
  1871. package/dist/scripts/__tests__/docs-site-contract.test.js +42 -0
  1872. package/dist/scripts/__tests__/docs-site-contract.test.js.map +1 -0
  1873. package/dist/scripts/__tests__/generate-release-body.test.d.ts +2 -0
  1874. package/dist/scripts/__tests__/generate-release-body.test.d.ts.map +1 -0
  1875. package/dist/scripts/__tests__/generate-release-body.test.js +233 -0
  1876. package/dist/scripts/__tests__/generate-release-body.test.js.map +1 -0
  1877. package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts +2 -0
  1878. package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts.map +1 -0
  1879. package/dist/scripts/__tests__/hook-derived-watcher.test.js +227 -0
  1880. package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +1 -0
  1881. package/dist/scripts/__tests__/notify-dispatcher.test.d.ts +2 -0
  1882. package/dist/scripts/__tests__/notify-dispatcher.test.d.ts.map +1 -0
  1883. package/dist/scripts/__tests__/notify-dispatcher.test.js +421 -0
  1884. package/dist/scripts/__tests__/notify-dispatcher.test.js.map +1 -0
  1885. package/dist/scripts/__tests__/notify-state-io.test.d.ts +2 -0
  1886. package/dist/scripts/__tests__/notify-state-io.test.d.ts.map +1 -0
  1887. package/dist/scripts/__tests__/notify-state-io.test.js +111 -0
  1888. package/dist/scripts/__tests__/notify-state-io.test.js.map +1 -0
  1889. package/dist/scripts/__tests__/notify-tmux-injection.test.d.ts +2 -0
  1890. package/dist/scripts/__tests__/notify-tmux-injection.test.d.ts.map +1 -0
  1891. package/dist/scripts/__tests__/notify-tmux-injection.test.js +57 -0
  1892. package/dist/scripts/__tests__/notify-tmux-injection.test.js.map +1 -0
  1893. package/dist/scripts/__tests__/postinstall.test.d.ts +2 -0
  1894. package/dist/scripts/__tests__/postinstall.test.d.ts.map +1 -0
  1895. package/dist/scripts/__tests__/postinstall.test.js +92 -0
  1896. package/dist/scripts/__tests__/postinstall.test.js.map +1 -0
  1897. package/dist/scripts/__tests__/prompt-inventory.test.d.ts +2 -0
  1898. package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +1 -0
  1899. package/dist/scripts/__tests__/prompt-inventory.test.js +56 -0
  1900. package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -0
  1901. package/dist/scripts/__tests__/run-test-files.test.d.ts +2 -0
  1902. package/dist/scripts/__tests__/run-test-files.test.d.ts.map +1 -0
  1903. package/dist/scripts/__tests__/run-test-files.test.js +365 -0
  1904. package/dist/scripts/__tests__/run-test-files.test.js.map +1 -0
  1905. package/dist/scripts/__tests__/smoke-packed-install.test.d.ts +2 -0
  1906. package/dist/scripts/__tests__/smoke-packed-install.test.d.ts.map +1 -0
  1907. package/dist/scripts/__tests__/smoke-packed-install.test.js +160 -0
  1908. package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -0
  1909. package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts +2 -0
  1910. package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts.map +1 -0
  1911. package/dist/scripts/__tests__/test-reply-listener-live.test.js +82 -0
  1912. package/dist/scripts/__tests__/test-reply-listener-live.test.js.map +1 -0
  1913. package/dist/scripts/__tests__/verify-native-agents.test.d.ts +2 -0
  1914. package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +1 -0
  1915. package/dist/scripts/__tests__/verify-native-agents.test.js +246 -0
  1916. package/dist/scripts/__tests__/verify-native-agents.test.js.map +1 -0
  1917. package/dist/scripts/build-api.d.ts +2 -0
  1918. package/dist/scripts/build-api.d.ts.map +1 -0
  1919. package/dist/scripts/build-api.js +44 -0
  1920. package/dist/scripts/build-api.js.map +1 -0
  1921. package/dist/scripts/build-explore-harness.d.ts +3 -0
  1922. package/dist/scripts/build-explore-harness.d.ts.map +1 -0
  1923. package/dist/scripts/build-explore-harness.js +50 -0
  1924. package/dist/scripts/build-explore-harness.js.map +1 -0
  1925. package/dist/scripts/build-sparkshell.d.ts +2 -0
  1926. package/dist/scripts/build-sparkshell.d.ts.map +1 -0
  1927. package/dist/scripts/build-sparkshell.js +46 -0
  1928. package/dist/scripts/build-sparkshell.js.map +1 -0
  1929. package/dist/scripts/check-runtime-syntax.d.ts +3 -0
  1930. package/dist/scripts/check-runtime-syntax.d.ts.map +1 -0
  1931. package/dist/scripts/check-runtime-syntax.js +57 -0
  1932. package/dist/scripts/check-runtime-syntax.js.map +1 -0
  1933. package/dist/scripts/check-version-sync.d.ts +3 -0
  1934. package/dist/scripts/check-version-sync.d.ts.map +1 -0
  1935. package/dist/scripts/check-version-sync.js +53 -0
  1936. package/dist/scripts/check-version-sync.js.map +1 -0
  1937. package/dist/scripts/cleanup-explore-harness.d.ts +3 -0
  1938. package/dist/scripts/cleanup-explore-harness.d.ts.map +1 -0
  1939. package/dist/scripts/cleanup-explore-harness.js +17 -0
  1940. package/dist/scripts/cleanup-explore-harness.js.map +1 -0
  1941. package/dist/scripts/codex-execution-surface.d.ts +16 -0
  1942. package/dist/scripts/codex-execution-surface.d.ts.map +1 -0
  1943. package/dist/scripts/codex-execution-surface.js +42 -0
  1944. package/dist/scripts/codex-execution-surface.js.map +1 -0
  1945. package/dist/scripts/codex-native-hook.d.ts +26 -0
  1946. package/dist/scripts/codex-native-hook.d.ts.map +1 -0
  1947. package/dist/scripts/codex-native-hook.js +3842 -0
  1948. package/dist/scripts/codex-native-hook.js.map +1 -0
  1949. package/dist/scripts/codex-native-pre-post.d.ts +46 -0
  1950. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -0
  1951. package/dist/scripts/codex-native-pre-post.js +1186 -0
  1952. package/dist/scripts/codex-native-pre-post.js.map +1 -0
  1953. package/dist/scripts/eval/eval-candidate-handoff.d.ts +2 -0
  1954. package/dist/scripts/eval/eval-candidate-handoff.d.ts.map +1 -0
  1955. package/dist/scripts/eval/eval-candidate-handoff.js +11 -0
  1956. package/dist/scripts/eval/eval-candidate-handoff.js.map +1 -0
  1957. package/dist/scripts/eval/eval-cli-discoverability.d.ts +3 -0
  1958. package/dist/scripts/eval/eval-cli-discoverability.d.ts.map +1 -0
  1959. package/dist/scripts/eval/eval-cli-discoverability.js +37 -0
  1960. package/dist/scripts/eval/eval-cli-discoverability.js.map +1 -0
  1961. package/dist/scripts/eval/eval-fresh-run-tagging.d.ts +2 -0
  1962. package/dist/scripts/eval/eval-fresh-run-tagging.d.ts.map +1 -0
  1963. package/dist/scripts/eval/eval-fresh-run-tagging.js +11 -0
  1964. package/dist/scripts/eval/eval-fresh-run-tagging.js.map +1 -0
  1965. package/dist/scripts/eval/eval-help-consistency.d.ts +2 -0
  1966. package/dist/scripts/eval/eval-help-consistency.d.ts.map +1 -0
  1967. package/dist/scripts/eval/eval-help-consistency.js +12 -0
  1968. package/dist/scripts/eval/eval-help-consistency.js.map +1 -0
  1969. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts +2 -0
  1970. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts.map +1 -0
  1971. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js +31 -0
  1972. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js.map +1 -0
  1973. package/dist/scripts/eval/eval-parity-smoke.d.ts +2 -0
  1974. package/dist/scripts/eval/eval-parity-smoke.d.ts.map +1 -0
  1975. package/dist/scripts/eval/eval-parity-smoke.js +23 -0
  1976. package/dist/scripts/eval/eval-parity-smoke.js.map +1 -0
  1977. package/dist/scripts/eval/eval-parity-sweep.d.ts +2 -0
  1978. package/dist/scripts/eval/eval-parity-sweep.d.ts.map +1 -0
  1979. package/dist/scripts/eval/eval-parity-sweep.js +29 -0
  1980. package/dist/scripts/eval/eval-parity-sweep.js.map +1 -0
  1981. package/dist/scripts/eval/eval-resume-dirty-guard.d.ts +2 -0
  1982. package/dist/scripts/eval/eval-resume-dirty-guard.d.ts.map +1 -0
  1983. package/dist/scripts/eval/eval-resume-dirty-guard.js +11 -0
  1984. package/dist/scripts/eval/eval-resume-dirty-guard.js.map +1 -0
  1985. package/dist/scripts/eval/eval-security-path-traversal.d.ts +3 -0
  1986. package/dist/scripts/eval/eval-security-path-traversal.d.ts.map +1 -0
  1987. package/dist/scripts/eval/eval-security-path-traversal.js +35 -0
  1988. package/dist/scripts/eval/eval-security-path-traversal.js.map +1 -0
  1989. package/dist/scripts/fixtures/ask-advisor-stub.d.ts +3 -0
  1990. package/dist/scripts/fixtures/ask-advisor-stub.d.ts.map +1 -0
  1991. package/dist/scripts/fixtures/ask-advisor-stub.js +13 -0
  1992. package/dist/scripts/fixtures/ask-advisor-stub.js.map +1 -0
  1993. package/dist/scripts/generate-catalog-docs.d.ts +3 -0
  1994. package/dist/scripts/generate-catalog-docs.d.ts.map +1 -0
  1995. package/dist/scripts/generate-catalog-docs.js +99 -0
  1996. package/dist/scripts/generate-catalog-docs.js.map +1 -0
  1997. package/dist/scripts/generate-native-release-manifest.d.ts +3 -0
  1998. package/dist/scripts/generate-native-release-manifest.d.ts.map +1 -0
  1999. package/dist/scripts/generate-native-release-manifest.js +107 -0
  2000. package/dist/scripts/generate-native-release-manifest.js.map +1 -0
  2001. package/dist/scripts/generate-release-body.d.ts +35 -0
  2002. package/dist/scripts/generate-release-body.d.ts.map +1 -0
  2003. package/dist/scripts/generate-release-body.js +278 -0
  2004. package/dist/scripts/generate-release-body.js.map +1 -0
  2005. package/dist/scripts/hook-derived-watcher.d.ts +3 -0
  2006. package/dist/scripts/hook-derived-watcher.d.ts.map +1 -0
  2007. package/dist/scripts/hook-derived-watcher.js +557 -0
  2008. package/dist/scripts/hook-derived-watcher.js.map +1 -0
  2009. package/dist/scripts/hook-payload-guard.d.ts +9 -0
  2010. package/dist/scripts/hook-payload-guard.d.ts.map +1 -0
  2011. package/dist/scripts/hook-payload-guard.js +111 -0
  2012. package/dist/scripts/hook-payload-guard.js.map +1 -0
  2013. package/dist/scripts/notify-dispatcher.d.ts +7 -0
  2014. package/dist/scripts/notify-dispatcher.d.ts.map +1 -0
  2015. package/dist/scripts/notify-dispatcher.js +359 -0
  2016. package/dist/scripts/notify-dispatcher.js.map +1 -0
  2017. package/dist/scripts/notify-fallback-watcher.d.ts +3 -0
  2018. package/dist/scripts/notify-fallback-watcher.d.ts.map +1 -0
  2019. package/dist/scripts/notify-fallback-watcher.js +1771 -0
  2020. package/dist/scripts/notify-fallback-watcher.js.map +1 -0
  2021. package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts +2 -0
  2022. package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts.map +1 -0
  2023. package/dist/scripts/notify-hook/__tests__/operational-events.test.js +24 -0
  2024. package/dist/scripts/notify-hook/__tests__/operational-events.test.js.map +1 -0
  2025. package/dist/scripts/notify-hook/__tests__/payload-guard.test.d.ts +2 -0
  2026. package/dist/scripts/notify-hook/__tests__/payload-guard.test.d.ts.map +1 -0
  2027. package/dist/scripts/notify-hook/__tests__/payload-guard.test.js +39 -0
  2028. package/dist/scripts/notify-hook/__tests__/payload-guard.test.js.map +1 -0
  2029. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +2 -0
  2030. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +1 -0
  2031. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +153 -0
  2032. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +1 -0
  2033. package/dist/scripts/notify-hook/active-team.d.ts +9 -0
  2034. package/dist/scripts/notify-hook/active-team.d.ts.map +1 -0
  2035. package/dist/scripts/notify-hook/active-team.js +45 -0
  2036. package/dist/scripts/notify-hook/active-team.js.map +1 -0
  2037. package/dist/scripts/notify-hook/auto-nudge.d.ts +96 -0
  2038. package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -0
  2039. package/dist/scripts/notify-hook/auto-nudge.js +698 -0
  2040. package/dist/scripts/notify-hook/auto-nudge.js.map +1 -0
  2041. package/dist/scripts/notify-hook/log.d.ts +6 -0
  2042. package/dist/scripts/notify-hook/log.d.ts.map +1 -0
  2043. package/dist/scripts/notify-hook/log.js +22 -0
  2044. package/dist/scripts/notify-hook/log.js.map +1 -0
  2045. package/dist/scripts/notify-hook/managed-tmux.d.ts +21 -0
  2046. package/dist/scripts/notify-hook/managed-tmux.d.ts.map +1 -0
  2047. package/dist/scripts/notify-hook/managed-tmux.js +541 -0
  2048. package/dist/scripts/notify-hook/managed-tmux.js.map +1 -0
  2049. package/dist/scripts/notify-hook/operational-events.d.ts +14 -0
  2050. package/dist/scripts/notify-hook/operational-events.d.ts.map +1 -0
  2051. package/dist/scripts/notify-hook/operational-events.js +255 -0
  2052. package/dist/scripts/notify-hook/operational-events.js.map +1 -0
  2053. package/dist/scripts/notify-hook/orchestration-intent.d.ts +17 -0
  2054. package/dist/scripts/notify-hook/orchestration-intent.d.ts.map +1 -0
  2055. package/dist/scripts/notify-hook/orchestration-intent.js +71 -0
  2056. package/dist/scripts/notify-hook/orchestration-intent.js.map +1 -0
  2057. package/dist/scripts/notify-hook/payload-parser.d.ts +13 -0
  2058. package/dist/scripts/notify-hook/payload-parser.d.ts.map +1 -0
  2059. package/dist/scripts/notify-hook/payload-parser.js +134 -0
  2060. package/dist/scripts/notify-hook/payload-parser.js.map +1 -0
  2061. package/dist/scripts/notify-hook/process-runner.d.ts +9 -0
  2062. package/dist/scripts/notify-hook/process-runner.d.ts.map +1 -0
  2063. package/dist/scripts/notify-hook/process-runner.js +74 -0
  2064. package/dist/scripts/notify-hook/process-runner.js.map +1 -0
  2065. package/dist/scripts/notify-hook/ralph-session-resume.d.ts +22 -0
  2066. package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -0
  2067. package/dist/scripts/notify-hook/ralph-session-resume.js +381 -0
  2068. package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -0
  2069. package/dist/scripts/notify-hook/state-io.d.ts +21 -0
  2070. package/dist/scripts/notify-hook/state-io.d.ts.map +1 -0
  2071. package/dist/scripts/notify-hook/state-io.js +169 -0
  2072. package/dist/scripts/notify-hook/state-io.js.map +1 -0
  2073. package/dist/scripts/notify-hook/team-dispatch.d.ts +36 -0
  2074. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -0
  2075. package/dist/scripts/notify-hook/team-dispatch.js +1084 -0
  2076. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -0
  2077. package/dist/scripts/notify-hook/team-leader-nudge.d.ts +21 -0
  2078. package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -0
  2079. package/dist/scripts/notify-hook/team-leader-nudge.js +1029 -0
  2080. package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -0
  2081. package/dist/scripts/notify-hook/team-tmux-guard.d.ts +15 -0
  2082. package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -0
  2083. package/dist/scripts/notify-hook/team-tmux-guard.js +205 -0
  2084. package/dist/scripts/notify-hook/team-tmux-guard.js.map +1 -0
  2085. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts +34 -0
  2086. package/dist/scripts/notify-hook/team-worker-posttooluse.d.ts.map +1 -0
  2087. package/dist/scripts/notify-hook/team-worker-posttooluse.js +434 -0
  2088. package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -0
  2089. package/dist/scripts/notify-hook/team-worker-stop.d.ts +15 -0
  2090. package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -0
  2091. package/dist/scripts/notify-hook/team-worker-stop.js +418 -0
  2092. package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -0
  2093. package/dist/scripts/notify-hook/team-worker.d.ts +33 -0
  2094. package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -0
  2095. package/dist/scripts/notify-hook/team-worker.js +705 -0
  2096. package/dist/scripts/notify-hook/team-worker.js.map +1 -0
  2097. package/dist/scripts/notify-hook/tmux-injection.d.ts +15 -0
  2098. package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -0
  2099. package/dist/scripts/notify-hook/tmux-injection.js +673 -0
  2100. package/dist/scripts/notify-hook/tmux-injection.js.map +1 -0
  2101. package/dist/scripts/notify-hook/utils.d.ts +9 -0
  2102. package/dist/scripts/notify-hook/utils.d.ts.map +1 -0
  2103. package/dist/scripts/notify-hook/utils.js +36 -0
  2104. package/dist/scripts/notify-hook/utils.js.map +1 -0
  2105. package/dist/scripts/notify-hook/visual-verdict.d.ts +29 -0
  2106. package/dist/scripts/notify-hook/visual-verdict.d.ts.map +1 -0
  2107. package/dist/scripts/notify-hook/visual-verdict.js +145 -0
  2108. package/dist/scripts/notify-hook/visual-verdict.js.map +1 -0
  2109. package/dist/scripts/notify-hook.d.ts +20 -0
  2110. package/dist/scripts/notify-hook.d.ts.map +1 -0
  2111. package/dist/scripts/notify-hook.js +950 -0
  2112. package/dist/scripts/notify-hook.js.map +1 -0
  2113. package/dist/scripts/postinstall.d.ts +18 -0
  2114. package/dist/scripts/postinstall.d.ts.map +1 -0
  2115. package/dist/scripts/postinstall.js +66 -0
  2116. package/dist/scripts/postinstall.js.map +1 -0
  2117. package/dist/scripts/prompt-inventory.d.ts +29 -0
  2118. package/dist/scripts/prompt-inventory.d.ts.map +1 -0
  2119. package/dist/scripts/prompt-inventory.js +178 -0
  2120. package/dist/scripts/prompt-inventory.js.map +1 -0
  2121. package/dist/scripts/run-provider-advisor.d.ts +3 -0
  2122. package/dist/scripts/run-provider-advisor.d.ts.map +1 -0
  2123. package/dist/scripts/run-provider-advisor.js +177 -0
  2124. package/dist/scripts/run-provider-advisor.js.map +1 -0
  2125. package/dist/scripts/run-test-files.d.ts +2 -0
  2126. package/dist/scripts/run-test-files.d.ts.map +1 -0
  2127. package/dist/scripts/run-test-files.js +340 -0
  2128. package/dist/scripts/run-test-files.js.map +1 -0
  2129. package/dist/scripts/smoke-packed-install.d.ts +21 -0
  2130. package/dist/scripts/smoke-packed-install.d.ts.map +1 -0
  2131. package/dist/scripts/smoke-packed-install.js +221 -0
  2132. package/dist/scripts/smoke-packed-install.js.map +1 -0
  2133. package/dist/scripts/sync-plugin-mirror.d.ts +14 -0
  2134. package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -0
  2135. package/dist/scripts/sync-plugin-mirror.js +306 -0
  2136. package/dist/scripts/sync-plugin-mirror.js.map +1 -0
  2137. package/dist/scripts/sync-prompt-guidance-fragments.d.ts +3 -0
  2138. package/dist/scripts/sync-prompt-guidance-fragments.d.ts.map +1 -0
  2139. package/dist/scripts/sync-prompt-guidance-fragments.js +50 -0
  2140. package/dist/scripts/sync-prompt-guidance-fragments.js.map +1 -0
  2141. package/dist/scripts/team-hardening-benchmark.d.ts +3 -0
  2142. package/dist/scripts/team-hardening-benchmark.d.ts.map +1 -0
  2143. package/dist/scripts/team-hardening-benchmark.js +91 -0
  2144. package/dist/scripts/team-hardening-benchmark.js.map +1 -0
  2145. package/dist/scripts/test-reply-listener-live.d.ts +24 -0
  2146. package/dist/scripts/test-reply-listener-live.d.ts.map +1 -0
  2147. package/dist/scripts/test-reply-listener-live.js +138 -0
  2148. package/dist/scripts/test-reply-listener-live.js.map +1 -0
  2149. package/dist/scripts/test-sparkshell.d.ts +2 -0
  2150. package/dist/scripts/test-sparkshell.d.ts.map +1 -0
  2151. package/dist/scripts/test-sparkshell.js +25 -0
  2152. package/dist/scripts/test-sparkshell.js.map +1 -0
  2153. package/dist/scripts/tmux-hook-engine.d.ts +45 -0
  2154. package/dist/scripts/tmux-hook-engine.d.ts.map +1 -0
  2155. package/dist/scripts/tmux-hook-engine.js +313 -0
  2156. package/dist/scripts/tmux-hook-engine.js.map +1 -0
  2157. package/dist/scripts/verify-native-agents.d.ts +16 -0
  2158. package/dist/scripts/verify-native-agents.d.ts.map +1 -0
  2159. package/dist/scripts/verify-native-agents.js +247 -0
  2160. package/dist/scripts/verify-native-agents.js.map +1 -0
  2161. package/dist/scripts/verify-native-release-assets.d.ts +3 -0
  2162. package/dist/scripts/verify-native-release-assets.d.ts.map +1 -0
  2163. package/dist/scripts/verify-native-release-assets.js +62 -0
  2164. package/dist/scripts/verify-native-release-assets.js.map +1 -0
  2165. package/dist/session-history/__tests__/search.test.d.ts +2 -0
  2166. package/dist/session-history/__tests__/search.test.d.ts.map +1 -0
  2167. package/dist/session-history/__tests__/search.test.js +150 -0
  2168. package/dist/session-history/__tests__/search.test.js.map +1 -0
  2169. package/dist/session-history/search.d.ts +31 -0
  2170. package/dist/session-history/search.d.ts.map +1 -0
  2171. package/dist/session-history/search.js +331 -0
  2172. package/dist/session-history/search.js.map +1 -0
  2173. package/dist/sidecar/__tests__/boundary.test.d.ts +2 -0
  2174. package/dist/sidecar/__tests__/boundary.test.d.ts.map +1 -0
  2175. package/dist/sidecar/__tests__/boundary.test.js +48 -0
  2176. package/dist/sidecar/__tests__/boundary.test.js.map +1 -0
  2177. package/dist/sidecar/__tests__/collector.test.d.ts +2 -0
  2178. package/dist/sidecar/__tests__/collector.test.d.ts.map +1 -0
  2179. package/dist/sidecar/__tests__/collector.test.js +162 -0
  2180. package/dist/sidecar/__tests__/collector.test.js.map +1 -0
  2181. package/dist/sidecar/__tests__/render.test.d.ts +2 -0
  2182. package/dist/sidecar/__tests__/render.test.d.ts.map +1 -0
  2183. package/dist/sidecar/__tests__/render.test.js +67 -0
  2184. package/dist/sidecar/__tests__/render.test.js.map +1 -0
  2185. package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts +2 -0
  2186. package/dist/sidecar/__tests__/resource-leak-watch.test.d.ts.map +1 -0
  2187. package/dist/sidecar/__tests__/resource-leak-watch.test.js +38 -0
  2188. package/dist/sidecar/__tests__/resource-leak-watch.test.js.map +1 -0
  2189. package/dist/sidecar/__tests__/tmux.test.d.ts +2 -0
  2190. package/dist/sidecar/__tests__/tmux.test.d.ts.map +1 -0
  2191. package/dist/sidecar/__tests__/tmux.test.js +30 -0
  2192. package/dist/sidecar/__tests__/tmux.test.js.map +1 -0
  2193. package/dist/sidecar/__tests__/watch.test.d.ts +2 -0
  2194. package/dist/sidecar/__tests__/watch.test.d.ts.map +1 -0
  2195. package/dist/sidecar/__tests__/watch.test.js +42 -0
  2196. package/dist/sidecar/__tests__/watch.test.js.map +1 -0
  2197. package/dist/sidecar/collector.d.ts +4 -0
  2198. package/dist/sidecar/collector.d.ts.map +1 -0
  2199. package/dist/sidecar/collector.js +377 -0
  2200. package/dist/sidecar/collector.js.map +1 -0
  2201. package/dist/sidecar/index.d.ts +25 -0
  2202. package/dist/sidecar/index.d.ts.map +1 -0
  2203. package/dist/sidecar/index.js +182 -0
  2204. package/dist/sidecar/index.js.map +1 -0
  2205. package/dist/sidecar/render.d.ts +3 -0
  2206. package/dist/sidecar/render.d.ts.map +1 -0
  2207. package/dist/sidecar/render.js +72 -0
  2208. package/dist/sidecar/render.js.map +1 -0
  2209. package/dist/sidecar/tmux.d.ts +13 -0
  2210. package/dist/sidecar/tmux.d.ts.map +1 -0
  2211. package/dist/sidecar/tmux.js +44 -0
  2212. package/dist/sidecar/tmux.js.map +1 -0
  2213. package/dist/sidecar/types.d.ts +125 -0
  2214. package/dist/sidecar/types.d.ts.map +1 -0
  2215. package/dist/sidecar/types.js +2 -0
  2216. package/dist/sidecar/types.js.map +1 -0
  2217. package/dist/state/__tests__/mode-state-context.test.d.ts +2 -0
  2218. package/dist/state/__tests__/mode-state-context.test.d.ts.map +1 -0
  2219. package/dist/state/__tests__/mode-state-context.test.js +35 -0
  2220. package/dist/state/__tests__/mode-state-context.test.js.map +1 -0
  2221. package/dist/state/__tests__/operations-ralph-phase.test.d.ts +2 -0
  2222. package/dist/state/__tests__/operations-ralph-phase.test.d.ts.map +1 -0
  2223. package/dist/state/__tests__/operations-ralph-phase.test.js +190 -0
  2224. package/dist/state/__tests__/operations-ralph-phase.test.js.map +1 -0
  2225. package/dist/state/__tests__/operations.test.d.ts +2 -0
  2226. package/dist/state/__tests__/operations.test.d.ts.map +1 -0
  2227. package/dist/state/__tests__/operations.test.js +2753 -0
  2228. package/dist/state/__tests__/operations.test.js.map +1 -0
  2229. package/dist/state/__tests__/path-traversal.test.d.ts +2 -0
  2230. package/dist/state/__tests__/path-traversal.test.d.ts.map +1 -0
  2231. package/dist/state/__tests__/path-traversal.test.js +49 -0
  2232. package/dist/state/__tests__/path-traversal.test.js.map +1 -0
  2233. package/dist/state/__tests__/planning-gate.test.d.ts +2 -0
  2234. package/dist/state/__tests__/planning-gate.test.d.ts.map +1 -0
  2235. package/dist/state/__tests__/planning-gate.test.js +219 -0
  2236. package/dist/state/__tests__/planning-gate.test.js.map +1 -0
  2237. package/dist/state/__tests__/skill-active.test.d.ts +2 -0
  2238. package/dist/state/__tests__/skill-active.test.d.ts.map +1 -0
  2239. package/dist/state/__tests__/skill-active.test.js +314 -0
  2240. package/dist/state/__tests__/skill-active.test.js.map +1 -0
  2241. package/dist/state/__tests__/workflow-transition.test.d.ts +2 -0
  2242. package/dist/state/__tests__/workflow-transition.test.d.ts.map +1 -0
  2243. package/dist/state/__tests__/workflow-transition.test.js +293 -0
  2244. package/dist/state/__tests__/workflow-transition.test.js.map +1 -0
  2245. package/dist/state/mode-state-context.d.ts +14 -0
  2246. package/dist/state/mode-state-context.d.ts.map +1 -0
  2247. package/dist/state/mode-state-context.js +49 -0
  2248. package/dist/state/mode-state-context.js.map +1 -0
  2249. package/dist/state/operations.d.ts +13 -0
  2250. package/dist/state/operations.d.ts.map +1 -0
  2251. package/dist/state/operations.js +544 -0
  2252. package/dist/state/operations.js.map +1 -0
  2253. package/dist/state/paths.d.ts +3 -0
  2254. package/dist/state/paths.d.ts.map +1 -0
  2255. package/dist/state/paths.js +2 -0
  2256. package/dist/state/paths.js.map +1 -0
  2257. package/dist/state/skill-active.d.ts +64 -0
  2258. package/dist/state/skill-active.d.ts.map +1 -0
  2259. package/dist/state/skill-active.js +375 -0
  2260. package/dist/state/skill-active.js.map +1 -0
  2261. package/dist/state/workflow-transition-reconcile.d.ts +22 -0
  2262. package/dist/state/workflow-transition-reconcile.d.ts.map +1 -0
  2263. package/dist/state/workflow-transition-reconcile.js +144 -0
  2264. package/dist/state/workflow-transition-reconcile.js.map +1 -0
  2265. package/dist/state/workflow-transition.d.ts +45 -0
  2266. package/dist/state/workflow-transition.d.ts.map +1 -0
  2267. package/dist/state/workflow-transition.js +268 -0
  2268. package/dist/state/workflow-transition.js.map +1 -0
  2269. package/dist/subagents/__tests__/tracker.test.d.ts +2 -0
  2270. package/dist/subagents/__tests__/tracker.test.d.ts.map +1 -0
  2271. package/dist/subagents/__tests__/tracker.test.js +255 -0
  2272. package/dist/subagents/__tests__/tracker.test.js.map +1 -0
  2273. package/dist/subagents/tracker.d.ts +60 -0
  2274. package/dist/subagents/tracker.d.ts.map +1 -0
  2275. package/dist/subagents/tracker.js +229 -0
  2276. package/dist/subagents/tracker.js.map +1 -0
  2277. package/dist/team/__tests__/allocation-policy.test.d.ts +2 -0
  2278. package/dist/team/__tests__/allocation-policy.test.d.ts.map +1 -0
  2279. package/dist/team/__tests__/allocation-policy.test.js +111 -0
  2280. package/dist/team/__tests__/allocation-policy.test.js.map +1 -0
  2281. package/dist/team/__tests__/api-interop.test.d.ts +2 -0
  2282. package/dist/team/__tests__/api-interop.test.d.ts.map +1 -0
  2283. package/dist/team/__tests__/api-interop.test.js +2321 -0
  2284. package/dist/team/__tests__/api-interop.test.js.map +1 -0
  2285. package/dist/team/__tests__/approved-execution.test.d.ts +2 -0
  2286. package/dist/team/__tests__/approved-execution.test.d.ts.map +1 -0
  2287. package/dist/team/__tests__/approved-execution.test.js +304 -0
  2288. package/dist/team/__tests__/approved-execution.test.js.map +1 -0
  2289. package/dist/team/__tests__/commit-hygiene.test.d.ts +2 -0
  2290. package/dist/team/__tests__/commit-hygiene.test.d.ts.map +1 -0
  2291. package/dist/team/__tests__/commit-hygiene.test.js +93 -0
  2292. package/dist/team/__tests__/commit-hygiene.test.js.map +1 -0
  2293. package/dist/team/__tests__/coordination-protocol.test.d.ts +2 -0
  2294. package/dist/team/__tests__/coordination-protocol.test.d.ts.map +1 -0
  2295. package/dist/team/__tests__/coordination-protocol.test.js +173 -0
  2296. package/dist/team/__tests__/coordination-protocol.test.js.map +1 -0
  2297. package/dist/team/__tests__/cross-rebase-smoke.test.d.ts +2 -0
  2298. package/dist/team/__tests__/cross-rebase-smoke.test.d.ts.map +1 -0
  2299. package/dist/team/__tests__/cross-rebase-smoke.test.js +161 -0
  2300. package/dist/team/__tests__/cross-rebase-smoke.test.js.map +1 -0
  2301. package/dist/team/__tests__/current-task-baseline.test.d.ts +2 -0
  2302. package/dist/team/__tests__/current-task-baseline.test.d.ts.map +1 -0
  2303. package/dist/team/__tests__/current-task-baseline.test.js +87 -0
  2304. package/dist/team/__tests__/current-task-baseline.test.js.map +1 -0
  2305. package/dist/team/__tests__/delegation-policy.test.d.ts +2 -0
  2306. package/dist/team/__tests__/delegation-policy.test.d.ts.map +1 -0
  2307. package/dist/team/__tests__/delegation-policy.test.js +69 -0
  2308. package/dist/team/__tests__/delegation-policy.test.js.map +1 -0
  2309. package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts +2 -0
  2310. package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts.map +1 -0
  2311. package/dist/team/__tests__/delivery-e2e-smoke.test.js +677 -0
  2312. package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -0
  2313. package/dist/team/__tests__/delivery-log.test.d.ts +2 -0
  2314. package/dist/team/__tests__/delivery-log.test.d.ts.map +1 -0
  2315. package/dist/team/__tests__/delivery-log.test.js +62 -0
  2316. package/dist/team/__tests__/delivery-log.test.js.map +1 -0
  2317. package/dist/team/__tests__/events.test.d.ts +2 -0
  2318. package/dist/team/__tests__/events.test.d.ts.map +1 -0
  2319. package/dist/team/__tests__/events.test.js +313 -0
  2320. package/dist/team/__tests__/events.test.js.map +1 -0
  2321. package/dist/team/__tests__/followup-planner.test.d.ts +2 -0
  2322. package/dist/team/__tests__/followup-planner.test.d.ts.map +1 -0
  2323. package/dist/team/__tests__/followup-planner.test.js +100 -0
  2324. package/dist/team/__tests__/followup-planner.test.js.map +1 -0
  2325. package/dist/team/__tests__/hardening-e2e.test.d.ts +2 -0
  2326. package/dist/team/__tests__/hardening-e2e.test.d.ts.map +1 -0
  2327. package/dist/team/__tests__/hardening-e2e.test.js +98 -0
  2328. package/dist/team/__tests__/hardening-e2e.test.js.map +1 -0
  2329. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +2 -0
  2330. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +1 -0
  2331. package/dist/team/__tests__/hook-primary-e2e-contract.test.js +78 -0
  2332. package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +1 -0
  2333. package/dist/team/__tests__/idle-nudge.test.d.ts +2 -0
  2334. package/dist/team/__tests__/idle-nudge.test.d.ts.map +1 -0
  2335. package/dist/team/__tests__/idle-nudge.test.js +230 -0
  2336. package/dist/team/__tests__/idle-nudge.test.js.map +1 -0
  2337. package/dist/team/__tests__/leader-activity.test.d.ts +2 -0
  2338. package/dist/team/__tests__/leader-activity.test.d.ts.map +1 -0
  2339. package/dist/team/__tests__/leader-activity.test.js +261 -0
  2340. package/dist/team/__tests__/leader-activity.test.js.map +1 -0
  2341. package/dist/team/__tests__/mcp-comm.test.d.ts +2 -0
  2342. package/dist/team/__tests__/mcp-comm.test.d.ts.map +1 -0
  2343. package/dist/team/__tests__/mcp-comm.test.js +289 -0
  2344. package/dist/team/__tests__/mcp-comm.test.js.map +1 -0
  2345. package/dist/team/__tests__/model-contract.test.d.ts +2 -0
  2346. package/dist/team/__tests__/model-contract.test.d.ts.map +1 -0
  2347. package/dist/team/__tests__/model-contract.test.js +187 -0
  2348. package/dist/team/__tests__/model-contract.test.js.map +1 -0
  2349. package/dist/team/__tests__/orchestrator.test.d.ts +2 -0
  2350. package/dist/team/__tests__/orchestrator.test.d.ts.map +1 -0
  2351. package/dist/team/__tests__/orchestrator.test.js +111 -0
  2352. package/dist/team/__tests__/orchestrator.test.js.map +1 -0
  2353. package/dist/team/__tests__/phase-controller.test.d.ts +2 -0
  2354. package/dist/team/__tests__/phase-controller.test.d.ts.map +1 -0
  2355. package/dist/team/__tests__/phase-controller.test.js +50 -0
  2356. package/dist/team/__tests__/phase-controller.test.js.map +1 -0
  2357. package/dist/team/__tests__/rebalance-policy.test.d.ts +2 -0
  2358. package/dist/team/__tests__/rebalance-policy.test.d.ts.map +1 -0
  2359. package/dist/team/__tests__/rebalance-policy.test.js +168 -0
  2360. package/dist/team/__tests__/rebalance-policy.test.js.map +1 -0
  2361. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +2 -0
  2362. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +1 -0
  2363. package/dist/team/__tests__/repo-aware-decomposition.test.js +156 -0
  2364. package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -0
  2365. package/dist/team/__tests__/role-router.test.d.ts +2 -0
  2366. package/dist/team/__tests__/role-router.test.d.ts.map +1 -0
  2367. package/dist/team/__tests__/role-router.test.js +263 -0
  2368. package/dist/team/__tests__/role-router.test.js.map +1 -0
  2369. package/dist/team/__tests__/runtime-boxed-state.test.d.ts +2 -0
  2370. package/dist/team/__tests__/runtime-boxed-state.test.d.ts.map +1 -0
  2371. package/dist/team/__tests__/runtime-boxed-state.test.js +39 -0
  2372. package/dist/team/__tests__/runtime-boxed-state.test.js.map +1 -0
  2373. package/dist/team/__tests__/runtime-cli.test.d.ts +2 -0
  2374. package/dist/team/__tests__/runtime-cli.test.d.ts.map +1 -0
  2375. package/dist/team/__tests__/runtime-cli.test.js +320 -0
  2376. package/dist/team/__tests__/runtime-cli.test.js.map +1 -0
  2377. package/dist/team/__tests__/runtime.test.d.ts +2 -0
  2378. package/dist/team/__tests__/runtime.test.d.ts.map +1 -0
  2379. package/dist/team/__tests__/runtime.test.js +6464 -0
  2380. package/dist/team/__tests__/runtime.test.js.map +1 -0
  2381. package/dist/team/__tests__/scaling.test.d.ts +2 -0
  2382. package/dist/team/__tests__/scaling.test.d.ts.map +1 -0
  2383. package/dist/team/__tests__/scaling.test.js +1664 -0
  2384. package/dist/team/__tests__/scaling.test.js.map +1 -0
  2385. package/dist/team/__tests__/shutdown-fallback.test.d.ts +2 -0
  2386. package/dist/team/__tests__/shutdown-fallback.test.d.ts.map +1 -0
  2387. package/dist/team/__tests__/shutdown-fallback.test.js +125 -0
  2388. package/dist/team/__tests__/shutdown-fallback.test.js.map +1 -0
  2389. package/dist/team/__tests__/state-root.test.d.ts +2 -0
  2390. package/dist/team/__tests__/state-root.test.d.ts.map +1 -0
  2391. package/dist/team/__tests__/state-root.test.js +208 -0
  2392. package/dist/team/__tests__/state-root.test.js.map +1 -0
  2393. package/dist/team/__tests__/state.test.d.ts +2 -0
  2394. package/dist/team/__tests__/state.test.d.ts.map +1 -0
  2395. package/dist/team/__tests__/state.test.js +1942 -0
  2396. package/dist/team/__tests__/state.test.js.map +1 -0
  2397. package/dist/team/__tests__/team-identity.test.d.ts +2 -0
  2398. package/dist/team/__tests__/team-identity.test.d.ts.map +1 -0
  2399. package/dist/team/__tests__/team-identity.test.js +166 -0
  2400. package/dist/team/__tests__/team-identity.test.js.map +1 -0
  2401. package/dist/team/__tests__/team-ops-contract.test.d.ts +2 -0
  2402. package/dist/team/__tests__/team-ops-contract.test.d.ts.map +1 -0
  2403. package/dist/team/__tests__/team-ops-contract.test.js +96 -0
  2404. package/dist/team/__tests__/team-ops-contract.test.js.map +1 -0
  2405. package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts +2 -0
  2406. package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts.map +1 -0
  2407. package/dist/team/__tests__/tmux-claude-workers-demo.test.js +191 -0
  2408. package/dist/team/__tests__/tmux-claude-workers-demo.test.js.map +1 -0
  2409. package/dist/team/__tests__/tmux-session.test.d.ts +2 -0
  2410. package/dist/team/__tests__/tmux-session.test.d.ts.map +1 -0
  2411. package/dist/team/__tests__/tmux-session.test.js +4546 -0
  2412. package/dist/team/__tests__/tmux-session.test.js.map +1 -0
  2413. package/dist/team/__tests__/tmux-test-fixture.d.ts +20 -0
  2414. package/dist/team/__tests__/tmux-test-fixture.d.ts.map +1 -0
  2415. package/dist/team/__tests__/tmux-test-fixture.js +148 -0
  2416. package/dist/team/__tests__/tmux-test-fixture.js.map +1 -0
  2417. package/dist/team/__tests__/tmux-test-fixture.test.d.ts +2 -0
  2418. package/dist/team/__tests__/tmux-test-fixture.test.d.ts.map +1 -0
  2419. package/dist/team/__tests__/tmux-test-fixture.test.js +114 -0
  2420. package/dist/team/__tests__/tmux-test-fixture.test.js.map +1 -0
  2421. package/dist/team/__tests__/worker-bootstrap.test.d.ts +2 -0
  2422. package/dist/team/__tests__/worker-bootstrap.test.d.ts.map +1 -0
  2423. package/dist/team/__tests__/worker-bootstrap.test.js +1122 -0
  2424. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -0
  2425. package/dist/team/__tests__/worker-runtime-identity.test.d.ts +2 -0
  2426. package/dist/team/__tests__/worker-runtime-identity.test.d.ts.map +1 -0
  2427. package/dist/team/__tests__/worker-runtime-identity.test.js +258 -0
  2428. package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -0
  2429. package/dist/team/__tests__/worktree.test.d.ts +2 -0
  2430. package/dist/team/__tests__/worktree.test.d.ts.map +1 -0
  2431. package/dist/team/__tests__/worktree.test.js +317 -0
  2432. package/dist/team/__tests__/worktree.test.js.map +1 -0
  2433. package/dist/team/allocation-policy.d.ts +29 -0
  2434. package/dist/team/allocation-policy.d.ts.map +1 -0
  2435. package/dist/team/allocation-policy.js +153 -0
  2436. package/dist/team/allocation-policy.js.map +1 -0
  2437. package/dist/team/api-interop.d.ts +20 -0
  2438. package/dist/team/api-interop.d.ts.map +1 -0
  2439. package/dist/team/api-interop.js +1084 -0
  2440. package/dist/team/api-interop.js.map +1 -0
  2441. package/dist/team/approved-execution.d.ts +64 -0
  2442. package/dist/team/approved-execution.d.ts.map +1 -0
  2443. package/dist/team/approved-execution.js +242 -0
  2444. package/dist/team/approved-execution.js.map +1 -0
  2445. package/dist/team/commit-hygiene.d.ts +79 -0
  2446. package/dist/team/commit-hygiene.d.ts.map +1 -0
  2447. package/dist/team/commit-hygiene.js +364 -0
  2448. package/dist/team/commit-hygiene.js.map +1 -0
  2449. package/dist/team/contracts.d.ts +26 -0
  2450. package/dist/team/contracts.d.ts.map +1 -0
  2451. package/dist/team/contracts.js +103 -0
  2452. package/dist/team/contracts.js.map +1 -0
  2453. package/dist/team/coordination-protocol.d.ts +14 -0
  2454. package/dist/team/coordination-protocol.d.ts.map +1 -0
  2455. package/dist/team/coordination-protocol.js +244 -0
  2456. package/dist/team/coordination-protocol.js.map +1 -0
  2457. package/dist/team/current-task-baseline.d.ts +32 -0
  2458. package/dist/team/current-task-baseline.d.ts.map +1 -0
  2459. package/dist/team/current-task-baseline.js +85 -0
  2460. package/dist/team/current-task-baseline.js.map +1 -0
  2461. package/dist/team/dag-schema.d.ts +38 -0
  2462. package/dist/team/dag-schema.d.ts.map +1 -0
  2463. package/dist/team/dag-schema.js +221 -0
  2464. package/dist/team/dag-schema.js.map +1 -0
  2465. package/dist/team/delegation-policy.d.ts +3 -0
  2466. package/dist/team/delegation-policy.d.ts.map +1 -0
  2467. package/dist/team/delegation-policy.js +82 -0
  2468. package/dist/team/delegation-policy.js.map +1 -0
  2469. package/dist/team/delivery-log.d.ts +14 -0
  2470. package/dist/team/delivery-log.d.ts.map +1 -0
  2471. package/dist/team/delivery-log.js +43 -0
  2472. package/dist/team/delivery-log.js.map +1 -0
  2473. package/dist/team/followup-planner.d.ts +45 -0
  2474. package/dist/team/followup-planner.d.ts.map +1 -0
  2475. package/dist/team/followup-planner.js +200 -0
  2476. package/dist/team/followup-planner.js.map +1 -0
  2477. package/dist/team/goal-workflow.d.ts +20 -0
  2478. package/dist/team/goal-workflow.d.ts.map +1 -0
  2479. package/dist/team/goal-workflow.js +57 -0
  2480. package/dist/team/goal-workflow.js.map +1 -0
  2481. package/dist/team/idle-nudge.d.ts +53 -0
  2482. package/dist/team/idle-nudge.d.ts.map +1 -0
  2483. package/dist/team/idle-nudge.js +141 -0
  2484. package/dist/team/idle-nudge.js.map +1 -0
  2485. package/dist/team/leader-activity.d.ts +15 -0
  2486. package/dist/team/leader-activity.d.ts.map +1 -0
  2487. package/dist/team/leader-activity.js +224 -0
  2488. package/dist/team/leader-activity.js.map +1 -0
  2489. package/dist/team/mcp-comm.d.ts +73 -0
  2490. package/dist/team/mcp-comm.d.ts.map +1 -0
  2491. package/dist/team/mcp-comm.js +314 -0
  2492. package/dist/team/mcp-comm.js.map +1 -0
  2493. package/dist/team/model-contract.d.ts +26 -0
  2494. package/dist/team/model-contract.d.ts.map +1 -0
  2495. package/dist/team/model-contract.js +205 -0
  2496. package/dist/team/model-contract.js.map +1 -0
  2497. package/dist/team/orchestrator.d.ts +47 -0
  2498. package/dist/team/orchestrator.d.ts.map +1 -0
  2499. package/dist/team/orchestrator.js +131 -0
  2500. package/dist/team/orchestrator.js.map +1 -0
  2501. package/dist/team/pane-status.d.ts +149 -0
  2502. package/dist/team/pane-status.d.ts.map +1 -0
  2503. package/dist/team/pane-status.js +558 -0
  2504. package/dist/team/pane-status.js.map +1 -0
  2505. package/dist/team/phase-controller.d.ts +12 -0
  2506. package/dist/team/phase-controller.d.ts.map +1 -0
  2507. package/dist/team/phase-controller.js +142 -0
  2508. package/dist/team/phase-controller.js.map +1 -0
  2509. package/dist/team/progress-evidence.d.ts +2 -0
  2510. package/dist/team/progress-evidence.d.ts.map +1 -0
  2511. package/dist/team/progress-evidence.js +77 -0
  2512. package/dist/team/progress-evidence.js.map +1 -0
  2513. package/dist/team/rebalance-policy.d.ts +19 -0
  2514. package/dist/team/rebalance-policy.d.ts.map +1 -0
  2515. package/dist/team/rebalance-policy.js +48 -0
  2516. package/dist/team/rebalance-policy.js.map +1 -0
  2517. package/dist/team/reminder-intents.d.ts +11 -0
  2518. package/dist/team/reminder-intents.d.ts.map +1 -0
  2519. package/dist/team/reminder-intents.js +40 -0
  2520. package/dist/team/reminder-intents.js.map +1 -0
  2521. package/dist/team/repo-aware-decomposition.d.ts +68 -0
  2522. package/dist/team/repo-aware-decomposition.d.ts.map +1 -0
  2523. package/dist/team/repo-aware-decomposition.js +235 -0
  2524. package/dist/team/repo-aware-decomposition.js.map +1 -0
  2525. package/dist/team/role-router.d.ts +32 -0
  2526. package/dist/team/role-router.d.ts.map +1 -0
  2527. package/dist/team/role-router.js +298 -0
  2528. package/dist/team/role-router.js.map +1 -0
  2529. package/dist/team/runtime-cli.d.ts +78 -0
  2530. package/dist/team/runtime-cli.d.ts.map +1 -0
  2531. package/dist/team/runtime-cli.js +376 -0
  2532. package/dist/team/runtime-cli.js.map +1 -0
  2533. package/dist/team/runtime.d.ts +162 -0
  2534. package/dist/team/runtime.d.ts.map +1 -0
  2535. package/dist/team/runtime.js +4160 -0
  2536. package/dist/team/runtime.js.map +1 -0
  2537. package/dist/team/scaling.d.ts +59 -0
  2538. package/dist/team/scaling.d.ts.map +1 -0
  2539. package/dist/team/scaling.js +650 -0
  2540. package/dist/team/scaling.js.map +1 -0
  2541. package/dist/team/state/approvals.d.ts +25 -0
  2542. package/dist/team/state/approvals.d.ts.map +1 -0
  2543. package/dist/team/state/approvals.js +31 -0
  2544. package/dist/team/state/approvals.js.map +1 -0
  2545. package/dist/team/state/config.d.ts +2 -0
  2546. package/dist/team/state/config.d.ts.map +1 -0
  2547. package/dist/team/state/config.js +2 -0
  2548. package/dist/team/state/config.js.map +1 -0
  2549. package/dist/team/state/dispatch-lock.d.ts +3 -0
  2550. package/dist/team/state/dispatch-lock.d.ts.map +1 -0
  2551. package/dist/team/state/dispatch-lock.js +81 -0
  2552. package/dist/team/state/dispatch-lock.js.map +1 -0
  2553. package/dist/team/state/dispatch.d.ts +67 -0
  2554. package/dist/team/state/dispatch.d.ts.map +1 -0
  2555. package/dist/team/state/dispatch.js +302 -0
  2556. package/dist/team/state/dispatch.js.map +1 -0
  2557. package/dist/team/state/events.d.ts +26 -0
  2558. package/dist/team/state/events.d.ts.map +1 -0
  2559. package/dist/team/state/events.js +145 -0
  2560. package/dist/team/state/events.js.map +1 -0
  2561. package/dist/team/state/index.d.ts +11 -0
  2562. package/dist/team/state/index.d.ts.map +1 -0
  2563. package/dist/team/state/index.js +11 -0
  2564. package/dist/team/state/index.js.map +1 -0
  2565. package/dist/team/state/io.d.ts +2 -0
  2566. package/dist/team/state/io.d.ts.map +1 -0
  2567. package/dist/team/state/io.js +2 -0
  2568. package/dist/team/state/io.js.map +1 -0
  2569. package/dist/team/state/locks.d.ts +16 -0
  2570. package/dist/team/state/locks.d.ts.map +1 -0
  2571. package/dist/team/state/locks.js +201 -0
  2572. package/dist/team/state/locks.js.map +1 -0
  2573. package/dist/team/state/mailbox.d.ts +43 -0
  2574. package/dist/team/state/mailbox.d.ts.map +1 -0
  2575. package/dist/team/state/mailbox.js +222 -0
  2576. package/dist/team/state/mailbox.js.map +1 -0
  2577. package/dist/team/state/monitor.d.ts +108 -0
  2578. package/dist/team/state/monitor.d.ts.map +1 -0
  2579. package/dist/team/state/monitor.js +193 -0
  2580. package/dist/team/state/monitor.js.map +1 -0
  2581. package/dist/team/state/shutdown.d.ts +2 -0
  2582. package/dist/team/state/shutdown.d.ts.map +1 -0
  2583. package/dist/team/state/shutdown.js +2 -0
  2584. package/dist/team/state/shutdown.js.map +1 -0
  2585. package/dist/team/state/summary.d.ts +2 -0
  2586. package/dist/team/state/summary.d.ts.map +1 -0
  2587. package/dist/team/state/summary.js +2 -0
  2588. package/dist/team/state/summary.js.map +1 -0
  2589. package/dist/team/state/tasks.d.ts +53 -0
  2590. package/dist/team/state/tasks.d.ts.map +1 -0
  2591. package/dist/team/state/tasks.js +284 -0
  2592. package/dist/team/state/tasks.js.map +1 -0
  2593. package/dist/team/state/types.d.ts +356 -0
  2594. package/dist/team/state/types.d.ts.map +1 -0
  2595. package/dist/team/state/types.js +3 -0
  2596. package/dist/team/state/types.js.map +1 -0
  2597. package/dist/team/state/workers.d.ts +2 -0
  2598. package/dist/team/state/workers.d.ts.map +1 -0
  2599. package/dist/team/state/workers.js +2 -0
  2600. package/dist/team/state/workers.js.map +1 -0
  2601. package/dist/team/state-root.d.ts +40 -0
  2602. package/dist/team/state-root.d.ts.map +1 -0
  2603. package/dist/team/state-root.js +297 -0
  2604. package/dist/team/state-root.js.map +1 -0
  2605. package/dist/team/state.d.ts +471 -0
  2606. package/dist/team/state.d.ts.map +1 -0
  2607. package/dist/team/state.js +1418 -0
  2608. package/dist/team/state.js.map +1 -0
  2609. package/dist/team/team-identity.d.ts +26 -0
  2610. package/dist/team/team-identity.d.ts.map +1 -0
  2611. package/dist/team/team-identity.js +169 -0
  2612. package/dist/team/team-identity.js.map +1 -0
  2613. package/dist/team/team-ops.d.ts +66 -0
  2614. package/dist/team/team-ops.d.ts.map +1 -0
  2615. package/dist/team/team-ops.js +79 -0
  2616. package/dist/team/team-ops.js.map +1 -0
  2617. package/dist/team/tmux-session.d.ts +190 -0
  2618. package/dist/team/tmux-session.d.ts.map +1 -0
  2619. package/dist/team/tmux-session.js +2071 -0
  2620. package/dist/team/tmux-session.js.map +1 -0
  2621. package/dist/team/ultragoal-context.d.ts +47 -0
  2622. package/dist/team/ultragoal-context.d.ts.map +1 -0
  2623. package/dist/team/ultragoal-context.js +215 -0
  2624. package/dist/team/ultragoal-context.js.map +1 -0
  2625. package/dist/team/worker-bootstrap.d.ts +92 -0
  2626. package/dist/team/worker-bootstrap.d.ts.map +1 -0
  2627. package/dist/team/worker-bootstrap.js +860 -0
  2628. package/dist/team/worker-bootstrap.js.map +1 -0
  2629. package/dist/team/worktree.d.ts +69 -0
  2630. package/dist/team/worktree.d.ts.map +1 -0
  2631. package/dist/team/worktree.js +437 -0
  2632. package/dist/team/worktree.js.map +1 -0
  2633. package/dist/ultragoal/__tests__/artifacts.test.d.ts +2 -0
  2634. package/dist/ultragoal/__tests__/artifacts.test.d.ts.map +1 -0
  2635. package/dist/ultragoal/__tests__/artifacts.test.js +1423 -0
  2636. package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -0
  2637. package/dist/ultragoal/__tests__/docs-contract.test.d.ts +2 -0
  2638. package/dist/ultragoal/__tests__/docs-contract.test.d.ts.map +1 -0
  2639. package/dist/ultragoal/__tests__/docs-contract.test.js +132 -0
  2640. package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -0
  2641. package/dist/ultragoal/__tests__/steering-fixtures.d.ts +68 -0
  2642. package/dist/ultragoal/__tests__/steering-fixtures.d.ts.map +1 -0
  2643. package/dist/ultragoal/__tests__/steering-fixtures.js +259 -0
  2644. package/dist/ultragoal/__tests__/steering-fixtures.js.map +1 -0
  2645. package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts +2 -0
  2646. package/dist/ultragoal/__tests__/steering-fixtures.test.d.ts.map +1 -0
  2647. package/dist/ultragoal/__tests__/steering-fixtures.test.js +65 -0
  2648. package/dist/ultragoal/__tests__/steering-fixtures.test.js.map +1 -0
  2649. package/dist/ultragoal/artifacts.d.ts +249 -0
  2650. package/dist/ultragoal/artifacts.d.ts.map +1 -0
  2651. package/dist/ultragoal/artifacts.js +1349 -0
  2652. package/dist/ultragoal/artifacts.js.map +1 -0
  2653. package/dist/utils/__tests__/agents-md.test.d.ts +2 -0
  2654. package/dist/utils/__tests__/agents-md.test.d.ts.map +1 -0
  2655. package/dist/utils/__tests__/agents-md.test.js +96 -0
  2656. package/dist/utils/__tests__/agents-md.test.js.map +1 -0
  2657. package/dist/utils/__tests__/agents-model-table.test.d.ts +2 -0
  2658. package/dist/utils/__tests__/agents-model-table.test.d.ts.map +1 -0
  2659. package/dist/utils/__tests__/agents-model-table.test.js +108 -0
  2660. package/dist/utils/__tests__/agents-model-table.test.js.map +1 -0
  2661. package/dist/utils/__tests__/dep-versions.test.d.ts +2 -0
  2662. package/dist/utils/__tests__/dep-versions.test.d.ts.map +1 -0
  2663. package/dist/utils/__tests__/dep-versions.test.js +46 -0
  2664. package/dist/utils/__tests__/dep-versions.test.js.map +1 -0
  2665. package/dist/utils/__tests__/package.test.d.ts +2 -0
  2666. package/dist/utils/__tests__/package.test.d.ts.map +1 -0
  2667. package/dist/utils/__tests__/package.test.js +21 -0
  2668. package/dist/utils/__tests__/package.test.js.map +1 -0
  2669. package/dist/utils/__tests__/paths.test.d.ts +2 -0
  2670. package/dist/utils/__tests__/paths.test.d.ts.map +1 -0
  2671. package/dist/utils/__tests__/paths.test.js +647 -0
  2672. package/dist/utils/__tests__/paths.test.js.map +1 -0
  2673. package/dist/utils/__tests__/platform-command.test.d.ts +2 -0
  2674. package/dist/utils/__tests__/platform-command.test.d.ts.map +1 -0
  2675. package/dist/utils/__tests__/platform-command.test.js +399 -0
  2676. package/dist/utils/__tests__/platform-command.test.js.map +1 -0
  2677. package/dist/utils/__tests__/repo-deps.test.d.ts +2 -0
  2678. package/dist/utils/__tests__/repo-deps.test.d.ts.map +1 -0
  2679. package/dist/utils/__tests__/repo-deps.test.js +71 -0
  2680. package/dist/utils/__tests__/repo-deps.test.js.map +1 -0
  2681. package/dist/utils/__tests__/sleep-resource.test.d.ts +2 -0
  2682. package/dist/utils/__tests__/sleep-resource.test.d.ts.map +1 -0
  2683. package/dist/utils/__tests__/sleep-resource.test.js +39 -0
  2684. package/dist/utils/__tests__/sleep-resource.test.js.map +1 -0
  2685. package/dist/utils/__tests__/version.test.d.ts +2 -0
  2686. package/dist/utils/__tests__/version.test.d.ts.map +1 -0
  2687. package/dist/utils/__tests__/version.test.js +78 -0
  2688. package/dist/utils/__tests__/version.test.js.map +1 -0
  2689. package/dist/utils/agents-md.d.ts +10 -0
  2690. package/dist/utils/agents-md.d.ts.map +1 -0
  2691. package/dist/utils/agents-md.js +76 -0
  2692. package/dist/utils/agents-md.js.map +1 -0
  2693. package/dist/utils/agents-model-table.d.ts +16 -0
  2694. package/dist/utils/agents-model-table.d.ts.map +1 -0
  2695. package/dist/utils/agents-model-table.js +102 -0
  2696. package/dist/utils/agents-model-table.js.map +1 -0
  2697. package/dist/utils/git-layout.d.ts +8 -0
  2698. package/dist/utils/git-layout.d.ts.map +1 -0
  2699. package/dist/utils/git-layout.js +58 -0
  2700. package/dist/utils/git-layout.js.map +1 -0
  2701. package/dist/utils/package.d.ts +9 -0
  2702. package/dist/utils/package.d.ts.map +1 -0
  2703. package/dist/utils/package.js +31 -0
  2704. package/dist/utils/package.js.map +1 -0
  2705. package/dist/utils/paths.d.ts +101 -0
  2706. package/dist/utils/paths.d.ts.map +1 -0
  2707. package/dist/utils/paths.js +314 -0
  2708. package/dist/utils/paths.js.map +1 -0
  2709. package/dist/utils/platform-command.d.ts +29 -0
  2710. package/dist/utils/platform-command.d.ts.map +1 -0
  2711. package/dist/utils/platform-command.js +239 -0
  2712. package/dist/utils/platform-command.js.map +1 -0
  2713. package/dist/utils/repo-deps.d.ts +20 -0
  2714. package/dist/utils/repo-deps.d.ts.map +1 -0
  2715. package/dist/utils/repo-deps.js +78 -0
  2716. package/dist/utils/repo-deps.js.map +1 -0
  2717. package/dist/utils/safe-json.d.ts +3 -0
  2718. package/dist/utils/safe-json.d.ts.map +1 -0
  2719. package/dist/utils/safe-json.js +19 -0
  2720. package/dist/utils/safe-json.js.map +1 -0
  2721. package/dist/utils/sleep.d.ts +3 -0
  2722. package/dist/utils/sleep.d.ts.map +1 -0
  2723. package/dist/utils/sleep.js +35 -0
  2724. package/dist/utils/sleep.js.map +1 -0
  2725. package/dist/utils/toml.d.ts +4 -0
  2726. package/dist/utils/toml.d.ts.map +1 -0
  2727. package/dist/utils/toml.js +75 -0
  2728. package/dist/utils/toml.js.map +1 -0
  2729. package/dist/utils/version.d.ts +7 -0
  2730. package/dist/utils/version.d.ts.map +1 -0
  2731. package/dist/utils/version.js +72 -0
  2732. package/dist/utils/version.js.map +1 -0
  2733. package/dist/verification/__tests__/ci-rust-gates.test.d.ts +2 -0
  2734. package/dist/verification/__tests__/ci-rust-gates.test.d.ts.map +1 -0
  2735. package/dist/verification/__tests__/ci-rust-gates.test.js +293 -0
  2736. package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -0
  2737. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts +2 -0
  2738. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts.map +1 -0
  2739. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +68 -0
  2740. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +1 -0
  2741. package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts +2 -0
  2742. package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts.map +1 -0
  2743. package/dist/verification/__tests__/explore-harness-release-workflow.test.js +74 -0
  2744. package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -0
  2745. package/dist/verification/__tests__/native-release-manifest.test.d.ts +2 -0
  2746. package/dist/verification/__tests__/native-release-manifest.test.d.ts.map +1 -0
  2747. package/dist/verification/__tests__/native-release-manifest.test.js +80 -0
  2748. package/dist/verification/__tests__/native-release-manifest.test.js.map +1 -0
  2749. package/dist/verification/__tests__/pr-check-workflow.test.d.ts +2 -0
  2750. package/dist/verification/__tests__/pr-check-workflow.test.d.ts.map +1 -0
  2751. package/dist/verification/__tests__/pr-check-workflow.test.js +27 -0
  2752. package/dist/verification/__tests__/pr-check-workflow.test.js.map +1 -0
  2753. package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts +2 -0
  2754. package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts.map +1 -0
  2755. package/dist/verification/__tests__/ralph-persistence-gate.test.js +55 -0
  2756. package/dist/verification/__tests__/ralph-persistence-gate.test.js.map +1 -0
  2757. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts +2 -0
  2758. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts.map +1 -0
  2759. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js +32 -0
  2760. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js.map +1 -0
  2761. package/dist/verification/__tests__/verifier.test.d.ts +2 -0
  2762. package/dist/verification/__tests__/verifier.test.d.ts.map +1 -0
  2763. package/dist/verification/__tests__/verifier.test.js +113 -0
  2764. package/dist/verification/__tests__/verifier.test.js.map +1 -0
  2765. package/dist/verification/verifier.d.ts +37 -0
  2766. package/dist/verification/verifier.d.ts.map +1 -0
  2767. package/dist/verification/verifier.js +100 -0
  2768. package/dist/verification/verifier.js.map +1 -0
  2769. package/dist/visual/__tests__/verdict.test.d.ts +2 -0
  2770. package/dist/visual/__tests__/verdict.test.d.ts.map +1 -0
  2771. package/dist/visual/__tests__/verdict.test.js +81 -0
  2772. package/dist/visual/__tests__/verdict.test.js.map +1 -0
  2773. package/dist/visual/constants.d.ts +4 -0
  2774. package/dist/visual/constants.d.ts.map +1 -0
  2775. package/dist/visual/constants.js +3 -0
  2776. package/dist/visual/constants.js.map +1 -0
  2777. package/dist/visual/verdict.d.ts +17 -0
  2778. package/dist/visual/verdict.d.ts.map +1 -0
  2779. package/dist/visual/verdict.js +61 -0
  2780. package/dist/visual/verdict.js.map +1 -0
  2781. package/dist/wiki/__tests__/cjk-tokenize.test.d.ts +12 -0
  2782. package/dist/wiki/__tests__/cjk-tokenize.test.d.ts.map +1 -0
  2783. package/dist/wiki/__tests__/cjk-tokenize.test.js +139 -0
  2784. package/dist/wiki/__tests__/cjk-tokenize.test.js.map +1 -0
  2785. package/dist/wiki/__tests__/crlf-parse.test.d.ts +2 -0
  2786. package/dist/wiki/__tests__/crlf-parse.test.d.ts.map +1 -0
  2787. package/dist/wiki/__tests__/crlf-parse.test.js +24 -0
  2788. package/dist/wiki/__tests__/crlf-parse.test.js.map +1 -0
  2789. package/dist/wiki/__tests__/escape-newline.test.d.ts +2 -0
  2790. package/dist/wiki/__tests__/escape-newline.test.d.ts.map +1 -0
  2791. package/dist/wiki/__tests__/escape-newline.test.js +45 -0
  2792. package/dist/wiki/__tests__/escape-newline.test.js.map +1 -0
  2793. package/dist/wiki/__tests__/ingest.test.d.ts +5 -0
  2794. package/dist/wiki/__tests__/ingest.test.d.ts.map +1 -0
  2795. package/dist/wiki/__tests__/ingest.test.js +215 -0
  2796. package/dist/wiki/__tests__/ingest.test.js.map +1 -0
  2797. package/dist/wiki/__tests__/lint.test.d.ts +5 -0
  2798. package/dist/wiki/__tests__/lint.test.d.ts.map +1 -0
  2799. package/dist/wiki/__tests__/lint.test.js +176 -0
  2800. package/dist/wiki/__tests__/lint.test.js.map +1 -0
  2801. package/dist/wiki/__tests__/query.test.d.ts +5 -0
  2802. package/dist/wiki/__tests__/query.test.d.ts.map +1 -0
  2803. package/dist/wiki/__tests__/query.test.js +166 -0
  2804. package/dist/wiki/__tests__/query.test.js.map +1 -0
  2805. package/dist/wiki/__tests__/reserved-file-guard.test.d.ts +2 -0
  2806. package/dist/wiki/__tests__/reserved-file-guard.test.d.ts.map +1 -0
  2807. package/dist/wiki/__tests__/reserved-file-guard.test.js +44 -0
  2808. package/dist/wiki/__tests__/reserved-file-guard.test.js.map +1 -0
  2809. package/dist/wiki/__tests__/session-hooks.test.d.ts +5 -0
  2810. package/dist/wiki/__tests__/session-hooks.test.d.ts.map +1 -0
  2811. package/dist/wiki/__tests__/session-hooks.test.js +64 -0
  2812. package/dist/wiki/__tests__/session-hooks.test.js.map +1 -0
  2813. package/dist/wiki/__tests__/slug-nonascii.test.d.ts +2 -0
  2814. package/dist/wiki/__tests__/slug-nonascii.test.d.ts.map +1 -0
  2815. package/dist/wiki/__tests__/slug-nonascii.test.js +30 -0
  2816. package/dist/wiki/__tests__/slug-nonascii.test.js.map +1 -0
  2817. package/dist/wiki/__tests__/storage.test.d.ts +5 -0
  2818. package/dist/wiki/__tests__/storage.test.d.ts.map +1 -0
  2819. package/dist/wiki/__tests__/storage.test.js +318 -0
  2820. package/dist/wiki/__tests__/storage.test.js.map +1 -0
  2821. package/dist/wiki/__tests__/test-helpers.d.ts +31 -0
  2822. package/dist/wiki/__tests__/test-helpers.d.ts.map +1 -0
  2823. package/dist/wiki/__tests__/test-helpers.js +108 -0
  2824. package/dist/wiki/__tests__/test-helpers.js.map +1 -0
  2825. package/dist/wiki/index.d.ts +14 -0
  2826. package/dist/wiki/index.d.ts.map +1 -0
  2827. package/dist/wiki/index.js +17 -0
  2828. package/dist/wiki/index.js.map +1 -0
  2829. package/dist/wiki/ingest.d.ts +20 -0
  2830. package/dist/wiki/ingest.d.ts.map +1 -0
  2831. package/dist/wiki/ingest.js +115 -0
  2832. package/dist/wiki/ingest.js.map +1 -0
  2833. package/dist/wiki/lifecycle.d.ts +25 -0
  2834. package/dist/wiki/lifecycle.d.ts.map +1 -0
  2835. package/dist/wiki/lifecycle.js +239 -0
  2836. package/dist/wiki/lifecycle.js.map +1 -0
  2837. package/dist/wiki/lint.d.ts +25 -0
  2838. package/dist/wiki/lint.d.ts.map +1 -0
  2839. package/dist/wiki/lint.js +170 -0
  2840. package/dist/wiki/lint.js.map +1 -0
  2841. package/dist/wiki/query.d.ts +36 -0
  2842. package/dist/wiki/query.d.ts.map +1 -0
  2843. package/dist/wiki/query.js +139 -0
  2844. package/dist/wiki/query.js.map +1 -0
  2845. package/dist/wiki/storage.d.ts +37 -0
  2846. package/dist/wiki/storage.d.ts.map +1 -0
  2847. package/dist/wiki/storage.js +358 -0
  2848. package/dist/wiki/storage.js.map +1 -0
  2849. package/dist/wiki/types.d.ts +83 -0
  2850. package/dist/wiki/types.d.ts.map +1 -0
  2851. package/dist/wiki/types.js +15 -0
  2852. package/dist/wiki/types.js.map +1 -0
  2853. package/package.json +110 -0
  2854. package/plugins/oh-my-codex/.app.json +3 -0
  2855. package/plugins/oh-my-codex/.codex-plugin/plugin.json +31 -0
  2856. package/plugins/oh-my-codex/.mcp.json +52 -0
  2857. package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +420 -0
  2858. package/plugins/oh-my-codex/hooks/hooks.json +76 -0
  2859. package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +148 -0
  2860. package/plugins/oh-my-codex/skills/analyze/SKILL.md +146 -0
  2861. package/plugins/oh-my-codex/skills/ask/SKILL.md +58 -0
  2862. package/plugins/oh-my-codex/skills/autopilot/SKILL.md +215 -0
  2863. package/plugins/oh-my-codex/skills/autoresearch/SKILL.md +72 -0
  2864. package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +36 -0
  2865. package/plugins/oh-my-codex/skills/best-practice-research/SKILL.md +88 -0
  2866. package/plugins/oh-my-codex/skills/cancel/SKILL.md +399 -0
  2867. package/plugins/oh-my-codex/skills/code-review/SKILL.md +292 -0
  2868. package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +287 -0
  2869. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +579 -0
  2870. package/plugins/oh-my-codex/skills/design/SKILL.md +180 -0
  2871. package/plugins/oh-my-codex/skills/doctor/SKILL.md +239 -0
  2872. package/plugins/oh-my-codex/skills/hud/SKILL.md +98 -0
  2873. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +135 -0
  2874. package/plugins/oh-my-codex/skills/performance-goal/SKILL.md +65 -0
  2875. package/plugins/oh-my-codex/skills/pipeline/SKILL.md +97 -0
  2876. package/plugins/oh-my-codex/skills/plan/SKILL.md +277 -0
  2877. package/plugins/oh-my-codex/skills/prometheus-strict/README.md +35 -0
  2878. package/plugins/oh-my-codex/skills/prometheus-strict/SKILL.md +219 -0
  2879. package/plugins/oh-my-codex/skills/ralph/SKILL.md +294 -0
  2880. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +203 -0
  2881. package/plugins/oh-my-codex/skills/skill/SKILL.md +836 -0
  2882. package/plugins/oh-my-codex/skills/team/SKILL.md +536 -0
  2883. package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +139 -0
  2884. package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +263 -0
  2885. package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +190 -0
  2886. package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +161 -0
  2887. package/plugins/oh-my-codex/skills/wiki/SKILL.md +57 -0
  2888. package/plugins/oh-my-codex/skills/worker/SKILL.md +120 -0
  2889. package/prompts/analyst.md +135 -0
  2890. package/prompts/api-reviewer.md +113 -0
  2891. package/prompts/architect.md +111 -0
  2892. package/prompts/build-fixer.md +115 -0
  2893. package/prompts/code-reviewer.md +139 -0
  2894. package/prompts/code-simplifier.md +134 -0
  2895. package/prompts/critic.md +80 -0
  2896. package/prompts/debugger.md +117 -0
  2897. package/prompts/dependency-expert.md +129 -0
  2898. package/prompts/designer.md +126 -0
  2899. package/prompts/executor.md +108 -0
  2900. package/prompts/explore-harness.md +64 -0
  2901. package/prompts/explore.md +85 -0
  2902. package/prompts/git-master.md +114 -0
  2903. package/prompts/information-architect.md +226 -0
  2904. package/prompts/performance-reviewer.md +109 -0
  2905. package/prompts/planner.md +110 -0
  2906. package/prompts/product-analyst.md +304 -0
  2907. package/prompts/product-manager.md +245 -0
  2908. package/prompts/prometheus-strict-metis.md +274 -0
  2909. package/prompts/prometheus-strict-momus.md +82 -0
  2910. package/prompts/prometheus-strict-oracle.md +107 -0
  2911. package/prompts/qa-tester.md +124 -0
  2912. package/prompts/quality-reviewer.md +123 -0
  2913. package/prompts/quality-strategist.md +274 -0
  2914. package/prompts/researcher.md +122 -0
  2915. package/prompts/scholastic.md +11 -0
  2916. package/prompts/security-reviewer.md +143 -0
  2917. package/prompts/sisyphus-lite.md +111 -0
  2918. package/prompts/style-reviewer.md +102 -0
  2919. package/prompts/team-executor.md +57 -0
  2920. package/prompts/team-orchestrator.md +8 -0
  2921. package/prompts/test-engineer.md +130 -0
  2922. package/prompts/ux-researcher.md +327 -0
  2923. package/prompts/verifier.md +85 -0
  2924. package/prompts/vision.md +98 -0
  2925. package/prompts/writer.md +109 -0
  2926. package/skills/ai-slop-cleaner/SKILL.md +148 -0
  2927. package/skills/analyze/SKILL.md +146 -0
  2928. package/skills/ask/SKILL.md +58 -0
  2929. package/skills/ask-claude/SKILL.md +12 -0
  2930. package/skills/ask-gemini/SKILL.md +12 -0
  2931. package/skills/autopilot/SKILL.md +215 -0
  2932. package/skills/autoresearch/SKILL.md +72 -0
  2933. package/skills/autoresearch-goal/SKILL.md +36 -0
  2934. package/skills/best-practice-research/SKILL.md +88 -0
  2935. package/skills/build-fix/SKILL.md +10 -0
  2936. package/skills/cancel/SKILL.md +399 -0
  2937. package/skills/code-review/SKILL.md +292 -0
  2938. package/skills/configure-notifications/SKILL.md +287 -0
  2939. package/skills/deep-interview/SKILL.md +579 -0
  2940. package/skills/deepsearch/SKILL.md +10 -0
  2941. package/skills/design/SKILL.md +180 -0
  2942. package/skills/doctor/SKILL.md +239 -0
  2943. package/skills/ecomode/SKILL.md +114 -0
  2944. package/skills/frontend-ui-ux/SKILL.md +16 -0
  2945. package/skills/git-master/SKILL.md +27 -0
  2946. package/skills/help/SKILL.md +10 -0
  2947. package/skills/hud/SKILL.md +98 -0
  2948. package/skills/note/SKILL.md +10 -0
  2949. package/skills/omx-setup/SKILL.md +135 -0
  2950. package/skills/performance-goal/SKILL.md +65 -0
  2951. package/skills/pipeline/SKILL.md +97 -0
  2952. package/skills/plan/SKILL.md +277 -0
  2953. package/skills/prometheus-strict/README.md +35 -0
  2954. package/skills/prometheus-strict/SKILL.md +219 -0
  2955. package/skills/ralph/SKILL.md +294 -0
  2956. package/skills/ralph-init/SKILL.md +10 -0
  2957. package/skills/ralplan/SKILL.md +203 -0
  2958. package/skills/review/SKILL.md +10 -0
  2959. package/skills/security-review/SKILL.md +10 -0
  2960. package/skills/skill/SKILL.md +836 -0
  2961. package/skills/swarm/SKILL.md +12 -0
  2962. package/skills/tdd/SKILL.md +104 -0
  2963. package/skills/team/SKILL.md +536 -0
  2964. package/skills/trace/SKILL.md +10 -0
  2965. package/skills/ultragoal/SKILL.md +139 -0
  2966. package/skills/ultraqa/SKILL.md +263 -0
  2967. package/skills/ultrawork/SKILL.md +190 -0
  2968. package/skills/visual-ralph/SKILL.md +161 -0
  2969. package/skills/visual-verdict/SKILL.md +10 -0
  2970. package/skills/web-clone/SKILL.md +357 -0
  2971. package/skills/wiki/SKILL.md +57 -0
  2972. package/skills/worker/SKILL.md +120 -0
  2973. package/src/scripts/__tests__/codex-native-hook.test.ts +17173 -0
  2974. package/src/scripts/__tests__/docs-site-contract.test.ts +47 -0
  2975. package/src/scripts/__tests__/generate-release-body.test.ts +275 -0
  2976. package/src/scripts/__tests__/hook-derived-watcher.test.ts +285 -0
  2977. package/src/scripts/__tests__/notify-dispatcher.test.ts +504 -0
  2978. package/src/scripts/__tests__/notify-state-io.test.ts +168 -0
  2979. package/src/scripts/__tests__/notify-tmux-injection.test.ts +82 -0
  2980. package/src/scripts/__tests__/postinstall.test.ts +113 -0
  2981. package/src/scripts/__tests__/prompt-inventory.test.ts +64 -0
  2982. package/src/scripts/__tests__/run-test-files.test.ts +455 -0
  2983. package/src/scripts/__tests__/smoke-packed-install.test.ts +192 -0
  2984. package/src/scripts/__tests__/test-reply-listener-live.test.ts +101 -0
  2985. package/src/scripts/__tests__/verify-native-agents.test.ts +299 -0
  2986. package/src/scripts/ask-claude.sh +17 -0
  2987. package/src/scripts/ask-gemini.sh +14 -0
  2988. package/src/scripts/build-api.ts +48 -0
  2989. package/src/scripts/build-explore-harness.ts +54 -0
  2990. package/src/scripts/build-sparkshell.ts +52 -0
  2991. package/src/scripts/check-runtime-syntax.ts +63 -0
  2992. package/src/scripts/check-version-sync.ts +54 -0
  2993. package/src/scripts/cleanup-explore-harness.ts +18 -0
  2994. package/src/scripts/codex-execution-surface.ts +75 -0
  2995. package/src/scripts/codex-native-hook.ts +4877 -0
  2996. package/src/scripts/codex-native-pre-post.ts +1360 -0
  2997. package/src/scripts/demo-claude-workers.sh +241 -0
  2998. package/src/scripts/demo-team-e2e.sh +184 -0
  2999. package/src/scripts/eval/eval-adaptive-sort-optimization.py +24 -0
  3000. package/src/scripts/eval/eval-candidate-handoff.ts +8 -0
  3001. package/src/scripts/eval/eval-cli-discoverability.ts +40 -0
  3002. package/src/scripts/eval/eval-fresh-run-tagging.ts +8 -0
  3003. package/src/scripts/eval/eval-help-consistency.ts +11 -0
  3004. package/src/scripts/eval/eval-in-action-cat-shellout-demo.ts +31 -0
  3005. package/src/scripts/eval/eval-ml-kaggle-model-optimization.py +29 -0
  3006. package/src/scripts/eval/eval-noisy-bayesopt-highdim.py +44 -0
  3007. package/src/scripts/eval/eval-noisy-latent-subspace-discovery.py +44 -0
  3008. package/src/scripts/eval/eval-parity-smoke.ts +20 -0
  3009. package/src/scripts/eval/eval-parity-sweep.ts +26 -0
  3010. package/src/scripts/eval/eval-resume-dirty-guard.ts +8 -0
  3011. package/src/scripts/eval/eval-security-path-traversal.ts +38 -0
  3012. package/src/scripts/fixtures/ask-advisor-stub.ts +12 -0
  3013. package/src/scripts/generate-catalog-docs.ts +112 -0
  3014. package/src/scripts/generate-native-release-manifest.ts +147 -0
  3015. package/src/scripts/generate-release-body.ts +327 -0
  3016. package/src/scripts/hook-derived-watcher.ts +649 -0
  3017. package/src/scripts/hook-payload-guard.ts +113 -0
  3018. package/src/scripts/notify-dispatcher.ts +408 -0
  3019. package/src/scripts/notify-fallback-watcher.ts +2022 -0
  3020. package/src/scripts/notify-hook/__tests__/operational-events.test.ts +24 -0
  3021. package/src/scripts/notify-hook/__tests__/payload-guard.test.ts +41 -0
  3022. package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +180 -0
  3023. package/src/scripts/notify-hook/active-team.ts +55 -0
  3024. package/src/scripts/notify-hook/auto-nudge.ts +758 -0
  3025. package/src/scripts/notify-hook/log.ts +30 -0
  3026. package/src/scripts/notify-hook/managed-tmux.ts +568 -0
  3027. package/src/scripts/notify-hook/operational-events.ts +282 -0
  3028. package/src/scripts/notify-hook/orchestration-intent.ts +80 -0
  3029. package/src/scripts/notify-hook/payload-parser.ts +143 -0
  3030. package/src/scripts/notify-hook/process-runner.ts +75 -0
  3031. package/src/scripts/notify-hook/ralph-session-resume.ts +465 -0
  3032. package/src/scripts/notify-hook/state-io.ts +220 -0
  3033. package/src/scripts/notify-hook/team-dispatch.ts +1162 -0
  3034. package/src/scripts/notify-hook/team-leader-nudge.ts +1068 -0
  3035. package/src/scripts/notify-hook/team-tmux-guard.ts +236 -0
  3036. package/src/scripts/notify-hook/team-worker-posttooluse.ts +536 -0
  3037. package/src/scripts/notify-hook/team-worker-stop.ts +438 -0
  3038. package/src/scripts/notify-hook/team-worker.ts +709 -0
  3039. package/src/scripts/notify-hook/tmux-injection.ts +740 -0
  3040. package/src/scripts/notify-hook/utils.ts +31 -0
  3041. package/src/scripts/notify-hook/visual-verdict.ts +158 -0
  3042. package/src/scripts/notify-hook.ts +1033 -0
  3043. package/src/scripts/postinstall.ts +107 -0
  3044. package/src/scripts/prepare-build.js +83 -0
  3045. package/src/scripts/prompt-inventory.ts +218 -0
  3046. package/src/scripts/run-autoresearch-showcase.sh +75 -0
  3047. package/src/scripts/run-provider-advisor.ts +213 -0
  3048. package/src/scripts/run-test-files.ts +379 -0
  3049. package/src/scripts/smoke-packed-install.ts +268 -0
  3050. package/src/scripts/sync-plugin-mirror.ts +458 -0
  3051. package/src/scripts/sync-prompt-guidance-fragments.ts +55 -0
  3052. package/src/scripts/team-hardening-benchmark.ts +90 -0
  3053. package/src/scripts/test-reply-listener-live.ts +188 -0
  3054. package/src/scripts/test-sparkshell.ts +29 -0
  3055. package/src/scripts/tmux-hook-engine.ts +349 -0
  3056. package/src/scripts/verify-native-agents.ts +311 -0
  3057. package/src/scripts/verify-native-release-assets.ts +68 -0
  3058. package/templates/AGENTS.md +187 -0
  3059. package/templates/catalog-manifest.json +547 -0
  3060. package/templates/model-instructions/explore-lightweight-AGENTS.md +11 -0
  3061. package/templates/model-instructions/sparkshell-lightweight-AGENTS.md +10 -0
@@ -0,0 +1,2997 @@
1
+ use serde::{Deserialize, Serialize};
2
+ use serde_json::{json, Value};
3
+ use std::collections::BTreeMap;
4
+ use std::env;
5
+ use std::fs;
6
+ use std::io::{self, BufRead, BufReader, Read, Write};
7
+ use std::net::{IpAddr, Shutdown, TcpListener, TcpStream};
8
+ use std::path::{Path, PathBuf};
9
+ use std::process::{Child, Command, Stdio};
10
+ use std::sync::atomic::{AtomicBool, Ordering};
11
+ use std::sync::{Arc, Mutex};
12
+ use std::time::{Duration, SystemTime, UNIX_EPOCH};
13
+
14
+ pub type Result<T> = std::result::Result<T, OmxApiError>;
15
+
16
+ pub const DEFAULT_API_PORT: u16 = 14510;
17
+ pub const MAX_HTTP_HEADER_BYTES: usize = 64 * 1024;
18
+ pub const MAX_HTTP_BODY_BYTES: usize = 4 * 1024 * 1024;
19
+ const CODEX_RESPONSES_PATH: &str = "/responses";
20
+ const CODEX_IMAGES_GENERATIONS_PATH: &str = "/images/generations";
21
+ const CODEX_DEFAULT_ORIGINATOR: &str = "codex_cli_rs";
22
+ const CODEX_DEFAULT_BACKEND_BASE_PATH: &str = "/backend-api/codex";
23
+ const CODEX_INSTALLATION_ID_HEADER: &str = "x-codex-installation-id";
24
+ const CODEX_WINDOW_ID_HEADER: &str = "x-codex-window-id";
25
+
26
+ #[derive(Debug)]
27
+ pub enum OmxApiError {
28
+ Io(io::Error),
29
+ Json(serde_json::Error),
30
+ Message(String),
31
+ }
32
+
33
+ impl std::fmt::Display for OmxApiError {
34
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
35
+ match self {
36
+ Self::Io(error) => write!(f, "{error}"),
37
+ Self::Json(error) => write!(f, "{error}"),
38
+ Self::Message(message) => f.write_str(message),
39
+ }
40
+ }
41
+ }
42
+
43
+ impl std::error::Error for OmxApiError {}
44
+
45
+ impl From<io::Error> for OmxApiError {
46
+ fn from(error: io::Error) -> Self {
47
+ Self::Io(error)
48
+ }
49
+ }
50
+
51
+ impl From<serde_json::Error> for OmxApiError {
52
+ fn from(error: serde_json::Error) -> Self {
53
+ Self::Json(error)
54
+ }
55
+ }
56
+
57
+ #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
58
+ #[serde(rename_all = "kebab-case")]
59
+ pub enum BackendMode {
60
+ Mock,
61
+ RealPrivate,
62
+ }
63
+
64
+ impl BackendMode {
65
+ fn parse(value: &str) -> Result<Self> {
66
+ match value {
67
+ "mock" => Ok(Self::Mock),
68
+ "real-private" => Ok(Self::RealPrivate),
69
+ other => Err(OmxApiError::Message(format!(
70
+ "unsupported backend mode '{other}'; expected mock or real-private"
71
+ ))),
72
+ }
73
+ }
74
+
75
+ fn as_str(&self) -> &'static str {
76
+ match self {
77
+ Self::Mock => "mock",
78
+ Self::RealPrivate => "real-private",
79
+ }
80
+ }
81
+ }
82
+
83
+ #[derive(Clone, Debug, Serialize, Deserialize)]
84
+ pub struct ServerConfig {
85
+ pub host: String,
86
+ pub port: u16,
87
+ pub backend: BackendMode,
88
+ pub state_file: PathBuf,
89
+ pub once: bool,
90
+ pub daemon: bool,
91
+ pub local_bearer_token: Option<String>,
92
+ }
93
+
94
+ impl Default for ServerConfig {
95
+ fn default() -> Self {
96
+ Self {
97
+ host: "127.0.0.1".to_string(),
98
+ port: DEFAULT_API_PORT,
99
+ backend: BackendMode::Mock,
100
+ state_file: default_state_file(),
101
+ once: false,
102
+ daemon: false,
103
+ local_bearer_token: None,
104
+ }
105
+ }
106
+ }
107
+
108
+ #[derive(Clone, Debug, Serialize, Deserialize)]
109
+ pub struct DaemonState {
110
+ pub pid: u32,
111
+ pub host: String,
112
+ pub port: u16,
113
+ pub backend: BackendMode,
114
+ pub started_at_unix: u64,
115
+ #[serde(skip)]
116
+ pub local_bearer_token: Option<String>,
117
+ #[serde(skip_serializing_if = "Option::is_none")]
118
+ pub local_bearer_token_file: Option<PathBuf>,
119
+ }
120
+
121
+ impl DaemonState {
122
+ pub fn base_url(&self) -> String {
123
+ format!("http://{}:{}", self.host, self.port)
124
+ }
125
+ }
126
+
127
+ #[derive(Clone, Debug, Default, Serialize, Deserialize)]
128
+ pub struct TelemetrySnapshot {
129
+ pub requests_total: u64,
130
+ pub by_route: BTreeMap<String, u64>,
131
+ }
132
+
133
+ #[derive(Debug, Default)]
134
+ pub struct Telemetry {
135
+ inner: Mutex<TelemetrySnapshot>,
136
+ }
137
+
138
+ impl Telemetry {
139
+ pub fn record(&self, route: &str) {
140
+ let mut inner = self.inner.lock().expect("telemetry lock poisoned");
141
+ inner.requests_total += 1;
142
+ *inner.by_route.entry(route.to_string()).or_insert(0) += 1;
143
+ }
144
+
145
+ pub fn snapshot(&self) -> TelemetrySnapshot {
146
+ self.inner.lock().expect("telemetry lock poisoned").clone()
147
+ }
148
+ }
149
+
150
+ #[derive(Clone, Debug)]
151
+ pub struct Request {
152
+ pub method: String,
153
+ pub path: String,
154
+ pub headers: BTreeMap<String, String>,
155
+ pub body: Vec<u8>,
156
+ }
157
+
158
+ #[derive(Clone, Debug)]
159
+ pub struct Response {
160
+ pub status: u16,
161
+ pub content_type: String,
162
+ pub body: Vec<u8>,
163
+ pub extra_headers: Vec<(String, String)>,
164
+ }
165
+
166
+ impl Response {
167
+ pub fn json(status: u16, value: Value) -> Self {
168
+ let body = serde_json::to_vec(&value).expect("JSON serialization should not fail");
169
+ Self {
170
+ status,
171
+ content_type: "application/json".to_string(),
172
+ body,
173
+ extra_headers: Vec::new(),
174
+ }
175
+ }
176
+
177
+ pub fn text(status: u16, content_type: &str, body: impl Into<Vec<u8>>) -> Self {
178
+ Self {
179
+ status,
180
+ content_type: content_type.to_string(),
181
+ body: body.into(),
182
+ extra_headers: Vec::new(),
183
+ }
184
+ }
185
+ }
186
+
187
+ pub fn default_state_file() -> PathBuf {
188
+ env::temp_dir().join("omx-api-daemon.json")
189
+ }
190
+
191
+ pub fn write_daemon_state(path: impl AsRef<Path>, state: &DaemonState) -> Result<()> {
192
+ let path = path.as_ref();
193
+ if let Some(parent) = path.parent() {
194
+ fs::create_dir_all(parent)?;
195
+ }
196
+ let bytes = serde_json::to_vec_pretty(state)?;
197
+ fs::write(path, bytes)?;
198
+ Ok(())
199
+ }
200
+
201
+ pub fn read_daemon_state(path: impl AsRef<Path>) -> Result<Option<DaemonState>> {
202
+ let path = path.as_ref();
203
+ if !path.exists() {
204
+ return Ok(None);
205
+ }
206
+ let bytes = fs::read(path)?;
207
+ Ok(Some(serde_json::from_slice(&bytes)?))
208
+ }
209
+
210
+ pub fn remove_daemon_state(path: impl AsRef<Path>) -> Result<()> {
211
+ let path = path.as_ref();
212
+ match fs::remove_file(path) {
213
+ Ok(()) => Ok(()),
214
+ Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),
215
+ Err(error) => Err(error.into()),
216
+ }
217
+ }
218
+
219
+ fn token_file_for_state(path: impl AsRef<Path>) -> PathBuf {
220
+ let mut path = path.as_ref().to_path_buf();
221
+ path.set_extension("token");
222
+ path
223
+ }
224
+
225
+ fn write_local_bearer_token(path: impl AsRef<Path>, token: &str) -> Result<()> {
226
+ let path = path.as_ref();
227
+ if let Some(parent) = path.parent() {
228
+ fs::create_dir_all(parent)?;
229
+ }
230
+ #[cfg(unix)]
231
+ {
232
+ use std::os::unix::fs::OpenOptionsExt;
233
+ let mut file = fs::OpenOptions::new()
234
+ .create(true)
235
+ .truncate(true)
236
+ .write(true)
237
+ .mode(0o600)
238
+ .open(path)?;
239
+ file.write_all(token.as_bytes())?;
240
+ Ok(())
241
+ }
242
+ #[cfg(not(unix))]
243
+ {
244
+ fs::write(path, token)?;
245
+ Ok(())
246
+ }
247
+ }
248
+
249
+ fn read_local_bearer_token(path: impl AsRef<Path>) -> Result<Option<String>> {
250
+ let path = path.as_ref();
251
+ if !path.exists() {
252
+ return Ok(None);
253
+ }
254
+ Ok(Some(fs::read_to_string(path)?.trim().to_string()).filter(|token| !token.is_empty()))
255
+ }
256
+
257
+ fn remove_local_bearer_token(path: impl AsRef<Path>) -> Result<()> {
258
+ match fs::remove_file(path) {
259
+ Ok(()) => Ok(()),
260
+ Err(error) if error.kind() == io::ErrorKind::NotFound => Ok(()),
261
+ Err(error) => Err(error.into()),
262
+ }
263
+ }
264
+
265
+ pub fn redact_secrets(input: &str) -> String {
266
+ let mut out = String::with_capacity(input.len());
267
+ let mut redact_next = false;
268
+ for (index, token) in input.split_whitespace().enumerate() {
269
+ if index > 0 {
270
+ out.push(' ');
271
+ }
272
+ let lower = token.to_ascii_lowercase();
273
+ if redact_next
274
+ || lower.starts_with("sk-")
275
+ || lower.starts_with("sess-")
276
+ || lower.starts_with("bearer")
277
+ || lower.contains("api_key=")
278
+ || lower.contains("apikey=")
279
+ || lower.contains("authorization:")
280
+ {
281
+ out.push_str("[REDACTED]");
282
+ redact_next =
283
+ lower == "bearer" || lower.ends_with("bearer") || lower.contains("authorization:");
284
+ } else {
285
+ out.push_str(token);
286
+ redact_next = false;
287
+ }
288
+ }
289
+ redact_secret_markers(&redact_key_value_secret_fragments(
290
+ &redact_json_secret_values(&out),
291
+ ))
292
+ }
293
+
294
+ fn redact_json_secret_values(input: &str) -> String {
295
+ let mut value: Value = match serde_json::from_str(input) {
296
+ Ok(value) => value,
297
+ Err(_) => return input.to_string(),
298
+ };
299
+ redact_value(&mut value);
300
+ serde_json::to_string(&value).unwrap_or_else(|_| input.to_string())
301
+ }
302
+
303
+ fn redact_key_value_secret_fragments(input: &str) -> String {
304
+ let mut output = input.to_string();
305
+ let secret_keys = [
306
+ "access_token",
307
+ "api_key",
308
+ "apikey",
309
+ "auth_token",
310
+ "authorization",
311
+ "password",
312
+ "secret",
313
+ "token",
314
+ ];
315
+ let mut search_start = 0;
316
+ loop {
317
+ if search_start >= output.len() {
318
+ break;
319
+ }
320
+ let lower = output[search_start..].to_ascii_lowercase();
321
+ let Some((relative_key_start, key)) = secret_keys
322
+ .iter()
323
+ .filter_map(|key| lower.find(key).map(|index| (index, *key)))
324
+ .min_by_key(|(index, _)| *index)
325
+ else {
326
+ break;
327
+ };
328
+ let key_start = search_start + relative_key_start;
329
+ let key_end = key_start + key.len();
330
+ let after_key = &output[key_end..];
331
+ let Some(delimiter_offset) = after_key.char_indices().find_map(|(offset, ch)| match ch {
332
+ '=' | ':' => Some(offset),
333
+ '"' | '\'' | ' ' | '\t' => None,
334
+ _ => Some(usize::MAX),
335
+ }) else {
336
+ break;
337
+ };
338
+ if delimiter_offset == usize::MAX {
339
+ search_start = key_end;
340
+ continue;
341
+ }
342
+ let delimiter = key_end + delimiter_offset;
343
+ let mut value_start = delimiter + 1;
344
+ while output
345
+ .as_bytes()
346
+ .get(value_start)
347
+ .is_some_and(u8::is_ascii_whitespace)
348
+ {
349
+ value_start += 1;
350
+ }
351
+ let quote = output
352
+ .as_bytes()
353
+ .get(value_start)
354
+ .copied()
355
+ .filter(|byte| *byte == b'"' || *byte == b'\'');
356
+ if quote.is_some() {
357
+ value_start += 1;
358
+ }
359
+ let mut value_end = if let Some(quote) = quote {
360
+ output
361
+ .as_bytes()
362
+ .get(value_start..)
363
+ .and_then(|tail| tail.iter().position(|byte| *byte == quote))
364
+ .map(|offset| value_start + offset)
365
+ .unwrap_or_else(|| find_secret_end(&output, value_start))
366
+ } else {
367
+ find_secret_end(&output, value_start)
368
+ };
369
+ if value_end <= value_start {
370
+ search_start = key_end;
371
+ continue;
372
+ }
373
+ if quote.is_none() {
374
+ value_end = value_end
375
+ .min(
376
+ output[value_start..]
377
+ .find(',')
378
+ .map(|offset| value_start + offset)
379
+ .unwrap_or(output.len()),
380
+ )
381
+ .min(
382
+ output[value_start..]
383
+ .find('}')
384
+ .map(|offset| value_start + offset)
385
+ .unwrap_or(output.len()),
386
+ );
387
+ }
388
+ output.replace_range(value_start..value_end, "[REDACTED]");
389
+ search_start = value_start + "[REDACTED]".len();
390
+ }
391
+ output
392
+ }
393
+
394
+ fn redact_secret_markers(input: &str) -> String {
395
+ let mut output = input.to_string();
396
+ for marker in ["sk-", "ghp_", "xoxb-"] {
397
+ while let Some(start) = output.find(marker) {
398
+ let end = find_secret_end(&output, start);
399
+ output.replace_range(start..end, "[REDACTED]");
400
+ }
401
+ }
402
+ output
403
+ }
404
+
405
+ fn find_secret_end(text: &str, start: usize) -> usize {
406
+ text[start..]
407
+ .char_indices()
408
+ .find_map(|(offset, ch)| {
409
+ if ch.is_whitespace() || matches!(ch, ',' | ';' | ')' | ']' | '}') {
410
+ Some(start + offset)
411
+ } else {
412
+ None
413
+ }
414
+ })
415
+ .unwrap_or(text.len())
416
+ }
417
+
418
+ fn redact_value(value: &mut Value) {
419
+ match value {
420
+ Value::Object(map) => {
421
+ for (key, nested) in map {
422
+ let key = key.to_ascii_lowercase();
423
+ if key.contains("key")
424
+ || key.contains("token")
425
+ || key.contains("secret")
426
+ || key == "authorization"
427
+ {
428
+ *nested = Value::String("[REDACTED]".to_string());
429
+ } else {
430
+ redact_value(nested);
431
+ }
432
+ }
433
+ }
434
+ Value::Array(items) => {
435
+ for item in items {
436
+ redact_value(item);
437
+ }
438
+ }
439
+ Value::String(text) if text.starts_with("sk-") || text.starts_with("Bearer ") => {
440
+ *text = "[REDACTED]".to_string();
441
+ }
442
+ _ => {}
443
+ }
444
+ }
445
+
446
+ pub fn sse_event(event: Option<&str>, data: &Value) -> String {
447
+ let mut output = String::new();
448
+ if let Some(event) = event {
449
+ output.push_str("event: ");
450
+ output.push_str(event);
451
+ output.push('\n');
452
+ }
453
+ let json = serde_json::to_string(data).expect("JSON serialization should not fail");
454
+ for line in json.lines() {
455
+ output.push_str("data: ");
456
+ output.push_str(line);
457
+ output.push('\n');
458
+ }
459
+ output.push('\n');
460
+ output
461
+ }
462
+
463
+ pub fn sse_done() -> String {
464
+ "data: [DONE]\n\n".to_string()
465
+ }
466
+
467
+ pub fn route_request(
468
+ request: &Request,
469
+ backend: &BackendMode,
470
+ telemetry: &Telemetry,
471
+ shutdown: Option<&AtomicBool>,
472
+ expected_bearer: Option<&str>,
473
+ ) -> Response {
474
+ let route = canonical_route(&request.path);
475
+ telemetry.record(route);
476
+
477
+ if let Some(expected) = expected_bearer.filter(|token| !token.is_empty()) {
478
+ if !has_matching_local_bearer(request, expected) {
479
+ return Response::json(
480
+ 401,
481
+ json!({
482
+ "error": {
483
+ "message": "matching local bearer token required",
484
+ "type": "unauthorized"
485
+ }
486
+ }),
487
+ );
488
+ }
489
+ } else if local_bearer_required() && !has_local_bearer(request) {
490
+ return Response::json(
491
+ 401,
492
+ json!({
493
+ "error": {
494
+ "message": "local bearer token required by OMX_API_REQUIRE_LOCAL_BEARER",
495
+ "type": "unauthorized"
496
+ }
497
+ }),
498
+ );
499
+ }
500
+
501
+ match (request.method.as_str(), request.path.as_str()) {
502
+ ("GET", "/health") => Response::json(
503
+ 200,
504
+ json!({
505
+ "status": "ok",
506
+ "backend": backend.as_str(),
507
+ }),
508
+ ),
509
+ ("GET", "/v1/models") => Response::json(
510
+ 200,
511
+ json!({
512
+ "object": "list",
513
+ "data": [
514
+ {"id": "omx-mock", "object": "model", "owned_by": "omx"},
515
+ {"id": "omx-private", "object": "model", "owned_by": "local"}
516
+ ]
517
+ }),
518
+ ),
519
+ ("POST", "/v1/responses") => responses_response(request, backend),
520
+ ("POST", "/v1/chat/completions") => chat_response(request, backend),
521
+ ("POST", "/v1/images/generations") => image_response(request, backend),
522
+ ("GET", "/__admin/telemetry") => Response::json(200, json!(telemetry.snapshot())),
523
+ ("POST", "/__admin/stop") => {
524
+ if let Some(flag) = shutdown {
525
+ flag.store(true, Ordering::SeqCst);
526
+ }
527
+ Response::json(200, json!({"status": "stopping"}))
528
+ }
529
+ _ => Response::json(
530
+ 404,
531
+ json!({
532
+ "error": {
533
+ "message": format!("no route for {} {}", request.method, request.path),
534
+ "type": "not_found"
535
+ }
536
+ }),
537
+ ),
538
+ }
539
+ }
540
+
541
+ fn local_bearer_required() -> bool {
542
+ env::var("OMX_API_REQUIRE_LOCAL_BEARER")
543
+ .ok()
544
+ .map(|value| matches!(value.trim(), "1" | "true" | "TRUE" | "yes" | "on"))
545
+ .unwrap_or(false)
546
+ }
547
+
548
+ fn has_matching_local_bearer(request: &Request, expected: &str) -> bool {
549
+ request
550
+ .headers
551
+ .get("authorization")
552
+ .and_then(|value| value.strip_prefix("Bearer "))
553
+ .map(str::trim)
554
+ .is_some_and(|token| token == expected)
555
+ }
556
+
557
+ fn has_local_bearer(request: &Request) -> bool {
558
+ request
559
+ .headers
560
+ .get("authorization")
561
+ .and_then(|value| value.strip_prefix("Bearer "))
562
+ .map(str::trim)
563
+ .filter(|token| !token.is_empty())
564
+ .is_some()
565
+ }
566
+
567
+ fn canonical_route(path: &str) -> &'static str {
568
+ match path {
569
+ "/health" => "/health",
570
+ "/v1/models" => "/v1/models",
571
+ "/v1/responses" => "/v1/responses",
572
+ "/v1/chat/completions" => "/v1/chat/completions",
573
+ "/v1/images/generations" => "/v1/images/generations",
574
+ "/__admin/telemetry" => "/__admin/telemetry",
575
+ "/__admin/stop" => "/__admin/stop",
576
+ _ => "unknown",
577
+ }
578
+ }
579
+
580
+ fn responses_response(request: &Request, backend: &BackendMode) -> Response {
581
+ let body = match parse_json_body(request) {
582
+ Ok(body) => body,
583
+ Err(response) => return response,
584
+ };
585
+ if body.get("stream").and_then(Value::as_bool).unwrap_or(false) {
586
+ if *backend == BackendMode::RealPrivate {
587
+ return real_private_text_response(&body, "response", true);
588
+ }
589
+ let payload = json!({"type": "message", "delta": "omx mock response"});
590
+ let mut stream = sse_event(Some("response.output_text.delta"), &payload);
591
+ stream.push_str(&sse_done());
592
+ return Response::text(200, "text/event-stream", stream.into_bytes());
593
+ }
594
+
595
+ if *backend == BackendMode::RealPrivate {
596
+ return real_private_text_response(&body, "response", false);
597
+ }
598
+
599
+ let input = extract_prompt(&body);
600
+ Response::json(
601
+ 200,
602
+ json!({
603
+ "id": format!("omx-{}", now_unix()),
604
+ "object": "response",
605
+ "model": body.get("model").and_then(Value::as_str).unwrap_or("omx-mock"),
606
+ "backend": backend.as_str(),
607
+ "output_text": format!("omx mock response to: {}", redact_secrets(&input)),
608
+ "choices": [{
609
+ "index": 0,
610
+ "message": {"role": "assistant", "content": "omx mock response"},
611
+ "finish_reason": "stop"
612
+ }]
613
+ }),
614
+ )
615
+ }
616
+
617
+ fn chat_response(request: &Request, backend: &BackendMode) -> Response {
618
+ let body = match parse_json_body(request) {
619
+ Ok(body) => body,
620
+ Err(response) => return response,
621
+ };
622
+ if body.get("stream").and_then(Value::as_bool).unwrap_or(false) {
623
+ let text = if *backend == BackendMode::RealPrivate {
624
+ match real_private_text(&body) {
625
+ Ok(text) => text,
626
+ Err((status, kind, message)) => {
627
+ return Response::json(
628
+ status,
629
+ json!({"error": {"message": message, "type": kind}}),
630
+ );
631
+ }
632
+ }
633
+ } else {
634
+ "omx mock response".to_string()
635
+ };
636
+ let chunk = json!({
637
+ "id": format!("chatcmpl-omx-{}", now_unix()),
638
+ "object": "chat.completion.chunk",
639
+ "choices": [{"index": 0, "delta": {"content": text}, "finish_reason": null}]
640
+ });
641
+ let mut stream = sse_event(None, &chunk);
642
+ stream.push_str(&sse_done());
643
+ return Response::text(200, "text/event-stream", stream.into_bytes());
644
+ }
645
+ if *backend == BackendMode::RealPrivate {
646
+ return real_private_text_response(&body, "chat.completion", false);
647
+ }
648
+ Response::json(
649
+ 200,
650
+ json!({
651
+ "id": format!("chatcmpl-omx-{}", now_unix()),
652
+ "object": "chat.completion",
653
+ "model": body.get("model").and_then(Value::as_str).unwrap_or("omx-mock"),
654
+ "backend": backend.as_str(),
655
+ "choices": [{
656
+ "index": 0,
657
+ "message": {"role": "assistant", "content": "omx mock response"},
658
+ "finish_reason": "stop"
659
+ }]
660
+ }),
661
+ )
662
+ }
663
+
664
+ fn real_private_text_response(body: &Value, object: &str, stream: bool) -> Response {
665
+ match real_private_text(body) {
666
+ Ok(text) => text_response_json(body, object, "real-private", &text, stream),
667
+ Err((status, kind, message)) => Response::json(
668
+ status,
669
+ json!({
670
+ "error": {
671
+ "message": message,
672
+ "type": kind
673
+ }
674
+ }),
675
+ ),
676
+ }
677
+ }
678
+
679
+ fn real_private_text(body: &Value) -> std::result::Result<String, (u16, &'static str, String)> {
680
+ if let Some(fixture) = env::var("OMX_API_REAL_PRIVATE_RESPONSE_TEXT")
681
+ .ok()
682
+ .filter(|value| !value.trim().is_empty())
683
+ {
684
+ return Ok(fixture);
685
+ }
686
+
687
+ let Some(auth) = discover_codex_oauth() else {
688
+ return Err((
689
+ 503,
690
+ "missing_auth",
691
+ "missing Codex OAuth token; run Codex login or set OMX_API_REAL_PRIVATE_RESPONSE_TEXT for fixture smoke tests".to_string(),
692
+ ));
693
+ };
694
+
695
+ let Some(upstream) = env::var("OMX_API_PRIVATE_BACKEND_URL")
696
+ .ok()
697
+ .filter(|value| !value.trim().is_empty())
698
+ else {
699
+ return Err((
700
+ 501,
701
+ "private_backend_unconfigured",
702
+ "real-private OAuth was found, but OMX_API_PRIVATE_BACKEND_URL is not configured for this private backend build".to_string(),
703
+ ));
704
+ };
705
+
706
+ match post_codex_responses_to_url(&upstream, body, &auth) {
707
+ Ok(text) => Ok(text),
708
+ Err(error) => Err((
709
+ 502,
710
+ "private_backend_error",
711
+ redact_secrets(&error.to_string()),
712
+ )),
713
+ }
714
+ }
715
+
716
+ fn text_response_json(
717
+ body: &Value,
718
+ object: &str,
719
+ backend: &str,
720
+ text: &str,
721
+ stream: bool,
722
+ ) -> Response {
723
+ if stream {
724
+ let mut output = sse_event(
725
+ Some("response.created"),
726
+ &json!({"type": "response.created", "response": {"backend": backend}}),
727
+ );
728
+ output.push_str(&sse_event(
729
+ Some("response.output_text.delta"),
730
+ &json!({"type": "response.output_text.delta", "delta": text}),
731
+ ));
732
+ output.push_str(&sse_event(
733
+ Some("response.completed"),
734
+ &json!({"type": "response.completed"}),
735
+ ));
736
+ output.push_str(&sse_done());
737
+ return Response::text(200, "text/event-stream", output.into_bytes());
738
+ }
739
+
740
+ Response::json(
741
+ 200,
742
+ json!({
743
+ "id": format!("omx-{}", now_unix()),
744
+ "object": object,
745
+ "model": body.get("model").and_then(Value::as_str).unwrap_or("omx-private"),
746
+ "backend": backend,
747
+ "output_text": text,
748
+ "choices": [{
749
+ "index": 0,
750
+ "message": {"role": "assistant", "content": text},
751
+ "finish_reason": "stop"
752
+ }]
753
+ }),
754
+ )
755
+ }
756
+
757
+ fn image_response(request: &Request, backend: &BackendMode) -> Response {
758
+ let body = match parse_json_body(request) {
759
+ Ok(body) => body,
760
+ Err(response) => return response,
761
+ };
762
+ if *backend == BackendMode::RealPrivate {
763
+ return real_private_image_response(&body);
764
+ }
765
+ let prompt = body.get("prompt").and_then(Value::as_str).unwrap_or("");
766
+ if body.get("stream").and_then(Value::as_bool).unwrap_or(false) {
767
+ let mut stream = sse_event(
768
+ Some("image_generation.partial_image"),
769
+ &json!({"type": "image_generation.partial_image", "b64_json": "omx-mock-image-fragment"}),
770
+ );
771
+ stream.push_str(&sse_event(
772
+ Some("image_generation.completed"),
773
+ &json!({"type": "image_generation.completed"}),
774
+ ));
775
+ stream.push_str(&sse_done());
776
+ return Response::text(200, "text/event-stream", stream.into_bytes());
777
+ }
778
+ Response::json(
779
+ 200,
780
+ json!({
781
+ "created": now_unix(),
782
+ "backend": backend.as_str(),
783
+ "data": [{
784
+ "url": "https://localhost.omx.invalid/mock-image.png",
785
+ "revised_prompt": redact_secrets(prompt)
786
+ }]
787
+ }),
788
+ )
789
+ }
790
+
791
+ fn real_private_image_response(body: &Value) -> Response {
792
+ match real_private_image(body) {
793
+ Ok(image) => image_response_json(body, "real-private", image),
794
+ Err((status, kind, message)) => Response::json(
795
+ status,
796
+ json!({
797
+ "error": {
798
+ "message": message,
799
+ "type": kind
800
+ }
801
+ }),
802
+ ),
803
+ }
804
+ }
805
+
806
+ #[derive(Clone, Debug, Default)]
807
+ struct GeneratedImage {
808
+ url: Option<String>,
809
+ b64_json: Option<String>,
810
+ revised_prompt: Option<String>,
811
+ }
812
+
813
+ fn real_private_image(
814
+ body: &Value,
815
+ ) -> std::result::Result<GeneratedImage, (u16, &'static str, String)> {
816
+ if let Some(b64_json) = env::var("OMX_API_REAL_PRIVATE_IMAGE_B64_JSON")
817
+ .ok()
818
+ .filter(|value| !value.trim().is_empty())
819
+ {
820
+ return Ok(GeneratedImage {
821
+ b64_json: Some(b64_json),
822
+ revised_prompt: body
823
+ .get("prompt")
824
+ .and_then(Value::as_str)
825
+ .map(redact_secrets),
826
+ ..GeneratedImage::default()
827
+ });
828
+ }
829
+ if let Some(url) = env::var("OMX_API_REAL_PRIVATE_IMAGE_URL")
830
+ .ok()
831
+ .filter(|value| !value.trim().is_empty())
832
+ {
833
+ return Ok(GeneratedImage {
834
+ url: Some(url),
835
+ revised_prompt: body
836
+ .get("prompt")
837
+ .and_then(Value::as_str)
838
+ .map(redact_secrets),
839
+ ..GeneratedImage::default()
840
+ });
841
+ }
842
+
843
+ let Some(auth) = discover_codex_oauth() else {
844
+ return Err((
845
+ 503,
846
+ "missing_auth",
847
+ "missing Codex OAuth token; run Codex login or set OMX_API_REAL_PRIVATE_IMAGE_B64_JSON/OMX_API_REAL_PRIVATE_IMAGE_URL for fixture smoke tests".to_string(),
848
+ ));
849
+ };
850
+
851
+ if let Some(upstream) = env::var("OMX_API_PRIVATE_IMAGE_BACKEND_URL")
852
+ .ok()
853
+ .filter(|value| !value.trim().is_empty())
854
+ {
855
+ return post_codex_image_to_url(&upstream, body, &auth).map_err(|error| {
856
+ (
857
+ 502,
858
+ "private_backend_error",
859
+ redact_secrets(&error.to_string()),
860
+ )
861
+ });
862
+ }
863
+
864
+ if let Some(upstream) = env::var("OMX_API_PRIVATE_BACKEND_URL")
865
+ .ok()
866
+ .filter(|value| !value.trim().is_empty())
867
+ {
868
+ return post_codex_image_via_responses_to_url(&upstream, body, &auth).map_err(|error| {
869
+ (
870
+ 502,
871
+ "private_backend_error",
872
+ redact_secrets(&error.to_string()),
873
+ )
874
+ });
875
+ }
876
+
877
+ Err((
878
+ 501,
879
+ "private_image_backend_unconfigured",
880
+ "real-private OAuth was found, but neither OMX_API_PRIVATE_IMAGE_BACKEND_URL nor OMX_API_PRIVATE_BACKEND_URL is configured for image generation".to_string(),
881
+ ))
882
+ }
883
+
884
+ fn image_response_json(body: &Value, backend: &str, image: GeneratedImage) -> Response {
885
+ let mut item = serde_json::Map::new();
886
+ if let Some(url) = image.url {
887
+ item.insert("url".to_string(), Value::String(url));
888
+ }
889
+ if let Some(b64_json) = image.b64_json {
890
+ item.insert("b64_json".to_string(), Value::String(b64_json));
891
+ }
892
+ if let Some(revised_prompt) = image.revised_prompt.or_else(|| {
893
+ body.get("prompt")
894
+ .and_then(Value::as_str)
895
+ .map(redact_secrets)
896
+ }) {
897
+ item.insert("revised_prompt".to_string(), Value::String(revised_prompt));
898
+ }
899
+ if item.is_empty() {
900
+ item.insert(
901
+ "url".to_string(),
902
+ Value::String("https://localhost.omx.invalid/private-image.png".to_string()),
903
+ );
904
+ }
905
+
906
+ if body.get("stream").and_then(Value::as_bool).unwrap_or(false) {
907
+ let mut stream = sse_event(
908
+ Some("image_generation.partial_image"),
909
+ &json!({"type": "image_generation.partial_image", "backend": backend, "image": item}),
910
+ );
911
+ stream.push_str(&sse_event(
912
+ Some("image_generation.completed"),
913
+ &json!({"type": "image_generation.completed", "backend": backend}),
914
+ ));
915
+ stream.push_str(&sse_done());
916
+ return Response::text(200, "text/event-stream", stream.into_bytes());
917
+ }
918
+
919
+ Response::json(
920
+ 200,
921
+ json!({
922
+ "created": now_unix(),
923
+ "backend": backend,
924
+ "data": [Value::Object(item)]
925
+ }),
926
+ )
927
+ }
928
+
929
+ fn parse_json_body(request: &Request) -> std::result::Result<Value, Response> {
930
+ if request.body.is_empty() {
931
+ return Ok(json!({}));
932
+ }
933
+ serde_json::from_slice(&request.body).map_err(|error| {
934
+ Response::json(
935
+ 400,
936
+ json!({
937
+ "error": {
938
+ "message": format!("invalid JSON request body: {error}"),
939
+ "type": "invalid_request_error"
940
+ }
941
+ }),
942
+ )
943
+ })
944
+ }
945
+
946
+ fn extract_prompt(body: &Value) -> String {
947
+ if let Some(input) = body.get("input") {
948
+ if let Some(text) = input.as_str() {
949
+ return text.to_string();
950
+ }
951
+ if let Some(items) = input.as_array() {
952
+ let text = items
953
+ .iter()
954
+ .filter_map(|item| item.get("content"))
955
+ .flat_map(|content| match content {
956
+ Value::String(text) => vec![text.clone()],
957
+ Value::Array(parts) => parts
958
+ .iter()
959
+ .filter_map(|part| {
960
+ part.get("text").and_then(Value::as_str).map(str::to_string)
961
+ })
962
+ .collect::<Vec<_>>(),
963
+ other => vec![other.to_string()],
964
+ })
965
+ .collect::<Vec<_>>()
966
+ .join("\n");
967
+ if !text.is_empty() {
968
+ return text;
969
+ }
970
+ }
971
+ return input.to_string();
972
+ }
973
+ if let Some(messages) = body.get("messages").and_then(Value::as_array) {
974
+ return messages
975
+ .iter()
976
+ .filter_map(|message| message.get("content"))
977
+ .map(|content| {
978
+ content
979
+ .as_str()
980
+ .map(str::to_string)
981
+ .unwrap_or_else(|| content.to_string())
982
+ })
983
+ .collect::<Vec<_>>()
984
+ .join("\n");
985
+ }
986
+ if let Some(prompt) = body.get("prompt").and_then(Value::as_str) {
987
+ return prompt.to_string();
988
+ }
989
+ String::new()
990
+ }
991
+
992
+ #[derive(Clone, Debug, Default)]
993
+ struct CodexOAuth {
994
+ token: String,
995
+ account_id: Option<String>,
996
+ }
997
+
998
+ fn discover_codex_oauth() -> Option<CodexOAuth> {
999
+ if let Some(token) = env::var("OMX_API_CODEX_OAUTH_TOKEN")
1000
+ .ok()
1001
+ .filter(|value| !value.trim().is_empty())
1002
+ {
1003
+ return Some(CodexOAuth {
1004
+ token,
1005
+ account_id: env::var("OMX_API_CODEX_ACCOUNT_ID")
1006
+ .ok()
1007
+ .filter(|value| !value.trim().is_empty()),
1008
+ });
1009
+ }
1010
+
1011
+ let auth_path = env::var("CODEX_HOME")
1012
+ .ok()
1013
+ .filter(|value| !value.trim().is_empty())
1014
+ .map(PathBuf::from)
1015
+ .or_else(|| {
1016
+ env::var("HOME")
1017
+ .ok()
1018
+ .map(|home| PathBuf::from(home).join(".codex"))
1019
+ })
1020
+ .map(|home| home.join("auth.json"))?;
1021
+ let bytes = fs::read(auth_path).ok()?;
1022
+ let value: Value = serde_json::from_slice(&bytes).ok()?;
1023
+ Some(CodexOAuth {
1024
+ token: find_oauth_token(&value)?,
1025
+ account_id: find_codex_account_id(&value),
1026
+ })
1027
+ }
1028
+
1029
+ fn find_oauth_token(value: &Value) -> Option<String> {
1030
+ match value {
1031
+ Value::Object(map) => {
1032
+ for preferred in ["access_token", "id_token", "oauth_token", "token"] {
1033
+ if let Some(token) = map
1034
+ .get(preferred)
1035
+ .and_then(Value::as_str)
1036
+ .filter(|token| token.len() > 20)
1037
+ {
1038
+ return Some(token.to_string());
1039
+ }
1040
+ }
1041
+ map.values().find_map(find_oauth_token)
1042
+ }
1043
+ Value::Array(items) => items.iter().find_map(find_oauth_token),
1044
+ _ => None,
1045
+ }
1046
+ }
1047
+
1048
+ fn find_codex_account_id(value: &Value) -> Option<String> {
1049
+ match value {
1050
+ Value::Object(map) => {
1051
+ for preferred in ["account_id", "chatgpt_account_id"] {
1052
+ if let Some(account_id) = map
1053
+ .get(preferred)
1054
+ .and_then(Value::as_str)
1055
+ .filter(|account_id| !account_id.trim().is_empty())
1056
+ {
1057
+ return Some(account_id.to_string());
1058
+ }
1059
+ }
1060
+ map.values().find_map(find_codex_account_id)
1061
+ }
1062
+ Value::Array(items) => items.iter().find_map(find_codex_account_id),
1063
+ _ => None,
1064
+ }
1065
+ }
1066
+
1067
+ #[derive(Debug)]
1068
+ struct CodexNativeRequest {
1069
+ path: String,
1070
+ headers: Vec<(String, String)>,
1071
+ body: Value,
1072
+ }
1073
+
1074
+ fn build_codex_native_request(
1075
+ upstream_path: &str,
1076
+ body: &Value,
1077
+ auth: &CodexOAuth,
1078
+ ) -> CodexNativeRequest {
1079
+ let session_id = env::var("OMX_API_CODEX_SESSION_ID")
1080
+ .ok()
1081
+ .filter(|value| !value.trim().is_empty())
1082
+ .unwrap_or_else(|| "omx-api-local-session".to_string());
1083
+ let thread_id = env::var("OMX_API_CODEX_THREAD_ID")
1084
+ .ok()
1085
+ .filter(|value| !value.trim().is_empty())
1086
+ .unwrap_or_else(|| "omx-api-local-thread".to_string());
1087
+ let installation_id = env::var("OMX_API_CODEX_INSTALLATION_ID")
1088
+ .ok()
1089
+ .filter(|value| !value.trim().is_empty())
1090
+ .unwrap_or_else(|| "omx-api-local-installation".to_string());
1091
+ let window_id = env::var("OMX_API_CODEX_WINDOW_ID")
1092
+ .ok()
1093
+ .filter(|value| !value.trim().is_empty())
1094
+ .unwrap_or_else(|| "omx-api-local-window".to_string());
1095
+ let model = body
1096
+ .get("model")
1097
+ .and_then(Value::as_str)
1098
+ .filter(|value| !value.trim().is_empty())
1099
+ .map(str::to_string)
1100
+ .or_else(|| env::var("OMX_API_GENERATE_MODEL").ok())
1101
+ .unwrap_or_else(|| "omx-private".to_string());
1102
+ let prompt = extract_prompt(body);
1103
+ let tools = body.get("tools").cloned().unwrap_or_else(|| json!([]));
1104
+ let tool_choice = body
1105
+ .get("tool_choice")
1106
+ .cloned()
1107
+ .unwrap_or_else(|| json!("auto"));
1108
+ let path = normalize_codex_responses_path(upstream_path);
1109
+ let mut request_body = json!({
1110
+ "model": model,
1111
+ "input": [{
1112
+ "type": "message",
1113
+ "role": "user",
1114
+ "content": [{"type": "input_text", "text": prompt}]
1115
+ }],
1116
+ "tools": tools,
1117
+ "tool_choice": tool_choice,
1118
+ "parallel_tool_calls": false,
1119
+ "reasoning": body.get("reasoning").cloned().unwrap_or(Value::Null),
1120
+ "store": false,
1121
+ "stream": true,
1122
+ "include": [],
1123
+ "prompt_cache_key": thread_id,
1124
+ "client_metadata": {
1125
+ CODEX_INSTALLATION_ID_HEADER: installation_id.clone()
1126
+ }
1127
+ });
1128
+ if let Some(instructions) = body.get("instructions").cloned() {
1129
+ request_body["instructions"] = instructions;
1130
+ }
1131
+
1132
+ let mut headers = vec![
1133
+ ("Content-Type".to_string(), "application/json".to_string()),
1134
+ ("Accept".to_string(), "text/event-stream".to_string()),
1135
+ (
1136
+ "Authorization".to_string(),
1137
+ format!("Bearer {}", auth.token),
1138
+ ),
1139
+ (
1140
+ "originator".to_string(),
1141
+ CODEX_DEFAULT_ORIGINATOR.to_string(),
1142
+ ),
1143
+ ("User-Agent".to_string(), codex_user_agent()),
1144
+ ("x-client-request-id".to_string(), thread_id.clone()),
1145
+ ("session_id".to_string(), session_id.clone()),
1146
+ ("session-id".to_string(), session_id),
1147
+ ("thread_id".to_string(), thread_id.clone()),
1148
+ ("thread-id".to_string(), thread_id),
1149
+ (CODEX_WINDOW_ID_HEADER.to_string(), window_id),
1150
+ ];
1151
+ if let Some(account_id) = auth.account_id.as_ref() {
1152
+ headers.push(("ChatGPT-Account-ID".to_string(), account_id.clone()));
1153
+ }
1154
+
1155
+ CodexNativeRequest {
1156
+ path,
1157
+ headers,
1158
+ body: request_body,
1159
+ }
1160
+ }
1161
+
1162
+ fn codex_user_agent() -> String {
1163
+ env::var("OMX_API_CODEX_USER_AGENT")
1164
+ .ok()
1165
+ .filter(|value| !value.trim().is_empty())
1166
+ .unwrap_or_else(|| "codex_cli_rs/0.130.0 (omx-api)".to_string())
1167
+ }
1168
+
1169
+ fn normalize_codex_responses_path(path: &str) -> String {
1170
+ let path = if path == "/" || path.is_empty() {
1171
+ CODEX_DEFAULT_BACKEND_BASE_PATH
1172
+ } else {
1173
+ path.trim_end_matches('/')
1174
+ };
1175
+ if path.ends_with(CODEX_RESPONSES_PATH) {
1176
+ path.to_string()
1177
+ } else {
1178
+ format!("{path}{CODEX_RESPONSES_PATH}")
1179
+ }
1180
+ }
1181
+
1182
+ fn normalize_codex_images_generations_path(path: &str) -> String {
1183
+ let path = if path == "/" || path.is_empty() {
1184
+ CODEX_DEFAULT_BACKEND_BASE_PATH
1185
+ } else {
1186
+ path.trim_end_matches('/')
1187
+ };
1188
+ if path.ends_with(CODEX_IMAGES_GENERATIONS_PATH) {
1189
+ path.to_string()
1190
+ } else {
1191
+ format!("{path}{CODEX_IMAGES_GENERATIONS_PATH}")
1192
+ }
1193
+ }
1194
+
1195
+ fn build_codex_image_request(
1196
+ upstream_path: &str,
1197
+ body: &Value,
1198
+ auth: &CodexOAuth,
1199
+ ) -> CodexNativeRequest {
1200
+ let model = body
1201
+ .get("model")
1202
+ .and_then(Value::as_str)
1203
+ .filter(|value| !value.trim().is_empty())
1204
+ .map(str::to_string)
1205
+ .or_else(|| env::var("OMX_API_IMAGE_MODEL").ok())
1206
+ .unwrap_or_else(|| "omx-private-image".to_string());
1207
+ let prompt = body
1208
+ .get("prompt")
1209
+ .and_then(Value::as_str)
1210
+ .unwrap_or_default();
1211
+ let mut request_body = json!({
1212
+ "model": model,
1213
+ "prompt": prompt,
1214
+ "n": body.get("n").cloned().unwrap_or_else(|| json!(1)),
1215
+ "size": body.get("size").cloned().unwrap_or_else(|| json!("1024x1024")),
1216
+ });
1217
+ for key in ["quality", "response_format", "style", "user"] {
1218
+ if let Some(value) = body.get(key).cloned() {
1219
+ request_body[key] = value;
1220
+ }
1221
+ }
1222
+
1223
+ let mut headers = vec![
1224
+ ("Content-Type".to_string(), "application/json".to_string()),
1225
+ (
1226
+ "Accept".to_string(),
1227
+ "application/json, text/event-stream".to_string(),
1228
+ ),
1229
+ (
1230
+ "Authorization".to_string(),
1231
+ format!("Bearer {}", auth.token),
1232
+ ),
1233
+ (
1234
+ "originator".to_string(),
1235
+ CODEX_DEFAULT_ORIGINATOR.to_string(),
1236
+ ),
1237
+ ("User-Agent".to_string(), codex_user_agent()),
1238
+ ];
1239
+ if let Some(account_id) = auth.account_id.as_ref() {
1240
+ headers.push(("ChatGPT-Account-ID".to_string(), account_id.clone()));
1241
+ }
1242
+
1243
+ CodexNativeRequest {
1244
+ path: normalize_codex_images_generations_path(upstream_path),
1245
+ headers,
1246
+ body: request_body,
1247
+ }
1248
+ }
1249
+
1250
+ fn post_codex_responses_to_url(url: &str, body: &Value, auth: &CodexOAuth) -> Result<String> {
1251
+ let parsed = parse_http_backend_url(url)?;
1252
+ let codex_request = build_codex_native_request(&parsed.path, body, auth);
1253
+ let payload = serde_json::to_vec(&codex_request.body)?;
1254
+ let mut stream = TcpStream::connect((parsed.host.as_str(), parsed.port))?;
1255
+ stream.set_read_timeout(Some(Duration::from_secs(120)))?;
1256
+ stream.set_write_timeout(Some(Duration::from_secs(30)))?;
1257
+ write!(
1258
+ stream,
1259
+ "POST {} HTTP/1.1\r\nHost: {}:{}\r\n",
1260
+ codex_request.path, parsed.host, parsed.port
1261
+ )?;
1262
+ for (name, value) in codex_request.headers {
1263
+ write!(stream, "{name}: {value}\r\n")?;
1264
+ }
1265
+ write!(
1266
+ stream,
1267
+ "Content-Length: {}\r\nConnection: close\r\n\r\n",
1268
+ payload.len()
1269
+ )?;
1270
+ stream.write_all(&payload)?;
1271
+ let mut raw = String::new();
1272
+ stream.read_to_string(&mut raw)?;
1273
+ let (head, response_body) = split_http_response(&raw)?;
1274
+ let status = head
1275
+ .lines()
1276
+ .next()
1277
+ .and_then(|line| line.split_whitespace().nth(1))
1278
+ .and_then(|value| value.parse::<u16>().ok())
1279
+ .unwrap_or(502);
1280
+ if !(200..300).contains(&status) {
1281
+ return Err(OmxApiError::Message(format!(
1282
+ "private backend returned HTTP {status}: {response_body}"
1283
+ )));
1284
+ }
1285
+
1286
+ Ok(extract_backend_text_response(&response_body))
1287
+ }
1288
+
1289
+ fn post_codex_image_to_url(url: &str, body: &Value, auth: &CodexOAuth) -> Result<GeneratedImage> {
1290
+ let parsed = parse_http_backend_url(url)?;
1291
+ let codex_request = build_codex_image_request(&parsed.path, body, auth);
1292
+ let payload = serde_json::to_vec(&codex_request.body)?;
1293
+ let mut stream = TcpStream::connect((parsed.host.as_str(), parsed.port))?;
1294
+ stream.set_read_timeout(Some(Duration::from_secs(120)))?;
1295
+ stream.set_write_timeout(Some(Duration::from_secs(30)))?;
1296
+ write!(
1297
+ stream,
1298
+ "POST {} HTTP/1.1\r\nHost: {}:{}\r\n",
1299
+ codex_request.path, parsed.host, parsed.port
1300
+ )?;
1301
+ for (name, value) in codex_request.headers {
1302
+ write!(stream, "{name}: {value}\r\n")?;
1303
+ }
1304
+ write!(
1305
+ stream,
1306
+ "Content-Length: {}\r\nConnection: close\r\n\r\n",
1307
+ payload.len()
1308
+ )?;
1309
+ stream.write_all(&payload)?;
1310
+ let mut raw = String::new();
1311
+ stream.read_to_string(&mut raw)?;
1312
+ let (head, response_body) = split_http_response(&raw)?;
1313
+ let status = head
1314
+ .lines()
1315
+ .next()
1316
+ .and_then(|line| line.split_whitespace().nth(1))
1317
+ .and_then(|value| value.parse::<u16>().ok())
1318
+ .unwrap_or(502);
1319
+ if !(200..300).contains(&status) {
1320
+ return Err(OmxApiError::Message(format!(
1321
+ "private backend returned HTTP {status}: {response_body}"
1322
+ )));
1323
+ }
1324
+
1325
+ Ok(extract_backend_image_response(&response_body))
1326
+ }
1327
+
1328
+ fn post_codex_image_via_responses_to_url(
1329
+ url: &str,
1330
+ body: &Value,
1331
+ auth: &CodexOAuth,
1332
+ ) -> Result<GeneratedImage> {
1333
+ let mut request = body.clone();
1334
+ let prompt = body
1335
+ .get("prompt")
1336
+ .and_then(Value::as_str)
1337
+ .unwrap_or_default();
1338
+ request["input"] = json!([{
1339
+ "type": "message",
1340
+ "role": "user",
1341
+ "content": [{"type": "input_text", "text": prompt}]
1342
+ }]);
1343
+ request["tools"] = json!([{"type": "image_generation"}]);
1344
+ request["tool_choice"] = json!({"type": "image_generation"});
1345
+ request["stream"] = json!(true);
1346
+
1347
+ let parsed = parse_http_backend_url(url)?;
1348
+ let codex_request = build_codex_native_request(&parsed.path, &request, auth);
1349
+ let payload = serde_json::to_vec(&codex_request.body)?;
1350
+ let mut stream = TcpStream::connect((parsed.host.as_str(), parsed.port))?;
1351
+ stream.set_read_timeout(Some(Duration::from_secs(120)))?;
1352
+ stream.set_write_timeout(Some(Duration::from_secs(30)))?;
1353
+ write!(
1354
+ stream,
1355
+ "POST {} HTTP/1.1\r\nHost: {}:{}\r\n",
1356
+ codex_request.path, parsed.host, parsed.port
1357
+ )?;
1358
+ for (name, value) in codex_request.headers {
1359
+ write!(stream, "{name}: {value}\r\n")?;
1360
+ }
1361
+ write!(
1362
+ stream,
1363
+ "Content-Length: {}\r\nConnection: close\r\n\r\n",
1364
+ payload.len()
1365
+ )?;
1366
+ stream.write_all(&payload)?;
1367
+ let mut raw = String::new();
1368
+ stream.read_to_string(&mut raw)?;
1369
+ let (head, response_body) = split_http_response(&raw)?;
1370
+ let status = head
1371
+ .lines()
1372
+ .next()
1373
+ .and_then(|line| line.split_whitespace().nth(1))
1374
+ .and_then(|value| value.parse::<u16>().ok())
1375
+ .unwrap_or(502);
1376
+ if !(200..300).contains(&status) {
1377
+ return Err(OmxApiError::Message(format!(
1378
+ "private backend returned HTTP {status}: {response_body}"
1379
+ )));
1380
+ }
1381
+
1382
+ Ok(extract_backend_image_response(&response_body))
1383
+ }
1384
+
1385
+ fn split_http_response(raw: &str) -> Result<(String, String)> {
1386
+ let (head, response_body) = raw.split_once("\r\n\r\n").ok_or_else(|| {
1387
+ OmxApiError::Message("private backend returned malformed HTTP".to_string())
1388
+ })?;
1389
+ let body = if head.lines().any(|line| {
1390
+ let lower = line.to_ascii_lowercase();
1391
+ lower.starts_with("transfer-encoding:") && lower.contains("chunked")
1392
+ }) {
1393
+ decode_chunked_body(response_body)?
1394
+ } else {
1395
+ response_body.to_string()
1396
+ };
1397
+ Ok((head.to_string(), body))
1398
+ }
1399
+
1400
+ fn decode_chunked_body(input: &str) -> Result<String> {
1401
+ let bytes = input.as_bytes();
1402
+ let mut index = 0;
1403
+ let mut output = Vec::new();
1404
+ loop {
1405
+ let Some(line_end) = find_crlf(bytes, index) else {
1406
+ return Err(OmxApiError::Message(
1407
+ "chunked response missing chunk size".to_string(),
1408
+ ));
1409
+ };
1410
+ let size_line = std::str::from_utf8(&bytes[index..line_end])
1411
+ .map_err(|_| OmxApiError::Message("chunked response size is not UTF-8".to_string()))?;
1412
+ let size_hex = size_line.split(';').next().unwrap_or_default().trim();
1413
+ let size = usize::from_str_radix(size_hex, 16).map_err(|_| {
1414
+ OmxApiError::Message(format!("invalid chunk size `{}`", redact_secrets(size_hex)))
1415
+ })?;
1416
+ index = line_end + 2;
1417
+ if size == 0 {
1418
+ break;
1419
+ }
1420
+ if bytes.len() < index + size + 2 {
1421
+ return Err(OmxApiError::Message(
1422
+ "chunked response ended mid-chunk".to_string(),
1423
+ ));
1424
+ }
1425
+ output.extend_from_slice(&bytes[index..index + size]);
1426
+ index += size;
1427
+ if bytes.get(index..index + 2) != Some(b"\r\n") {
1428
+ return Err(OmxApiError::Message(
1429
+ "chunked response missing chunk terminator".to_string(),
1430
+ ));
1431
+ }
1432
+ index += 2;
1433
+ }
1434
+ String::from_utf8(output)
1435
+ .map_err(|_| OmxApiError::Message("chunked response body is not UTF-8".to_string()))
1436
+ }
1437
+
1438
+ fn find_crlf(bytes: &[u8], start: usize) -> Option<usize> {
1439
+ bytes
1440
+ .get(start..)?
1441
+ .windows(2)
1442
+ .position(|chunk| chunk == b"\r\n")
1443
+ .map(|offset| start + offset)
1444
+ }
1445
+
1446
+ fn extract_backend_image_response(response_body: &str) -> GeneratedImage {
1447
+ if response_body
1448
+ .lines()
1449
+ .any(|line| line.starts_with("event:") || line.starts_with("data:"))
1450
+ {
1451
+ for line in response_body.lines() {
1452
+ let Some(data) = line.strip_prefix("data:").map(str::trim) else {
1453
+ continue;
1454
+ };
1455
+ if data == "[DONE]" || data.is_empty() {
1456
+ continue;
1457
+ }
1458
+ if let Ok(value) = serde_json::from_str::<Value>(data) {
1459
+ let image = image_from_value(&value);
1460
+ if image.url.is_some() || image.b64_json.is_some() {
1461
+ return image;
1462
+ }
1463
+ }
1464
+ }
1465
+ }
1466
+
1467
+ let value: Value = serde_json::from_str(response_body).unwrap_or_else(|_| json!({}));
1468
+ image_from_value(&value)
1469
+ }
1470
+
1471
+ fn image_from_value(value: &Value) -> GeneratedImage {
1472
+ let candidate = value
1473
+ .pointer("/data/0")
1474
+ .or_else(|| value.pointer("/image"))
1475
+ .or_else(|| value.pointer("/output/0"))
1476
+ .unwrap_or(value);
1477
+ GeneratedImage {
1478
+ url: candidate
1479
+ .get("url")
1480
+ .and_then(Value::as_str)
1481
+ .or_else(|| value.pointer("/data/0/url").and_then(Value::as_str))
1482
+ .map(str::to_string),
1483
+ b64_json: candidate
1484
+ .get("b64_json")
1485
+ .and_then(Value::as_str)
1486
+ .or_else(|| candidate.get("b64").and_then(Value::as_str))
1487
+ .or_else(|| value.pointer("/data/0/b64_json").and_then(Value::as_str))
1488
+ .or_else(|| {
1489
+ value
1490
+ .pointer("/partial_image")
1491
+ .and_then(Value::as_str)
1492
+ .or_else(|| value.pointer("/b64_json").and_then(Value::as_str))
1493
+ })
1494
+ .map(str::to_string),
1495
+ revised_prompt: candidate
1496
+ .get("revised_prompt")
1497
+ .and_then(Value::as_str)
1498
+ .map(redact_secrets),
1499
+ }
1500
+ }
1501
+
1502
+ fn extract_backend_text_response(response_body: &str) -> String {
1503
+ if response_body
1504
+ .lines()
1505
+ .any(|line| line.starts_with("event:") || line.starts_with("data:"))
1506
+ {
1507
+ let mut text = String::new();
1508
+ for line in response_body.lines() {
1509
+ let Some(data) = line.strip_prefix("data:").map(str::trim) else {
1510
+ continue;
1511
+ };
1512
+ if data == "[DONE]" || data.is_empty() {
1513
+ continue;
1514
+ }
1515
+ if let Ok(value) = serde_json::from_str::<Value>(data) {
1516
+ if let Some(delta) = value.get("delta").and_then(Value::as_str) {
1517
+ text.push_str(delta);
1518
+ } else if let Some(delta) = value
1519
+ .pointer("/item/content/0/text")
1520
+ .and_then(Value::as_str)
1521
+ {
1522
+ text.push_str(delta);
1523
+ } else if let Some(delta) = value
1524
+ .pointer("/response/output_text")
1525
+ .and_then(Value::as_str)
1526
+ {
1527
+ text.push_str(delta);
1528
+ }
1529
+ }
1530
+ }
1531
+ if !text.is_empty() {
1532
+ return text;
1533
+ }
1534
+ }
1535
+
1536
+ let value: Value = serde_json::from_str(response_body)
1537
+ .unwrap_or_else(|_| json!({"output_text": response_body}));
1538
+ value
1539
+ .get("output_text")
1540
+ .and_then(Value::as_str)
1541
+ .or_else(|| {
1542
+ value
1543
+ .pointer("/choices/0/message/content")
1544
+ .and_then(Value::as_str)
1545
+ })
1546
+ .or_else(|| {
1547
+ value
1548
+ .pointer("/output/0/content/0/text")
1549
+ .and_then(Value::as_str)
1550
+ })
1551
+ .unwrap_or(response_body)
1552
+ .to_string()
1553
+ }
1554
+
1555
+ #[derive(Debug)]
1556
+ struct BackendUrl {
1557
+ host: String,
1558
+ port: u16,
1559
+ path: String,
1560
+ }
1561
+
1562
+ fn parse_http_backend_url(url: &str) -> Result<BackendUrl> {
1563
+ let rest = url.strip_prefix("http://").ok_or_else(|| {
1564
+ OmxApiError::Message(
1565
+ "OMX_API_PRIVATE_BACKEND_URL must use http:// in V1A; use a localhost TLS terminator for HTTPS backends".to_string(),
1566
+ )
1567
+ })?;
1568
+ let (authority, path) = rest
1569
+ .split_once('/')
1570
+ .map(|(authority, path)| (authority, format!("/{path}")))
1571
+ .unwrap_or((rest, "/".to_string()));
1572
+ let (host, port) = if let Some((host, port)) = authority.rsplit_once(':') {
1573
+ let parsed = port
1574
+ .parse::<u16>()
1575
+ .map_err(|_| OmxApiError::Message(format!("invalid private backend port in {url}")))?;
1576
+ (host.to_string(), parsed)
1577
+ } else {
1578
+ (authority.to_string(), 80)
1579
+ };
1580
+ if host.is_empty() {
1581
+ return Err(OmxApiError::Message(format!(
1582
+ "empty private backend host in {url}"
1583
+ )));
1584
+ }
1585
+ if !is_loopback_host(&host) && env::var_os("OMX_API_ALLOW_UNSAFE_PRIVATE_BACKEND").is_none() {
1586
+ return Err(OmxApiError::Message(format!(
1587
+ "private backend host `{host}` is not loopback; set OMX_API_ALLOW_UNSAFE_PRIVATE_BACKEND=1 only for trusted development"
1588
+ )));
1589
+ }
1590
+ Ok(BackendUrl { host, port, path })
1591
+ }
1592
+
1593
+ fn is_loopback_host(host: &str) -> bool {
1594
+ if host == "localhost" {
1595
+ return true;
1596
+ }
1597
+ let trimmed = host.trim_matches(['[', ']']);
1598
+ trimmed
1599
+ .parse::<IpAddr>()
1600
+ .map(|addr| addr.is_loopback())
1601
+ .unwrap_or(false)
1602
+ }
1603
+
1604
+ pub fn serve(config: ServerConfig) -> Result<DaemonState> {
1605
+ validate_loopback_host(&config.host)?;
1606
+ let listener = TcpListener::bind((config.host.as_str(), config.port))?;
1607
+ let port = listener.local_addr()?.port();
1608
+ let state = DaemonState {
1609
+ pid: std::process::id(),
1610
+ host: config.host.clone(),
1611
+ port,
1612
+ backend: config.backend.clone(),
1613
+ started_at_unix: now_unix(),
1614
+ local_bearer_token: config.local_bearer_token.clone(),
1615
+ local_bearer_token_file: config
1616
+ .local_bearer_token
1617
+ .as_ref()
1618
+ .map(|_| token_file_for_state(&config.state_file)),
1619
+ };
1620
+ if let Some(token) = config.local_bearer_token.as_deref() {
1621
+ write_local_bearer_token(token_file_for_state(&config.state_file), token)?;
1622
+ }
1623
+ write_daemon_state(&config.state_file, &state)?;
1624
+
1625
+ let telemetry = Arc::new(Telemetry::default());
1626
+ let shutdown = Arc::new(AtomicBool::new(false));
1627
+
1628
+ for stream in listener.incoming() {
1629
+ let stream = stream?;
1630
+ handle_connection(
1631
+ stream,
1632
+ &config.backend,
1633
+ &telemetry,
1634
+ &shutdown,
1635
+ config.local_bearer_token.as_deref(),
1636
+ )?;
1637
+ if config.once || shutdown.load(Ordering::SeqCst) {
1638
+ break;
1639
+ }
1640
+ }
1641
+ remove_local_bearer_token(token_file_for_state(&config.state_file))?;
1642
+ remove_daemon_state(&config.state_file)?;
1643
+ Ok(state)
1644
+ }
1645
+
1646
+ fn handle_connection(
1647
+ mut stream: TcpStream,
1648
+ backend: &BackendMode,
1649
+ telemetry: &Telemetry,
1650
+ shutdown: &AtomicBool,
1651
+ expected_bearer: Option<&str>,
1652
+ ) -> Result<()> {
1653
+ stream.set_read_timeout(Some(Duration::from_secs(10)))?;
1654
+ stream.set_write_timeout(Some(Duration::from_secs(10)))?;
1655
+ let request = match read_http_request(&mut stream) {
1656
+ Ok(request) => request,
1657
+ Err(OmxApiError::Message(message)) if message.contains("too large") => {
1658
+ write_http_response(
1659
+ &mut stream,
1660
+ Response::json(
1661
+ 413,
1662
+ json!({
1663
+ "error": {
1664
+ "message": message,
1665
+ "type": "request_too_large"
1666
+ }
1667
+ }),
1668
+ ),
1669
+ )?;
1670
+ let _ = stream.shutdown(Shutdown::Both);
1671
+ return Ok(());
1672
+ }
1673
+ Err(error) => return Err(error),
1674
+ };
1675
+ let response = route_request(
1676
+ &request,
1677
+ backend,
1678
+ telemetry,
1679
+ Some(shutdown),
1680
+ expected_bearer,
1681
+ );
1682
+ write_http_response(&mut stream, response)?;
1683
+ let _ = stream.shutdown(Shutdown::Both);
1684
+ Ok(())
1685
+ }
1686
+
1687
+ pub fn read_http_request(stream: &mut TcpStream) -> Result<Request> {
1688
+ let mut reader = BufReader::new(stream.try_clone()?);
1689
+ let mut request_line = String::new();
1690
+ reader.read_line(&mut request_line)?;
1691
+ let mut header_bytes = request_line.len();
1692
+ if header_bytes > MAX_HTTP_HEADER_BYTES {
1693
+ return Err(OmxApiError::Message(
1694
+ "HTTP request headers too large".to_string(),
1695
+ ));
1696
+ }
1697
+ let mut parts = request_line.split_whitespace();
1698
+ let method = parts.next().unwrap_or_default().to_string();
1699
+ let path = parts
1700
+ .next()
1701
+ .unwrap_or("/")
1702
+ .split('?')
1703
+ .next()
1704
+ .unwrap_or("/")
1705
+ .to_string();
1706
+
1707
+ let mut headers = BTreeMap::new();
1708
+ loop {
1709
+ let mut line = String::new();
1710
+ reader.read_line(&mut line)?;
1711
+ header_bytes += line.len();
1712
+ if header_bytes > MAX_HTTP_HEADER_BYTES {
1713
+ return Err(OmxApiError::Message(
1714
+ "HTTP request headers too large".to_string(),
1715
+ ));
1716
+ }
1717
+ let trimmed = line.trim_end_matches(['\r', '\n']);
1718
+ if trimmed.is_empty() {
1719
+ break;
1720
+ }
1721
+ if let Some((key, value)) = trimmed.split_once(':') {
1722
+ headers.insert(key.trim().to_ascii_lowercase(), value.trim().to_string());
1723
+ }
1724
+ }
1725
+
1726
+ let length = headers
1727
+ .get("content-length")
1728
+ .and_then(|value| value.parse::<usize>().ok())
1729
+ .unwrap_or(0);
1730
+ if length > MAX_HTTP_BODY_BYTES {
1731
+ return Err(OmxApiError::Message(format!(
1732
+ "HTTP request body too large: {length} bytes exceeds {MAX_HTTP_BODY_BYTES}"
1733
+ )));
1734
+ }
1735
+ let mut body = vec![0; length];
1736
+ reader.read_exact(&mut body)?;
1737
+
1738
+ Ok(Request {
1739
+ method,
1740
+ path,
1741
+ headers,
1742
+ body,
1743
+ })
1744
+ }
1745
+
1746
+ pub fn write_http_response(stream: &mut TcpStream, response: Response) -> Result<()> {
1747
+ let reason = reason_phrase(response.status);
1748
+ write!(
1749
+ stream,
1750
+ "HTTP/1.1 {} {}\r\nContent-Type: {}\r\nContent-Length: {}\r\nConnection: close\r\n",
1751
+ response.status,
1752
+ reason,
1753
+ response.content_type,
1754
+ response.body.len()
1755
+ )?;
1756
+ for (key, value) in response.extra_headers {
1757
+ write!(stream, "{}: {}\r\n", key, value)?;
1758
+ }
1759
+ write!(stream, "\r\n")?;
1760
+ stream.write_all(&response.body)?;
1761
+ stream.flush()?;
1762
+ Ok(())
1763
+ }
1764
+
1765
+ fn reason_phrase(status: u16) -> &'static str {
1766
+ match status {
1767
+ 200 => "OK",
1768
+ 400 => "Bad Request",
1769
+ 401 => "Unauthorized",
1770
+ 404 => "Not Found",
1771
+ 413 => "Payload Too Large",
1772
+ 503 => "Service Unavailable",
1773
+ _ => "OK",
1774
+ }
1775
+ }
1776
+
1777
+ pub fn stop_daemon(state_file: impl AsRef<Path>) -> Result<Value> {
1778
+ let Some(state) = read_daemon_state(&state_file)? else {
1779
+ return Ok(json!({"status": "not-running"}));
1780
+ };
1781
+ let response = http_request_with_bearer(
1782
+ &state.host,
1783
+ state.port,
1784
+ "POST",
1785
+ "/__admin/stop",
1786
+ Some(b"{}"),
1787
+ read_local_bearer_token(
1788
+ state
1789
+ .local_bearer_token_file
1790
+ .as_ref()
1791
+ .unwrap_or(&token_file_for_state(state_file.as_ref())),
1792
+ )?
1793
+ .as_deref(),
1794
+ )?;
1795
+ remove_local_bearer_token(
1796
+ state
1797
+ .local_bearer_token_file
1798
+ .as_ref()
1799
+ .unwrap_or(&token_file_for_state(state_file.as_ref())),
1800
+ )?;
1801
+ remove_daemon_state(state_file)?;
1802
+ Ok(json!({"status": "stopped", "response": response}))
1803
+ }
1804
+
1805
+ pub fn status(state_file: impl AsRef<Path>) -> Result<Value> {
1806
+ Ok(match read_daemon_state(state_file)? {
1807
+ Some(state) => json!({"status": "running", "daemon": state, "base_url": state.base_url()}),
1808
+ None => json!({"status": "not-running"}),
1809
+ })
1810
+ }
1811
+
1812
+ pub fn http_request(
1813
+ host: &str,
1814
+ port: u16,
1815
+ method: &str,
1816
+ path: &str,
1817
+ body: Option<&[u8]>,
1818
+ ) -> Result<String> {
1819
+ http_request_with_bearer(host, port, method, path, body, None)
1820
+ }
1821
+
1822
+ pub fn http_request_with_bearer(
1823
+ host: &str,
1824
+ port: u16,
1825
+ method: &str,
1826
+ path: &str,
1827
+ body: Option<&[u8]>,
1828
+ bearer: Option<&str>,
1829
+ ) -> Result<String> {
1830
+ let mut stream = TcpStream::connect((host, port))?;
1831
+ let body = body.unwrap_or_default();
1832
+ write!(
1833
+ stream,
1834
+ "{} {} HTTP/1.1\r\nHost: {}:{}\r\nContent-Length: {}\r\n",
1835
+ method,
1836
+ path,
1837
+ host,
1838
+ port,
1839
+ body.len()
1840
+ )?;
1841
+ if let Some(token) = bearer.filter(|token| !token.is_empty()) {
1842
+ write!(stream, "Authorization: Bearer {token}\r\n")?;
1843
+ }
1844
+ write!(stream, "Connection: close\r\n\r\n")?;
1845
+ stream.write_all(body)?;
1846
+ let mut response = String::new();
1847
+ stream.read_to_string(&mut response)?;
1848
+ Ok(response)
1849
+ }
1850
+
1851
+ pub fn http_json_request(
1852
+ host: &str,
1853
+ port: u16,
1854
+ method: &str,
1855
+ path: &str,
1856
+ body: &Value,
1857
+ bearer: Option<&str>,
1858
+ ) -> Result<String> {
1859
+ let payload = serde_json::to_vec(body)?;
1860
+ let raw = http_request_with_bearer(host, port, method, path, Some(&payload), bearer)?;
1861
+ let (head, response_body) = raw
1862
+ .split_once("\r\n\r\n")
1863
+ .ok_or_else(|| OmxApiError::Message("local API returned malformed HTTP".to_string()))?;
1864
+ let status = head
1865
+ .lines()
1866
+ .next()
1867
+ .and_then(|line| line.split_whitespace().nth(1))
1868
+ .and_then(|value| value.parse::<u16>().ok())
1869
+ .unwrap_or(502);
1870
+ if !(200..300).contains(&status) {
1871
+ return Err(OmxApiError::Message(format!(
1872
+ "local API returned HTTP {status}: {response_body}"
1873
+ )));
1874
+ }
1875
+ Ok(response_body.to_string())
1876
+ }
1877
+
1878
+ fn resolve_client_target(state_file: PathBuf) -> Result<(String, u16, Option<String>)> {
1879
+ if let Some(url) = env::var("OMX_API_BASE_URL")
1880
+ .ok()
1881
+ .filter(|value| !value.trim().is_empty())
1882
+ {
1883
+ let parsed = parse_http_backend_url(url.trim_end_matches('/'))?;
1884
+ return Ok((
1885
+ parsed.host,
1886
+ parsed.port,
1887
+ env::var("OMX_API_LOCAL_BEARER").ok(),
1888
+ ));
1889
+ }
1890
+ if let Some(state) = read_daemon_state(&state_file)? {
1891
+ let token = read_local_bearer_token(
1892
+ state
1893
+ .local_bearer_token_file
1894
+ .as_ref()
1895
+ .unwrap_or(&token_file_for_state(&state_file)),
1896
+ )?;
1897
+ return Ok((state.host, state.port, token));
1898
+ }
1899
+ let port = env::var("OMX_API_PORT")
1900
+ .ok()
1901
+ .and_then(|value| value.parse::<u16>().ok())
1902
+ .unwrap_or(DEFAULT_API_PORT);
1903
+ Ok((
1904
+ "127.0.0.1".to_string(),
1905
+ port,
1906
+ env::var("OMX_API_LOCAL_BEARER").ok(),
1907
+ ))
1908
+ }
1909
+
1910
+ fn spawn_daemon(config: &ServerConfig) -> Result<DaemonState> {
1911
+ let exe = env::current_exe()?;
1912
+ let token = config
1913
+ .local_bearer_token
1914
+ .clone()
1915
+ .unwrap_or_else(generate_local_bearer_token);
1916
+ let mut args = vec![
1917
+ "serve".to_string(),
1918
+ "--host".to_string(),
1919
+ config.host.clone(),
1920
+ "--port".to_string(),
1921
+ config.port.to_string(),
1922
+ "--backend".to_string(),
1923
+ config.backend.as_str().to_string(),
1924
+ "--state-file".to_string(),
1925
+ config.state_file.display().to_string(),
1926
+ ];
1927
+ if config.once {
1928
+ args.push("--once".to_string());
1929
+ }
1930
+ let mut child = Command::new(exe)
1931
+ .args(args)
1932
+ .env("OMX_API_LOCAL_BEARER", &token)
1933
+ .stdin(Stdio::null())
1934
+ .stdout(Stdio::null())
1935
+ .stderr(Stdio::null())
1936
+ .spawn()?;
1937
+ wait_for_daemon_state(
1938
+ &mut child,
1939
+ &config.state_file,
1940
+ 100,
1941
+ Duration::from_millis(20),
1942
+ )
1943
+ }
1944
+
1945
+ fn terminate_child(child: &mut Child) {
1946
+ let _ = child.kill();
1947
+ let _ = child.wait();
1948
+ }
1949
+
1950
+ fn wait_for_daemon_state(
1951
+ child: &mut Child,
1952
+ state_file: &Path,
1953
+ attempts: usize,
1954
+ sleep: Duration,
1955
+ ) -> Result<DaemonState> {
1956
+ for _ in 0..attempts {
1957
+ match read_daemon_state(state_file) {
1958
+ Ok(Some(state)) => return Ok(state),
1959
+ Ok(None) => {}
1960
+ Err(error) => {
1961
+ terminate_child(child);
1962
+ return Err(error);
1963
+ }
1964
+ }
1965
+ match child.try_wait() {
1966
+ Ok(Some(status)) => {
1967
+ return Err(OmxApiError::Message(format!(
1968
+ "daemon exited before writing state: {status}"
1969
+ )));
1970
+ }
1971
+ Ok(None) => {}
1972
+ Err(error) => {
1973
+ terminate_child(child);
1974
+ return Err(error.into());
1975
+ }
1976
+ }
1977
+ std::thread::sleep(sleep);
1978
+ }
1979
+ terminate_child(child);
1980
+ Err(OmxApiError::Message(
1981
+ "daemon did not write state within timeout".to_string(),
1982
+ ))
1983
+ }
1984
+
1985
+ pub fn run_cli<I, W, E>(args: I, mut stdout: W, _stderr: E) -> Result<()>
1986
+ where
1987
+ I: IntoIterator,
1988
+ I::Item: Into<String>,
1989
+ W: Write,
1990
+ E: Write,
1991
+ {
1992
+ let args: Vec<String> = args.into_iter().map(Into::into).collect();
1993
+ match args.first().map(String::as_str) {
1994
+ Some("serve") => {
1995
+ if args[1..].iter().any(|arg| arg == "--system") {
1996
+ if args[1..].iter().any(|arg| arg == "--dry-run") {
1997
+ run_system_plan(&args[1..], stdout)?;
1998
+ return Ok(());
1999
+ }
2000
+ return Err(OmxApiError::Message(
2001
+ "serve --system is dry-run only in V1A; pass --dry-run to inspect the service plan"
2002
+ .to_string(),
2003
+ ));
2004
+ }
2005
+ let config = parse_server_config(&args[1..])?;
2006
+ if config.daemon {
2007
+ let state = spawn_daemon(&config)?;
2008
+ writeln!(
2009
+ stdout,
2010
+ "{}",
2011
+ serde_json::to_string_pretty(&json!({
2012
+ "status": "started",
2013
+ "daemon": state,
2014
+ "base_url": state.base_url()
2015
+ }))?
2016
+ )?;
2017
+ } else if config.once {
2018
+ let state = serve(config)?;
2019
+ writeln!(
2020
+ stdout,
2021
+ "{}",
2022
+ serde_json::to_string(&json!({"served": state}))?
2023
+ )?;
2024
+ } else {
2025
+ serve(config)?;
2026
+ }
2027
+ }
2028
+ Some("generate") => run_generate(&args[1..], stdout)?,
2029
+ Some("smoke") => run_smoke(&args[1..], stdout)?,
2030
+ Some("status") => {
2031
+ let state_file = parse_state_file(&args[1..])?;
2032
+ writeln!(
2033
+ stdout,
2034
+ "{}",
2035
+ serde_json::to_string_pretty(&status(state_file)?)?
2036
+ )?;
2037
+ }
2038
+ Some("stop") => {
2039
+ let state_file = parse_state_file(&args[1..])?;
2040
+ writeln!(
2041
+ stdout,
2042
+ "{}",
2043
+ serde_json::to_string_pretty(&stop_daemon(state_file)?)?
2044
+ )?;
2045
+ }
2046
+ Some("system") => run_system(&args[1..], stdout)?,
2047
+ Some("help") | Some("--help") | Some("-h") | None => {
2048
+ writeln!(stdout, "{}", help_text())?;
2049
+ }
2050
+ Some(other) => {
2051
+ return Err(OmxApiError::Message(format!(
2052
+ "unknown subcommand '{other}'"
2053
+ )))
2054
+ }
2055
+ }
2056
+ Ok(())
2057
+ }
2058
+
2059
+ fn run_system<W: Write>(args: &[String], mut stdout: W) -> Result<()> {
2060
+ match args.first().map(String::as_str) {
2061
+ Some("dry-run") => writeln!(
2062
+ stdout,
2063
+ "{}",
2064
+ serde_json::to_string_pretty(&json!({
2065
+ "ok": true,
2066
+ "action": "system.dry-run",
2067
+ "would_start": "omx-api serve --backend mock"
2068
+ }))?
2069
+ )?,
2070
+ Some("generate") => writeln!(
2071
+ stdout,
2072
+ "{}",
2073
+ serde_json::to_string_pretty(&json!({
2074
+ "ok": true,
2075
+ "action": "system.generate",
2076
+ "files": ["state-file", "localhost-http-server"]
2077
+ }))?
2078
+ )?,
2079
+ Some(other) => {
2080
+ return Err(OmxApiError::Message(format!(
2081
+ "unknown system action '{other}'"
2082
+ )))
2083
+ }
2084
+ None => {
2085
+ return Err(OmxApiError::Message(
2086
+ "system requires dry-run or generate".to_string(),
2087
+ ))
2088
+ }
2089
+ }
2090
+ Ok(())
2091
+ }
2092
+
2093
+ fn run_system_plan<W: Write>(args: &[String], mut stdout: W) -> Result<()> {
2094
+ let mut service_args = vec!["serve".to_string()];
2095
+ for arg in args {
2096
+ if arg != "--system" && arg != "--dry-run" {
2097
+ service_args.push(arg.clone());
2098
+ }
2099
+ }
2100
+ writeln!(
2101
+ stdout,
2102
+ "{}",
2103
+ serde_json::to_string_pretty(&json!({
2104
+ "ok": true,
2105
+ "action": "serve.system.dry-run",
2106
+ "platform": env::consts::OS,
2107
+ "install_supported": false,
2108
+ "reason": "V1A emits a platform-aware service plan but refuses persistent service installation",
2109
+ "argv": service_args
2110
+ }))?
2111
+ )?;
2112
+ Ok(())
2113
+ }
2114
+
2115
+ fn run_generate<W: Write>(args: &[String], mut stdout: W) -> Result<()> {
2116
+ let Some(kind) = args.first().map(String::as_str) else {
2117
+ return Err(OmxApiError::Message(
2118
+ "generate requires text or image".to_string(),
2119
+ ));
2120
+ };
2121
+ let mut state_file = default_state_file();
2122
+ let mut prompt_parts = Vec::new();
2123
+ let mut index = 1;
2124
+ while index < args.len() {
2125
+ match args[index].as_str() {
2126
+ "--state-file" => {
2127
+ index += 1;
2128
+ state_file = PathBuf::from(required_value(args, index, "--state-file")?);
2129
+ }
2130
+ value => prompt_parts.push(value.to_string()),
2131
+ }
2132
+ index += 1;
2133
+ }
2134
+ let prompt = prompt_parts.join(" ");
2135
+ if prompt.trim().is_empty() {
2136
+ return Err(OmxApiError::Message(format!(
2137
+ "generate {kind} requires a prompt"
2138
+ )));
2139
+ }
2140
+ let (host, port, bearer) = resolve_client_target(state_file)?;
2141
+ let (path, body) = match kind {
2142
+ "text" => (
2143
+ "/v1/responses",
2144
+ json!({"model": env::var("OMX_API_GENERATE_MODEL").unwrap_or_else(|_| "omx-private".to_string()), "input": prompt}),
2145
+ ),
2146
+ "image" => ("/v1/images/generations", json!({"prompt": prompt})),
2147
+ other => {
2148
+ return Err(OmxApiError::Message(format!(
2149
+ "unknown generate kind '{other}'; expected text or image"
2150
+ )))
2151
+ }
2152
+ };
2153
+ let response = http_json_request(&host, port, "POST", path, &body, bearer.as_deref())?;
2154
+ writeln!(stdout, "{response}")?;
2155
+ Ok(())
2156
+ }
2157
+
2158
+ fn run_smoke<W: Write>(args: &[String], mut stdout: W) -> Result<()> {
2159
+ match args.first().map(String::as_str) {
2160
+ Some("text") => {
2161
+ if env::var_os("OMX_API_LIVE_SMOKE").is_none() {
2162
+ return Err(OmxApiError::Message(
2163
+ "set OMX_API_LIVE_SMOKE=1 to run the real-private text smoke".to_string(),
2164
+ ));
2165
+ }
2166
+ let body = json!({"model": "omx-private", "input": "Say OMX API smoke OK."});
2167
+ let response = real_private_text_response(&body, "response", false);
2168
+ if !(200..300).contains(&response.status) {
2169
+ return Err(OmxApiError::Message(
2170
+ String::from_utf8_lossy(&response.body).trim().to_string(),
2171
+ ));
2172
+ }
2173
+ writeln!(stdout, "{}", String::from_utf8_lossy(&response.body).trim())?;
2174
+ Ok(())
2175
+ }
2176
+ _ => Err(OmxApiError::Message(
2177
+ "smoke requires text (example: OMX_API_LIVE_SMOKE=1 omx-api smoke text)".to_string(),
2178
+ )),
2179
+ }
2180
+ }
2181
+
2182
+ fn parse_server_config(args: &[String]) -> Result<ServerConfig> {
2183
+ let mut config = ServerConfig {
2184
+ local_bearer_token: env::var("OMX_API_LOCAL_BEARER")
2185
+ .ok()
2186
+ .filter(|value| !value.trim().is_empty()),
2187
+ ..ServerConfig::default()
2188
+ };
2189
+ if let Some(backend) = env::var("OMX_API_BACKEND")
2190
+ .ok()
2191
+ .filter(|value| !value.trim().is_empty())
2192
+ {
2193
+ config.backend = BackendMode::parse(&backend)?;
2194
+ }
2195
+ let mut index = 0;
2196
+ while index < args.len() {
2197
+ match args[index].as_str() {
2198
+ "--host" => {
2199
+ index += 1;
2200
+ config.host = required_value(args, index, "--host")?.to_string();
2201
+ }
2202
+ "--port" => {
2203
+ index += 1;
2204
+ config.port = required_value(args, index, "--port")?
2205
+ .parse()
2206
+ .map_err(|_| OmxApiError::Message("--port must be an integer".to_string()))?;
2207
+ }
2208
+ "--backend" => {
2209
+ index += 1;
2210
+ config.backend = BackendMode::parse(required_value(args, index, "--backend")?)?;
2211
+ }
2212
+ "--state-file" => {
2213
+ index += 1;
2214
+ config.state_file = PathBuf::from(required_value(args, index, "--state-file")?);
2215
+ }
2216
+ "--once" => config.once = true,
2217
+ "--daemon" => config.daemon = true,
2218
+ "--dry-run" => {}
2219
+ "--system" => {}
2220
+ other => {
2221
+ return Err(OmxApiError::Message(format!(
2222
+ "unknown serve flag '{other}'"
2223
+ )))
2224
+ }
2225
+ }
2226
+ index += 1;
2227
+ }
2228
+ validate_loopback_host(&config.host)?;
2229
+ if config.backend == BackendMode::RealPrivate && config.local_bearer_token.is_none() {
2230
+ config.local_bearer_token = Some(generate_local_bearer_token());
2231
+ }
2232
+ Ok(config)
2233
+ }
2234
+
2235
+ fn validate_loopback_host(host: &str) -> Result<()> {
2236
+ if is_loopback_host(host) {
2237
+ Ok(())
2238
+ } else {
2239
+ Err(OmxApiError::Message(format!(
2240
+ "omx-api is localhost-only; refusing non-loopback host `{host}`"
2241
+ )))
2242
+ }
2243
+ }
2244
+
2245
+ fn generate_local_bearer_token() -> String {
2246
+ let mut bytes = [0_u8; 32];
2247
+ if fs::File::open("/dev/urandom")
2248
+ .and_then(|mut file| file.read_exact(&mut bytes))
2249
+ .is_err()
2250
+ {
2251
+ let seed = format!("{}-{}", std::process::id(), now_unix());
2252
+ for (index, byte) in seed.as_bytes().iter().enumerate() {
2253
+ bytes[index % bytes.len()] ^= *byte;
2254
+ }
2255
+ }
2256
+ bytes.iter().map(|byte| format!("{byte:02x}")).collect()
2257
+ }
2258
+
2259
+ fn parse_state_file(args: &[String]) -> Result<PathBuf> {
2260
+ let mut state_file = default_state_file();
2261
+ let mut index = 0;
2262
+ while index < args.len() {
2263
+ match args[index].as_str() {
2264
+ "--state-file" => {
2265
+ index += 1;
2266
+ state_file = PathBuf::from(required_value(args, index, "--state-file")?);
2267
+ }
2268
+ other => return Err(OmxApiError::Message(format!("unknown flag '{other}'"))),
2269
+ }
2270
+ index += 1;
2271
+ }
2272
+ Ok(state_file)
2273
+ }
2274
+
2275
+ fn required_value<'a>(args: &'a [String], index: usize, flag: &str) -> Result<&'a str> {
2276
+ args.get(index)
2277
+ .map(String::as_str)
2278
+ .ok_or_else(|| OmxApiError::Message(format!("{flag} requires a value")))
2279
+ }
2280
+
2281
+ fn help_text() -> &'static str {
2282
+ "omx-api serve [--daemon] [--system --dry-run]|status|stop|generate text|generate image|smoke text\nNote: real-private backend mode is experimental and requires local bearer auth."
2283
+ }
2284
+
2285
+ fn now_unix() -> u64 {
2286
+ SystemTime::now()
2287
+ .duration_since(UNIX_EPOCH)
2288
+ .unwrap_or_default()
2289
+ .as_secs()
2290
+ }
2291
+
2292
+ #[cfg(test)]
2293
+ mod tests {
2294
+ use super::*;
2295
+ use std::sync::{Mutex, OnceLock};
2296
+
2297
+ fn env_lock() -> std::sync::MutexGuard<'static, ()> {
2298
+ static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
2299
+ LOCK.get_or_init(|| Mutex::new(()))
2300
+ .lock()
2301
+ .expect("env lock")
2302
+ }
2303
+
2304
+ fn request(method: &str, path: &str, body: Value) -> Request {
2305
+ Request {
2306
+ method: method.to_string(),
2307
+ path: path.to_string(),
2308
+ headers: BTreeMap::new(),
2309
+ body: serde_json::to_vec(&body).unwrap(),
2310
+ }
2311
+ }
2312
+
2313
+ #[test]
2314
+ fn routes_health_and_models() {
2315
+ let telemetry = Telemetry::default();
2316
+ let health = route_request(
2317
+ &request("GET", "/health", json!({})),
2318
+ &BackendMode::Mock,
2319
+ &telemetry,
2320
+ None,
2321
+ None,
2322
+ );
2323
+ assert_eq!(health.status, 200);
2324
+ assert!(String::from_utf8(health.body).unwrap().contains("mock"));
2325
+
2326
+ let models = route_request(
2327
+ &request("GET", "/v1/models", json!({})),
2328
+ &BackendMode::Mock,
2329
+ &telemetry,
2330
+ None,
2331
+ None,
2332
+ );
2333
+ assert_eq!(models.status, 200);
2334
+ assert!(String::from_utf8(models.body).unwrap().contains("omx-mock"));
2335
+ assert_eq!(telemetry.snapshot().requests_total, 2);
2336
+ }
2337
+
2338
+ #[test]
2339
+ fn response_endpoint_redacts_prompt_secrets() {
2340
+ let telemetry = Telemetry::default();
2341
+ let response = route_request(
2342
+ &request(
2343
+ "POST",
2344
+ "/v1/responses",
2345
+ json!({"input": "use sk-secret123 please"}),
2346
+ ),
2347
+ &BackendMode::Mock,
2348
+ &telemetry,
2349
+ None,
2350
+ None,
2351
+ );
2352
+ let body = String::from_utf8(response.body).unwrap();
2353
+ assert!(body.contains("[REDACTED]"));
2354
+ assert!(!body.contains("sk-secret123"));
2355
+ }
2356
+
2357
+ #[test]
2358
+ fn post_endpoints_reject_malformed_json() {
2359
+ let telemetry = Telemetry::default();
2360
+ for path in [
2361
+ "/v1/responses",
2362
+ "/v1/chat/completions",
2363
+ "/v1/images/generations",
2364
+ ] {
2365
+ let malformed = Request {
2366
+ method: "POST".to_string(),
2367
+ path: path.to_string(),
2368
+ headers: BTreeMap::new(),
2369
+ body: b"{bad json".to_vec(),
2370
+ };
2371
+ let response = route_request(&malformed, &BackendMode::Mock, &telemetry, None, None);
2372
+ assert_eq!(response.status, 400, "{path} should reject malformed JSON");
2373
+ let body = String::from_utf8(response.body).unwrap();
2374
+ assert!(body.contains("invalid_request_error"));
2375
+ }
2376
+ }
2377
+
2378
+ #[test]
2379
+ fn redacts_bearer_credentials_as_pairs() {
2380
+ let redacted = redact_secrets("Authorization: Bearer abc123 and Bearer def456");
2381
+ assert!(!redacted.contains("abc123"));
2382
+ assert!(!redacted.contains("def456"));
2383
+ assert!(redacted.contains("[REDACTED] [REDACTED]"));
2384
+ }
2385
+
2386
+ #[test]
2387
+ fn redact_secrets_handles_embedded_json_and_key_value_forms() {
2388
+ let raw = r#"error body {"access_token":"tok-1","api_key":"sk-json"} password: hunter2 sk-one sk-two"#;
2389
+ let redacted = redact_secrets(raw);
2390
+ for secret in ["tok-1", "sk-json", "hunter2", "sk-one", "sk-two"] {
2391
+ assert!(!redacted.contains(secret), "leaked {secret}: {redacted}");
2392
+ }
2393
+ assert!(redacted.contains("[REDACTED]"));
2394
+ }
2395
+
2396
+ #[test]
2397
+ fn read_http_request_rejects_oversized_body_before_allocation() {
2398
+ let listener = TcpListener::bind(("127.0.0.1", 0)).expect("bind listener");
2399
+ let port = listener.local_addr().expect("addr").port();
2400
+ let handle = std::thread::spawn(move || {
2401
+ let (mut server, _) = listener.accept().expect("accept");
2402
+ read_http_request(&mut server).expect_err("oversized request should fail")
2403
+ });
2404
+ let mut client = TcpStream::connect(("127.0.0.1", port)).expect("connect");
2405
+ write!(
2406
+ client,
2407
+ "POST /v1/responses HTTP/1.1\r\nHost: 127.0.0.1\r\nContent-Length: {}\r\n\r\n",
2408
+ MAX_HTTP_BODY_BYTES + 1
2409
+ )
2410
+ .expect("write request");
2411
+ let error = handle.join().expect("reader thread");
2412
+ assert!(error.to_string().contains("body too large"), "{error}");
2413
+ }
2414
+
2415
+ #[test]
2416
+ fn route_requires_matching_local_bearer_when_configured() {
2417
+ let telemetry = Telemetry::default();
2418
+ let response = route_request(
2419
+ &request("GET", "/v1/models", json!({})),
2420
+ &BackendMode::Mock,
2421
+ &telemetry,
2422
+ None,
2423
+ Some("secret-token"),
2424
+ );
2425
+ assert_eq!(response.status, 401);
2426
+
2427
+ let mut authed = request("GET", "/v1/models", json!({}));
2428
+ authed.headers.insert(
2429
+ "authorization".to_string(),
2430
+ "Bearer secret-token".to_string(),
2431
+ );
2432
+ let response = route_request(
2433
+ &authed,
2434
+ &BackendMode::Mock,
2435
+ &telemetry,
2436
+ None,
2437
+ Some("secret-token"),
2438
+ );
2439
+ assert_eq!(response.status, 200);
2440
+ }
2441
+
2442
+ #[test]
2443
+ fn private_backend_url_rejects_non_loopback_plain_http() {
2444
+ let error = parse_http_backend_url("http://example.com/v1/responses")
2445
+ .expect_err("non-loopback private backend must be rejected");
2446
+ assert!(error.to_string().contains("not loopback"));
2447
+ let error = parse_http_backend_url("http://127.0.0.1.evil.test/v1/responses")
2448
+ .expect_err("hostname prefix must not bypass loopback check");
2449
+ assert!(error.to_string().contains("not loopback"));
2450
+ }
2451
+
2452
+ #[test]
2453
+ fn codex_native_request_matches_installed_codex_responses_wire_shape() {
2454
+ let _guard = env_lock();
2455
+ env::set_var("OMX_API_CODEX_SESSION_ID", "session-1");
2456
+ env::set_var("OMX_API_CODEX_THREAD_ID", "thread-1");
2457
+ env::set_var("OMX_API_CODEX_INSTALLATION_ID", "install-1");
2458
+ env::set_var("OMX_API_CODEX_WINDOW_ID", "window-1");
2459
+ env::set_var("OMX_API_CODEX_USER_AGENT", "codex_cli_rs/test");
2460
+
2461
+ let auth = CodexOAuth {
2462
+ token: "oauth-token".to_string(),
2463
+ account_id: Some("account-1".to_string()),
2464
+ };
2465
+ let request = build_codex_native_request(
2466
+ "/backend-api/codex",
2467
+ &json!({
2468
+ "model": "gpt-5.3-codex",
2469
+ "input": "summarize this",
2470
+ "reasoning": {"effort": "low"},
2471
+ "instructions": "Follow the sparkshell summary contract."
2472
+ }),
2473
+ &auth,
2474
+ );
2475
+
2476
+ assert_eq!(request.path, "/backend-api/codex/responses");
2477
+ assert!(request
2478
+ .headers
2479
+ .contains(&("Accept".to_string(), "text/event-stream".to_string())));
2480
+ assert!(request.headers.contains(&(
2481
+ "Authorization".to_string(),
2482
+ "Bearer oauth-token".to_string()
2483
+ )));
2484
+ assert!(request
2485
+ .headers
2486
+ .contains(&("ChatGPT-Account-ID".to_string(), "account-1".to_string())));
2487
+ assert!(request
2488
+ .headers
2489
+ .contains(&("originator".to_string(), "codex_cli_rs".to_string())));
2490
+ assert!(request
2491
+ .headers
2492
+ .contains(&("x-client-request-id".to_string(), "thread-1".to_string())));
2493
+ assert!(request
2494
+ .headers
2495
+ .contains(&("session_id".to_string(), "session-1".to_string())));
2496
+ assert!(request
2497
+ .headers
2498
+ .contains(&("session-id".to_string(), "session-1".to_string())));
2499
+ assert!(request
2500
+ .headers
2501
+ .contains(&("thread_id".to_string(), "thread-1".to_string())));
2502
+ assert!(request
2503
+ .headers
2504
+ .contains(&("thread-id".to_string(), "thread-1".to_string())));
2505
+ assert!(!request
2506
+ .headers
2507
+ .iter()
2508
+ .any(|(name, _)| name == CODEX_INSTALLATION_ID_HEADER));
2509
+
2510
+ assert_eq!(request.body["model"], "gpt-5.3-codex");
2511
+ assert_eq!(request.body["tools"], json!([]));
2512
+ assert_eq!(request.body["tool_choice"], "auto");
2513
+ assert_eq!(request.body["parallel_tool_calls"], false);
2514
+ assert_eq!(request.body["reasoning"], json!({"effort": "low"}));
2515
+ assert_eq!(
2516
+ request.body["instructions"],
2517
+ "Follow the sparkshell summary contract."
2518
+ );
2519
+ assert_eq!(request.body["store"], false);
2520
+ assert_eq!(request.body["stream"], true);
2521
+ assert_eq!(request.body["include"], json!([]));
2522
+ assert_eq!(request.body["prompt_cache_key"], "thread-1");
2523
+ assert_eq!(
2524
+ request.body["client_metadata"][CODEX_INSTALLATION_ID_HEADER],
2525
+ "install-1"
2526
+ );
2527
+ assert_eq!(
2528
+ request.body["input"],
2529
+ json!([{
2530
+ "type": "message",
2531
+ "role": "user",
2532
+ "content": [{"type": "input_text", "text": "summarize this"}]
2533
+ }])
2534
+ );
2535
+
2536
+ env::remove_var("OMX_API_CODEX_SESSION_ID");
2537
+ env::remove_var("OMX_API_CODEX_THREAD_ID");
2538
+ env::remove_var("OMX_API_CODEX_INSTALLATION_ID");
2539
+ env::remove_var("OMX_API_CODEX_WINDOW_ID");
2540
+ env::remove_var("OMX_API_CODEX_USER_AGENT");
2541
+ }
2542
+
2543
+ #[test]
2544
+ fn real_private_posts_codex_native_request_and_parses_sse_text() {
2545
+ let _guard = env_lock();
2546
+ env::remove_var("OMX_API_REAL_PRIVATE_RESPONSE_TEXT");
2547
+ env::set_var("OMX_API_CODEX_OAUTH_TOKEN", "oauth-token");
2548
+ env::set_var("OMX_API_CODEX_ACCOUNT_ID", "account-1");
2549
+ env::set_var("OMX_API_CODEX_THREAD_ID", "thread-1");
2550
+ env::set_var("OMX_API_CODEX_SESSION_ID", "session-1");
2551
+
2552
+ let listener = TcpListener::bind(("127.0.0.1", 0)).expect("bind private backend");
2553
+ let addr = listener.local_addr().expect("local addr");
2554
+ let seen = Arc::new(Mutex::new(String::new()));
2555
+ let seen_thread = Arc::clone(&seen);
2556
+ let handle = std::thread::spawn(move || {
2557
+ let (mut stream, _) = listener.accept().expect("accept request");
2558
+ let mut raw_bytes = Vec::new();
2559
+ let mut buffer = [0_u8; 1024];
2560
+ let header_end = loop {
2561
+ let read = stream.read(&mut buffer).expect("read request");
2562
+ assert!(read > 0, "request closed before headers");
2563
+ raw_bytes.extend_from_slice(&buffer[..read]);
2564
+ if let Some(index) = raw_bytes.windows(4).position(|chunk| chunk == b"\r\n\r\n") {
2565
+ break index + 4;
2566
+ }
2567
+ };
2568
+ let head = String::from_utf8_lossy(&raw_bytes[..header_end]).to_string();
2569
+ let content_length = head
2570
+ .lines()
2571
+ .find_map(|line| line.strip_prefix("Content-Length: "))
2572
+ .and_then(|value| value.trim().parse::<usize>().ok())
2573
+ .expect("content length");
2574
+ while raw_bytes.len() < header_end + content_length {
2575
+ let read = stream.read(&mut buffer).expect("read body");
2576
+ assert!(read > 0, "request closed before body");
2577
+ raw_bytes.extend_from_slice(&buffer[..read]);
2578
+ }
2579
+ let raw = String::from_utf8_lossy(&raw_bytes).to_string();
2580
+ *seen_thread.lock().expect("seen lock") = raw;
2581
+ let body = concat!(
2582
+ "event: response.output_text.delta\n",
2583
+ "data: {\"type\":\"response.output_text.delta\",\"delta\":\"hello\"}\n\n",
2584
+ "data: [DONE]\n\n"
2585
+ );
2586
+ write!(
2587
+ stream,
2588
+ "HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{}",
2589
+ body.len(),
2590
+ body
2591
+ )
2592
+ .expect("write response");
2593
+ });
2594
+
2595
+ env::set_var(
2596
+ "OMX_API_PRIVATE_BACKEND_URL",
2597
+ format!("http://127.0.0.1:{}/backend-api/codex", addr.port()),
2598
+ );
2599
+ let text = real_private_text(&json!({
2600
+ "model": "gpt-5.3-codex",
2601
+ "input": "ping",
2602
+ "reasoning": {"effort": "low"},
2603
+ "instructions": "Summarize via sparkshell."
2604
+ }))
2605
+ .expect("private text response");
2606
+ handle.join().expect("server thread");
2607
+
2608
+ assert_eq!(text, "hello");
2609
+ let raw = seen.lock().expect("seen lock").clone();
2610
+ assert!(raw.starts_with("POST /backend-api/codex/responses HTTP/1.1"));
2611
+ assert!(raw.contains("Accept: text/event-stream\r\n"));
2612
+ assert!(raw.contains("Authorization: Bearer oauth-token\r\n"));
2613
+ assert!(raw.contains("ChatGPT-Account-ID: account-1\r\n"));
2614
+ assert!(raw.contains("originator: codex_cli_rs\r\n"));
2615
+ assert!(raw.contains("\"stream\":true") || raw.contains("\"stream\": true"));
2616
+ assert!(
2617
+ raw.contains("\"prompt_cache_key\":\"thread-1\"")
2618
+ || raw.contains("\"prompt_cache_key\": \"thread-1\"")
2619
+ );
2620
+ assert!(
2621
+ raw.contains("\"type\":\"input_text\"") || raw.contains("\"type\": \"input_text\"")
2622
+ );
2623
+ assert!(raw.contains("\"text\":\"ping\"") || raw.contains("\"text\": \"ping\""));
2624
+ let forwarded_body = raw.split("\r\n\r\n").nth(1).expect("forwarded body");
2625
+ let forwarded_json: Value = serde_json::from_str(forwarded_body).expect("forwarded JSON");
2626
+ assert_eq!(forwarded_json["reasoning"], json!({"effort": "low"}));
2627
+ assert_eq!(forwarded_json["instructions"], "Summarize via sparkshell.");
2628
+
2629
+ env::remove_var("OMX_API_CODEX_OAUTH_TOKEN");
2630
+ env::remove_var("OMX_API_CODEX_ACCOUNT_ID");
2631
+ env::remove_var("OMX_API_CODEX_THREAD_ID");
2632
+ env::remove_var("OMX_API_CODEX_SESSION_ID");
2633
+ env::remove_var("OMX_API_PRIVATE_BACKEND_URL");
2634
+ }
2635
+
2636
+ #[test]
2637
+ fn real_private_responses_stream_uses_upstream_sse() {
2638
+ let _guard = env_lock();
2639
+ env::remove_var("OMX_API_REAL_PRIVATE_RESPONSE_TEXT");
2640
+ env::set_var("OMX_API_CODEX_OAUTH_TOKEN", "oauth-token");
2641
+
2642
+ let listener = TcpListener::bind(("127.0.0.1", 0)).expect("bind private backend");
2643
+ let addr = listener.local_addr().expect("local addr");
2644
+
2645
+ let handle = std::thread::spawn(move || {
2646
+ let (mut stream, _) = listener.accept().expect("accept request");
2647
+ let mut raw = Vec::new();
2648
+ let mut buffer = [0_u8; 1024];
2649
+ let header_end = loop {
2650
+ let read = stream.read(&mut buffer).expect("read request");
2651
+ assert!(read > 0, "request closed before headers");
2652
+ raw.extend_from_slice(&buffer[..read]);
2653
+ if let Some(index) = raw.windows(4).position(|chunk| chunk == b"\r\n\r\n") {
2654
+ break index + 4;
2655
+ }
2656
+ };
2657
+ let head = String::from_utf8_lossy(&raw[..header_end]).to_string();
2658
+ let content_length = head
2659
+ .lines()
2660
+ .find_map(|line| line.strip_prefix("Content-Length: "))
2661
+ .and_then(|value| value.trim().parse::<usize>().ok())
2662
+ .expect("content length");
2663
+ while raw.len() < header_end + content_length {
2664
+ let read = stream.read(&mut buffer).expect("read request body");
2665
+ assert!(read > 0, "request closed before body");
2666
+ raw.extend_from_slice(&buffer[..read]);
2667
+ }
2668
+
2669
+ let body = concat!(
2670
+ "event: response.output_text.delta\n",
2671
+ "data: {\"type\":\"response.output_text.delta\",\"delta\":\"hello\"}\n\n",
2672
+ "data: [DONE]\n\n"
2673
+ );
2674
+ write!(
2675
+ stream,
2676
+ "HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{}",
2677
+ body.len(),
2678
+ body
2679
+ )
2680
+ .expect("write response");
2681
+ });
2682
+
2683
+ env::set_var(
2684
+ "OMX_API_PRIVATE_BACKEND_URL",
2685
+ format!("http://127.0.0.1:{}/backend-api/codex", addr.port()),
2686
+ );
2687
+
2688
+ let response = route_request(
2689
+ &request("POST", "/v1/responses", json!({"stream": true})),
2690
+ &BackendMode::RealPrivate,
2691
+ &Telemetry::default(),
2692
+ None,
2693
+ None,
2694
+ );
2695
+
2696
+ handle.join().expect("server thread");
2697
+ assert_eq!(response.status, 200);
2698
+ assert_eq!(response.content_type, "text/event-stream");
2699
+ let body = String::from_utf8(response.body).unwrap();
2700
+ assert!(body.contains("response.output_text.delta"));
2701
+ assert!(body.contains("data: [DONE]"));
2702
+
2703
+ env::remove_var("OMX_API_CODEX_OAUTH_TOKEN");
2704
+ env::remove_var("OMX_API_PRIVATE_BACKEND_URL");
2705
+ }
2706
+
2707
+ #[test]
2708
+ fn real_private_image_falls_back_to_responses_image_tool() {
2709
+ let _guard = env_lock();
2710
+ env::remove_var("OMX_API_REAL_PRIVATE_IMAGE_B64_JSON");
2711
+ env::remove_var("OMX_API_REAL_PRIVATE_IMAGE_URL");
2712
+ env::remove_var("OMX_API_PRIVATE_IMAGE_BACKEND_URL");
2713
+ env::set_var("OMX_API_CODEX_OAUTH_TOKEN", "oauth-token");
2714
+
2715
+ let listener = TcpListener::bind(("127.0.0.1", 0)).expect("bind private backend");
2716
+ let addr = listener.local_addr().expect("local addr");
2717
+ let seen = Arc::new(Mutex::new(String::new()));
2718
+ let seen_thread = Arc::clone(&seen);
2719
+ let handle = std::thread::spawn(move || {
2720
+ let (mut stream, _) = listener.accept().expect("accept request");
2721
+ let mut raw_bytes = Vec::new();
2722
+ let mut buffer = [0_u8; 1024];
2723
+ let header_end = loop {
2724
+ let read = stream.read(&mut buffer).expect("read request");
2725
+ assert!(read > 0, "request closed before headers");
2726
+ raw_bytes.extend_from_slice(&buffer[..read]);
2727
+ if let Some(index) = raw_bytes.windows(4).position(|chunk| chunk == b"\r\n\r\n") {
2728
+ break index + 4;
2729
+ }
2730
+ };
2731
+ let head = String::from_utf8_lossy(&raw_bytes[..header_end]).to_string();
2732
+ let content_length = head
2733
+ .lines()
2734
+ .find_map(|line| line.strip_prefix("Content-Length: "))
2735
+ .and_then(|value| value.trim().parse::<usize>().ok())
2736
+ .expect("content length");
2737
+ while raw_bytes.len() < header_end + content_length {
2738
+ let read = stream.read(&mut buffer).expect("read request body");
2739
+ assert!(read > 0, "request closed before body");
2740
+ raw_bytes.extend_from_slice(&buffer[..read]);
2741
+ }
2742
+ *seen_thread.lock().expect("seen lock") =
2743
+ String::from_utf8_lossy(&raw_bytes).to_string();
2744
+ let body = concat!(
2745
+ "event: response.image_generation_call.partial_image\n",
2746
+ "data: {\"type\":\"response.image_generation_call.partial_image\",\"partial_image\":\"ZmFrZS1pbWFnZS10b29s\"}\n\n",
2747
+ "data: [DONE]\n\n"
2748
+ );
2749
+ write!(
2750
+ stream,
2751
+ "HTTP/1.1 200 OK\r\nContent-Type: text/event-stream\r\nContent-Length: {}\r\nConnection: close\r\n\r\n{}",
2752
+ body.len(),
2753
+ body
2754
+ )
2755
+ .expect("write response");
2756
+ });
2757
+
2758
+ env::set_var(
2759
+ "OMX_API_PRIVATE_BACKEND_URL",
2760
+ format!("http://127.0.0.1:{}/backend-api/codex", addr.port()),
2761
+ );
2762
+ let response = route_request(
2763
+ &request(
2764
+ "POST",
2765
+ "/v1/images/generations",
2766
+ json!({"prompt": "tool image", "stream": true}),
2767
+ ),
2768
+ &BackendMode::RealPrivate,
2769
+ &Telemetry::default(),
2770
+ None,
2771
+ None,
2772
+ );
2773
+
2774
+ handle.join().expect("server thread");
2775
+ assert_eq!(response.status, 200);
2776
+ assert_eq!(response.content_type, "text/event-stream");
2777
+ let body = String::from_utf8(response.body).unwrap();
2778
+ assert!(body.contains("image_generation.partial_image"));
2779
+ assert!(body.contains("ZmFrZS1pbWFnZS10b29s"));
2780
+ let raw = seen.lock().expect("seen lock").clone();
2781
+ let forwarded_body = raw.split("\r\n\r\n").nth(1).expect("forwarded body");
2782
+ let forwarded_json: Value = serde_json::from_str(forwarded_body).expect("forwarded JSON");
2783
+ assert_eq!(
2784
+ forwarded_json["tools"],
2785
+ json!([{"type": "image_generation"}])
2786
+ );
2787
+ assert_eq!(
2788
+ forwarded_json["tool_choice"],
2789
+ json!({"type": "image_generation"})
2790
+ );
2791
+ assert_eq!(
2792
+ forwarded_json["input"][0]["content"][0]["text"],
2793
+ "tool image"
2794
+ );
2795
+
2796
+ env::remove_var("OMX_API_CODEX_OAUTH_TOKEN");
2797
+ env::remove_var("OMX_API_PRIVATE_BACKEND_URL");
2798
+ }
2799
+
2800
+ #[test]
2801
+ fn redact_secrets_handles_chunk_like_sse_frames() {
2802
+ let chunk = "data: {\"message\":\"Bearer sk-mock-token\"}\n";
2803
+ let redacted = redact_secrets(chunk);
2804
+ assert!(!redacted.contains("sk-mock-token"));
2805
+ assert!(redacted.contains("[REDACTED]"));
2806
+ }
2807
+
2808
+ #[test]
2809
+ fn chat_stream_response_uses_chat_chunk_shape() {
2810
+ let telemetry = Telemetry::default();
2811
+ let response = route_request(
2812
+ &request(
2813
+ "POST",
2814
+ "/v1/chat/completions",
2815
+ json!({"stream": true, "messages": []}),
2816
+ ),
2817
+ &BackendMode::Mock,
2818
+ &telemetry,
2819
+ None,
2820
+ None,
2821
+ );
2822
+ assert_eq!(response.content_type, "text/event-stream");
2823
+ let body = String::from_utf8(response.body).unwrap();
2824
+ assert!(body.contains("\"object\":\"chat.completion.chunk\""));
2825
+ assert!(body.contains("\"delta\":{\"content\":\"omx mock response\"}"));
2826
+ assert!(body.contains("data: [DONE]"));
2827
+ }
2828
+
2829
+ #[test]
2830
+ fn image_stream_response_uses_image_events() {
2831
+ let telemetry = Telemetry::default();
2832
+ let response = route_request(
2833
+ &request(
2834
+ "POST",
2835
+ "/v1/images/generations",
2836
+ json!({"stream": true, "prompt": "x"}),
2837
+ ),
2838
+ &BackendMode::Mock,
2839
+ &telemetry,
2840
+ None,
2841
+ None,
2842
+ );
2843
+ assert_eq!(response.content_type, "text/event-stream");
2844
+ let body = String::from_utf8(response.body).unwrap();
2845
+ assert!(body.contains("event: image_generation.partial_image"));
2846
+ assert!(body.contains("data: [DONE]"));
2847
+ }
2848
+
2849
+ #[test]
2850
+ fn real_private_image_reports_unconfigured_without_image_backend() {
2851
+ let _guard = env_lock();
2852
+ env::set_var("OMX_API_CODEX_OAUTH_TOKEN", "oauth-token");
2853
+ env::remove_var("OMX_API_REAL_PRIVATE_IMAGE_B64_JSON");
2854
+ env::remove_var("OMX_API_REAL_PRIVATE_IMAGE_URL");
2855
+ env::remove_var("OMX_API_PRIVATE_IMAGE_BACKEND_URL");
2856
+ env::remove_var("OMX_API_PRIVATE_BACKEND_URL");
2857
+ let telemetry = Telemetry::default();
2858
+ let response = route_request(
2859
+ &request("POST", "/v1/images/generations", json!({"prompt": "x"})),
2860
+ &BackendMode::RealPrivate,
2861
+ &telemetry,
2862
+ None,
2863
+ None,
2864
+ );
2865
+ assert_eq!(response.status, 501);
2866
+ assert!(String::from_utf8(response.body)
2867
+ .unwrap()
2868
+ .contains("private_image_backend_unconfigured"));
2869
+ env::remove_var("OMX_API_CODEX_OAUTH_TOKEN");
2870
+ }
2871
+
2872
+ #[test]
2873
+ fn real_private_chat_stream_preserves_backend_errors() {
2874
+ let _guard = env_lock();
2875
+ env::remove_var("OMX_API_REAL_PRIVATE_RESPONSE_TEXT");
2876
+ env::remove_var("OMX_API_CODEX_OAUTH_TOKEN");
2877
+ env::remove_var("OMX_API_PRIVATE_BACKEND_URL");
2878
+ let previous_codex_home = env::var("CODEX_HOME").ok();
2879
+ env::set_var(
2880
+ "CODEX_HOME",
2881
+ env::temp_dir().join("omx-api-test-missing-auth"),
2882
+ );
2883
+ let telemetry = Telemetry::default();
2884
+ let response = route_request(
2885
+ &request(
2886
+ "POST",
2887
+ "/v1/chat/completions",
2888
+ json!({"stream": true, "messages": []}),
2889
+ ),
2890
+ &BackendMode::RealPrivate,
2891
+ &telemetry,
2892
+ None,
2893
+ None,
2894
+ );
2895
+ let status = response.status;
2896
+ let content_type = response.content_type.clone();
2897
+ let body = String::from_utf8(response.body).unwrap();
2898
+ if let Some(codex_home) = previous_codex_home {
2899
+ env::set_var("CODEX_HOME", codex_home);
2900
+ } else {
2901
+ env::remove_var("CODEX_HOME");
2902
+ }
2903
+
2904
+ assert_eq!(status, 503);
2905
+ assert_eq!(content_type, "application/json");
2906
+ assert!(body.contains("missing_auth"));
2907
+ }
2908
+
2909
+ #[test]
2910
+ fn live_text_smoke_fails_when_private_backend_returns_error() {
2911
+ let _guard = env_lock();
2912
+ env::set_var("OMX_API_LIVE_SMOKE", "1");
2913
+ env::remove_var("OMX_API_REAL_PRIVATE_RESPONSE_TEXT");
2914
+ env::set_var("OMX_API_CODEX_OAUTH_TOKEN", "oauth-token");
2915
+ env::remove_var("OMX_API_PRIVATE_BACKEND_URL");
2916
+
2917
+ let mut stdout = Vec::new();
2918
+ let error = run_cli(["smoke", "text"], &mut stdout, Vec::new())
2919
+ .expect_err("smoke must fail on real-private error JSON");
2920
+
2921
+ assert!(stdout.is_empty(), "error smoke should not write stdout");
2922
+ assert!(error.to_string().contains("private_backend_unconfigured"));
2923
+
2924
+ env::remove_var("OMX_API_LIVE_SMOKE");
2925
+ env::remove_var("OMX_API_CODEX_OAUTH_TOKEN");
2926
+ }
2927
+
2928
+ #[test]
2929
+ fn live_text_smoke_succeeds_when_response_fixture_set() {
2930
+ let _guard = env_lock();
2931
+ let mut stdout = Vec::new();
2932
+ env::set_var("OMX_API_LIVE_SMOKE", "1");
2933
+ env::set_var("OMX_API_REAL_PRIVATE_RESPONSE_TEXT", "ok-fixture-smoke");
2934
+
2935
+ run_cli(["smoke", "text"], &mut stdout, Vec::new()).unwrap();
2936
+
2937
+ env::remove_var("OMX_API_LIVE_SMOKE");
2938
+ env::remove_var("OMX_API_REAL_PRIVATE_RESPONSE_TEXT");
2939
+ assert!(String::from_utf8(stdout)
2940
+ .unwrap()
2941
+ .contains("ok-fixture-smoke"));
2942
+ }
2943
+
2944
+ #[test]
2945
+ fn daemon_state_round_trips() {
2946
+ let path = env::temp_dir().join(format!("omx-api-test-{}.json", now_unix()));
2947
+ let state = DaemonState {
2948
+ pid: 42,
2949
+ host: "127.0.0.1".to_string(),
2950
+ port: 9999,
2951
+ backend: BackendMode::Mock,
2952
+ started_at_unix: 1,
2953
+ local_bearer_token: None,
2954
+ local_bearer_token_file: None,
2955
+ };
2956
+ write_daemon_state(&path, &state).unwrap();
2957
+ let raw = fs::read_to_string(&path).unwrap();
2958
+ assert!(!raw.contains("local_bearer_token"));
2959
+ let read = read_daemon_state(&path).unwrap().unwrap();
2960
+ assert_eq!(read.pid, 42);
2961
+ remove_daemon_state(&path).unwrap();
2962
+ assert!(read_daemon_state(&path).unwrap().is_none());
2963
+ }
2964
+
2965
+ #[test]
2966
+ fn daemon_startup_timeout_kills_child_process_to_avoid_process_leak() {
2967
+ let path = env::temp_dir().join(format!("omx-api-timeout-test-{}.json", now_unix()));
2968
+ let mut child = Command::new("sh")
2969
+ .arg("-c")
2970
+ .arg("sleep 60")
2971
+ .stdin(Stdio::null())
2972
+ .stdout(Stdio::null())
2973
+ .stderr(Stdio::null())
2974
+ .spawn()
2975
+ .expect("spawn sleep child");
2976
+
2977
+ let error = wait_for_daemon_state(&mut child, &path, 1, Duration::from_millis(1))
2978
+ .expect_err("missing state should time out");
2979
+
2980
+ assert!(error
2981
+ .to_string()
2982
+ .contains("daemon did not write state within timeout"));
2983
+ assert!(
2984
+ child.try_wait().unwrap().is_some(),
2985
+ "timeout path should reap the spawned daemon child"
2986
+ );
2987
+ let _ = fs::remove_file(path);
2988
+ }
2989
+
2990
+ #[test]
2991
+ fn cli_system_dry_run_is_json() {
2992
+ let mut out = Vec::new();
2993
+ run_cli(["system", "dry-run"], &mut out, io::sink()).unwrap();
2994
+ let value: Value = serde_json::from_slice(&out).unwrap();
2995
+ assert_eq!(value["action"], "system.dry-run");
2996
+ }
2997
+ }