literally-aeo 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +73 -2
- package/dist/author-tools.js +3031 -0
- package/dist/cli.mjs +25536 -0
- package/dist/lib/access/schema.js +24 -0
- package/dist/lib/agents/author-schema.js +28 -0
- package/dist/lib/agents/author-validation.js +46 -0
- package/dist/lib/agents/copy-schema.js +30 -0
- package/dist/lib/agents/copy-validation.js +62 -0
- package/dist/lib/agents/copywriter-input.js +31 -0
- package/dist/lib/agents/credentials.js +6 -0
- package/dist/lib/agents/facts.js +31 -0
- package/dist/lib/agents/narrative-facts.js +12 -0
- package/dist/lib/agents/verifier.js +62 -0
- package/dist/lib/analysis/answer-text.js +19 -0
- package/dist/lib/analysis/competitor-classifier.js +6 -0
- package/dist/lib/analysis/domain-classifier.js +73 -0
- package/dist/lib/analysis/domain-labels.js +32 -0
- package/dist/lib/analysis/domain-match.js +12 -0
- package/dist/lib/analysis/name-forms.js +12 -0
- package/dist/lib/analysis/outreach.js +17 -0
- package/dist/lib/analysis/progress-schema.js +13 -0
- package/dist/lib/analysis/progress.js +39 -0
- package/dist/lib/analysis/qualified-competitors.js +7 -0
- package/dist/lib/analysis/retrieval.js +16 -0
- package/dist/lib/analysis/scoring.js +12 -0
- package/dist/lib/analysis/search-analyzer.js +17 -0
- package/dist/lib/analysis/sentiment.js +61 -0
- package/dist/lib/analysis/source-classifier.js +22 -0
- package/dist/lib/analysis/source-mix.js +16 -0
- package/dist/lib/analysis/verbatim.js +6 -0
- package/dist/lib/api/errors.js +10 -0
- package/dist/lib/author/examples.js +34 -0
- package/dist/lib/bundle/checks.js +16 -0
- package/dist/lib/bundle/contracts.js +66 -0
- package/dist/lib/bundle/export.js +69 -0
- package/dist/lib/bundle/journal.js +41 -0
- package/dist/lib/bundle/json.js +13 -0
- package/dist/lib/bundle/lineage.js +13 -0
- package/dist/lib/bundle/paths.js +6 -0
- package/dist/lib/bundle/project-journal.js +36 -0
- package/dist/lib/bundle/project.js +55 -0
- package/dist/lib/bundle/read.js +60 -0
- package/dist/lib/bundle/recorder.js +46 -0
- package/dist/lib/bundle/redact.js +35 -0
- package/dist/lib/bundle/trace-coverage.js +33 -0
- package/dist/lib/bundle/verify-integrity.js +41 -0
- package/dist/lib/bundle/verify-measurement.js +49 -0
- package/dist/lib/bundle/verify-report.js +62 -0
- package/dist/lib/bundle/verify.js +71 -0
- package/dist/lib/bundle/writer-lock.js +11 -0
- package/dist/lib/bundle/zip.js +13 -0
- package/dist/lib/capture-manifest.js +42 -0
- package/dist/lib/checks/crawler-access.js +16 -0
- package/dist/lib/checks/renderability.js +8 -0
- package/dist/lib/checks/run-checks.js +38 -0
- package/dist/lib/chunks/chunk-2GY42RIJ.js +33 -0
- package/dist/lib/chunks/chunk-2MGARWKY.js +138 -0
- package/dist/lib/chunks/chunk-2NJEWPCV.js +94 -0
- package/dist/lib/chunks/chunk-2PAO43CH.js +43 -0
- package/dist/lib/chunks/chunk-2QLAFBCG.js +8 -0
- package/dist/lib/chunks/chunk-2URYGUMH.js +27 -0
- package/dist/lib/chunks/chunk-3BFCI7LI.js +34 -0
- package/dist/lib/chunks/chunk-3BJWRD4O.js +0 -0
- package/dist/lib/chunks/chunk-3DG7GHFA.js +297 -0
- package/dist/lib/chunks/chunk-3EBWDHPK.js +133 -0
- package/dist/lib/chunks/chunk-3KQFLOC7.js +188 -0
- package/dist/lib/chunks/chunk-3UFZ2XPE.js +73 -0
- package/dist/lib/chunks/chunk-47IZBMP2.js +115 -0
- package/dist/lib/chunks/chunk-4E4NDGOZ.js +47 -0
- package/dist/lib/chunks/chunk-4QQJXCD2.js +113 -0
- package/dist/lib/chunks/chunk-55U7PRRM.js +26 -0
- package/dist/lib/chunks/chunk-565CYND6.js +93 -0
- package/dist/lib/chunks/chunk-56VOFZ7T.js +1486 -0
- package/dist/lib/chunks/chunk-5B3RNVZ6.js +193 -0
- package/dist/lib/chunks/chunk-5HT55QYX.js +53 -0
- package/dist/lib/chunks/chunk-5KKLUM7M.js +105 -0
- package/dist/lib/chunks/chunk-5SOTF3XD.js +56 -0
- package/dist/lib/chunks/chunk-5T3V6XJS.js +41 -0
- package/dist/lib/chunks/chunk-5VNYUCLL.js +352 -0
- package/dist/lib/chunks/chunk-5ZITQDVE.js +149 -0
- package/dist/lib/chunks/chunk-6AUEDSTU.js +52 -0
- package/dist/lib/chunks/chunk-6EH4N3EU.js +113 -0
- package/dist/lib/chunks/chunk-6EI4CVRW.js +33 -0
- package/dist/lib/chunks/chunk-6GKKALCI.js +538 -0
- package/dist/lib/chunks/chunk-6GSQKCKF.js +48 -0
- package/dist/lib/chunks/chunk-6KHQ7DXP.js +100 -0
- package/dist/lib/chunks/chunk-6RAKXYSR.js +226 -0
- package/dist/lib/chunks/chunk-72P6NOKD.js +190 -0
- package/dist/lib/chunks/chunk-74UNVGWB.js +0 -0
- package/dist/lib/chunks/chunk-7GXRDAUY.js +554 -0
- package/dist/lib/chunks/chunk-7MR6IJ7I.js +0 -0
- package/dist/lib/chunks/chunk-7O3M6I2X.js +123 -0
- package/dist/lib/chunks/chunk-7PLK6VGC.js +12 -0
- package/dist/lib/chunks/chunk-7QYZSP7Q.js +190 -0
- package/dist/lib/chunks/chunk-7YYDUHJG.js +113 -0
- package/dist/lib/chunks/chunk-7ZOJE6BH.js +73 -0
- package/dist/lib/chunks/chunk-AP5DLF36.js +150 -0
- package/dist/lib/chunks/chunk-AUB5THIS.js +341 -0
- package/dist/lib/chunks/chunk-B5L2KMTU.js +108 -0
- package/dist/lib/chunks/chunk-C6CMSW5J.js +13 -0
- package/dist/lib/chunks/chunk-CFFPOTP4.js +356 -0
- package/dist/lib/chunks/chunk-CJ5YD3CU.js +237 -0
- package/dist/lib/chunks/chunk-CKUTDJAB.js +213 -0
- package/dist/lib/chunks/chunk-CPT2GKKW.js +188 -0
- package/dist/lib/chunks/chunk-CQ62GN7P.js +30 -0
- package/dist/lib/chunks/chunk-CRVCWDH6.js +0 -0
- package/dist/lib/chunks/chunk-D2INDP5W.js +240 -0
- package/dist/lib/chunks/chunk-D2LPQO6Y.js +39 -0
- package/dist/lib/chunks/chunk-D5B4ZOW6.js +61 -0
- package/dist/lib/chunks/chunk-D7GEQVLL.js +115 -0
- package/dist/lib/chunks/chunk-DC6PN7QJ.js +193 -0
- package/dist/lib/chunks/chunk-DYJVVQHD.js +60 -0
- package/dist/lib/chunks/chunk-E3CDKC5B.js +45 -0
- package/dist/lib/chunks/chunk-E3OEE5XN.js +202 -0
- package/dist/lib/chunks/chunk-E4HADK7C.js +18 -0
- package/dist/lib/chunks/chunk-E6NQQU6V.js +111 -0
- package/dist/lib/chunks/chunk-EBXOHAMQ.js +131 -0
- package/dist/lib/chunks/chunk-EPQHVILQ.js +348 -0
- package/dist/lib/chunks/chunk-EV4DRS5M.js +61 -0
- package/dist/lib/chunks/chunk-EYKINDNK.js +29 -0
- package/dist/lib/chunks/chunk-EZD2C7QS.js +10 -0
- package/dist/lib/chunks/chunk-FBFZBLTY.js +752 -0
- package/dist/lib/chunks/chunk-FFOVLI3U.js +235 -0
- package/dist/lib/chunks/chunk-FKLNEB2P.js +529 -0
- package/dist/lib/chunks/chunk-FNDJUELJ.js +253 -0
- package/dist/lib/chunks/chunk-FPAN3VRW.js +350 -0
- package/dist/lib/chunks/chunk-FT5NSQYX.js +0 -0
- package/dist/lib/chunks/chunk-FWBVTM7F.js +11 -0
- package/dist/lib/chunks/chunk-GLXY73MK.js +165 -0
- package/dist/lib/chunks/chunk-GMGKKE5N.js +11 -0
- package/dist/lib/chunks/chunk-GMKF2FU4.js +104 -0
- package/dist/lib/chunks/chunk-GVC4LH2N.js +130 -0
- package/dist/lib/chunks/chunk-GVOF5ZUG.js +44 -0
- package/dist/lib/chunks/chunk-H2KDLDK6.js +13 -0
- package/dist/lib/chunks/chunk-H56DDRKE.js +85 -0
- package/dist/lib/chunks/chunk-HFOYASRQ.js +99 -0
- package/dist/lib/chunks/chunk-HOJXKHPX.js +34 -0
- package/dist/lib/chunks/chunk-HSZ3DM74.js +55 -0
- package/dist/lib/chunks/chunk-HXHFMFQU.js +29 -0
- package/dist/lib/chunks/chunk-I3TMFPK4.js +229 -0
- package/dist/lib/chunks/chunk-I7VNIW6Q.js +196 -0
- package/dist/lib/chunks/chunk-IAR6XGEW.js +184 -0
- package/dist/lib/chunks/chunk-IB6RROHE.js +204 -0
- package/dist/lib/chunks/chunk-IBOWGKN7.js +98 -0
- package/dist/lib/chunks/chunk-IEVAFDW7.js +513 -0
- package/dist/lib/chunks/chunk-IPNK7FYT.js +70 -0
- package/dist/lib/chunks/chunk-IRPKBDB7.js +13 -0
- package/dist/lib/chunks/chunk-ISN6MBNB.js +70 -0
- package/dist/lib/chunks/chunk-J46W3EMQ.js +237 -0
- package/dist/lib/chunks/chunk-JQ3P552S.js +0 -0
- package/dist/lib/chunks/chunk-JS3GBU3R.js +46 -0
- package/dist/lib/chunks/chunk-KHU5DRBE.js +343 -0
- package/dist/lib/chunks/chunk-KMRQSIZW.js +90 -0
- package/dist/lib/chunks/chunk-KRFHQQS7.js +323 -0
- package/dist/lib/chunks/chunk-KZR25REO.js +95 -0
- package/dist/lib/chunks/chunk-LIZX4N3H.js +110 -0
- package/dist/lib/chunks/chunk-LPND3VNQ.js +812 -0
- package/dist/lib/chunks/chunk-MD4AVTK2.js +257 -0
- package/dist/lib/chunks/chunk-MHAKYFDF.js +741 -0
- package/dist/lib/chunks/chunk-MIF5IYNR.js +139 -0
- package/dist/lib/chunks/chunk-MRRWMAPA.js +0 -0
- package/dist/lib/chunks/chunk-MX6Y4RD2.js +22 -0
- package/dist/lib/chunks/chunk-N2XIGMJ6.js +0 -0
- package/dist/lib/chunks/chunk-NANJGMEJ.js +108 -0
- package/dist/lib/chunks/chunk-NCLFZOZU.js +74 -0
- package/dist/lib/chunks/chunk-NH4QGBJV.js +61 -0
- package/dist/lib/chunks/chunk-NL2LDKXX.js +125 -0
- package/dist/lib/chunks/chunk-NVBMIPXR.js +259 -0
- package/dist/lib/chunks/chunk-NZFMOQHU.js +32 -0
- package/dist/lib/chunks/chunk-O2DKE2RO.js +77 -0
- package/dist/lib/chunks/chunk-O7M2OY3H.js +35 -0
- package/dist/lib/chunks/chunk-OBXAHX3L.js +46 -0
- package/dist/lib/chunks/chunk-OORO55OM.js +922 -0
- package/dist/lib/chunks/chunk-OQVIRYT5.js +147 -0
- package/dist/lib/chunks/chunk-OVUCZLH2.js +114 -0
- package/dist/lib/chunks/chunk-OX656HYK.js +46 -0
- package/dist/lib/chunks/chunk-OYKV5NDM.js +28 -0
- package/dist/lib/chunks/chunk-PCYNBDZ7.js +386 -0
- package/dist/lib/chunks/chunk-PDS5KWO3.js +256 -0
- package/dist/lib/chunks/chunk-PKB6JRJM.js +53 -0
- package/dist/lib/chunks/chunk-PO2J5OQ3.js +46 -0
- package/dist/lib/chunks/chunk-POUSX3T4.js +64 -0
- package/dist/lib/chunks/chunk-PYLJISDZ.js +206 -0
- package/dist/lib/chunks/chunk-Q2PWES4B.js +822 -0
- package/dist/lib/chunks/chunk-QBD24WTZ.js +37 -0
- package/dist/lib/chunks/chunk-QFVRCSJ2.js +54 -0
- package/dist/lib/chunks/chunk-QTXOW5XC.js +14 -0
- package/dist/lib/chunks/chunk-RMFT4KKK.js +281 -0
- package/dist/lib/chunks/chunk-S2AM76LT.js +90 -0
- package/dist/lib/chunks/chunk-S2SFHTJD.js +152 -0
- package/dist/lib/chunks/chunk-S42BCLHP.js +0 -0
- package/dist/lib/chunks/chunk-S7KJZIUR.js +241 -0
- package/dist/lib/chunks/chunk-SBAZBOPI.js +33 -0
- package/dist/lib/chunks/chunk-SBQ4TWGJ.js +33 -0
- package/dist/lib/chunks/chunk-SDWYZM64.js +371 -0
- package/dist/lib/chunks/chunk-SREGO3PU.js +25 -0
- package/dist/lib/chunks/chunk-SWJ7KQSL.js +318 -0
- package/dist/lib/chunks/chunk-SWS3K62X.js +93 -0
- package/dist/lib/chunks/chunk-SZ2UBZKG.js +13 -0
- package/dist/lib/chunks/chunk-TCOH3FGE.js +66 -0
- package/dist/lib/chunks/chunk-TGTM5ZFR.js +82 -0
- package/dist/lib/chunks/chunk-TNL2GWYR.js +345 -0
- package/dist/lib/chunks/chunk-UGCT46PC.js +20 -0
- package/dist/lib/chunks/chunk-ULRXHSJL.js +85 -0
- package/dist/lib/chunks/chunk-URUODEVG.js +0 -0
- package/dist/lib/chunks/chunk-V5B6UZ3E.js +47 -0
- package/dist/lib/chunks/chunk-VHDVKEWO.js +102 -0
- package/dist/lib/chunks/chunk-W46Y7KBR.js +29 -0
- package/dist/lib/chunks/chunk-W5XYW6ZM.js +133 -0
- package/dist/lib/chunks/chunk-WDSCJEDG.js +371 -0
- package/dist/lib/chunks/chunk-WE2WPNG2.js +104 -0
- package/dist/lib/chunks/chunk-WJUHRJVW.js +55 -0
- package/dist/lib/chunks/chunk-WKH6BJAZ.js +167 -0
- package/dist/lib/chunks/chunk-WUELMJ22.js +345 -0
- package/dist/lib/chunks/chunk-X2Y2ZNG3.js +776 -0
- package/dist/lib/chunks/chunk-X6E44EGV.js +261 -0
- package/dist/lib/chunks/chunk-XHWRSGX3.js +95 -0
- package/dist/lib/chunks/chunk-XI5H46DF.js +47 -0
- package/dist/lib/chunks/chunk-XJVXASDD.js +281 -0
- package/dist/lib/chunks/chunk-XL4JIQ5X.js +316 -0
- package/dist/lib/chunks/chunk-XNRSHATN.js +303 -0
- package/dist/lib/chunks/chunk-Y4OGZ3Q5.js +365 -0
- package/dist/lib/chunks/chunk-Y6D6IVOM.js +299 -0
- package/dist/lib/chunks/chunk-YHS5IEVZ.js +252 -0
- package/dist/lib/chunks/chunk-YIEAIIND.js +6 -0
- package/dist/lib/chunks/chunk-YR67JG2V.js +65 -0
- package/dist/lib/chunks/chunk-YWJPJI3W.js +51 -0
- package/dist/lib/chunks/chunk-Z4LMDKBU.js +369 -0
- package/dist/lib/chunks/chunk-Z7V63UZA.js +108 -0
- package/dist/lib/chunks/chunk-ZBDUE3A5.js +136 -0
- package/dist/lib/chunks/chunk-ZCOI3HE2.js +45 -0
- package/dist/lib/chunks/chunk-ZLOOC46D.js +142 -0
- package/dist/lib/chunks/chunk-ZSEY7AHQ.js +123 -0
- package/dist/lib/chunks/chunk-ZVAKKRRD.js +11 -0
- package/dist/lib/chunks/chunk-ZXGATMMH.js +101 -0
- package/dist/lib/chunks/chunk-ZXQPD4OC.js +202 -0
- package/dist/lib/chunks/chunk-ZYSPTOKK.js +302 -0
- package/dist/lib/cli/bundle-commands.js +371 -0
- package/dist/lib/cli/io.js +12 -0
- package/dist/lib/cli/run-commands.js +614 -0
- package/dist/lib/codex-workflow/aggregate.js +56 -0
- package/dist/lib/codex-workflow/author-search.js +48 -0
- package/dist/lib/codex-workflow/author-tools.js +63 -0
- package/dist/lib/codex-workflow/author.js +99 -0
- package/dist/lib/codex-workflow/batch-input.js +7 -0
- package/dist/lib/codex-workflow/batch-layout.js +8 -0
- package/dist/lib/codex-workflow/capture.js +62 -0
- package/dist/lib/codex-workflow/checkpoint.js +39 -0
- package/dist/lib/codex-workflow/checks.js +44 -0
- package/dist/lib/codex-workflow/codex-home.js +17 -0
- package/dist/lib/codex-workflow/copy-editor.js +66 -0
- package/dist/lib/codex-workflow/copy-recovery.js +32 -0
- package/dist/lib/codex-workflow/copy.js +66 -0
- package/dist/lib/codex-workflow/finish.js +84 -0
- package/dist/lib/codex-workflow/host-models.js +15 -0
- package/dist/lib/codex-workflow/loop.js +140 -0
- package/dist/lib/codex-workflow/pending.js +8 -0
- package/dist/lib/codex-workflow/prompts.js +8 -0
- package/dist/lib/codex-workflow/quality.js +31 -0
- package/dist/lib/codex-workflow/run-inputs.js +38 -0
- package/dist/lib/codex-workflow/run-source.js +55 -0
- package/dist/lib/codex-workflow/schemas.js +58 -0
- package/dist/lib/codex-workflow/session.js +40 -0
- package/dist/lib/codex-workflow/stage.js +98 -0
- package/dist/lib/codex-workflow/workdir.js +42 -0
- package/dist/lib/configs/literally-2026-q3.js +6 -0
- package/dist/lib/container/protocol.js +20 -0
- package/dist/lib/coverage-schema.js +6 -0
- package/dist/lib/engine/audit-file.js +46 -0
- package/dist/lib/engine/author.js +97 -0
- package/dist/lib/engine/budget.js +16 -0
- package/dist/lib/engine/env-file.js +8 -0
- package/dist/lib/engine/local-run.js +149 -0
- package/dist/lib/engine/package-root.js +8 -0
- package/dist/lib/engine/preflight.js +43 -0
- package/dist/lib/engine/rejudge.js +151 -0
- package/dist/lib/engine/resources.js +7 -0
- package/dist/lib/engine/run-configuration.js +15 -0
- package/dist/lib/engine/templates.js +33 -0
- package/dist/lib/grounding/controller.js +31 -0
- package/dist/lib/grounding/extract.js +38 -0
- package/dist/lib/grounding/fetch.js +23 -0
- package/dist/lib/grounding/file-store.js +17 -0
- package/dist/lib/grounding/grounding-runtime.js +62 -0
- package/dist/lib/grounding/model-usage.js +9 -0
- package/dist/lib/grounding/model.js +30 -0
- package/dist/lib/grounding/profile.js +15 -0
- package/dist/lib/grounding/recorded-tools.js +35 -0
- package/dist/lib/grounding/schema.js +42 -0
- package/dist/lib/grounding/session.js +30 -0
- package/dist/lib/grounding/tools.js +25 -0
- package/dist/lib/grounding/validation.js +28 -0
- package/dist/lib/grounding.js +13 -0
- package/dist/lib/harness/checkpoint.js +17 -0
- package/dist/lib/harness/contracts.js +30 -0
- package/dist/lib/harness/criteria.js +14 -0
- package/dist/lib/harness/policy.js +25 -0
- package/dist/lib/harness/report/artifacts.js +36 -0
- package/dist/lib/harness/report/capture-coverage.js +11 -0
- package/dist/lib/harness/store.js +46 -0
- package/dist/lib/lib/analysis-checkpoint.js +10 -0
- package/dist/lib/lib/canonical-json.js +8 -0
- package/dist/lib/lib/checkpoint.js +34 -0
- package/dist/lib/lib/env.js +14 -0
- package/dist/lib/lib/log.js +7 -0
- package/dist/lib/lib/paths.js +8 -0
- package/dist/lib/lib/progress-comparison.js +16 -0
- package/dist/lib/lib/report-presentation.js +13 -0
- package/dist/lib/lib/run-id.js +8 -0
- package/dist/lib/lib/type-guards.js +8 -0
- package/dist/lib/models/accounting.js +22 -0
- package/dist/lib/models/batching.js +18 -0
- package/dist/lib/models/budget-protection.js +6 -0
- package/dist/lib/models/context.js +0 -0
- package/dist/lib/models/coverage-rounds.js +6 -0
- package/dist/lib/models/errors.js +8 -0
- package/dist/lib/models/failure-diagnostics.js +6 -0
- package/dist/lib/models/profiles.js +30 -0
- package/dist/lib/models/served-model.js +6 -0
- package/dist/lib/models/structured-images.js +10 -0
- package/dist/lib/models/structured.js +25 -0
- package/dist/lib/models/wire-schema.js +6 -0
- package/dist/lib/pipeline.js +57 -0
- package/dist/lib/probes/agent-cli-parsers.js +23 -0
- package/dist/lib/probes/agent-clis.js +64 -0
- package/dist/lib/probes/chat-retrieval.js +17 -0
- package/dist/lib/probes/child-process.js +13 -0
- package/dist/lib/probes/dataforseo-locale.js +10 -0
- package/dist/lib/probes/dataforseo.js +10 -0
- package/dist/lib/probes/failure.js +26 -0
- package/dist/lib/probes/grounding-urls.js +19 -0
- package/dist/lib/probes/limits.js +12 -0
- package/dist/lib/probes/outcomes.js +13 -0
- package/dist/lib/probes/probe-trace.js +12 -0
- package/dist/lib/probes/probes.js +40 -0
- package/dist/lib/probes/web-tool-guard.js +18 -0
- package/dist/lib/report/contracts.js +34 -0
- package/dist/lib/report/core/answer-text.js +18 -0
- package/dist/lib/report/core/copy-schema.js +10 -0
- package/dist/lib/report/core/domain-match.js +11 -0
- package/dist/lib/report/core/grounding.js +12 -0
- package/dist/lib/report/core/normalize-domain.js +6 -0
- package/dist/lib/report/core/progress-comparison.js +15 -0
- package/dist/lib/report/core/progress-question-sets.js +16 -0
- package/dist/lib/report/core/progress-schema.js +12 -0
- package/dist/lib/report/core/progress-slot-key.js +6 -0
- package/dist/lib/report/core/qualified-competitors.js +6 -0
- package/dist/lib/report/core/report-presentation.js +12 -0
- package/dist/lib/report/core/retrieval.js +10 -0
- package/dist/lib/report/core/schema.js +70 -0
- package/dist/lib/report/core/source-classifier.js +21 -0
- package/dist/lib/report/core/surfaces.js +18 -0
- package/dist/lib/retrieval.js +11 -0
- package/dist/lib/runner.js +71 -0
- package/dist/lib/schema.js +110 -0
- package/dist/lib/section-result.js +34 -0
- package/dist/lib/stores/artifacts.js +35 -0
- package/dist/lib/stores/content-hash.js +10 -0
- package/dist/lib/stores/file-publication.js +20 -0
- package/dist/lib/stores/files.js +76 -0
- package/dist/lib/stores/fs-errors.js +6 -0
- package/dist/lib/stores/local-versions.js +40 -0
- package/dist/lib/stores/memory.js +312 -0
- package/dist/lib/stores/ports.js +6 -0
- package/dist/lib/stores/publication-history.js +10 -0
- package/dist/lib/stores/publication.js +50 -0
- package/dist/lib/stores/run-lifecycle.js +12 -0
- package/dist/lib/stores/versions.js +6 -0
- package/dist/lib/surfaces.js +19 -0
- package/dist/lib/viewer/page.js +6 -0
- package/dist/lib/viewer/server.js +71 -0
- package/dist/lib/workflow/callbacks.js +15 -0
- package/dist/lib/workflow/lineage.js +8 -0
- package/dist/lib/workflow/schema.js +52 -0
- package/dist/types/access/schema.d.ts +75 -0
- package/dist/types/agents/author-schema.d.ts +76 -0
- package/dist/types/agents/author-validation.d.ts +73 -0
- package/dist/types/agents/copy-schema.d.ts +345 -0
- package/dist/types/agents/copy-validation.d.ts +158 -0
- package/dist/types/agents/copywriter-input.d.ts +46 -0
- package/dist/types/agents/credentials.d.ts +10 -0
- package/dist/types/agents/facts.d.ts +69 -0
- package/dist/types/agents/narrative-facts.d.ts +8 -0
- package/dist/types/agents/verifier.d.ts +167 -0
- package/dist/types/analysis/answer-text.d.ts +1 -0
- package/dist/types/analysis/competitor-classifier.d.ts +1 -0
- package/dist/types/analysis/domain-classifier.d.ts +105 -0
- package/dist/types/analysis/domain-labels.d.ts +30 -0
- package/dist/types/analysis/domain-match.d.ts +1 -0
- package/dist/types/analysis/name-forms.d.ts +25 -0
- package/dist/types/analysis/outreach.d.ts +6 -0
- package/dist/types/analysis/progress-schema.d.ts +1 -0
- package/dist/types/analysis/progress.d.ts +15 -0
- package/dist/types/analysis/qualified-competitors.d.ts +1 -0
- package/dist/types/analysis/retrieval.d.ts +22 -0
- package/dist/types/analysis/scoring.d.ts +55 -0
- package/dist/types/analysis/search-analyzer.d.ts +23 -0
- package/dist/types/analysis/sentiment.d.ts +99 -0
- package/dist/types/analysis/source-classifier.d.ts +1 -0
- package/dist/types/analysis/source-mix.d.ts +6 -0
- package/dist/types/analysis/verbatim.d.ts +1 -0
- package/dist/types/api/errors.d.ts +30 -0
- package/dist/types/author/examples.d.ts +31 -0
- package/dist/types/bundle/checks.d.ts +45 -0
- package/dist/types/bundle/contracts.d.ts +354 -0
- package/dist/types/bundle/export.d.ts +46 -0
- package/dist/types/bundle/journal.d.ts +39 -0
- package/dist/types/bundle/json.d.ts +8 -0
- package/dist/types/bundle/lineage.d.ts +13 -0
- package/dist/types/bundle/paths.d.ts +2 -0
- package/dist/types/bundle/project-journal.d.ts +31 -0
- package/dist/types/bundle/project.d.ts +30 -0
- package/dist/types/bundle/read.d.ts +9 -0
- package/dist/types/bundle/recorder.d.ts +89 -0
- package/dist/types/bundle/redact.d.ts +17 -0
- package/dist/types/bundle/trace-coverage.d.ts +36 -0
- package/dist/types/bundle/verify-integrity.d.ts +11 -0
- package/dist/types/bundle/verify-measurement.d.ts +26 -0
- package/dist/types/bundle/verify-report.d.ts +16 -0
- package/dist/types/bundle/verify.d.ts +31 -0
- package/dist/types/bundle/writer-lock.d.ts +23 -0
- package/dist/types/bundle/zip.d.ts +24 -0
- package/dist/types/capture-manifest.d.ts +122 -0
- package/dist/types/checks/crawler-access.d.ts +25 -0
- package/dist/types/checks/renderability.d.ts +4 -0
- package/dist/types/checks/run-checks.d.ts +8 -0
- package/dist/types/cli/bundle-commands.d.ts +5 -0
- package/dist/types/cli/io.d.ts +10 -0
- package/dist/types/cli/literally-aeo.d.ts +1 -0
- package/dist/types/cli/run-commands.d.ts +14 -0
- package/dist/types/codex-workflow/aggregate.d.ts +76 -0
- package/dist/types/codex-workflow/author-search.d.ts +26 -0
- package/dist/types/codex-workflow/author-tools-server.d.ts +1 -0
- package/dist/types/codex-workflow/author-tools.d.ts +145 -0
- package/dist/types/codex-workflow/author.d.ts +101 -0
- package/dist/types/codex-workflow/batch-input.d.ts +12 -0
- package/dist/types/codex-workflow/batch-layout.d.ts +16 -0
- package/dist/types/codex-workflow/capture.d.ts +37 -0
- package/dist/types/codex-workflow/checkpoint.d.ts +18 -0
- package/dist/types/codex-workflow/checks.d.ts +53 -0
- package/dist/types/codex-workflow/codex-home.d.ts +47 -0
- package/dist/types/codex-workflow/copy-editor.d.ts +164 -0
- package/dist/types/codex-workflow/copy-recovery.d.ts +30 -0
- package/dist/types/codex-workflow/copy.d.ts +62 -0
- package/dist/types/codex-workflow/finish.d.ts +53 -0
- package/dist/types/codex-workflow/host-models.d.ts +5 -0
- package/dist/types/codex-workflow/loop.d.ts +177 -0
- package/dist/types/codex-workflow/pending.d.ts +6 -0
- package/dist/types/codex-workflow/prompts.d.ts +14 -0
- package/dist/types/codex-workflow/quality.d.ts +25 -0
- package/dist/types/codex-workflow/run-inputs.d.ts +951 -0
- package/dist/types/codex-workflow/run-source.d.ts +34 -0
- package/dist/types/codex-workflow/schemas.d.ts +493 -0
- package/dist/types/codex-workflow/session.d.ts +13 -0
- package/dist/types/codex-workflow/stage.d.ts +136 -0
- package/dist/types/codex-workflow/workdir.d.ts +40 -0
- package/dist/types/configs/literally-2026-q3.d.ts +2 -0
- package/dist/types/container/protocol.d.ts +72 -0
- package/dist/types/coverage-schema.d.ts +6 -0
- package/dist/types/engine/audit-file.d.ts +126 -0
- package/dist/types/engine/author.d.ts +52 -0
- package/dist/types/engine/budget.d.ts +68 -0
- package/dist/types/engine/env-file.d.ts +13 -0
- package/dist/types/engine/local-run.d.ts +62 -0
- package/dist/types/engine/package-root.d.ts +8 -0
- package/dist/types/engine/preflight.d.ts +27 -0
- package/dist/types/engine/rejudge.d.ts +14 -0
- package/dist/types/engine/resources.d.ts +8 -0
- package/dist/types/engine/run-configuration.d.ts +36 -0
- package/dist/types/engine/templates.d.ts +38 -0
- package/dist/types/grounding/controller.d.ts +110 -0
- package/dist/types/grounding/extract.d.ts +103 -0
- package/dist/types/grounding/fetch.d.ts +53 -0
- package/dist/types/grounding/file-store.d.ts +2 -0
- package/dist/types/grounding/grounding-runtime.d.ts +43 -0
- package/dist/types/grounding/model-usage.d.ts +13 -0
- package/dist/types/grounding/model.d.ts +51 -0
- package/dist/types/grounding/profile.d.ts +15 -0
- package/dist/types/grounding/recorded-tools.d.ts +12 -0
- package/dist/types/grounding/schema.d.ts +521 -0
- package/dist/types/grounding/session.d.ts +143 -0
- package/dist/types/grounding/tools.d.ts +135 -0
- package/dist/types/grounding/validation.d.ts +35 -0
- package/dist/types/grounding.d.ts +1 -0
- package/dist/types/harness/checkpoint.d.ts +29 -0
- package/dist/types/harness/contracts.d.ts +141 -0
- package/dist/types/harness/criteria.d.ts +34 -0
- package/dist/types/harness/policy.d.ts +9 -0
- package/dist/types/harness/report/artifacts.d.ts +287 -0
- package/dist/types/harness/report/capture-coverage.d.ts +11 -0
- package/dist/types/harness/store.d.ts +116 -0
- package/dist/types/lib/analysis-checkpoint.d.ts +20 -0
- package/dist/types/lib/canonical-json.d.ts +11 -0
- package/dist/types/lib/checkpoint.d.ts +33 -0
- package/dist/types/lib/env.d.ts +31 -0
- package/dist/types/lib/log.d.ts +11 -0
- package/dist/types/lib/paths.d.ts +2 -0
- package/dist/types/lib/progress-comparison.d.ts +1 -0
- package/dist/types/lib/report-presentation.d.ts +1 -0
- package/dist/types/lib/run-id.d.ts +2 -0
- package/dist/types/lib/type-guards.d.ts +9 -0
- package/dist/types/models/accounting.d.ts +147 -0
- package/dist/types/models/batching.d.ts +17 -0
- package/dist/types/models/budget-protection.d.ts +10 -0
- package/dist/types/models/context.d.ts +8 -0
- package/dist/types/models/coverage-rounds.d.ts +47 -0
- package/dist/types/models/errors.d.ts +12 -0
- package/dist/types/models/failure-diagnostics.d.ts +8 -0
- package/dist/types/models/profiles.d.ts +551 -0
- package/dist/types/models/served-model.d.ts +11 -0
- package/dist/types/models/structured-images.d.ts +9 -0
- package/dist/types/models/structured.d.ts +111 -0
- package/dist/types/models/wire-schema.d.ts +27 -0
- package/dist/types/pipeline.d.ts +117 -0
- package/dist/types/probes/agent-cli-parsers.d.ts +46 -0
- package/dist/types/probes/agent-clis.d.ts +132 -0
- package/dist/types/probes/chat-retrieval.d.ts +14 -0
- package/dist/types/probes/child-process.d.ts +28 -0
- package/dist/types/probes/dataforseo-locale.d.ts +8 -0
- package/dist/types/probes/dataforseo.d.ts +15 -0
- package/dist/types/probes/failure.d.ts +30 -0
- package/dist/types/probes/grounding-urls.d.ts +18 -0
- package/dist/types/probes/limits.d.ts +30 -0
- package/dist/types/probes/outcomes.d.ts +20 -0
- package/dist/types/probes/probe-trace.d.ts +51 -0
- package/dist/types/probes/probes.d.ts +47 -0
- package/dist/types/probes/web-tool-guard.d.ts +59 -0
- package/dist/types/report/contracts.d.ts +973 -0
- package/dist/types/report/core/answer-text.d.ts +24 -0
- package/dist/types/report/core/copy-schema.d.ts +47 -0
- package/dist/types/report/core/domain-match.d.ts +9 -0
- package/dist/types/report/core/grounding.d.ts +4 -0
- package/dist/types/report/core/normalize-domain.d.ts +2 -0
- package/dist/types/report/core/progress-comparison.d.ts +52 -0
- package/dist/types/report/core/progress-question-sets.d.ts +16 -0
- package/dist/types/report/core/progress-schema.d.ts +101 -0
- package/dist/types/report/core/progress-slot-key.d.ts +9 -0
- package/dist/types/report/core/qualified-competitors.d.ts +6 -0
- package/dist/types/report/core/report-presentation.d.ts +10 -0
- package/dist/types/report/core/retrieval.d.ts +6 -0
- package/dist/types/report/core/schema.d.ts +745 -0
- package/dist/types/report/core/source-classifier.d.ts +21 -0
- package/dist/types/report/core/surfaces.d.ts +11 -0
- package/dist/types/retrieval.d.ts +1 -0
- package/dist/types/runner.d.ts +96 -0
- package/dist/types/schema.d.ts +858 -0
- package/dist/types/section-result.d.ts +4 -0
- package/dist/types/stores/artifacts.d.ts +2 -0
- package/dist/types/stores/content-hash.d.ts +2 -0
- package/dist/types/stores/file-publication.d.ts +31 -0
- package/dist/types/stores/files.d.ts +87 -0
- package/dist/types/stores/fs-errors.d.ts +5 -0
- package/dist/types/stores/local-versions.d.ts +54 -0
- package/dist/types/stores/memory.d.ts +76 -0
- package/dist/types/stores/ports.d.ts +150 -0
- package/dist/types/stores/publication-history.d.ts +27 -0
- package/dist/types/stores/publication.d.ts +53 -0
- package/dist/types/stores/run-lifecycle.d.ts +7 -0
- package/dist/types/stores/versions.d.ts +71 -0
- package/dist/types/surfaces.d.ts +1 -0
- package/dist/types/viewer/page.d.ts +2 -0
- package/dist/types/viewer/server.d.ts +14 -0
- package/dist/types/workflow/callbacks.d.ts +22 -0
- package/dist/types/workflow/lineage.d.ts +20 -0
- package/dist/types/workflow/schema.d.ts +1572 -0
- package/package.json +95 -3
- package/resources/author/COPY_RULES.md +95 -0
- package/resources/author/RULES.md +104 -0
- package/resources/author/banlist.json +38 -0
- package/resources/editorial/COMPANY.md +11 -0
- package/resources/editorial/positioning.md +8 -0
- package/resources/editorial/services.md +4 -0
- package/src/access/schema.ts +96 -0
- package/src/agents/author-schema.ts +49 -0
- package/src/agents/author-validation.ts +409 -0
- package/src/agents/copy-schema.ts +214 -0
- package/src/agents/copy-validation.ts +1170 -0
- package/src/agents/copywriter-input.ts +90 -0
- package/src/agents/credentials.ts +60 -0
- package/src/agents/facts.ts +343 -0
- package/src/agents/narrative-facts.ts +174 -0
- package/src/agents/verifier.ts +603 -0
- package/src/analysis/answer-text.ts +1 -0
- package/src/analysis/competitor-classifier.ts +15 -0
- package/src/analysis/domain-classifier.ts +804 -0
- package/src/analysis/domain-labels.ts +67 -0
- package/src/analysis/domain-match.ts +1 -0
- package/src/analysis/name-forms.ts +59 -0
- package/src/analysis/outreach.ts +107 -0
- package/src/analysis/progress-schema.ts +1 -0
- package/src/analysis/progress.ts +346 -0
- package/src/analysis/qualified-competitors.ts +1 -0
- package/src/analysis/retrieval.ts +105 -0
- package/src/analysis/scoring.ts +167 -0
- package/src/analysis/search-analyzer.ts +83 -0
- package/src/analysis/sentiment.ts +558 -0
- package/src/analysis/source-classifier.ts +1 -0
- package/src/analysis/source-mix.ts +56 -0
- package/src/analysis/verbatim.ts +107 -0
- package/src/api/errors.ts +50 -0
- package/src/author/COPY_RULES.md +95 -0
- package/src/author/RULES.md +104 -0
- package/src/author/banlist.json +38 -0
- package/src/author/examples.ts +79 -0
- package/src/bundle/checks.ts +146 -0
- package/src/bundle/contracts.ts +289 -0
- package/src/bundle/export.ts +448 -0
- package/src/bundle/journal.ts +270 -0
- package/src/bundle/json.ts +157 -0
- package/src/bundle/lineage.ts +45 -0
- package/src/bundle/paths.ts +36 -0
- package/src/bundle/project-journal.ts +179 -0
- package/src/bundle/project.ts +434 -0
- package/src/bundle/read.ts +154 -0
- package/src/bundle/recorder.ts +497 -0
- package/src/bundle/redact.ts +134 -0
- package/src/bundle/trace-coverage.ts +168 -0
- package/src/bundle/verify-integrity.ts +322 -0
- package/src/bundle/verify-measurement.ts +384 -0
- package/src/bundle/verify-report.ts +260 -0
- package/src/bundle/verify.ts +400 -0
- package/src/bundle/writer-lock.ts +133 -0
- package/src/bundle/zip.ts +281 -0
- package/src/capture-manifest.ts +348 -0
- package/src/checks/crawler-access.ts +373 -0
- package/src/checks/renderability.ts +164 -0
- package/src/checks/run-checks.ts +74 -0
- package/src/cli/bundle-commands.ts +249 -0
- package/src/cli/io.ts +63 -0
- package/src/cli/literally-aeo.ts +121 -0
- package/src/cli/run-commands.ts +535 -0
- package/src/codex-workflow/aggregate.ts +336 -0
- package/src/codex-workflow/author-search.ts +76 -0
- package/src/codex-workflow/author-tools-server.ts +208 -0
- package/src/codex-workflow/author-tools.ts +1202 -0
- package/src/codex-workflow/author.ts +512 -0
- package/src/codex-workflow/batch-input.ts +145 -0
- package/src/codex-workflow/batch-layout.ts +47 -0
- package/src/codex-workflow/capture.ts +255 -0
- package/src/codex-workflow/checkpoint.ts +127 -0
- package/src/codex-workflow/checks.ts +510 -0
- package/src/codex-workflow/codex-home.ts +187 -0
- package/src/codex-workflow/copy-editor.ts +322 -0
- package/src/codex-workflow/copy-recovery.ts +134 -0
- package/src/codex-workflow/copy.ts +195 -0
- package/src/codex-workflow/finish.ts +433 -0
- package/src/codex-workflow/host-models.ts +35 -0
- package/src/codex-workflow/loop.ts +1159 -0
- package/src/codex-workflow/pending.ts +24 -0
- package/src/codex-workflow/prompts.ts +153 -0
- package/src/codex-workflow/quality.ts +97 -0
- package/src/codex-workflow/run-inputs.ts +117 -0
- package/src/codex-workflow/run-source.ts +149 -0
- package/src/codex-workflow/schemas.ts +222 -0
- package/src/codex-workflow/session.ts +70 -0
- package/src/codex-workflow/stage.ts +2344 -0
- package/src/codex-workflow/workdir.ts +242 -0
- package/src/configs/literally-2026-q3.ts +199 -0
- package/src/container/protocol.ts +152 -0
- package/src/coverage-schema.ts +7 -0
- package/src/engine/audit-file.ts +254 -0
- package/src/engine/author.ts +279 -0
- package/src/engine/budget.ts +164 -0
- package/src/engine/editorial/COMPANY.md +11 -0
- package/src/engine/editorial/positioning.md +8 -0
- package/src/engine/editorial/services.md +4 -0
- package/src/engine/env-file.ts +87 -0
- package/src/engine/local-run.ts +323 -0
- package/src/engine/package-root.ts +47 -0
- package/src/engine/preflight.ts +156 -0
- package/src/engine/rejudge.ts +118 -0
- package/src/engine/resources.ts +45 -0
- package/src/engine/run-configuration.ts +70 -0
- package/src/engine/templates.ts +66 -0
- package/src/grounding/controller.ts +1211 -0
- package/src/grounding/extract.ts +830 -0
- package/src/grounding/fetch.ts +448 -0
- package/src/grounding/file-store.ts +131 -0
- package/src/grounding/grounding-runtime.ts +318 -0
- package/src/grounding/model-usage.ts +48 -0
- package/src/grounding/model.ts +508 -0
- package/src/grounding/profile.ts +63 -0
- package/src/grounding/recorded-tools.ts +40 -0
- package/src/grounding/schema.ts +262 -0
- package/src/grounding/session.ts +681 -0
- package/src/grounding/tools.ts +500 -0
- package/src/grounding/validation.ts +435 -0
- package/src/grounding.ts +1 -0
- package/src/harness/checkpoint.ts +53 -0
- package/src/harness/contracts.ts +169 -0
- package/src/harness/criteria.ts +166 -0
- package/src/harness/policy.ts +28 -0
- package/src/harness/report/artifacts.ts +130 -0
- package/src/harness/report/capture-coverage.ts +40 -0
- package/src/harness/store.ts +167 -0
- package/src/lib/analysis-checkpoint.ts +94 -0
- package/src/lib/canonical-json.ts +90 -0
- package/src/lib/checkpoint.ts +140 -0
- package/src/lib/env.ts +80 -0
- package/src/lib/log.ts +192 -0
- package/src/lib/paths.ts +14 -0
- package/src/lib/progress-comparison.ts +1 -0
- package/src/lib/report-presentation.ts +1 -0
- package/src/lib/run-id.ts +39 -0
- package/src/lib/type-guards.ts +14 -0
- package/src/models/accounting.ts +656 -0
- package/src/models/batching.ts +68 -0
- package/src/models/budget-protection.ts +68 -0
- package/src/models/context.ts +9 -0
- package/src/models/coverage-rounds.ts +125 -0
- package/src/models/errors.ts +39 -0
- package/src/models/failure-diagnostics.ts +157 -0
- package/src/models/profiles.ts +511 -0
- package/src/models/served-model.ts +20 -0
- package/src/models/structured-images.ts +95 -0
- package/src/models/structured.ts +634 -0
- package/src/models/wire-schema.ts +453 -0
- package/src/pipeline.ts +496 -0
- package/src/probes/agent-cli-parsers.ts +835 -0
- package/src/probes/agent-clis.ts +1482 -0
- package/src/probes/chat-retrieval.ts +238 -0
- package/src/probes/child-process.ts +280 -0
- package/src/probes/dataforseo-locale.ts +71 -0
- package/src/probes/dataforseo.ts +286 -0
- package/src/probes/failure.ts +182 -0
- package/src/probes/grounding-urls.ts +182 -0
- package/src/probes/limits.ts +181 -0
- package/src/probes/outcomes.ts +40 -0
- package/src/probes/probe-trace.ts +109 -0
- package/src/probes/probes.ts +789 -0
- package/src/probes/web-tool-guard.ts +195 -0
- package/src/report/contracts.ts +161 -0
- package/src/report/core/answer-text.ts +144 -0
- package/src/report/core/copy-schema.ts +75 -0
- package/src/report/core/domain-match.ts +52 -0
- package/src/report/core/grounding.ts +32 -0
- package/src/report/core/normalize-domain.ts +16 -0
- package/src/report/core/progress-comparison.ts +362 -0
- package/src/report/core/progress-question-sets.ts +93 -0
- package/src/report/core/progress-schema.ts +150 -0
- package/src/report/core/progress-slot-key.ts +20 -0
- package/src/report/core/qualified-competitors.ts +15 -0
- package/src/report/core/report-presentation.ts +112 -0
- package/src/report/core/retrieval.ts +49 -0
- package/src/report/core/schema.ts +489 -0
- package/src/report/core/source-classifier.ts +239 -0
- package/src/report/core/surfaces.ts +64 -0
- package/src/retrieval.ts +1 -0
- package/src/runner.ts +461 -0
- package/src/schema.ts +181 -0
- package/src/section-result.ts +315 -0
- package/src/stores/artifacts.ts +74 -0
- package/src/stores/content-hash.ts +8 -0
- package/src/stores/file-publication.ts +194 -0
- package/src/stores/files.ts +1069 -0
- package/src/stores/fs-errors.ts +12 -0
- package/src/stores/local-versions.ts +412 -0
- package/src/stores/memory.ts +432 -0
- package/src/stores/ports.ts +231 -0
- package/src/stores/publication-history.ts +48 -0
- package/src/stores/publication.ts +221 -0
- package/src/stores/run-lifecycle.ts +72 -0
- package/src/stores/versions.ts +113 -0
- package/src/surfaces.ts +1 -0
- package/src/viewer/page.ts +208 -0
- package/src/viewer/server.ts +215 -0
- package/src/workflow/callbacks.ts +201 -0
- package/src/workflow/lineage.ts +36 -0
- package/src/workflow/schema.ts +256 -0
package/src/runner.ts
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AeoAgentSurface,
|
|
3
|
+
AeoAuditConfig,
|
|
4
|
+
AeoPerception,
|
|
5
|
+
AeoSnapshot,
|
|
6
|
+
AeoSurface,
|
|
7
|
+
AeoVisibility,
|
|
8
|
+
RunRequest,
|
|
9
|
+
} from './schema';
|
|
10
|
+
import {
|
|
11
|
+
aeoSnapshotVersion,
|
|
12
|
+
allSurfaces,
|
|
13
|
+
chatSurfaces,
|
|
14
|
+
aeoSnapshotSchema,
|
|
15
|
+
isAgentSurface,
|
|
16
|
+
} from './schema';
|
|
17
|
+
import { createLog } from './lib/log';
|
|
18
|
+
import type { AgentCliVersions } from './probes/agent-clis';
|
|
19
|
+
import type { ProbeLimiter } from './probes/limits';
|
|
20
|
+
import type { PartialFailure } from './probes/web-tool-guard';
|
|
21
|
+
import type { SectionRunResult } from './pipeline';
|
|
22
|
+
import {
|
|
23
|
+
perceptionModel,
|
|
24
|
+
perceptionVersion,
|
|
25
|
+
legacyPerceptionVersion,
|
|
26
|
+
extractPerceptionForSection,
|
|
27
|
+
perceptionExtractionSchema,
|
|
28
|
+
type PerceptionExtraction,
|
|
29
|
+
} from './analysis/sentiment';
|
|
30
|
+
import type { SourceClassifierConfig } from './analysis/source-classifier';
|
|
31
|
+
import { deriveOutreachTargets } from './analysis/outreach';
|
|
32
|
+
import { buildSourceMix } from './analysis/source-mix';
|
|
33
|
+
import { competitorClassifierVersion } from './analysis/competitor-classifier';
|
|
34
|
+
import {
|
|
35
|
+
domainClassifierVersion,
|
|
36
|
+
learnDomainLabels,
|
|
37
|
+
type DomainLabelsFile,
|
|
38
|
+
type LearnDomainLabelsResult,
|
|
39
|
+
} from './analysis/domain-classifier';
|
|
40
|
+
import { plannedProbeUnitsForSection, type ProbeUnit } from './lib/checkpoint';
|
|
41
|
+
import { perceptionKey } from './lib/analysis-checkpoint';
|
|
42
|
+
import type { CheckPhaseResult } from './checks/run-checks';
|
|
43
|
+
import type { AnalysisStore } from './stores/ports';
|
|
44
|
+
import type { InternalModelContext } from './models/context';
|
|
45
|
+
import { internalModelRoleDigest } from './models/profiles';
|
|
46
|
+
|
|
47
|
+
const log = createLog('AeoRunner');
|
|
48
|
+
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// The deterministic half of a run: planning the probe units a request
|
|
51
|
+
// covers, and, once the Codex workflow has judged the answers, the source
|
|
52
|
+
// mix, the perception pass and the validated snapshot the report publishes
|
|
53
|
+
// (specs/aeo-codex-workflow-spec.md §5). No argv, no process.exit, no
|
|
54
|
+
// node:fs, no process.env in here.
|
|
55
|
+
// ============================================================================
|
|
56
|
+
|
|
57
|
+
/** A request the runner cannot act on (unknown section, plan over the cap). */
|
|
58
|
+
export class RunRequestError extends Error {
|
|
59
|
+
constructor(message: string) {
|
|
60
|
+
super(message);
|
|
61
|
+
this.name = 'RunRequestError';
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ---------------------------------------------------------------------------
|
|
66
|
+
// Plan
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
|
|
69
|
+
export type RunPlan = {
|
|
70
|
+
sections: AeoAuditConfig['sections'];
|
|
71
|
+
surfaces: readonly AeoSurface[];
|
|
72
|
+
chatSurfaces: AeoSurface[];
|
|
73
|
+
agentSurfaces: AeoAgentSurface[];
|
|
74
|
+
// Every probe unit the scope plans, across sections — the resume scope
|
|
75
|
+
// the probe store is matched against and the scoring denominator.
|
|
76
|
+
units: ProbeUnit[];
|
|
77
|
+
probesBySurface: Map<AeoSurface, number>;
|
|
78
|
+
promptCount: number;
|
|
79
|
+
agentPromptCount: number;
|
|
80
|
+
agentRunsPerPrompt: number;
|
|
81
|
+
chatProbes: number;
|
|
82
|
+
agentProbes: number;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const resolveSections = (
|
|
86
|
+
config: AeoAuditConfig,
|
|
87
|
+
filter: readonly string[] | undefined,
|
|
88
|
+
): AeoAuditConfig['sections'] => {
|
|
89
|
+
if (!filter) {
|
|
90
|
+
return config.sections;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const sections = config.sections.filter((s) => filter.includes(s.key));
|
|
94
|
+
|
|
95
|
+
if (sections.length === 0) {
|
|
96
|
+
throw new RunRequestError(
|
|
97
|
+
`No sections match ${filter.join(',')}. Available: ${config.sections
|
|
98
|
+
.map((s) => s.key)
|
|
99
|
+
.join(', ')}.`,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return sections;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The probe plan a run will execute, derived from the planned-units list —
|
|
108
|
+
* the same source the store is matched against — so plan display, cost
|
|
109
|
+
* estimate and resume scope can never disagree. A plan above the request's
|
|
110
|
+
* cost cap is refused before any probe is sent (§4.2).
|
|
111
|
+
*/
|
|
112
|
+
export const planRun = (
|
|
113
|
+
config: AeoAuditConfig,
|
|
114
|
+
request: RunRequest,
|
|
115
|
+
): RunPlan => {
|
|
116
|
+
const sections = resolveSections(config, request.sections);
|
|
117
|
+
// The request's surfaces are the operator's override (a narrowed
|
|
118
|
+
// re-probe); otherwise the config decides whether the coding agents are
|
|
119
|
+
// measured (specs/aeo-surface-selection-spec.md §3.2).
|
|
120
|
+
const surfaces: readonly AeoSurface[] =
|
|
121
|
+
request.surfaces ??
|
|
122
|
+
(config.surfaces.codingAgents === 'skip' ? chatSurfaces : allSurfaces);
|
|
123
|
+
|
|
124
|
+
const units = sections.flatMap((section) =>
|
|
125
|
+
plannedProbeUnitsForSection({
|
|
126
|
+
sectionKey: section.key,
|
|
127
|
+
prompts: section.prompts,
|
|
128
|
+
surfaces,
|
|
129
|
+
agentProbes: config.agentProbes,
|
|
130
|
+
}),
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
if (units.length > request.maxPlannedUnits) {
|
|
134
|
+
throw new RunRequestError(
|
|
135
|
+
`Plan of ${units.length} probe units exceeds the cap of ${request.maxPlannedUnits} (maxPlannedUnits); narrow the run or raise the cap deliberately.`,
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const probesBySurface = new Map<AeoSurface, number>();
|
|
140
|
+
const agentPromptKeys = new Set<string>();
|
|
141
|
+
let chatProbes = 0;
|
|
142
|
+
let agentProbes = 0;
|
|
143
|
+
|
|
144
|
+
for (const unit of units) {
|
|
145
|
+
probesBySurface.set(
|
|
146
|
+
unit.surface,
|
|
147
|
+
(probesBySurface.get(unit.surface) ?? 0) + 1,
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
if (isAgentSurface(unit.surface)) {
|
|
151
|
+
agentProbes += 1;
|
|
152
|
+
agentPromptKeys.add(`${unit.sectionKey}|${unit.promptId}`);
|
|
153
|
+
} else {
|
|
154
|
+
chatProbes += 1;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const promptCount = sections.reduce((sum, s) => sum + s.prompts.length, 0);
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
sections,
|
|
162
|
+
surfaces,
|
|
163
|
+
chatSurfaces: surfaces.filter((s) => !isAgentSurface(s)),
|
|
164
|
+
agentSurfaces: surfaces.filter(isAgentSurface),
|
|
165
|
+
units,
|
|
166
|
+
probesBySurface,
|
|
167
|
+
promptCount,
|
|
168
|
+
agentPromptCount: agentPromptKeys.size,
|
|
169
|
+
agentRunsPerPrompt: config.agentProbes.runsPerPrompt,
|
|
170
|
+
chatProbes,
|
|
171
|
+
agentProbes,
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
/** How much of a plan the probe bank already covered when the run began. */
|
|
176
|
+
export type PlanCoverage = {
|
|
177
|
+
count: number;
|
|
178
|
+
total: number;
|
|
179
|
+
oldestCapturedAt: string | null;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
// Enrich: learned domain labels, then the source mix and outreach
|
|
184
|
+
// targets derived with them. Failures are recorded, never blocking.
|
|
185
|
+
// ---------------------------------------------------------------------------
|
|
186
|
+
|
|
187
|
+
export type EnrichedReport = {
|
|
188
|
+
labels: LearnDomainLabelsResult;
|
|
189
|
+
sourceMix: NonNullable<AeoSnapshot['sourceMix']>;
|
|
190
|
+
outreachTargets: NonNullable<AeoSnapshot['outreachTargets']>;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/** Qualified competitor domains, then a model pass over remaining cited hosts,
|
|
194
|
+
* cached in the report's labels file. A failed batch degrades those hosts to
|
|
195
|
+
* earned and lands in partialFailures under `domain_labels:` — deliberately
|
|
196
|
+
* NOT a blocking prefix. */
|
|
197
|
+
export const enrichSourceMix = async (
|
|
198
|
+
config: AeoAuditConfig,
|
|
199
|
+
finishedSections: Array<{ key: string; visibility: AeoVisibility }>,
|
|
200
|
+
ctx: {
|
|
201
|
+
previousLabels: DomainLabelsFile | null;
|
|
202
|
+
logContext: Record<string, unknown>;
|
|
203
|
+
internalModels?: InternalModelContext;
|
|
204
|
+
signal?: AbortSignal;
|
|
205
|
+
},
|
|
206
|
+
): Promise<EnrichedReport> => {
|
|
207
|
+
const staticClassifierConfig: SourceClassifierConfig = {
|
|
208
|
+
brandDomain: config.brand.domain,
|
|
209
|
+
competitorDomains: config.competitors.map((c) => c.domain),
|
|
210
|
+
overrides: config.sourceOverrides,
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
log.info('Learning domain labels for the source mix', ctx.logContext);
|
|
214
|
+
const labels = await learnDomainLabels({
|
|
215
|
+
sections: finishedSections,
|
|
216
|
+
staticConfig: staticClassifierConfig,
|
|
217
|
+
context: {
|
|
218
|
+
brandName: config.brand.name,
|
|
219
|
+
brandDomain: config.brand.domain,
|
|
220
|
+
productBrief: config.productBrief,
|
|
221
|
+
promptTexts: finishedSections.flatMap((s) =>
|
|
222
|
+
s.visibility.prompts.map((p) => p.text),
|
|
223
|
+
),
|
|
224
|
+
},
|
|
225
|
+
previous: ctx.previousLabels,
|
|
226
|
+
logContext: ctx.logContext,
|
|
227
|
+
internalModels: ctx.internalModels,
|
|
228
|
+
signal: ctx.signal,
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
const classifierConfig: SourceClassifierConfig = {
|
|
232
|
+
...staticClassifierConfig,
|
|
233
|
+
learned: labels.learned,
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
return {
|
|
237
|
+
labels,
|
|
238
|
+
sourceMix: buildSourceMix(finishedSections, classifierConfig),
|
|
239
|
+
outreachTargets: deriveOutreachTargets(finishedSections, classifierConfig),
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
// ---------------------------------------------------------------------------
|
|
244
|
+
// Assemble: the validated snapshot from everything the phases
|
|
245
|
+
// produced. Pure: the same inputs give the same snapshot.
|
|
246
|
+
// ---------------------------------------------------------------------------
|
|
247
|
+
|
|
248
|
+
export const assembleSnapshot = (args: {
|
|
249
|
+
config: AeoAuditConfig;
|
|
250
|
+
request: RunRequest;
|
|
251
|
+
plan: RunPlan;
|
|
252
|
+
completedSections: Array<{ key: string; result: SectionRunResult }>;
|
|
253
|
+
enriched: EnrichedReport;
|
|
254
|
+
perception: AeoPerception | undefined;
|
|
255
|
+
checks: CheckPhaseResult['checks'] | undefined;
|
|
256
|
+
agentCliVersions: AgentCliVersions;
|
|
257
|
+
resumed: PlanCoverage;
|
|
258
|
+
promptCount: number;
|
|
259
|
+
probeCount: number;
|
|
260
|
+
partialFailures: PartialFailure[];
|
|
261
|
+
generatedAt: string;
|
|
262
|
+
/** What judged the answers: the Codex analyze stage's version and model. */
|
|
263
|
+
analyzer: { version: number; model: string };
|
|
264
|
+
}): AeoSnapshot => {
|
|
265
|
+
const { config, request, plan, enriched, resumed } = args;
|
|
266
|
+
|
|
267
|
+
return aeoSnapshotSchema.parse({
|
|
268
|
+
version: aeoSnapshotVersion,
|
|
269
|
+
reportKey: config.reportKey,
|
|
270
|
+
brand: config.brand,
|
|
271
|
+
competitors: config.competitors,
|
|
272
|
+
sections: args.completedSections.map(({ key, result }) => ({
|
|
273
|
+
key,
|
|
274
|
+
visibility: result.visibility,
|
|
275
|
+
})),
|
|
276
|
+
sourceMix: enriched.sourceMix,
|
|
277
|
+
...(args.perception ? { perception: args.perception } : {}),
|
|
278
|
+
technicalChecks: args.checks,
|
|
279
|
+
outreachTargets: enriched.outreachTargets,
|
|
280
|
+
meta: {
|
|
281
|
+
generatedAt: args.generatedAt,
|
|
282
|
+
promptCount: args.promptCount,
|
|
283
|
+
probeCount: args.probeCount,
|
|
284
|
+
// Honesty on resume: a snapshot mixing stored answers with fresh ones
|
|
285
|
+
// must say so — generatedAt alone would overstate freshness.
|
|
286
|
+
...(resumed.count > 0
|
|
287
|
+
? {
|
|
288
|
+
reusedProbes: {
|
|
289
|
+
count: resumed.count,
|
|
290
|
+
oldestCapturedAt: resumed.oldestCapturedAt,
|
|
291
|
+
},
|
|
292
|
+
}
|
|
293
|
+
: {}),
|
|
294
|
+
partialFailures: args.partialFailures,
|
|
295
|
+
surfaces: [...plan.surfaces],
|
|
296
|
+
agentClis: args.agentCliVersions,
|
|
297
|
+
analyzerVersion: args.analyzer.version,
|
|
298
|
+
domainClassifierVersion,
|
|
299
|
+
...(request.modelProfile?.roles.competitorClassifier
|
|
300
|
+
? { competitorClassifierVersion }
|
|
301
|
+
: {}),
|
|
302
|
+
runId: request.runId,
|
|
303
|
+
models: {
|
|
304
|
+
analyzer: args.analyzer.model,
|
|
305
|
+
perception:
|
|
306
|
+
request.modelProfile?.roles.perception.model ?? perceptionModel,
|
|
307
|
+
},
|
|
308
|
+
},
|
|
309
|
+
} satisfies AeoSnapshot);
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// ---------------------------------------------------------------------------
|
|
313
|
+
// Perception pass; a failed batch degrades to skipped
|
|
314
|
+
// answers, but every loss lands in partialFailures (never silent). Cached
|
|
315
|
+
// per section in the analysis store (correctness spec §3.7) so an unchanged
|
|
316
|
+
// answer set replays without the model.
|
|
317
|
+
// ---------------------------------------------------------------------------
|
|
318
|
+
|
|
319
|
+
/** One section's perception pass, cached per exact answer set. A targeted
|
|
320
|
+
* repair bypasses the cached extraction and replaces it on success. */
|
|
321
|
+
const runSectionPerception = async (
|
|
322
|
+
{
|
|
323
|
+
key,
|
|
324
|
+
result,
|
|
325
|
+
}: {
|
|
326
|
+
key: string;
|
|
327
|
+
result: Pick<SectionRunResult, 'visibility' | 'brandMentionAnswers'>;
|
|
328
|
+
},
|
|
329
|
+
ctx: {
|
|
330
|
+
config: AeoAuditConfig;
|
|
331
|
+
analysisStore: AnalysisStore | null;
|
|
332
|
+
runId: string;
|
|
333
|
+
limiter?: ProbeLimiter;
|
|
334
|
+
signal?: AbortSignal;
|
|
335
|
+
internalModels?: InternalModelContext;
|
|
336
|
+
bypassCache?: boolean;
|
|
337
|
+
},
|
|
338
|
+
) => {
|
|
339
|
+
const { config, internalModels, runId } = ctx;
|
|
340
|
+
const cacheKey = perceptionKey({
|
|
341
|
+
sectionKey: key,
|
|
342
|
+
identity: { brand: config.brand, competitors: config.competitors },
|
|
343
|
+
productBrief: config.productBrief,
|
|
344
|
+
answers: result.brandMentionAnswers.map((a) => ({
|
|
345
|
+
surface: a.surface,
|
|
346
|
+
runIndex: a.runIndex,
|
|
347
|
+
promptIdx: a.promptIdx,
|
|
348
|
+
text: a.responseText,
|
|
349
|
+
})),
|
|
350
|
+
perceptionVersion: internalModels
|
|
351
|
+
? perceptionVersion
|
|
352
|
+
: legacyPerceptionVersion,
|
|
353
|
+
modelProfileDigest: internalModels
|
|
354
|
+
? internalModelRoleDigest(internalModels.profile.roles.perception)
|
|
355
|
+
: undefined,
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
const cached = ctx.bypassCache
|
|
359
|
+
? null
|
|
360
|
+
: ((await ctx.analysisStore?.get(cacheKey, perceptionExtractionSchema)) ??
|
|
361
|
+
null);
|
|
362
|
+
|
|
363
|
+
const extract = () => {
|
|
364
|
+
return extractPerceptionForSection({
|
|
365
|
+
sectionKey: key,
|
|
366
|
+
brandName: config.brand.name,
|
|
367
|
+
productBrief: config.productBrief,
|
|
368
|
+
visibility: result.visibility,
|
|
369
|
+
answers: result.brandMentionAnswers,
|
|
370
|
+
cachedExtraction: cached,
|
|
371
|
+
logContext: { reportKey: config.reportKey, runId },
|
|
372
|
+
signal: ctx.signal,
|
|
373
|
+
internalModels,
|
|
374
|
+
});
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
const extracted = ctx.limiter
|
|
378
|
+
? await ctx.limiter.run('analyzer', extract)
|
|
379
|
+
: await extract();
|
|
380
|
+
|
|
381
|
+
if (!cached && extracted.failures.length === 0) {
|
|
382
|
+
await ctx.analysisStore?.put(
|
|
383
|
+
cacheKey,
|
|
384
|
+
{
|
|
385
|
+
narratives: extracted.section.narratives,
|
|
386
|
+
flaggedClaims: extracted.section.flaggedClaims,
|
|
387
|
+
} satisfies PerceptionExtraction,
|
|
388
|
+
{
|
|
389
|
+
runId,
|
|
390
|
+
version: internalModels ? perceptionVersion : legacyPerceptionVersion,
|
|
391
|
+
modelId:
|
|
392
|
+
internalModels?.profile.roles.perception.model ?? perceptionModel,
|
|
393
|
+
},
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
return extracted;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export type PerceptionPassOptions = {
|
|
401
|
+
analysisStore: AnalysisStore;
|
|
402
|
+
runId: string;
|
|
403
|
+
limiter: ProbeLimiter;
|
|
404
|
+
signal?: AbortSignal;
|
|
405
|
+
internalModels?: InternalModelContext;
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
export const runPerceptionPass = async (
|
|
409
|
+
config: AeoAuditConfig,
|
|
410
|
+
completedSections: Array<{ key: string; result: SectionRunResult }>,
|
|
411
|
+
{
|
|
412
|
+
analysisStore,
|
|
413
|
+
runId,
|
|
414
|
+
limiter,
|
|
415
|
+
signal,
|
|
416
|
+
internalModels,
|
|
417
|
+
}: PerceptionPassOptions,
|
|
418
|
+
): Promise<{
|
|
419
|
+
perception: AeoPerception | undefined;
|
|
420
|
+
failures: PartialFailure[];
|
|
421
|
+
}> => {
|
|
422
|
+
const failures: PartialFailure[] = [];
|
|
423
|
+
|
|
424
|
+
try {
|
|
425
|
+
const perceptionResults = await Promise.all(
|
|
426
|
+
completedSections.map((section) =>
|
|
427
|
+
runSectionPerception(section, {
|
|
428
|
+
config,
|
|
429
|
+
analysisStore,
|
|
430
|
+
runId,
|
|
431
|
+
limiter,
|
|
432
|
+
signal,
|
|
433
|
+
internalModels,
|
|
434
|
+
}),
|
|
435
|
+
),
|
|
436
|
+
);
|
|
437
|
+
|
|
438
|
+
// A validation failure blocks like an analysis failure; a transport
|
|
439
|
+
// failure after retries records under the non-blocking `perception:`
|
|
440
|
+
// prefix (§2.6).
|
|
441
|
+
for (const { section, failures: sectionFailures } of perceptionResults) {
|
|
442
|
+
for (const failure of sectionFailures) {
|
|
443
|
+
failures.push({
|
|
444
|
+
step: failure.blocking
|
|
445
|
+
? `analysis:perception:${section.key}`
|
|
446
|
+
: `perception:${section.key}`,
|
|
447
|
+
error: failure.message,
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
return {
|
|
453
|
+
perception: { sections: perceptionResults.map((r) => r.section) },
|
|
454
|
+
failures,
|
|
455
|
+
};
|
|
456
|
+
} catch (error) {
|
|
457
|
+
failures.push({ step: 'analysis:perception', error: String(error) });
|
|
458
|
+
|
|
459
|
+
return { perception: undefined, failures };
|
|
460
|
+
}
|
|
461
|
+
};
|
package/src/schema.ts
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { questionSetNameSchema } from './report/core/progress-schema';
|
|
3
|
+
import {
|
|
4
|
+
brandSchema,
|
|
5
|
+
aeoPromptSchema,
|
|
6
|
+
aeoSurfaceSchema,
|
|
7
|
+
sourceCategorySchema,
|
|
8
|
+
} from './report/core/schema';
|
|
9
|
+
import { coverageThresholdsSchema } from './coverage-schema';
|
|
10
|
+
import { groundingBundleSchema } from './grounding/schema';
|
|
11
|
+
import { internalModelProfileSchema } from './models/profiles';
|
|
12
|
+
import { modelBudgetLimitsSchema } from './models/accounting';
|
|
13
|
+
import { probeLimitsSchema } from './probes/limits';
|
|
14
|
+
|
|
15
|
+
export * from './report/core/schema';
|
|
16
|
+
|
|
17
|
+
export const aeoSectionConfigSchema = z.object({
|
|
18
|
+
// Free string — section keys are per-client, no shared enum to extend.
|
|
19
|
+
key: z.string().min(1),
|
|
20
|
+
prompts: z.array(aeoPromptSchema).min(1),
|
|
21
|
+
// Per-section override for reports whose sections measure different
|
|
22
|
+
// markets. Omitted → the report-level set (the union shown on the page).
|
|
23
|
+
competitors: z.array(brandSchema).optional(),
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Agent probe volume (spec §5, revised 2026-08-21): defaults are the
|
|
27
|
+
// canonical 2 runs per prompt over every prompt; reports may shrink the
|
|
28
|
+
// agent batch. Changing either value after the first committed run is an
|
|
29
|
+
// agent-baseline reset — call it out in the methodology note.
|
|
30
|
+
export const agentProbeConfigSchema = z.object({
|
|
31
|
+
// Runs per prompt per agent surface.
|
|
32
|
+
runsPerPrompt: z.number().int().min(1).max(2).default(2),
|
|
33
|
+
// Cap on how many of each section's prompts get agent probes — the FIRST N
|
|
34
|
+
// prompts in config order, so the subset is stable across runs. Omitted =
|
|
35
|
+
// all prompts.
|
|
36
|
+
maxPromptsPerSection: z.number().int().min(1).optional(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export type AgentProbeConfig = z.infer<typeof agentProbeConfigSchema>;
|
|
40
|
+
|
|
41
|
+
const ownedCompetitorDomainSchema = z
|
|
42
|
+
.string()
|
|
43
|
+
.trim()
|
|
44
|
+
.regex(
|
|
45
|
+
/^(?=.{1,253}$)(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.?$/,
|
|
46
|
+
'Expected a domain name without a URL, path or port',
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
export const aeoAuditConfigSchema = z.object({
|
|
50
|
+
reportKey: z.string().min(1),
|
|
51
|
+
// Labels the console Dashboard's question-set selector until it adopts
|
|
52
|
+
// @literally/aeo-report 0.5.0; the website no longer shows it.
|
|
53
|
+
questionSetName: questionSetNameSchema.optional(),
|
|
54
|
+
slug: z.string().min(1),
|
|
55
|
+
brand: brandSchema,
|
|
56
|
+
competitors: z.array(brandSchema).min(1),
|
|
57
|
+
// Additional domains owned by the audited company, excluded only from
|
|
58
|
+
// competitor qualification. This does not broaden mention/citation scoring.
|
|
59
|
+
competitorQualification: z
|
|
60
|
+
.object({
|
|
61
|
+
ownedDomains: z.array(ownedCompetitorDomainSchema).min(1).max(20),
|
|
62
|
+
})
|
|
63
|
+
.strict()
|
|
64
|
+
.optional(),
|
|
65
|
+
sections: z.array(aeoSectionConfigSchema).min(1),
|
|
66
|
+
// Defaults to the canonical volume (2 runs per prompt, all prompts) via
|
|
67
|
+
// the schema — consumers read config.agentProbes directly, no fallbacks.
|
|
68
|
+
// prefault({}) runs {} through the inner schema so its own defaults fill.
|
|
69
|
+
agentProbes: agentProbeConfigSchema.prefault({}),
|
|
70
|
+
// Renderability targets — docs, pricing, comparison pages (§7.4).
|
|
71
|
+
moneyPages: z.array(z.string().url()),
|
|
72
|
+
// Grounds accuracy flagging (§7.2): claims contradicting this brief are
|
|
73
|
+
// flagged for human verification.
|
|
74
|
+
productBrief: z.string().min(1),
|
|
75
|
+
// Whether the coding agents are measured (specs/aeo-surface-selection-spec
|
|
76
|
+
// §3.1): the author decides from who the buyers are, with the reason the
|
|
77
|
+
// config gate shows. The default keeps every stored config measuring all
|
|
78
|
+
// eight surfaces.
|
|
79
|
+
surfaces: z
|
|
80
|
+
.object({
|
|
81
|
+
codingAgents: z.enum(['measure', 'skip']),
|
|
82
|
+
because: z.string().trim().min(12).max(300),
|
|
83
|
+
})
|
|
84
|
+
.strict()
|
|
85
|
+
.prefault({
|
|
86
|
+
codingAgents: 'measure',
|
|
87
|
+
because:
|
|
88
|
+
'Default: every surface is measured until the author decides otherwise.',
|
|
89
|
+
}),
|
|
90
|
+
productGrounding: groundingBundleSchema.optional(),
|
|
91
|
+
// Per-report domain classification overrides for §7.1.
|
|
92
|
+
sourceOverrides: z.record(z.string(), sourceCategorySchema).optional(),
|
|
93
|
+
// Config-declared facts checked by a human, not crawled (§7.4).
|
|
94
|
+
agentReadiness: z
|
|
95
|
+
.object({ mcpServer: z.boolean(), llmDocs: z.boolean() })
|
|
96
|
+
.optional(),
|
|
97
|
+
// Google AI Overview locale; defaults ported from the console.
|
|
98
|
+
geography: z.string().default('us'),
|
|
99
|
+
language: z.string().default('en'),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export type AeoAuditConfig = z.infer<typeof aeoAuditConfigSchema>;
|
|
103
|
+
export type AeoAuditConfigInput = z.input<typeof aeoAuditConfigSchema>;
|
|
104
|
+
export type AeoSectionConfig = z.infer<typeof aeoSectionConfigSchema>;
|
|
105
|
+
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
// Section visibility (v2 superset of the console's aiSearchVisibilitySchema)
|
|
108
|
+
// ---------------------------------------------------------------------------
|
|
109
|
+
// Raw answer text is deliberately NOT part of the snapshot: full responseText
|
|
110
|
+
// lives in evidence chunk files referenced by `evidenceFile` (§6), keeping
|
|
111
|
+
// the page payload static-site-friendly.
|
|
112
|
+
|
|
113
|
+
export const checkpointMatchSchema = z.object({
|
|
114
|
+
sectionKey: z.string().min(1).optional(),
|
|
115
|
+
surface: aeoSurfaceSchema.optional(),
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Coverage gate (§4.1): per surface, captured / planned below the threshold
|
|
119
|
+
// blocks the write unless `allowPartial`. Defaults per §9.3: any surface at
|
|
120
|
+
// zero blocks, and any surface below half its plan blocks.
|
|
121
|
+
export { coverageThresholdsSchema } from './coverage-schema';
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
pipelineRequestSchema,
|
|
125
|
+
pipelineCallbackSchema,
|
|
126
|
+
} from './workflow/schema';
|
|
127
|
+
|
|
128
|
+
export type {
|
|
129
|
+
PipelineRequest,
|
|
130
|
+
PipelineCallback,
|
|
131
|
+
ResolvedGates,
|
|
132
|
+
} from './workflow/schema';
|
|
133
|
+
|
|
134
|
+
export type CoverageThresholds = z.infer<typeof coverageThresholdsSchema>;
|
|
135
|
+
|
|
136
|
+
// Cost cap default (§9.8): above the largest registered baseline (Literally,
|
|
137
|
+
// 285 units) with headroom for a two-section config; a plan above it fails
|
|
138
|
+
// before any probe is sent.
|
|
139
|
+
export const defaultMaxPlannedUnits = 400;
|
|
140
|
+
|
|
141
|
+
export const runRequestSchema = z.object({
|
|
142
|
+
modelProfile: internalModelProfileSchema.optional(),
|
|
143
|
+
modelBudget: modelBudgetLimitsSchema.optional(),
|
|
144
|
+
derivedFromRunId: z.string().min(1).optional(),
|
|
145
|
+
configVersion: z.number().int().positive().optional(),
|
|
146
|
+
batchJobId: z.string().min(1).optional(),
|
|
147
|
+
batchAttempt: z.number().int().positive().optional(),
|
|
148
|
+
reportKey: z.string().min(1),
|
|
149
|
+
runId: z.string().min(1),
|
|
150
|
+
// Section keys to run; omitted = every section of the config.
|
|
151
|
+
sections: z.array(z.string().min(1)).min(1).optional(),
|
|
152
|
+
// Surfaces in scope; omitted = every surface.
|
|
153
|
+
surfaces: z.array(aeoSurfaceSchema).min(1).optional(),
|
|
154
|
+
// `resume` reuses stored captures and analyses; `fresh` clears both first
|
|
155
|
+
// (a new baseline or a quarterly re-measurement).
|
|
156
|
+
mode: z.enum(['resume', 'fresh']).default('resume'),
|
|
157
|
+
// Stored captures to drop before probing, so only they re-execute.
|
|
158
|
+
redo: z.array(checkpointMatchSchema).optional(),
|
|
159
|
+
// Writes the snapshot despite blocking partial failures (analysis
|
|
160
|
+
// failures, coverage shortfalls); the report says what is missing.
|
|
161
|
+
allowPartial: z.boolean().default(false),
|
|
162
|
+
// How far grounding goes. `full` extracts, researches and adjudicates the
|
|
163
|
+
// claims assistants made about the product; `extraction_only` keeps the
|
|
164
|
+
// claim inventory (observed-claim facts and the reviewers' evidence need
|
|
165
|
+
// it) and skips research and adjudication, so the copy has no product
|
|
166
|
+
// facts to state and states none. A report about measured visibility does
|
|
167
|
+
// not pay minutes and a research budget for a fact check it will not use.
|
|
168
|
+
grounding: z.enum(['full', 'extraction_only']).default('full'),
|
|
169
|
+
coverageThresholds: coverageThresholdsSchema.prefault({}),
|
|
170
|
+
maxPlannedUnits: z.number().int().positive().default(defaultMaxPlannedUnits),
|
|
171
|
+
// Per-provider pool sizes (§4.5).
|
|
172
|
+
limits: probeLimitsSchema.prefault({}),
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export type RunRequest = z.infer<typeof runRequestSchema>;
|
|
176
|
+
export type RunRequestInput = z.input<typeof runRequestSchema>;
|
|
177
|
+
|
|
178
|
+
export const partialFailureSchema = z.object({
|
|
179
|
+
step: z.string(),
|
|
180
|
+
error: z.string(),
|
|
181
|
+
});
|