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
@@ -1,7 +1,16 @@
1
1
  import { load } from 'cheerio';
2
- import type { Browser } from 'playwright';
3
- import type { AeoTechnicalChecks } from '../schema';
2
+ import type { BrowserContext } from 'playwright';
3
+ import {
4
+ withBoundedPage,
5
+ withGuardedChromium,
6
+ } from '../grounding/chromium-guard';
7
+ import {
8
+ describeSiteError,
9
+ type HostPacer,
10
+ type SiteRequest,
11
+ } from '../grounding/guarded-request';
4
12
  import { createLog } from '../lib/log';
13
+ import type { AeoTechnicalChecks } from '../schema';
5
14
 
6
15
  const log = createLog('Renderability');
7
16
 
@@ -9,16 +18,21 @@ const log = createLog('Renderability');
9
18
  // Renderability check (spec §7.4): for each money page, compare the text a
10
19
  // no-JS fetch yields against a Playwright-rendered version. Most AI retrieval
11
20
  // bots don't execute JS — pages whose substance only exists after JS are
12
- // invisible to them. Playwright is already a devDependency via the migration
13
- // tooling; it is imported lazily so `--dry-run` and probe-only runs never
14
- // need a browser installed.
21
+ // invisible to them. Playwright is imported lazily, so a run without money
22
+ // pages never needs a browser installed. Both fetches pass the guard: the
23
+ // static one through guardedRequest, the browser through the guarding
24
+ // proxy (withGuardedChromium).
15
25
  // ============================================================================
16
26
 
17
- const fetchTimeoutMs = 20_000;
18
- const renderTimeoutMs = 45_000;
27
+ const fetchTimeoutInMs = 20_000;
28
+ const renderTimeoutInMs = 45_000;
19
29
  // How long a loaded page gets to go network-idle before its text is read as
20
30
  // it stands.
21
- const settleTimeoutMs = 8_000;
31
+ const settleTimeoutInMs = 8_000;
32
+ // The whole render, reading the text included: past it the page is closed.
33
+ const renderDeadlineInMs = 60_000;
34
+ const staticMaxBytes = 10 * 1024 * 1024;
35
+ const pageRedirects = 5;
22
36
  // Flag when more than 40% of the rendered text is missing statically AND the
23
37
  // absolute gap is large enough to be substance, not a cookie banner.
24
38
  const missingRatioThreshold = 0.4;
@@ -28,95 +42,114 @@ type RenderabilityResult = NonNullable<
28
42
  AeoTechnicalChecks['renderability']
29
43
  >[number];
30
44
 
45
+ /** The phase's guarded request and the pacer behind it: a page's static
46
+ * fetch and its render are spaced like any other request to its host. */
47
+ export type PagedSite = { request: SiteRequest; pace: HostPacer };
48
+
31
49
  export const runRenderabilityCheck = async (
32
50
  moneyPages: readonly string[],
51
+ site: PagedSite,
33
52
  ): Promise<RenderabilityResult[]> => {
34
53
  if (moneyPages.length === 0) {
35
54
  return [];
36
55
  }
37
56
 
38
- const { chromium } = await import('playwright');
39
- const browser = await chromium.launch();
40
-
41
- try {
42
- const results: RenderabilityResult[] = [];
43
-
44
- // Sequential on purpose: one browser page, no hammering the client's site.
45
- for (const url of moneyPages) {
46
- const pageStartedAt = Date.now();
47
- const result = await checkPage(url, browser);
48
-
49
- results.push(result);
50
- log.debug('Renderability page checked', {
51
- url,
52
- durationMs: Date.now() - pageStartedAt,
53
- staticTextChars: result.staticTextChars,
54
- renderedTextChars: result.renderedTextChars,
55
- flagged: result.flagged,
56
- error: result.error,
57
- });
58
- }
57
+ const { result: results, connections } = await withGuardedChromium(
58
+ async (context) => {
59
+ const checked: RenderabilityResult[] = [];
60
+
61
+ // Sequential on purpose: one browser page, no hammering the client's site.
62
+ for (const url of moneyPages) {
63
+ const pageStartedAt = Date.now();
64
+ const result = await checkPage(url, context, site);
65
+
66
+ checked.push(result);
67
+ log.debug('Renderability page checked', {
68
+ url,
69
+ durationMs: Date.now() - pageStartedAt,
70
+ staticTextChars: result.staticTextChars,
71
+ renderedTextChars: result.renderedTextChars,
72
+ flagged: result.flagged,
73
+ error: result.error,
74
+ });
75
+ }
76
+
77
+ return checked;
78
+ },
79
+ );
80
+
81
+ log.info('Renderability check completed', {
82
+ pages: results.length,
83
+ flagged: results.filter((r) => r.flagged).length,
84
+ errors: results.filter((r) => r.error).length,
85
+ connections,
86
+ });
87
+
88
+ return results;
89
+ };
59
90
 
60
- log.info('Renderability check completed', {
61
- pages: results.length,
62
- flagged: results.filter((r) => r.flagged).length,
63
- errors: results.filter((r) => r.error).length,
64
- });
91
+ const failedPage = (url: string, error: string): RenderabilityResult => {
92
+ return {
93
+ url,
94
+ staticTextChars: 0,
95
+ renderedTextChars: 0,
96
+ missingRatio: 0,
97
+ flagged: false,
98
+ error,
99
+ };
100
+ };
65
101
 
66
- return results;
67
- } finally {
68
- await browser.close();
69
- }
102
+ const renderText = (url: string, context: BrowserContext): Promise<string> => {
103
+ return withBoundedPage(context, renderDeadlineInMs, async (page) => {
104
+ // Load, then give the page a bounded moment to settle. Waiting for a
105
+ // fully idle network is a trap on documentation sites, which keep a
106
+ // connection open (live reload, search index, analytics) long after
107
+ // the text is drawn: one never went idle in 45 s, and the report said
108
+ // "could not check" for exactly the pages that matter most. The text
109
+ // is there long before.
110
+ await page.goto(url, { waitUntil: 'load', timeout: renderTimeoutInMs });
111
+ await page
112
+ .waitForLoadState('networkidle', { timeout: settleTimeoutInMs })
113
+ // A page that never settles is read as it stands, as explained above.
114
+ .catch(() => undefined);
115
+
116
+ // A document can lack a body at runtime although the DOM types say
117
+ // otherwise; querySelector keeps that case typed.
118
+ const text = await page.evaluate(
119
+ () => document.querySelector('body')?.innerText ?? '',
120
+ );
121
+
122
+ return normalizeWhitespace(text);
123
+ });
70
124
  };
71
125
 
72
126
  const checkPage = async (
73
127
  url: string,
74
- browser: Browser,
128
+ context: BrowserContext,
129
+ site: PagedSite,
75
130
  ): Promise<RenderabilityResult> => {
76
131
  try {
77
- const response = await fetch(url, {
78
- signal: AbortSignal.timeout(fetchTimeoutMs),
79
- headers: { 'user-agent': 'literally-aeo-audit/1.0' },
132
+ const response = await site.request({
133
+ url,
134
+ timeoutInMs: fetchTimeoutInMs,
135
+ userAgent: 'literally-aeo-audit/1.0',
136
+ accept: 'text/html,application/xhtml+xml',
137
+ redirects: pageRedirects,
138
+ body: {
139
+ contentTypes: /^(text\/html|application\/xhtml\+xml|text\/plain)(;|$)/i,
140
+ maxBytes: staticMaxBytes,
141
+ oversize: 'refuse',
142
+ },
80
143
  });
81
144
 
82
- if (!response.ok) {
83
- return {
84
- url,
85
- staticTextChars: 0,
86
- renderedTextChars: 0,
87
- missingRatio: 0,
88
- flagged: false,
89
- error: `Static fetch failed: HTTP ${response.status}`,
90
- };
145
+ if (response.status < 200 || response.status >= 300) {
146
+ return failedPage(url, `Static fetch failed: HTTP ${response.status}`);
91
147
  }
92
148
 
93
- const staticText = extractText(await response.text());
94
-
95
- const page = await browser.newPage();
96
- let renderedText: string;
97
-
98
- try {
99
- // Load, then give the page a bounded moment to settle. Waiting for a
100
- // fully idle network is a trap on documentation sites, which keep a
101
- // connection open (live reload, search index, analytics) long after
102
- // the text is drawn: botpress.com/docs never went idle in 45 s and
103
- // the report said "could not check" for exactly the pages that
104
- // matter most (2026-09-15). The text is there long before.
105
- await page.goto(url, { waitUntil: 'load', timeout: renderTimeoutMs });
106
- await page
107
- .waitForLoadState('networkidle', { timeout: settleTimeoutMs })
108
- // A page that never settles is read as it stands, as explained above.
109
- .catch(() => undefined);
110
- // A document can lack a body at runtime although the DOM types say
111
- // otherwise; querySelector keeps that case typed.
112
- renderedText = normalizeWhitespace(
113
- await page.evaluate(
114
- () => document.querySelector('body')?.innerText ?? '',
115
- ),
116
- );
117
- } finally {
118
- await page.close();
119
- }
149
+ const staticText = extractText(response.body?.toString('utf8') ?? '');
150
+ const renderedText = await site.pace(new URL(url), () => {
151
+ return renderText(url, context);
152
+ });
120
153
 
121
154
  const staticChars = staticText.length;
122
155
  const renderedChars = renderedText.length;
@@ -137,17 +170,10 @@ const checkPage = async (
137
170
  } catch (error) {
138
171
  log.warn('Renderability check failed for page', {
139
172
  url,
140
- error: String(error),
173
+ error: describeSiteError(error),
141
174
  });
142
175
 
143
- return {
144
- url,
145
- staticTextChars: 0,
146
- renderedTextChars: 0,
147
- missingRatio: 0,
148
- flagged: false,
149
- error: error instanceof Error ? error.message : String(error),
150
- };
176
+ return failedPage(url, describeSiteError(error));
151
177
  }
152
178
  };
153
179
 
@@ -1,4 +1,9 @@
1
1
  import { recorded, type ExecutionRecorder } from '../bundle/recorder';
2
+ import {
3
+ createHostPacer,
4
+ guardedRequest,
5
+ type SiteRequest,
6
+ } from '../grounding/guarded-request';
2
7
  import type { AeoAuditConfig, AeoTechnicalChecks } from '../schema';
3
8
  import type { PartialFailure } from '../probes/web-tool-guard';
4
9
  import { checkLlmsTxt, runCrawlerAccessCheck } from './crawler-access';
@@ -11,6 +16,10 @@ import { runRenderabilityCheck } from './renderability';
11
16
  // run with a stub — checks are live fetches and a Playwright browser.
12
17
  // ============================================================================
13
18
 
19
+ // At most one request at a time per host, this far apart, across every check
20
+ // of the phase (specs/aeo-checks-and-reach-spec.md §3.1).
21
+ const hostIntervalInMs = 1000;
22
+
14
23
  export type CheckPhaseResult = {
15
24
  checks: AeoTechnicalChecks;
16
25
  failures: PartialFailure[];
@@ -21,6 +30,10 @@ export const runTechnicalChecks = async (
21
30
  recorder?: ExecutionRecorder,
22
31
  ): Promise<CheckPhaseResult> => {
23
32
  const failures: PartialFailure[] = [];
33
+ const pace = createHostPacer(hostIntervalInMs);
34
+ const request: SiteRequest = (options) => {
35
+ return guardedRequest({ ...options, pace });
36
+ };
24
37
 
25
38
  // One operation per check, with its parameters and its extracted result
26
39
  // (spec §7.2). The checks' own HTTP requests and raw bodies stay inside
@@ -52,13 +65,13 @@ export const runTechnicalChecks = async (
52
65
 
53
66
  const [crawlerAccess, llmsTxt, renderability] = await Promise.all([
54
67
  check('crawler_access', { domain: config.brand.domain }, () =>
55
- runCrawlerAccessCheck(config.brand.domain),
68
+ runCrawlerAccessCheck(config.brand.domain, request),
56
69
  ),
57
70
  check('llms_txt', { domain: config.brand.domain }, () =>
58
- checkLlmsTxt(config.brand.domain),
71
+ checkLlmsTxt(config.brand.domain, request),
59
72
  ),
60
73
  check('renderability', { moneyPages: config.moneyPages }, () =>
61
- runRenderabilityCheck(config.moneyPages),
74
+ runRenderabilityCheck(config.moneyPages, { request, pace }),
62
75
  ),
63
76
  ]);
64
77
 
@@ -0,0 +1,28 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { engineResources } from '../engine/resources';
3
+ import { writeOut, type Flags } from './io';
4
+
5
+ // ============================================================================
6
+ // literally-aeo guide (specs/aeo-claude-operator-spec.md §4.5): the operator
7
+ // guide for an AI agent running an audit for a user, printed from the
8
+ // installed package so it always matches the commands of this version.
9
+ // ============================================================================
10
+
11
+ /** readOperatorGuide returns the guide this engine ships. */
12
+ export const readOperatorGuide = async (): Promise<string> => {
13
+ const { guide } = await engineResources();
14
+
15
+ return readFile(guide, 'utf8');
16
+ };
17
+
18
+ export const runGuide = async (flags: Flags) => {
19
+ const guide = await readOperatorGuide();
20
+
21
+ writeOut(
22
+ flags.switches.has('--json')
23
+ ? JSON.stringify({ resultVersion: 1, command: 'guide', guide })
24
+ : guide.trimEnd(),
25
+ );
26
+
27
+ return 0;
28
+ };
package/src/cli/io.ts CHANGED
@@ -18,6 +18,8 @@ const valueOptions = new Set([
18
18
  '--port',
19
19
  '--brief',
20
20
  '--redact',
21
+ '--max-usd',
22
+ '--model',
21
23
  ]);
22
24
 
23
25
  export const parseFlags = (argv: readonly string[]): Flags => {
@@ -1,6 +1,7 @@
1
1
  import { Console } from 'node:console';
2
2
  import { toolVersion } from '../bundle/contracts';
3
3
  import { runExport, runVerify, runView } from './bundle-commands';
4
+ import { runGuide } from './guide-command';
4
5
  import { parseFlags, writeErr, writeOut } from './io';
5
6
  import {
6
7
  runDoctor,
@@ -10,6 +11,7 @@ import {
10
11
  runRejudge,
11
12
  runRun,
12
13
  } from './run-commands';
14
+ import { runStatus } from './status-command';
13
15
 
14
16
  // ============================================================================
15
17
  // literally-aeo (specs/aeo-open-source-cli-spec.md §4.3). No command loads
@@ -23,40 +25,52 @@ Usage:
23
25
  literally-aeo init [--config audit.json]
24
26
  literally-aeo doctor [--config audit.json] [--env-file .env] [--output audit-run]
25
27
  literally-aeo plan [--config audit.json] [--output audit-run]
26
- literally-aeo run [--config audit.json] [--env-file .env] [--output audit-run] [--budget-file limits.json]
27
- literally-aeo author --brief brief.json [--output audit-draft] [--env-file .env]
28
- literally-aeo rejudge <run-dir> --output <new-run-dir> [--config audit.json] [--env-file .env]
28
+ literally-aeo run [--config audit.json] [--env-file .env] [--output audit-run] [--max-usd N] [--budget-file limits.json]
29
+ literally-aeo author --brief brief.json [--estimate] [--max-usd N] [--model <id>] [--output audit-draft] [--env-file .env]
30
+ literally-aeo rejudge <run-dir> --output <new-run-dir> [--model <id>] [--max-usd N] [--config audit.json] [--env-file .env]
29
31
  literally-aeo view <archive|bundle-dir|run-dir> [--working] [--port N]
30
32
  literally-aeo export <run-dir> [--output <file.aeo.zip>] [--env-file <file>] [--accept-findings] [--redact redactions.json]
31
33
  literally-aeo verify <archive|bundle-dir|run-dir>
34
+ literally-aeo status <run-dir>
35
+ literally-aeo guide
32
36
 
33
37
  Every command takes --json (a versioned result on stdout) and --quiet.
34
38
 
35
39
  init writes an example audit.json and .env.example, never over a file.
36
- doctor checks the CLIs, settings and run directory a run needs, offline;
37
- settings are named, never shown. plan prints what a run would measure and
38
- whether the run directory is new, resumable or completed, offline. run
39
- measures: it captures every planned answer (reusing what the run directory
40
- already holds), judges, reviews and writes the report; running it again
41
- resumes; --budget-file raises the run's limits, recorded. author researches a brief
42
- (JSON: companyName, website, desiredRecommendation, and optionally
43
- competitors, moneyPages, notes) and proposes an audit.json beside the
44
- record of the session; a run of that file bundles the record and the diff
45
- from proposal to final. rejudge judges a
46
- finished run's captures again in a new run directory, carrying the original
47
- revision as its predecessor; nothing is probed again. view serves the
40
+ doctor checks the model, the CLIs, settings and run directory a run needs,
41
+ offline; settings are named, never shown, and an unsupported model is
42
+ refused with the supported list. plan prints what a run would measure, its
43
+ estimated cost as a range, and whether the run directory is new, resumable
44
+ or completed, offline. run measures: it captures every planned answer
45
+ (reusing what the run directory already holds), judges, reviews and writes
46
+ the report; running it again resumes. A new run starts only under an
47
+ approved cap, --max-usd or runPolicy.budget.maxUsd, which covers every
48
+ paid call (probes, Codex stages, host model calls, searches); without one
49
+ it prints the estimate and spends nothing. A run freezes its cap and its
50
+ model; --max-usd or --budget-file raises the cap of a run, recorded.
51
+ author researches a brief (JSON: companyName, website,
52
+ desiredRecommendation, and optionally competitors, moneyPages, notes) and
53
+ proposes an audit.json beside the record of the session; --estimate prints
54
+ what that costs and spends nothing, and the session needs --max-usd. A run
55
+ of that file bundles the record and the diff from proposal to final.
56
+ rejudge judges a finished run's captures again in a new run directory,
57
+ carrying the original revision as its predecessor; nothing is probed
58
+ again, and --model judges with another model. view serves the
48
59
  report and its evidence on this machine only (127.0.0.1, a one-time link);
49
60
  a run directory without a finalized revision shows its working state,
50
61
  labelled as such. export packs a run directory into a portable archive;
51
- verify checks one offline.
62
+ verify checks one offline. status reports a run directory's phase,
63
+ answers and spend against its cap, read-only, beside a live run too. guide
64
+ prints the protocol an AI agent follows to run an audit for a user.
52
65
 
53
66
  Settings come from the process environment first, then the env file
54
67
  (default ./.env); no other file is read.
55
68
 
56
69
  Exit codes: 0 done; 1 invalid input, a failed check or an error; 2 stopped
57
- before or during work and resumable (missing setting, failed canary, a live
58
- writer holding the run), or an unsupported bundle; 3 done with disclosed
59
- limitations; 128 plus the signal number when interrupted.`;
70
+ before or during work and resumable (no approved cap, the cap reached,
71
+ missing setting, failed canary, a live writer holding the run), or an
72
+ unsupported bundle; 3 done with disclosed limitations; 128 plus the signal
73
+ number when interrupted.`;
60
74
 
61
75
  const main = async (argv: readonly string[]) => {
62
76
  const flags = parseFlags(argv);
@@ -101,6 +115,12 @@ const main = async (argv: readonly string[]) => {
101
115
  case 'view':
102
116
  return runView(commandFlags, usageText);
103
117
 
118
+ case 'status':
119
+ return runStatus(commandFlags, usageText);
120
+
121
+ case 'guide':
122
+ return runGuide(commandFlags);
123
+
104
124
  default:
105
125
  throw new Error(usageText);
106
126
  }