literally-aeo 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/README.md +71 -7
  2. package/dist/author-tools.js +512 -461
  3. package/dist/cli.mjs +3512 -2010
  4. package/dist/lib/access/schema.js +6 -6
  5. package/dist/lib/agents/author-schema.js +11 -12
  6. package/dist/lib/agents/author-validation.js +19 -20
  7. package/dist/lib/agents/copy-validation.js +22 -22
  8. package/dist/lib/agents/copywriter-input.js +22 -7
  9. package/dist/lib/agents/facts.js +21 -6
  10. package/dist/lib/agents/narrative-facts.js +20 -2
  11. package/dist/lib/agents/verifier.js +26 -25
  12. package/dist/lib/analysis/domain-classifier.js +21 -22
  13. package/dist/lib/analysis/domain-labels.js +11 -12
  14. package/dist/lib/analysis/progress-schema.js +2 -2
  15. package/dist/lib/analysis/progress.js +19 -21
  16. package/dist/lib/analysis/retrieval.js +20 -3
  17. package/dist/lib/analysis/scoring.js +20 -3
  18. package/dist/lib/analysis/search-analyzer.js +19 -5
  19. package/dist/lib/analysis/sentiment.js +18 -19
  20. package/dist/lib/author/examples.js +12 -13
  21. package/dist/lib/bundle/contracts.js +15 -14
  22. package/dist/lib/bundle/export.js +34 -31
  23. package/dist/lib/bundle/isolation.js +17 -0
  24. package/dist/lib/bundle/journal.js +14 -15
  25. package/dist/lib/bundle/project-journal.js +19 -18
  26. package/dist/lib/bundle/project.js +31 -28
  27. package/dist/lib/bundle/read.js +35 -32
  28. package/dist/lib/bundle/recorder.js +17 -16
  29. package/dist/lib/bundle/redact.js +14 -15
  30. package/dist/lib/bundle/trace-coverage.js +14 -15
  31. package/dist/lib/bundle/verify-integrity.js +16 -17
  32. package/dist/lib/bundle/verify-measurement.js +22 -23
  33. package/dist/lib/bundle/verify-report.js +29 -30
  34. package/dist/lib/bundle/verify.js +37 -38
  35. package/dist/lib/bundle/writer-lock.js +3 -1
  36. package/dist/lib/capture-manifest.js +13 -14
  37. package/dist/lib/checks/crawler-access.js +4 -1
  38. package/dist/lib/checks/renderability.js +5 -1
  39. package/dist/lib/checks/run-checks.js +23 -19
  40. package/dist/lib/chunks/chunk-2B5QF6UQ.js +159 -0
  41. package/dist/lib/chunks/chunk-2FOKEIIN.js +93 -0
  42. package/dist/lib/chunks/{chunk-KRFHQQS7.js → chunk-2KH7LNK7.js} +24 -24
  43. package/dist/lib/chunks/{chunk-NVBMIPXR.js → chunk-3GPUCXVA.js} +44 -26
  44. package/dist/lib/chunks/{chunk-3EBWDHPK.js → chunk-3OE4UQIB.js} +14 -16
  45. package/dist/lib/chunks/{chunk-FNDJUELJ.js → chunk-3OWJBGQE.js} +14 -14
  46. package/dist/lib/chunks/{chunk-Y4OGZ3Q5.js → chunk-46PVVQYR.js} +1 -1
  47. package/dist/lib/chunks/{chunk-EV4DRS5M.js → chunk-4XIAXX7K.js} +1 -1
  48. package/dist/lib/chunks/{chunk-IBOWGKN7.js → chunk-52F5XYOW.js} +1 -1
  49. package/dist/lib/chunks/{chunk-3DG7GHFA.js → chunk-66DVMLGR.js} +10 -10
  50. package/dist/lib/chunks/{chunk-FFOVLI3U.js → chunk-66T7JC57.js} +12 -10
  51. package/dist/lib/chunks/{chunk-KMRQSIZW.js → chunk-6GOBBNDU.js} +16 -1
  52. package/dist/lib/chunks/{chunk-WUELMJ22.js → chunk-6HMHXSCS.js} +2 -2
  53. package/dist/lib/chunks/{chunk-SWS3K62X.js → chunk-6JICXLDA.js} +3 -3
  54. package/dist/lib/chunks/{chunk-SBAZBOPI.js → chunk-6P7EZJI7.js} +4 -2
  55. package/dist/lib/chunks/chunk-75DMLOQ7.js +127 -0
  56. package/dist/lib/chunks/{chunk-RMFT4KKK.js → chunk-7CW6U5WJ.js} +1 -1
  57. package/dist/lib/chunks/{chunk-5VNYUCLL.js → chunk-7HM6IZ3L.js} +6 -9
  58. package/dist/lib/chunks/{chunk-X6E44EGV.js → chunk-7LBSNDRR.js} +10 -8
  59. package/dist/lib/chunks/{chunk-S2AM76LT.js → chunk-7WO3FFPS.js} +3 -3
  60. package/dist/lib/chunks/{chunk-ULRXHSJL.js → chunk-7YDXD4MD.js} +9 -6
  61. package/dist/lib/chunks/{chunk-HFOYASRQ.js → chunk-AAFHXNLU.js} +4 -4
  62. package/dist/lib/chunks/{chunk-OBXAHX3L.js → chunk-AASWJR7Q.js} +1 -5
  63. package/dist/lib/chunks/{chunk-MD4AVTK2.js → chunk-AJKV46SM.js} +3 -3
  64. package/dist/lib/chunks/{chunk-IEVAFDW7.js → chunk-AJO7XVXK.js} +12 -12
  65. package/dist/lib/chunks/{chunk-GMKF2FU4.js → chunk-AK6YNTCV.js} +1 -1
  66. package/dist/lib/chunks/{chunk-WKH6BJAZ.js → chunk-BFWK3TBN.js} +6 -6
  67. package/dist/lib/chunks/{chunk-FKLNEB2P.js → chunk-BGAHZIL3.js} +51 -17
  68. package/dist/lib/chunks/{chunk-ZCOI3HE2.js → chunk-BRENK356.js} +1 -1
  69. package/dist/lib/chunks/{chunk-S7KJZIUR.js → chunk-BXF4OC74.js} +18 -9
  70. package/dist/lib/chunks/{chunk-NCLFZOZU.js → chunk-CH7OCYDL.js} +1 -1
  71. package/dist/lib/chunks/{chunk-FPAN3VRW.js → chunk-DDS4G4DO.js} +27 -19
  72. package/dist/lib/chunks/{chunk-ZLOOC46D.js → chunk-DL6YQDTE.js} +34 -8
  73. package/dist/lib/chunks/chunk-DVFFYY5G.js +74 -0
  74. package/dist/lib/chunks/{chunk-PDS5KWO3.js → chunk-E2YTTB6Q.js} +56 -42
  75. package/dist/lib/chunks/{chunk-YR67JG2V.js → chunk-E3OGPTUY.js} +8 -3
  76. package/dist/lib/chunks/{chunk-SDWYZM64.js → chunk-EDQTINTL.js} +5 -1
  77. package/dist/lib/chunks/chunk-ESEMYWUH.js +257 -0
  78. package/dist/lib/chunks/{chunk-YHS5IEVZ.js → chunk-F2NSJ6PG.js} +12 -8
  79. package/dist/lib/chunks/{chunk-7GXRDAUY.js → chunk-F7DBTXKG.js} +6 -6
  80. package/dist/lib/chunks/chunk-FAUFE7MI.js +31 -0
  81. package/dist/lib/chunks/{chunk-4E4NDGOZ.js → chunk-FDM2YNQL.js} +1 -1
  82. package/dist/lib/chunks/{chunk-47IZBMP2.js → chunk-FIC7JSR4.js} +2 -2
  83. package/dist/lib/chunks/{chunk-CJ5YD3CU.js → chunk-FJL2V6P5.js} +6 -6
  84. package/dist/lib/chunks/{chunk-KHU5DRBE.js → chunk-FL6LN2K6.js} +9 -9
  85. package/dist/lib/chunks/{chunk-HSZ3DM74.js → chunk-GEFKDW7X.js} +15 -2
  86. package/dist/lib/chunks/{chunk-XNRSHATN.js → chunk-HI3PD3KR.js} +8 -8
  87. package/dist/lib/chunks/{chunk-AUB5THIS.js → chunk-I3UE52ZV.js} +2 -2
  88. package/dist/lib/chunks/{chunk-IAR6XGEW.js → chunk-J5NPHPXY.js} +5 -4
  89. package/dist/lib/chunks/{chunk-XJVXASDD.js → chunk-JBOOD6MU.js} +11 -10
  90. package/dist/lib/chunks/{chunk-5KKLUM7M.js → chunk-JKPBXPCW.js} +3 -3
  91. package/dist/lib/chunks/{chunk-5HT55QYX.js → chunk-JQDQVG3D.js} +1 -1
  92. package/dist/lib/chunks/{chunk-3KQFLOC7.js → chunk-JXBLGCXZ.js} +1 -1
  93. package/dist/lib/chunks/{chunk-D2INDP5W.js → chunk-JYFEXVWC.js} +7 -6
  94. package/dist/lib/chunks/{chunk-X2Y2ZNG3.js → chunk-K2FZFESR.js} +8 -8
  95. package/dist/lib/chunks/{chunk-DC6PN7QJ.js → chunk-K4Y5NT4M.js} +11 -7
  96. package/dist/lib/chunks/chunk-K7YFL5KB.js +182 -0
  97. package/dist/lib/chunks/{chunk-ZYSPTOKK.js → chunk-KQCRJIEG.js} +1 -1
  98. package/dist/lib/chunks/{chunk-LPND3VNQ.js → chunk-KSOHZKV5.js} +43 -35
  99. package/dist/lib/chunks/{chunk-FBFZBLTY.js → chunk-LR27H2HZ.js} +15 -16
  100. package/dist/lib/chunks/{chunk-KZR25REO.js → chunk-LTI2YYU3.js} +1 -1
  101. package/dist/lib/chunks/{chunk-EPQHVILQ.js → chunk-MA27TFEY.js} +5 -3
  102. package/dist/lib/chunks/{chunk-J46W3EMQ.js → chunk-MENTBQGB.js} +8 -7
  103. package/dist/lib/chunks/chunk-MPJCZN4G.js +155 -0
  104. package/dist/lib/chunks/{chunk-56VOFZ7T.js → chunk-MTDYBJXH.js} +92 -26
  105. package/dist/lib/chunks/{chunk-PCYNBDZ7.js → chunk-OD36HUXA.js} +17 -12
  106. package/dist/lib/chunks/{chunk-WDSCJEDG.js → chunk-OQFAMKLN.js} +11 -11
  107. package/dist/lib/chunks/{chunk-Z4LMDKBU.js → chunk-PWOYEIPF.js} +4 -4
  108. package/dist/lib/chunks/{chunk-XL4JIQ5X.js → chunk-PXB4PWJI.js} +7 -3
  109. package/dist/lib/chunks/{chunk-7ZOJE6BH.js → chunk-QGZ4QSUE.js} +8 -7
  110. package/dist/lib/chunks/chunk-QJZTDZMB.js +321 -0
  111. package/dist/lib/chunks/{chunk-MHAKYFDF.js → chunk-R2AJYV6A.js} +22 -22
  112. package/dist/lib/chunks/{chunk-5B3RNVZ6.js → chunk-RK57YZKM.js} +1 -1
  113. package/dist/lib/chunks/{chunk-ZXGATMMH.js → chunk-RPTADJXD.js} +1 -1
  114. package/dist/lib/chunks/{chunk-2NJEWPCV.js → chunk-RXSHKWZJ.js} +3 -3
  115. package/dist/lib/chunks/chunk-RYCRL3YA.js +106 -0
  116. package/dist/lib/chunks/{chunk-E3OEE5XN.js → chunk-SD7LR26G.js} +3 -3
  117. package/dist/lib/chunks/{chunk-GVC4LH2N.js → chunk-SIJOQRRK.js} +1 -1
  118. package/dist/lib/chunks/{chunk-ZBDUE3A5.js → chunk-SLAPBFRH.js} +12 -7
  119. package/dist/lib/chunks/{chunk-CKUTDJAB.js → chunk-SMPP7B7F.js} +45 -10
  120. package/dist/lib/chunks/{chunk-POUSX3T4.js → chunk-SQQ56UP2.js} +15 -6
  121. package/dist/lib/chunks/{chunk-I3TMFPK4.js → chunk-T5XQ6NXD.js} +6 -4
  122. package/dist/lib/chunks/{chunk-EYKINDNK.js → chunk-TAPVCSCR.js} +1 -1
  123. package/dist/lib/chunks/{chunk-ISN6MBNB.js → chunk-U5USH2HB.js} +7 -7
  124. package/dist/lib/chunks/chunk-U64NCRRR.js +97 -0
  125. package/dist/lib/chunks/{chunk-D2LPQO6Y.js → chunk-U6BW6LGX.js} +10 -3
  126. package/dist/lib/chunks/chunk-U772TN32.js +67 -0
  127. package/dist/lib/chunks/{chunk-XHWRSGX3.js → chunk-UYDQXXDQ.js} +4 -4
  128. package/dist/lib/chunks/{chunk-CPT2GKKW.js → chunk-V5JJEEBT.js} +1 -1
  129. package/dist/lib/chunks/{chunk-YWJPJI3W.js → chunk-VL253W5C.js} +3 -1
  130. package/dist/lib/chunks/{chunk-I7VNIW6Q.js → chunk-VPXYGN4I.js} +86 -15
  131. package/dist/lib/chunks/{chunk-Z7V63UZA.js → chunk-VXDMOB7O.js} +4 -4
  132. package/dist/lib/chunks/chunk-W5X7WJYL.js +91 -0
  133. package/dist/lib/chunks/{chunk-6AUEDSTU.js → chunk-WCLKIPJV.js} +1 -1
  134. package/dist/lib/chunks/{chunk-QFVRCSJ2.js → chunk-WDOA5JEH.js} +2 -0
  135. package/dist/lib/chunks/chunk-WDT2Y7D7.js +117 -0
  136. package/dist/lib/chunks/{chunk-OVUCZLH2.js → chunk-WIBMVNIH.js} +2 -2
  137. package/dist/lib/chunks/{chunk-5T3V6XJS.js → chunk-WNIXDMJL.js} +1 -1
  138. package/dist/lib/chunks/{chunk-OORO55OM.js → chunk-WZGI7UVM.js} +23 -8
  139. package/dist/lib/chunks/{chunk-2GY42RIJ.js → chunk-XAKME6NM.js} +1 -1
  140. package/dist/lib/chunks/{chunk-Q2PWES4B.js → chunk-XAN4CRFP.js} +33 -41
  141. package/dist/lib/chunks/{chunk-MIF5IYNR.js → chunk-XDG6NPJB.js} +26 -29
  142. package/dist/lib/chunks/{chunk-IPNK7FYT.js → chunk-XFUYEFQP.js} +1 -1
  143. package/dist/lib/chunks/{chunk-OQVIRYT5.js → chunk-XNTFOVCE.js} +2 -2
  144. package/dist/lib/chunks/chunk-Y2CZ6FZY.js +61 -0
  145. package/dist/lib/chunks/{chunk-D7GEQVLL.js → chunk-YKJHFD64.js} +1 -1
  146. package/dist/lib/chunks/chunk-YZEZRQIG.js +194 -0
  147. package/dist/lib/chunks/chunk-ZIGNJAPC.js +11 -0
  148. package/dist/lib/chunks/{chunk-5ZITQDVE.js → chunk-ZQ3ER7JD.js} +12 -13
  149. package/dist/lib/cli/bundle-commands.js +102 -94
  150. package/dist/lib/cli/guide-command.js +25 -0
  151. package/dist/lib/cli/io.js +1 -1
  152. package/dist/lib/cli/run-commands.js +310 -140
  153. package/dist/lib/cli/status-command.js +236 -0
  154. package/dist/lib/codex-workflow/aggregate.js +22 -24
  155. package/dist/lib/codex-workflow/author-search.js +4 -3
  156. package/dist/lib/codex-workflow/author-tools.js +18 -17
  157. package/dist/lib/codex-workflow/author.js +39 -36
  158. package/dist/lib/codex-workflow/capture.js +26 -25
  159. package/dist/lib/codex-workflow/checkpoint.js +14 -15
  160. package/dist/lib/codex-workflow/checks.js +16 -18
  161. package/dist/lib/codex-workflow/codex-binary.js +13 -0
  162. package/dist/lib/codex-workflow/codex-home.js +6 -3
  163. package/dist/lib/codex-workflow/copy-editor.js +33 -32
  164. package/dist/lib/codex-workflow/copy-recovery.js +12 -13
  165. package/dist/lib/codex-workflow/copy.js +30 -29
  166. package/dist/lib/codex-workflow/finish.js +37 -38
  167. package/dist/lib/codex-workflow/host-models.js +7 -7
  168. package/dist/lib/codex-workflow/loop.js +71 -65
  169. package/dist/lib/codex-workflow/quality.js +12 -13
  170. package/dist/lib/codex-workflow/run-inputs.js +13 -14
  171. package/dist/lib/codex-workflow/run-source.js +28 -24
  172. package/dist/lib/codex-workflow/schemas.js +12 -13
  173. package/dist/lib/codex-workflow/session.js +15 -16
  174. package/dist/lib/codex-workflow/stage.js +51 -45
  175. package/dist/lib/codex-workflow/workdir.js +14 -15
  176. package/dist/lib/engine/audit-file.js +18 -13
  177. package/dist/lib/engine/author.js +62 -53
  178. package/dist/lib/engine/budget.js +7 -1
  179. package/dist/lib/engine/cost-estimate.js +43 -0
  180. package/dist/lib/engine/local-run.js +79 -71
  181. package/dist/lib/engine/preflight.js +17 -13
  182. package/dist/lib/engine/rejudge.js +87 -79
  183. package/dist/lib/engine/resources.js +1 -1
  184. package/dist/lib/engine/run-configuration.js +2 -1
  185. package/dist/lib/engine/run-status.js +153 -0
  186. package/dist/lib/engine/templates.js +19 -14
  187. package/dist/lib/grounding/chromium-guard.js +13 -0
  188. package/dist/lib/grounding/controller.js +13 -12
  189. package/dist/lib/grounding/extract.js +12 -11
  190. package/dist/lib/grounding/fetch.js +4 -7
  191. package/dist/lib/grounding/file-store.js +5 -5
  192. package/dist/lib/grounding/grounding-runtime.js +34 -32
  193. package/dist/lib/grounding/guarded-request.js +18 -0
  194. package/dist/lib/grounding/model.js +11 -10
  195. package/dist/lib/grounding/profile.js +4 -4
  196. package/dist/lib/grounding/recorded-tools.js +18 -17
  197. package/dist/lib/grounding/session.js +3 -3
  198. package/dist/lib/grounding/tools.js +4 -3
  199. package/dist/lib/grounding/validation.js +2 -2
  200. package/dist/lib/harness/report/artifacts.js +12 -13
  201. package/dist/lib/harness/report/capture-coverage.js +4 -4
  202. package/dist/lib/lib/checkpoint.js +11 -12
  203. package/dist/lib/lib/progress-comparison.js +2 -2
  204. package/dist/lib/models/batching.js +5 -5
  205. package/dist/lib/models/cost-coefficients.js +20 -0
  206. package/dist/lib/models/local-profile.js +10 -0
  207. package/dist/lib/models/pricing.js +6 -0
  208. package/dist/lib/models/profiles.js +7 -14
  209. package/dist/lib/models/structured-images.js +1 -1
  210. package/dist/lib/models/structured.js +4 -4
  211. package/dist/lib/models/supported-models.js +20 -0
  212. package/dist/lib/pipeline.js +21 -21
  213. package/dist/lib/probes/agent-cli-parsers.js +1 -1
  214. package/dist/lib/probes/agent-clis.js +13 -12
  215. package/dist/lib/probes/charged-trace.js +10 -0
  216. package/dist/lib/probes/probes.js +12 -12
  217. package/dist/lib/probes/web-tool-guard.js +3 -3
  218. package/dist/lib/report/contracts.js +4 -4
  219. package/dist/lib/report/core/progress-comparison.js +2 -2
  220. package/dist/lib/report/core/progress-schema.js +2 -2
  221. package/dist/lib/report/core/schema.js +2 -4
  222. package/dist/lib/report/core/surfaces.js +1 -3
  223. package/dist/lib/runner.js +25 -26
  224. package/dist/lib/schema.js +20 -15
  225. package/dist/lib/section-result.js +15 -17
  226. package/dist/lib/stores/artifacts.js +18 -19
  227. package/dist/lib/stores/files.js +32 -32
  228. package/dist/lib/stores/local-versions.js +11 -12
  229. package/dist/lib/stores/memory.js +34 -35
  230. package/dist/lib/stores/publication.js +23 -23
  231. package/dist/lib/surfaces.js +1 -3
  232. package/dist/lib/viewer/server.js +38 -39
  233. package/dist/lib/workflow/schema.js +9 -10
  234. package/dist/types/agents/author-schema.d.ts +3 -3
  235. package/dist/types/agents/copy-validation.d.ts +4 -4
  236. package/dist/types/agents/verifier.d.ts +6 -6
  237. package/dist/types/analysis/scoring.d.ts +2 -2
  238. package/dist/types/bundle/contracts.d.ts +3 -2
  239. package/dist/types/bundle/isolation.d.ts +37 -0
  240. package/dist/types/bundle/project-journal.d.ts +2 -0
  241. package/dist/types/bundle/recorder.d.ts +4 -0
  242. package/dist/types/bundle/writer-lock.d.ts +9 -0
  243. package/dist/types/checks/crawler-access.d.ts +3 -2
  244. package/dist/types/checks/renderability.d.ts +8 -1
  245. package/dist/types/cli/guide-command.d.ts +4 -0
  246. package/dist/types/cli/status-command.d.ts +2 -0
  247. package/dist/types/codex-workflow/author-tools.d.ts +3 -3
  248. package/dist/types/codex-workflow/codex-binary.d.ts +26 -0
  249. package/dist/types/codex-workflow/codex-home.d.ts +24 -20
  250. package/dist/types/codex-workflow/copy-editor.d.ts +1 -1
  251. package/dist/types/codex-workflow/copy.d.ts +3 -4
  252. package/dist/types/codex-workflow/finish.d.ts +5 -3
  253. package/dist/types/codex-workflow/host-models.d.ts +7 -3
  254. package/dist/types/codex-workflow/loop.d.ts +10 -1
  255. package/dist/types/codex-workflow/run-inputs.d.ts +31 -113
  256. package/dist/types/codex-workflow/schemas.d.ts +6 -6
  257. package/dist/types/codex-workflow/stage.d.ts +16 -5
  258. package/dist/types/engine/audit-file.d.ts +9 -3
  259. package/dist/types/engine/author.d.ts +7 -1
  260. package/dist/types/engine/budget.d.ts +46 -15
  261. package/dist/types/engine/cost-estimate.d.ts +40 -0
  262. package/dist/types/engine/local-run.d.ts +6 -0
  263. package/dist/types/engine/preflight.d.ts +7 -0
  264. package/dist/types/engine/resources.d.ts +2 -0
  265. package/dist/types/engine/run-configuration.d.ts +4 -3
  266. package/dist/types/engine/run-status.d.ts +75 -0
  267. package/dist/types/engine/templates.d.ts +1 -2
  268. package/dist/types/grounding/chromium-guard.d.ts +41 -0
  269. package/dist/types/grounding/fetch.d.ts +0 -10
  270. package/dist/types/grounding/guarded-request.d.ts +76 -0
  271. package/dist/types/harness/report/artifacts.d.ts +1 -0
  272. package/dist/types/lib/checkpoint.d.ts +5 -6
  273. package/dist/types/models/cost-coefficients.d.ts +106 -0
  274. package/dist/types/models/local-profile.d.ts +12 -0
  275. package/dist/types/models/pricing.d.ts +8 -0
  276. package/dist/types/models/profiles.d.ts +55 -160
  277. package/dist/types/models/served-model.d.ts +2 -3
  278. package/dist/types/models/structured.d.ts +3 -3
  279. package/dist/types/models/supported-models.d.ts +48 -0
  280. package/dist/types/pipeline.d.ts +2 -1
  281. package/dist/types/probes/charged-trace.d.ts +8 -0
  282. package/dist/types/probes/probe-trace.d.ts +2 -0
  283. package/dist/types/probes/probes.d.ts +2 -1
  284. package/dist/types/report/contracts.d.ts +2 -0
  285. package/dist/types/report/core/schema.d.ts +3 -1
  286. package/dist/types/report/core/surfaces.d.ts +0 -1
  287. package/dist/types/schema.d.ts +50 -113
  288. package/dist/types/section-result.d.ts +1 -1
  289. package/dist/types/workflow/schema.d.ts +79 -152
  290. package/package.json +2 -1
  291. package/resources/guide/OPERATOR.md +189 -0
  292. package/src/agents/author-schema.ts +13 -1
  293. package/src/agents/author-validation.ts +2 -5
  294. package/src/agents/copy-validation.ts +8 -12
  295. package/src/agents/facts.ts +8 -8
  296. package/src/agents/narrative-facts.ts +9 -20
  297. package/src/agents/verifier.ts +12 -16
  298. package/src/analysis/progress.ts +1 -0
  299. package/src/analysis/scoring.ts +9 -13
  300. package/src/bundle/contracts.ts +9 -4
  301. package/src/bundle/isolation.ts +157 -0
  302. package/src/bundle/project-journal.ts +4 -0
  303. package/src/bundle/project.ts +20 -7
  304. package/src/bundle/recorder.ts +5 -0
  305. package/src/bundle/verify.ts +3 -3
  306. package/src/bundle/writer-lock.ts +27 -0
  307. package/src/capture-manifest.ts +4 -0
  308. package/src/checks/crawler-access.ts +70 -50
  309. package/src/checks/renderability.ts +113 -87
  310. package/src/checks/run-checks.ts +16 -3
  311. package/src/cli/guide-command.ts +28 -0
  312. package/src/cli/io.ts +2 -0
  313. package/src/cli/literally-aeo.ts +39 -19
  314. package/src/cli/run-commands.ts +238 -18
  315. package/src/cli/status-command.ts +113 -0
  316. package/src/codex-workflow/aggregate.ts +1 -0
  317. package/src/codex-workflow/author-tools.ts +39 -60
  318. package/src/codex-workflow/capture.ts +1 -0
  319. package/src/codex-workflow/codex-binary.ts +105 -0
  320. package/src/codex-workflow/codex-home.ts +50 -40
  321. package/src/codex-workflow/copy-editor.ts +3 -3
  322. package/src/codex-workflow/copy.ts +7 -10
  323. package/src/codex-workflow/finish.ts +13 -8
  324. package/src/codex-workflow/host-models.ts +33 -24
  325. package/src/codex-workflow/loop.ts +38 -11
  326. package/src/codex-workflow/stage.ts +126 -17
  327. package/src/engine/audit-file.ts +98 -9
  328. package/src/engine/author.ts +47 -2
  329. package/src/engine/budget.ts +138 -43
  330. package/src/engine/cost-estimate.ts +178 -0
  331. package/src/engine/guide/OPERATOR.md +189 -0
  332. package/src/engine/local-run.ts +38 -8
  333. package/src/engine/preflight.ts +140 -7
  334. package/src/engine/resources.ts +9 -4
  335. package/src/engine/run-configuration.ts +19 -1
  336. package/src/engine/run-status.ts +452 -0
  337. package/src/engine/templates.ts +5 -2
  338. package/src/grounding/chromium-guard.ts +273 -0
  339. package/src/grounding/controller.ts +1 -1
  340. package/src/grounding/fetch.ts +39 -276
  341. package/src/grounding/guarded-request.ts +428 -0
  342. package/src/grounding/tools.ts +2 -1
  343. package/src/grounding/validation.ts +1 -1
  344. package/src/lib/checkpoint.ts +15 -16
  345. package/src/models/cost-coefficients.ts +140 -0
  346. package/src/models/local-profile.ts +150 -0
  347. package/src/models/pricing.ts +31 -0
  348. package/src/models/profiles.ts +58 -419
  349. package/src/models/served-model.ts +2 -3
  350. package/src/models/structured-images.ts +5 -4
  351. package/src/models/structured.ts +20 -7
  352. package/src/models/supported-models.ts +112 -0
  353. package/src/pipeline.ts +13 -7
  354. package/src/probes/agent-clis.ts +26 -5
  355. package/src/probes/charged-trace.ts +87 -0
  356. package/src/probes/probe-trace.ts +2 -0
  357. package/src/probes/probes.ts +72 -12
  358. package/src/report/core/schema.ts +4 -1
  359. package/src/report/core/surfaces.ts +4 -8
  360. package/src/runner.ts +1 -0
  361. package/src/schema.ts +68 -4
  362. package/src/section-result.ts +6 -5
  363. package/dist/lib/chunks/chunk-6EH4N3EU.js +0 -113
  364. package/dist/lib/chunks/chunk-CFFPOTP4.js +0 -356
  365. package/dist/lib/chunks/chunk-LIZX4N3H.js +0 -110
  366. package/dist/lib/chunks/chunk-OYKV5NDM.js +0 -28
  367. package/dist/lib/chunks/chunk-SWJ7KQSL.js +0 -318
  368. package/dist/lib/chunks/chunk-WE2WPNG2.js +0 -104
  369. package/dist/lib/chunks/{chunk-XI5H46DF.js → chunk-SASE7U6E.js} +3 -3
@@ -0,0 +1,91 @@
1
+ import {
2
+ codexStageModelSchema,
3
+ internalModelRoleSchema,
4
+ modelPricingSchema
5
+ } from "./chunk-RYCRL3YA.js";
6
+
7
+ // src/models/supported-models.ts
8
+ import { z } from "zod";
9
+ var supportedModelSchema = z.object({
10
+ /** The gateway model ID, as audit.json's `model` names it. */
11
+ id: z.string().min(1),
12
+ label: z.string().min(1),
13
+ pricingUsdPerMillion: modelPricingSchema,
14
+ pricingCheckedAt: z.iso.date(),
15
+ contextWindow: z.number().int().positive(),
16
+ maxOutputTokens: z.number().int().positive(),
17
+ /** The model's hidden reasoning is billed inside the output allowance,
18
+ * so every role is given room to think on top of its answer. */
19
+ thinkingInOutput: z.boolean(),
20
+ providerOptions: internalModelRoleSchema.shape.providerOptions,
21
+ stageReasoningEffort: codexStageModelSchema.shape.reasoningEffort,
22
+ /** The date a real batch ran through the gateway on Codex's Responses
23
+ * wire API with this model (the spike, spec §4.3); null until then. */
24
+ stageRuntimeVerifiedAt: z.iso.date().nullable()
25
+ }).strict();
26
+ var supportedModels = [
27
+ {
28
+ id: "anthropic/claude-opus-5.5",
29
+ label: "Claude Opus 5.5",
30
+ pricingUsdPerMillion: { input: 4, output: 20, cachedInput: 0.2 },
31
+ pricingCheckedAt: "2026-11-04",
32
+ contextWindow: 1e6,
33
+ maxOutputTokens: 128e3,
34
+ thinkingInOutput: true,
35
+ providerOptions: { gateway: { reasoning: { effort: "high" } } },
36
+ stageReasoningEffort: "high",
37
+ stageRuntimeVerifiedAt: "2026-11-04"
38
+ },
39
+ {
40
+ id: "anthropic/claude-sonnet-5.5",
41
+ label: "Claude Sonnet 5.5",
42
+ pricingUsdPerMillion: { input: 2, output: 10, cachedInput: 0.2 },
43
+ pricingCheckedAt: "2026-11-04",
44
+ contextWindow: 1e6,
45
+ maxOutputTokens: 128e3,
46
+ thinkingInOutput: true,
47
+ providerOptions: { gateway: { reasoning: { effort: "high" } } },
48
+ stageReasoningEffort: "high",
49
+ stageRuntimeVerifiedAt: "2026-11-04"
50
+ }
51
+ ];
52
+ var recommendedModelId = "anthropic/claude-opus-5.5";
53
+ var describeSupportedModels = () => {
54
+ const lines = supportedModels.map((model) => {
55
+ const { input, cachedInput, output } = model.pricingUsdPerMillion;
56
+ const recommended = model.id === recommendedModelId ? " (recommended)" : "";
57
+ return `${model.id}${recommended}: ${model.label}, $${input} in / $${cachedInput} cached / $${output} out per million tokens (checked ${model.pricingCheckedAt})`;
58
+ });
59
+ return lines;
60
+ };
61
+ var findSupportedModel = (id) => {
62
+ return supportedModels.find((model) => model.id === id);
63
+ };
64
+ var UnsupportedModelError = class extends Error {
65
+ constructor(id) {
66
+ super(
67
+ [
68
+ `${id} is not a supported model. Set audit.json's "model" to one of:`,
69
+ ...describeSupportedModels().map((line) => ` ${line}`)
70
+ ].join("\n")
71
+ );
72
+ this.name = "UnsupportedModelError";
73
+ }
74
+ };
75
+ var resolveSupportedModel = (id = recommendedModelId) => {
76
+ const model = findSupportedModel(id);
77
+ if (!model) {
78
+ throw new UnsupportedModelError(id);
79
+ }
80
+ return model;
81
+ };
82
+
83
+ export {
84
+ supportedModelSchema,
85
+ supportedModels,
86
+ recommendedModelId,
87
+ describeSupportedModels,
88
+ findSupportedModel,
89
+ UnsupportedModelError,
90
+ resolveSupportedModel
91
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  structuredCallReservation
3
- } from "./chunk-PCYNBDZ7.js";
3
+ } from "./chunk-OD36HUXA.js";
4
4
 
5
5
  // src/models/batching.ts
6
6
  var batchModelInputs = (args) => {
@@ -1,6 +1,8 @@
1
1
  // src/models/structured-images.ts
2
2
  var imageTokenReserve = {
3
3
  "anthropic/claude-opus-4.6": 2048,
4
+ "anthropic/claude-opus-5.5": 2048,
5
+ "anthropic/claude-sonnet-5.5": 2048,
4
6
  "moonshotai/kimi-k3": 2048
5
7
  };
6
8
  var supportsImageInput = (model) => {
@@ -0,0 +1,117 @@
1
+ import {
2
+ tokenCostUsd
3
+ } from "./chunk-ZIGNJAPC.js";
4
+ import {
5
+ authorToolCaps
6
+ } from "./chunk-XAN4CRFP.js";
7
+ import {
8
+ authorSearchLowUsd,
9
+ authorTokens,
10
+ costCoefficientsVersion,
11
+ hostTokensPerAnswer,
12
+ probeUsd,
13
+ searchUsdPerAnswer,
14
+ stageTokens
15
+ } from "./chunk-DVFFYY5G.js";
16
+
17
+ // src/engine/cost-estimate.ts
18
+ var cents = (usd) => {
19
+ return Math.round(usd * 100) / 100;
20
+ };
21
+ var rangeOf = (low, high) => {
22
+ return { low: cents(low), high: cents(high) };
23
+ };
24
+ var recommendedCapOf = (high) => {
25
+ return Math.max(1, Math.ceil(high));
26
+ };
27
+ var tokensCost = (model, tokens, cachedShare) => {
28
+ return tokenCostUsd(model.pricingUsdPerMillion, {
29
+ inputTokens: tokens.input,
30
+ cachedInputTokens: Math.round(tokens.input * cachedShare),
31
+ outputTokens: tokens.output
32
+ });
33
+ };
34
+ var scaled = (tokens, factor) => {
35
+ return { input: tokens.input * factor, output: tokens.output * factor };
36
+ };
37
+ var sumOf = (ranges) => {
38
+ return rangeOf(
39
+ ranges.reduce((total, range) => total + range.low, 0),
40
+ ranges.reduce((total, range) => total + range.high, 0)
41
+ );
42
+ };
43
+ var estimateRunCost = ({
44
+ plan,
45
+ model,
46
+ grounding
47
+ }) => {
48
+ const answers = plan.units.length;
49
+ const { cachedShare } = stageTokens;
50
+ const probes = sumOf(
51
+ [...plan.probesBySurface].map(
52
+ ([surface, count]) => rangeOf(probeUsd[surface].low * count, probeUsd[surface].high * count)
53
+ )
54
+ );
55
+ const stages = rangeOf(
56
+ tokensCost(
57
+ model,
58
+ scaled(stageTokens.perAnswer.low, answers),
59
+ cachedShare.high
60
+ ) + tokensCost(model, stageTokens.perRun.low, cachedShare.high),
61
+ tokensCost(
62
+ model,
63
+ scaled(stageTokens.perAnswer.high, answers),
64
+ cachedShare.low
65
+ ) + tokensCost(model, stageTokens.perRun.high, cachedShare.low)
66
+ );
67
+ const hostTokens = hostTokensPerAnswer[grounding];
68
+ const hostCalls = rangeOf(
69
+ tokensCost(model, scaled(hostTokens.low, answers), 0),
70
+ tokensCost(model, scaled(hostTokens.high, answers), 0)
71
+ );
72
+ const search = grounding === "full" ? rangeOf(
73
+ searchUsdPerAnswer.low * answers,
74
+ searchUsdPerAnswer.high * answers
75
+ ) : rangeOf(0, 0);
76
+ const total = sumOf([probes, stages, hostCalls, search]);
77
+ const estimate = {
78
+ currency: "USD",
79
+ kind: "estimate",
80
+ model: model.id,
81
+ coefficientsVersion: costCoefficientsVersion,
82
+ low: total.low,
83
+ high: total.high,
84
+ categories: { probes, stages, hostCalls, search },
85
+ recommendedCapUsd: recommendedCapOf(total.high)
86
+ };
87
+ return estimate;
88
+ };
89
+ var estimateAuthorCost = (model) => {
90
+ const { cachedShare } = stageTokens;
91
+ const stages = rangeOf(
92
+ tokensCost(model, authorTokens.session.low, cachedShare.high),
93
+ tokensCost(model, authorTokens.session.high, cachedShare.low)
94
+ );
95
+ const search = rangeOf(authorSearchLowUsd, authorToolCaps.searchSpendUsd);
96
+ const total = sumOf([stages, search]);
97
+ const estimate = {
98
+ currency: "USD",
99
+ kind: "estimate",
100
+ model: model.id,
101
+ coefficientsVersion: costCoefficientsVersion,
102
+ low: total.low,
103
+ high: total.high,
104
+ categories: { stages, search },
105
+ recommendedCapUsd: recommendedCapOf(total.high)
106
+ };
107
+ return estimate;
108
+ };
109
+ var describeCostRange = (range) => {
110
+ return `$${range.low.toFixed(2)} to $${range.high.toFixed(2)}`;
111
+ };
112
+
113
+ export {
114
+ estimateRunCost,
115
+ estimateAuthorCost,
116
+ describeCostRange
117
+ };
@@ -2,10 +2,10 @@ import {
2
2
  aeoSnapshotSchema,
3
3
  brandSchema,
4
4
  sourceCategorySchema
5
- } from "./chunk-SDWYZM64.js";
5
+ } from "./chunk-EDQTINTL.js";
6
6
  import {
7
7
  progressMeasurementSchema
8
- } from "./chunk-D7GEQVLL.js";
8
+ } from "./chunk-YKJHFD64.js";
9
9
  import {
10
10
  aeoReportCopySchema
11
11
  } from "./chunk-PKB6JRJM.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  researchProfile
3
- } from "./chunk-Y4OGZ3Q5.js";
3
+ } from "./chunk-46PVVQYR.js";
4
4
 
5
5
  // src/grounding/profile.ts
6
6
  var reservation = (role) => {
@@ -21,6 +21,10 @@ import {
21
21
  childEnv,
22
22
  runChild
23
23
  } from "./chunk-7QYZSP7Q.js";
24
+ import {
25
+ codexArgs,
26
+ resolveCodexBinary
27
+ } from "./chunk-U772TN32.js";
24
28
  import {
25
29
  ProbeFailure,
26
30
  agentProbeRetryPolicy,
@@ -32,6 +36,10 @@ import {
32
36
  import {
33
37
  createLog
34
38
  } from "./chunk-ZSEY7AHQ.js";
39
+ import {
40
+ getEnvironment,
41
+ readEnv
42
+ } from "./chunk-PO2J5OQ3.js";
35
43
  import {
36
44
  isRecord
37
45
  } from "./chunk-7PLK6VGC.js";
@@ -39,17 +47,13 @@ import {
39
47
  sleep,
40
48
  unlimited
41
49
  } from "./chunk-W5XYW6ZM.js";
42
- import {
43
- getEnvironment,
44
- readEnv
45
- } from "./chunk-PO2J5OQ3.js";
46
50
  import {
47
51
  retrievalLogSchema
48
- } from "./chunk-SDWYZM64.js";
52
+ } from "./chunk-EDQTINTL.js";
49
53
  import {
50
54
  agentSurfaces,
51
55
  surfaceRunCounts
52
- } from "./chunk-OBXAHX3L.js";
56
+ } from "./chunk-AASWJR7Q.js";
53
57
 
54
58
  // src/probes/agent-clis.ts
55
59
  import { execFile } from "node:child_process";
@@ -197,6 +201,13 @@ var probeForSurface = (surface) => {
197
201
  return runCursorProbe;
198
202
  }
199
203
  };
204
+ var localCommand = (command, args) => {
205
+ if (command !== "codex") {
206
+ return { command, args: [...args] };
207
+ }
208
+ const binary = resolveCodexBinary();
209
+ return { command: binary.command, args: codexArgs(binary, args) };
210
+ };
200
211
  var cliVersion = async (command, args) => {
201
212
  try {
202
213
  const transport = workerTransport();
@@ -209,7 +220,10 @@ var cliVersion = async (command, args) => {
209
220
  if (readEnv("AEO_ISOLATED_ADAPTER") === "1") {
210
221
  requireWorkerTransport();
211
222
  }
212
- const { stdout } = await execFileAsync(command, args, { timeout: 15e3 });
223
+ const local = localCommand(command, args);
224
+ const { stdout } = await execFileAsync(local.command, local.args, {
225
+ timeout: 15e3
226
+ });
213
227
  return stdout.trim().split("\n")[0] ?? null;
214
228
  } catch {
215
229
  return null;
@@ -742,7 +756,8 @@ var claudeEnvKeys = [
742
756
  var codexEnvKeys = ["OPENAI_API_KEY", "CODEX_HOME"];
743
757
  var cursorEnvKeys = ["CURSOR_API_KEY"];
744
758
  var execCli = async (command, { cliArgs, cwd, runtime, env, signal }) => {
745
- const result = await runChild(command, cliArgs, {
759
+ const local = localCommand(command, cliArgs);
760
+ const result = await runChild(local.command, local.args, {
746
761
  cwd,
747
762
  env,
748
763
  timeoutMs: runtime.timeoutMs ?? agentProbeTimeoutMs,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  recorded
3
- } from "./chunk-XL4JIQ5X.js";
3
+ } from "./chunk-PXB4PWJI.js";
4
4
 
5
5
  // src/grounding/recorded-tools.ts
6
6
  var recordedGroundingTools = (tools, recorder) => {
@@ -1,17 +1,24 @@
1
+ import {
2
+ withBoundedPage,
3
+ withGuardedChromium
4
+ } from "./chunk-K7YFL5KB.js";
1
5
  import {
2
6
  writeFileAtomically
3
7
  } from "./chunk-MX6Y4RD2.js";
4
8
  import {
5
9
  stageSchemas
6
- } from "./chunk-GVC4LH2N.js";
10
+ } from "./chunk-SIJOQRRK.js";
7
11
  import {
8
- SourceRetrievalError,
9
12
  boundedUtf8,
10
13
  canonicalResearchUrl,
11
14
  extractSourceDocument,
12
- fetchGroundingSource,
15
+ fetchGroundingSource
16
+ } from "./chunk-MPJCZN4G.js";
17
+ import {
18
+ SourceRetrievalError,
19
+ resolvePublicAddress,
13
20
  validateResearchUrl
14
- } from "./chunk-SWJ7KQSL.js";
21
+ } from "./chunk-ESEMYWUH.js";
15
22
  import {
16
23
  groundingSourceSchema
17
24
  } from "./chunk-6RAKXYSR.js";
@@ -673,43 +680,28 @@ var createAuthorTools = (options) => {
673
680
  };
674
681
  };
675
682
  var renderWithChromium = async (url, signal) => {
676
- const { lookup } = await import("node:dns/promises");
677
- const { isIP } = await import("node:net");
678
- const { isPublicAddress } = await import("../workflow/callbacks.js");
679
- const addresses = await lookup(url.hostname, { all: true });
680
- if (!addresses.length || addresses.some(({ address }) => !isPublicAddress(address))) {
681
- throw new SourceRetrievalError(
682
- "unsafe_destination",
683
- "Source DNS must resolve exclusively to public addresses"
684
- );
685
- }
686
- const { chromium } = await import("playwright");
687
- const browser = await chromium.launch();
688
- try {
689
- const page = await browser.newPage({
690
- userAgent: `${researchUserAgent}/1`
691
- });
692
- await page.route("**/*", (route) => {
693
- const target = new URL(route.request().url());
694
- const host = target.hostname.replace(/^\[|\]$/g, "");
695
- if (target.protocol !== "https:" || isIP(host) && !isPublicAddress(host) || host === "localhost" || host.endsWith(".local") || host.endsWith(".internal")) {
696
- return route.abort();
697
- }
698
- return route.continue();
699
- });
700
- const abort = () => {
701
- void page.close().catch(() => void 0);
702
- };
703
- signal.addEventListener("abort", abort, { once: true });
704
- try {
705
- await page.goto(url.href, { waitUntil: "networkidle", timeout: 45e3 });
706
- return await page.content();
707
- } finally {
708
- signal.removeEventListener("abort", abort);
709
- }
710
- } finally {
711
- await browser.close();
712
- }
683
+ await resolvePublicAddress(url.hostname, signal);
684
+ const { result } = await withGuardedChromium(
685
+ (context) => {
686
+ return withBoundedPage(context, 6e4, async (page) => {
687
+ const abort = () => {
688
+ void page.close().catch(() => void 0);
689
+ };
690
+ signal.addEventListener("abort", abort, { once: true });
691
+ try {
692
+ await page.goto(url.href, {
693
+ waitUntil: "networkidle",
694
+ timeout: 45e3
695
+ });
696
+ return await page.content();
697
+ } finally {
698
+ signal.removeEventListener("abort", abort);
699
+ }
700
+ });
701
+ },
702
+ { userAgent: `${researchUserAgent}/1` }
703
+ );
704
+ return result;
713
705
  };
714
706
  var readResearchJournal = async (dir, label) => {
715
707
  const raw = await readFile(
@@ -1,28 +1,31 @@
1
+ import {
2
+ codexBinaryVersion,
3
+ resolveCodexBinary
4
+ } from "./chunk-U772TN32.js";
1
5
  import {
2
6
  getEnvironment
3
7
  } from "./chunk-PO2J5OQ3.js";
4
8
 
5
9
  // src/codex-workflow/codex-home.ts
6
- import { execFile } from "node:child_process";
7
10
  import { mkdir, writeFile } from "node:fs/promises";
8
11
  import path from "node:path";
9
- import { promisify } from "node:util";
10
- var codexModel = {
12
+ var codexGateway = {
11
13
  provider: "vercel",
12
14
  providerName: "Vercel AI Gateway",
13
15
  baseUrl: "https://ai-gateway.vercel.sh/v1",
14
16
  /** The environment variable the gateway key is read from; the only
15
17
  * secret the child process sees. */
16
18
  apiKeyEnv: "AI_GATEWAY_API_KEY",
17
- wireApi: "responses",
18
- model: "deepseek/deepseek-v4.1-flash",
19
- reasoningEffort: "high",
20
- /** The model's context window as the gateway reports it (`/v1/models`,
21
- * 2026-09-13). Codex has no metadata for gateway models and otherwise
22
- * falls back to a default window, which decides when it compacts the
23
- * session history; a qualify or review batch that read ten answers and
24
- * their rows would be compacted for no reason. */
25
- contextWindow: 1e6
19
+ wireApi: "responses"
20
+ };
21
+ var codexStageConfig = (stageModel) => {
22
+ const config = {
23
+ ...codexGateway,
24
+ model: stageModel.model,
25
+ reasoningEffort: stageModel.reasoningEffort,
26
+ contextWindow: stageModel.contextWindow
27
+ };
28
+ return config;
26
29
  };
27
30
  var codexHomeDir = (workdir) => {
28
31
  return path.join(workdir, ".codex-home");
@@ -30,7 +33,8 @@ var codexHomeDir = (workdir) => {
30
33
  var tomlString = (value) => {
31
34
  return JSON.stringify(value);
32
35
  };
33
- var codexConfigToml = (workdir, research) => {
36
+ var codexConfigToml = (workdir, { stageModel, research }) => {
37
+ const codexModel = codexStageConfig(stageModel);
34
38
  const underTmp = workdir === "/tmp" || workdir.startsWith("/tmp/");
35
39
  return [
36
40
  `model = "${codexModel.model}"`,
@@ -88,11 +92,11 @@ var codexConfigToml = (workdir, research) => {
88
92
  ] : []
89
93
  ].join("\n");
90
94
  };
91
- var prepareCodexHome = async (workdir, env = getEnvironment(), research) => {
92
- const apiKey = env[codexModel.apiKeyEnv];
95
+ var prepareCodexHome = async (workdir, { stageModel, research, env = getEnvironment() }) => {
96
+ const apiKey = env[codexGateway.apiKeyEnv];
93
97
  if (!apiKey) {
94
98
  throw new Error(
95
- `${codexModel.apiKeyEnv} is not set; the Codex stages run on ${codexModel.model} through the gateway and need it.`
99
+ `${codexGateway.apiKeyEnv} is not set; the Codex stages run on ${stageModel.model} through the gateway and need it.`
96
100
  );
97
101
  }
98
102
  const home = codexHomeDir(workdir);
@@ -102,26 +106,18 @@ var prepareCodexHome = async (workdir, env = getEnvironment(), research) => {
102
106
  await writeFile(path.join(workdir, ".aeo-report-root"), "");
103
107
  await writeFile(
104
108
  path.join(home, "config.toml"),
105
- codexConfigToml(workdir, research)
109
+ codexConfigToml(workdir, { stageModel, research })
106
110
  );
107
111
  return {
108
112
  PATH: env.PATH ?? "",
109
113
  HOME: home,
110
114
  CODEX_HOME: home,
111
115
  TMPDIR: temporaryDirectory,
112
- [codexModel.apiKeyEnv]: apiKey
116
+ [codexGateway.apiKeyEnv]: apiKey
113
117
  };
114
118
  };
115
- var codexCliVersion = async (command = "codex") => {
116
- try {
117
- const { stdout } = await promisify(execFile)(command, ["--version"], {
118
- timeout: 15e3
119
- });
120
- const [firstLine] = stdout.trim().split("\n");
121
- return firstLine === void 0 || firstLine === "" ? null : firstLine;
122
- } catch {
123
- return null;
124
- }
119
+ var codexCliVersion = async (binary = resolveCodexBinary()) => {
120
+ return codexBinaryVersion(binary);
125
121
  };
126
122
  var workflowSecrets = (env) => {
127
123
  return [env.AEO_DATABASE_URL, env.AI_GATEWAY_API_KEY].filter(
@@ -130,7 +126,8 @@ var workflowSecrets = (env) => {
130
126
  };
131
127
 
132
128
  export {
133
- codexModel,
129
+ codexGateway,
130
+ codexStageConfig,
134
131
  codexHomeDir,
135
132
  codexConfigToml,
136
133
  prepareCodexHome,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-72P6NOKD.js";
4
4
  import {
5
5
  authorOutputSchema
6
- } from "./chunk-D2LPQO6Y.js";
6
+ } from "./chunk-U6BW6LGX.js";
7
7
 
8
8
  // src/author/examples.ts
9
9
  var syntheticExample = {
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-ZXQPD4OC.js";
4
4
  import {
5
5
  verifyBundle
6
- } from "./chunk-XNRSHATN.js";
6
+ } from "./chunk-HI3PD3KR.js";
7
7
  import {
8
8
  RunOrigin,
9
9
  toolVersion
10
- } from "./chunk-I3TMFPK4.js";
10
+ } from "./chunk-T5XQ6NXD.js";
11
11
  import {
12
12
  parseBundleJson
13
13
  } from "./chunk-E6NQQU6V.js";
@@ -0,0 +1,61 @@
1
+ import {
2
+ probeUsd
3
+ } from "./chunk-DVFFYY5G.js";
4
+ import {
5
+ ModelBudgetError
6
+ } from "./chunk-TNL2GWYR.js";
7
+
8
+ // src/probes/charged-trace.ts
9
+ import { randomUUID } from "node:crypto";
10
+ var chargedProbeTrace = (trace, ledger) => {
11
+ let refused;
12
+ const charged = {
13
+ start: async (attempt) => {
14
+ const estimateUsd = probeUsd[attempt.surface].high;
15
+ const callId = `probe:${attempt.surface}:${attempt.promptId}:${attempt.runIndex}:${attempt.attempt}:${randomUUID()}`;
16
+ const isPaid = estimateUsd > 0;
17
+ if (isPaid) {
18
+ try {
19
+ await ledger.reserve({
20
+ callId,
21
+ role: `probe:${attempt.surface}`,
22
+ ...attempt.requestedModel !== null && {
23
+ requestedModel: attempt.requestedModel
24
+ },
25
+ reservedUsd: estimateUsd,
26
+ inputTokens: 0,
27
+ maxOutputTokens: 0
28
+ });
29
+ } catch (error) {
30
+ if (error instanceof ModelBudgetError) {
31
+ refused ??= error;
32
+ }
33
+ throw error;
34
+ }
35
+ }
36
+ const handle = await trace.start(attempt);
37
+ return {
38
+ id: handle.id,
39
+ end: async (result) => {
40
+ await handle.end(result);
41
+ if (!isPaid) {
42
+ return;
43
+ }
44
+ const reportedUsd = result.outcome === "succeeded" ? result.costUsd : void 0;
45
+ await ledger.settle(callId, {
46
+ ...attempt.requestedModel !== null && {
47
+ requestedModel: attempt.requestedModel
48
+ },
49
+ ...reportedUsd !== void 0 && { costUsd: reportedUsd },
50
+ ...result.outcome !== "succeeded" && { valid: false }
51
+ });
52
+ }
53
+ };
54
+ }
55
+ };
56
+ return { trace: charged, exhausted: () => refused };
57
+ };
58
+
59
+ export {
60
+ chargedProbeTrace
61
+ };
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-SZ2UBZKG.js";
4
4
  import {
5
5
  allSurfaces
6
- } from "./chunk-OBXAHX3L.js";
6
+ } from "./chunk-AASWJR7Q.js";
7
7
 
8
8
  // src/report/core/progress-schema.ts
9
9
  import { z } from "zod";