literally-aeo 0.0.0-stage → 0.1.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/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-2KJZ326K.js +253 -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-2ROSV4HD.js +64 -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-3EBWDHPK.js +133 -0
- package/dist/lib/chunks/chunk-3UFZ2XPE.js +73 -0
- package/dist/lib/chunks/chunk-4E4NDGOZ.js +47 -0
- package/dist/lib/chunks/chunk-4QQJXCD2.js +113 -0
- package/dist/lib/chunks/chunk-4US3OBKJ.js +136 -0
- package/dist/lib/chunks/chunk-4ZY6P5SO.js +303 -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-5EX5DKMA.js +812 -0
- package/dist/lib/chunks/chunk-5GZVDGTX.js +316 -0
- package/dist/lib/chunks/chunk-5H3SNUQT.js +101 -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-6KO7HGCQ.js +229 -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-AKKFERA4.js +99 -0
- package/dist/lib/chunks/chunk-AP5DLF36.js +150 -0
- package/dist/lib/chunks/chunk-AUB5THIS.js +341 -0
- package/dist/lib/chunks/chunk-AWOJWMPN.js +213 -0
- package/dist/lib/chunks/chunk-B5L2KMTU.js +108 -0
- package/dist/lib/chunks/chunk-BEQLSAVX.js +202 -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-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-CS24IL3K.js +115 -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-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-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-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-H3G3VTT7.js +259 -0
- package/dist/lib/chunks/chunk-H56DDRKE.js +85 -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-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-J6IJGYP5.js +147 -0
- package/dist/lib/chunks/chunk-JQ3P552S.js +0 -0
- package/dist/lib/chunks/chunk-JS3GBU3R.js +46 -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-M2OD74GP.js +93 -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-N2ZZ6JRF.js +188 -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-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-OL746E4T.js +350 -0
- package/dist/lib/chunks/chunk-OORO55OM.js +922 -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-P4K6BP3L.js +104 -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-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-RBOO4NDG.js +33 -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-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-WTQWU522.js +343 -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-XU6WQ5UL.js +257 -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-YOZNLFSB.js +297 -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-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-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
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
export type ReportCopyPresentation = 'generated' | 'authored';
|
|
2
|
+
|
|
3
|
+
export const reportCopyPresentation = (
|
|
4
|
+
provenanceKind: unknown,
|
|
5
|
+
): ReportCopyPresentation => {
|
|
6
|
+
return provenanceKind === 'agent' ? 'generated' : 'authored';
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** Names and acronyms a section key or a generated title carries in lower
|
|
10
|
+
* case ("typescript app hosting", "wysiwyg editors"), keyed by their
|
|
11
|
+
* lower-case form. Only forms that are never an ordinary word belong here:
|
|
12
|
+
* "it" and "as" stay out. */
|
|
13
|
+
const knownNameForms: Record<string, string> = {
|
|
14
|
+
'aeo': 'AEO',
|
|
15
|
+
'ai': 'AI',
|
|
16
|
+
'api': 'API',
|
|
17
|
+
'apis': 'APIs',
|
|
18
|
+
'b2b': 'B2B',
|
|
19
|
+
'b2c': 'B2C',
|
|
20
|
+
'cd': 'CD',
|
|
21
|
+
'ci': 'CI',
|
|
22
|
+
'cli': 'CLI',
|
|
23
|
+
'cms': 'CMS',
|
|
24
|
+
'crm': 'CRM',
|
|
25
|
+
'devops': 'DevOps',
|
|
26
|
+
'erp': 'ERP',
|
|
27
|
+
'gdpr': 'GDPR',
|
|
28
|
+
'github': 'GitHub',
|
|
29
|
+
'gitlab': 'GitLab',
|
|
30
|
+
'graphql': 'GraphQL',
|
|
31
|
+
'hr': 'HR',
|
|
32
|
+
'iaas': 'IaaS',
|
|
33
|
+
'ios': 'iOS',
|
|
34
|
+
'javascript': 'JavaScript',
|
|
35
|
+
'llm': 'LLM',
|
|
36
|
+
'llms': 'LLMs',
|
|
37
|
+
'macos': 'macOS',
|
|
38
|
+
'ml': 'ML',
|
|
39
|
+
'mlops': 'MLOps',
|
|
40
|
+
'mysql': 'MySQL',
|
|
41
|
+
'node.js': 'Node.js',
|
|
42
|
+
'nodejs': 'Node.js',
|
|
43
|
+
'paas': 'PaaS',
|
|
44
|
+
'postgresql': 'PostgreSQL',
|
|
45
|
+
'pr': 'PR',
|
|
46
|
+
'saas': 'SaaS',
|
|
47
|
+
'sdk': 'SDK',
|
|
48
|
+
'sdks': 'SDKs',
|
|
49
|
+
'seo': 'SEO',
|
|
50
|
+
'typescript': 'TypeScript',
|
|
51
|
+
'ui': 'UI',
|
|
52
|
+
'ux': 'UX',
|
|
53
|
+
'vpn': 'VPN',
|
|
54
|
+
'wordpress': 'WordPress',
|
|
55
|
+
'wysiwyg': 'WYSIWYG',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Sentence case without lowercasing product names or existing acronyms;
|
|
59
|
+
* a known name or acronym takes its proper form wherever it stands. The
|
|
60
|
+
* first word is whatever leads the title, a number included, so a title
|
|
61
|
+
* like "2 factor auth" does not capitalize its second word. */
|
|
62
|
+
export const reportSectionTitle = (title: string): string => {
|
|
63
|
+
let first = true;
|
|
64
|
+
|
|
65
|
+
const sectionTitle = title.replace(/[\p{L}\p{N}][\p{L}\p{N}.]*/gu, (word) => {
|
|
66
|
+
// A period inside a word is part of a name ("node.js"); one ending the
|
|
67
|
+
// word is punctuation and stays outside the lookup ("hosting api.").
|
|
68
|
+
const trailing = /\.+$/.exec(word)?.[0] ?? '';
|
|
69
|
+
const lookupKey = word
|
|
70
|
+
.slice(0, word.length - trailing.length)
|
|
71
|
+
.toLowerCase();
|
|
72
|
+
// An own-property check keeps inherited members ("constructor",
|
|
73
|
+
// "tostring") from matching the table.
|
|
74
|
+
const known = Object.hasOwn(knownNameForms, lookupKey)
|
|
75
|
+
? knownNameForms[lookupKey]
|
|
76
|
+
: undefined;
|
|
77
|
+
const isFirst = first;
|
|
78
|
+
|
|
79
|
+
first = false;
|
|
80
|
+
|
|
81
|
+
if (known !== undefined) {
|
|
82
|
+
return `${known}${trailing}`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return isFirst ? `${word.charAt(0).toUpperCase()}${word.slice(1)}` : word;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
return sectionTitle;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/** The stored audit timestamp determines the date in every reader timezone. */
|
|
92
|
+
export const formatReportDate = (iso: string): string => {
|
|
93
|
+
const date = new Date(iso);
|
|
94
|
+
|
|
95
|
+
if (Number.isNaN(date.getTime())) {
|
|
96
|
+
return iso;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return date.toLocaleDateString('en-GB', {
|
|
100
|
+
year: 'numeric',
|
|
101
|
+
month: 'long',
|
|
102
|
+
day: 'numeric',
|
|
103
|
+
timeZone: 'UTC',
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const reportPreparedBy = (
|
|
108
|
+
brandName: string,
|
|
109
|
+
generatedAt: string,
|
|
110
|
+
): string => {
|
|
111
|
+
return `Prepared by Literally.dev for ${brandName}, ${formatReportDate(generatedAt)}`;
|
|
112
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { AeoSurface } from './surfaces';
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// Retrieval-log constants (retrieval-log spec §1, §2) — deliberately zod-free
|
|
5
|
+
// like surfaces.ts: the report page's client island imports from here,
|
|
6
|
+
// and schema.ts builds its enums from these.
|
|
7
|
+
// ============================================================================
|
|
8
|
+
|
|
9
|
+
// One web search or web fetch a surface executed while answering a probe.
|
|
10
|
+
// `search` carries a query; the URL-driven kinds carry the target URL.
|
|
11
|
+
export const retrievalCallKinds = [
|
|
12
|
+
'search',
|
|
13
|
+
'fetch',
|
|
14
|
+
'open_page',
|
|
15
|
+
'find_in_page',
|
|
16
|
+
] as const;
|
|
17
|
+
|
|
18
|
+
export type RetrievalCallKind = (typeof retrievalCallKinds)[number];
|
|
19
|
+
|
|
20
|
+
// What a surface's stream structurally reveals about its retrieval:
|
|
21
|
+
// full queries and result sets
|
|
22
|
+
// queries_only queries, no result sets (Codex)
|
|
23
|
+
// partial queries as a flat list, sources not linked to them (Gemini)
|
|
24
|
+
// none nothing (Perplexity, Google AI Overview)
|
|
25
|
+
export const retrievalExposures = [
|
|
26
|
+
'full',
|
|
27
|
+
'queries_only',
|
|
28
|
+
'partial',
|
|
29
|
+
'none',
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
32
|
+
export type RetrievalExposure = (typeof retrievalExposures)[number];
|
|
33
|
+
|
|
34
|
+
// Verified per surface on 2026-09-03 against the checked-in stream fixtures
|
|
35
|
+
// and the installed SDK types (spec §2). `none` is reserved for surfaces
|
|
36
|
+
// that structurally expose nothing — a parse miss on any other surface is
|
|
37
|
+
// stored as "not captured", never as `none`.
|
|
38
|
+
export const surfaceRetrievalExposure: Readonly<
|
|
39
|
+
Record<AeoSurface, RetrievalExposure>
|
|
40
|
+
> = {
|
|
41
|
+
chatgpt: 'full',
|
|
42
|
+
gemini: 'partial',
|
|
43
|
+
claude: 'full',
|
|
44
|
+
perplexity: 'none',
|
|
45
|
+
google_ai_overview: 'none',
|
|
46
|
+
claude_code: 'full',
|
|
47
|
+
codex: 'queries_only',
|
|
48
|
+
cursor: 'full',
|
|
49
|
+
};
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { retrievalCallKinds, retrievalExposures } from './retrieval';
|
|
3
|
+
import { allSurfaces } from './surfaces';
|
|
4
|
+
|
|
5
|
+
export const aeoSnapshotVersion = 2;
|
|
6
|
+
|
|
7
|
+
/** Ceiling on additive scrutiny rounds; the workflow loop and the stored
|
|
8
|
+
* `meta.quality.reviewRounds` share it. */
|
|
9
|
+
export const maxReviewRounds = 5;
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Surfaces
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Constants and helpers live in the zod-free surfaces.ts (the client
|
|
15
|
+
// island imports them from there without dragging zod into the bundle);
|
|
16
|
+
// re-exported here so schema consumers see one module.
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
agentSurfaces,
|
|
20
|
+
allSurfaces,
|
|
21
|
+
chatSurfaces,
|
|
22
|
+
surfaceRunCounts,
|
|
23
|
+
isAgentSurface,
|
|
24
|
+
plannedRunsPerPrompt,
|
|
25
|
+
} from './surfaces';
|
|
26
|
+
export type { AeoAgentSurface, AeoChatSurface, AeoSurface } from './surfaces';
|
|
27
|
+
|
|
28
|
+
export const aeoSurfaceSchema = z.enum(allSurfaces);
|
|
29
|
+
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
// Retrieval log (retrieval-log spec §4) — the searches and fetches behind one
|
|
32
|
+
// answer, one shape for every surface so the page never branches on surface
|
|
33
|
+
// names. Constants live in the zod-free retrieval.ts (client-safe).
|
|
34
|
+
// ---------------------------------------------------------------------------
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
retrievalCallKinds,
|
|
38
|
+
retrievalExposures,
|
|
39
|
+
surfaceRetrievalExposure,
|
|
40
|
+
} from './retrieval';
|
|
41
|
+
export type { RetrievalCallKind, RetrievalExposure } from './retrieval';
|
|
42
|
+
|
|
43
|
+
export const retrievalCallSchema = z.object({
|
|
44
|
+
kind: z.enum(retrievalCallKinds),
|
|
45
|
+
// Search term for `search`; null for the URL-driven kinds.
|
|
46
|
+
query: z.string().nullable(),
|
|
47
|
+
// Target for fetch / open_page / find_in_page; null for `search`.
|
|
48
|
+
url: z.string().nullable(),
|
|
49
|
+
// URLs the call returned to the model. Null when the surface does not
|
|
50
|
+
// expose results for this call (Codex, Gemini queries) or the result
|
|
51
|
+
// never arrived / could not be parsed.
|
|
52
|
+
resultUrls: z.array(z.string()).nullable(),
|
|
53
|
+
// False when resultUrls is a cited subset rather than the full result
|
|
54
|
+
// list (ChatGPT). Irrelevant when resultUrls is null.
|
|
55
|
+
resultsComplete: z.boolean(),
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export type RetrievalCall = z.infer<typeof retrievalCallSchema>;
|
|
59
|
+
|
|
60
|
+
export const retrievalLogSchema = z.object({
|
|
61
|
+
exposure: z.enum(retrievalExposures),
|
|
62
|
+
// In stream order. Empty is legal: the surface exposes retrieval and the
|
|
63
|
+
// answer made no calls (an honest from-memory answer).
|
|
64
|
+
calls: z.array(retrievalCallSchema),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export type RetrievalLog = z.infer<typeof retrievalLogSchema>;
|
|
68
|
+
|
|
69
|
+
// Compact per-call summary on the matrix row (§4): the presence flags the
|
|
70
|
+
// aggregate views read, never the result URLs themselves (those stay in the
|
|
71
|
+
// evidence chunk).
|
|
72
|
+
export const retrievalCallSummarySchema = z.object({
|
|
73
|
+
kind: z.enum(retrievalCallKinds),
|
|
74
|
+
query: z.string().nullable(), // search only
|
|
75
|
+
url: z.string().nullable(), // fetch / open_page / find_in_page
|
|
76
|
+
// search: the brand's domain is in the result set (null when the surface
|
|
77
|
+
// exposes no result set, or when an incomplete result set cannot prove
|
|
78
|
+
// absence). Other kinds: the opened URL is on the brand's domain.
|
|
79
|
+
brandFound: z.boolean().nullable(),
|
|
80
|
+
// Same rule per competitor; normalized domains.
|
|
81
|
+
competitorsFound: z.array(z.string()),
|
|
82
|
+
// search only; null when results are not exposed.
|
|
83
|
+
resultCount: z.number().nullable(),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export type RetrievalCallSummary = z.infer<typeof retrievalCallSummarySchema>;
|
|
87
|
+
|
|
88
|
+
// One entry per cited URL on a run; `callIndices` (into the run's retrieval
|
|
89
|
+
// log) empty when the citation is unattributed.
|
|
90
|
+
export const citationAttributionSchema = z.array(
|
|
91
|
+
z.object({ url: z.string(), callIndices: z.array(z.number().int()) }),
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
export type CitationAttribution = z.infer<typeof citationAttributionSchema>;
|
|
95
|
+
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
// Prompts
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
// No `brand_awareness` category on purpose — those prompts pre-bias mention
|
|
100
|
+
// rates (console prospect-audit rule, carried over).
|
|
101
|
+
|
|
102
|
+
export const aeoPromptCategorySchema = z.enum([
|
|
103
|
+
'product_recommendation',
|
|
104
|
+
'industry_expert',
|
|
105
|
+
'comparison',
|
|
106
|
+
'problem_solving',
|
|
107
|
+
'general_knowledge',
|
|
108
|
+
]);
|
|
109
|
+
|
|
110
|
+
export type AeoPromptCategory = z.infer<typeof aeoPromptCategorySchema>;
|
|
111
|
+
|
|
112
|
+
export const aeoPromptSchema = z.object({
|
|
113
|
+
id: z.string().min(1),
|
|
114
|
+
text: z.string().min(1),
|
|
115
|
+
category: aeoPromptCategorySchema,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export type AeoPrompt = z.infer<typeof aeoPromptSchema>;
|
|
119
|
+
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
// Citation source classification (§7.1)
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
|
|
124
|
+
export const sourceCategories = [
|
|
125
|
+
'owned',
|
|
126
|
+
'competitor',
|
|
127
|
+
'social',
|
|
128
|
+
'institutional',
|
|
129
|
+
'earned',
|
|
130
|
+
] as const;
|
|
131
|
+
|
|
132
|
+
export const sourceCategorySchema = z.enum(sourceCategories);
|
|
133
|
+
export type SourceCategory = z.infer<typeof sourceCategorySchema>;
|
|
134
|
+
|
|
135
|
+
const sourceMixCountsSchema = z.object({
|
|
136
|
+
owned: z.number(),
|
|
137
|
+
competitor: z.number(),
|
|
138
|
+
social: z.number(),
|
|
139
|
+
institutional: z.number(),
|
|
140
|
+
earned: z.number(),
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
export type SourceMixCounts = z.infer<typeof sourceMixCountsSchema>;
|
|
144
|
+
|
|
145
|
+
// ---------------------------------------------------------------------------
|
|
146
|
+
|
|
147
|
+
export const brandSchema = z.object({
|
|
148
|
+
name: z.string(),
|
|
149
|
+
domain: z.string(),
|
|
150
|
+
aliases: z.array(z.string()).default([]),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
export type AeoBrand = z.infer<typeof brandSchema>;
|
|
154
|
+
|
|
155
|
+
export const aeoMatrixRowSchema = z.object({
|
|
156
|
+
promptIdx: z.number(),
|
|
157
|
+
surface: aeoSurfaceSchema,
|
|
158
|
+
prospectMentioned: z.boolean(),
|
|
159
|
+
prospectPosition: z
|
|
160
|
+
.enum(['primary', 'secondary', 'listed', 'absent'])
|
|
161
|
+
.nullable(),
|
|
162
|
+
contextSnippet: z.string().nullable(),
|
|
163
|
+
runIndex: z.number().optional(),
|
|
164
|
+
citedUrls: z.array(z.string().url()).optional(),
|
|
165
|
+
mentionedBrands: z
|
|
166
|
+
.array(z.object({ name: z.string(), domain: z.string().nullable() }))
|
|
167
|
+
.optional(),
|
|
168
|
+
// Section-aware buyer alternatives, qualified from saved answer context.
|
|
169
|
+
// Absent = historical data; an empty array means none qualified. The raw
|
|
170
|
+
// mentionedBrands inventory remains intact for inspecting the actual answer.
|
|
171
|
+
qualifiedCompetitors: z
|
|
172
|
+
.array(z.object({ name: z.string(), domain: z.string().nullable() }))
|
|
173
|
+
.optional(),
|
|
174
|
+
competitors: z.array(
|
|
175
|
+
z.object({ domain: z.string(), mentioned: z.boolean() }),
|
|
176
|
+
),
|
|
177
|
+
// Per-mention sentiment — the analyzer always extracted it; v2 persists it.
|
|
178
|
+
sentiment: z.enum(['positive', 'neutral', 'negative']).optional(),
|
|
179
|
+
// Agent surfaces only: whether the CLI actually used web tools, and which
|
|
180
|
+
// CLI version answered. Answers from model priors are honest data (§5).
|
|
181
|
+
// Tri-state (correctness spec §3.1): true = a web search/fetch completed,
|
|
182
|
+
// false = the stream was parsed and no web tool was attempted, null = the
|
|
183
|
+
// run's tool events could not be parsed (or were never captured — the
|
|
184
|
+
// migrated pre-fix baselines), so retrieval is unknown. Never guessed
|
|
185
|
+
// from the answer text.
|
|
186
|
+
usedWebSearch: z.boolean().nullable().optional(),
|
|
187
|
+
agentCliVersion: z.string().optional(),
|
|
188
|
+
// Retrieval log summary (retrieval-log spec §4). Both absent = the log was
|
|
189
|
+
// not captured for this run (a probe that predates the spec, or a parse
|
|
190
|
+
// miss) — never a from-memory claim. Present on every fresh probe,
|
|
191
|
+
// `exposure: 'none'` surfaces included (with an empty call list).
|
|
192
|
+
retrievalExposure: retrievalLogSchema.shape.exposure.optional(),
|
|
193
|
+
retrievalCalls: z.array(retrievalCallSummarySchema).optional(),
|
|
194
|
+
// Google AI Overview only (hardening spec §4.1): the SERP carried no AI
|
|
195
|
+
// Overview. A captured absence — counts against share of voice — with no
|
|
196
|
+
// answer text behind it. Absent on every other surface.
|
|
197
|
+
noOverview: z.literal(true).optional(),
|
|
198
|
+
// Path of this run's evidence chunk, relative to the report directory
|
|
199
|
+
// (e.g. 'evidence/vector_search-0.json'). Null when no text was captured.
|
|
200
|
+
evidenceFile: z.string().nullable().optional(),
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
export type AeoMatrixRow = z.infer<typeof aeoMatrixRowSchema>;
|
|
204
|
+
|
|
205
|
+
export const aeoVisibilitySchema = z.object({
|
|
206
|
+
prompts: z.array(
|
|
207
|
+
z.object({ text: z.string(), category: aeoPromptCategorySchema }),
|
|
208
|
+
),
|
|
209
|
+
surfaces: z.array(aeoSurfaceSchema),
|
|
210
|
+
matrix: z.array(aeoMatrixRowSchema),
|
|
211
|
+
summary: z.object({
|
|
212
|
+
// Headline scorecards — chat surfaces only, comparable with v1 baselines.
|
|
213
|
+
// Null when the run measured no chat surfaces (agents-only iteration
|
|
214
|
+
// runs): an unmeasured scope must never render as a measured 0%.
|
|
215
|
+
prospectShareOfVoice: z.number().min(0).max(1).nullable(),
|
|
216
|
+
prospectCitationRate: z.number().min(0).max(1).nullable(),
|
|
217
|
+
// Agent scorecard pair over the agent-surface runs (Claude Code, Codex,
|
|
218
|
+
// Cursor — §5). Null when the
|
|
219
|
+
// agent surfaces weren't run.
|
|
220
|
+
agentShareOfVoice: z.number().min(0).max(1).nullable(),
|
|
221
|
+
agentCitationRate: z.number().min(0).max(1).nullable(),
|
|
222
|
+
byModel: z.record(
|
|
223
|
+
z.string(),
|
|
224
|
+
z.object({ shareOfVoice: z.number(), citationRate: z.number() }),
|
|
225
|
+
),
|
|
226
|
+
byCompetitor: z.array(
|
|
227
|
+
z.object({
|
|
228
|
+
domain: z.string(),
|
|
229
|
+
shareOfVoice: z.number(),
|
|
230
|
+
citationRate: z.number(),
|
|
231
|
+
}),
|
|
232
|
+
),
|
|
233
|
+
topCompetitorDomain: z.string().nullable(),
|
|
234
|
+
}),
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
export type AeoVisibility = z.infer<typeof aeoVisibilitySchema>;
|
|
238
|
+
|
|
239
|
+
// ---------------------------------------------------------------------------
|
|
240
|
+
// Enrichment blocks (§7) — each optional so a failed step degrades to an
|
|
241
|
+
// omitted report section, same posture as v1 partial failures.
|
|
242
|
+
// ---------------------------------------------------------------------------
|
|
243
|
+
|
|
244
|
+
export const aeoSourceMixSchema = z.object({
|
|
245
|
+
sections: z.array(
|
|
246
|
+
z.object({
|
|
247
|
+
key: z.string(),
|
|
248
|
+
perSurface: z.array(
|
|
249
|
+
z.object({ surface: aeoSurfaceSchema, counts: sourceMixCountsSchema }),
|
|
250
|
+
),
|
|
251
|
+
total: sourceMixCountsSchema,
|
|
252
|
+
}),
|
|
253
|
+
),
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
export type AeoSourceMix = z.infer<typeof aeoSourceMixSchema>;
|
|
257
|
+
|
|
258
|
+
export const aeoPerceptionSchema = z.object({
|
|
259
|
+
sections: z.array(
|
|
260
|
+
z.object({
|
|
261
|
+
key: z.string(),
|
|
262
|
+
// Tallies over captured answers that mention the brand.
|
|
263
|
+
sentiment: z.object({
|
|
264
|
+
positive: z.number(),
|
|
265
|
+
neutral: z.number(),
|
|
266
|
+
negative: z.number(),
|
|
267
|
+
}),
|
|
268
|
+
// Narrative phrases AI attaches to the brand ("open-source",
|
|
269
|
+
// "complex to set up"), with where they were said.
|
|
270
|
+
narratives: z.array(
|
|
271
|
+
z.object({
|
|
272
|
+
phrase: z.string(),
|
|
273
|
+
promptIdx: z.number(),
|
|
274
|
+
surface: aeoSurfaceSchema,
|
|
275
|
+
}),
|
|
276
|
+
),
|
|
277
|
+
// Suspected factual errors vs the config's product brief — flagged for
|
|
278
|
+
// human verification, never auto-published as fact (§7.2).
|
|
279
|
+
flaggedClaims: z.array(
|
|
280
|
+
z.object({
|
|
281
|
+
claim: z.string(),
|
|
282
|
+
reason: z.string(),
|
|
283
|
+
promptIdx: z.number(),
|
|
284
|
+
surface: aeoSurfaceSchema,
|
|
285
|
+
}),
|
|
286
|
+
),
|
|
287
|
+
}),
|
|
288
|
+
),
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
export type AeoPerception = z.infer<typeof aeoPerceptionSchema>;
|
|
292
|
+
|
|
293
|
+
export const aiBotKinds = ['training', 'search', 'user_fetch'] as const;
|
|
294
|
+
|
|
295
|
+
export const aeoTechnicalChecksSchema = z.object({
|
|
296
|
+
crawlerAccess: z
|
|
297
|
+
.object({
|
|
298
|
+
robotsUrl: z.string(),
|
|
299
|
+
fetchedAt: z.string(),
|
|
300
|
+
robotsFetchError: z.string().nullable(),
|
|
301
|
+
bots: z.array(
|
|
302
|
+
z.object({
|
|
303
|
+
bot: z.string(),
|
|
304
|
+
kind: z.enum(aiBotKinds),
|
|
305
|
+
// Null when robots.txt could not be fetched or parsed.
|
|
306
|
+
robotsAllowed: z.boolean().nullable(),
|
|
307
|
+
// Live GET with the bot's UA — search/user-fetch bots only; catches
|
|
308
|
+
// WAF-level blocks robots.txt doesn't show. Null when not probed.
|
|
309
|
+
liveStatus: z.number().nullable(),
|
|
310
|
+
liveBlocked: z.boolean().nullable(),
|
|
311
|
+
// What the live probe can honestly say. A request presenting as a
|
|
312
|
+
// bot from the audit's own address is an impersonation to a site
|
|
313
|
+
// that verifies bots by IP, so a 403 the site does not also give
|
|
314
|
+
// a plain browser is `refused_as_bot`, never proof the real bot is
|
|
315
|
+
// blocked; a 403 to the browser too says nothing about bots.
|
|
316
|
+
// Absent on snapshots written before the control request existed.
|
|
317
|
+
liveVerdict: z
|
|
318
|
+
.enum(['ok', 'refused_as_bot', 'inconclusive'])
|
|
319
|
+
.optional(),
|
|
320
|
+
}),
|
|
321
|
+
),
|
|
322
|
+
// The same page fetched with an ordinary browser agent from the same
|
|
323
|
+
// address, right after the bot probes: the control the verdicts rest on.
|
|
324
|
+
controlStatus: z.number().nullable().optional(),
|
|
325
|
+
})
|
|
326
|
+
.nullable(),
|
|
327
|
+
renderability: z
|
|
328
|
+
.array(
|
|
329
|
+
z.object({
|
|
330
|
+
url: z.string(),
|
|
331
|
+
staticTextChars: z.number(),
|
|
332
|
+
renderedTextChars: z.number(),
|
|
333
|
+
// Fraction of rendered text missing from the no-JS fetch.
|
|
334
|
+
missingRatio: z.number(),
|
|
335
|
+
flagged: z.boolean(),
|
|
336
|
+
error: z.string().nullable(),
|
|
337
|
+
}),
|
|
338
|
+
)
|
|
339
|
+
.nullable(),
|
|
340
|
+
llmsTxt: z
|
|
341
|
+
.object({ llmsTxt: z.boolean(), llmsFullTxt: z.boolean() })
|
|
342
|
+
.nullable(),
|
|
343
|
+
agentReadiness: z
|
|
344
|
+
.object({ mcpServer: z.boolean(), llmDocs: z.boolean() })
|
|
345
|
+
.nullable(),
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
export type AeoTechnicalChecks = z.infer<typeof aeoTechnicalChecksSchema>;
|
|
349
|
+
|
|
350
|
+
export const aeoOutreachTargetsSchema = z.array(
|
|
351
|
+
z.object({
|
|
352
|
+
domain: z.string(),
|
|
353
|
+
citations: z.number(),
|
|
354
|
+
// Prompts this domain wins while the client is absent — resolved to text
|
|
355
|
+
// at render via sectionKey + promptIdx.
|
|
356
|
+
prompts: z.array(
|
|
357
|
+
z.object({ sectionKey: z.string(), promptIdx: z.number() }),
|
|
358
|
+
),
|
|
359
|
+
sampleUrls: z.array(z.string()),
|
|
360
|
+
}),
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
export type AeoOutreachTargets = z.infer<typeof aeoOutreachTargetsSchema>;
|
|
364
|
+
|
|
365
|
+
// ---------------------------------------------------------------------------
|
|
366
|
+
// Snapshot v2
|
|
367
|
+
// ---------------------------------------------------------------------------
|
|
368
|
+
|
|
369
|
+
export const aeoSnapshotSchema = z.object({
|
|
370
|
+
version: z.literal(aeoSnapshotVersion),
|
|
371
|
+
reportKey: z.string(),
|
|
372
|
+
brand: brandSchema,
|
|
373
|
+
competitors: z.array(brandSchema),
|
|
374
|
+
// Array, not fixed keys: a section that failed entirely is omitted while
|
|
375
|
+
// the others still render.
|
|
376
|
+
sections: z
|
|
377
|
+
.array(z.object({ key: z.string(), visibility: aeoVisibilitySchema }))
|
|
378
|
+
.min(1),
|
|
379
|
+
sourceMix: aeoSourceMixSchema.optional(),
|
|
380
|
+
perception: aeoPerceptionSchema.optional(),
|
|
381
|
+
technicalChecks: aeoTechnicalChecksSchema.optional(),
|
|
382
|
+
outreachTargets: aeoOutreachTargetsSchema.optional(),
|
|
383
|
+
meta: z.object({
|
|
384
|
+
// Review is additive. Exhausting its rounds records remaining work;
|
|
385
|
+
// it never prevents delivery of the measured report.
|
|
386
|
+
quality: z
|
|
387
|
+
.object({
|
|
388
|
+
needsImprovement: z.boolean(),
|
|
389
|
+
reviewRounds: z.number().int().min(0).max(maxReviewRounds),
|
|
390
|
+
issues: z.array(
|
|
391
|
+
z.object({
|
|
392
|
+
stage: z.string(),
|
|
393
|
+
code: z.string(),
|
|
394
|
+
message: z.string(),
|
|
395
|
+
file: z.string().nullable().optional(),
|
|
396
|
+
evidence: z.string().optional(),
|
|
397
|
+
}),
|
|
398
|
+
),
|
|
399
|
+
})
|
|
400
|
+
.optional(),
|
|
401
|
+
generatedAt: z.string(),
|
|
402
|
+
promptCount: z.number(),
|
|
403
|
+
// Successful probes across all sections.
|
|
404
|
+
probeCount: z.number(),
|
|
405
|
+
// Present when the run reused checkpointed probes (resume / --redo):
|
|
406
|
+
// the snapshot then mixes capture ages, and generatedAt alone would
|
|
407
|
+
// overstate freshness. Absent = every probe was captured by this run.
|
|
408
|
+
reusedProbes: z
|
|
409
|
+
.object({
|
|
410
|
+
count: z.number(),
|
|
411
|
+
oldestCapturedAt: z.string().nullable(),
|
|
412
|
+
})
|
|
413
|
+
.optional(),
|
|
414
|
+
partialFailures: z.array(z.object({ step: z.string(), error: z.string() })),
|
|
415
|
+
// The run's surface scope (correctness spec §3.6): with the pre-flight
|
|
416
|
+
// CLI check, `agentClis.<cli>: null` can only mean "not in scope", and
|
|
417
|
+
// this field says so explicitly. Optional: older snapshots lack it.
|
|
418
|
+
surfaces: z.array(aeoSurfaceSchema).optional(),
|
|
419
|
+
// Which agent CLIs answered, for the methodology note. Null = not run.
|
|
420
|
+
agentClis: z
|
|
421
|
+
.object({
|
|
422
|
+
claudeCode: z.string().nullable(),
|
|
423
|
+
codex: z.string().nullable(),
|
|
424
|
+
// Optional: snapshots committed before the cursor surface existed
|
|
425
|
+
// lack this key and must keep parsing.
|
|
426
|
+
cursor: z.string().nullable().optional(),
|
|
427
|
+
})
|
|
428
|
+
.optional(),
|
|
429
|
+
// Answer-analyzer version that produced the matrix (correctness spec
|
|
430
|
+
// §3.7); a bump invalidates every cached analysis.
|
|
431
|
+
analyzerVersion: z.number().int().optional(),
|
|
432
|
+
// Domain-classifier version behind the source mix and outreach targets
|
|
433
|
+
// (§7.1 amendment, 2026-09-04). Absent = static rules only (baselines
|
|
434
|
+
// committed before the amendment).
|
|
435
|
+
domainClassifierVersion: z.number().int().optional(),
|
|
436
|
+
competitorClassifierVersion: z.number().int().optional(),
|
|
437
|
+
// One-off data migrations applied to this committed file (correctness
|
|
438
|
+
// spec §3.8), so a rewritten value is visible in the file itself.
|
|
439
|
+
migrations: z
|
|
440
|
+
.array(z.object({ id: z.string(), appliedAt: z.string() }))
|
|
441
|
+
.optional(),
|
|
442
|
+
// The run that produced the snapshot (hardening spec §4.2); every unit
|
|
443
|
+
// record, analysis entry and log event of the run carries the same id.
|
|
444
|
+
// Optional: snapshots committed before run identity existed lack it.
|
|
445
|
+
runId: z.string().optional(),
|
|
446
|
+
derivedFromRunId: z.string().optional(),
|
|
447
|
+
replayKind: z.enum(['grounding', 'analysis']).optional(),
|
|
448
|
+
groundingPolicyVersion: z.number().int().positive().optional(),
|
|
449
|
+
// The model ids behind the analyzer and perception passes (§2.11).
|
|
450
|
+
models: z
|
|
451
|
+
.object({ analyzer: z.string(), perception: z.string() })
|
|
452
|
+
.optional(),
|
|
453
|
+
}),
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
export type AeoSnapshot = z.infer<typeof aeoSnapshotSchema>;
|
|
457
|
+
|
|
458
|
+
// ---------------------------------------------------------------------------
|
|
459
|
+
// Evidence chunks (§6) — one file per prompt per section, lazy-loaded by the
|
|
460
|
+
// report page's evidence drawer.
|
|
461
|
+
// ---------------------------------------------------------------------------
|
|
462
|
+
|
|
463
|
+
export const aeoEvidenceChunkSchema = z.object({
|
|
464
|
+
sectionKey: z.string(),
|
|
465
|
+
promptIdx: z.number(),
|
|
466
|
+
promptText: z.string(),
|
|
467
|
+
runs: z.array(
|
|
468
|
+
z.object({
|
|
469
|
+
surface: aeoSurfaceSchema,
|
|
470
|
+
runIndex: z.number(),
|
|
471
|
+
responseText: z.string(),
|
|
472
|
+
// Raw retrieval log and the cited-URL → call attribution derived from
|
|
473
|
+
// it (retrieval-log spec §4, §6). Absent = not captured for this run.
|
|
474
|
+
retrieval: retrievalLogSchema.optional(),
|
|
475
|
+
citationAttribution: citationAttributionSchema.optional(),
|
|
476
|
+
}),
|
|
477
|
+
),
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
export type AeoEvidenceChunk = z.infer<typeof aeoEvidenceChunkSchema>;
|
|
481
|
+
|
|
482
|
+
export const evidenceChunkFileName = (
|
|
483
|
+
sectionKey: string,
|
|
484
|
+
promptIdx: number,
|
|
485
|
+
): string => {
|
|
486
|
+
return `evidence/${sectionKey}-${promptIdx}.json`;
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
// ---------------------------------------------------------------------------
|