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
@@ -0,0 +1,292 @@
1
+ import {
2
+ AgentStreamError,
3
+ RejectedWebToolError,
4
+ RetrievalConsistencyError
5
+ } from "./chunk-SF4UJ2AY.js";
6
+ import {
7
+ isWorkerInvocationError
8
+ } from "./chunk-565CYND6.js";
9
+ import {
10
+ ChildProcessError,
11
+ runChild
12
+ } from "./chunk-7QYZSP7Q.js";
13
+ import {
14
+ codexArgs,
15
+ resolveCodexBinary
16
+ } from "./chunk-U772TN32.js";
17
+ import {
18
+ ProbeFailure,
19
+ errorMessage,
20
+ isAuthError,
21
+ isCapacityError
22
+ } from "./chunk-7O3M6I2X.js";
23
+ import {
24
+ isRecord
25
+ } from "./chunk-7PLK6VGC.js";
26
+
27
+ // src/probes/adapters/cli-process.ts
28
+ import { mkdtemp, rm } from "node:fs/promises";
29
+ import { homedir, tmpdir } from "node:os";
30
+ import path from "node:path";
31
+ var authSettingNames = (profile) => {
32
+ return profile.settings.filter((setting) => setting.group === "auth").map((setting) => setting.name);
33
+ };
34
+ var agentProbeTimeoutMs = 5 * 60 * 1e3;
35
+ var agentKillGraceMs = 1e4;
36
+ var agentMaxBufferBytes = 64 * 1024 * 1024;
37
+ var localCommand = (command, args, env) => {
38
+ if (command !== "codex") {
39
+ return { command, args: [...args] };
40
+ }
41
+ const binary = resolveCodexBinary(env);
42
+ return { command: binary.command, args: codexArgs(binary, args) };
43
+ };
44
+ var cliOutputByError = /* @__PURE__ */ new WeakMap();
45
+ var attachCliOutput = (error, output) => {
46
+ if (typeof error === "object" && error !== null) {
47
+ cliOutputByError.set(error, output);
48
+ }
49
+ return error;
50
+ };
51
+ var workerFailureKinds = /* @__PURE__ */ new Map([
52
+ ["capacity", "capacity"],
53
+ ["auth", "auth"],
54
+ ["timeout", "timeout"],
55
+ ["parser", "parser"],
56
+ ["rejected_web_tool", "rejected_web_tool"]
57
+ ]);
58
+ var classifyAgentError = (error) => {
59
+ if (error instanceof ProbeFailure) {
60
+ return { kind: error.kind, message: error.message };
61
+ }
62
+ if (isWorkerInvocationError(error)) {
63
+ const kind = workerFailureKinds.get(error.kind) ?? "cli_error";
64
+ return { kind, message: error.detail ?? error.message };
65
+ }
66
+ if (error instanceof RejectedWebToolError) {
67
+ return { kind: "rejected_web_tool", message: error.message };
68
+ }
69
+ if (error instanceof RetrievalConsistencyError) {
70
+ return { kind: "parser", message: error.message };
71
+ }
72
+ if (error instanceof ChildProcessError) {
73
+ const { result } = error;
74
+ if (result.timedOut || result.aborted) {
75
+ return { kind: "timeout", message: error.message };
76
+ }
77
+ const signals = cliFailureSignals(result);
78
+ return {
79
+ kind: kindFromSignals(signals.errorTexts, "cli_error"),
80
+ message: signals.detail ? `${error.message} \u2014 ${signals.detail}` : error.message
81
+ };
82
+ }
83
+ if (error instanceof AgentStreamError) {
84
+ const output = cliOutputByError.get(error);
85
+ const signals = output ? cliFailureSignals({ code: 0, signal: null, ...output }) : { detail: "", errorTexts: [] };
86
+ return {
87
+ kind: error.kind === "cli_error" ? kindFromSignals(signals.errorTexts, "cli_error") : "parser",
88
+ message: signals.detail ? `${error.message} \u2014 ${signals.detail}` : error.message
89
+ };
90
+ }
91
+ const message = errorMessage(error);
92
+ if (error instanceof Error && error.name === "AbortError") {
93
+ return { kind: "timeout", message };
94
+ }
95
+ return { kind: "cli_error", message };
96
+ };
97
+ var kindFromSignals = (errorTexts, fallback) => {
98
+ const joined = errorTexts.join("\n");
99
+ if (isCapacityError(joined)) {
100
+ return "capacity";
101
+ }
102
+ if (isAuthError(joined)) {
103
+ return "auth";
104
+ }
105
+ return fallback;
106
+ };
107
+ var cliFailureDetailChars = 300;
108
+ var describeExit = ({
109
+ code,
110
+ signal
111
+ }) => {
112
+ if (typeof code === "number") {
113
+ return `exit ${code}`;
114
+ }
115
+ if (signal) {
116
+ return `killed by ${signal}`;
117
+ }
118
+ return "";
119
+ };
120
+ var cliFailureSignals = (output) => {
121
+ const exit = describeExit(output);
122
+ const stderrText = output.stderr.trim();
123
+ const errorTexts = [];
124
+ let lastErrorEventText = null;
125
+ if (stderrText) {
126
+ errorTexts.push(stderrText);
127
+ }
128
+ const events = parseEventLines(output.stdout);
129
+ for (const event of events) {
130
+ if (!isErrorEvent(event)) {
131
+ continue;
132
+ }
133
+ const text = eventMessage(event);
134
+ if (text) {
135
+ errorTexts.push(text);
136
+ lastErrorEventText = text;
137
+ }
138
+ if (typeof event.error === "string") {
139
+ errorTexts.push(event.error);
140
+ }
141
+ }
142
+ let detail;
143
+ if (lastErrorEventText) {
144
+ detail = `error event: ${lastErrorEventText.slice(0, cliFailureDetailChars)}`;
145
+ } else if (stderrText) {
146
+ detail = `stderr: ${stderrText.slice(0, cliFailureDetailChars)}`;
147
+ } else {
148
+ const last = lastCliMessage(events, output.stdout);
149
+ detail = last ? `last stdout message: ${last}` : "";
150
+ }
151
+ return {
152
+ detail: [exit, detail].filter(Boolean).join(", "),
153
+ errorTexts
154
+ };
155
+ };
156
+ var describeCliFailure = (output) => {
157
+ return cliFailureSignals(output).detail;
158
+ };
159
+ var parseEventLines = (stdout) => {
160
+ const events = [];
161
+ for (const line of stdout.split("\n")) {
162
+ const trimmed = line.trim();
163
+ if (!trimmed.startsWith("{")) {
164
+ continue;
165
+ }
166
+ try {
167
+ const event = JSON.parse(trimmed);
168
+ if (isRecord(event)) {
169
+ events.push(event);
170
+ }
171
+ } catch {
172
+ continue;
173
+ }
174
+ }
175
+ return events;
176
+ };
177
+ var isErrorEvent = (event) => {
178
+ if (event.type === "error") {
179
+ return true;
180
+ }
181
+ if (typeof event.error === "string" || isRecord(event.error)) {
182
+ return true;
183
+ }
184
+ if (event.is_error === true) {
185
+ return true;
186
+ }
187
+ if (typeof event.subtype === "string" && /error/i.test(event.subtype)) {
188
+ return true;
189
+ }
190
+ const item = isRecord(event.item) ? event.item : null;
191
+ if (item && (item.error !== void 0 || item.status === "failed")) {
192
+ return true;
193
+ }
194
+ return false;
195
+ };
196
+ var lastCliMessage = (events, stdout) => {
197
+ for (let i = events.length - 1; i >= 0; i -= 1) {
198
+ const event = events[i];
199
+ if (!event) {
200
+ continue;
201
+ }
202
+ const text = eventMessage(event);
203
+ if (text) {
204
+ return text.slice(0, cliFailureDetailChars);
205
+ }
206
+ }
207
+ return stdout.trim().slice(-cliFailureDetailChars);
208
+ };
209
+ var eventMessage = (event) => {
210
+ const candidates = [event.result];
211
+ const message = isRecord(event.message) ? event.message : null;
212
+ if (Array.isArray(message?.content)) {
213
+ for (const block of message.content) {
214
+ if (isRecord(block) && typeof block.text === "string") {
215
+ candidates.push(block.text);
216
+ }
217
+ }
218
+ }
219
+ if (isRecord(event.item)) {
220
+ candidates.push(event.item.text);
221
+ }
222
+ if (isRecord(event.msg)) {
223
+ candidates.push(event.msg.message);
224
+ }
225
+ candidates.push(event.message);
226
+ if (isRecord(event.error)) {
227
+ candidates.push(event.error.message);
228
+ }
229
+ candidates.push(event.error);
230
+ for (const candidate of candidates) {
231
+ if (typeof candidate === "string" && candidate.trim()) {
232
+ return unwrapApiErrorBody(candidate.trim());
233
+ }
234
+ }
235
+ return null;
236
+ };
237
+ var unwrapApiErrorBody = (text) => {
238
+ if (!text.startsWith("{")) {
239
+ return text;
240
+ }
241
+ try {
242
+ const body = JSON.parse(text);
243
+ if (isRecord(body) && isRecord(body.error) && typeof body.error.message === "string") {
244
+ return typeof body.status === "number" ? `HTTP ${body.status}: ${body.error.message}` : body.error.message;
245
+ }
246
+ } catch {
247
+ }
248
+ return text;
249
+ };
250
+ var withScratchDir = async (runtime, surface, fn) => {
251
+ const dir = await mkdtemp(path.join(tmpdir(), "aeo-agent-probe-"));
252
+ try {
253
+ return await fn(dir);
254
+ } finally {
255
+ await rm(dir, { recursive: true, force: true });
256
+ if (surface === "claude_code" && !runtime.claudeConfigDir) {
257
+ await rm(claudeTranscriptDir(runtime.env, dir), {
258
+ recursive: true,
259
+ force: true
260
+ });
261
+ }
262
+ }
263
+ };
264
+ var claudeTranscriptDir = (env, cwd) => {
265
+ const configDir = env.CLAUDE_CONFIG_DIR ?? path.join(env.HOME ?? homedir(), ".claude");
266
+ return path.join(configDir, "projects", cwd.replaceAll("/", "-"));
267
+ };
268
+ var execCli = async (command, { cliArgs, cwd, runtime, env, signal }) => {
269
+ const local = localCommand(command, cliArgs, runtime.env);
270
+ const result = await runChild(local.command, local.args, {
271
+ cwd,
272
+ env,
273
+ timeoutMs: runtime.timeoutMs ?? agentProbeTimeoutMs,
274
+ maxBuffer: agentMaxBufferBytes,
275
+ killGraceMs: agentKillGraceMs,
276
+ signal
277
+ });
278
+ return { stdout: result.stdout, stderr: result.stderr };
279
+ };
280
+
281
+ export {
282
+ authSettingNames,
283
+ agentProbeTimeoutMs,
284
+ localCommand,
285
+ attachCliOutput,
286
+ classifyAgentError,
287
+ cliFailureSignals,
288
+ describeCliFailure,
289
+ withScratchDir,
290
+ claudeTranscriptDir,
291
+ execCli
292
+ };
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-TCOH3FGE.js";
5
5
  import {
6
6
  computeAISearchSummary
7
- } from "./chunk-QGZ4QSUE.js";
7
+ } from "./chunk-FHV4PBYG.js";
8
8
  import {
9
9
  agentProbedPrompts
10
- } from "./chunk-DL6YQDTE.js";
10
+ } from "./chunk-LOIAGEKN.js";
11
11
  import {
12
12
  evidenceChunkFileName
13
13
  } from "./chunk-EDQTINTL.js";
@@ -6,13 +6,14 @@ import {
6
6
  } from "./chunk-2B5QF6UQ.js";
7
7
  import {
8
8
  resolveSupportedModel
9
- } from "./chunk-W5X7WJYL.js";
9
+ } from "./chunk-FPPHYGIO.js";
10
10
  import {
11
11
  resolveDataForSeoLocale
12
- } from "./chunk-NH4QGBJV.js";
12
+ } from "./chunk-XBSA7MNJ.js";
13
13
  import {
14
- urlIsOnDomain
15
- } from "./chunk-HOJXKHPX.js";
14
+ maxMoneyPages,
15
+ moneyPageProblem
16
+ } from "./chunk-FK2JQHAX.js";
16
17
  import {
17
18
  SourceRetrievalError,
18
19
  validateResearchUrl
@@ -23,10 +24,10 @@ import {
23
24
  chatProbeConfigSchema,
24
25
  defaultMaxPlannedUnits,
25
26
  runRequestSchema
26
- } from "./chunk-DL6YQDTE.js";
27
+ } from "./chunk-LOIAGEKN.js";
27
28
  import {
28
29
  probeLimitsSchema
29
- } from "./chunk-W5XYW6ZM.js";
30
+ } from "./chunk-PT6PK2MJ.js";
30
31
  import {
31
32
  coverageThresholdsSchema
32
33
  } from "./chunk-EZD2C7QS.js";
@@ -93,20 +94,11 @@ var checkHostProblem = (host) => {
93
94
  }
94
95
  return `Use a bare public host name such as docs.acme.example, not ${JSON.stringify(host)}.`;
95
96
  };
96
- var moneyPageProblem = (page, file) => {
97
- try {
98
- validateResearchUrl(page);
99
- } catch (err) {
100
- if (err instanceof SourceRetrievalError) {
101
- return `A money page must be a public https URL with no port or credentials: ${err.message}`;
102
- }
103
- throw err;
97
+ var describeMoneyPageProblem = (page, domain, problem) => {
98
+ if (problem.kind === "unsafe_url") {
99
+ return `A money page must be a public https URL with no port or credentials: ${problem.message}`;
104
100
  }
105
- const hosts = [file.brand.domain, ...file.runPolicy.checkHosts];
106
- if (hosts.some((host) => urlIsOnDomain(page, host))) {
107
- return void 0;
108
- }
109
- return `${page} is not on ${file.brand.domain} or its subdomains. Name its host in runPolicy.checkHosts to let the site checks fetch it.`;
101
+ return `${page} is not on ${domain} or its subdomains. Name its host in runPolicy.checkHosts to let the site checks fetch it.`;
110
102
  };
111
103
  var auditFileSchema = z.object({
112
104
  version: z.literal(auditFileVersion),
@@ -126,7 +118,7 @@ var auditFileSchema = z.object({
126
118
  chatProbes: chatProbeConfigSchema.optional(),
127
119
  geography: z.string().default("us"),
128
120
  language: z.string().default("en"),
129
- moneyPages: z.array(z.url()).max(20).default([]),
121
+ moneyPages: z.array(z.url()).max(maxMoneyPages).default([]),
130
122
  productBrief: z.string().trim().min(1),
131
123
  // `full` researches and adjudicates the claims answers make about the
132
124
  // product; `extraction_only` keeps the claim inventory and skips both.
@@ -153,11 +145,14 @@ var auditFileSchema = z.object({
153
145
  }
154
146
  }
155
147
  for (const [index, page] of file.moneyPages.entries()) {
156
- const problem = moneyPageProblem(page, file);
148
+ const problem = moneyPageProblem(page, {
149
+ domain: file.brand.domain,
150
+ checkHosts: file.runPolicy.checkHosts
151
+ });
157
152
  if (problem !== void 0) {
158
153
  context.addIssue({
159
154
  code: "custom",
160
- message: problem,
155
+ message: describeMoneyPageProblem(page, file.brand.domain, problem),
161
156
  path: ["moneyPages", index]
162
157
  });
163
158
  }
@@ -2,16 +2,16 @@ import {
2
2
  checkIntegrity,
3
3
  checkTraceChain,
4
4
  checkTraceCoverage
5
- } from "./chunk-AJKV46SM.js";
5
+ } from "./chunk-LNYQMWJO.js";
6
6
  import {
7
7
  checkJudgments,
8
8
  checkPlan
9
- } from "./chunk-66DVMLGR.js";
9
+ } from "./chunk-TKOQMB6A.js";
10
10
  import {
11
11
  checkCopy,
12
12
  checkGrounding,
13
13
  checkMetrics
14
- } from "./chunk-SD7LR26G.js";
14
+ } from "./chunk-5JU2Y2I6.js";
15
15
  import {
16
16
  CheckOutcome,
17
17
  checkFrom,
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-6KHQ7DXP.js";
22
22
  import {
23
23
  capturedAnswerOf
24
- } from "./chunk-AK6YNTCV.js";
24
+ } from "./chunk-ASIFUJG2.js";
25
25
  import {
26
26
  bundleManifestSchema,
27
27
  bundlePaths,
@@ -29,7 +29,7 @@ import {
29
29
  predecessorPrefix,
30
30
  readableBundleSchemaVersions,
31
31
  traceSchemaVersion
32
- } from "./chunk-T5XQ6NXD.js";
32
+ } from "./chunk-JJFOILZK.js";
33
33
  import {
34
34
  parseBundleJson
35
35
  } from "./chunk-E6NQQU6V.js";
@@ -1,31 +1,31 @@
1
1
  import {
2
2
  authorDir
3
- } from "./chunk-3OE4UQIB.js";
3
+ } from "./chunk-WRHGLRUK.js";
4
4
  import {
5
5
  readResearchDocuments,
6
6
  readResearchJournal,
7
7
  researchDir,
8
8
  summarizeResearch
9
- } from "./chunk-XAN4CRFP.js";
9
+ } from "./chunk-SQ55KGHO.js";
10
10
  import {
11
11
  enginePackageRoot
12
12
  } from "./chunk-3BFCI7LI.js";
13
13
  import {
14
14
  authorExamples
15
- } from "./chunk-XFUYEFQP.js";
15
+ } from "./chunk-ZBQU2VU3.js";
16
16
  import {
17
17
  writeFileAtomically
18
18
  } from "./chunk-MX6Y4RD2.js";
19
19
  import {
20
20
  authorStageOutputSchema,
21
21
  stageJsonSchema
22
- } from "./chunk-SIJOQRRK.js";
22
+ } from "./chunk-KRXOJJR7.js";
23
23
  import {
24
24
  getEnvironment
25
25
  } from "./chunk-PO2J5OQ3.js";
26
26
  import {
27
27
  validateAuthorOutput
28
- } from "./chunk-7LBSNDRR.js";
28
+ } from "./chunk-3S2FAVRE.js";
29
29
  import {
30
30
  canonicalResearchUrl
31
31
  } from "./chunk-MPJCZN4G.js";
@@ -2,7 +2,7 @@ import {
2
2
  aeoAuditConfigSchema,
3
3
  aeoSectionConfigSchema,
4
4
  agentProbeConfigSchema
5
- } from "./chunk-DL6YQDTE.js";
5
+ } from "./chunk-LOIAGEKN.js";
6
6
  import {
7
7
  proposedProductFactSchema
8
8
  } from "./chunk-6RAKXYSR.js";
@@ -13,18 +13,18 @@ import {
13
13
  import {
14
14
  qualifiedCompetitorsForRow
15
15
  } from "./chunk-GMGKKE5N.js";
16
+ import {
17
+ batchModelInputs
18
+ } from "./chunk-WPCBE2NZ.js";
16
19
  import {
17
20
  askUntilCovered
18
21
  } from "./chunk-JS3GBU3R.js";
19
- import {
20
- batchModelInputs
21
- } from "./chunk-WCLKIPJV.js";
22
22
  import {
23
23
  generateStructured
24
- } from "./chunk-OD36HUXA.js";
24
+ } from "./chunk-Q22FCF4A.js";
25
25
  import {
26
26
  createLog
27
- } from "./chunk-ZSEY7AHQ.js";
27
+ } from "./chunk-BBK54RVK.js";
28
28
  import {
29
29
  domainClassifierVersion,
30
30
  learnedLabels
@@ -43,7 +43,7 @@ import {
43
43
  } from "./chunk-RYCRL3YA.js";
44
44
  import {
45
45
  ModelBudgetError
46
- } from "./chunk-TNL2GWYR.js";
46
+ } from "./chunk-EUXNCXCR.js";
47
47
  import {
48
48
  sourceCategories
49
49
  } from "./chunk-EDQTINTL.js";
@@ -16,6 +16,7 @@ var withModelBudgetProtection = (accounting, profile) => {
16
16
  // Forwarded so a recording accounting still sees the request.
17
17
  observe: (callId, evidence) => accounting.observe?.(callId, evidence) ?? Promise.resolve(),
18
18
  settle: (callId, usage) => accounting.settle(callId, usage),
19
+ release: (callId) => accounting.release(callId),
19
20
  reserve: (call) => {
20
21
  let usd = copy.usd + verifier.usd;
21
22
  let tokens = copy.tokens + verifier.tokens;
@@ -1,8 +1,11 @@
1
+ import {
2
+ searchSourcesMarker
3
+ } from "./chunk-SJCUR4QX.js";
1
4
  import {
2
5
  isStageName,
3
6
  stageJsonSchema,
4
7
  stageSchemas
5
- } from "./chunk-SIJOQRRK.js";
8
+ } from "./chunk-KRXOJJR7.js";
6
9
  import {
7
10
  criteriaForRole,
8
11
  producerGuidance
@@ -11,7 +14,6 @@ import {
11
14
  // src/codex-workflow/workdir.ts
12
15
  import { mkdir, writeFile } from "node:fs/promises";
13
16
  import path from "node:path";
14
- var sourcesMarker = "Sources used by search:";
15
17
  var plainSegmentPattern = /^[a-z0-9_-]+$/;
16
18
  var plainBytePattern = /[a-z0-9_-]/;
17
19
  var answerPathSegment = (value) => {
@@ -34,7 +36,7 @@ var answerFilePath = (record) => {
34
36
  return `${answerSectionPrefix(record.sectionKey)}${answerPathSegment(record.promptId)}/${record.surface}-${record.runIndex}.md`;
35
37
  };
36
38
  var answerBody = (text) => {
37
- const at = text.lastIndexOf(sourcesMarker);
39
+ const at = text.lastIndexOf(searchSourcesMarker);
38
40
  return (at < 0 ? text : text.slice(0, at)).trim();
39
41
  };
40
42
  var materializeWorkdir = async (args) => {
@@ -65,7 +67,7 @@ var materializeWorkdir = async (args) => {
65
67
  for (const record of args.captured) {
66
68
  const file = answerFilePath(record);
67
69
  const text = record.probe.text;
68
- const at = text.lastIndexOf(sourcesMarker);
70
+ const at = text.lastIndexOf(searchSourcesMarker);
69
71
  const body = answerBody(text);
70
72
  const sources = at < 0 ? "" : text.slice(at);
71
73
  const content = [
@@ -179,7 +181,6 @@ ${criterion.guidance}
179
181
  };
180
182
 
181
183
  export {
182
- sourcesMarker,
183
184
  answerPathSegment,
184
185
  answerSectionPrefix,
185
186
  answerFilePath,
@@ -0,0 +1,97 @@
1
+ import {
2
+ claudeCodeProfile,
3
+ runClaudeCodeProbe
4
+ } from "./chunk-CXZIHHLJ.js";
5
+ import {
6
+ codexProfile,
7
+ codexRequestParameters,
8
+ runCodexProbe
9
+ } from "./chunk-JW7DTYSI.js";
10
+ import {
11
+ cursorProfile,
12
+ runCursorProbe
13
+ } from "./chunk-IH67TEGY.js";
14
+ import {
15
+ agentProbeTimeoutMs,
16
+ classifyAgentError
17
+ } from "./chunk-QKTKQSPS.js";
18
+ import {
19
+ retrievalLogSchema
20
+ } from "./chunk-EDQTINTL.js";
21
+
22
+ // src/probes/adapters/cli-agents.ts
23
+ import { z } from "zod";
24
+ var cliAdapterProfiles = {
25
+ claude_code: claudeCodeProfile,
26
+ codex: codexProfile,
27
+ cursor: cursorProfile
28
+ };
29
+ var agentAnswerSchema = z.object({
30
+ text: z.string(),
31
+ usedWebSearch: z.boolean().nullable(),
32
+ retrieval: retrievalLogSchema,
33
+ requestedModel: z.string().nullable().optional(),
34
+ reportedModel: z.string().optional()
35
+ });
36
+ var requestParameters = {
37
+ claude_code: () => ({ cli: "claude" }),
38
+ codex: codexRequestParameters,
39
+ cursor: () => ({ cli: "cursor-agent" })
40
+ };
41
+ var localProbes = {
42
+ claude_code: runClaudeCodeProbe,
43
+ codex: runCodexProbe,
44
+ cursor: runCursorProbe
45
+ };
46
+ var probeForSurface = (surface) => {
47
+ return async (prompt, runtime, signal) => {
48
+ if (!runtime.transport) {
49
+ return localProbes[surface](prompt, runtime, signal);
50
+ }
51
+ const answer = await runtime.transport.invoke(
52
+ surface,
53
+ {
54
+ task: "probe",
55
+ prompt,
56
+ timeoutMs: Math.min(runtime.timeoutMs ?? agentProbeTimeoutMs, 3e5)
57
+ },
58
+ signal
59
+ );
60
+ return agentAnswerSchema.parse(answer);
61
+ };
62
+ };
63
+ var createCliAdapter = (surface, { runtime }) => {
64
+ const run = probeForSurface(surface);
65
+ const adapter = {
66
+ ...cliAdapterProfiles[surface],
67
+ surface,
68
+ request: (promptText) => ({
69
+ prompt: promptText,
70
+ parameters: requestParameters[surface](runtime.env)
71
+ }),
72
+ probe: async (promptText, { signal }) => {
73
+ const answer = await run(promptText, runtime, signal);
74
+ const probeAnswer = {
75
+ answerText: answer.text,
76
+ sources: { format: "none" },
77
+ retrieval: answer.retrieval,
78
+ usedWebSearch: answer.usedWebSearch,
79
+ ...answer.requestedModel !== void 0 && {
80
+ requestedModel: answer.requestedModel
81
+ },
82
+ ...answer.reportedModel !== void 0 && {
83
+ servedModel: answer.reportedModel
84
+ }
85
+ };
86
+ return probeAnswer;
87
+ },
88
+ classifyError: classifyAgentError
89
+ };
90
+ return adapter;
91
+ };
92
+
93
+ export {
94
+ cliAdapterProfiles,
95
+ probeForSurface,
96
+ createCliAdapter
97
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createLog
3
- } from "./chunk-ZSEY7AHQ.js";
3
+ } from "./chunk-BBK54RVK.js";
4
4
  import {
5
5
  isRecord
6
6
  } from "./chunk-7PLK6VGC.js";