literally-aeo 0.2.1 → 0.3.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 (310) hide show
  1. package/dist/cli.mjs +6075 -5175
  2. package/dist/lib/agents/author-schema.js +5 -5
  3. package/dist/lib/agents/author-validation.js +9 -7
  4. package/dist/lib/agents/copy-validation.js +10 -10
  5. package/dist/lib/agents/copywriter-input.js +9 -9
  6. package/dist/lib/agents/facts.js +8 -8
  7. package/dist/lib/agents/narrative-facts.js +6 -6
  8. package/dist/lib/agents/verifier.js +14 -13
  9. package/dist/lib/analysis/domain-classifier.js +12 -10
  10. package/dist/lib/analysis/domain-labels.js +4 -4
  11. package/dist/lib/analysis/outreach.js +2 -2
  12. package/dist/lib/analysis/progress.js +9 -9
  13. package/dist/lib/analysis/retrieval.js +5 -5
  14. package/dist/lib/analysis/scoring.js +5 -5
  15. package/dist/lib/analysis/search-analyzer.js +6 -6
  16. package/dist/lib/analysis/sentiment.js +12 -10
  17. package/dist/lib/analysis/source-mix.js +2 -2
  18. package/dist/lib/author/examples.js +6 -6
  19. package/dist/lib/bundle/contracts.js +6 -6
  20. package/dist/lib/bundle/export.js +18 -18
  21. package/dist/lib/bundle/journal.js +7 -7
  22. package/dist/lib/bundle/project-journal.js +10 -10
  23. package/dist/lib/bundle/project.js +16 -16
  24. package/dist/lib/bundle/read.js +19 -19
  25. package/dist/lib/bundle/recorder.js +8 -8
  26. package/dist/lib/bundle/redact.js +7 -7
  27. package/dist/lib/bundle/trace-coverage.js +7 -7
  28. package/dist/lib/bundle/verify-integrity.js +9 -9
  29. package/dist/lib/bundle/verify-measurement.js +22 -13
  30. package/dist/lib/bundle/verify-report.js +24 -16
  31. package/dist/lib/bundle/verify.js +32 -24
  32. package/dist/lib/capture-manifest.js +6 -6
  33. package/dist/lib/checks/crawler-access.js +2 -2
  34. package/dist/lib/checks/money-pages.js +13 -0
  35. package/dist/lib/checks/renderability.js +2 -2
  36. package/dist/lib/checks/run-checks.js +12 -12
  37. package/dist/lib/chunks/{chunk-XAKME6NM.js → chunk-2C723CW7.js} +1 -1
  38. package/dist/lib/chunks/chunk-2FDSOZ6Q.js +287 -0
  39. package/dist/lib/chunks/{chunk-PWOYEIPF.js → chunk-2U5QSA6Q.js} +7 -7
  40. package/dist/lib/chunks/{chunk-6EI4CVRW.js → chunk-3ESH5NDR.js} +5 -1
  41. package/dist/lib/chunks/{chunk-7LBSNDRR.js → chunk-3S2FAVRE.js} +22 -3
  42. package/dist/lib/chunks/{chunk-LR27H2HZ.js → chunk-44NSZBCP.js} +6 -6
  43. package/dist/lib/chunks/{chunk-JBOOD6MU.js → chunk-4AWFF53U.js} +12 -4
  44. package/dist/lib/chunks/{chunk-MENTBQGB.js → chunk-4HPMLJKC.js} +4 -4
  45. package/dist/lib/chunks/{chunk-AAFHXNLU.js → chunk-4Q2WFZ5J.js} +11 -4
  46. package/dist/lib/chunks/{chunk-SD7LR26G.js → chunk-5JU2Y2I6.js} +2 -2
  47. package/dist/lib/chunks/{chunk-RPTADJXD.js → chunk-64JFN2Q5.js} +1 -1
  48. package/dist/lib/chunks/chunk-66UE4TT2.js +245 -0
  49. package/dist/lib/chunks/chunk-6N3C6E3D.js +105 -0
  50. package/dist/lib/chunks/{chunk-F2NSJ6PG.js → chunk-6RED3G6K.js} +7 -3
  51. package/dist/lib/chunks/{chunk-QJZTDZMB.js → chunk-7KLTOVIY.js} +9 -9
  52. package/dist/lib/chunks/{chunk-PXB4PWJI.js → chunk-7ZR3WDF2.js} +38 -5
  53. package/dist/lib/chunks/chunk-A5PF7UE2.js +86 -0
  54. package/dist/lib/chunks/{chunk-JXBLGCXZ.js → chunk-AB7DUTX5.js} +1 -1
  55. package/dist/lib/chunks/{chunk-WDT2Y7D7.js → chunk-AQCWKHTE.js} +11 -7
  56. package/dist/lib/chunks/{chunk-SQQ56UP2.js → chunk-ASHFEFCU.js} +3 -3
  57. package/dist/lib/chunks/{chunk-AK6YNTCV.js → chunk-ASIFUJG2.js} +1 -1
  58. package/dist/lib/chunks/{chunk-ZSEY7AHQ.js → chunk-BBK54RVK.js} +14 -11
  59. package/dist/lib/chunks/chunk-BQMUZLHO.js +17 -0
  60. package/dist/lib/chunks/{chunk-KSOHZKV5.js → chunk-CQNIPZH3.js} +21 -21
  61. package/dist/lib/chunks/{chunk-7HM6IZ3L.js → chunk-CVEXMYPW.js} +2 -2
  62. package/dist/lib/chunks/chunk-CXZIHHLJ.js +95 -0
  63. package/dist/lib/chunks/{chunk-75DMLOQ7.js → chunk-CYJNBVQB.js} +1 -1
  64. package/dist/lib/chunks/{chunk-FAUFE7MI.js → chunk-D7N5OLYL.js} +1 -1
  65. package/dist/lib/chunks/{chunk-E2YTTB6Q.js → chunk-DSK3PM4Z.js} +1 -1
  66. package/dist/lib/chunks/{chunk-TNL2GWYR.js → chunk-EUXNCXCR.js} +22 -0
  67. package/dist/lib/chunks/{chunk-FJL2V6P5.js → chunk-F4EQULFR.js} +6 -6
  68. package/dist/lib/chunks/{chunk-QGZ4QSUE.js → chunk-FHV4PBYG.js} +1 -1
  69. package/dist/lib/chunks/chunk-FK2JQHAX.js +30 -0
  70. package/dist/lib/chunks/{chunk-K2FZFESR.js → chunk-FONFW67K.js} +4 -4
  71. package/dist/lib/chunks/{chunk-W5X7WJYL.js → chunk-FPPHYGIO.js} +3 -3
  72. package/dist/lib/chunks/{chunk-XNTFOVCE.js → chunk-FYE4R5TY.js} +2 -2
  73. package/dist/lib/chunks/{chunk-FIC7JSR4.js → chunk-H2DOBJZC.js} +2 -2
  74. package/dist/lib/chunks/{chunk-R2AJYV6A.js → chunk-HEWHNSDP.js} +68 -36
  75. package/dist/lib/chunks/{chunk-RXSHKWZJ.js → chunk-HLC6OHGO.js} +2 -2
  76. package/dist/lib/chunks/{chunk-6HMHXSCS.js → chunk-HXXFRZTJ.js} +2 -2
  77. package/dist/lib/chunks/{chunk-JYFEXVWC.js → chunk-HYMWNGOK.js} +13 -6
  78. package/dist/lib/chunks/chunk-IH67TEGY.js +73 -0
  79. package/dist/lib/chunks/{chunk-JKPBXPCW.js → chunk-IMADI2YP.js} +1 -1
  80. package/dist/lib/chunks/{chunk-SLAPBFRH.js → chunk-JBGQFPTY.js} +4 -4
  81. package/dist/lib/chunks/{chunk-JQDQVG3D.js → chunk-JDU3ZCKO.js} +1 -1
  82. package/dist/lib/chunks/{chunk-2KH7LNK7.js → chunk-JGIX427K.js} +7 -7
  83. package/dist/lib/chunks/{chunk-7CW6U5WJ.js → chunk-JIE2ANVD.js} +1 -1
  84. package/dist/lib/chunks/{chunk-T5XQ6NXD.js → chunk-JJFOILZK.js} +2 -2
  85. package/dist/lib/chunks/{chunk-F7DBTXKG.js → chunk-JMIK2QN3.js} +4 -3
  86. package/dist/lib/chunks/chunk-JW7DTYSI.js +116 -0
  87. package/dist/lib/chunks/{chunk-BFWK3TBN.js → chunk-JXLCKACO.js} +2 -2
  88. package/dist/lib/chunks/{chunk-7WO3FFPS.js → chunk-K5NQDJLE.js} +1 -1
  89. package/dist/lib/chunks/{chunk-BXF4OC74.js → chunk-KI2FB4Y3.js} +30 -16
  90. package/dist/lib/chunks/{chunk-Y2CZ6FZY.js → chunk-KRWDELRS.js} +30 -7
  91. package/dist/lib/chunks/{chunk-SIJOQRRK.js → chunk-KRXOJJR7.js} +1 -1
  92. package/dist/lib/chunks/chunk-KSUI4DAY.js +15 -0
  93. package/dist/lib/chunks/chunk-KXFZ3CH3.js +98 -0
  94. package/dist/lib/chunks/{chunk-3OWJBGQE.js → chunk-LJCWZ5SZ.js} +14 -14
  95. package/dist/lib/chunks/{chunk-AJKV46SM.js → chunk-LNYQMWJO.js} +3 -3
  96. package/dist/lib/chunks/{chunk-DL6YQDTE.js → chunk-LOIAGEKN.js} +2 -2
  97. package/dist/lib/chunks/{chunk-I3UE52ZV.js → chunk-LPOIMPJK.js} +2 -2
  98. package/dist/lib/chunks/{chunk-66T7JC57.js → chunk-LUKP64NX.js} +2 -2
  99. package/dist/lib/chunks/chunk-MNG5TZRW.js +208 -0
  100. package/dist/lib/chunks/{chunk-SMPP7B7F.js → chunk-MPQXB7HN.js} +7 -7
  101. package/dist/lib/chunks/{chunk-6JICXLDA.js → chunk-MZ2KN3IH.js} +3 -3
  102. package/dist/lib/chunks/chunk-N62G4EWT.js +91 -0
  103. package/dist/lib/chunks/{chunk-7YDXD4MD.js → chunk-ODIXZHHX.js} +1 -1
  104. package/dist/lib/chunks/{chunk-MTDYBJXH.js → chunk-OTVHGRCO.js} +8 -8
  105. package/dist/lib/chunks/{chunk-YZEZRQIG.js → chunk-OVF27NAO.js} +69 -17
  106. package/dist/lib/chunks/chunk-P6LHGBYU.js +90 -0
  107. package/dist/lib/chunks/{chunk-U5USH2HB.js → chunk-PAL5SXIP.js} +1 -1
  108. package/dist/lib/chunks/{chunk-W5XYW6ZM.js → chunk-PT6PK2MJ.js} +26 -19
  109. package/dist/lib/chunks/{chunk-OD36HUXA.js → chunk-Q22FCF4A.js} +6 -7
  110. package/dist/lib/chunks/chunk-QKTKQSPS.js +292 -0
  111. package/dist/lib/chunks/{chunk-K4Y5NT4M.js → chunk-QO5TPMWS.js} +2 -2
  112. package/dist/lib/chunks/{chunk-VPXYGN4I.js → chunk-QUZYFAGP.js} +17 -22
  113. package/dist/lib/chunks/{chunk-HI3PD3KR.js → chunk-QVMPTT7R.js} +5 -5
  114. package/dist/lib/chunks/{chunk-OQFAMKLN.js → chunk-RGZY6YUQ.js} +5 -5
  115. package/dist/lib/chunks/{chunk-U6BW6LGX.js → chunk-RM2VVR7Y.js} +1 -1
  116. package/dist/lib/chunks/{chunk-AJO7XVXK.js → chunk-RMSH7RUG.js} +6 -6
  117. package/dist/lib/chunks/{chunk-V5B6UZ3E.js → chunk-RQGEPR6V.js} +1 -0
  118. package/dist/lib/chunks/{chunk-V5JJEEBT.js → chunk-RYB77E7O.js} +6 -5
  119. package/dist/lib/chunks/chunk-S24JGY7B.js +97 -0
  120. package/dist/lib/chunks/{chunk-6GKKALCI.js → chunk-SF4UJ2AY.js} +1 -1
  121. package/dist/lib/chunks/chunk-SJCUR4QX.js +94 -0
  122. package/dist/lib/chunks/{chunk-XAN4CRFP.js → chunk-SQ55KGHO.js} +1 -1
  123. package/dist/lib/chunks/{chunk-66DVMLGR.js → chunk-TKOQMB6A.js} +7 -7
  124. package/dist/lib/chunks/{chunk-UYDQXXDQ.js → chunk-TWK6IA4P.js} +1 -1
  125. package/dist/lib/chunks/{chunk-DVFFYY5G.js → chunk-U42I3SBR.js} +13 -9
  126. package/dist/lib/chunks/{chunk-FL6LN2K6.js → chunk-UECQONVZ.js} +5 -5
  127. package/dist/lib/chunks/{chunk-FDM2YNQL.js → chunk-VTY53IFN.js} +1 -1
  128. package/dist/lib/chunks/chunk-VYUC772A.js +338 -0
  129. package/dist/lib/chunks/{chunk-WCLKIPJV.js → chunk-WPCBE2NZ.js} +1 -1
  130. package/dist/lib/chunks/{chunk-3OE4UQIB.js → chunk-WRHGLRUK.js} +5 -5
  131. package/dist/lib/chunks/{chunk-3GPUCXVA.js → chunk-WUIY7BXR.js} +36 -19
  132. package/dist/lib/chunks/{chunk-7YYDUHJG.js → chunk-WZA4H4TG.js} +39 -13
  133. package/dist/lib/chunks/{chunk-NH4QGBJV.js → chunk-XBSA7MNJ.js} +7 -2
  134. package/dist/lib/chunks/chunk-XTBCXEH7.js +243 -0
  135. package/dist/lib/chunks/{chunk-ZQ3ER7JD.js → chunk-YPVJAXPP.js} +1 -1
  136. package/dist/lib/chunks/{chunk-SASE7U6E.js → chunk-YQD5ITKI.js} +1 -1
  137. package/dist/lib/chunks/{chunk-DDS4G4DO.js → chunk-YY4BH5XM.js} +6 -6
  138. package/dist/lib/chunks/{chunk-J5NPHPXY.js → chunk-Z3BZRBQF.js} +36 -2
  139. package/dist/lib/chunks/{chunk-XFUYEFQP.js → chunk-ZBQU2VU3.js} +1 -1
  140. package/dist/lib/chunks/{chunk-E3OGPTUY.js → chunk-ZHGABG7L.js} +2 -2
  141. package/dist/lib/chunks/chunk-ZZCRYG36.js +31 -0
  142. package/dist/lib/cli/bundle-commands.js +91 -74
  143. package/dist/lib/cli/run-commands.js +141 -96
  144. package/dist/lib/cli/status-command.js +77 -60
  145. package/dist/lib/codex-workflow/aggregate.js +20 -12
  146. package/dist/lib/codex-workflow/author-tools.js +7 -7
  147. package/dist/lib/codex-workflow/author.js +25 -23
  148. package/dist/lib/codex-workflow/capture.js +39 -18
  149. package/dist/lib/codex-workflow/checkpoint.js +7 -7
  150. package/dist/lib/codex-workflow/checks.js +9 -9
  151. package/dist/lib/codex-workflow/copy-editor.js +20 -19
  152. package/dist/lib/codex-workflow/copy-recovery.js +4 -4
  153. package/dist/lib/codex-workflow/copy.js +17 -16
  154. package/dist/lib/codex-workflow/finish.js +29 -25
  155. package/dist/lib/codex-workflow/host-models.js +2 -2
  156. package/dist/lib/codex-workflow/loop.js +54 -48
  157. package/dist/lib/codex-workflow/quality.js +4 -4
  158. package/dist/lib/codex-workflow/run-inputs.js +6 -6
  159. package/dist/lib/codex-workflow/run-source.js +16 -16
  160. package/dist/lib/codex-workflow/schemas.js +6 -6
  161. package/dist/lib/codex-workflow/session.js +8 -8
  162. package/dist/lib/codex-workflow/stage.js +32 -29
  163. package/dist/lib/codex-workflow/workdir.js +18 -11
  164. package/dist/lib/engine/audit-file.js +9 -8
  165. package/dist/lib/engine/author.js +40 -37
  166. package/dist/lib/engine/cost-estimate.js +37 -9
  167. package/dist/lib/engine/local-run.js +76 -59
  168. package/dist/lib/engine/preflight.js +37 -9
  169. package/dist/lib/engine/rejudge.js +82 -65
  170. package/dist/lib/engine/run-bindings.js +62 -0
  171. package/dist/lib/engine/run-status.js +77 -60
  172. package/dist/lib/engine/templates.js +10 -9
  173. package/dist/lib/grounding/controller.js +8 -7
  174. package/dist/lib/grounding/extract.js +8 -6
  175. package/dist/lib/grounding/grounding-runtime.js +22 -21
  176. package/dist/lib/grounding/model-usage.js +2 -2
  177. package/dist/lib/grounding/model.js +7 -5
  178. package/dist/lib/grounding/recorded-tools.js +9 -9
  179. package/dist/lib/harness/report/artifacts.js +5 -5
  180. package/dist/lib/lib/checkpoint.js +5 -5
  181. package/dist/lib/lib/log.js +1 -1
  182. package/dist/lib/models/accounting.js +1 -1
  183. package/dist/lib/models/batching.js +6 -4
  184. package/dist/lib/models/budget-protection.js +1 -1
  185. package/dist/lib/models/cost-coefficients.js +2 -1
  186. package/dist/lib/models/gateway-cost.js +7 -0
  187. package/dist/lib/models/structured.js +5 -3
  188. package/dist/lib/models/supported-models.js +1 -1
  189. package/dist/lib/pipeline.js +36 -17
  190. package/dist/lib/probes/adapter.js +6 -0
  191. package/dist/lib/probes/adapters/cli-agents.js +44 -0
  192. package/dist/lib/probes/adapters/cli-claude-code.js +21 -0
  193. package/dist/lib/probes/adapters/cli-codex.js +23 -0
  194. package/dist/lib/probes/adapters/cli-cursor.js +21 -0
  195. package/dist/lib/probes/adapters/cli-process.js +34 -0
  196. package/dist/lib/probes/adapters/dataforseo-ai-overview.js +20 -0
  197. package/dist/lib/probes/adapters/gateway-chat.js +30 -0
  198. package/dist/lib/probes/adapters/gateway-perplexity.js +19 -0
  199. package/dist/lib/probes/agent-cli-parsers.js +2 -2
  200. package/dist/lib/probes/agent-clis.js +26 -11
  201. package/dist/lib/probes/answer-text.js +21 -0
  202. package/dist/lib/probes/attempt.js +28 -0
  203. package/dist/lib/probes/bindings.js +69 -0
  204. package/dist/lib/probes/charged-trace.js +47 -3
  205. package/dist/lib/probes/dataforseo-locale.js +1 -1
  206. package/dist/lib/probes/dataforseo.js +8 -5
  207. package/dist/lib/probes/grounding-urls.js +6 -4
  208. package/dist/lib/probes/legacy-bindings.js +7 -0
  209. package/dist/lib/probes/limits.js +1 -1
  210. package/dist/lib/probes/probes.js +33 -12
  211. package/dist/lib/runner.js +17 -14
  212. package/dist/lib/schema.js +4 -4
  213. package/dist/lib/section-result.js +6 -6
  214. package/dist/lib/stores/artifacts.js +7 -7
  215. package/dist/lib/stores/files.js +20 -18
  216. package/dist/lib/stores/local-versions.js +5 -5
  217. package/dist/lib/stores/memory.js +20 -15
  218. package/dist/lib/stores/publication.js +11 -11
  219. package/dist/lib/stores/unit-record.js +28 -0
  220. package/dist/lib/viewer/server.js +33 -25
  221. package/dist/lib/workflow/schema.js +3 -3
  222. package/dist/types/bundle/contracts.d.ts +1 -1
  223. package/dist/types/capture-manifest.d.ts +1 -0
  224. package/dist/types/checks/money-pages.d.ts +19 -0
  225. package/dist/types/codex-workflow/capture.d.ts +13 -0
  226. package/dist/types/codex-workflow/workdir.d.ts +0 -1
  227. package/dist/types/engine/cost-estimate.d.ts +5 -1
  228. package/dist/types/engine/preflight.d.ts +6 -1
  229. package/dist/types/engine/run-bindings.d.ts +25 -0
  230. package/dist/types/models/accounting.d.ts +7 -0
  231. package/dist/types/models/cost-coefficients.d.ts +5 -5
  232. package/dist/types/models/gateway-cost.d.ts +3 -0
  233. package/dist/types/pipeline.d.ts +2 -0
  234. package/dist/types/probes/adapter.d.ts +112 -0
  235. package/dist/types/probes/adapters/cli-agents.d.ts +19 -0
  236. package/dist/types/probes/adapters/cli-claude-code.d.ts +4 -0
  237. package/dist/types/probes/adapters/cli-codex.d.ts +10 -0
  238. package/dist/types/probes/adapters/cli-cursor.d.ts +4 -0
  239. package/dist/types/probes/adapters/cli-process.d.ts +86 -0
  240. package/dist/types/probes/adapters/dataforseo-ai-overview.d.ts +12 -0
  241. package/dist/types/probes/adapters/gateway-chat.d.ts +32 -0
  242. package/dist/types/probes/adapters/gateway-perplexity.d.ts +10 -0
  243. package/dist/types/probes/agent-clis.d.ts +7 -49
  244. package/dist/types/probes/answer-text.d.ts +20 -0
  245. package/dist/types/probes/attempt.d.ts +113 -0
  246. package/dist/types/probes/bindings.d.ts +79 -0
  247. package/dist/types/probes/charged-trace.d.ts +2 -1
  248. package/dist/types/probes/dataforseo.d.ts +24 -1
  249. package/dist/types/probes/grounding-urls.d.ts +18 -5
  250. package/dist/types/probes/legacy-bindings.d.ts +36 -0
  251. package/dist/types/probes/limits.d.ts +12 -6
  252. package/dist/types/probes/probe-trace.d.ts +10 -0
  253. package/dist/types/probes/probes.d.ts +5 -3
  254. package/dist/types/stores/ports.d.ts +1 -0
  255. package/dist/types/stores/unit-record.d.ts +11 -0
  256. package/package.json +6 -6
  257. package/src/agents/author-validation.ts +22 -1
  258. package/src/analysis/progress.ts +10 -1
  259. package/src/bundle/contracts.ts +1 -1
  260. package/src/bundle/recorder.ts +47 -1
  261. package/src/capture-manifest.ts +6 -0
  262. package/src/checks/money-pages.ts +48 -0
  263. package/src/cli/run-commands.ts +37 -1
  264. package/src/codex-workflow/capture.ts +60 -0
  265. package/src/codex-workflow/workdir.ts +3 -4
  266. package/src/engine/audit-file.ts +20 -30
  267. package/src/engine/cost-estimate.ts +10 -4
  268. package/src/engine/local-run.ts +21 -2
  269. package/src/engine/preflight.ts +113 -17
  270. package/src/engine/rejudge.ts +5 -0
  271. package/src/engine/run-bindings.ts +142 -0
  272. package/src/grounding/extract.ts +1 -0
  273. package/src/grounding/model-usage.ts +4 -0
  274. package/src/lib/log.ts +17 -15
  275. package/src/models/accounting.ts +34 -0
  276. package/src/models/budget-protection.ts +1 -0
  277. package/src/models/cost-coefficients.ts +17 -13
  278. package/src/models/gateway-cost.ts +32 -0
  279. package/src/models/structured.ts +2 -10
  280. package/src/models/supported-models.ts +3 -3
  281. package/src/pipeline.ts +36 -17
  282. package/src/probes/adapter.ts +122 -0
  283. package/src/probes/adapters/cli-agents.ts +123 -0
  284. package/src/probes/adapters/cli-claude-code.ts +119 -0
  285. package/src/probes/adapters/cli-codex.ts +145 -0
  286. package/src/probes/adapters/cli-cursor.ts +95 -0
  287. package/src/probes/adapters/cli-process.ts +522 -0
  288. package/src/probes/adapters/dataforseo-ai-overview.ts +106 -0
  289. package/src/probes/adapters/gateway-chat.ts +339 -0
  290. package/src/probes/adapters/gateway-perplexity.ts +104 -0
  291. package/src/probes/agent-clis.ts +151 -1088
  292. package/src/probes/answer-text.ts +153 -0
  293. package/src/probes/attempt.ts +462 -0
  294. package/src/probes/bindings.ts +344 -0
  295. package/src/probes/charged-trace.ts +54 -13
  296. package/src/probes/dataforseo-locale.ts +13 -2
  297. package/src/probes/dataforseo.ts +265 -188
  298. package/src/probes/grounding-urls.ts +68 -19
  299. package/src/probes/legacy-bindings.ts +40 -0
  300. package/src/probes/limits.ts +31 -18
  301. package/src/probes/probe-trace.ts +10 -0
  302. package/src/probes/probes.ts +64 -736
  303. package/src/runner.ts +13 -0
  304. package/src/stores/files.ts +78 -54
  305. package/src/stores/memory.ts +4 -1
  306. package/src/stores/ports.ts +3 -0
  307. package/src/stores/unit-record.ts +151 -0
  308. package/dist/lib/chunks/chunk-BGAHZIL3.js +0 -563
  309. package/dist/lib/chunks/chunk-IB6RROHE.js +0 -204
  310. package/dist/lib/chunks/chunk-WZGI7UVM.js +0 -937
@@ -1,51 +1,55 @@
1
1
  import {
2
2
  assertPublishable
3
- } from "../chunks/chunk-7WO3FFPS.js";
3
+ } from "../chunks/chunk-K5NQDJLE.js";
4
4
  import {
5
5
  validateReportArtifacts
6
- } from "../chunks/chunk-U5USH2HB.js";
6
+ } from "../chunks/chunk-PAL5SXIP.js";
7
7
  import {
8
8
  memoryVersionStores
9
- } from "../chunks/chunk-7CW6U5WJ.js";
9
+ } from "../chunks/chunk-JIE2ANVD.js";
10
10
  import "../chunks/chunk-IRPKBDB7.js";
11
11
  import {
12
12
  StoreConflictError
13
13
  } from "../chunks/chunk-FWBVTM7F.js";
14
+ import {
15
+ parseUnitRecord
16
+ } from "../chunks/chunk-6N3C6E3D.js";
14
17
  import {
15
18
  UnitConflictError
16
19
  } from "../chunks/chunk-C6CMSW5J.js";
17
20
  import "../chunks/chunk-2QLAFBCG.js";
18
- import "../chunks/chunk-F2NSJ6PG.js";
21
+ import "../chunks/chunk-7O3M6I2X.js";
22
+ import "../chunks/chunk-6RED3G6K.js";
19
23
  import "../chunks/chunk-3BJWRD4O.js";
20
24
  import "../chunks/chunk-TGTM5ZFR.js";
21
25
  import "../chunks/chunk-BRENK356.js";
22
- import "../chunks/chunk-LR27H2HZ.js";
23
- import "../chunks/chunk-7PLK6VGC.js";
26
+ import "../chunks/chunk-44NSZBCP.js";
24
27
  import "../chunks/chunk-NANJGMEJ.js";
28
+ import "../chunks/chunk-7PLK6VGC.js";
25
29
  import "../chunks/chunk-55U7PRRM.js";
26
30
  import "../chunks/chunk-2PAO43CH.js";
27
31
  import "../chunks/chunk-NZFMOQHU.js";
28
- import "../chunks/chunk-66T7JC57.js";
32
+ import "../chunks/chunk-LUKP64NX.js";
29
33
  import "../chunks/chunk-KQCRJIEG.js";
30
- import "../chunks/chunk-ZQ3ER7JD.js";
34
+ import "../chunks/chunk-YPVJAXPP.js";
31
35
  import "../chunks/chunk-JQ3P552S.js";
32
36
  import {
33
37
  entryMatches,
34
38
  unitRecordKey
35
- } from "../chunks/chunk-7YDXD4MD.js";
39
+ } from "../chunks/chunk-ODIXZHHX.js";
36
40
  import "../chunks/chunk-N2XIGMJ6.js";
37
- import "../chunks/chunk-HOJXKHPX.js";
38
41
  import "../chunks/chunk-ESEMYWUH.js";
39
42
  import "../chunks/chunk-NL2LDKXX.js";
40
43
  import "../chunks/chunk-H2KDLDK6.js";
44
+ import "../chunks/chunk-HOJXKHPX.js";
41
45
  import "../chunks/chunk-QTXOW5XC.js";
42
- import "../chunks/chunk-DL6YQDTE.js";
43
- import "../chunks/chunk-BFWK3TBN.js";
46
+ import "../chunks/chunk-LOIAGEKN.js";
47
+ import "../chunks/chunk-JXLCKACO.js";
44
48
  import "../chunks/chunk-E4HADK7C.js";
45
- import "../chunks/chunk-W5XYW6ZM.js";
49
+ import "../chunks/chunk-PT6PK2MJ.js";
46
50
  import "../chunks/chunk-RYCRL3YA.js";
47
51
  import "../chunks/chunk-EZD2C7QS.js";
48
- import "../chunks/chunk-TNL2GWYR.js";
52
+ import "../chunks/chunk-EUXNCXCR.js";
49
53
  import {
50
54
  evaluateRunClaim,
51
55
  isTerminalRun
@@ -76,7 +80,8 @@ var settle = (work) => {
76
80
  var MemoryProbeStore = class {
77
81
  #records = /* @__PURE__ */ new Map();
78
82
  constructor(seed = []) {
79
- for (const record of seed) {
83
+ for (const [index, row] of [...seed].entries()) {
84
+ const record = parseUnitRecord(row, `seed ${index + 1}`);
80
85
  this.#records.set(unitRecordKey(record), record);
81
86
  }
82
87
  }
@@ -2,32 +2,32 @@ import {
2
2
  assertPublishable,
3
3
  isCurrentValidation,
4
4
  sameTriple
5
- } from "../chunks/chunk-7WO3FFPS.js";
5
+ } from "../chunks/chunk-K5NQDJLE.js";
6
6
  import "../chunks/chunk-FWBVTM7F.js";
7
- import "../chunks/chunk-LR27H2HZ.js";
8
- import "../chunks/chunk-7PLK6VGC.js";
7
+ import "../chunks/chunk-44NSZBCP.js";
9
8
  import "../chunks/chunk-NANJGMEJ.js";
9
+ import "../chunks/chunk-7PLK6VGC.js";
10
10
  import "../chunks/chunk-55U7PRRM.js";
11
11
  import "../chunks/chunk-2PAO43CH.js";
12
12
  import "../chunks/chunk-NZFMOQHU.js";
13
- import "../chunks/chunk-66T7JC57.js";
13
+ import "../chunks/chunk-LUKP64NX.js";
14
14
  import "../chunks/chunk-KQCRJIEG.js";
15
- import "../chunks/chunk-ZQ3ER7JD.js";
15
+ import "../chunks/chunk-YPVJAXPP.js";
16
16
  import "../chunks/chunk-JQ3P552S.js";
17
- import "../chunks/chunk-7YDXD4MD.js";
17
+ import "../chunks/chunk-ODIXZHHX.js";
18
18
  import "../chunks/chunk-N2XIGMJ6.js";
19
- import "../chunks/chunk-HOJXKHPX.js";
20
19
  import "../chunks/chunk-ESEMYWUH.js";
21
20
  import "../chunks/chunk-NL2LDKXX.js";
22
21
  import "../chunks/chunk-H2KDLDK6.js";
22
+ import "../chunks/chunk-HOJXKHPX.js";
23
23
  import "../chunks/chunk-QTXOW5XC.js";
24
- import "../chunks/chunk-DL6YQDTE.js";
25
- import "../chunks/chunk-BFWK3TBN.js";
24
+ import "../chunks/chunk-LOIAGEKN.js";
25
+ import "../chunks/chunk-JXLCKACO.js";
26
26
  import "../chunks/chunk-E4HADK7C.js";
27
- import "../chunks/chunk-W5XYW6ZM.js";
27
+ import "../chunks/chunk-PT6PK2MJ.js";
28
28
  import "../chunks/chunk-RYCRL3YA.js";
29
29
  import "../chunks/chunk-EZD2C7QS.js";
30
- import "../chunks/chunk-TNL2GWYR.js";
30
+ import "../chunks/chunk-EUXNCXCR.js";
31
31
  import "../chunks/chunk-WJUHRJVW.js";
32
32
  import "../chunks/chunk-6RAKXYSR.js";
33
33
  import "../chunks/chunk-D5B4ZOW6.js";
@@ -0,0 +1,28 @@
1
+ import {
2
+ ProbeStoreIntegrityError,
3
+ parseUnitRecord
4
+ } from "../chunks/chunk-6N3C6E3D.js";
5
+ import "../chunks/chunk-7O3M6I2X.js";
6
+ import "../chunks/chunk-LOIAGEKN.js";
7
+ import "../chunks/chunk-JXLCKACO.js";
8
+ import "../chunks/chunk-E4HADK7C.js";
9
+ import "../chunks/chunk-PT6PK2MJ.js";
10
+ import "../chunks/chunk-RYCRL3YA.js";
11
+ import "../chunks/chunk-EZD2C7QS.js";
12
+ import "../chunks/chunk-EUXNCXCR.js";
13
+ import "../chunks/chunk-WJUHRJVW.js";
14
+ import "../chunks/chunk-6RAKXYSR.js";
15
+ import "../chunks/chunk-D5B4ZOW6.js";
16
+ import "../chunks/chunk-4XIAXX7K.js";
17
+ import "../chunks/chunk-WIBMVNIH.js";
18
+ import "../chunks/chunk-EDQTINTL.js";
19
+ import "../chunks/chunk-HXHFMFQU.js";
20
+ import "../chunks/chunk-QBD24WTZ.js";
21
+ import "../chunks/chunk-YKJHFD64.js";
22
+ import "../chunks/chunk-SZ2UBZKG.js";
23
+ import "../chunks/chunk-AASWJR7Q.js";
24
+ import "../chunks/chunk-PKB6JRJM.js";
25
+ export {
26
+ ProbeStoreIntegrityError,
27
+ parseUnitRecord
28
+ };
@@ -1,55 +1,63 @@
1
1
  import {
2
2
  startViewer
3
- } from "../chunks/chunk-XNTFOVCE.js";
3
+ } from "../chunks/chunk-FYE4R5TY.js";
4
4
  import "../chunks/chunk-ZXQPD4OC.js";
5
- import "../chunks/chunk-HI3PD3KR.js";
6
- import "../chunks/chunk-AJKV46SM.js";
7
- import "../chunks/chunk-66DVMLGR.js";
8
- import "../chunks/chunk-SD7LR26G.js";
9
- import "../chunks/chunk-MENTBQGB.js";
10
- import "../chunks/chunk-I3UE52ZV.js";
11
- import "../chunks/chunk-K4Y5NT4M.js";
12
- import "../chunks/chunk-V5JJEEBT.js";
5
+ import "../chunks/chunk-QVMPTT7R.js";
6
+ import "../chunks/chunk-LNYQMWJO.js";
7
+ import "../chunks/chunk-TKOQMB6A.js";
8
+ import "../chunks/chunk-5JU2Y2I6.js";
9
+ import "../chunks/chunk-4HPMLJKC.js";
10
+ import "../chunks/chunk-LPOIMPJK.js";
11
+ import "../chunks/chunk-QO5TPMWS.js";
12
+ import "../chunks/chunk-RYB77E7O.js";
13
+ import "../chunks/chunk-SJCUR4QX.js";
14
+ import "../chunks/chunk-S2SFHTJD.js";
15
+ import "../chunks/chunk-CRVCWDH6.js";
13
16
  import "../chunks/chunk-6KHQ7DXP.js";
14
- import "../chunks/chunk-RXSHKWZJ.js";
15
- import "../chunks/chunk-SIJOQRRK.js";
17
+ import "../chunks/chunk-HLC6OHGO.js";
18
+ import "../chunks/chunk-KRXOJJR7.js";
16
19
  import "../chunks/chunk-SREGO3PU.js";
17
- import "../chunks/chunk-AK6YNTCV.js";
18
- import "../chunks/chunk-JXBLGCXZ.js";
20
+ import "../chunks/chunk-ASIFUJG2.js";
21
+ import "../chunks/chunk-AB7DUTX5.js";
19
22
  import "../chunks/chunk-W46Y7KBR.js";
20
23
  import "../chunks/chunk-2QLAFBCG.js";
21
- import "../chunks/chunk-T5XQ6NXD.js";
22
- import "../chunks/chunk-JKPBXPCW.js";
24
+ import "../chunks/chunk-JJFOILZK.js";
25
+ import "../chunks/chunk-IMADI2YP.js";
23
26
  import "../chunks/chunk-7O3M6I2X.js";
24
27
  import "../chunks/chunk-E6NQQU6V.js";
25
- import "../chunks/chunk-F2NSJ6PG.js";
28
+ import "../chunks/chunk-6RED3G6K.js";
26
29
  import "../chunks/chunk-TCOH3FGE.js";
27
30
  import "../chunks/chunk-3UFZ2XPE.js";
28
- import "../chunks/chunk-SASE7U6E.js";
31
+ import "../chunks/chunk-YQD5ITKI.js";
29
32
  import "../chunks/chunk-3BJWRD4O.js";
30
33
  import "../chunks/chunk-TGTM5ZFR.js";
34
+ import "../chunks/chunk-WZA4H4TG.js";
35
+ import "../chunks/chunk-74UNVGWB.js";
36
+ import "../chunks/chunk-UGCT46PC.js";
37
+ import "../chunks/chunk-BBK54RVK.js";
38
+ import "../chunks/chunk-PO2J5OQ3.js";
31
39
  import "../chunks/chunk-CQ62GN7P.js";
32
- import "../chunks/chunk-QGZ4QSUE.js";
33
- import "../chunks/chunk-U6BW6LGX.js";
40
+ import "../chunks/chunk-FHV4PBYG.js";
41
+ import "../chunks/chunk-RM2VVR7Y.js";
34
42
  import "../chunks/chunk-7PLK6VGC.js";
35
43
  import "../chunks/chunk-55U7PRRM.js";
36
44
  import "../chunks/chunk-B5L2KMTU.js";
37
45
  import "../chunks/chunk-KQCRJIEG.js";
38
46
  import "../chunks/chunk-JQ3P552S.js";
39
- import "../chunks/chunk-7YDXD4MD.js";
47
+ import "../chunks/chunk-ODIXZHHX.js";
40
48
  import "../chunks/chunk-N2XIGMJ6.js";
41
- import "../chunks/chunk-HOJXKHPX.js";
42
49
  import "../chunks/chunk-ESEMYWUH.js";
43
50
  import "../chunks/chunk-NL2LDKXX.js";
44
51
  import "../chunks/chunk-H2KDLDK6.js";
52
+ import "../chunks/chunk-HOJXKHPX.js";
45
53
  import "../chunks/chunk-QTXOW5XC.js";
46
- import "../chunks/chunk-DL6YQDTE.js";
47
- import "../chunks/chunk-BFWK3TBN.js";
54
+ import "../chunks/chunk-LOIAGEKN.js";
55
+ import "../chunks/chunk-JXLCKACO.js";
48
56
  import "../chunks/chunk-E4HADK7C.js";
49
- import "../chunks/chunk-W5XYW6ZM.js";
57
+ import "../chunks/chunk-PT6PK2MJ.js";
50
58
  import "../chunks/chunk-RYCRL3YA.js";
51
59
  import "../chunks/chunk-EZD2C7QS.js";
52
- import "../chunks/chunk-TNL2GWYR.js";
60
+ import "../chunks/chunk-EUXNCXCR.js";
53
61
  import "../chunks/chunk-WJUHRJVW.js";
54
62
  import "../chunks/chunk-6RAKXYSR.js";
55
63
  import "../chunks/chunk-D5B4ZOW6.js";
@@ -13,12 +13,12 @@ import {
13
13
  reviewRequestSchema,
14
14
  scopeSchema,
15
15
  tripleSchema
16
- } from "../chunks/chunk-BFWK3TBN.js";
16
+ } from "../chunks/chunk-JXLCKACO.js";
17
17
  import "../chunks/chunk-E4HADK7C.js";
18
- import "../chunks/chunk-W5XYW6ZM.js";
18
+ import "../chunks/chunk-PT6PK2MJ.js";
19
19
  import "../chunks/chunk-RYCRL3YA.js";
20
20
  import "../chunks/chunk-EZD2C7QS.js";
21
- import "../chunks/chunk-TNL2GWYR.js";
21
+ import "../chunks/chunk-EUXNCXCR.js";
22
22
  import "../chunks/chunk-WJUHRJVW.js";
23
23
  import "../chunks/chunk-D5B4ZOW6.js";
24
24
  import "../chunks/chunk-4XIAXX7K.js";
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const toolId = "literally-aeo";
3
- export declare const toolVersion = "0.2.1";
3
+ export declare const toolVersion = "0.3.0";
4
4
  export declare const bundleSchemaVersion = 2;
5
5
  export declare const readableBundleSchemaVersions: readonly number[];
6
6
  export declare const traceSchemaVersion = 1;
@@ -84,6 +84,7 @@ export declare const captureManifestSchema: z.ZodObject<{
84
84
  reportedModel: z.ZodNullable<z.ZodString>;
85
85
  cliVersion: z.ZodNullable<z.ZodString>;
86
86
  parameters: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
87
+ adapter: z.ZodOptional<z.ZodString>;
87
88
  }, z.core.$strip>;
88
89
  metadataProvenance: z.ZodEnum<{
89
90
  captured_record: "captured_record";
@@ -0,0 +1,19 @@
1
+ export declare const maxMoneyPages = 20;
2
+ /** Why a money page is refused: another site's page, or a URL the guard
3
+ * would never fetch. Each caller words the remedy its own input offers. */
4
+ export type MoneyPageProblem = {
5
+ kind: 'off_site';
6
+ } | {
7
+ kind: 'unsafe_url';
8
+ message: string;
9
+ };
10
+ /**
11
+ * moneyPageProblem says why the site checks may not fetch a page, or
12
+ * undefined when they may. The page must be on the brand's site or its
13
+ * subdomains (or on a host the operator allowed), and public https with no
14
+ * port or credentials.
15
+ */
16
+ export declare const moneyPageProblem: (page: string, site: {
17
+ domain: string;
18
+ checkHosts?: readonly string[];
19
+ }) => MoneyPageProblem | undefined;
@@ -8,6 +8,7 @@ import type { AeoAuditConfig, RunRequest } from '../schema';
8
8
  import type { ProbeStore, Stores } from '../stores/ports';
9
9
  import { type AeoAgentSurface } from '../surfaces';
10
10
  import type { ProbeTrace } from '../probes/probe-trace';
11
+ import { type ProbeDependencies, type RunBindings } from '../probes/bindings';
11
12
  export type CaptureDeps = {
12
13
  config: AeoAuditConfig;
13
14
  request: RunRequest;
@@ -20,6 +21,9 @@ export type CaptureDeps = {
20
21
  /** The run journal, when the capture is recorded (a local run). */
21
22
  trace?: ProbeTrace;
22
23
  signal?: AbortSignal;
24
+ /** What the probe adapters are created with: the gateway, credentials,
25
+ * clients. */
26
+ probeDependencies: ProbeDependencies;
23
27
  logContext: Record<string, unknown>;
24
28
  now?: () => Date;
25
29
  /** The section capture service; tests inject one. */
@@ -34,4 +38,13 @@ export declare class CaptureRetryableError extends Error {
34
38
  * needs neither the CLI nor its credential, so the pre-flight (auth, install,
35
39
  * canary) covers only these. */
36
40
  export declare const agentSurfacesToCapture: (plan: RunPlan, probeStore: Pick<ProbeStore, "list">) => Promise<AeoAgentSurface[]>;
41
+ /**
42
+ * assertBankUsable refuses a bank the run cannot build on, before anything
43
+ * is dispatched: a row no release wrote (phase 3 item 6), or a banked
44
+ * answer the plan reuses that another binding captured. captureForRun runs
45
+ * it before its first section, where the sections would otherwise settle
46
+ * independently and spend while one fails; a host runs it before its agent
47
+ * canaries too.
48
+ */
49
+ export declare const assertBankUsable: (probeStore: Pick<ProbeStore, "list">, plan: RunPlan, bindings: RunBindings) => Promise<void>;
37
50
  export declare const captureForRun: (deps: CaptureDeps) => Promise<CaptureArtifact>;
@@ -1,6 +1,5 @@
1
1
  import type { AeoAuditConfig } from '../schema';
2
2
  import type { CapturedUnitRecord } from '../stores/ports';
3
- export declare const sourcesMarker = "Sources used by search:";
4
3
  export type AnswerFile = {
5
4
  /** Path relative to the work directory. */
6
5
  file: string;
@@ -1,5 +1,6 @@
1
1
  import { type Range } from '../models/cost-coefficients';
2
2
  import type { SupportedModel } from '../models/supported-models';
3
+ import { type RunBindings } from '../probes/bindings';
3
4
  import type { RunPlan } from '../runner';
4
5
  export type CostRange = Range<number>;
5
6
  export type RunCostEstimate = {
@@ -29,10 +30,13 @@ type EstimateRunOptions = {
29
30
  plan: Pick<RunPlan, 'units' | 'probesBySurface'>;
30
31
  model: SupportedModel;
31
32
  grounding: 'full' | 'extraction_only';
33
+ /** The bindings the run measures with: each surface's probes cost what
34
+ * its bound adapter costs. */
35
+ bindings: RunBindings;
32
36
  };
33
37
  /** estimateRunCost estimates a whole run as planned; a resume spends less,
34
38
  * because banked answers are never probed again. */
35
- export declare const estimateRunCost: ({ plan, model, grounding, }: EstimateRunOptions) => RunCostEstimate;
39
+ export declare const estimateRunCost: ({ plan, model, grounding, bindings, }: EstimateRunOptions) => RunCostEstimate;
36
40
  /** estimateAuthorCost estimates one author session and its research. */
37
41
  export declare const estimateAuthorCost: (model: SupportedModel) => AuthorCostEstimate;
38
42
  /** One line a person reads: "$12.40 to $38.10 (estimate)". */
@@ -1,3 +1,4 @@
1
+ import { type RunBindings } from '../probes/bindings';
1
2
  import { type AeoAgentSurface, type AeoSurface } from '../schema';
2
3
  import type { Settings } from './env-file';
3
4
  export declare const minimumNodeMajor = 24;
@@ -6,7 +7,8 @@ export type PreflightCheck = {
6
7
  ok: boolean;
7
8
  detail: string;
8
9
  };
9
- export declare const credentialSettingNames: readonly ["AI_GATEWAY_API_KEY", "DATAFORSEO_PASSWORD", "AEO_DATABASE_URL", "AEO_SITE_DATABASE_URL", "AEO_API_TOKEN", "OPENAI_API_KEY", "ANTHROPIC_API_KEY", "CLAUDE_CODE_OAUTH_TOKEN", "GOOGLE_GENERATIVE_AI_API_KEY", "PERPLEXITY_API_KEY", "CURSOR_API_KEY"];
10
+ export declare const engineSecretSettingNames: readonly ["AI_GATEWAY_API_KEY", "DATAFORSEO_PASSWORD", "AEO_DATABASE_URL", "AEO_SITE_DATABASE_URL", "AEO_API_TOKEN", "GOOGLE_GENERATIVE_AI_API_KEY", "PERPLEXITY_API_KEY"];
11
+ export declare const credentialSettingNames: readonly string[];
10
12
  /** Every setting a run may read, for applying the env file. */
11
13
  export declare const runSettingNames: string[];
12
14
  /** How an agent surface authenticates on this machine: a variable, or the
@@ -31,4 +33,7 @@ export declare const runPreflight: (args: {
31
33
  groundingSearch?: boolean;
32
34
  /** Money pages are rendered in Chromium by the renderability check. */
33
35
  rendersPages?: boolean;
36
+ /** The bindings the run measures with: each surface's adapter, whose
37
+ * settings preflight requires. */
38
+ bindings: RunBindings;
34
39
  }) => Promise<PreflightCheck[]>;
@@ -0,0 +1,25 @@
1
+ import { type RunBindings } from '../probes/bindings';
2
+ export declare const bindingsFile = "bindings.json";
3
+ /**
4
+ * estimateBindingsOf is the bindings a run directory's estimate prices: its
5
+ * frozen bindings once it has usable ones, else the defaults a new run
6
+ * would freeze. Read-only. A frozen binding the engine cannot build is the
7
+ * run's start to refuse (exit 2), not the estimate's.
8
+ */
9
+ export declare const estimateBindingsOf: (bankPath: string) => Promise<RunBindings>;
10
+ /**
11
+ * resolveRunBindings returns the bindings a run measures with: the frozen
12
+ * ones on a resume, refused when the installed engine cannot build them;
13
+ * otherwise the defaults for a new run, or the legacy bindings for a run
14
+ * that started before bindings were frozen, written before they are used.
15
+ */
16
+ export declare const resolveRunBindings: (bankPath: string, { startedBefore }: {
17
+ startedBefore: boolean;
18
+ }) => Promise<RunBindings>;
19
+ /**
20
+ * carryFrozenBindings gives a derived run directory (a rejudgment) the
21
+ * bindings its reused answers were captured under: the source's frozen
22
+ * file, or, from before bindings were frozen, the legacy bindings. Never
23
+ * the installed defaults.
24
+ */
25
+ export declare const carryFrozenBindings: (sourceBank: string, targetBank: string) => Promise<void>;
@@ -79,6 +79,13 @@ export type ModelCallAccounting = {
79
79
  reserve(call: ModelCallReservation): Promise<void>;
80
80
  assertOwned(): Promise<void>;
81
81
  settle(callId: string, usage: ModelCallUsage): Promise<void>;
82
+ /**
83
+ * Withdraws a reservation whose call was never dispatched (its operation
84
+ * could not be recorded first). Unlike a settlement at $0, it records no
85
+ * cost the provider did not report: the call leaves the ledger. A settled
86
+ * call cannot be released.
87
+ */
88
+ release(callId: string): Promise<void>;
82
89
  /** Present when the run records its execution: the request before
83
90
  * dispatch, the response before settlement. A failure stops the call. */
84
91
  observe?(callId: string, evidence: ModelCallEvidence): Promise<void>;
@@ -1,6 +1,6 @@
1
- import type { AeoSurface } from '../surfaces';
1
+ import { ProbeAdapterId } from '../probes/adapter';
2
2
  import type { TokenUsage } from './pricing';
3
- export declare const costCoefficientsVersion = 1;
3
+ export declare const costCoefficientsVersion = 2;
4
4
  export type TokenRange = {
5
5
  input: number;
6
6
  output: number;
@@ -85,9 +85,9 @@ export declare const searchUsdPerAnswer: {
85
85
  readonly low: 0.001;
86
86
  readonly high: 0.01;
87
87
  };
88
- /** One probe unit, by surface, in USD. The coding-agent surfaces run on
89
- * the operator's own login and bill nothing to the run. */
90
- export declare const probeUsd: Record<AeoSurface, Range<number>>;
88
+ /** One probe unit, by adapter, in USD. The coding-agent CLIs run on the
89
+ * operator's own plan and bill nothing to the run's cap. */
90
+ export declare const probeUsd: Readonly<Record<ProbeAdapterId, Range<number>>>;
91
91
  /** The calibrated workload a Codex session is: a batch of answer files
92
92
  * (analyze, qualify, review), the whole report (write) or a brief
93
93
  * (author). Each stage's descriptor names its own. */
@@ -0,0 +1,3 @@
1
+ /** gatewayCostUsd is the cost in a response's provider metadata, when the
2
+ * gateway reported one. */
3
+ export declare const gatewayCostUsd: (providerMetadata: unknown) => number | undefined;
@@ -4,6 +4,7 @@ import { type AgentCliVersions, type AgentProbeResult, type AgentRuntime } from
4
4
  import type { ProbeFailureKind } from './probes/failure';
5
5
  import type { ProbeLimiter } from './probes/limits';
6
6
  import { type ProbeTrace } from './probes/probe-trace';
7
+ import type { ProbeDependencies } from './probes/bindings';
7
8
  import { type AnalysisStore, type ProbeStore } from './stores/ports';
8
9
  import type { BrandMentionAnswer } from './analysis/sentiment';
9
10
  import type { InternalModelContext } from './models/context';
@@ -61,6 +62,7 @@ export type SectionRunArgs = {
61
62
  agentRuntime?: AgentRuntime;
62
63
  trace?: ProbeTrace;
63
64
  signal?: AbortSignal;
65
+ probeDependencies: ProbeDependencies;
64
66
  logContext: Record<string, unknown>;
65
67
  };
66
68
  export type AnalyzedRun = {
@@ -0,0 +1,112 @@
1
+ import type { LanguageModel } from 'ai';
2
+ import type { Range } from '../models/cost-coefficients';
3
+ import type { RetrievalExposure, RetrievalLog } from '../schema';
4
+ import type { AeoSurface } from '../surfaces';
5
+ import type { AIOverviewReference } from './dataforseo';
6
+ import type { ProbeFailureKind } from './failure';
7
+ import type { ProbeProvider } from './limits';
8
+ /** Every registered adapter, with its version. A change to an adapter's
9
+ * request or parsing bumps its version. */
10
+ export declare const ProbeAdapterId: {
11
+ readonly GATEWAY_OPENAI: "gateway.openai@1";
12
+ readonly GATEWAY_GOOGLE: "gateway.google@1";
13
+ readonly GATEWAY_ANTHROPIC: "gateway.anthropic@1";
14
+ readonly GATEWAY_PERPLEXITY: "gateway.perplexity@1";
15
+ readonly DATAFORSEO_AI_OVERVIEW: "dataforseo.ai_overview@1";
16
+ readonly CLI_CLAUDE_CODE: "cli.claude_code@1";
17
+ readonly CLI_CODEX: "cli.codex@1";
18
+ readonly CLI_CURSOR: "cli.cursor@1";
19
+ };
20
+ export type ProbeAdapterId = (typeof ProbeAdapterId)[keyof typeof ProbeAdapterId];
21
+ /** A setting an adapter reads. Settings that share a group are
22
+ * alternatives: any one of them is enough. `billsAccount` names the
23
+ * provider account an auth setting bills per use, outside the run's cap;
24
+ * plan and doctor disclose it. */
25
+ export type ProbeSetting = {
26
+ name: string;
27
+ secret: boolean;
28
+ group?: 'auth';
29
+ billsAccount?: string;
30
+ };
31
+ /** The retry family whose rules the host applies (attempt.ts). */
32
+ export type ProbeRetryFamily = 'chat' | 'agent';
33
+ /** `metered`: every attempt is reserved against the run's budget;
34
+ * `subscription`: the operator's own plan pays, and nothing is reserved. */
35
+ export type ProbeBilling = 'metered' | 'subscription';
36
+ /** How the host reads the model an answer names: through servedModelOf
37
+ * against the requested model, as the CLI reported it, or not at all. */
38
+ export type ServedModelRule = 'compare_to_requested' | 'raw' | 'none';
39
+ /** What an adapter is, independent of a run: what it observes, what it
40
+ * needs, which pool and retry rules it runs under, and what it costs. */
41
+ export type ProbeAdapterProfile = {
42
+ id: ProbeAdapterId;
43
+ observes: {
44
+ retrieval: RetrievalExposure;
45
+ servedModel: ServedModelRule;
46
+ };
47
+ settings: readonly ProbeSetting[];
48
+ pool: Exclude<ProbeProvider, 'analyzer'>;
49
+ retry: ProbeRetryFamily;
50
+ estimateUsd: Range<number>;
51
+ billing: ProbeBilling;
52
+ /** Google's grounding redirects in the answer and its retrieval log are
53
+ * resolved to their targets before the answer is banked. */
54
+ resolvesRedirects: boolean;
55
+ };
56
+ /** The sources an answer cites, rendered after the body (answer-text.ts). */
57
+ export type AnswerSources = {
58
+ format: 'search';
59
+ sources: readonly unknown[];
60
+ } | {
61
+ format: 'ai_overview';
62
+ references: readonly AIOverviewReference[];
63
+ } | {
64
+ format: 'none';
65
+ };
66
+ export type ProbeAnswer = {
67
+ /** The body, without the source block. */
68
+ answerText: string;
69
+ sources: AnswerSources;
70
+ /** null: the log could not be captured. */
71
+ retrieval: RetrievalLog | null;
72
+ /** Google AI Overview's honest absence. */
73
+ noOverview?: true;
74
+ /** The model asked for, when the request names it only at answer time
75
+ * (Codex); null when the CLI's own default answered. */
76
+ requestedModel?: string | null;
77
+ /** The model the provider or CLI named, raw; observes.servedModel says
78
+ * how the host reads it. */
79
+ servedModel?: string;
80
+ reportedCostUsd?: number;
81
+ /** Coding agents only; null stays unknown. */
82
+ usedWebSearch?: boolean | null;
83
+ };
84
+ export type ProbeContext = {
85
+ signal?: AbortSignal;
86
+ };
87
+ /** A request as the adapter dispatches it: the prompt it sends, with any
88
+ * prefix, and the parameters that shape the answer. Recorded when an
89
+ * attempt starts (spec §4.9). */
90
+ export type ProbeRequest = {
91
+ prompt: string;
92
+ parameters: Readonly<Record<string, unknown>>;
93
+ };
94
+ /** The models a chat adapter asks through, by model ID: the run's Vercel AI
95
+ * Gateway provider, created with the run's own key. */
96
+ export type ChatModelProvider = (modelId: string) => LanguageModel;
97
+ export type ProbeFailureClass = {
98
+ kind: ProbeFailureKind;
99
+ message: string;
100
+ };
101
+ /** One adapter instance, serving one surface. */
102
+ export type ProbeAdapter = ProbeAdapterProfile & {
103
+ surface: AeoSurface;
104
+ /** The model the binding pins, for an adapter that calls a model API. */
105
+ model?: string;
106
+ /** The request `probe` dispatches for `promptText`, built from the same
107
+ * values the dispatch uses. */
108
+ request: (promptText: string) => ProbeRequest;
109
+ probe: (promptText: string, ctx: ProbeContext) => Promise<ProbeAnswer>;
110
+ /** The message is journaled, so it never carries the prompt. */
111
+ classifyError: (error: unknown) => ProbeFailureClass;
112
+ };
@@ -0,0 +1,19 @@
1
+ import type { AeoAgentSurface } from '../../surfaces';
2
+ import type { ProbeAdapter, ProbeAdapterProfile } from '../adapter';
3
+ import { type AgentProbeFn, type AgentRuntime } from './cli-process';
4
+ export declare const cliAdapterProfiles: {
5
+ claude_code: ProbeAdapterProfile;
6
+ codex: ProbeAdapterProfile;
7
+ cursor: ProbeAdapterProfile;
8
+ };
9
+ /** probeForSurface is one CLI run: through the runtime's worker transport
10
+ * when it has one, else on this machine. */
11
+ export declare const probeForSurface: (surface: AeoAgentSurface) => AgentProbeFn;
12
+ /**
13
+ * createCliAdapter is the adapter of `surface`'s CLI, running each attempt
14
+ * with `runtime`: its environment, its config directory, its deadline and,
15
+ * hosted, its worker transport.
16
+ */
17
+ export declare const createCliAdapter: (surface: AeoAgentSurface, { runtime }: {
18
+ runtime: AgentRuntime;
19
+ }) => ProbeAdapter;
@@ -0,0 +1,4 @@
1
+ import { type ProbeAdapterProfile } from '../adapter';
2
+ import { type AgentProbeFn } from './cli-process';
3
+ export declare const claudeCodeProfile: ProbeAdapterProfile;
4
+ export declare const runClaudeCodeProbe: AgentProbeFn;
@@ -0,0 +1,10 @@
1
+ import { type ProbeAdapterProfile } from '../adapter';
2
+ import { type AgentProbeFn } from './cli-process';
3
+ export declare const codexProfile: ProbeAdapterProfile;
4
+ /** The parameters a Codex probe runs with, as its request records them. */
5
+ export declare const codexRequestParameters: (env: NodeJS.ProcessEnv) => {
6
+ cli: string;
7
+ model: string | null;
8
+ sandbox: string;
9
+ };
10
+ export declare const runCodexProbe: AgentProbeFn;
@@ -0,0 +1,4 @@
1
+ import { type ProbeAdapterProfile } from '../adapter';
2
+ import { type AgentProbeFn } from './cli-process';
3
+ export declare const cursorProfile: ProbeAdapterProfile;
4
+ export declare const runCursorProbe: AgentProbeFn;