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.
- package/dist/cli.mjs +6075 -5175
- package/dist/lib/agents/author-schema.js +5 -5
- package/dist/lib/agents/author-validation.js +9 -7
- package/dist/lib/agents/copy-validation.js +10 -10
- package/dist/lib/agents/copywriter-input.js +9 -9
- package/dist/lib/agents/facts.js +8 -8
- package/dist/lib/agents/narrative-facts.js +6 -6
- package/dist/lib/agents/verifier.js +14 -13
- package/dist/lib/analysis/domain-classifier.js +12 -10
- package/dist/lib/analysis/domain-labels.js +4 -4
- package/dist/lib/analysis/outreach.js +2 -2
- package/dist/lib/analysis/progress.js +9 -9
- package/dist/lib/analysis/retrieval.js +5 -5
- package/dist/lib/analysis/scoring.js +5 -5
- package/dist/lib/analysis/search-analyzer.js +6 -6
- package/dist/lib/analysis/sentiment.js +12 -10
- package/dist/lib/analysis/source-mix.js +2 -2
- package/dist/lib/author/examples.js +6 -6
- package/dist/lib/bundle/contracts.js +6 -6
- package/dist/lib/bundle/export.js +18 -18
- package/dist/lib/bundle/journal.js +7 -7
- package/dist/lib/bundle/project-journal.js +10 -10
- package/dist/lib/bundle/project.js +16 -16
- package/dist/lib/bundle/read.js +19 -19
- package/dist/lib/bundle/recorder.js +8 -8
- package/dist/lib/bundle/redact.js +7 -7
- package/dist/lib/bundle/trace-coverage.js +7 -7
- package/dist/lib/bundle/verify-integrity.js +9 -9
- package/dist/lib/bundle/verify-measurement.js +22 -13
- package/dist/lib/bundle/verify-report.js +24 -16
- package/dist/lib/bundle/verify.js +32 -24
- package/dist/lib/capture-manifest.js +6 -6
- package/dist/lib/checks/crawler-access.js +2 -2
- package/dist/lib/checks/money-pages.js +13 -0
- package/dist/lib/checks/renderability.js +2 -2
- package/dist/lib/checks/run-checks.js +12 -12
- package/dist/lib/chunks/{chunk-XAKME6NM.js → chunk-2C723CW7.js} +1 -1
- package/dist/lib/chunks/chunk-2FDSOZ6Q.js +287 -0
- package/dist/lib/chunks/{chunk-PWOYEIPF.js → chunk-2U5QSA6Q.js} +7 -7
- package/dist/lib/chunks/{chunk-6EI4CVRW.js → chunk-3ESH5NDR.js} +5 -1
- package/dist/lib/chunks/{chunk-7LBSNDRR.js → chunk-3S2FAVRE.js} +22 -3
- package/dist/lib/chunks/{chunk-LR27H2HZ.js → chunk-44NSZBCP.js} +6 -6
- package/dist/lib/chunks/{chunk-JBOOD6MU.js → chunk-4AWFF53U.js} +12 -4
- package/dist/lib/chunks/{chunk-MENTBQGB.js → chunk-4HPMLJKC.js} +4 -4
- package/dist/lib/chunks/{chunk-AAFHXNLU.js → chunk-4Q2WFZ5J.js} +11 -4
- package/dist/lib/chunks/{chunk-SD7LR26G.js → chunk-5JU2Y2I6.js} +2 -2
- package/dist/lib/chunks/{chunk-RPTADJXD.js → chunk-64JFN2Q5.js} +1 -1
- package/dist/lib/chunks/chunk-66UE4TT2.js +245 -0
- package/dist/lib/chunks/chunk-6N3C6E3D.js +105 -0
- package/dist/lib/chunks/{chunk-F2NSJ6PG.js → chunk-6RED3G6K.js} +7 -3
- package/dist/lib/chunks/{chunk-QJZTDZMB.js → chunk-7KLTOVIY.js} +9 -9
- package/dist/lib/chunks/{chunk-PXB4PWJI.js → chunk-7ZR3WDF2.js} +38 -5
- package/dist/lib/chunks/chunk-A5PF7UE2.js +86 -0
- package/dist/lib/chunks/{chunk-JXBLGCXZ.js → chunk-AB7DUTX5.js} +1 -1
- package/dist/lib/chunks/{chunk-WDT2Y7D7.js → chunk-AQCWKHTE.js} +11 -7
- package/dist/lib/chunks/{chunk-SQQ56UP2.js → chunk-ASHFEFCU.js} +3 -3
- package/dist/lib/chunks/{chunk-AK6YNTCV.js → chunk-ASIFUJG2.js} +1 -1
- package/dist/lib/chunks/{chunk-ZSEY7AHQ.js → chunk-BBK54RVK.js} +14 -11
- package/dist/lib/chunks/chunk-BQMUZLHO.js +17 -0
- package/dist/lib/chunks/{chunk-KSOHZKV5.js → chunk-CQNIPZH3.js} +21 -21
- package/dist/lib/chunks/{chunk-7HM6IZ3L.js → chunk-CVEXMYPW.js} +2 -2
- package/dist/lib/chunks/chunk-CXZIHHLJ.js +95 -0
- package/dist/lib/chunks/{chunk-75DMLOQ7.js → chunk-CYJNBVQB.js} +1 -1
- package/dist/lib/chunks/{chunk-FAUFE7MI.js → chunk-D7N5OLYL.js} +1 -1
- package/dist/lib/chunks/{chunk-E2YTTB6Q.js → chunk-DSK3PM4Z.js} +1 -1
- package/dist/lib/chunks/{chunk-TNL2GWYR.js → chunk-EUXNCXCR.js} +22 -0
- package/dist/lib/chunks/{chunk-FJL2V6P5.js → chunk-F4EQULFR.js} +6 -6
- package/dist/lib/chunks/{chunk-QGZ4QSUE.js → chunk-FHV4PBYG.js} +1 -1
- package/dist/lib/chunks/chunk-FK2JQHAX.js +30 -0
- package/dist/lib/chunks/{chunk-K2FZFESR.js → chunk-FONFW67K.js} +4 -4
- package/dist/lib/chunks/{chunk-W5X7WJYL.js → chunk-FPPHYGIO.js} +3 -3
- package/dist/lib/chunks/{chunk-XNTFOVCE.js → chunk-FYE4R5TY.js} +2 -2
- package/dist/lib/chunks/{chunk-FIC7JSR4.js → chunk-H2DOBJZC.js} +2 -2
- package/dist/lib/chunks/{chunk-R2AJYV6A.js → chunk-HEWHNSDP.js} +68 -36
- package/dist/lib/chunks/{chunk-RXSHKWZJ.js → chunk-HLC6OHGO.js} +2 -2
- package/dist/lib/chunks/{chunk-6HMHXSCS.js → chunk-HXXFRZTJ.js} +2 -2
- package/dist/lib/chunks/{chunk-JYFEXVWC.js → chunk-HYMWNGOK.js} +13 -6
- package/dist/lib/chunks/chunk-IH67TEGY.js +73 -0
- package/dist/lib/chunks/{chunk-JKPBXPCW.js → chunk-IMADI2YP.js} +1 -1
- package/dist/lib/chunks/{chunk-SLAPBFRH.js → chunk-JBGQFPTY.js} +4 -4
- package/dist/lib/chunks/{chunk-JQDQVG3D.js → chunk-JDU3ZCKO.js} +1 -1
- package/dist/lib/chunks/{chunk-2KH7LNK7.js → chunk-JGIX427K.js} +7 -7
- package/dist/lib/chunks/{chunk-7CW6U5WJ.js → chunk-JIE2ANVD.js} +1 -1
- package/dist/lib/chunks/{chunk-T5XQ6NXD.js → chunk-JJFOILZK.js} +2 -2
- package/dist/lib/chunks/{chunk-F7DBTXKG.js → chunk-JMIK2QN3.js} +4 -3
- package/dist/lib/chunks/chunk-JW7DTYSI.js +116 -0
- package/dist/lib/chunks/{chunk-BFWK3TBN.js → chunk-JXLCKACO.js} +2 -2
- package/dist/lib/chunks/{chunk-7WO3FFPS.js → chunk-K5NQDJLE.js} +1 -1
- package/dist/lib/chunks/{chunk-BXF4OC74.js → chunk-KI2FB4Y3.js} +30 -16
- package/dist/lib/chunks/{chunk-Y2CZ6FZY.js → chunk-KRWDELRS.js} +30 -7
- package/dist/lib/chunks/{chunk-SIJOQRRK.js → chunk-KRXOJJR7.js} +1 -1
- package/dist/lib/chunks/chunk-KSUI4DAY.js +15 -0
- package/dist/lib/chunks/chunk-KXFZ3CH3.js +98 -0
- package/dist/lib/chunks/{chunk-3OWJBGQE.js → chunk-LJCWZ5SZ.js} +14 -14
- package/dist/lib/chunks/{chunk-AJKV46SM.js → chunk-LNYQMWJO.js} +3 -3
- package/dist/lib/chunks/{chunk-DL6YQDTE.js → chunk-LOIAGEKN.js} +2 -2
- package/dist/lib/chunks/{chunk-I3UE52ZV.js → chunk-LPOIMPJK.js} +2 -2
- package/dist/lib/chunks/{chunk-66T7JC57.js → chunk-LUKP64NX.js} +2 -2
- package/dist/lib/chunks/chunk-MNG5TZRW.js +208 -0
- package/dist/lib/chunks/{chunk-SMPP7B7F.js → chunk-MPQXB7HN.js} +7 -7
- package/dist/lib/chunks/{chunk-6JICXLDA.js → chunk-MZ2KN3IH.js} +3 -3
- package/dist/lib/chunks/chunk-N62G4EWT.js +91 -0
- package/dist/lib/chunks/{chunk-7YDXD4MD.js → chunk-ODIXZHHX.js} +1 -1
- package/dist/lib/chunks/{chunk-MTDYBJXH.js → chunk-OTVHGRCO.js} +8 -8
- package/dist/lib/chunks/{chunk-YZEZRQIG.js → chunk-OVF27NAO.js} +69 -17
- package/dist/lib/chunks/chunk-P6LHGBYU.js +90 -0
- package/dist/lib/chunks/{chunk-U5USH2HB.js → chunk-PAL5SXIP.js} +1 -1
- package/dist/lib/chunks/{chunk-W5XYW6ZM.js → chunk-PT6PK2MJ.js} +26 -19
- package/dist/lib/chunks/{chunk-OD36HUXA.js → chunk-Q22FCF4A.js} +6 -7
- package/dist/lib/chunks/chunk-QKTKQSPS.js +292 -0
- package/dist/lib/chunks/{chunk-K4Y5NT4M.js → chunk-QO5TPMWS.js} +2 -2
- package/dist/lib/chunks/{chunk-VPXYGN4I.js → chunk-QUZYFAGP.js} +17 -22
- package/dist/lib/chunks/{chunk-HI3PD3KR.js → chunk-QVMPTT7R.js} +5 -5
- package/dist/lib/chunks/{chunk-OQFAMKLN.js → chunk-RGZY6YUQ.js} +5 -5
- package/dist/lib/chunks/{chunk-U6BW6LGX.js → chunk-RM2VVR7Y.js} +1 -1
- package/dist/lib/chunks/{chunk-AJO7XVXK.js → chunk-RMSH7RUG.js} +6 -6
- package/dist/lib/chunks/{chunk-V5B6UZ3E.js → chunk-RQGEPR6V.js} +1 -0
- package/dist/lib/chunks/{chunk-V5JJEEBT.js → chunk-RYB77E7O.js} +6 -5
- package/dist/lib/chunks/chunk-S24JGY7B.js +97 -0
- package/dist/lib/chunks/{chunk-6GKKALCI.js → chunk-SF4UJ2AY.js} +1 -1
- package/dist/lib/chunks/chunk-SJCUR4QX.js +94 -0
- package/dist/lib/chunks/{chunk-XAN4CRFP.js → chunk-SQ55KGHO.js} +1 -1
- package/dist/lib/chunks/{chunk-66DVMLGR.js → chunk-TKOQMB6A.js} +7 -7
- package/dist/lib/chunks/{chunk-UYDQXXDQ.js → chunk-TWK6IA4P.js} +1 -1
- package/dist/lib/chunks/{chunk-DVFFYY5G.js → chunk-U42I3SBR.js} +13 -9
- package/dist/lib/chunks/{chunk-FL6LN2K6.js → chunk-UECQONVZ.js} +5 -5
- package/dist/lib/chunks/{chunk-FDM2YNQL.js → chunk-VTY53IFN.js} +1 -1
- package/dist/lib/chunks/chunk-VYUC772A.js +338 -0
- package/dist/lib/chunks/{chunk-WCLKIPJV.js → chunk-WPCBE2NZ.js} +1 -1
- package/dist/lib/chunks/{chunk-3OE4UQIB.js → chunk-WRHGLRUK.js} +5 -5
- package/dist/lib/chunks/{chunk-3GPUCXVA.js → chunk-WUIY7BXR.js} +36 -19
- package/dist/lib/chunks/{chunk-7YYDUHJG.js → chunk-WZA4H4TG.js} +39 -13
- package/dist/lib/chunks/{chunk-NH4QGBJV.js → chunk-XBSA7MNJ.js} +7 -2
- package/dist/lib/chunks/chunk-XTBCXEH7.js +243 -0
- package/dist/lib/chunks/{chunk-ZQ3ER7JD.js → chunk-YPVJAXPP.js} +1 -1
- package/dist/lib/chunks/{chunk-SASE7U6E.js → chunk-YQD5ITKI.js} +1 -1
- package/dist/lib/chunks/{chunk-DDS4G4DO.js → chunk-YY4BH5XM.js} +6 -6
- package/dist/lib/chunks/{chunk-J5NPHPXY.js → chunk-Z3BZRBQF.js} +36 -2
- package/dist/lib/chunks/{chunk-XFUYEFQP.js → chunk-ZBQU2VU3.js} +1 -1
- package/dist/lib/chunks/{chunk-E3OGPTUY.js → chunk-ZHGABG7L.js} +2 -2
- package/dist/lib/chunks/chunk-ZZCRYG36.js +31 -0
- package/dist/lib/cli/bundle-commands.js +91 -74
- package/dist/lib/cli/run-commands.js +141 -96
- package/dist/lib/cli/status-command.js +77 -60
- package/dist/lib/codex-workflow/aggregate.js +20 -12
- package/dist/lib/codex-workflow/author-tools.js +7 -7
- package/dist/lib/codex-workflow/author.js +25 -23
- package/dist/lib/codex-workflow/capture.js +39 -18
- package/dist/lib/codex-workflow/checkpoint.js +7 -7
- package/dist/lib/codex-workflow/checks.js +9 -9
- package/dist/lib/codex-workflow/copy-editor.js +20 -19
- package/dist/lib/codex-workflow/copy-recovery.js +4 -4
- package/dist/lib/codex-workflow/copy.js +17 -16
- package/dist/lib/codex-workflow/finish.js +29 -25
- package/dist/lib/codex-workflow/host-models.js +2 -2
- package/dist/lib/codex-workflow/loop.js +54 -48
- package/dist/lib/codex-workflow/quality.js +4 -4
- package/dist/lib/codex-workflow/run-inputs.js +6 -6
- package/dist/lib/codex-workflow/run-source.js +16 -16
- package/dist/lib/codex-workflow/schemas.js +6 -6
- package/dist/lib/codex-workflow/session.js +8 -8
- package/dist/lib/codex-workflow/stage.js +32 -29
- package/dist/lib/codex-workflow/workdir.js +18 -11
- package/dist/lib/engine/audit-file.js +9 -8
- package/dist/lib/engine/author.js +40 -37
- package/dist/lib/engine/cost-estimate.js +37 -9
- package/dist/lib/engine/local-run.js +76 -59
- package/dist/lib/engine/preflight.js +37 -9
- package/dist/lib/engine/rejudge.js +82 -65
- package/dist/lib/engine/run-bindings.js +62 -0
- package/dist/lib/engine/run-status.js +77 -60
- package/dist/lib/engine/templates.js +10 -9
- package/dist/lib/grounding/controller.js +8 -7
- package/dist/lib/grounding/extract.js +8 -6
- package/dist/lib/grounding/grounding-runtime.js +22 -21
- package/dist/lib/grounding/model-usage.js +2 -2
- package/dist/lib/grounding/model.js +7 -5
- package/dist/lib/grounding/recorded-tools.js +9 -9
- package/dist/lib/harness/report/artifacts.js +5 -5
- package/dist/lib/lib/checkpoint.js +5 -5
- package/dist/lib/lib/log.js +1 -1
- package/dist/lib/models/accounting.js +1 -1
- package/dist/lib/models/batching.js +6 -4
- package/dist/lib/models/budget-protection.js +1 -1
- package/dist/lib/models/cost-coefficients.js +2 -1
- package/dist/lib/models/gateway-cost.js +7 -0
- package/dist/lib/models/structured.js +5 -3
- package/dist/lib/models/supported-models.js +1 -1
- package/dist/lib/pipeline.js +36 -17
- package/dist/lib/probes/adapter.js +6 -0
- package/dist/lib/probes/adapters/cli-agents.js +44 -0
- package/dist/lib/probes/adapters/cli-claude-code.js +21 -0
- package/dist/lib/probes/adapters/cli-codex.js +23 -0
- package/dist/lib/probes/adapters/cli-cursor.js +21 -0
- package/dist/lib/probes/adapters/cli-process.js +34 -0
- package/dist/lib/probes/adapters/dataforseo-ai-overview.js +20 -0
- package/dist/lib/probes/adapters/gateway-chat.js +30 -0
- package/dist/lib/probes/adapters/gateway-perplexity.js +19 -0
- package/dist/lib/probes/agent-cli-parsers.js +2 -2
- package/dist/lib/probes/agent-clis.js +26 -11
- package/dist/lib/probes/answer-text.js +21 -0
- package/dist/lib/probes/attempt.js +28 -0
- package/dist/lib/probes/bindings.js +69 -0
- package/dist/lib/probes/charged-trace.js +47 -3
- package/dist/lib/probes/dataforseo-locale.js +1 -1
- package/dist/lib/probes/dataforseo.js +8 -5
- package/dist/lib/probes/grounding-urls.js +6 -4
- package/dist/lib/probes/legacy-bindings.js +7 -0
- package/dist/lib/probes/limits.js +1 -1
- package/dist/lib/probes/probes.js +33 -12
- package/dist/lib/runner.js +17 -14
- package/dist/lib/schema.js +4 -4
- package/dist/lib/section-result.js +6 -6
- package/dist/lib/stores/artifacts.js +7 -7
- package/dist/lib/stores/files.js +20 -18
- package/dist/lib/stores/local-versions.js +5 -5
- package/dist/lib/stores/memory.js +20 -15
- package/dist/lib/stores/publication.js +11 -11
- package/dist/lib/stores/unit-record.js +28 -0
- package/dist/lib/viewer/server.js +33 -25
- package/dist/lib/workflow/schema.js +3 -3
- package/dist/types/bundle/contracts.d.ts +1 -1
- package/dist/types/capture-manifest.d.ts +1 -0
- package/dist/types/checks/money-pages.d.ts +19 -0
- package/dist/types/codex-workflow/capture.d.ts +13 -0
- package/dist/types/codex-workflow/workdir.d.ts +0 -1
- package/dist/types/engine/cost-estimate.d.ts +5 -1
- package/dist/types/engine/preflight.d.ts +6 -1
- package/dist/types/engine/run-bindings.d.ts +25 -0
- package/dist/types/models/accounting.d.ts +7 -0
- package/dist/types/models/cost-coefficients.d.ts +5 -5
- package/dist/types/models/gateway-cost.d.ts +3 -0
- package/dist/types/pipeline.d.ts +2 -0
- package/dist/types/probes/adapter.d.ts +112 -0
- package/dist/types/probes/adapters/cli-agents.d.ts +19 -0
- package/dist/types/probes/adapters/cli-claude-code.d.ts +4 -0
- package/dist/types/probes/adapters/cli-codex.d.ts +10 -0
- package/dist/types/probes/adapters/cli-cursor.d.ts +4 -0
- package/dist/types/probes/adapters/cli-process.d.ts +86 -0
- package/dist/types/probes/adapters/dataforseo-ai-overview.d.ts +12 -0
- package/dist/types/probes/adapters/gateway-chat.d.ts +32 -0
- package/dist/types/probes/adapters/gateway-perplexity.d.ts +10 -0
- package/dist/types/probes/agent-clis.d.ts +7 -49
- package/dist/types/probes/answer-text.d.ts +20 -0
- package/dist/types/probes/attempt.d.ts +113 -0
- package/dist/types/probes/bindings.d.ts +79 -0
- package/dist/types/probes/charged-trace.d.ts +2 -1
- package/dist/types/probes/dataforseo.d.ts +24 -1
- package/dist/types/probes/grounding-urls.d.ts +18 -5
- package/dist/types/probes/legacy-bindings.d.ts +36 -0
- package/dist/types/probes/limits.d.ts +12 -6
- package/dist/types/probes/probe-trace.d.ts +10 -0
- package/dist/types/probes/probes.d.ts +5 -3
- package/dist/types/stores/ports.d.ts +1 -0
- package/dist/types/stores/unit-record.d.ts +11 -0
- package/package.json +6 -6
- package/src/agents/author-validation.ts +22 -1
- package/src/analysis/progress.ts +10 -1
- package/src/bundle/contracts.ts +1 -1
- package/src/bundle/recorder.ts +47 -1
- package/src/capture-manifest.ts +6 -0
- package/src/checks/money-pages.ts +48 -0
- package/src/cli/run-commands.ts +37 -1
- package/src/codex-workflow/capture.ts +60 -0
- package/src/codex-workflow/workdir.ts +3 -4
- package/src/engine/audit-file.ts +20 -30
- package/src/engine/cost-estimate.ts +10 -4
- package/src/engine/local-run.ts +21 -2
- package/src/engine/preflight.ts +113 -17
- package/src/engine/rejudge.ts +5 -0
- package/src/engine/run-bindings.ts +142 -0
- package/src/grounding/extract.ts +1 -0
- package/src/grounding/model-usage.ts +4 -0
- package/src/lib/log.ts +17 -15
- package/src/models/accounting.ts +34 -0
- package/src/models/budget-protection.ts +1 -0
- package/src/models/cost-coefficients.ts +17 -13
- package/src/models/gateway-cost.ts +32 -0
- package/src/models/structured.ts +2 -10
- package/src/models/supported-models.ts +3 -3
- package/src/pipeline.ts +36 -17
- package/src/probes/adapter.ts +122 -0
- package/src/probes/adapters/cli-agents.ts +123 -0
- package/src/probes/adapters/cli-claude-code.ts +119 -0
- package/src/probes/adapters/cli-codex.ts +145 -0
- package/src/probes/adapters/cli-cursor.ts +95 -0
- package/src/probes/adapters/cli-process.ts +522 -0
- package/src/probes/adapters/dataforseo-ai-overview.ts +106 -0
- package/src/probes/adapters/gateway-chat.ts +339 -0
- package/src/probes/adapters/gateway-perplexity.ts +104 -0
- package/src/probes/agent-clis.ts +151 -1088
- package/src/probes/answer-text.ts +153 -0
- package/src/probes/attempt.ts +462 -0
- package/src/probes/bindings.ts +344 -0
- package/src/probes/charged-trace.ts +54 -13
- package/src/probes/dataforseo-locale.ts +13 -2
- package/src/probes/dataforseo.ts +265 -188
- package/src/probes/grounding-urls.ts +68 -19
- package/src/probes/legacy-bindings.ts +40 -0
- package/src/probes/limits.ts +31 -18
- package/src/probes/probe-trace.ts +10 -0
- package/src/probes/probes.ts +64 -736
- package/src/runner.ts +13 -0
- package/src/stores/files.ts +78 -54
- package/src/stores/memory.ts +4 -1
- package/src/stores/ports.ts +3 -0
- package/src/stores/unit-record.ts +151 -0
- package/dist/lib/chunks/chunk-BGAHZIL3.js +0 -563
- package/dist/lib/chunks/chunk-IB6RROHE.js +0 -204
- package/dist/lib/chunks/chunk-WZGI7UVM.js +0 -937
|
@@ -58,22 +58,35 @@ export const extractGroundingRedirectUrls = (text: string): string[] => {
|
|
|
58
58
|
return matches.map(stripTrailingPunctuation);
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
/** What resolving one wrapper URL found: its target, or why there is none,
|
|
62
|
+
* after how many requests. Recorded in the probe's journal operation. */
|
|
63
|
+
export type RedirectResolution = {
|
|
64
|
+
url: string;
|
|
65
|
+
target: string | null;
|
|
66
|
+
hops: number;
|
|
67
|
+
failure?: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
61
70
|
/**
|
|
62
|
-
* Resolves every unique grounding-redirect URL in `urls` to its real target
|
|
63
|
-
*
|
|
64
|
-
* (callers keep the original URL), so a flaky
|
|
65
|
-
* Runs a sliding-window worker pool so one slow
|
|
66
|
-
* slot, not a whole batch.
|
|
71
|
+
* Resolves every unique grounding-redirect URL in `urls` to its real target
|
|
72
|
+
* and reports each attempt. `resolved` maps redirect URL → resolved URL;
|
|
73
|
+
* failures are absent from it (callers keep the original URL), so a flaky
|
|
74
|
+
* redirect never fails a run. Runs a sliding-window worker pool so one slow
|
|
75
|
+
* URL only delays its own slot, not a whole batch.
|
|
67
76
|
*/
|
|
68
|
-
export const
|
|
77
|
+
export const traceGroundingRedirects = async (
|
|
69
78
|
urls: Iterable<string>,
|
|
70
79
|
logContext: Record<string, unknown> = {},
|
|
71
|
-
): Promise<
|
|
80
|
+
): Promise<{
|
|
81
|
+
resolved: Map<string, string>;
|
|
82
|
+
resolutions: RedirectResolution[];
|
|
83
|
+
}> => {
|
|
72
84
|
const unique = [...new Set([...urls].filter(isGroundingRedirectUrl))];
|
|
73
85
|
const resolved = new Map<string, string>();
|
|
86
|
+
const resolutions: RedirectResolution[] = [];
|
|
74
87
|
|
|
75
88
|
if (unique.length === 0) {
|
|
76
|
-
return resolved;
|
|
89
|
+
return { resolved, resolutions };
|
|
77
90
|
}
|
|
78
91
|
|
|
79
92
|
let nextIndex = 0;
|
|
@@ -88,10 +101,12 @@ export const resolveGroundingRedirects = async (
|
|
|
88
101
|
continue;
|
|
89
102
|
}
|
|
90
103
|
|
|
91
|
-
const
|
|
104
|
+
const resolution = await resolveOne(url);
|
|
92
105
|
|
|
93
|
-
|
|
94
|
-
|
|
106
|
+
resolutions.push(resolution);
|
|
107
|
+
|
|
108
|
+
if (resolution.target) {
|
|
109
|
+
resolved.set(url, resolution.target);
|
|
95
110
|
}
|
|
96
111
|
}
|
|
97
112
|
},
|
|
@@ -105,53 +120,87 @@ export const resolveGroundingRedirects = async (
|
|
|
105
120
|
resolved: resolved.size,
|
|
106
121
|
});
|
|
107
122
|
|
|
123
|
+
// In the order the URLs were found, whatever order the pool finished in.
|
|
124
|
+
resolutions.sort((a, b) => unique.indexOf(a.url) - unique.indexOf(b.url));
|
|
125
|
+
|
|
126
|
+
return { resolved, resolutions };
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
/** resolveGroundingRedirects is traceGroundingRedirects' map alone. */
|
|
130
|
+
export const resolveGroundingRedirects = async (
|
|
131
|
+
urls: Iterable<string>,
|
|
132
|
+
logContext: Record<string, unknown> = {},
|
|
133
|
+
): Promise<Map<string, string>> => {
|
|
134
|
+
const { resolved } = await traceGroundingRedirects(urls, logContext);
|
|
135
|
+
|
|
108
136
|
return resolved;
|
|
109
137
|
};
|
|
110
138
|
|
|
111
|
-
const resolveOne = async (url: string): Promise<
|
|
139
|
+
const resolveOne = async (url: string): Promise<RedirectResolution> => {
|
|
140
|
+
let hops = 0;
|
|
141
|
+
|
|
112
142
|
try {
|
|
113
143
|
let current = url;
|
|
114
144
|
|
|
115
|
-
|
|
145
|
+
while (hops < maxRedirectHops) {
|
|
116
146
|
const response = await fetch(current, {
|
|
117
147
|
method: 'GET',
|
|
118
148
|
redirect: 'manual',
|
|
119
149
|
signal: AbortSignal.timeout(resolveTimeoutMs),
|
|
120
150
|
});
|
|
121
151
|
|
|
152
|
+
hops += 1;
|
|
153
|
+
|
|
122
154
|
const location = response.headers.get('location');
|
|
123
155
|
|
|
124
156
|
if (response.status < 300 || response.status >= 400 || !location) {
|
|
125
157
|
// A non-redirect answer carries a body nobody reads; release it.
|
|
126
158
|
await response.body?.cancel().catch(() => undefined);
|
|
127
159
|
|
|
128
|
-
return
|
|
160
|
+
return {
|
|
161
|
+
url,
|
|
162
|
+
target: null,
|
|
163
|
+
hops,
|
|
164
|
+
failure: `HTTP ${response.status} without a redirect`,
|
|
165
|
+
};
|
|
129
166
|
}
|
|
130
167
|
|
|
131
168
|
await response.body?.cancel().catch(() => undefined);
|
|
132
169
|
const target = new URL(location, current);
|
|
133
170
|
|
|
134
171
|
if (target.protocol !== 'http:' && target.protocol !== 'https:') {
|
|
135
|
-
return
|
|
172
|
+
return {
|
|
173
|
+
url,
|
|
174
|
+
target: null,
|
|
175
|
+
hops,
|
|
176
|
+
failure: `redirect to a ${target.protocol} URL`,
|
|
177
|
+
};
|
|
136
178
|
}
|
|
137
179
|
|
|
138
180
|
// Off the allow-list means we reached the real page: record it.
|
|
139
181
|
if (!isGroundingRedirectUrl(target.href)) {
|
|
140
|
-
return target.href;
|
|
182
|
+
return { url, target: target.href, hops };
|
|
141
183
|
}
|
|
142
184
|
|
|
143
185
|
current = target.href;
|
|
144
186
|
}
|
|
145
187
|
|
|
146
188
|
// Still on a wrapper after the hop budget — treat as unresolved.
|
|
147
|
-
return
|
|
189
|
+
return {
|
|
190
|
+
url,
|
|
191
|
+
target: null,
|
|
192
|
+
hops,
|
|
193
|
+
failure: `still a redirect wrapper after ${maxRedirectHops} hops`,
|
|
194
|
+
};
|
|
148
195
|
} catch (error) {
|
|
196
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
197
|
+
|
|
149
198
|
log.warn('Failed to resolve grounding redirect', {
|
|
150
199
|
url: url.slice(0, 120),
|
|
151
|
-
error:
|
|
200
|
+
error: message,
|
|
152
201
|
});
|
|
153
202
|
|
|
154
|
-
return null;
|
|
203
|
+
return { url, target: null, hops, failure: message.slice(0, 300) };
|
|
155
204
|
}
|
|
156
205
|
};
|
|
157
206
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AeoSurface } from '../surfaces';
|
|
2
|
+
import { ProbeAdapterId } from './adapter';
|
|
3
|
+
|
|
4
|
+
// ============================================================================
|
|
5
|
+
// The legacy bindings (specs/aeo-probe-adapters-spec.md §4.6): each
|
|
6
|
+
// surface's adapter and model as of literally-aeo 0.2.0. Frozen forever:
|
|
7
|
+
// a capture that records no adapter was taken with its surface's legacy
|
|
8
|
+
// binding. The default bindings (bindings.ts) start equal to this table and
|
|
9
|
+
// change only in a method release. Zod-free and SDK-free, so the progress
|
|
10
|
+
// projection can read it.
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
export type ProbeBinding = {
|
|
14
|
+
adapter: ProbeAdapterId;
|
|
15
|
+
/** The model a model-API adapter asks for. */
|
|
16
|
+
model?: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const legacyProbeBindings = {
|
|
20
|
+
chatgpt: {
|
|
21
|
+
adapter: ProbeAdapterId.GATEWAY_OPENAI,
|
|
22
|
+
model: 'openai/gpt-5.4-mini',
|
|
23
|
+
},
|
|
24
|
+
gemini: {
|
|
25
|
+
adapter: ProbeAdapterId.GATEWAY_GOOGLE,
|
|
26
|
+
model: 'google/gemini-3-flash',
|
|
27
|
+
},
|
|
28
|
+
claude: {
|
|
29
|
+
adapter: ProbeAdapterId.GATEWAY_ANTHROPIC,
|
|
30
|
+
model: 'anthropic/claude-sonnet-4.5',
|
|
31
|
+
},
|
|
32
|
+
perplexity: {
|
|
33
|
+
adapter: ProbeAdapterId.GATEWAY_PERPLEXITY,
|
|
34
|
+
model: 'perplexity/sonar-pro',
|
|
35
|
+
},
|
|
36
|
+
google_ai_overview: { adapter: ProbeAdapterId.DATAFORSEO_AI_OVERVIEW },
|
|
37
|
+
claude_code: { adapter: ProbeAdapterId.CLI_CLAUDE_CODE },
|
|
38
|
+
codex: { adapter: ProbeAdapterId.CLI_CODEX },
|
|
39
|
+
cursor: { adapter: ProbeAdapterId.CLI_CURSOR },
|
|
40
|
+
} as const satisfies Record<AeoSurface, ProbeBinding>;
|
package/src/probes/limits.ts
CHANGED
|
@@ -70,11 +70,16 @@ class Semaphore {
|
|
|
70
70
|
|
|
71
71
|
type RunOptions = {
|
|
72
72
|
signal?: AbortSignal;
|
|
73
|
+
/** A pause of its own the work also waits out, beside its pool's: one
|
|
74
|
+
* adapter's capacity pause, so a 429 on one surface never holds back
|
|
75
|
+
* another surface sharing the pool. */
|
|
76
|
+
pauseKey?: string;
|
|
73
77
|
};
|
|
74
78
|
|
|
75
79
|
export class ProbeLimiter {
|
|
76
80
|
readonly #pools: Record<ProbeProvider, Semaphore>;
|
|
77
|
-
|
|
81
|
+
// When each paused pool or adapter may resume, by its key.
|
|
82
|
+
readonly #resumeAtMs = new Map<string, number>();
|
|
78
83
|
|
|
79
84
|
constructor(limits: ProbeLimits) {
|
|
80
85
|
this.#pools = {
|
|
@@ -88,26 +93,29 @@ export class ProbeLimiter {
|
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
/**
|
|
91
|
-
* Holds new work
|
|
92
|
-
*
|
|
93
|
-
*
|
|
96
|
+
* Holds new work under `key` (a provider pool, or the pause key of one
|
|
97
|
+
* adapter) for `delayMs`, extending any pause already running. A
|
|
98
|
+
* rate-limited provider then sees one retry per window instead of every
|
|
99
|
+
* queued unit spending an attempt on the same 429.
|
|
94
100
|
*/
|
|
95
|
-
pause(
|
|
101
|
+
pause(key: string, delayMs: number): void {
|
|
96
102
|
const resumeAtMs = Date.now() + delayMs;
|
|
97
103
|
|
|
98
|
-
this.#resumeAtMs
|
|
99
|
-
|
|
100
|
-
resumeAtMs,
|
|
104
|
+
this.#resumeAtMs.set(
|
|
105
|
+
key,
|
|
106
|
+
Math.max(this.#resumeAtMs.get(key) ?? 0, resumeAtMs),
|
|
101
107
|
);
|
|
102
108
|
}
|
|
103
109
|
|
|
104
|
-
/** Runs `fn` once the provider
|
|
110
|
+
/** Runs `fn` once neither the provider nor the work's own pause key is
|
|
111
|
+
* paused and a slot on the provider's pool is free. */
|
|
105
112
|
async run<T>(
|
|
106
113
|
provider: ProbeProvider,
|
|
107
114
|
fn: () => Promise<T>,
|
|
108
|
-
{ signal }: RunOptions = {},
|
|
115
|
+
{ signal, pauseKey }: RunOptions = {},
|
|
109
116
|
): Promise<T> {
|
|
110
|
-
const
|
|
117
|
+
const keys = pauseKey === undefined ? [provider] : [provider, pauseKey];
|
|
118
|
+
const release = await this.#acquire(provider, keys, signal);
|
|
111
119
|
|
|
112
120
|
try {
|
|
113
121
|
return await fn();
|
|
@@ -118,15 +126,16 @@ export class ProbeLimiter {
|
|
|
118
126
|
|
|
119
127
|
async #acquire(
|
|
120
128
|
provider: ProbeProvider,
|
|
129
|
+
keys: readonly string[],
|
|
121
130
|
signal: AbortSignal | undefined,
|
|
122
131
|
): Promise<() => void> {
|
|
123
132
|
for (;;) {
|
|
124
|
-
await this.#waitForResume(
|
|
133
|
+
await this.#waitForResume(keys, signal);
|
|
125
134
|
|
|
126
135
|
const release = await this.#pools[provider].acquire();
|
|
127
136
|
|
|
128
137
|
// A pause may have started while this caller queued for the slot.
|
|
129
|
-
if (this.#getPauseMs(
|
|
138
|
+
if (this.#getPauseMs(keys) <= 0 || signal?.aborted) {
|
|
130
139
|
return release;
|
|
131
140
|
}
|
|
132
141
|
|
|
@@ -135,16 +144,20 @@ export class ProbeLimiter {
|
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
async #waitForResume(
|
|
138
|
-
|
|
147
|
+
keys: readonly string[],
|
|
139
148
|
signal: AbortSignal | undefined,
|
|
140
149
|
): Promise<void> {
|
|
141
|
-
while (this.#getPauseMs(
|
|
142
|
-
await sleep(this.#getPauseMs(
|
|
150
|
+
while (this.#getPauseMs(keys) > 0 && !signal?.aborted) {
|
|
151
|
+
await sleep(this.#getPauseMs(keys), signal);
|
|
143
152
|
}
|
|
144
153
|
}
|
|
145
154
|
|
|
146
|
-
#getPauseMs(
|
|
147
|
-
|
|
155
|
+
#getPauseMs(keys: readonly string[]): number {
|
|
156
|
+
const now = Date.now();
|
|
157
|
+
|
|
158
|
+
return Math.max(
|
|
159
|
+
...keys.map((key) => (this.#resumeAtMs.get(key) ?? 0) - now),
|
|
160
|
+
);
|
|
148
161
|
}
|
|
149
162
|
}
|
|
150
163
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { RetrievalLog } from '../schema';
|
|
2
2
|
import type { AeoSurface } from '../surfaces';
|
|
3
|
+
import type { ProbeRequest } from './adapter';
|
|
4
|
+
import type { RedirectResolution } from './grounding-urls';
|
|
3
5
|
|
|
4
6
|
// ============================================================================
|
|
5
7
|
// The probes' view of the run journal (specs/aeo-open-source-cli-spec.md
|
|
@@ -19,6 +21,11 @@ export type ProbeAttemptStart = {
|
|
|
19
21
|
retryOf?: string;
|
|
20
22
|
/** What the probe asks for, when it is known before dispatch. */
|
|
21
23
|
requestedModel: string | null;
|
|
24
|
+
/** The adapter dispatching the attempt (spec §4.9). */
|
|
25
|
+
adapter?: string;
|
|
26
|
+
/** The request as dispatched: the prompt with any prefix, and the
|
|
27
|
+
* parameters that shape the answer. */
|
|
28
|
+
request?: ProbeRequest;
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
export type ProbeAttemptEnd =
|
|
@@ -31,6 +38,9 @@ export type ProbeAttemptEnd =
|
|
|
31
38
|
noOverview?: true;
|
|
32
39
|
/** What the provider reported the attempt cost, when it did. */
|
|
33
40
|
costUsd?: number;
|
|
41
|
+
/** The redirect resolutions finalising the answer made: the network
|
|
42
|
+
* requests after the provider answered. */
|
|
43
|
+
redirects?: readonly RedirectResolution[];
|
|
34
44
|
}
|
|
35
45
|
| {
|
|
36
46
|
outcome: 'failed' | 'cancelled';
|