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
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import {
|
|
2
|
+
structuredWireSchema
|
|
3
|
+
} from "./chunk-Y6D6IVOM.js";
|
|
4
|
+
import {
|
|
5
|
+
structuredImageMessages,
|
|
6
|
+
structuredImageTokens
|
|
7
|
+
} from "./chunk-QFVRCSJ2.js";
|
|
8
|
+
import {
|
|
9
|
+
servedModelOf
|
|
10
|
+
} from "./chunk-ZVAKKRRD.js";
|
|
11
|
+
import {
|
|
12
|
+
createLog
|
|
13
|
+
} from "./chunk-ZSEY7AHQ.js";
|
|
14
|
+
import {
|
|
15
|
+
structuredFailureDiagnostic
|
|
16
|
+
} from "./chunk-NANJGMEJ.js";
|
|
17
|
+
import {
|
|
18
|
+
assertModelCallActive
|
|
19
|
+
} from "./chunk-55U7PRRM.js";
|
|
20
|
+
import {
|
|
21
|
+
internalModelRoleDigest,
|
|
22
|
+
internalModelRoleSchema
|
|
23
|
+
} from "./chunk-CFFPOTP4.js";
|
|
24
|
+
import {
|
|
25
|
+
readEnv
|
|
26
|
+
} from "./chunk-PO2J5OQ3.js";
|
|
27
|
+
import {
|
|
28
|
+
ModelBudgetError
|
|
29
|
+
} from "./chunk-TNL2GWYR.js";
|
|
30
|
+
|
|
31
|
+
// src/models/structured.ts
|
|
32
|
+
import { randomUUID } from "node:crypto";
|
|
33
|
+
import { createGateway, GatewayInternalServerError } from "@ai-sdk/gateway";
|
|
34
|
+
import { Agent, fetch as undiciFetch } from "undici";
|
|
35
|
+
import { NoObjectGeneratedError, Output, streamText } from "ai";
|
|
36
|
+
import { z } from "zod";
|
|
37
|
+
var StructuredOutputMissingError = class extends Error {
|
|
38
|
+
text;
|
|
39
|
+
usage;
|
|
40
|
+
issues;
|
|
41
|
+
constructor({ text, usage, issues }, { cause }) {
|
|
42
|
+
super("Model produced no value matching the response schema", { cause });
|
|
43
|
+
this.text = text;
|
|
44
|
+
this.usage = usage;
|
|
45
|
+
this.issues = issues;
|
|
46
|
+
this.name = "StructuredOutputMissingError";
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var StructuredJournalError = class extends Error {
|
|
50
|
+
observation;
|
|
51
|
+
constructor(observation, cause) {
|
|
52
|
+
super("Model response could not be journaled", { cause });
|
|
53
|
+
this.observation = observation;
|
|
54
|
+
this.name = "StructuredJournalError";
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var reportedNumber = (value) => {
|
|
58
|
+
const number = typeof value === "string" && value.trim() ? Number(value) : value;
|
|
59
|
+
return typeof number === "number" && Number.isFinite(number) && number >= 0 ? number : void 0;
|
|
60
|
+
};
|
|
61
|
+
var isGatewayCreditRefusal = (error) => {
|
|
62
|
+
return GatewayInternalServerError.isInstance(error) && error.statusCode === 402 && error.message.startsWith(
|
|
63
|
+
"A positive credit balance is required for all requests, including BYOK, so fallback providers remain available. Add credits at https://vercel.com/"
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
var transportTimeoutMs = 96e4;
|
|
67
|
+
var dispatcher = new Agent({
|
|
68
|
+
headersTimeout: transportTimeoutMs,
|
|
69
|
+
bodyTimeout: transportTimeoutMs
|
|
70
|
+
});
|
|
71
|
+
var fetchWithDispatcher = (request, init) => {
|
|
72
|
+
return undiciFetch(request, { ...init, dispatcher });
|
|
73
|
+
};
|
|
74
|
+
var gateway = createGateway({
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Undici's fetch types differ from the DOM fetch type the SDK declares, though both are compatible at runtime.
|
|
76
|
+
fetch: fetchWithDispatcher
|
|
77
|
+
});
|
|
78
|
+
var dispatchProviderOptions = (providerOptions, denylist = readEnv("AEO_GATEWAY_ROUTE_DENYLIST") ?? "") => {
|
|
79
|
+
const denied = denylist.split(",").map((route) => route.trim()).filter(Boolean);
|
|
80
|
+
const gatewayOptions = providerOptions.gateway;
|
|
81
|
+
const only = gatewayOptions?.only;
|
|
82
|
+
if (denied.length === 0 || !gatewayOptions || !only) {
|
|
83
|
+
return providerOptions;
|
|
84
|
+
}
|
|
85
|
+
const allowed = only.filter((route) => !denied.includes(route));
|
|
86
|
+
if (allowed.length === 0 || allowed.length === only.length) {
|
|
87
|
+
return providerOptions;
|
|
88
|
+
}
|
|
89
|
+
return { ...providerOptions, gateway: { ...gatewayOptions, only: allowed } };
|
|
90
|
+
};
|
|
91
|
+
var gatewayTransport = async (input) => {
|
|
92
|
+
const wire = structuredWireSchema(input.schema);
|
|
93
|
+
let streamFailure;
|
|
94
|
+
const result = streamText({
|
|
95
|
+
onError: ({ error }) => {
|
|
96
|
+
streamFailure ??= error;
|
|
97
|
+
},
|
|
98
|
+
model: gateway(input.role.model),
|
|
99
|
+
output: Output.object({ schema: wire.sdkSchema }),
|
|
100
|
+
providerOptions: dispatchProviderOptions(input.role.providerOptions),
|
|
101
|
+
maxOutputTokens: input.role.maxOutputTokens,
|
|
102
|
+
maxRetries: 0,
|
|
103
|
+
abortSignal: input.signal,
|
|
104
|
+
system: [
|
|
105
|
+
input.system,
|
|
106
|
+
wire.wrapped ? "Return the requested result inside the top-level result property required by the response schema." : void 0
|
|
107
|
+
].filter(Boolean).join("\n"),
|
|
108
|
+
...input.images?.length ? { messages: structuredImageMessages(input.prompt, input.images) } : { prompt: input.prompt }
|
|
109
|
+
});
|
|
110
|
+
let drained;
|
|
111
|
+
try {
|
|
112
|
+
drained = await Promise.all([
|
|
113
|
+
result.usage,
|
|
114
|
+
result.response,
|
|
115
|
+
result.finishReason,
|
|
116
|
+
result.providerMetadata,
|
|
117
|
+
result.text,
|
|
118
|
+
result.toolCalls
|
|
119
|
+
]);
|
|
120
|
+
} catch (error) {
|
|
121
|
+
throw streamFailure ?? error;
|
|
122
|
+
}
|
|
123
|
+
const [
|
|
124
|
+
reported,
|
|
125
|
+
response,
|
|
126
|
+
finishReason,
|
|
127
|
+
providerMetadata,
|
|
128
|
+
answered,
|
|
129
|
+
toolCalls
|
|
130
|
+
] = drained;
|
|
131
|
+
const text = answered === "" && toolCalls.length > 0 ? JSON.stringify(
|
|
132
|
+
toolCalls.map((call) => {
|
|
133
|
+
const callInput = call.input;
|
|
134
|
+
return { tool: call.toolName, input: callInput };
|
|
135
|
+
})
|
|
136
|
+
) : answered;
|
|
137
|
+
const usage = {
|
|
138
|
+
resolvedModel: servedModelOf(input.role.model, response.modelId),
|
|
139
|
+
requestId: response.id,
|
|
140
|
+
finishReason,
|
|
141
|
+
inputTokens: reported.inputTokens,
|
|
142
|
+
outputTokens: reported.outputTokens,
|
|
143
|
+
cachedInputTokens: reported.inputTokenDetails.cacheReadTokens,
|
|
144
|
+
reasoningTokens: reported.outputTokenDetails.reasoningTokens,
|
|
145
|
+
costUsd: reportedNumber(providerMetadata?.gateway?.cost)
|
|
146
|
+
};
|
|
147
|
+
try {
|
|
148
|
+
return { output: await result.output, text, usage };
|
|
149
|
+
} catch (error) {
|
|
150
|
+
if (!NoObjectGeneratedError.isInstance(error)) {
|
|
151
|
+
throw streamFailure ?? error;
|
|
152
|
+
}
|
|
153
|
+
const [toolCall] = toolCalls;
|
|
154
|
+
if (answered === "" && toolCalls.length === 1 && toolCall) {
|
|
155
|
+
const callInput = toolCall.input;
|
|
156
|
+
for (const action of [`tool:${toolCall.toolName}`, toolCall.toolName]) {
|
|
157
|
+
const candidate = { action, input: callInput };
|
|
158
|
+
try {
|
|
159
|
+
return {
|
|
160
|
+
output: wire.decode(
|
|
161
|
+
wire.wrapped ? { result: candidate } : candidate
|
|
162
|
+
),
|
|
163
|
+
text,
|
|
164
|
+
usage
|
|
165
|
+
};
|
|
166
|
+
} catch {
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
throw new StructuredOutputMissingError(
|
|
171
|
+
{ text, usage, issues: wire.lastFailure() },
|
|
172
|
+
{ cause: error }
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
var structuredCallReservation = (input) => {
|
|
177
|
+
const role = internalModelRoleSchema.parse(input.role);
|
|
178
|
+
const imageTokens = structuredImageTokens(input.images, role.model);
|
|
179
|
+
const inputTokens = Buffer.byteLength(
|
|
180
|
+
JSON.stringify({
|
|
181
|
+
system: input.system,
|
|
182
|
+
prompt: input.prompt,
|
|
183
|
+
schema: structuredWireSchema(input.schema).wire,
|
|
184
|
+
...input.images?.length ? { imageIds: input.images.map(({ id }) => id) } : {}
|
|
185
|
+
})
|
|
186
|
+
) + 2048 + imageTokens;
|
|
187
|
+
if (inputTokens > role.maxInputTokens) {
|
|
188
|
+
throw new Error("model_input_limit");
|
|
189
|
+
}
|
|
190
|
+
return {
|
|
191
|
+
inputTokens,
|
|
192
|
+
maxOutputTokens: role.maxOutputTokens,
|
|
193
|
+
// Cache creation can cost more than uncached input; reserve that ceiling.
|
|
194
|
+
reservedUsd: (inputTokens * role.pricingUsdPerMillion.input * 1.25 + role.maxOutputTokens * role.pricingUsdPerMillion.output) / 1e6
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
var billedInvalidAnswer = (error, requestedModel) => {
|
|
198
|
+
if (NoObjectGeneratedError.isInstance(error)) {
|
|
199
|
+
return {
|
|
200
|
+
text: typeof error.text === "string" ? error.text : null,
|
|
201
|
+
usage: {
|
|
202
|
+
resolvedModel: servedModelOf(requestedModel, error.response?.modelId),
|
|
203
|
+
requestId: error.response?.id,
|
|
204
|
+
finishReason: error.finishReason,
|
|
205
|
+
inputTokens: error.usage?.inputTokens,
|
|
206
|
+
outputTokens: error.usage?.outputTokens,
|
|
207
|
+
cachedInputTokens: error.usage?.inputTokenDetails.cacheReadTokens,
|
|
208
|
+
reasoningTokens: error.usage?.outputTokenDetails.reasoningTokens
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
if (error instanceof StructuredOutputMissingError) {
|
|
213
|
+
return { text: error.text, usage: error.usage };
|
|
214
|
+
}
|
|
215
|
+
return null;
|
|
216
|
+
};
|
|
217
|
+
var journal = async (sink, observation) => {
|
|
218
|
+
if (!sink) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
try {
|
|
222
|
+
await sink.observe(observation);
|
|
223
|
+
} catch (error) {
|
|
224
|
+
throw new StructuredJournalError(observation, error);
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
var outputJsonSchema = (schema) => {
|
|
228
|
+
try {
|
|
229
|
+
return z.toJSONSchema(schema);
|
|
230
|
+
} catch {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
var generateStructured = async (input, transport = gatewayTransport) => {
|
|
235
|
+
input.signal?.throwIfAborted();
|
|
236
|
+
const reservation = structuredCallReservation(input);
|
|
237
|
+
const callId = input.callId ?? randomUUID();
|
|
238
|
+
await input.accounting.observe?.(callId, {
|
|
239
|
+
kind: "request",
|
|
240
|
+
system: input.system ?? null,
|
|
241
|
+
prompt: input.prompt,
|
|
242
|
+
schema: outputJsonSchema(input.schema),
|
|
243
|
+
role: input.role,
|
|
244
|
+
images: input.images ?? []
|
|
245
|
+
});
|
|
246
|
+
await input.accounting.reserve({
|
|
247
|
+
callId,
|
|
248
|
+
role: input.roleName,
|
|
249
|
+
requestedModel: input.role.model,
|
|
250
|
+
reasoningEffort: input.role.providerOptions.openai?.reasoningEffort,
|
|
251
|
+
profileDigest: internalModelRoleDigest(input.role),
|
|
252
|
+
...reservation
|
|
253
|
+
});
|
|
254
|
+
await input.accounting.assertOwned();
|
|
255
|
+
const remainingMs = input.accounting.deadlineAt ? Date.parse(input.accounting.deadlineAt) - Date.now() : input.role.deadlineMs;
|
|
256
|
+
if (!Number.isFinite(remainingMs) || remainingMs <= 0) {
|
|
257
|
+
throw new ModelBudgetError("Model budget deadline reached before dispatch");
|
|
258
|
+
}
|
|
259
|
+
const signal = AbortSignal.any([
|
|
260
|
+
...input.signal ? [input.signal] : [],
|
|
261
|
+
AbortSignal.timeout(Math.min(input.role.deadlineMs, remainingMs))
|
|
262
|
+
]);
|
|
263
|
+
assertModelCallActive(signal);
|
|
264
|
+
const start = Date.now();
|
|
265
|
+
const log = createLog("InternalModel");
|
|
266
|
+
const heartbeat = setInterval(
|
|
267
|
+
() => log.info("Model request in progress", {
|
|
268
|
+
callId,
|
|
269
|
+
role: input.roleName,
|
|
270
|
+
model: input.role.model,
|
|
271
|
+
elapsedMs: Date.now() - start
|
|
272
|
+
}),
|
|
273
|
+
3e4
|
|
274
|
+
);
|
|
275
|
+
heartbeat.unref();
|
|
276
|
+
let result;
|
|
277
|
+
try {
|
|
278
|
+
result = await transport({ ...input, signal });
|
|
279
|
+
} catch (error) {
|
|
280
|
+
log.warn("Model request failed", {
|
|
281
|
+
callId,
|
|
282
|
+
role: input.roleName,
|
|
283
|
+
model: input.role.model,
|
|
284
|
+
durationMs: Date.now() - start,
|
|
285
|
+
...structuredFailureDiagnostic(error, signal),
|
|
286
|
+
// Which upstream route answered, and how it ended: a route that
|
|
287
|
+
// rejects a request looks identical to a schema miss without this.
|
|
288
|
+
...error instanceof StructuredOutputMissingError ? {
|
|
289
|
+
resolvedModel: error.usage.resolvedModel,
|
|
290
|
+
finishReason: error.usage.finishReason,
|
|
291
|
+
outputTokens: error.usage.outputTokens,
|
|
292
|
+
// What was said and why it was refused, when the operator asked
|
|
293
|
+
// for it: a schema miss with neither is undiagnosable from a log.
|
|
294
|
+
...readEnv("AEO_HARNESS_DEBUG_ERRORS") === "1" ? {
|
|
295
|
+
issues: error.issues.slice(0, 3),
|
|
296
|
+
text: error.text?.slice(0, 600) ?? null
|
|
297
|
+
} : {}
|
|
298
|
+
} : {}
|
|
299
|
+
});
|
|
300
|
+
if (isGatewayCreditRefusal(error)) {
|
|
301
|
+
await input.accounting.assertOwned();
|
|
302
|
+
assertModelCallActive(signal, error);
|
|
303
|
+
await input.accounting.settle(callId, {
|
|
304
|
+
requestedModel: input.role.model,
|
|
305
|
+
reasoningEffort: input.role.providerOptions.openai?.reasoningEffort,
|
|
306
|
+
durationMs: Date.now() - start,
|
|
307
|
+
costUsd: 0,
|
|
308
|
+
inputTokens: 0,
|
|
309
|
+
outputTokens: 0,
|
|
310
|
+
finishReason: "gateway_credit_refused",
|
|
311
|
+
valid: false
|
|
312
|
+
});
|
|
313
|
+
} else {
|
|
314
|
+
const billed = billedInvalidAnswer(error, input.role.model);
|
|
315
|
+
if (billed) {
|
|
316
|
+
await input.accounting.assertOwned();
|
|
317
|
+
const invalidUsage = {
|
|
318
|
+
...billed.usage,
|
|
319
|
+
callId,
|
|
320
|
+
requestedModel: input.role.model,
|
|
321
|
+
reasoningEffort: input.role.providerOptions.openai?.reasoningEffort,
|
|
322
|
+
durationMs: Date.now() - start,
|
|
323
|
+
valid: false
|
|
324
|
+
};
|
|
325
|
+
await journal(input.journal, {
|
|
326
|
+
callId,
|
|
327
|
+
payload: null,
|
|
328
|
+
text: billed.text,
|
|
329
|
+
valid: false,
|
|
330
|
+
usage: invalidUsage
|
|
331
|
+
});
|
|
332
|
+
await input.accounting.observe?.(callId, {
|
|
333
|
+
kind: "response",
|
|
334
|
+
payload: null,
|
|
335
|
+
text: billed.text,
|
|
336
|
+
valid: false
|
|
337
|
+
});
|
|
338
|
+
const { callId: _invalidCallId, ...recordedInvalidUsage } = invalidUsage;
|
|
339
|
+
await input.accounting.settle(callId, recordedInvalidUsage);
|
|
340
|
+
if (invalidUsage.finishReason === "length") {
|
|
341
|
+
throw new Error("model_output_limit");
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
assertModelCallActive(signal, error);
|
|
346
|
+
throw error;
|
|
347
|
+
} finally {
|
|
348
|
+
clearInterval(heartbeat);
|
|
349
|
+
}
|
|
350
|
+
await input.accounting.assertOwned();
|
|
351
|
+
assertModelCallActive(signal);
|
|
352
|
+
const usage = {
|
|
353
|
+
...result.usage,
|
|
354
|
+
callId,
|
|
355
|
+
requestedModel: input.role.model,
|
|
356
|
+
reasoningEffort: input.role.providerOptions.openai?.reasoningEffort,
|
|
357
|
+
durationMs: Date.now() - start
|
|
358
|
+
};
|
|
359
|
+
await journal(input.journal, {
|
|
360
|
+
callId,
|
|
361
|
+
payload: result.output,
|
|
362
|
+
text: result.text ?? null,
|
|
363
|
+
valid: true,
|
|
364
|
+
usage
|
|
365
|
+
});
|
|
366
|
+
await input.accounting.observe?.(callId, {
|
|
367
|
+
kind: "response",
|
|
368
|
+
payload: result.output,
|
|
369
|
+
text: result.text ?? null,
|
|
370
|
+
valid: true
|
|
371
|
+
});
|
|
372
|
+
const { callId: _callId, ...recordedUsage } = usage;
|
|
373
|
+
await input.accounting.settle(callId, recordedUsage);
|
|
374
|
+
if (usage.finishReason === "length") {
|
|
375
|
+
throw new Error("model_output_limit");
|
|
376
|
+
}
|
|
377
|
+
return { output: input.schema.parse(result.output), usage };
|
|
378
|
+
};
|
|
379
|
+
|
|
380
|
+
export {
|
|
381
|
+
StructuredOutputMissingError,
|
|
382
|
+
StructuredJournalError,
|
|
383
|
+
dispatchProviderOptions,
|
|
384
|
+
structuredCallReservation,
|
|
385
|
+
generateStructured
|
|
386
|
+
};
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createLog
|
|
3
|
+
} from "./chunk-ZSEY7AHQ.js";
|
|
4
|
+
|
|
5
|
+
// src/checks/crawler-access.ts
|
|
6
|
+
var log = createLog("CrawlerAccess");
|
|
7
|
+
var aiBotRoster = [
|
|
8
|
+
{ bot: "GPTBot", kind: "training" },
|
|
9
|
+
{
|
|
10
|
+
bot: "OAI-SearchBot",
|
|
11
|
+
kind: "search",
|
|
12
|
+
liveProbeUa: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.0; +https://openai.com/searchbot"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
bot: "ChatGPT-User",
|
|
16
|
+
kind: "user_fetch",
|
|
17
|
+
liveProbeUa: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot"
|
|
18
|
+
},
|
|
19
|
+
{ bot: "ClaudeBot", kind: "training" },
|
|
20
|
+
{
|
|
21
|
+
bot: "Claude-User",
|
|
22
|
+
kind: "user_fetch",
|
|
23
|
+
liveProbeUa: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; Claude-User/1.0; +Claude-User@anthropic.com"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
bot: "Claude-SearchBot",
|
|
27
|
+
kind: "search",
|
|
28
|
+
liveProbeUa: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; Claude-SearchBot/1.0; +Claude-SearchBot@anthropic.com"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
bot: "PerplexityBot",
|
|
32
|
+
kind: "search",
|
|
33
|
+
liveProbeUa: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
bot: "Perplexity-User",
|
|
37
|
+
kind: "user_fetch",
|
|
38
|
+
liveProbeUa: "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; Perplexity-User/1.0; +https://perplexity.ai/perplexity-user"
|
|
39
|
+
},
|
|
40
|
+
{ bot: "Google-Extended", kind: "training" },
|
|
41
|
+
{ bot: "meta-externalagent", kind: "training" },
|
|
42
|
+
{ bot: "Bytespider", kind: "training" },
|
|
43
|
+
{ bot: "CCBot", kind: "training" }
|
|
44
|
+
];
|
|
45
|
+
var fetchTimeoutMs = 15e3;
|
|
46
|
+
var probeIntervalMs = 1e3;
|
|
47
|
+
var controlUserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36";
|
|
48
|
+
var sleep = (ms) => {
|
|
49
|
+
return new Promise((resolve) => {
|
|
50
|
+
setTimeout(resolve, ms);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
var isRefused = (code) => {
|
|
54
|
+
return code === 403 || code === 429;
|
|
55
|
+
};
|
|
56
|
+
var getLiveVerdict = (liveStatus, controlStatus) => {
|
|
57
|
+
if (liveStatus === null || controlStatus === null || isRefused(controlStatus)) {
|
|
58
|
+
return "inconclusive";
|
|
59
|
+
}
|
|
60
|
+
return isRefused(liveStatus) ? "refused_as_bot" : "ok";
|
|
61
|
+
};
|
|
62
|
+
var describeError = (error) => {
|
|
63
|
+
return error instanceof Error ? error.message : String(error);
|
|
64
|
+
};
|
|
65
|
+
var runCrawlerAccessCheck = async (brandDomain) => {
|
|
66
|
+
const origin = `https://${brandDomain.replace(/^https?:\/\//, "").replace(/\/.*$/, "")}`;
|
|
67
|
+
const robotsUrl = `${origin}/robots.txt`;
|
|
68
|
+
let robotsBody = null;
|
|
69
|
+
let robotsFetchError = null;
|
|
70
|
+
try {
|
|
71
|
+
const response = await fetch(robotsUrl, {
|
|
72
|
+
signal: AbortSignal.timeout(fetchTimeoutMs),
|
|
73
|
+
headers: { "user-agent": "literally-aeo-audit/1.0" }
|
|
74
|
+
});
|
|
75
|
+
if (response.ok) {
|
|
76
|
+
robotsBody = await response.text();
|
|
77
|
+
} else if (response.status === 404) {
|
|
78
|
+
robotsBody = "";
|
|
79
|
+
} else {
|
|
80
|
+
robotsFetchError = `HTTP ${response.status}`;
|
|
81
|
+
}
|
|
82
|
+
} catch (error) {
|
|
83
|
+
robotsFetchError = describeError(error);
|
|
84
|
+
}
|
|
85
|
+
const groups = robotsBody !== null ? parseRobotsTxt(robotsBody) : null;
|
|
86
|
+
const status = async (userAgent) => {
|
|
87
|
+
try {
|
|
88
|
+
const response = await fetch(origin, {
|
|
89
|
+
signal: AbortSignal.timeout(fetchTimeoutMs),
|
|
90
|
+
headers: { "user-agent": userAgent },
|
|
91
|
+
redirect: "follow"
|
|
92
|
+
});
|
|
93
|
+
return response.status;
|
|
94
|
+
} catch (error) {
|
|
95
|
+
log.warn("Live UA probe failed", { userAgent, error: String(error) });
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const probed = [];
|
|
100
|
+
for (const bot of aiBotRoster) {
|
|
101
|
+
if (!bot.liveProbeUa) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (probed.length > 0) {
|
|
105
|
+
await sleep(probeIntervalMs);
|
|
106
|
+
}
|
|
107
|
+
probed.push({ bot, liveStatus: await status(bot.liveProbeUa) });
|
|
108
|
+
}
|
|
109
|
+
if (probed.length > 0) {
|
|
110
|
+
await sleep(probeIntervalMs);
|
|
111
|
+
}
|
|
112
|
+
const controlStatus = probed.length > 0 ? await status(controlUserAgent) : null;
|
|
113
|
+
const bots = aiBotRoster.map((bot) => {
|
|
114
|
+
const robotsAllowed = groups ? isRootAllowed(groups, bot.bot) : null;
|
|
115
|
+
const probe = probed.find((entry) => entry.bot === bot);
|
|
116
|
+
if (!probe) {
|
|
117
|
+
return {
|
|
118
|
+
bot: bot.bot,
|
|
119
|
+
kind: bot.kind,
|
|
120
|
+
robotsAllowed,
|
|
121
|
+
liveStatus: null,
|
|
122
|
+
liveBlocked: null
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const liveStatus = probe.liveStatus;
|
|
126
|
+
const liveVerdict = getLiveVerdict(liveStatus, controlStatus);
|
|
127
|
+
return {
|
|
128
|
+
bot: bot.bot,
|
|
129
|
+
kind: bot.kind,
|
|
130
|
+
robotsAllowed,
|
|
131
|
+
liveStatus,
|
|
132
|
+
// The live probe cannot establish a block of the real bot from here;
|
|
133
|
+
// the boolean stays for readers of older snapshots and is false only
|
|
134
|
+
// where the probe was served.
|
|
135
|
+
liveBlocked: liveVerdict === "ok" ? false : null,
|
|
136
|
+
liveVerdict
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
log.info("Crawler access check completed", {
|
|
140
|
+
robotsUrl,
|
|
141
|
+
robotsFetchError,
|
|
142
|
+
controlStatus,
|
|
143
|
+
bots: bots.length,
|
|
144
|
+
robotsBlocked: bots.filter((b) => b.robotsAllowed === false).length,
|
|
145
|
+
refusedAsBot: bots.filter((b) => b.liveVerdict === "refused_as_bot").length,
|
|
146
|
+
inconclusive: bots.filter((b) => b.liveVerdict === "inconclusive").length
|
|
147
|
+
});
|
|
148
|
+
return {
|
|
149
|
+
robotsUrl,
|
|
150
|
+
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
151
|
+
robotsFetchError,
|
|
152
|
+
controlStatus,
|
|
153
|
+
bots
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
var checkLlmsTxt = async (brandDomain) => {
|
|
157
|
+
const origin = `https://${brandDomain.replace(/^https?:\/\//, "").replace(/\/.*$/, "")}`;
|
|
158
|
+
const [llmsTxt, llmsFullTxt] = await Promise.all([
|
|
159
|
+
urlExists(`${origin}/llms.txt`),
|
|
160
|
+
urlExists(`${origin}/llms-full.txt`)
|
|
161
|
+
]);
|
|
162
|
+
log.debug("llms.txt check completed", { origin, llmsTxt, llmsFullTxt });
|
|
163
|
+
return { llmsTxt, llmsFullTxt };
|
|
164
|
+
};
|
|
165
|
+
var urlExists = async (url) => {
|
|
166
|
+
try {
|
|
167
|
+
const response = await fetch(url, {
|
|
168
|
+
signal: AbortSignal.timeout(fetchTimeoutMs),
|
|
169
|
+
headers: { "user-agent": "literally-aeo-audit/1.0" }
|
|
170
|
+
});
|
|
171
|
+
if (!response.ok) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
175
|
+
return !contentType.includes("text/html");
|
|
176
|
+
} catch {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
var parseRobotsTxt = (body) => {
|
|
181
|
+
const groups = [];
|
|
182
|
+
let current = null;
|
|
183
|
+
let lastLineWasAgent = false;
|
|
184
|
+
for (const rawLine of body.split("\n")) {
|
|
185
|
+
const line = rawLine.split("#")[0]?.trim() ?? "";
|
|
186
|
+
if (!line) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
const separatorIndex = line.indexOf(":");
|
|
190
|
+
if (separatorIndex < 0) {
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const field = line.slice(0, separatorIndex).trim().toLowerCase();
|
|
194
|
+
const value = line.slice(separatorIndex + 1).trim();
|
|
195
|
+
if (field === "user-agent") {
|
|
196
|
+
if (!current || !lastLineWasAgent) {
|
|
197
|
+
current = { agents: [], rules: [] };
|
|
198
|
+
groups.push(current);
|
|
199
|
+
}
|
|
200
|
+
current.agents.push(value.toLowerCase());
|
|
201
|
+
lastLineWasAgent = true;
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
lastLineWasAgent = false;
|
|
205
|
+
if (!current) {
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (field === "allow" || field === "disallow") {
|
|
209
|
+
if (value === "") {
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
current.rules.push({ allow: field === "allow", path: value });
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return groups;
|
|
216
|
+
};
|
|
217
|
+
var isRootAllowed = (groups, bot) => {
|
|
218
|
+
const botLower = bot.toLowerCase();
|
|
219
|
+
let matched = null;
|
|
220
|
+
let matchedSpecificity = -1;
|
|
221
|
+
for (const group of groups) {
|
|
222
|
+
for (const agent of group.agents) {
|
|
223
|
+
let specificity = -1;
|
|
224
|
+
if (agent === "*") {
|
|
225
|
+
specificity = 0;
|
|
226
|
+
} else if (botLower.includes(agent) || agent.includes(botLower)) {
|
|
227
|
+
specificity = agent.length;
|
|
228
|
+
}
|
|
229
|
+
if (specificity > matchedSpecificity) {
|
|
230
|
+
matched = group;
|
|
231
|
+
matchedSpecificity = specificity;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (!matched) {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
let best = null;
|
|
239
|
+
for (const rule of matched.rules) {
|
|
240
|
+
if (!"/".startsWith(rule.path) && rule.path !== "/") {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (!best || rule.path.length > best.length) {
|
|
244
|
+
best = { allow: rule.allow, length: rule.path.length };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
return best ? best.allow : true;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export {
|
|
251
|
+
aiBotRoster,
|
|
252
|
+
runCrawlerAccessCheck,
|
|
253
|
+
checkLlmsTxt,
|
|
254
|
+
parseRobotsTxt,
|
|
255
|
+
isRootAllowed
|
|
256
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// src/report/core/copy-schema.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var reportProseSchema = z.string().max(2e4).refine(
|
|
4
|
+
(value) => !/(?:https?:|ftp:)\/\/|(?:javascript|data):|www\.|\[[^\]]*\]\([^)]*\)|<\/?[a-z][^>]*>/i.test(
|
|
5
|
+
value
|
|
6
|
+
),
|
|
7
|
+
"Report prose cannot contain URLs, markdown links, or HTML"
|
|
8
|
+
).describe(
|
|
9
|
+
"Plain prose. No URLs, no markdown links, and no HTML; cite evidence by fact ID instead."
|
|
10
|
+
);
|
|
11
|
+
var aeoSectionCopySchema = z.object({
|
|
12
|
+
anchor: z.string().regex(/^[a-zA-Z0-9-]+$/),
|
|
13
|
+
title: reportProseSchema,
|
|
14
|
+
subtitle: reportProseSchema,
|
|
15
|
+
perceptionCopy: reportProseSchema.optional(),
|
|
16
|
+
retrievalCopy: reportProseSchema.optional()
|
|
17
|
+
}).strict();
|
|
18
|
+
var aeoReportCopySchema = z.object({
|
|
19
|
+
reportKey: z.string().min(1),
|
|
20
|
+
heroEyebrow: reportProseSchema.optional(),
|
|
21
|
+
brandLogo: z.object({
|
|
22
|
+
src: z.string().regex(
|
|
23
|
+
/^(?:\/assets\/[^?#]+|\/aeo-insights-assets\/[a-zA-Z0-9_-]+\/[a-f0-9]{64}\.png)$/
|
|
24
|
+
).refine((src) => !src.split("/").includes("..")),
|
|
25
|
+
width: z.number().int().positive(),
|
|
26
|
+
height: z.number().int().positive()
|
|
27
|
+
}).strict().optional(),
|
|
28
|
+
title: reportProseSchema,
|
|
29
|
+
metaDescription: reportProseSchema,
|
|
30
|
+
subtitle: reportProseSchema,
|
|
31
|
+
preparedBy: reportProseSchema,
|
|
32
|
+
eyebrow: reportProseSchema,
|
|
33
|
+
heading: reportProseSchema,
|
|
34
|
+
intro: reportProseSchema,
|
|
35
|
+
pendingBadge: reportProseSchema,
|
|
36
|
+
pendingBody: reportProseSchema,
|
|
37
|
+
sections: z.record(z.string(), aeoSectionCopySchema),
|
|
38
|
+
actionPlan: z.object({
|
|
39
|
+
heading: reportProseSchema,
|
|
40
|
+
intro: reportProseSchema,
|
|
41
|
+
items: z.array(
|
|
42
|
+
z.object({ title: reportProseSchema, body: reportProseSchema }).strict()
|
|
43
|
+
)
|
|
44
|
+
}).strict().optional(),
|
|
45
|
+
methodologyNote: reportProseSchema,
|
|
46
|
+
footerNote: reportProseSchema
|
|
47
|
+
}).strict();
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
reportProseSchema,
|
|
51
|
+
aeoSectionCopySchema,
|
|
52
|
+
aeoReportCopySchema
|
|
53
|
+
};
|