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
package/src/runner.ts
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
import { createLog } from './lib/log';
|
|
18
18
|
import type { AgentCliVersions } from './probes/agent-clis';
|
|
19
19
|
import type { ProbeLimiter } from './probes/limits';
|
|
20
|
+
import { resolveDataForSeoLocale } from './probes/dataforseo-locale';
|
|
20
21
|
import type { PartialFailure } from './probes/web-tool-guard';
|
|
21
22
|
import type { SectionRunResult } from './pipeline';
|
|
22
23
|
import {
|
|
@@ -131,6 +132,18 @@ export const planRun = (
|
|
|
131
132
|
}),
|
|
132
133
|
);
|
|
133
134
|
|
|
135
|
+
// Google AI Overviews are placed in a market by DataForSEO's location
|
|
136
|
+
// and language codes. A market the table cannot place is refused here,
|
|
137
|
+
// before anything is reserved, never measured as the United States.
|
|
138
|
+
if (
|
|
139
|
+
surfaces.includes('google_ai_overview') &&
|
|
140
|
+
!resolveDataForSeoLocale(config.geography, config.language)
|
|
141
|
+
) {
|
|
142
|
+
throw new RunRequestError(
|
|
143
|
+
`No search market for geography ${JSON.stringify(config.geography)} and language ${JSON.stringify(config.language)}: AI Overviews cannot be placed there. Please fix the config's geography and language (supported codes include us and en), or leave google_ai_overview out of the run.`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
134
147
|
if (units.length > request.maxPlannedUnits) {
|
|
135
148
|
throw new RunRequestError(
|
|
136
149
|
`Plan of ${units.length} probe units exceeds the cap of ${request.maxPlannedUnits} (maxPlannedUnits); narrow the run or raise the cap deliberately.`,
|
package/src/stores/files.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
mkdtemp,
|
|
6
6
|
open,
|
|
7
7
|
readFile,
|
|
8
|
+
truncate,
|
|
8
9
|
readdir,
|
|
9
10
|
rename,
|
|
10
11
|
rm,
|
|
@@ -42,14 +43,13 @@ import {
|
|
|
42
43
|
} from './file-publication';
|
|
43
44
|
import { hasErrorCode } from './fs-errors';
|
|
44
45
|
import { openFileVersionStores } from './local-versions';
|
|
46
|
+
import { parseUnitRecord, ProbeStoreIntegrityError } from './unit-record';
|
|
45
47
|
import type { AnalysisEntry } from './memory';
|
|
46
48
|
import {
|
|
47
49
|
UnitConflictError,
|
|
48
50
|
type AnalysisEntryMeta,
|
|
49
51
|
type AnalysisStore,
|
|
50
|
-
type CapturedUnitRecord,
|
|
51
52
|
type CheckpointMatch,
|
|
52
|
-
type FailedUnitRecord,
|
|
53
53
|
type ProbeStore,
|
|
54
54
|
type ProbeUnit,
|
|
55
55
|
type ReportArtifacts,
|
|
@@ -128,9 +128,14 @@ const readJsonl = async (filePath: string): Promise<unknown[]> => {
|
|
|
128
128
|
class JsonlFile {
|
|
129
129
|
readonly filePath: string;
|
|
130
130
|
#queue: Promise<void> = Promise.resolve();
|
|
131
|
+
// Where an unterminated last line starts: cut before the first append, so
|
|
132
|
+
// the append starts a line of its own instead of joining the torn bytes
|
|
133
|
+
// into a row no reader can parse. A reader never changes the file.
|
|
134
|
+
#tornTailAt: number | undefined;
|
|
131
135
|
|
|
132
|
-
constructor(filePath: string) {
|
|
136
|
+
constructor(filePath: string, { tornTailAt }: { tornTailAt?: number } = {}) {
|
|
133
137
|
this.filePath = filePath;
|
|
138
|
+
this.#tornTailAt = tornTailAt;
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
append(line: string): Promise<void> {
|
|
@@ -148,6 +153,12 @@ class JsonlFile {
|
|
|
148
153
|
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
149
154
|
await chmod(directory, 0o700);
|
|
150
155
|
|
|
156
|
+
if (this.#tornTailAt !== undefined && flag === 'a') {
|
|
157
|
+
await truncate(this.filePath, this.#tornTailAt);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
this.#tornTailAt = undefined;
|
|
161
|
+
|
|
151
162
|
const file = await open(this.filePath, flag, 0o600);
|
|
152
163
|
|
|
153
164
|
try {
|
|
@@ -167,62 +178,64 @@ class JsonlFile {
|
|
|
167
178
|
}
|
|
168
179
|
}
|
|
169
180
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
'
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
typeof row.runIndex === 'number'
|
|
184
|
-
);
|
|
185
|
-
};
|
|
181
|
+
/**
|
|
182
|
+
* readUnitRecords reads a probe store's lines, each validated
|
|
183
|
+
* (unit-record.ts). The one line not read is an unterminated last line: an
|
|
184
|
+
* append the process did not finish, so a write `put` never acknowledged.
|
|
185
|
+
* Its byte offset is returned so the store's first write can cut it off.
|
|
186
|
+
*/
|
|
187
|
+
const readUnitRecords = async (
|
|
188
|
+
filePath: string,
|
|
189
|
+
): Promise<{ records: UnitRecord[]; tornTailAt: number | undefined }> => {
|
|
190
|
+
const raw = await readFile(filePath, 'utf8').catch((err: unknown) => {
|
|
191
|
+
if (hasErrorCode(err, 'ENOENT')) {
|
|
192
|
+
return '';
|
|
193
|
+
}
|
|
186
194
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
195
|
+
throw err;
|
|
196
|
+
});
|
|
197
|
+
const lines = raw.split('\n');
|
|
198
|
+
const records: UnitRecord[] = [];
|
|
199
|
+
let tornTailAt: number | undefined;
|
|
190
200
|
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
'probe' in row &&
|
|
196
|
-
Boolean(row.probe) &&
|
|
197
|
-
'capturedAt' in row &&
|
|
198
|
-
typeof row.capturedAt === 'string'
|
|
199
|
-
);
|
|
200
|
-
};
|
|
201
|
+
for (const [index, line] of lines.entries()) {
|
|
202
|
+
if (!line.trim()) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
201
205
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const parseUnitRecord = (row: unknown): UnitRecord | null => {
|
|
205
|
-
if (!row || typeof row !== 'object' || !hasUnitKey(row)) {
|
|
206
|
-
return null;
|
|
207
|
-
}
|
|
206
|
+
const where = `${filePath}:${index + 1}`;
|
|
207
|
+
let row: unknown;
|
|
208
208
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
try {
|
|
210
|
+
row = JSON.parse(line);
|
|
211
|
+
} catch {
|
|
212
|
+
if (index === lines.length - 1) {
|
|
213
|
+
log.warn('Cut an unterminated last probe store line', { where });
|
|
214
|
+
tornTailAt = Buffer.byteLength(raw) - Buffer.byteLength(line);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
throw new ProbeStoreIntegrityError(
|
|
219
|
+
`Probe store row ${where} is not JSON. Please repair or remove the row; the run stops rather than probe a banked unit again.`,
|
|
220
|
+
);
|
|
221
|
+
}
|
|
212
222
|
|
|
213
|
-
|
|
214
|
-
return { ...row, status: 'captured' };
|
|
223
|
+
records.push(parseUnitRecord(row, where));
|
|
215
224
|
}
|
|
216
225
|
|
|
217
|
-
return
|
|
226
|
+
return { records, tornTailAt };
|
|
218
227
|
};
|
|
219
228
|
|
|
220
229
|
export class FileProbeStore implements ProbeStore {
|
|
221
230
|
readonly #file: JsonlFile;
|
|
222
231
|
readonly #records: Map<string, UnitRecord>;
|
|
223
232
|
|
|
224
|
-
private constructor(
|
|
225
|
-
|
|
233
|
+
private constructor(
|
|
234
|
+
filePath: string,
|
|
235
|
+
records: Map<string, UnitRecord>,
|
|
236
|
+
tornTailAt: number | undefined,
|
|
237
|
+
) {
|
|
238
|
+
this.#file = new JsonlFile(filePath, { tornTailAt });
|
|
226
239
|
this.#records = records;
|
|
227
240
|
}
|
|
228
241
|
|
|
@@ -236,16 +249,14 @@ export class FileProbeStore implements ProbeStore {
|
|
|
236
249
|
);
|
|
237
250
|
const records = new Map<string, UnitRecord>();
|
|
238
251
|
|
|
239
|
-
|
|
240
|
-
const record = parseUnitRecord(row);
|
|
252
|
+
const { records: read, tornTailAt } = await readUnitRecords(filePath);
|
|
241
253
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
254
|
+
// Last line wins on load — the file is a log of writes.
|
|
255
|
+
for (const record of read) {
|
|
256
|
+
records.set(unitRecordKey(record), record);
|
|
246
257
|
}
|
|
247
258
|
|
|
248
|
-
return new FileProbeStore(filePath, records);
|
|
259
|
+
return new FileProbeStore(filePath, records, tornTailAt);
|
|
249
260
|
}
|
|
250
261
|
|
|
251
262
|
get size(): number {
|
|
@@ -270,9 +281,22 @@ export class FileProbeStore implements ProbeStore {
|
|
|
270
281
|
return;
|
|
271
282
|
}
|
|
272
283
|
|
|
284
|
+
// Set before the write, so a concurrent put of the same unit meets it;
|
|
285
|
+
// undone when the write fails, so the store never reports a row the
|
|
286
|
+
// file does not hold.
|
|
273
287
|
this.#records.set(key, record);
|
|
274
288
|
|
|
275
|
-
|
|
289
|
+
try {
|
|
290
|
+
await this.#file.append(JSON.stringify(record));
|
|
291
|
+
} catch (error) {
|
|
292
|
+
if (existing) {
|
|
293
|
+
this.#records.set(key, existing);
|
|
294
|
+
} else {
|
|
295
|
+
this.#records.delete(key);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
throw error;
|
|
299
|
+
}
|
|
276
300
|
}
|
|
277
301
|
|
|
278
302
|
async invalidate(match: CheckpointMatch): Promise<number> {
|
package/src/stores/memory.ts
CHANGED
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
type UnitRecord,
|
|
37
37
|
} from './ports';
|
|
38
38
|
import { validateReportArtifacts } from './artifacts';
|
|
39
|
+
import { parseUnitRecord } from './unit-record';
|
|
39
40
|
|
|
40
41
|
// ============================================================================
|
|
41
42
|
// Map-backed implementations of the storage ports — for unit tests and the
|
|
@@ -56,7 +57,9 @@ export class MemoryProbeStore implements ProbeStore {
|
|
|
56
57
|
readonly #records = new Map<string, UnitRecord>();
|
|
57
58
|
|
|
58
59
|
constructor(seed: Iterable<UnitRecord> = []) {
|
|
59
|
-
for (const
|
|
60
|
+
for (const [index, row] of [...seed].entries()) {
|
|
61
|
+
const record = parseUnitRecord(row, `seed ${index + 1}`);
|
|
62
|
+
|
|
60
63
|
this.#records.set(unitRecordKey(record), record);
|
|
61
64
|
}
|
|
62
65
|
}
|
package/src/stores/ports.ts
CHANGED
|
@@ -56,6 +56,9 @@ export type CapturedUnitRecord = {
|
|
|
56
56
|
requestedModel: string | null;
|
|
57
57
|
reportedModel: string | null;
|
|
58
58
|
parameters: Record<string, unknown>;
|
|
59
|
+
// The adapter that captured the answer, recorded only when it is not the
|
|
60
|
+
// surface's legacy adapter: absent means the legacy adapter.
|
|
61
|
+
adapter?: string;
|
|
59
62
|
};
|
|
60
63
|
} & UnitRecordBase;
|
|
61
64
|
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { probeFailureKinds } from '../probes/failure';
|
|
3
|
+
import {
|
|
4
|
+
aeoSurfaceSchema,
|
|
5
|
+
isAgentSurface,
|
|
6
|
+
retrievalLogSchema,
|
|
7
|
+
} from '../schema';
|
|
8
|
+
import type { UnitRecord } from './ports';
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// A probe store row as it may have been written by any release (probe
|
|
12
|
+
// adapters spec §7, phase 3 item 6). Read rows are validated against it: a
|
|
13
|
+
// row that does not match stops the run before any dispatch. It is never read
|
|
14
|
+
// as missing, which would probe a paid unit again and then lose the new
|
|
15
|
+
// answer to the stored row's conflict on `put`.
|
|
16
|
+
//
|
|
17
|
+
// Every legacy shape is accepted: rows without `status` (before unit
|
|
18
|
+
// outcomes), without `runId`, `captureMetadata`, `retrieval` or a reported
|
|
19
|
+
// model. Validation never rewrites a row: the store keeps the bytes it read.
|
|
20
|
+
// ============================================================================
|
|
21
|
+
|
|
22
|
+
const unitFields = {
|
|
23
|
+
sectionKey: z.string().min(1),
|
|
24
|
+
promptId: z.string().min(1),
|
|
25
|
+
promptText: z.string(),
|
|
26
|
+
surface: aeoSurfaceSchema,
|
|
27
|
+
runIndex: z.number().int().positive(),
|
|
28
|
+
runId: z.string().min(1).optional(),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// Every field a release has banked on a probe: the chat result, then the
|
|
32
|
+
// coding agent's additions.
|
|
33
|
+
const probeSchema = z
|
|
34
|
+
.object({
|
|
35
|
+
promptId: z.string().min(1),
|
|
36
|
+
promptText: z.string(),
|
|
37
|
+
promptCategory: z.string(),
|
|
38
|
+
modelName: aeoSurfaceSchema,
|
|
39
|
+
runIndex: z.number().int().positive(),
|
|
40
|
+
text: z.string(),
|
|
41
|
+
retrieval: retrievalLogSchema.optional(),
|
|
42
|
+
noOverview: z.literal(true).optional(),
|
|
43
|
+
reportedModel: z.string().optional(),
|
|
44
|
+
usedWebSearch: z.boolean().nullable().optional(),
|
|
45
|
+
agentCliVersion: z.string().optional(),
|
|
46
|
+
requestedModel: z.string().nullable().optional(),
|
|
47
|
+
})
|
|
48
|
+
.strict()
|
|
49
|
+
.superRefine((probe, context) => {
|
|
50
|
+
const agent = isAgentSurface(probe.modelName);
|
|
51
|
+
|
|
52
|
+
if (
|
|
53
|
+
agent &&
|
|
54
|
+
(probe.usedWebSearch === undefined || !probe.agentCliVersion)
|
|
55
|
+
) {
|
|
56
|
+
context.addIssue({
|
|
57
|
+
code: 'custom',
|
|
58
|
+
message: 'A coding-agent probe names its web-tool use and CLI version.',
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (!agent && probe.agentCliVersion !== undefined) {
|
|
63
|
+
context.addIssue({
|
|
64
|
+
code: 'custom',
|
|
65
|
+
message: 'A chat probe carries no CLI version.',
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const captureMetadataSchema = z
|
|
71
|
+
.object({
|
|
72
|
+
requestedModel: z.string().nullable(),
|
|
73
|
+
reportedModel: z.string().nullable(),
|
|
74
|
+
parameters: z.record(z.string(), z.unknown()),
|
|
75
|
+
adapter: z.string().min(1).max(200).optional(),
|
|
76
|
+
})
|
|
77
|
+
.strict();
|
|
78
|
+
|
|
79
|
+
const capturedRowSchema = z
|
|
80
|
+
.object({
|
|
81
|
+
status: z.literal('captured').optional(),
|
|
82
|
+
...unitFields,
|
|
83
|
+
capturedAt: z.iso.datetime(),
|
|
84
|
+
probe: probeSchema,
|
|
85
|
+
captureMetadata: captureMetadataSchema.optional(),
|
|
86
|
+
})
|
|
87
|
+
.strict()
|
|
88
|
+
.superRefine((row, context) => {
|
|
89
|
+
if (
|
|
90
|
+
row.probe.modelName !== row.surface ||
|
|
91
|
+
row.probe.promptId !== row.promptId ||
|
|
92
|
+
row.probe.runIndex !== row.runIndex
|
|
93
|
+
) {
|
|
94
|
+
context.addIssue({
|
|
95
|
+
code: 'custom',
|
|
96
|
+
message: "The probe's surface, prompt and run differ from the row's.",
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const failedRowSchema = z
|
|
102
|
+
.object({
|
|
103
|
+
status: z.literal('failed'),
|
|
104
|
+
...unitFields,
|
|
105
|
+
failedAt: z.iso.datetime(),
|
|
106
|
+
kind: z.enum(probeFailureKinds),
|
|
107
|
+
attempts: z.number().int().nonnegative(),
|
|
108
|
+
lastError: z.string(),
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
|
|
112
|
+
/** A stored row that no release could have written. */
|
|
113
|
+
export class ProbeStoreIntegrityError extends Error {
|
|
114
|
+
constructor(message: string) {
|
|
115
|
+
super(message);
|
|
116
|
+
this.name = 'ProbeStoreIntegrityError';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const isRecordLike = (row: unknown): row is Record<string, unknown> => {
|
|
121
|
+
return typeof row === 'object' && row !== null && !Array.isArray(row);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* parseUnitRecord validates a stored row and returns it as a unit record,
|
|
126
|
+
* unchanged but for the `status` a row from before unit outcomes lacks.
|
|
127
|
+
* `where` names the row in the error (a file line, a unit key).
|
|
128
|
+
*/
|
|
129
|
+
export const parseUnitRecord = (row: unknown, where: string): UnitRecord => {
|
|
130
|
+
const failed = isRecordLike(row) && row.status === 'failed';
|
|
131
|
+
const result = (failed ? failedRowSchema : capturedRowSchema).safeParse(row);
|
|
132
|
+
|
|
133
|
+
if (!result.success || !isRecordLike(row)) {
|
|
134
|
+
const issue = result.error?.issues[0];
|
|
135
|
+
const field = issue?.path.join('.') ?? '';
|
|
136
|
+
const reason = issue
|
|
137
|
+
? `${field === '' ? '' : `${field}: `}${issue.message}`
|
|
138
|
+
: 'not an object';
|
|
139
|
+
|
|
140
|
+
throw new ProbeStoreIntegrityError(
|
|
141
|
+
`Probe store row ${where} is invalid (${reason}). Please repair or remove the row; the run stops rather than probe a banked unit again.`,
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Validated above; the row itself is kept so its stored bytes never change.
|
|
146
|
+
const record = (
|
|
147
|
+
failed || row.status === 'captured' ? row : { ...row, status: 'captured' }
|
|
148
|
+
) as UnitRecord;
|
|
149
|
+
|
|
150
|
+
return record;
|
|
151
|
+
};
|