literally-aeo 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/README.md +183 -14
  2. package/dist/author-tools.js +386 -283
  3. package/dist/cli.mjs +19943 -16532
  4. package/dist/lib/access/schema.js +6 -6
  5. package/dist/lib/agents/author-schema.js +12 -12
  6. package/dist/lib/agents/author-validation.js +15 -15
  7. package/dist/lib/agents/copy-validation.js +18 -17
  8. package/dist/lib/agents/copywriter-input.js +16 -15
  9. package/dist/lib/agents/credentials.js +1 -1
  10. package/dist/lib/agents/facts.js +15 -14
  11. package/dist/lib/agents/methodology.js +56 -0
  12. package/dist/lib/agents/narrative-facts.js +13 -13
  13. package/dist/lib/agents/verifier.js +22 -20
  14. package/dist/lib/analysis/domain-classifier.js +21 -19
  15. package/dist/lib/analysis/domain-labels.js +12 -12
  16. package/dist/lib/analysis/outreach.js +2 -2
  17. package/dist/lib/analysis/progress-schema.js +6 -2
  18. package/dist/lib/analysis/progress.js +17 -16
  19. package/dist/lib/analysis/rate-evidence.js +6 -0
  20. package/dist/lib/analysis/retrieval.js +12 -12
  21. package/dist/lib/analysis/scoring.js +12 -12
  22. package/dist/lib/analysis/search-analyzer.js +13 -13
  23. package/dist/lib/analysis/sentiment.js +20 -18
  24. package/dist/lib/analysis/source-mix.js +2 -2
  25. package/dist/lib/author/examples.js +13 -13
  26. package/dist/lib/bundle/contracts.js +19 -13
  27. package/dist/lib/bundle/export.js +86 -31
  28. package/dist/lib/bundle/isolation.js +2 -2
  29. package/dist/lib/bundle/journal.js +14 -14
  30. package/dist/lib/bundle/project-journal.js +18 -18
  31. package/dist/lib/bundle/project.js +87 -30
  32. package/dist/lib/bundle/read.js +87 -32
  33. package/dist/lib/bundle/recorder.js +16 -16
  34. package/dist/lib/bundle/redact.js +14 -14
  35. package/dist/lib/bundle/trace-coverage.js +14 -14
  36. package/dist/lib/bundle/verify-integrity.js +17 -17
  37. package/dist/lib/bundle/verify-measurement.js +31 -22
  38. package/dist/lib/bundle/verify-report.js +36 -26
  39. package/dist/lib/bundle/verify.js +45 -35
  40. package/dist/lib/capture-manifest.js +13 -13
  41. package/dist/lib/checks/crawler-access.js +2 -2
  42. package/dist/lib/checks/renderability.js +2 -2
  43. package/dist/lib/checks/run-checks.js +20 -20
  44. package/dist/lib/chunks/{chunk-4XIAXX7K.js → chunk-2A327DMI.js} +1 -1
  45. package/dist/lib/chunks/{chunk-7WO3FFPS.js → chunk-2FK6QVU6.js} +3 -3
  46. package/dist/lib/chunks/{chunk-F2NSJ6PG.js → chunk-2WS6RC35.js} +8 -4
  47. package/dist/lib/chunks/{chunk-6EI4CVRW.js → chunk-3ESH5NDR.js} +5 -1
  48. package/dist/lib/chunks/{chunk-WIBMVNIH.js → chunk-3F5ZP2EO.js} +4 -4
  49. package/dist/lib/chunks/{chunk-ZXQPD4OC.js → chunk-3TF4JGQA.js} +126 -5
  50. package/dist/lib/chunks/{chunk-BFWK3TBN.js → chunk-3YPAIXFG.js} +8 -8
  51. package/dist/lib/chunks/{chunk-PIFTG6YW.js → chunk-4332MUTU.js} +4 -4
  52. package/dist/lib/chunks/{chunk-K2FZFESR.js → chunk-4MOZ3DVS.js} +8 -7
  53. package/dist/lib/chunks/{chunk-KFAT65P7.js → chunk-4SCPKDJV.js} +1 -1
  54. package/dist/lib/chunks/{chunk-6HMHXSCS.js → chunk-4ZR2LPUD.js} +3 -3
  55. package/dist/lib/chunks/{chunk-QGZ4QSUE.js → chunk-55KFAM4X.js} +36 -5
  56. package/dist/lib/chunks/{chunk-FJL2V6P5.js → chunk-66OL2XA6.js} +13 -8
  57. package/dist/lib/chunks/{chunk-4QQJXCD2.js → chunk-6FRZN5SA.js} +13 -28
  58. package/dist/lib/chunks/{chunk-3OE4UQIB.js → chunk-6FXNXXY7.js} +116 -7
  59. package/dist/lib/chunks/chunk-6TJXJZUL.js +97 -0
  60. package/dist/lib/chunks/{chunk-YKJHFD64.js → chunk-72ZLXWD4.js} +21 -4
  61. package/dist/lib/chunks/{chunk-2FOKEIIN.js → chunk-744YWRX7.js} +1 -1
  62. package/dist/lib/chunks/{chunk-I3UE52ZV.js → chunk-77EQ3RT6.js} +4 -4
  63. package/dist/lib/chunks/{chunk-AJO7XVXK.js → chunk-7GHR6MOG.js} +12 -12
  64. package/dist/lib/chunks/{chunk-JYCVBFH5.js → chunk-7GJTWUI4.js} +2 -2
  65. package/dist/lib/chunks/{chunk-UNCUG2YS.js → chunk-7NQOQNE7.js} +3 -3
  66. package/dist/lib/chunks/chunk-7Y3S7LD5.js +160 -0
  67. package/dist/lib/chunks/{chunk-U64NCRRR.js → chunk-7ZQAAEOK.js} +7 -6
  68. package/dist/lib/chunks/{chunk-MENTBQGB.js → chunk-A4QTI7FN.js} +78 -19
  69. package/dist/lib/chunks/{chunk-Y2CZ6FZY.js → chunk-ADNYALFZ.js} +36 -7
  70. package/dist/lib/chunks/{chunk-CH7OCYDL.js → chunk-B5ZAFK6T.js} +1 -1
  71. package/dist/lib/chunks/{chunk-WDT2Y7D7.js → chunk-B6YKBZXD.js} +20 -11
  72. package/dist/lib/chunks/{chunk-ZSEY7AHQ.js → chunk-BBK54RVK.js} +14 -11
  73. package/dist/lib/chunks/{chunk-YGLWQFKL.js → chunk-BE7EDOJY.js} +3 -3
  74. package/dist/lib/chunks/{chunk-OD36HUXA.js → chunk-BECSPYFC.js} +7 -8
  75. package/dist/lib/chunks/{chunk-HGGOGCPX.js → chunk-BNKNZTYH.js} +17 -14
  76. package/dist/lib/chunks/{chunk-2KH7LNK7.js → chunk-BOLZJBPS.js} +56 -15
  77. package/dist/lib/chunks/chunk-BQMUZLHO.js +17 -0
  78. package/dist/lib/chunks/chunk-C22Q3TKU.js +90 -0
  79. package/dist/lib/chunks/chunk-C3AZMWQJ.js +109 -0
  80. package/dist/lib/chunks/{chunk-T6XZQOXS.js → chunk-CCSF7LP5.js} +7 -7
  81. package/dist/lib/chunks/{chunk-JBOOD6MU.js → chunk-CHDK5EQK.js} +57 -16
  82. package/dist/lib/chunks/{chunk-NZFMOQHU.js → chunk-CWEVVIZI.js} +11 -1
  83. package/dist/lib/chunks/{chunk-75DMLOQ7.js → chunk-CYJNBVQB.js} +1 -1
  84. package/dist/lib/chunks/{chunk-66T7JC57.js → chunk-CZRHH5HF.js} +85 -5
  85. package/dist/lib/chunks/{chunk-FAUFE7MI.js → chunk-D7N5OLYL.js} +1 -1
  86. package/dist/lib/chunks/chunk-DBQ3HVPX.js +73 -0
  87. package/dist/lib/chunks/{chunk-PKNODC6Y.js → chunk-DC6CS6GC.js} +1 -1
  88. package/dist/lib/chunks/{chunk-7YDXD4MD.js → chunk-DHQKAIOP.js} +2 -2
  89. package/dist/lib/chunks/{chunk-LTCDLURT.js → chunk-DIR4UIRF.js} +73 -24
  90. package/dist/lib/chunks/{chunk-E2YTTB6Q.js → chunk-DSK3PM4Z.js} +1 -1
  91. package/dist/lib/chunks/chunk-DWOTAT7R.js +312 -0
  92. package/dist/lib/chunks/chunk-E2JICEL3.js +446 -0
  93. package/dist/lib/chunks/{chunk-HXHFMFQU.js → chunk-E5COBP7A.js} +13 -2
  94. package/dist/lib/chunks/{chunk-XAN4CRFP.js → chunk-EUHVUF7I.js} +1 -1
  95. package/dist/lib/chunks/{chunk-TNL2GWYR.js → chunk-EUXNCXCR.js} +22 -0
  96. package/dist/lib/chunks/chunk-F3MHGDZG.js +97 -0
  97. package/dist/lib/chunks/chunk-F7LCGM6W.js +120 -0
  98. package/dist/lib/chunks/chunk-FJAZEGU6.js +354 -0
  99. package/dist/lib/chunks/chunk-FOJVAGAD.js +91 -0
  100. package/dist/lib/chunks/chunk-FXR6P7HY.js +14 -0
  101. package/dist/lib/chunks/chunk-GC4XJYQW.js +145 -0
  102. package/dist/lib/chunks/chunk-GQZHZSAQ.js +108 -0
  103. package/dist/lib/chunks/{chunk-BRENK356.js → chunk-GZC3ASNL.js} +1 -1
  104. package/dist/lib/chunks/{chunk-3CMPR6ZZ.js → chunk-H2JJCIZW.js} +1 -1
  105. package/dist/lib/chunks/{chunk-XSER7WEB.js → chunk-H33MFLSH.js} +12 -12
  106. package/dist/lib/chunks/chunk-H4IE2JE6.js +118 -0
  107. package/dist/lib/chunks/chunk-H4LZ3U26.js +31 -0
  108. package/dist/lib/chunks/{chunk-XFUYEFQP.js → chunk-HHGLGVOZ.js} +1 -1
  109. package/dist/lib/chunks/{chunk-52F5XYOW.js → chunk-I2KRWXXO.js} +15 -7
  110. package/dist/lib/chunks/chunk-IDNT2WBK.js +27 -0
  111. package/dist/lib/chunks/{chunk-R5UPOEWE.js → chunk-IUQ6C4Y6.js} +14 -4
  112. package/dist/lib/chunks/chunk-IXYVHA7C.js +101 -0
  113. package/dist/lib/chunks/{chunk-FDM2YNQL.js → chunk-J3BZ3WPV.js} +1 -1
  114. package/dist/lib/chunks/{chunk-U6BW6LGX.js → chunk-J63WQUKR.js} +10 -3
  115. package/dist/lib/chunks/{chunk-OOLWU667.js → chunk-JBEKIT7Z.js} +10 -10
  116. package/dist/lib/chunks/chunk-JEAZREDN.js +94 -0
  117. package/dist/lib/chunks/{chunk-2B5QF6UQ.js → chunk-JFUWSJZT.js} +46 -5
  118. package/dist/lib/chunks/{chunk-SIJOQRRK.js → chunk-JHOLYLI4.js} +4 -2
  119. package/dist/lib/chunks/chunk-JOLIDHZV.js +39 -0
  120. package/dist/lib/chunks/{chunk-HCUJ2J7P.js → chunk-JWH33YCK.js} +17 -16
  121. package/dist/lib/chunks/{chunk-HGGRPOSA.js → chunk-K5K27WBZ.js} +10 -9
  122. package/dist/lib/chunks/{chunk-7HM6IZ3L.js → chunk-KU53HTUY.js} +2 -2
  123. package/dist/lib/chunks/{chunk-PIF3GL62.js → chunk-LJTFZ52Y.js} +24 -12
  124. package/dist/lib/chunks/chunk-LMUTZ6O2.js +335 -0
  125. package/dist/lib/chunks/chunk-LTPLZSXI.js +86 -0
  126. package/dist/lib/chunks/{chunk-RXSHKWZJ.js → chunk-M3WZCV65.js} +3 -3
  127. package/dist/lib/chunks/{chunk-ZOGIJGU3.js → chunk-MN3YGXJH.js} +17 -17
  128. package/dist/lib/chunks/{chunk-ZQ3ER7JD.js → chunk-MSEGYN6W.js} +32 -14
  129. package/dist/lib/chunks/{chunk-JQDQVG3D.js → chunk-MWZIVYMK.js} +1 -1
  130. package/dist/lib/chunks/{chunk-WCLKIPJV.js → chunk-MX6YA6YH.js} +1 -1
  131. package/dist/lib/chunks/{chunk-GEFKDW7X.js → chunk-N4PQ6RPQ.js} +14 -2
  132. package/dist/lib/chunks/{chunk-EDQTINTL.js → chunk-N5IAPSLM.js} +52 -6
  133. package/dist/lib/chunks/{chunk-V5JJEEBT.js → chunk-NAPYHYA5.js} +6 -5
  134. package/dist/lib/chunks/{chunk-LR27H2HZ.js → chunk-NWUZJUJX.js} +8 -8
  135. package/dist/lib/chunks/{chunk-U5USH2HB.js → chunk-NZTOOSLX.js} +3 -3
  136. package/dist/lib/chunks/{chunk-S6QOXJAL.js → chunk-OQVEYTVV.js} +16 -7
  137. package/dist/lib/chunks/{chunk-GLUGYZQO.js → chunk-OXPPUUIO.js} +48 -60
  138. package/dist/lib/chunks/chunk-PPTUCXWS.js +95 -0
  139. package/dist/lib/chunks/{chunk-W5XYW6ZM.js → chunk-PT6PK2MJ.js} +26 -19
  140. package/dist/lib/chunks/{chunk-7DNLRXEY.js → chunk-PUZBLM7E.js} +9 -6
  141. package/dist/lib/chunks/{chunk-7YZPEX3T.js → chunk-PVW5W2MX.js} +9 -4
  142. package/dist/lib/chunks/{chunk-YEUCAPKP.js → chunk-QFIJSLAR.js} +26 -6
  143. package/dist/lib/chunks/{chunk-J5NPHPXY.js → chunk-QTUWCZ3X.js} +43 -8
  144. package/dist/lib/chunks/{chunk-6GKKALCI.js → chunk-R4BFYHLK.js} +2 -2
  145. package/dist/lib/chunks/chunk-R75F4MKU.js +162 -0
  146. package/dist/lib/chunks/{chunk-V5B6UZ3E.js → chunk-RQGEPR6V.js} +1 -0
  147. package/dist/lib/chunks/{chunk-TAPVCSCR.js → chunk-SCZ7PA4T.js} +1 -1
  148. package/dist/lib/chunks/{chunk-K4Y5NT4M.js → chunk-SFPPZGTA.js} +112 -26
  149. package/dist/lib/chunks/chunk-SN3DKEOY.js +11 -0
  150. package/dist/lib/chunks/{chunk-UYDQXXDQ.js → chunk-ST6IVXHT.js} +1 -1
  151. package/dist/lib/chunks/chunk-SXCTAL6V.js +116 -0
  152. package/dist/lib/chunks/chunk-SXVKFPC4.js +288 -0
  153. package/dist/lib/chunks/chunk-T4Z3GAEH.js +292 -0
  154. package/dist/lib/chunks/{chunk-RK57YZKM.js → chunk-T7DNKNMG.js} +81 -26
  155. package/dist/lib/chunks/{chunk-DL6YQDTE.js → chunk-TPPBTN3E.js} +50 -21
  156. package/dist/lib/chunks/{chunk-J7QKT5E7.js → chunk-UBH2P5IR.js} +91 -32
  157. package/dist/lib/chunks/{chunk-BYHXNFWN.js → chunk-UIXTXI7P.js} +9 -7
  158. package/dist/lib/chunks/chunk-UWXR24TV.js +38 -0
  159. package/dist/lib/chunks/chunk-V57HW7T4.js +86 -0
  160. package/dist/lib/chunks/{chunk-XA27KAUV.js → chunk-VCFLUGLQ.js} +80 -48
  161. package/dist/lib/chunks/{chunk-VL253W5C.js → chunk-VMDGYDZW.js} +3 -1
  162. package/dist/lib/chunks/{chunk-RIJERFGU.js → chunk-W6TGEP5C.js} +96 -26
  163. package/dist/lib/chunks/chunk-WB4ZBRF6.js +338 -0
  164. package/dist/lib/chunks/{chunk-F7DBTXKG.js → chunk-WQTDLVKV.js} +4 -3
  165. package/dist/lib/chunks/{chunk-VXYQWE45.js → chunk-WRH4CIFQ.js} +3 -3
  166. package/dist/lib/chunks/{chunk-JKPBXPCW.js → chunk-WSFXGX7S.js} +3 -3
  167. package/dist/lib/chunks/{chunk-BXF4OC74.js → chunk-WSWQCHSW.js} +32 -17
  168. package/dist/lib/chunks/{chunk-EOO5RBUW.js → chunk-WTAIFAQV.js} +42 -6
  169. package/dist/lib/chunks/{chunk-7YYDUHJG.js → chunk-WZA4H4TG.js} +39 -13
  170. package/dist/lib/chunks/{chunk-RYCRL3YA.js → chunk-X3HRV5CF.js} +12 -4
  171. package/dist/lib/chunks/{chunk-S2SFHTJD.js → chunk-XPUCJQIB.js} +39 -1
  172. package/dist/lib/chunks/{chunk-PWOYEIPF.js → chunk-Y2NZTYKV.js} +8 -8
  173. package/dist/lib/chunks/chunk-YLS4XX7B.js +105 -0
  174. package/dist/lib/chunks/{chunk-7CW6U5WJ.js → chunk-YPMRZX4U.js} +1 -1
  175. package/dist/lib/chunks/{chunk-SASE7U6E.js → chunk-YQD5ITKI.js} +1 -1
  176. package/dist/lib/chunks/{chunk-LTI2YYU3.js → chunk-YTEUQEJE.js} +1 -1
  177. package/dist/lib/chunks/{chunk-4GLW3ZRO.js → chunk-YYP547FI.js} +146 -22
  178. package/dist/lib/chunks/{chunk-QD3JXA3Y.js → chunk-ZDCKZEDJ.js} +56 -36
  179. package/dist/lib/chunks/{chunk-AT3XMGES.js → chunk-ZWTNELCS.js} +12 -6
  180. package/dist/lib/chunks/{chunk-VHKHYAC5.js → chunk-ZWWIXFCV.js} +3 -3
  181. package/dist/lib/chunks/{chunk-MA27TFEY.js → chunk-ZXL6FZX4.js} +8 -1
  182. package/dist/lib/cli/bundle-commands.js +137 -111
  183. package/dist/lib/cli/guide-command.js +1 -1
  184. package/dist/lib/cli/io.js +1 -1
  185. package/dist/lib/cli/run-commands.js +349 -168
  186. package/dist/lib/cli/status-command.js +114 -87
  187. package/dist/lib/codex-workflow/aggregate.js +41 -24
  188. package/dist/lib/codex-workflow/author-search.js +1 -1
  189. package/dist/lib/codex-workflow/author-tools.js +14 -14
  190. package/dist/lib/codex-workflow/author.js +35 -32
  191. package/dist/lib/codex-workflow/capture.js +53 -28
  192. package/dist/lib/codex-workflow/checkpoint.js +14 -14
  193. package/dist/lib/codex-workflow/checks.js +16 -16
  194. package/dist/lib/codex-workflow/copy-editor.js +29 -26
  195. package/dist/lib/codex-workflow/copy-recovery.js +13 -13
  196. package/dist/lib/codex-workflow/copy.js +32 -23
  197. package/dist/lib/codex-workflow/finish.js +67 -37
  198. package/dist/lib/codex-workflow/host-models.js +2 -2
  199. package/dist/lib/codex-workflow/loop.js +96 -72
  200. package/dist/lib/codex-workflow/prompts.js +1 -1
  201. package/dist/lib/codex-workflow/quality.js +13 -13
  202. package/dist/lib/codex-workflow/run-inputs.js +13 -13
  203. package/dist/lib/codex-workflow/run-source.js +24 -24
  204. package/dist/lib/codex-workflow/schemas.js +13 -13
  205. package/dist/lib/codex-workflow/session.js +15 -15
  206. package/dist/lib/codex-workflow/stage.js +49 -46
  207. package/dist/lib/codex-workflow/workdir.js +25 -18
  208. package/dist/lib/engine/audit-file.js +50 -16
  209. package/dist/lib/engine/author.js +77 -57
  210. package/dist/lib/engine/budget.js +3 -1
  211. package/dist/lib/engine/cost-estimate.js +46 -16
  212. package/dist/lib/engine/local-run.js +113 -85
  213. package/dist/lib/engine/preflight.js +47 -17
  214. package/dist/lib/engine/rejudge.js +121 -92
  215. package/dist/lib/engine/run-bindings.js +66 -0
  216. package/dist/lib/engine/run-configuration.js +3 -1
  217. package/dist/lib/engine/run-method.js +67 -0
  218. package/dist/lib/engine/run-models.js +48 -0
  219. package/dist/lib/engine/run-status.js +112 -85
  220. package/dist/lib/engine/templates.js +47 -17
  221. package/dist/lib/grounding/controller.js +10 -9
  222. package/dist/lib/grounding/extract.js +10 -8
  223. package/dist/lib/grounding/grounding-runtime.js +32 -31
  224. package/dist/lib/grounding/model-usage.js +2 -2
  225. package/dist/lib/grounding/model.js +9 -7
  226. package/dist/lib/grounding/recorded-tools.js +17 -17
  227. package/dist/lib/grounding/tools.js +5 -1
  228. package/dist/lib/harness/report/artifacts.js +12 -12
  229. package/dist/lib/harness/report/capture-coverage.js +4 -4
  230. package/dist/lib/lib/checkpoint.js +12 -12
  231. package/dist/lib/lib/compare.js +6 -0
  232. package/dist/lib/lib/log.js +1 -1
  233. package/dist/lib/lib/progress-comparison.js +3 -2
  234. package/dist/lib/models/accounting.js +1 -1
  235. package/dist/lib/models/batching.js +7 -5
  236. package/dist/lib/models/budget-protection.js +1 -1
  237. package/dist/lib/models/catalog.js +16 -0
  238. package/dist/lib/models/cost-coefficients.js +12 -1
  239. package/dist/lib/models/gateway-cost.js +7 -0
  240. package/dist/lib/models/local-profile.js +2 -2
  241. package/dist/lib/models/open-model.js +7 -0
  242. package/dist/lib/models/profiles.js +3 -1
  243. package/dist/lib/models/structured.js +6 -4
  244. package/dist/lib/models/supported-models.js +2 -2
  245. package/dist/lib/pipeline.js +50 -27
  246. package/dist/lib/probes/adapter.js +6 -0
  247. package/dist/lib/probes/adapters/cli-agents.js +44 -0
  248. package/dist/lib/probes/adapters/cli-claude-code.js +22 -0
  249. package/dist/lib/probes/adapters/cli-codex.js +24 -0
  250. package/dist/lib/probes/adapters/cli-cursor.js +22 -0
  251. package/dist/lib/probes/adapters/cli-process.js +35 -0
  252. package/dist/lib/probes/adapters/dataforseo-ai-mode.js +24 -0
  253. package/dist/lib/probes/adapters/dataforseo-ai-overview.js +21 -0
  254. package/dist/lib/probes/adapters/dataforseo-chatgpt-app.js +22 -0
  255. package/dist/lib/probes/adapters/gateway-chat.js +33 -0
  256. package/dist/lib/probes/adapters/gateway-perplexity.js +20 -0
  257. package/dist/lib/probes/agent-cli-parsers.js +4 -3
  258. package/dist/lib/probes/agent-clis.js +34 -19
  259. package/dist/lib/probes/answer-text.js +22 -0
  260. package/dist/lib/probes/attempt.js +29 -0
  261. package/dist/lib/probes/bindings.js +101 -0
  262. package/dist/lib/probes/charged-trace.js +49 -3
  263. package/dist/lib/probes/chat-retrieval.js +7 -2
  264. package/dist/lib/probes/dataforseo-locale.js +9 -3
  265. package/dist/lib/probes/dataforseo.js +16 -5
  266. package/dist/lib/probes/grounding-urls.js +6 -4
  267. package/dist/lib/probes/legacy-bindings.js +7 -0
  268. package/dist/lib/probes/limits.js +1 -1
  269. package/dist/lib/probes/probes.js +42 -19
  270. package/dist/lib/probes/web-tool-guard.js +3 -3
  271. package/dist/lib/report/contracts.js +7 -7
  272. package/dist/lib/report/core/progress-comparison.js +3 -2
  273. package/dist/lib/report/core/progress-schema.js +6 -2
  274. package/dist/lib/report/core/progress-statistics.js +8 -0
  275. package/dist/lib/report/core/rate-interval.js +6 -0
  276. package/dist/lib/report/core/retrieval.js +4 -1
  277. package/dist/lib/report/core/schema.js +23 -3
  278. package/dist/lib/report/core/surfaces.js +23 -1
  279. package/dist/lib/retrieval.js +4 -1
  280. package/dist/lib/runner.js +28 -25
  281. package/dist/lib/schema.js +37 -13
  282. package/dist/lib/section-result.js +15 -13
  283. package/dist/lib/stores/artifacts.js +15 -15
  284. package/dist/lib/stores/files.js +31 -27
  285. package/dist/lib/stores/local-versions.js +12 -12
  286. package/dist/lib/stores/memory.js +33 -27
  287. package/dist/lib/stores/publication.js +19 -18
  288. package/dist/lib/stores/unit-record.js +28 -0
  289. package/dist/lib/surfaces.js +23 -1
  290. package/dist/lib/viewer/page.js +1 -1
  291. package/dist/lib/viewer/server.js +47 -37
  292. package/dist/lib/workflow/schema.js +10 -10
  293. package/dist/types/agents/author-schema.d.ts +10 -10
  294. package/dist/types/agents/facts.d.ts +1 -1
  295. package/dist/types/agents/methodology.d.ts +26 -0
  296. package/dist/types/agents/verifier.d.ts +1 -1
  297. package/dist/types/analysis/domain-labels.d.ts +1 -1
  298. package/dist/types/analysis/rate-evidence.d.ts +11 -0
  299. package/dist/types/analysis/scoring.d.ts +17 -0
  300. package/dist/types/analysis/sentiment.d.ts +8 -4
  301. package/dist/types/bundle/contracts.d.ts +42 -20
  302. package/dist/types/bundle/project.d.ts +6 -0
  303. package/dist/types/bundle/recorder.d.ts +1 -1
  304. package/dist/types/bundle/trace-coverage.d.ts +4 -2
  305. package/dist/types/capture-manifest.d.ts +9 -4
  306. package/dist/types/codex-workflow/aggregate.d.ts +90 -12
  307. package/dist/types/codex-workflow/capture.d.ts +13 -0
  308. package/dist/types/codex-workflow/copy-editor.d.ts +40 -1
  309. package/dist/types/codex-workflow/copy.d.ts +136 -1
  310. package/dist/types/codex-workflow/run-inputs.d.ts +138 -32
  311. package/dist/types/codex-workflow/schemas.d.ts +20 -20
  312. package/dist/types/codex-workflow/stage.d.ts +7 -1
  313. package/dist/types/codex-workflow/workdir.d.ts +0 -1
  314. package/dist/types/engine/audit-file.d.ts +96 -6
  315. package/dist/types/engine/budget.d.ts +19 -6
  316. package/dist/types/engine/cost-estimate.d.ts +15 -2
  317. package/dist/types/engine/local-run.d.ts +12 -2
  318. package/dist/types/engine/preflight.d.ts +27 -6
  319. package/dist/types/engine/run-bindings.d.ts +52 -0
  320. package/dist/types/engine/run-configuration.d.ts +15 -3
  321. package/dist/types/engine/run-method.d.ts +58 -0
  322. package/dist/types/engine/run-models.d.ts +89 -0
  323. package/dist/types/engine/templates.d.ts +3 -1
  324. package/dist/types/grounding/tools.d.ts +10 -0
  325. package/dist/types/harness/report/artifacts.d.ts +48 -24
  326. package/dist/types/lib/compare.d.ts +3 -0
  327. package/dist/types/models/accounting.d.ts +7 -0
  328. package/dist/types/models/catalog.d.ts +52 -0
  329. package/dist/types/models/cost-coefficients.d.ts +77 -24
  330. package/dist/types/models/gateway-cost.d.ts +3 -0
  331. package/dist/types/models/local-profile.d.ts +5 -1
  332. package/dist/types/models/open-model.d.ts +10 -0
  333. package/dist/types/models/profiles.d.ts +113 -14
  334. package/dist/types/models/supported-models.d.ts +13 -3
  335. package/dist/types/pipeline.d.ts +2 -0
  336. package/dist/types/probes/adapter.d.ts +121 -0
  337. package/dist/types/probes/adapters/cli-agents.d.ts +19 -0
  338. package/dist/types/probes/adapters/cli-claude-code.d.ts +4 -0
  339. package/dist/types/probes/adapters/cli-codex.d.ts +10 -0
  340. package/dist/types/probes/adapters/cli-cursor.d.ts +4 -0
  341. package/dist/types/probes/adapters/cli-process.d.ts +86 -0
  342. package/dist/types/probes/adapters/dataforseo-ai-mode.d.ts +16 -0
  343. package/dist/types/probes/adapters/dataforseo-ai-overview.d.ts +12 -0
  344. package/dist/types/probes/adapters/dataforseo-chatgpt-app.d.ts +12 -0
  345. package/dist/types/probes/adapters/gateway-chat.d.ts +61 -0
  346. package/dist/types/probes/adapters/gateway-perplexity.d.ts +10 -0
  347. package/dist/types/probes/agent-clis.d.ts +7 -49
  348. package/dist/types/probes/answer-text.d.ts +20 -0
  349. package/dist/types/probes/attempt.d.ts +113 -0
  350. package/dist/types/probes/bindings.d.ts +168 -0
  351. package/dist/types/probes/charged-trace.d.ts +8 -1
  352. package/dist/types/probes/chat-retrieval.d.ts +2 -0
  353. package/dist/types/probes/dataforseo-locale.d.ts +16 -0
  354. package/dist/types/probes/dataforseo.d.ts +66 -1
  355. package/dist/types/probes/grounding-urls.d.ts +18 -5
  356. package/dist/types/probes/legacy-bindings.d.ts +36 -0
  357. package/dist/types/probes/limits.d.ts +12 -6
  358. package/dist/types/probes/probe-trace.d.ts +13 -0
  359. package/dist/types/probes/probes.d.ts +7 -5
  360. package/dist/types/report/contracts.d.ts +184 -30
  361. package/dist/types/report/core/progress-comparison.d.ts +19 -2
  362. package/dist/types/report/core/progress-schema.d.ts +13 -5
  363. package/dist/types/report/core/progress-statistics.d.ts +28 -0
  364. package/dist/types/report/core/rate-interval.d.ts +10 -0
  365. package/dist/types/report/core/retrieval.d.ts +5 -2
  366. package/dist/types/report/core/schema.d.ts +190 -30
  367. package/dist/types/report/core/surfaces.d.ts +38 -4
  368. package/dist/types/runner.d.ts +5 -0
  369. package/dist/types/schema.d.ts +126 -21
  370. package/dist/types/section-result.d.ts +7 -2
  371. package/dist/types/stores/ports.d.ts +1 -0
  372. package/dist/types/stores/unit-record.d.ts +11 -0
  373. package/dist/types/workflow/schema.d.ts +121 -41
  374. package/package.json +6 -6
  375. package/resources/guide/OPERATOR.md +35 -7
  376. package/src/agents/author-schema.ts +7 -0
  377. package/src/agents/credentials.ts +18 -3
  378. package/src/agents/facts.ts +116 -3
  379. package/src/agents/methodology.ts +168 -0
  380. package/src/agents/narrative-facts.ts +50 -13
  381. package/src/agents/verifier.ts +2 -1
  382. package/src/analysis/progress.ts +14 -2
  383. package/src/analysis/rate-evidence.ts +74 -0
  384. package/src/analysis/scoring.ts +53 -10
  385. package/src/bundle/contracts.ts +42 -5
  386. package/src/bundle/export.ts +24 -4
  387. package/src/bundle/project-journal.ts +7 -1
  388. package/src/bundle/project.ts +76 -7
  389. package/src/bundle/recorder.ts +50 -1
  390. package/src/bundle/trace-coverage.ts +13 -6
  391. package/src/bundle/verify-integrity.ts +1 -0
  392. package/src/bundle/verify-report.ts +9 -3
  393. package/src/capture-manifest.ts +6 -0
  394. package/src/cli/io.ts +2 -0
  395. package/src/cli/literally-aeo.ts +10 -6
  396. package/src/cli/run-commands.ts +268 -39
  397. package/src/codex-workflow/aggregate.ts +108 -15
  398. package/src/codex-workflow/capture.ts +62 -5
  399. package/src/codex-workflow/copy-editor.ts +13 -2
  400. package/src/codex-workflow/copy.ts +171 -2
  401. package/src/codex-workflow/finish.ts +39 -0
  402. package/src/codex-workflow/loop.ts +23 -2
  403. package/src/codex-workflow/prompts.ts +32 -42
  404. package/src/codex-workflow/schemas.ts +3 -1
  405. package/src/codex-workflow/stage.ts +40 -45
  406. package/src/codex-workflow/workdir.ts +3 -4
  407. package/src/engine/audit-file.ts +186 -13
  408. package/src/engine/author.ts +5 -2
  409. package/src/engine/budget.ts +70 -10
  410. package/src/engine/cost-estimate.ts +39 -9
  411. package/src/engine/guide/OPERATOR.md +35 -7
  412. package/src/engine/local-run.ts +109 -13
  413. package/src/engine/preflight.ts +170 -30
  414. package/src/engine/rejudge.ts +8 -2
  415. package/src/engine/run-bindings.ts +189 -0
  416. package/src/engine/run-configuration.ts +36 -6
  417. package/src/engine/run-method.ts +230 -0
  418. package/src/engine/run-models.ts +276 -0
  419. package/src/engine/run-status.ts +9 -4
  420. package/src/engine/templates.ts +7 -2
  421. package/src/grounding/controller.ts +2 -1
  422. package/src/grounding/extract.ts +1 -0
  423. package/src/grounding/model-usage.ts +4 -0
  424. package/src/grounding/tools.ts +18 -1
  425. package/src/lib/compare.ts +9 -0
  426. package/src/lib/log.ts +17 -15
  427. package/src/models/accounting.ts +34 -0
  428. package/src/models/budget-protection.ts +1 -0
  429. package/src/models/catalog.ts +500 -0
  430. package/src/models/cost-coefficients.ts +116 -27
  431. package/src/models/gateway-cost.ts +32 -0
  432. package/src/models/local-profile.ts +14 -8
  433. package/src/models/open-model.ts +70 -0
  434. package/src/models/profiles.ts +17 -4
  435. package/src/models/structured.ts +2 -10
  436. package/src/models/supported-models.ts +7 -5
  437. package/src/pipeline.ts +45 -19
  438. package/src/probes/adapter.ts +138 -0
  439. package/src/probes/adapters/cli-agents.ts +123 -0
  440. package/src/probes/adapters/cli-claude-code.ts +119 -0
  441. package/src/probes/adapters/cli-codex.ts +145 -0
  442. package/src/probes/adapters/cli-cursor.ts +95 -0
  443. package/src/probes/adapters/cli-process.ts +522 -0
  444. package/src/probes/adapters/dataforseo-ai-mode.ts +146 -0
  445. package/src/probes/adapters/dataforseo-ai-overview.ts +106 -0
  446. package/src/probes/adapters/dataforseo-chatgpt-app.ts +115 -0
  447. package/src/probes/adapters/gateway-chat.ts +453 -0
  448. package/src/probes/adapters/gateway-perplexity.ts +104 -0
  449. package/src/probes/agent-clis.ts +151 -1088
  450. package/src/probes/answer-text.ts +153 -0
  451. package/src/probes/attempt.ts +463 -0
  452. package/src/probes/bindings.ts +761 -0
  453. package/src/probes/charged-trace.ts +69 -13
  454. package/src/probes/chat-retrieval.ts +67 -0
  455. package/src/probes/dataforseo-locale.ts +153 -22
  456. package/src/probes/dataforseo.ts +474 -178
  457. package/src/probes/grounding-urls.ts +68 -19
  458. package/src/probes/legacy-bindings.ts +41 -0
  459. package/src/probes/limits.ts +31 -18
  460. package/src/probes/probe-trace.ts +13 -0
  461. package/src/probes/probes.ts +76 -738
  462. package/src/probes/web-tool-guard.ts +18 -8
  463. package/src/report/core/progress-comparison.ts +158 -44
  464. package/src/report/core/progress-schema.ts +25 -3
  465. package/src/report/core/progress-statistics.ts +194 -0
  466. package/src/report/core/rate-interval.ts +24 -0
  467. package/src/report/core/retrieval.ts +18 -4
  468. package/src/report/core/schema.ts +79 -4
  469. package/src/report/core/surfaces.ts +100 -9
  470. package/src/runner.ts +72 -4
  471. package/src/schema.ts +78 -17
  472. package/src/section-result.ts +141 -23
  473. package/src/stores/files.ts +78 -54
  474. package/src/stores/memory.ts +4 -1
  475. package/src/stores/ports.ts +3 -0
  476. package/src/stores/unit-record.ts +151 -0
  477. package/src/viewer/page.ts +126 -5
  478. package/dist/lib/chunks/chunk-AASWJR7Q.js +0 -42
  479. package/dist/lib/chunks/chunk-BGAHZIL3.js +0 -563
  480. package/dist/lib/chunks/chunk-DVFFYY5G.js +0 -74
  481. package/dist/lib/chunks/chunk-IB6RROHE.js +0 -204
  482. package/dist/lib/chunks/chunk-NH4QGBJV.js +0 -61
  483. package/dist/lib/chunks/chunk-WZGI7UVM.js +0 -937
@@ -0,0 +1,10 @@
1
+ import type { AeoApiSurface } from '../../surfaces';
2
+ import { type ChatModelProvider, type ProbeAdapter, type ProbeAdapterProfile } from '../adapter';
3
+ export declare const gatewayPerplexityProfile: ProbeAdapterProfile;
4
+ /** createGatewayPerplexityAdapter asks `model` on `surface` through the
5
+ * run's `gateway`. */
6
+ export declare const createGatewayPerplexityAdapter: ({ surface, gateway, model, }: {
7
+ surface: AeoApiSurface;
8
+ gateway: ChatModelProvider;
9
+ model: string;
10
+ }) => ProbeAdapter;
@@ -1,9 +1,11 @@
1
1
  import type { AeoAgentSurface, RetrievalLog } from '../schema';
2
+ import { type AgentAnswer, type AgentFailure, type AgentRuntime } from './adapters/cli-process';
2
3
  import type { ProbePromptInput, ProbeResult } from './probes';
3
- import { type ProbeFailureKind } from './failure';
4
4
  import { type ProbeLimiter } from './limits';
5
5
  import type { ProbeOutcome } from './outcomes';
6
6
  import { type ProbeTrace } from './probe-trace';
7
+ export type { AgentAnswer, AgentFailure, AgentRuntime, CliFailureSignals, } from './adapters/cli-process';
8
+ export { classifyAgentError, claudeTranscriptDir, cliFailureSignals, describeCliFailure, } from './adapters/cli-process';
7
9
  export type AgentProbeResult = {
8
10
  modelName: AeoAgentSurface;
9
11
  usedWebSearch: boolean | null;
@@ -21,14 +23,10 @@ export type AgentProbeBatch = {
21
23
  outcomes: AgentProbeOutcome[];
22
24
  rejectedWebToolSurfaces: AeoAgentSurface[];
23
25
  };
24
- export type AgentRuntime = {
25
- env: NodeJS.ProcessEnv;
26
- claudeConfigDir: string | null;
27
- timeoutMs?: number;
28
- };
29
26
  export declare const defaultAgentRuntime: (env?: NodeJS.ProcessEnv) => AgentRuntime;
30
- /** Detects which agent CLIs are installed and their versions. */
31
- export declare const detectAgentClis: () => Promise<AgentCliVersions>;
27
+ /** Detects which agent CLIs the runtime can start, and their versions:
28
+ * through its worker transport when it has one, else on this machine. */
29
+ export declare const detectAgentClis: (runtime?: AgentRuntime) => Promise<AgentCliVersions>;
32
30
  export declare const versionForSurface: (surface: AeoAgentSurface, versions: AgentCliVersions) => string | null;
33
31
  /**
34
32
  * Pre-flight (correctness spec §3.6): every agent surface in scope needs its
@@ -41,16 +39,9 @@ export declare const agentAuthEnv: Readonly<Record<AeoAgentSurface, {
41
39
  anyOf: readonly string[];
42
40
  purpose: string;
43
41
  }>>;
44
- export declare const assertAgentAuth: (surfaces: readonly AeoAgentSurface[], env: NodeJS.ProcessEnv) => void;
42
+ export declare const assertAgentAuth: (surfaces: readonly AeoAgentSurface[], { env, transport }: AgentRuntime) => void;
45
43
  /** The CLI binary behind a surface, for pre-flight messages. */
46
44
  export declare const cliNameForSurface: (surface: AeoAgentSurface) => string;
47
- type AgentAnswer = {
48
- text: string;
49
- usedWebSearch: boolean | null;
50
- retrieval: RetrievalLog;
51
- requestedModel?: string | null;
52
- reportedModel?: string;
53
- };
54
45
  export declare const canaryPrompt = "Reply with the single word OK and nothing else. Do not search the web.";
55
46
  /**
56
47
  * Canary pre-flight (§4.5): one cheap probe per agent surface in scope, so
@@ -91,42 +82,9 @@ export declare const runAgentProbesForPrompts: (args: {
91
82
  signal?: AbortSignal;
92
83
  logContext?: Record<string, unknown>;
93
84
  }) => Promise<AgentProbeBatch>;
94
- export type AgentFailure = {
95
- kind: ProbeFailureKind;
96
- message: string;
97
- };
98
- export declare const classifyAgentError: (error: unknown) => AgentFailure;
99
- export type CliFailureSignals = {
100
- detail: string;
101
- errorTexts: string[];
102
- };
103
- /**
104
- * What the CLI said about its own failure: the last event it marked as an
105
- * error, otherwise stderr when it wrote anything, otherwise the last message
106
- * in its NDJSON stdout (the `result`, an error string, or the last text
107
- * block), otherwise the raw stdout tail. Error events come before stderr
108
- * because Codex always writes a stdin notice there, even when the real error
109
- * is a structured event.
110
- */
111
- export declare const cliFailureSignals: (output: {
112
- code: number | null;
113
- signal?: NodeJS.Signals | null;
114
- stdout: string;
115
- stderr: string;
116
- }) => CliFailureSignals;
117
- /** Log line for a failed CLI run; empty when there is nothing to say. */
118
- export declare const describeCliFailure: (output: {
119
- code: number | null;
120
- signal?: NodeJS.Signals | null;
121
- stdout: string;
122
- stderr: string;
123
- }) => string;
124
- /** Where Claude Code keeps the transcript of a session run in `cwd`. */
125
- export declare const claudeTranscriptDir: (env: NodeJS.ProcessEnv, cwd: string) => string;
126
85
  /** Called only inside a fixed isolated worker, or by the local CLI path. */
127
86
  export declare const runAgentProbeDirect: (surface: AeoAgentSurface, { prompt, runtime, signal, }: {
128
87
  prompt: string;
129
88
  runtime: AgentRuntime;
130
89
  signal?: AbortSignal;
131
90
  }) => Promise<AgentAnswer>;
132
- export {};
@@ -0,0 +1,20 @@
1
+ import type { RetrievalLog } from '../schema';
2
+ import type { ProbeAnswer } from './adapter';
3
+ import { type RedirectResolution } from './grounding-urls';
4
+ export declare const searchSourcesMarker = "Sources used by search:";
5
+ export declare const aiOverviewSourcesMarker = "Sources cited in AI Overview:";
6
+ /** renderAnswer is the answer's text with its source block. */
7
+ export declare const renderAnswer: (answer: ProbeAnswer) => string;
8
+ export type FinalAnswer = {
9
+ text: string;
10
+ retrieval: RetrievalLog | null;
11
+ /** Every redirect resolution attempted, for the journal; empty when the
12
+ * answer named no wrapper or the adapter keeps them. */
13
+ redirects: RedirectResolution[];
14
+ };
15
+ /** finalizeAnswer renders, strips U+0000 and resolves redirects, in that
16
+ * order. */
17
+ export declare const finalizeAnswer: (answer: ProbeAnswer, { resolvesRedirects, logContext, }: {
18
+ resolvesRedirects: boolean;
19
+ logContext?: Record<string, unknown>;
20
+ }) => Promise<FinalAnswer>;
@@ -0,0 +1,113 @@
1
+ import type { Log } from '../lib/log';
2
+ import type { RetrievalLog } from '../schema';
3
+ import type { ProbeAdapter, ProbeAnswer } from './adapter';
4
+ import { type ProbeFailureKind, type RetryPolicy } from './failure';
5
+ import { type ProbeLimiter } from './limits';
6
+ import type { ProbeOutcome } from './outcomes';
7
+ import { type ProbeAttemptHandle, type ProbeTrace } from './probe-trace';
8
+ type AttemptRules = {
9
+ /** The family's name in log lines. */
10
+ label: string;
11
+ policy: Readonly<Record<ProbeFailureKind, RetryPolicy>>;
12
+ /** ±20% on every retry delay, so units that failed together do not all
13
+ * retry in the same second. */
14
+ jitter: boolean;
15
+ /** Whether the attempt takes a slot on its adapter's pool. */
16
+ pooled: boolean;
17
+ completedLevel: 'debug' | 'info';
18
+ };
19
+ export declare const attemptRules: {
20
+ readonly chat: {
21
+ readonly label: "Probe";
22
+ readonly policy: Readonly<Record<"timeout" | "capacity" | "auth" | "cli_error" | "rejected_web_tool" | "parser" | "empty_answer" | "persistence", RetryPolicy>>;
23
+ readonly jitter: true;
24
+ readonly pooled: true;
25
+ readonly completedLevel: "debug";
26
+ };
27
+ readonly agent: {
28
+ readonly label: "Agent probe";
29
+ readonly policy: Readonly<Record<"timeout" | "capacity" | "auth" | "cli_error" | "rejected_web_tool" | "parser" | "empty_answer" | "persistence", RetryPolicy>>;
30
+ readonly jitter: true;
31
+ readonly pooled: true;
32
+ readonly completedLevel: "info";
33
+ };
34
+ readonly canary: {
35
+ readonly label: "Canary probe";
36
+ readonly policy: Readonly<Record<"timeout" | "capacity" | "auth" | "cli_error" | "rejected_web_tool" | "parser" | "empty_answer" | "persistence", RetryPolicy>>;
37
+ readonly jitter: false;
38
+ readonly pooled: false;
39
+ readonly completedLevel: "info";
40
+ };
41
+ };
42
+ /** What the journal names an attempt by. */
43
+ export type AttemptUnit = {
44
+ promptId: string;
45
+ promptText: string;
46
+ runIndex: number;
47
+ };
48
+ export type AttemptHost = {
49
+ rules: AttemptRules;
50
+ trace?: ProbeTrace;
51
+ /** Required unless the rules take no pool. */
52
+ limiter?: ProbeLimiter;
53
+ signal?: AbortSignal;
54
+ log: Log;
55
+ logContext: Record<string, unknown>;
56
+ };
57
+ export type AttemptResult = {
58
+ status: 'answered';
59
+ answer: ProbeAnswer;
60
+ attempts: number;
61
+ durationMs: number;
62
+ /** The answered attempt's open operation; the caller ends it. */
63
+ handle: ProbeAttemptHandle | undefined;
64
+ } | {
65
+ status: 'failed';
66
+ kind: ProbeFailureKind;
67
+ lastError: string;
68
+ attempts: number;
69
+ /** The last error thrown, when one was: a provider error, or the
70
+ * ProbeTraceError of an operation that could not be opened. */
71
+ cause?: unknown;
72
+ };
73
+ /**
74
+ * requestedModelOf is the model a probe asked for: the model its binding
75
+ * pins for a model API; otherwise the one the answer names (Codex learns
76
+ * it only when it answers); otherwise none.
77
+ */
78
+ export declare const requestedModelOf: (bound: {
79
+ model?: string;
80
+ }, answeredModel?: string | null) => string | null;
81
+ /**
82
+ * runProbeAttempts asks `adapter` until it answers or its retry policy is
83
+ * spent. Each attempt opens its operation inside the pool slot, so the
84
+ * operation starts when the request does, and before it: no dispatch goes
85
+ * unrecorded. An answered attempt's operation is left open for the caller,
86
+ * who finalises the answer before ending it.
87
+ */
88
+ export declare const runProbeAttempts: (adapter: ProbeAdapter, unit: AttemptUnit, host: AttemptHost) => Promise<AttemptResult>;
89
+ /** reportedModelOf applies the adapter's served-model rule. */
90
+ export declare const reportedModelOf: (adapter: ProbeAdapter, answer: ProbeAnswer) => string | undefined;
91
+ /** A unit's answer as it is banked and journaled. */
92
+ export type BankedAnswer = {
93
+ text: string;
94
+ retrieval: RetrievalLog | null;
95
+ requestedModel: string | null;
96
+ reportedModel?: string;
97
+ noOverview?: true;
98
+ usedWebSearch?: boolean | null;
99
+ };
100
+ export type UnitHost<P> = AttemptHost & {
101
+ /** The banked result of an answer. */
102
+ toResult: (answer: BankedAnswer) => P;
103
+ /** Banks a captured result. A throw fails the unit as `persistence`; the
104
+ * probe is never dispatched again (hardening spec §4.2). */
105
+ bank?: (result: P) => Promise<void>;
106
+ };
107
+ /**
108
+ * runProbeUnit runs one planned unit to exactly one outcome: its answer
109
+ * finalised, its operation ended with what is banked, and the result
110
+ * banked; or the typed failure that stopped it.
111
+ */
112
+ export declare const runProbeUnit: <P>(adapter: ProbeAdapter, unit: AttemptUnit, host: UnitHost<P>) => Promise<ProbeOutcome<P>>;
113
+ export {};
@@ -0,0 +1,168 @@
1
+ import type { CapturedUnitRecord } from '../stores/ports';
2
+ import type { CatalogModel } from '../models/catalog';
3
+ import { type Range } from '../models/cost-coefficients';
4
+ import { type AeoApiSurface, type AeoBuiltInSurface, type AeoConsumerSurface, type AeoCustomSurface, type AeoDefaultSurface, type AeoSurface } from '../surfaces';
5
+ import { ProbeAdapterId, type ChatModelProvider, type ProbeAdapter, type ProbeAdapterProfile } from './adapter';
6
+ import { type DataForSeoProbeClient } from './dataforseo';
7
+ import { type ProbeBinding } from './legacy-bindings';
8
+ export type { ProbeBinding };
9
+ /** A run's frozen bindings: one per default surface, and one per consumer
10
+ * app the audit lists and per custom surface it declares. */
11
+ export type RunBindings = Readonly<Record<AeoDefaultSurface, ProbeBinding>> & Readonly<Partial<Record<AeoConsumerSurface, ProbeBinding>>> & {
12
+ readonly [custom: AeoCustomSurface]: ProbeBinding;
13
+ };
14
+ /** The binding a run froze for `surface`. A custom surface the bindings do
15
+ * not hold was never declared, and a consumer app they do not hold is one
16
+ * the run directory started without: the plan would contain neither. */
17
+ export declare const bindingOf: (bindings: RunBindings, surface: AeoSurface) => ProbeBinding;
18
+ /** A surface's binding as of 0.2.0; a consumer or custom surface has
19
+ * none. */
20
+ export declare const legacyBindingOf: (surface: AeoSurface) => ProbeBinding | undefined;
21
+ /**
22
+ * Thrown before any dispatch when a run's frozen bindings cannot be
23
+ * honoured: a binding the installed engine cannot build, or a banked answer
24
+ * taken with another adapter. The run stops resumable (exit 2); nothing is
25
+ * probed under a binding the run did not freeze.
26
+ */
27
+ export declare class RunBindingsError extends Error {
28
+ constructor(message: string);
29
+ }
30
+ /**
31
+ * What a run hands its adapters (probe adapters spec §3.1): everything an
32
+ * adapter needs is passed in when it is created, never read from the
33
+ * environment or a module global.
34
+ */
35
+ export type ProbeDependencies = {
36
+ /** The run's frozen bindings: which adapter measures each surface. */
37
+ bindings: RunBindings;
38
+ /** The run's gateway provider, created with its own key. */
39
+ gateway: ChatModelProvider;
40
+ /** The run's DataForSEO client; absent when the run has no credentials,
41
+ * which fails each AI Overview probe as an auth failure. */
42
+ dataForSeo?: DataForSeoProbeClient;
43
+ /** Adapters beyond the engine's own: consulted first for a chat surface,
44
+ * with the binding the run froze for it. A host or a test registers one
45
+ * here; nothing in the engine changes to add it. */
46
+ registry?: ChatAdapterRegistry;
47
+ };
48
+ /** An adapter for `surface` under `binding`, or undefined to leave it to
49
+ * the engine's own adapters. */
50
+ export type ChatAdapterRegistry = (surface: AeoApiSurface, binding: ProbeBinding) => ProbeAdapter | undefined;
51
+ /**
52
+ * probeDependenciesOf creates a run's probe clients from its settings, for
53
+ * the local run and for a host alike: the engine builds the gateway with its
54
+ * own pinned provider package, which shapes every probe request. The
55
+ * gateway key is required: without one, the provider package would look
56
+ * for a key in the process environment on its own. The DataForSEO client is
57
+ * absent when its credentials are not set; preflight requires them for
58
+ * every surface in scope.
59
+ */
60
+ export declare const probeDependenciesOf: (env: NodeJS.ProcessEnv, bindings: RunBindings) => ProbeDependencies;
61
+ /**
62
+ * The bindings a new run freezes (method release spec §4): each API chat
63
+ * surface asks the gateway model closest to what its consumer product
64
+ * serves the free tier by default, as each vendor's own pages said on
65
+ * 10 November 2026. Where a vendor names no model or no version, the
66
+ * comment says so. The methodology section names each as the nearest match,
67
+ * not the same product. The other surfaces keep their legacy binding.
68
+ */
69
+ export declare const defaultBindingsChosenOn = "2026-11-10";
70
+ export declare const defaultProbeBindings: Readonly<Record<AeoDefaultSurface, ProbeBinding>>;
71
+ /**
72
+ * The binding of each consumer app (method release spec §5): a scrape has
73
+ * no model to name, so each has exactly one. A run freezes it only for an
74
+ * app its audit lists, so a run that lists none freezes what it always
75
+ * did, and a later version of a scrape never strands a directory that
76
+ * measured no app.
77
+ */
78
+ export declare const consumerProbeBindings: Readonly<Record<AeoConsumerSurface, ProbeBinding>>;
79
+ /** The engine's own binding of a built-in surface. */
80
+ export declare const ownBindingOf: (surface: AeoBuiltInSurface) => ProbeBinding;
81
+ /** Every registered adapter's profile, by ID. */
82
+ export declare const probeAdapterProfiles: Readonly<Record<ProbeAdapterId, ProbeAdapterProfile>>;
83
+ /** The profile of the adapter a binding names. */
84
+ export declare const profileOf: (binding: ProbeBinding) => ProbeAdapterProfile;
85
+ /** The API chat surfaces: the ones a model can be swapped behind. */
86
+ export declare const modelBoundSurfaces: readonly ["chatgpt", "gemini", "claude", "perplexity"];
87
+ export type ModelBoundSurface = (typeof modelBoundSurfaces)[number];
88
+ /** The adapters that ask a gateway model: the ones a model override can
89
+ * name or infer. */
90
+ export declare const modelAdapterIds: readonly ["gateway.openai@1", "gateway.openai@2", "gateway.google@1", "gateway.anthropic@1", "gateway.anthropic@2", "gateway.perplexity@1", "gateway.search@1"];
91
+ type ModelAdapterId = (typeof modelAdapterIds)[number];
92
+ /** What audit.json's `probes` asks for one surface. */
93
+ export type ProbeOverride = {
94
+ model: string;
95
+ adapter?: ModelAdapterId;
96
+ };
97
+ export type ProbeOverrides = Partial<Record<ModelBoundSurface, ProbeOverride>>;
98
+ /** A custom surface as audit.json declares it. */
99
+ export type CustomSurfaceDeclaration = ProbeOverride & {
100
+ key: string;
101
+ };
102
+ /** The ID of the custom surface declared under `key`. */
103
+ export declare const customSurfaceId: (key: string) => AeoCustomSurface;
104
+ /**
105
+ * requestedBindingsOf is the bindings a new run freezes: the defaults, with
106
+ * each override's model behind its surface, one binding per declared
107
+ * custom surface, and the binding of each consumer app the audit lists. A
108
+ * built-in surface's adapter is the one the override names, or its
109
+ * provider's own search; a model of another provider, and every custom
110
+ * surface, searches through the gateway's own tool.
111
+ */
112
+ export declare const requestedBindingsOf: (overrides?: ProbeOverrides, custom?: readonly CustomSurfaceDeclaration[], consumerApps?: readonly AeoConsumerSurface[]) => RunBindings;
113
+ /** Whether the engine has its own cost figure for a binding: one of its
114
+ * default or legacy bindings. Any other is priced from the catalog. */
115
+ export declare const isOwnBinding: (binding: ProbeBinding) => boolean;
116
+ /** The models a run's bindings need a catalog price for. */
117
+ export declare const catalogPricedModels: (bindings: RunBindings, surfaces: readonly AeoSurface[]) => string[];
118
+ /**
119
+ * probeEstimateUsd is what one probe under `binding` is estimated and
120
+ * reserved at: the engine's flat figure for its own bindings, and for any
121
+ * other model the assumed usage of a probe at that model's catalog price.
122
+ */
123
+ export declare const probeEstimateUsd: (binding: ProbeBinding, priced: ReadonlyMap<string, CatalogModel>) => Range<number>;
124
+ /**
125
+ * availableBindings returns a run's frozen bindings once the installed
126
+ * engine can build every one of them, and otherwise names the binding the
127
+ * run needs.
128
+ */
129
+ export declare const availableBindings: (frozen: Readonly<Record<string, {
130
+ adapter: string;
131
+ model?: string;
132
+ }>>) => RunBindings;
133
+ /** The adapter a banked answer was captured with: the one its capture
134
+ * metadata names, or, when it names none, its surface's legacy adapter. */
135
+ export declare const capturedAdapterOf: (record: CapturedUnitRecord) => string | undefined;
136
+ /** The models `surface`'s captured answers were asked of, in ID order. */
137
+ export declare const askedModelsOn: (captured: readonly CapturedUnitRecord[], surface: AeoSurface) => string[];
138
+ /** The models `surface`'s captured answers were reported as answered by,
139
+ * in ID order: for a scraped consumer app, what the scraper read. */
140
+ export declare const reportedModelsOn: (captured: readonly CapturedUnitRecord[], surface: AeoSurface) => string[];
141
+ /**
142
+ * surfaceLabelOverrides names the model in the label of every surface whose
143
+ * captured answers were not asked of its default model (open models spec
144
+ * §4): the default label claims the free-tier pin. Every declared custom
145
+ * surface gets its own label. Empty for a run on the defaults, whose
146
+ * snapshot then carries no labels at all.
147
+ */
148
+ export declare const surfaceLabelOverrides: (captured: readonly CapturedUnitRecord[],
149
+ /** The custom surfaces the config declares, with their labels. */
150
+ declared?: readonly {
151
+ key: string;
152
+ label: string;
153
+ }[]) => Record<string, string>;
154
+ /**
155
+ * bankBindingMismatches lists the banked answers a run cannot reuse: those
156
+ * taken with another adapter than the surface's frozen binding, or asked of
157
+ * another model when the binding names one. Unit keys carry neither, so
158
+ * without this check a changed binding would reuse answers measured
159
+ * another way.
160
+ */
161
+ export declare const bankBindingMismatches: (records: readonly CapturedUnitRecord[], bindings: RunBindings) => CapturedUnitRecord[];
162
+ /** createChatAdapter is the adapter `surface` is bound to by default, asking
163
+ * in the run's market. */
164
+ export declare const createChatAdapter: (surface: AeoApiSurface, { geography, language, dependencies, }: {
165
+ geography: string;
166
+ language: string;
167
+ dependencies: ProbeDependencies;
168
+ }) => ProbeAdapter;
@@ -1,8 +1,15 @@
1
1
  import { ModelBudgetError, type ModelCallAccounting } from '../models/accounting';
2
+ import type { CatalogModel } from '../models/catalog';
3
+ import { type RunBindings } from './bindings';
2
4
  import type { ProbeTrace } from './probe-trace';
3
5
  export type ChargedTrace = {
4
6
  trace: ProbeTrace;
5
7
  /** The first refusal of the cap, once an attempt was refused. */
6
8
  exhausted: () => ModelBudgetError | undefined;
7
9
  };
8
- export declare const chargedProbeTrace: (trace: ProbeTrace, ledger: ModelCallAccounting) => ChargedTrace;
10
+ export declare const chargedProbeTrace: (trace: ProbeTrace, ledger: ModelCallAccounting, { bindings, priced, }: {
11
+ bindings: RunBindings;
12
+ /** The run's frozen catalog prices, for a binding the engine has no
13
+ * flat figure for. */
14
+ priced?: ReadonlyMap<string, CatalogModel>;
15
+ }) => ChargedTrace;
@@ -4,6 +4,8 @@ export type RetrievalStep = {
4
4
  };
5
5
  export declare const extractOpenAiRetrieval: (steps: ReadonlyArray<RetrievalStep>) => RetrievalLog;
6
6
  export declare const extractAnthropicRetrieval: (steps: ReadonlyArray<RetrievalStep>) => RetrievalLog;
7
+ export declare const gatewaySearchToolName = "perplexity_search";
8
+ export declare const extractGatewaySearchRetrieval: (steps: ReadonlyArray<RetrievalStep>) => RetrievalLog;
7
9
  export declare const extractGeminiRetrieval: (providerMetadata: unknown) => RetrievalLog;
8
10
  /** Every URL in a log's result sets, for redirect resolution. */
9
11
  export declare const retrievalResultUrls: (retrieval: RetrievalLog) => string[];
@@ -1,8 +1,24 @@
1
+ import type { AeoConsumerSurface } from '../surfaces';
1
2
  export declare const dataForSeoLocationCodes: Readonly<Record<string, number>>;
2
3
  export declare const dataForSeoLanguageCodes: Readonly<Record<string, string>>;
4
+ /** The markets an audit can name, for the message that refuses another. */
5
+ export declare const supportedMarkets: string;
3
6
  /** resolveDataForSeoLocale maps a config's market, or undefined when either
4
7
  * half has no code: the caller decides, never a silent default here. */
5
8
  export declare const resolveDataForSeoLocale: (geography: string, language: string) => {
6
9
  locationCode: number;
7
10
  languageCode: string;
8
11
  } | undefined;
12
+ type ConsumerScrapeMarkets = {
13
+ /** The location codes the scrape lists, or `null` when the vendor
14
+ * publishes no list of its own for it. */
15
+ locationCodes: ReadonlySet<number> | null;
16
+ languageCodes: ReadonlySet<string>;
17
+ };
18
+ export declare const consumerScrapeMarkets: Readonly<Record<AeoConsumerSurface, ConsumerScrapeMarkets>>;
19
+ /** consumerMarketProblem says why `surface` cannot be measured in a market,
20
+ * or undefined when DataForSEO lists both halves of it for that scrape. A
21
+ * market the tables above cannot place is refused on its own, for every
22
+ * surface DataForSEO places. */
23
+ export declare const consumerMarketProblem: (surface: AeoConsumerSurface, geography: string, language: string) => string | undefined;
24
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { resolveDataForSeoLocale } from './dataforseo-locale';
1
2
  export type AIOverviewReference = {
2
3
  source: string;
3
4
  domain: string;
@@ -12,4 +13,68 @@ export type AIOverviewOutcome = {
12
13
  } | {
13
14
  status: 'no_overview';
14
15
  };
15
- export declare const getGoogleAIOverview: (query: string, geography: string, language: string) => Promise<AIOverviewOutcome>;
16
+ /** What a paid response reported as its cost; null when it reported none. */
17
+ type ReportedCost = {
18
+ costUsd: number | null;
19
+ };
20
+ export type AiModeAnswer = ReportedCost & {
21
+ markdown: string;
22
+ references: AIOverviewReference[];
23
+ };
24
+ export type ChatGptAppSource = {
25
+ url: string;
26
+ title: string;
27
+ };
28
+ export type ChatGptAppAnswer = ReportedCost & {
29
+ /** The answer's prose and tables, in the order the page shows them. */
30
+ markdown: string;
31
+ /** The sources the vendor describes as cited or relied on. */
32
+ sources: ChatGptAppSource[];
33
+ /** The searches the answer ran, as a flat list; null when the response
34
+ * reported no list. */
35
+ fanOutQueries: string[] | null;
36
+ /** The model the scraper reports, verbatim; null when it names none. */
37
+ model: string | null;
38
+ };
39
+ /** Where a SERP is placed: a market resolveDataForSeoLocale mapped. */
40
+ export type DataForSeoLocale = NonNullable<ReturnType<typeof resolveDataForSeoLocale>>;
41
+ export type DataForSeoProbeClient = {
42
+ getGoogleAIOverview: (query: string, locale: DataForSeoLocale) => Promise<AIOverviewOutcome>;
43
+ getGoogleAiMode: (query: string, locale: DataForSeoLocale) => Promise<AiModeAnswer>;
44
+ getChatGptAnswer: (query: string, locale: DataForSeoLocale) => Promise<ChatGptAppAnswer>;
45
+ };
46
+ export declare const aiOverviewEndpoint = "/serp/google/organic/live/advanced";
47
+ /** aiOverviewTask is the SERP task an AI Overview probe sends. */
48
+ export declare const aiOverviewTask: (query: string, locale: DataForSeoLocale) => {
49
+ keyword: string;
50
+ language_code: string;
51
+ location_code: number;
52
+ load_async_ai_overview: boolean;
53
+ };
54
+ export declare const aiModeEndpoint = "/serp/google/ai_mode/live/advanced";
55
+ /** aiModeTask is the task an AI Mode probe sends. */
56
+ export declare const aiModeTask: (query: string, locale: DataForSeoLocale) => {
57
+ keyword: string;
58
+ language_code: string;
59
+ location_code: number;
60
+ };
61
+ export declare const chatGptEndpoint = "/ai_optimization/chat_gpt/llm_scraper/live/advanced";
62
+ /** chatGptTask is the task a ChatGPT probe sends: the web interface, with
63
+ * its search forced on, as every other surface is asked. */
64
+ export declare const chatGptTask: (query: string, locale: DataForSeoLocale) => {
65
+ keyword: string;
66
+ language_code: string;
67
+ location_code: number;
68
+ force_web_search: boolean;
69
+ };
70
+ /**
71
+ * createDataForSeoProbeClient is one run's DataForSEO client. Requests are
72
+ * spaced by the client's own throttle: callers queue behind one chain
73
+ * instead of all reading the last request time before any of them awaits
74
+ * (§3.5).
75
+ */
76
+ export declare const createDataForSeoProbeClient: ({ login, password, }: {
77
+ login: string;
78
+ password: string;
79
+ }) => DataForSeoProbeClient;
80
+ export {};
@@ -1,13 +1,26 @@
1
1
  import { groundingRedirectUrlPrefix, isGroundingRedirectUrl } from '../grounding';
2
2
  export { groundingRedirectUrlPrefix, isGroundingRedirectUrl };
3
3
  export declare const extractGroundingRedirectUrls: (text: string) => string[];
4
+ /** What resolving one wrapper URL found: its target, or why there is none,
5
+ * after how many requests. Recorded in the probe's journal operation. */
6
+ export type RedirectResolution = {
7
+ url: string;
8
+ target: string | null;
9
+ hops: number;
10
+ failure?: string;
11
+ };
4
12
  /**
5
- * Resolves every unique grounding-redirect URL in `urls` to its real target.
6
- * Returns a map of redirect URL → resolved URL; failures are simply absent
7
- * (callers keep the original URL), so a flaky redirect never fails a run.
8
- * Runs a sliding-window worker pool so one slow URL only delays its own
9
- * slot, not a whole batch.
13
+ * Resolves every unique grounding-redirect URL in `urls` to its real target
14
+ * and reports each attempt. `resolved` maps redirect URL → resolved URL;
15
+ * failures are absent from it (callers keep the original URL), so a flaky
16
+ * redirect never fails a run. Runs a sliding-window worker pool so one slow
17
+ * URL only delays its own slot, not a whole batch.
10
18
  */
19
+ export declare const traceGroundingRedirects: (urls: Iterable<string>, logContext?: Record<string, unknown>) => Promise<{
20
+ resolved: Map<string, string>;
21
+ resolutions: RedirectResolution[];
22
+ }>;
23
+ /** resolveGroundingRedirects is traceGroundingRedirects' map alone. */
11
24
  export declare const resolveGroundingRedirects: (urls: Iterable<string>, logContext?: Record<string, unknown>) => Promise<Map<string, string>>;
12
25
  /**
13
26
  * Replaces resolved redirect URLs inside free text in a single pass. Each
@@ -0,0 +1,36 @@
1
+ import { ProbeAdapterId } from './adapter';
2
+ export type ProbeBinding = {
3
+ adapter: ProbeAdapterId;
4
+ /** The model a model-API adapter asks for. */
5
+ model?: string;
6
+ };
7
+ export declare const legacyProbeBindings: {
8
+ readonly chatgpt: {
9
+ readonly adapter: "gateway.openai@1";
10
+ readonly model: "openai/gpt-5.4-mini";
11
+ };
12
+ readonly gemini: {
13
+ readonly adapter: "gateway.google@1";
14
+ readonly model: "google/gemini-3-flash";
15
+ };
16
+ readonly claude: {
17
+ readonly adapter: "gateway.anthropic@1";
18
+ readonly model: "anthropic/claude-sonnet-4.5";
19
+ };
20
+ readonly perplexity: {
21
+ readonly adapter: "gateway.perplexity@1";
22
+ readonly model: "perplexity/sonar-pro";
23
+ };
24
+ readonly google_ai_overview: {
25
+ readonly adapter: "dataforseo.ai_overview@1";
26
+ };
27
+ readonly claude_code: {
28
+ readonly adapter: "cli.claude_code@1";
29
+ };
30
+ readonly codex: {
31
+ readonly adapter: "cli.codex@1";
32
+ };
33
+ readonly cursor: {
34
+ readonly adapter: "cli.cursor@1";
35
+ };
36
+ };
@@ -11,18 +11,24 @@ export type ProbeLimits = z.infer<typeof probeLimitsSchema>;
11
11
  export type ProbeProvider = keyof ProbeLimits;
12
12
  type RunOptions = {
13
13
  signal?: AbortSignal;
14
+ /** A pause of its own the work also waits out, beside its pool's: one
15
+ * adapter's capacity pause, so a 429 on one surface never holds back
16
+ * another surface sharing the pool. */
17
+ pauseKey?: string;
14
18
  };
15
19
  export declare class ProbeLimiter {
16
20
  #private;
17
21
  constructor(limits: ProbeLimits);
18
22
  /**
19
- * Holds new work on the provider's pool for `delayMs`, extending any pause
20
- * already running. A rate-limited provider then sees one retry per window
21
- * instead of every queued unit spending an attempt on the same 429.
23
+ * Holds new work under `key` (a provider pool, or the pause key of one
24
+ * adapter) for `delayMs`, extending any pause already running. A
25
+ * rate-limited provider then sees one retry per window instead of every
26
+ * queued unit spending an attempt on the same 429.
22
27
  */
23
- pause(provider: ProbeProvider, delayMs: number): void;
24
- /** Runs `fn` once the provider is not paused and a slot on its pool is free. */
25
- run<T>(provider: ProbeProvider, fn: () => Promise<T>, { signal }?: RunOptions): Promise<T>;
28
+ pause(key: string, delayMs: number): void;
29
+ /** Runs `fn` once neither the provider nor the work's own pause key is
30
+ * paused and a slot on the provider's pool is free. */
31
+ run<T>(provider: ProbeProvider, fn: () => Promise<T>, { signal, pauseKey }?: RunOptions): Promise<T>;
26
32
  }
27
33
  /** An unbounded limiter for tests and one-off scripts. */
28
34
  export declare const unlimited: () => ProbeLimiter;