literally-aeo 0.2.2 → 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 +6031 -5158
- package/dist/lib/agents/author-schema.js +5 -5
- package/dist/lib/agents/author-validation.js +7 -7
- package/dist/lib/agents/copy-validation.js +9 -9
- package/dist/lib/agents/copywriter-input.js +8 -8
- package/dist/lib/agents/facts.js +7 -7
- package/dist/lib/agents/narrative-facts.js +6 -6
- package/dist/lib/agents/verifier.js +13 -12
- 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 +8 -8
- 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 +23 -15
- package/dist/lib/bundle/verify.js +31 -23
- package/dist/lib/capture-manifest.js +6 -6
- package/dist/lib/checks/crawler-access.js +2 -2
- package/dist/lib/checks/renderability.js +2 -2
- package/dist/lib/checks/run-checks.js +12 -12
- package/dist/lib/chunks/{chunk-3CMPR6ZZ.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-VHKHYAC5.js → chunk-3S2FAVRE.js} +2 -2
- 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-S6QOXJAL.js → chunk-4Q2WFZ5J.js} +11 -4
- package/dist/lib/chunks/{chunk-7DNLRXEY.js → chunk-5JU2Y2I6.js} +2 -2
- package/dist/lib/chunks/{chunk-KFAT65P7.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-HCUJ2J7P.js → chunk-7KLTOVIY.js} +9 -9
- package/dist/lib/chunks/{chunk-EOO5RBUW.js → chunk-7ZR3WDF2.js} +38 -5
- package/dist/lib/chunks/chunk-A5PF7UE2.js +86 -0
- package/dist/lib/chunks/{chunk-PKNODC6Y.js → chunk-AB7DUTX5.js} +1 -1
- package/dist/lib/chunks/{chunk-WDT2Y7D7.js → chunk-AQCWKHTE.js} +11 -7
- package/dist/lib/chunks/{chunk-UNCUG2YS.js → chunk-ASHFEFCU.js} +3 -3
- package/dist/lib/chunks/{chunk-BYHXNFWN.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-QD3JXA3Y.js → chunk-CQNIPZH3.js} +18 -18
- 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-K2FZFESR.js → chunk-FONFW67K.js} +4 -4
- package/dist/lib/chunks/{chunk-PIFTG6YW.js → chunk-FPPHYGIO.js} +2 -2
- package/dist/lib/chunks/{chunk-VXYQWE45.js → chunk-FYE4R5TY.js} +2 -2
- package/dist/lib/chunks/{chunk-JYCVBFH5.js → chunk-H2DOBJZC.js} +2 -2
- package/dist/lib/chunks/{chunk-XA27KAUV.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-R5UPOEWE.js → chunk-HYMWNGOK.js} +10 -3
- 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-AT3XMGES.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-YEUCAPKP.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-XSER7WEB.js → chunk-LJCWZ5SZ.js} +14 -14
- package/dist/lib/chunks/{chunk-HGGRPOSA.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-HGGOGCPX.js → chunk-MPQXB7HN.js} +7 -7
- package/dist/lib/chunks/{chunk-YGLWQFKL.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-GLUGYZQO.js → chunk-OTVHGRCO.js} +8 -8
- package/dist/lib/chunks/{chunk-RIJERFGU.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-4GLW3ZRO.js → chunk-QUZYFAGP.js} +4 -4
- package/dist/lib/chunks/{chunk-T6XZQOXS.js → chunk-QVMPTT7R.js} +5 -5
- package/dist/lib/chunks/{chunk-OOLWU667.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-ZOGIJGU3.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-PIF3GL62.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-J7QKT5E7.js → chunk-WUIY7BXR.js} +34 -17
- 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-LTCDLURT.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-7YZPEX3T.js → chunk-ZHGABG7L.js} +2 -2
- package/dist/lib/chunks/chunk-ZZCRYG36.js +31 -0
- package/dist/lib/cli/bundle-commands.js +89 -73
- package/dist/lib/cli/run-commands.js +136 -92
- package/dist/lib/cli/status-command.js +75 -59
- 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 +23 -22
- package/dist/lib/codex-workflow/capture.js +38 -17
- 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 +19 -18
- package/dist/lib/codex-workflow/copy-recovery.js +4 -4
- package/dist/lib/codex-workflow/copy.js +16 -15
- package/dist/lib/codex-workflow/finish.js +28 -24
- package/dist/lib/codex-workflow/host-models.js +2 -2
- package/dist/lib/codex-workflow/loop.js +51 -46
- 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 +30 -28
- package/dist/lib/codex-workflow/workdir.js +18 -11
- package/dist/lib/engine/audit-file.js +7 -7
- package/dist/lib/engine/author.js +38 -36
- package/dist/lib/engine/cost-estimate.js +37 -9
- package/dist/lib/engine/local-run.js +74 -58
- package/dist/lib/engine/preflight.js +37 -9
- package/dist/lib/engine/rejudge.js +80 -64
- package/dist/lib/engine/run-bindings.js +62 -0
- package/dist/lib/engine/run-status.js +75 -59
- package/dist/lib/engine/templates.js +8 -8
- 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 +19 -17
- package/dist/lib/stores/local-versions.js +5 -5
- package/dist/lib/stores/memory.js +19 -14
- package/dist/lib/stores/publication.js +10 -10
- package/dist/lib/stores/unit-record.js +28 -0
- package/dist/lib/viewer/server.js +32 -24
- 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/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/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/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/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 +2 -2
- 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
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import {
|
|
2
|
+
attemptRules,
|
|
3
|
+
reportedModelOf,
|
|
4
|
+
requestedModelOf,
|
|
5
|
+
runProbeAttempts,
|
|
6
|
+
runProbeUnit
|
|
7
|
+
} from "./chunk-2FDSOZ6Q.js";
|
|
8
|
+
import {
|
|
9
|
+
ProbeTraceError,
|
|
10
|
+
endAttempt
|
|
11
|
+
} from "./chunk-GVOF5ZUG.js";
|
|
12
|
+
import {
|
|
13
|
+
cliAdapterProfiles,
|
|
14
|
+
createCliAdapter,
|
|
15
|
+
probeForSurface
|
|
16
|
+
} from "./chunk-S24JGY7B.js";
|
|
17
|
+
import {
|
|
18
|
+
authSettingNames,
|
|
19
|
+
localCommand
|
|
20
|
+
} from "./chunk-QKTKQSPS.js";
|
|
21
|
+
import {
|
|
22
|
+
ProbeFailure
|
|
23
|
+
} from "./chunk-7O3M6I2X.js";
|
|
24
|
+
import {
|
|
25
|
+
createLog
|
|
26
|
+
} from "./chunk-BBK54RVK.js";
|
|
27
|
+
import {
|
|
28
|
+
getEnvironment,
|
|
29
|
+
readEnv
|
|
30
|
+
} from "./chunk-PO2J5OQ3.js";
|
|
31
|
+
import {
|
|
32
|
+
unlimited
|
|
33
|
+
} from "./chunk-PT6PK2MJ.js";
|
|
34
|
+
import {
|
|
35
|
+
agentSurfaces,
|
|
36
|
+
surfaceRunCounts
|
|
37
|
+
} from "./chunk-AASWJR7Q.js";
|
|
38
|
+
|
|
39
|
+
// src/probes/agent-clis.ts
|
|
40
|
+
import { execFile } from "node:child_process";
|
|
41
|
+
import { promisify } from "node:util";
|
|
42
|
+
import { z } from "zod";
|
|
43
|
+
var execFileAsync = promisify(execFile);
|
|
44
|
+
var log = createLog("AgentCliProbes");
|
|
45
|
+
var defaultAgentRuntime = (env = getEnvironment()) => {
|
|
46
|
+
return { env, claudeConfigDir: null };
|
|
47
|
+
};
|
|
48
|
+
var detectAgentClis = async (runtime = defaultAgentRuntime()) => {
|
|
49
|
+
return {
|
|
50
|
+
claudeCode: await cliVersion("claude", ["--version"], runtime),
|
|
51
|
+
codex: await cliVersion("codex", ["--version"], runtime),
|
|
52
|
+
cursor: await cliVersion("cursor-agent", ["--version"], runtime)
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
var versionForSurface = (surface, versions) => {
|
|
56
|
+
switch (surface) {
|
|
57
|
+
case "claude_code":
|
|
58
|
+
return versions.claudeCode;
|
|
59
|
+
case "codex":
|
|
60
|
+
return versions.codex;
|
|
61
|
+
case "cursor":
|
|
62
|
+
return versions.cursor;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var assertAgentClis = (surfaces, versions) => {
|
|
66
|
+
const missing = surfaces.filter((s) => !versionForSurface(s, versions));
|
|
67
|
+
if (missing.length === 0) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
throw new Error(
|
|
71
|
+
[
|
|
72
|
+
`Missing agent CLI${missing.length === 1 ? "" : "s"} for surface${missing.length === 1 ? "" : "s"} in scope:`,
|
|
73
|
+
...missing.map(
|
|
74
|
+
(s) => ` - ${s} \u2014 \`${cliNameForSurface(s)}\` not found on PATH`
|
|
75
|
+
),
|
|
76
|
+
"Install and authenticate the CLI, or narrow the run with --surfaces to",
|
|
77
|
+
"leave the surface out (the snapshot then records it as unmeasured)."
|
|
78
|
+
].join("\n")
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
var agentAuthEnv = {
|
|
82
|
+
claude_code: {
|
|
83
|
+
anyOf: authSettingNames(cliAdapterProfiles.claude_code),
|
|
84
|
+
purpose: "Claude Code probes (subscription token from `claude setup-token`, or an API key)"
|
|
85
|
+
},
|
|
86
|
+
codex: {
|
|
87
|
+
anyOf: authSettingNames(cliAdapterProfiles.codex),
|
|
88
|
+
purpose: "Codex probes (an API key, or a CODEX_HOME provisioned with `codex login --with-api-key`)"
|
|
89
|
+
},
|
|
90
|
+
cursor: {
|
|
91
|
+
anyOf: authSettingNames(cliAdapterProfiles.cursor),
|
|
92
|
+
purpose: "Cursor probes"
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var assertAgentAuth = (surfaces, { env, transport }) => {
|
|
96
|
+
const missing = surfaces.filter(
|
|
97
|
+
(surface) => transport ? !transport.has(surface) : !agentAuthEnv[surface].anyOf.some((name) => env[name])
|
|
98
|
+
);
|
|
99
|
+
if (missing.length === 0) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
throw new Error(
|
|
103
|
+
[
|
|
104
|
+
"Non-interactive run: agent CLI auth must be provided by environment for every agent surface in scope:",
|
|
105
|
+
...missing.map(
|
|
106
|
+
(surface) => ` - ${surface} \u2014 one of ${agentAuthEnv[surface].anyOf.join(", ")} (${agentAuthEnv[surface].purpose})`
|
|
107
|
+
),
|
|
108
|
+
"Set them, or narrow the run with --surfaces."
|
|
109
|
+
].join("\n")
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
var cliNameForSurface = (surface) => {
|
|
113
|
+
switch (surface) {
|
|
114
|
+
case "claude_code":
|
|
115
|
+
return "claude";
|
|
116
|
+
case "codex":
|
|
117
|
+
return "codex";
|
|
118
|
+
case "cursor":
|
|
119
|
+
return "cursor-agent";
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var workerVersionSchema = z.string().nullish();
|
|
123
|
+
var getVersionSurface = (command) => {
|
|
124
|
+
if (command === "claude") {
|
|
125
|
+
return "claude_code";
|
|
126
|
+
}
|
|
127
|
+
if (command === "codex") {
|
|
128
|
+
return "codex";
|
|
129
|
+
}
|
|
130
|
+
return "cursor";
|
|
131
|
+
};
|
|
132
|
+
var cliVersion = async (command, args, { env, transport }) => {
|
|
133
|
+
try {
|
|
134
|
+
if (transport) {
|
|
135
|
+
const version = await transport.invoke(getVersionSurface(command), {
|
|
136
|
+
task: "version"
|
|
137
|
+
});
|
|
138
|
+
return workerVersionSchema.parse(version) ?? null;
|
|
139
|
+
}
|
|
140
|
+
if (readEnv("AEO_ISOLATED_ADAPTER") === "1") {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
const local = localCommand(command, args, env);
|
|
144
|
+
const { stdout } = await execFileAsync(local.command, local.args, {
|
|
145
|
+
timeout: 15e3
|
|
146
|
+
});
|
|
147
|
+
return stdout.trim().split("\n")[0] ?? null;
|
|
148
|
+
} catch {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
var canaryPrompt = "Reply with the single word OK and nothing else. Do not search the web.";
|
|
153
|
+
var runCanaryProbe = async (surface, runtime, { signal, trace } = {}) => {
|
|
154
|
+
const startedAt = Date.now();
|
|
155
|
+
const adapter = createCliAdapter(surface, {
|
|
156
|
+
runtime: {
|
|
157
|
+
...runtime,
|
|
158
|
+
timeoutMs: Math.min(runtime.timeoutMs ?? 12e4, 12e4)
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const attempted = await runProbeAttempts(
|
|
162
|
+
adapter,
|
|
163
|
+
{ promptId: "canary", promptText: canaryPrompt, runIndex: 0 },
|
|
164
|
+
{
|
|
165
|
+
rules: attemptRules.canary,
|
|
166
|
+
trace,
|
|
167
|
+
signal,
|
|
168
|
+
log,
|
|
169
|
+
logContext: { surface }
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
if (attempted.status === "answered") {
|
|
173
|
+
const { answer } = attempted;
|
|
174
|
+
log.info("Canary probe passed", {
|
|
175
|
+
surface,
|
|
176
|
+
durationMs: Date.now() - startedAt,
|
|
177
|
+
chars: answer.answerText.length
|
|
178
|
+
});
|
|
179
|
+
const reportedModel = reportedModelOf(adapter, answer);
|
|
180
|
+
const unrecorded = await endAttempt(attempted.handle, {
|
|
181
|
+
outcome: "succeeded",
|
|
182
|
+
text: answer.answerText,
|
|
183
|
+
retrieval: answer.retrieval,
|
|
184
|
+
requestedModel: requestedModelOf(adapter, answer.requestedModel),
|
|
185
|
+
...reportedModel ? { reportedModel } : {}
|
|
186
|
+
});
|
|
187
|
+
return unrecorded === null ? null : { kind: "persistence", message: unrecorded, surface };
|
|
188
|
+
}
|
|
189
|
+
if (attempted.cause instanceof ProbeTraceError) {
|
|
190
|
+
throw attempted.cause;
|
|
191
|
+
}
|
|
192
|
+
signal?.throwIfAborted();
|
|
193
|
+
if (attempted.cause !== void 0) {
|
|
194
|
+
log.error("Canary probe failed", attempted.cause, {
|
|
195
|
+
surface,
|
|
196
|
+
kind: attempted.kind,
|
|
197
|
+
detail: attempted.lastError
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return { kind: attempted.kind, message: attempted.lastError, surface };
|
|
201
|
+
};
|
|
202
|
+
var runCanaryProbes = async (surfaces, runtime, options = {}) => {
|
|
203
|
+
const failures = (await Promise.all(
|
|
204
|
+
surfaces.map((surface) => runCanaryProbe(surface, runtime, options))
|
|
205
|
+
)).filter((failure) => failure !== null);
|
|
206
|
+
const [firstFailure] = failures;
|
|
207
|
+
if (firstFailure) {
|
|
208
|
+
const kind = failures.find(
|
|
209
|
+
(failure) => ["auth", "rejected_web_tool"].includes(failure.kind)
|
|
210
|
+
)?.kind ?? firstFailure.kind;
|
|
211
|
+
throw new ProbeFailure(
|
|
212
|
+
kind,
|
|
213
|
+
[
|
|
214
|
+
"Agent canary probe failed; the CLI is installed but cannot answer (auth, network, or configuration):",
|
|
215
|
+
...failures.map(
|
|
216
|
+
({ surface, kind: kind2, message }) => ` - ${surface}: ${kind2} \u2014 ${message}`
|
|
217
|
+
).sort()
|
|
218
|
+
].join("\n")
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
var runAgentProbesForPrompts = async (args) => {
|
|
223
|
+
const surfaces = args.surfaces ?? agentSurfaces;
|
|
224
|
+
const limiter = args.limiter ?? unlimited();
|
|
225
|
+
const runtime = args.runtime ?? defaultAgentRuntime();
|
|
226
|
+
const specs = [];
|
|
227
|
+
for (const prompt of args.prompts) {
|
|
228
|
+
for (const surface of surfaces) {
|
|
229
|
+
if (!versionForSurface(surface, args.versions)) {
|
|
230
|
+
throw new Error(
|
|
231
|
+
`Agent CLI for ${surface} (${cliNameForSurface(surface)}) is not installed; the pre-flight check should have rejected this run.`
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
const runs = args.runsPerPrompt ?? surfaceRunCounts[surface];
|
|
235
|
+
for (let run = 1; run <= runs; run++) {
|
|
236
|
+
if (args.filter && !args.filter({ promptId: prompt.id, surface, runIndex: run })) {
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
specs.push({ surface, prompt, runIndex: run });
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
const outcomes = await Promise.all(
|
|
244
|
+
specs.map(
|
|
245
|
+
(spec) => runAgentUnit(spec, {
|
|
246
|
+
version: versionForSurface(spec.surface, args.versions) ?? "unknown",
|
|
247
|
+
limiter,
|
|
248
|
+
runtime,
|
|
249
|
+
signal: args.signal,
|
|
250
|
+
onResult: args.onResult,
|
|
251
|
+
trace: args.trace,
|
|
252
|
+
logContext: args.logContext
|
|
253
|
+
})
|
|
254
|
+
)
|
|
255
|
+
);
|
|
256
|
+
const rejectedWebToolSurfaces = surfaces.filter((surface) => {
|
|
257
|
+
const onSurface = outcomes.filter((o) => o.unit.surface === surface);
|
|
258
|
+
return onSurface.length > 0 && onSurface.every(
|
|
259
|
+
(o) => o.status === "failed" && o.kind === "rejected_web_tool"
|
|
260
|
+
);
|
|
261
|
+
});
|
|
262
|
+
const captured = outcomes.filter((o) => o.status === "captured").length;
|
|
263
|
+
log.info("Agent probes completed", {
|
|
264
|
+
...args.logContext,
|
|
265
|
+
planned: specs.length,
|
|
266
|
+
captured,
|
|
267
|
+
failed: specs.length - captured,
|
|
268
|
+
...rejectedWebToolSurfaces.length > 0 ? { rejectedWebToolSurfaces } : {}
|
|
269
|
+
});
|
|
270
|
+
return { outcomes, rejectedWebToolSurfaces };
|
|
271
|
+
};
|
|
272
|
+
var runAgentUnit = async (spec, ctx) => {
|
|
273
|
+
const adapter = createCliAdapter(spec.surface, { runtime: ctx.runtime });
|
|
274
|
+
return runProbeUnit(
|
|
275
|
+
adapter,
|
|
276
|
+
{
|
|
277
|
+
promptId: spec.prompt.id,
|
|
278
|
+
promptText: spec.prompt.promptText,
|
|
279
|
+
runIndex: spec.runIndex
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
rules: attemptRules.agent,
|
|
283
|
+
trace: ctx.trace,
|
|
284
|
+
limiter: ctx.limiter,
|
|
285
|
+
signal: ctx.signal,
|
|
286
|
+
log,
|
|
287
|
+
logContext: {
|
|
288
|
+
...ctx.logContext,
|
|
289
|
+
surface: spec.surface,
|
|
290
|
+
promptId: spec.prompt.id,
|
|
291
|
+
run: spec.runIndex
|
|
292
|
+
},
|
|
293
|
+
toResult: (answer) => ({
|
|
294
|
+
promptId: spec.prompt.id,
|
|
295
|
+
promptText: spec.prompt.promptText,
|
|
296
|
+
promptCategory: spec.prompt.category,
|
|
297
|
+
modelName: spec.surface,
|
|
298
|
+
runIndex: spec.runIndex,
|
|
299
|
+
text: answer.text,
|
|
300
|
+
usedWebSearch: answer.usedWebSearch ?? null,
|
|
301
|
+
agentCliVersion: ctx.version,
|
|
302
|
+
...answer.retrieval ? { retrieval: answer.retrieval } : {},
|
|
303
|
+
requestedModel: answer.requestedModel,
|
|
304
|
+
...answer.reportedModel ? { reportedModel: answer.reportedModel } : {}
|
|
305
|
+
}),
|
|
306
|
+
...ctx.onResult && { bank: ctx.onResult }
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
};
|
|
310
|
+
var runAgentProbeDirect = async (surface, {
|
|
311
|
+
prompt,
|
|
312
|
+
runtime,
|
|
313
|
+
signal
|
|
314
|
+
}) => {
|
|
315
|
+
if (readEnv("AEO_ISOLATED_ADAPTER") === "1") {
|
|
316
|
+
throw new Error("Direct CLI launch prohibited in adapter.");
|
|
317
|
+
}
|
|
318
|
+
return probeForSurface(surface)(
|
|
319
|
+
prompt,
|
|
320
|
+
{ ...runtime, transport: void 0 },
|
|
321
|
+
signal
|
|
322
|
+
);
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
export {
|
|
326
|
+
defaultAgentRuntime,
|
|
327
|
+
detectAgentClis,
|
|
328
|
+
versionForSurface,
|
|
329
|
+
assertAgentClis,
|
|
330
|
+
agentAuthEnv,
|
|
331
|
+
assertAgentAuth,
|
|
332
|
+
cliNameForSurface,
|
|
333
|
+
canaryPrompt,
|
|
334
|
+
runCanaryProbe,
|
|
335
|
+
runCanaryProbes,
|
|
336
|
+
runAgentProbesForPrompts,
|
|
337
|
+
runAgentProbeDirect
|
|
338
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
hostStepAccounting
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-D7N5OLYL.js";
|
|
4
4
|
import {
|
|
5
5
|
engineResources
|
|
6
6
|
} from "./chunk-6P7EZJI7.js";
|
|
7
7
|
import {
|
|
8
8
|
createRecommendationVerifier
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CVEXMYPW.js";
|
|
10
10
|
import {
|
|
11
11
|
getEnvironment
|
|
12
12
|
} from "./chunk-PO2J5OQ3.js";
|
|
13
13
|
import {
|
|
14
14
|
validateAgentCopy
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-44NSZBCP.js";
|
|
16
16
|
import {
|
|
17
17
|
copywriterDocuments
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JDU3ZCKO.js";
|
|
19
19
|
import {
|
|
20
20
|
buildFactCatalog
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-LUKP64NX.js";
|
|
22
22
|
import {
|
|
23
23
|
aeoSnapshotSchema
|
|
24
24
|
} from "./chunk-EDQTINTL.js";
|
|
@@ -1,72 +1,80 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openFileStores
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HEWHNSDP.js";
|
|
4
4
|
import {
|
|
5
5
|
chargedProbeTrace
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KRWDELRS.js";
|
|
7
7
|
import {
|
|
8
8
|
createFileResearchSessionStore
|
|
9
9
|
} from "./chunk-VXDMOB7O.js";
|
|
10
10
|
import {
|
|
11
11
|
openGroundingRuntime
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LJCWZ5SZ.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveRunBindings
|
|
15
|
+
} from "./chunk-KXFZ3CH3.js";
|
|
13
16
|
import {
|
|
14
17
|
toAuditConfig,
|
|
15
18
|
toRunRequest
|
|
16
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QUZYFAGP.js";
|
|
17
20
|
import {
|
|
21
|
+
readFrozenBudget,
|
|
18
22
|
resolveRunBudget
|
|
19
23
|
} from "./chunk-2B5QF6UQ.js";
|
|
20
24
|
import {
|
|
21
25
|
resolveSupportedModel
|
|
22
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-FPPHYGIO.js";
|
|
23
27
|
import {
|
|
24
28
|
localTechnicalChecks,
|
|
25
29
|
persistedRunId
|
|
26
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-MZ2KN3IH.js";
|
|
27
31
|
import {
|
|
28
32
|
planRun
|
|
29
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-4AWFF53U.js";
|
|
30
34
|
import {
|
|
31
35
|
agentSurfacesToCapture,
|
|
36
|
+
assertBankUsable,
|
|
32
37
|
captureForRun
|
|
33
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Z3BZRBQF.js";
|
|
34
39
|
import {
|
|
35
40
|
assertAgentClis,
|
|
36
41
|
detectAgentClis,
|
|
37
42
|
runCanaryProbes
|
|
38
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-VYUC772A.js";
|
|
44
|
+
import {
|
|
45
|
+
probeDependenciesOf
|
|
46
|
+
} from "./chunk-MNG5TZRW.js";
|
|
39
47
|
import {
|
|
40
48
|
acquireWriterLock
|
|
41
49
|
} from "./chunk-6GOBBNDU.js";
|
|
42
50
|
import {
|
|
43
51
|
runInputsFile
|
|
44
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-HLC6OHGO.js";
|
|
45
53
|
import {
|
|
46
54
|
openRecorder,
|
|
47
55
|
probeTraceOf,
|
|
48
56
|
recordedOperationKinds,
|
|
49
57
|
recordingAccounting
|
|
50
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-7ZR3WDF2.js";
|
|
51
59
|
import {
|
|
52
60
|
hasErrorCode
|
|
53
61
|
} from "./chunk-2QLAFBCG.js";
|
|
54
62
|
import {
|
|
55
63
|
RunOrigin,
|
|
56
64
|
measurementDigest
|
|
57
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-JJFOILZK.js";
|
|
58
66
|
import {
|
|
59
67
|
capturePlan
|
|
60
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-6RED3G6K.js";
|
|
61
69
|
import {
|
|
62
70
|
getEnvironment
|
|
63
71
|
} from "./chunk-PO2J5OQ3.js";
|
|
64
72
|
import {
|
|
65
73
|
ProbeLimiter
|
|
66
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-PT6PK2MJ.js";
|
|
67
75
|
import {
|
|
68
76
|
createFileModelAccounting
|
|
69
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-EUXNCXCR.js";
|
|
70
78
|
|
|
71
79
|
// src/engine/local-run.ts
|
|
72
80
|
import { mkdir, readFile } from "node:fs/promises";
|
|
@@ -158,6 +166,10 @@ var openLockedLocalRun = async (file, dir, {
|
|
|
158
166
|
held
|
|
159
167
|
}) => {
|
|
160
168
|
const { recorder } = held;
|
|
169
|
+
const bank = path.join(dir, bankDir);
|
|
170
|
+
const bindings = await resolveRunBindings(bank, {
|
|
171
|
+
startedBefore: await readFrozenBudget(dir) !== void 0
|
|
172
|
+
});
|
|
161
173
|
const budget = await resolveRunBudget(dir, file.runPolicy.budget, {
|
|
162
174
|
model: resolveSupportedModel(file.model).id,
|
|
163
175
|
...maxUsd !== void 0 && { maxUsd },
|
|
@@ -169,7 +181,6 @@ var openLockedLocalRun = async (file, dir, {
|
|
|
169
181
|
...derivedFromRunId !== void 0 && { derivedFromRunId }
|
|
170
182
|
};
|
|
171
183
|
const plan = planRun(config, request);
|
|
172
|
-
const bank = path.join(dir, bankDir);
|
|
173
184
|
const stores = await openFileStores(config.reportKey, {
|
|
174
185
|
checkpointDir: bank,
|
|
175
186
|
contentDir: path.join(bank, "report")
|
|
@@ -205,6 +216,7 @@ var openLockedLocalRun = async (file, dir, {
|
|
|
205
216
|
recorder
|
|
206
217
|
)
|
|
207
218
|
};
|
|
219
|
+
await assertBankUsable(stores.probeStore, plan, bindings);
|
|
208
220
|
const agents = await agentSurfacesToCapture(plan, stores.probeStore);
|
|
209
221
|
const agentCliVersions = await detectAgentClis();
|
|
210
222
|
try {
|
|
@@ -220,8 +232,13 @@ var openLockedLocalRun = async (file, dir, {
|
|
|
220
232
|
{ cause: err }
|
|
221
233
|
);
|
|
222
234
|
}
|
|
223
|
-
const probes = chargedProbeTrace(
|
|
235
|
+
const probes = chargedProbeTrace(
|
|
236
|
+
probeTraceOf(recorder, "probe"),
|
|
237
|
+
ledger,
|
|
238
|
+
bindings
|
|
239
|
+
);
|
|
224
240
|
const capture = await captureForRun({
|
|
241
|
+
probeDependencies: probeDependenciesOf(getEnvironment(), bindings),
|
|
225
242
|
config,
|
|
226
243
|
request,
|
|
227
244
|
plan,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-UGCT46PC.js";
|
|
5
5
|
import {
|
|
6
6
|
createLog
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BBK54RVK.js";
|
|
8
8
|
|
|
9
9
|
// src/probes/grounding-urls.ts
|
|
10
10
|
var log = createLog("GroundingUrlResolver");
|
|
@@ -28,11 +28,12 @@ var extractGroundingRedirectUrls = (text) => {
|
|
|
28
28
|
const matches = text.match(groundingUrlPattern) ?? [];
|
|
29
29
|
return matches.map(stripTrailingPunctuation);
|
|
30
30
|
};
|
|
31
|
-
var
|
|
31
|
+
var traceGroundingRedirects = async (urls, logContext = {}) => {
|
|
32
32
|
const unique = [...new Set([...urls].filter(isGroundingRedirectUrl))];
|
|
33
33
|
const resolved = /* @__PURE__ */ new Map();
|
|
34
|
+
const resolutions = [];
|
|
34
35
|
if (unique.length === 0) {
|
|
35
|
-
return resolved;
|
|
36
|
+
return { resolved, resolutions };
|
|
36
37
|
}
|
|
37
38
|
let nextIndex = 0;
|
|
38
39
|
const workers = Array.from(
|
|
@@ -44,9 +45,10 @@ var resolveGroundingRedirects = async (urls, logContext = {}) => {
|
|
|
44
45
|
if (!url) {
|
|
45
46
|
continue;
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const resolution = await resolveOne(url);
|
|
49
|
+
resolutions.push(resolution);
|
|
50
|
+
if (resolution.target) {
|
|
51
|
+
resolved.set(url, resolution.target);
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -57,39 +59,62 @@ var resolveGroundingRedirects = async (urls, logContext = {}) => {
|
|
|
57
59
|
total: unique.length,
|
|
58
60
|
resolved: resolved.size
|
|
59
61
|
});
|
|
62
|
+
resolutions.sort((a, b) => unique.indexOf(a.url) - unique.indexOf(b.url));
|
|
63
|
+
return { resolved, resolutions };
|
|
64
|
+
};
|
|
65
|
+
var resolveGroundingRedirects = async (urls, logContext = {}) => {
|
|
66
|
+
const { resolved } = await traceGroundingRedirects(urls, logContext);
|
|
60
67
|
return resolved;
|
|
61
68
|
};
|
|
62
69
|
var resolveOne = async (url) => {
|
|
70
|
+
let hops = 0;
|
|
63
71
|
try {
|
|
64
72
|
let current = url;
|
|
65
|
-
|
|
73
|
+
while (hops < maxRedirectHops) {
|
|
66
74
|
const response = await fetch(current, {
|
|
67
75
|
method: "GET",
|
|
68
76
|
redirect: "manual",
|
|
69
77
|
signal: AbortSignal.timeout(resolveTimeoutMs)
|
|
70
78
|
});
|
|
79
|
+
hops += 1;
|
|
71
80
|
const location = response.headers.get("location");
|
|
72
81
|
if (response.status < 300 || response.status >= 400 || !location) {
|
|
73
82
|
await response.body?.cancel().catch(() => void 0);
|
|
74
|
-
return
|
|
83
|
+
return {
|
|
84
|
+
url,
|
|
85
|
+
target: null,
|
|
86
|
+
hops,
|
|
87
|
+
failure: `HTTP ${response.status} without a redirect`
|
|
88
|
+
};
|
|
75
89
|
}
|
|
76
90
|
await response.body?.cancel().catch(() => void 0);
|
|
77
91
|
const target = new URL(location, current);
|
|
78
92
|
if (target.protocol !== "http:" && target.protocol !== "https:") {
|
|
79
|
-
return
|
|
93
|
+
return {
|
|
94
|
+
url,
|
|
95
|
+
target: null,
|
|
96
|
+
hops,
|
|
97
|
+
failure: `redirect to a ${target.protocol} URL`
|
|
98
|
+
};
|
|
80
99
|
}
|
|
81
100
|
if (!isGroundingRedirectUrl(target.href)) {
|
|
82
|
-
return target.href;
|
|
101
|
+
return { url, target: target.href, hops };
|
|
83
102
|
}
|
|
84
103
|
current = target.href;
|
|
85
104
|
}
|
|
86
|
-
return
|
|
105
|
+
return {
|
|
106
|
+
url,
|
|
107
|
+
target: null,
|
|
108
|
+
hops,
|
|
109
|
+
failure: `still a redirect wrapper after ${maxRedirectHops} hops`
|
|
110
|
+
};
|
|
87
111
|
} catch (error) {
|
|
112
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
88
113
|
log.warn("Failed to resolve grounding redirect", {
|
|
89
114
|
url: url.slice(0, 120),
|
|
90
|
-
error:
|
|
115
|
+
error: message
|
|
91
116
|
});
|
|
92
|
-
return null;
|
|
117
|
+
return { url, target: null, hops, failure: message.slice(0, 300) };
|
|
93
118
|
}
|
|
94
119
|
};
|
|
95
120
|
var rewriteTextUrls = (text, resolved) => {
|
|
@@ -108,6 +133,7 @@ var stripTrailingPunctuation = (url) => {
|
|
|
108
133
|
|
|
109
134
|
export {
|
|
110
135
|
extractGroundingRedirectUrls,
|
|
136
|
+
traceGroundingRedirects,
|
|
111
137
|
resolveGroundingRedirects,
|
|
112
138
|
rewriteTextUrls
|
|
113
139
|
};
|
|
@@ -49,8 +49,13 @@ var dataForSeoLanguageCodes = {
|
|
|
49
49
|
dutch: "nl"
|
|
50
50
|
};
|
|
51
51
|
var resolveDataForSeoLocale = (geography, language) => {
|
|
52
|
-
const
|
|
53
|
-
const
|
|
52
|
+
const geographyKey = geography.toLowerCase();
|
|
53
|
+
const languageKey = language.toLowerCase();
|
|
54
|
+
if (!Object.hasOwn(dataForSeoLocationCodes, geographyKey) || !Object.hasOwn(dataForSeoLanguageCodes, languageKey)) {
|
|
55
|
+
return void 0;
|
|
56
|
+
}
|
|
57
|
+
const locationCode = dataForSeoLocationCodes[geographyKey];
|
|
58
|
+
const languageCode = dataForSeoLanguageCodes[languageKey];
|
|
54
59
|
return locationCode === void 0 || languageCode === void 0 ? void 0 : { locationCode, languageCode };
|
|
55
60
|
};
|
|
56
61
|
|