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,37 @@
|
|
|
1
|
+
// src/api/errors.ts
|
|
2
|
+
var errorStatus = {
|
|
3
|
+
unauthorized: 401,
|
|
4
|
+
forbidden: 403,
|
|
5
|
+
not_found: 404,
|
|
6
|
+
invalid_request: 400,
|
|
7
|
+
conflict: 409,
|
|
8
|
+
release_changed: 409,
|
|
9
|
+
pipeline_active: 409,
|
|
10
|
+
report_exists: 409,
|
|
11
|
+
gate_not_waiting: 409,
|
|
12
|
+
over_cost_cap: 429,
|
|
13
|
+
service_unavailable: 503,
|
|
14
|
+
incompatible_report: 503,
|
|
15
|
+
internal: 500
|
|
16
|
+
};
|
|
17
|
+
var ApiError = class extends Error {
|
|
18
|
+
code;
|
|
19
|
+
details;
|
|
20
|
+
constructor(code, message, { details } = {}) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.details = details;
|
|
24
|
+
this.name = "ApiError";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var requireScope = (scopes, scope) => {
|
|
28
|
+
if (!scopes.includes(scope)) {
|
|
29
|
+
throw new ApiError("forbidden", `Scope ${scope} is required`);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
errorStatus,
|
|
35
|
+
ApiError,
|
|
36
|
+
requireScope
|
|
37
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/models/structured-images.ts
|
|
2
|
+
var imageTokenReserve = {
|
|
3
|
+
"anthropic/claude-opus-4.6": 2048,
|
|
4
|
+
"moonshotai/kimi-k3": 2048
|
|
5
|
+
};
|
|
6
|
+
var supportsImageInput = (model) => {
|
|
7
|
+
return model in imageTokenReserve;
|
|
8
|
+
};
|
|
9
|
+
var structuredImageTokens = (images, model) => {
|
|
10
|
+
if (!images?.length) {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
const reservePerImage = imageTokenReserve[model];
|
|
14
|
+
if (!reservePerImage) {
|
|
15
|
+
throw new Error("model_image_unsupported");
|
|
16
|
+
}
|
|
17
|
+
if (images.length > 6 || new Set(images.map(({ id }) => id)).size !== images.length) {
|
|
18
|
+
throw new Error("model_image_invalid");
|
|
19
|
+
}
|
|
20
|
+
for (const image of images) {
|
|
21
|
+
if (!/^[a-zA-Z0-9_-]{1,80}$/.test(image.id) || !(image.bytes instanceof Uint8Array)) {
|
|
22
|
+
throw new Error("model_image_invalid");
|
|
23
|
+
}
|
|
24
|
+
const bytes = Buffer.from(
|
|
25
|
+
image.bytes.buffer,
|
|
26
|
+
image.bytes.byteOffset,
|
|
27
|
+
image.bytes.byteLength
|
|
28
|
+
);
|
|
29
|
+
if (bytes.length < 33 || bytes.length > 524288 || !bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])) || bytes.readUInt32BE(8) !== 13 || bytes.subarray(12, 16).toString("ascii") !== "IHDR" || bytes.readUInt32BE(16) < 1 || bytes.readUInt32BE(16) > 1024 || bytes.readUInt32BE(20) < 1 || bytes.readUInt32BE(20) > 512) {
|
|
30
|
+
throw new Error("model_image_invalid");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return images.length * reservePerImage;
|
|
34
|
+
};
|
|
35
|
+
var structuredImageMessages = (prompt, images) => {
|
|
36
|
+
return [
|
|
37
|
+
{
|
|
38
|
+
role: "user",
|
|
39
|
+
content: [
|
|
40
|
+
...images.flatMap(({ id, bytes }) => [
|
|
41
|
+
{ type: "text", text: `Image ${id}:` },
|
|
42
|
+
{ type: "image", image: bytes, mediaType: "image/png" }
|
|
43
|
+
]),
|
|
44
|
+
{ type: "text", text: prompt }
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
];
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export {
|
|
51
|
+
supportsImageInput,
|
|
52
|
+
structuredImageTokens,
|
|
53
|
+
structuredImageMessages
|
|
54
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/report/core/normalize-domain.ts
|
|
2
|
+
var normalizeDomain = (domain) => {
|
|
3
|
+
let host;
|
|
4
|
+
try {
|
|
5
|
+
host = new URL(domain.includes("://") ? domain : `https://${domain}`).hostname;
|
|
6
|
+
} catch {
|
|
7
|
+
host = domain.replace(/^https?:\/\//, "").replace(/\/.*$/, "");
|
|
8
|
+
}
|
|
9
|
+
return host.toLowerCase().replace(/\.$/, "").replace(/^www\./, "");
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
normalizeDomain
|
|
14
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
recorded
|
|
3
|
+
} from "./chunk-5GZVDGTX.js";
|
|
4
|
+
|
|
5
|
+
// src/grounding/recorded-tools.ts
|
|
6
|
+
var recordedGroundingTools = (tools, recorder) => {
|
|
7
|
+
const execute = (action, context) => {
|
|
8
|
+
return recorded({
|
|
9
|
+
recorder,
|
|
10
|
+
start: {
|
|
11
|
+
kind: "research_tool",
|
|
12
|
+
role: action.tool,
|
|
13
|
+
inputs: { action: JSON.stringify(action) },
|
|
14
|
+
details: { tool: action.tool, searchProvider: tools.searchProvider }
|
|
15
|
+
},
|
|
16
|
+
run: () => tools.execute(action, context),
|
|
17
|
+
finish: (result) => ({
|
|
18
|
+
outcome: result.kind === "failure" ? "failed" : "succeeded",
|
|
19
|
+
outputs: { result: JSON.stringify(result) },
|
|
20
|
+
details: {
|
|
21
|
+
resultKind: result.kind,
|
|
22
|
+
...result.kind === "failure" && { reason: result.reason }
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
signal: context.signal
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return { searchProvider: tools.searchProvider, execute };
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
recordedGroundingTools
|
|
33
|
+
};
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import {
|
|
2
|
+
aeoCheckpointDir
|
|
3
|
+
} from "./chunk-IRPKBDB7.js";
|
|
4
|
+
import {
|
|
5
|
+
StoreConflictError
|
|
6
|
+
} from "./chunk-FWBVTM7F.js";
|
|
7
|
+
import {
|
|
8
|
+
hasErrorCode
|
|
9
|
+
} from "./chunk-2QLAFBCG.js";
|
|
10
|
+
import {
|
|
11
|
+
aeoAuditConfigSchema
|
|
12
|
+
} from "./chunk-ZLOOC46D.js";
|
|
13
|
+
import {
|
|
14
|
+
aeoReportCopySchema
|
|
15
|
+
} from "./chunk-PKB6JRJM.js";
|
|
16
|
+
|
|
17
|
+
// src/stores/local-versions.ts
|
|
18
|
+
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
var isLocalVersionState = (value) => {
|
|
21
|
+
return typeof value === "object" && value !== null && "configs" in value && Array.isArray(value.configs) && "copies" in value && Array.isArray(value.copies) && "reports" in value && Array.isArray(value.reports);
|
|
22
|
+
};
|
|
23
|
+
var fileQueues = /* @__PURE__ */ new Map();
|
|
24
|
+
var LocalVersionRepository = class {
|
|
25
|
+
#file;
|
|
26
|
+
#queue = Promise.resolve();
|
|
27
|
+
#state = { configs: [], copies: [], reports: [] };
|
|
28
|
+
constructor(file) {
|
|
29
|
+
this.#file = file;
|
|
30
|
+
}
|
|
31
|
+
async read() {
|
|
32
|
+
if (!this.#file) {
|
|
33
|
+
return this.#state;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const parsed = JSON.parse(await readFile(this.#file, "utf8"));
|
|
37
|
+
if (!isLocalVersionState(parsed)) {
|
|
38
|
+
throw new Error(`Invalid version registry file: ${this.#file}.`);
|
|
39
|
+
}
|
|
40
|
+
for (const record of [...parsed.configs, ...parsed.copies]) {
|
|
41
|
+
record.createdAt = new Date(record.createdAt);
|
|
42
|
+
record.approvedAt = record.approvedAt ? new Date(record.approvedAt) : null;
|
|
43
|
+
}
|
|
44
|
+
this.#state = parsed;
|
|
45
|
+
} catch (error) {
|
|
46
|
+
if (!hasErrorCode(error, "ENOENT")) {
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return this.#state;
|
|
51
|
+
}
|
|
52
|
+
async mutate(fn) {
|
|
53
|
+
const file = this.#file;
|
|
54
|
+
const perform = async () => {
|
|
55
|
+
const next = structuredClone(await this.read());
|
|
56
|
+
const result = fn(next);
|
|
57
|
+
if (file) {
|
|
58
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
59
|
+
const temporary = `${file}.${process.pid}.tmp`;
|
|
60
|
+
await writeFile(temporary, `${JSON.stringify(next, null, 2)}
|
|
61
|
+
`, {
|
|
62
|
+
mode: 384
|
|
63
|
+
});
|
|
64
|
+
await rename(temporary, file);
|
|
65
|
+
}
|
|
66
|
+
this.#state = next;
|
|
67
|
+
return structuredClone(result);
|
|
68
|
+
};
|
|
69
|
+
if (!file) {
|
|
70
|
+
const pending2 = this.#queue.then(perform);
|
|
71
|
+
this.#queue = pending2.catch(() => void 0);
|
|
72
|
+
return pending2;
|
|
73
|
+
}
|
|
74
|
+
const pending = (fileQueues.get(file) ?? Promise.resolve()).then(perform);
|
|
75
|
+
fileQueues.set(
|
|
76
|
+
file,
|
|
77
|
+
pending.catch(() => void 0)
|
|
78
|
+
);
|
|
79
|
+
return pending;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
var LocalVersionStore = class {
|
|
83
|
+
#repo;
|
|
84
|
+
#kind;
|
|
85
|
+
constructor(repo, kind) {
|
|
86
|
+
this.#repo = repo;
|
|
87
|
+
this.#kind = kind;
|
|
88
|
+
}
|
|
89
|
+
async list(reportKey) {
|
|
90
|
+
const state = await this.#repo.read();
|
|
91
|
+
const rows = structuredClone(
|
|
92
|
+
this.#kind.rows(state).filter((row) => !reportKey || row.reportKey === reportKey)
|
|
93
|
+
);
|
|
94
|
+
return rows;
|
|
95
|
+
}
|
|
96
|
+
async getApproved(reportKey) {
|
|
97
|
+
const rows = await this.list(reportKey);
|
|
98
|
+
return rows.find((row) => row.status === "approved") ?? null;
|
|
99
|
+
}
|
|
100
|
+
async getVersion(reportKey, version) {
|
|
101
|
+
const rows = await this.list(reportKey);
|
|
102
|
+
return rows.find((row) => row.version === version) ?? null;
|
|
103
|
+
}
|
|
104
|
+
async getBySlug(slug) {
|
|
105
|
+
const state = await this.#repo.read();
|
|
106
|
+
const report = state.reports.find(
|
|
107
|
+
(candidate) => candidate.slug === slug && !candidate.retiredAt
|
|
108
|
+
);
|
|
109
|
+
return report ? this.getApproved(report.reportKey) : null;
|
|
110
|
+
}
|
|
111
|
+
async putDraft(reportKey, value, options) {
|
|
112
|
+
const parsed = this.#kind.parse(value);
|
|
113
|
+
if (parsed.reportKey !== reportKey) {
|
|
114
|
+
throw new StoreConflictError("Draft belongs to another report");
|
|
115
|
+
}
|
|
116
|
+
return this.#repo.mutate((state) => {
|
|
117
|
+
this.#kind.claimReport?.(state, parsed);
|
|
118
|
+
const report = state.reports.find(
|
|
119
|
+
(candidate) => candidate.reportKey === reportKey
|
|
120
|
+
);
|
|
121
|
+
if (!report) {
|
|
122
|
+
throw new StoreConflictError("Unknown report");
|
|
123
|
+
}
|
|
124
|
+
const rows = this.#kind.rows(state);
|
|
125
|
+
const existing = options.authorJobId ? rows.find(
|
|
126
|
+
(row2) => row2.reportKey === reportKey && row2.authorJobId === options.authorJobId
|
|
127
|
+
) : void 0;
|
|
128
|
+
if (existing) {
|
|
129
|
+
return existing;
|
|
130
|
+
}
|
|
131
|
+
const version = Math.max(
|
|
132
|
+
0,
|
|
133
|
+
...rows.filter((row2) => row2.reportKey === reportKey).map((row2) => row2.version)
|
|
134
|
+
) + 1;
|
|
135
|
+
const metadata = {
|
|
136
|
+
reportKey,
|
|
137
|
+
version,
|
|
138
|
+
status: "draft",
|
|
139
|
+
source: options.source,
|
|
140
|
+
authorJobId: options.authorJobId ?? null,
|
|
141
|
+
pipelineId: options.pipelineId ?? null,
|
|
142
|
+
flags: options.flags ?? [],
|
|
143
|
+
verdict: options.verdict ?? null,
|
|
144
|
+
confidence: options.confidence ?? null,
|
|
145
|
+
notes: options.notes ?? null,
|
|
146
|
+
approvedBy: null,
|
|
147
|
+
approvedAt: null,
|
|
148
|
+
createdAt: /* @__PURE__ */ new Date()
|
|
149
|
+
};
|
|
150
|
+
const row = this.#kind.createRow(metadata, parsed, options);
|
|
151
|
+
rows.push(row);
|
|
152
|
+
if (this.#kind.tracksCopyOwner && options.source !== "agent") {
|
|
153
|
+
report.copyOwner = "human";
|
|
154
|
+
}
|
|
155
|
+
return row;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
async approve(reportKey, version, { approvedBy }) {
|
|
159
|
+
if (!approvedBy.trim()) {
|
|
160
|
+
throw new StoreConflictError("Approval requires an actor");
|
|
161
|
+
}
|
|
162
|
+
await this.#repo.mutate((state) => {
|
|
163
|
+
const rows = this.#kind.rows(state);
|
|
164
|
+
const target = rows.find(
|
|
165
|
+
(row) => row.reportKey === reportKey && row.version === version
|
|
166
|
+
);
|
|
167
|
+
if (!target) {
|
|
168
|
+
throw new StoreConflictError("Unknown version");
|
|
169
|
+
}
|
|
170
|
+
if (target.status === "approved") {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
if (target.status !== "draft") {
|
|
174
|
+
throw new StoreConflictError("Only a draft can be approved");
|
|
175
|
+
}
|
|
176
|
+
for (const row of rows) {
|
|
177
|
+
if (row.reportKey === reportKey && row.status === "approved") {
|
|
178
|
+
row.status = "superseded";
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
target.status = "approved";
|
|
182
|
+
target.approvedBy = approvedBy;
|
|
183
|
+
target.approvedAt = /* @__PURE__ */ new Date();
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
async reject(reportKey, version, _options) {
|
|
187
|
+
await this.#repo.mutate((state) => {
|
|
188
|
+
const row = this.#kind.rows(state).find(
|
|
189
|
+
(candidate) => candidate.reportKey === reportKey && candidate.version === version
|
|
190
|
+
);
|
|
191
|
+
if (row?.status !== "draft") {
|
|
192
|
+
throw new StoreConflictError("Only a draft can be rejected");
|
|
193
|
+
}
|
|
194
|
+
row.status = "rejected";
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
async retire(reportKey, _options) {
|
|
198
|
+
await this.#repo.mutate((state) => {
|
|
199
|
+
const report = state.reports.find(
|
|
200
|
+
(candidate) => candidate.reportKey === reportKey
|
|
201
|
+
);
|
|
202
|
+
if (!report) {
|
|
203
|
+
throw new StoreConflictError("Unknown report");
|
|
204
|
+
}
|
|
205
|
+
report.retiredAt = /* @__PURE__ */ new Date();
|
|
206
|
+
for (const row of [...state.configs, ...state.copies]) {
|
|
207
|
+
if (row.reportKey === reportKey && row.status === "approved") {
|
|
208
|
+
row.status = "superseded";
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
var configKind = {
|
|
215
|
+
rows: (state) => state.configs,
|
|
216
|
+
parse: (value) => aeoAuditConfigSchema.parse(value),
|
|
217
|
+
createRow: (metadata, config) => ({ ...metadata, config }),
|
|
218
|
+
tracksCopyOwner: false,
|
|
219
|
+
claimReport: (state, config) => {
|
|
220
|
+
const report = state.reports.find(
|
|
221
|
+
(candidate) => candidate.reportKey === config.reportKey
|
|
222
|
+
);
|
|
223
|
+
if (report && report.slug !== config.slug) {
|
|
224
|
+
throw new StoreConflictError("Config must preserve the report slug");
|
|
225
|
+
}
|
|
226
|
+
if (report) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (state.reports.some((candidate) => candidate.slug === config.slug)) {
|
|
230
|
+
throw new StoreConflictError("Report slug already exists");
|
|
231
|
+
}
|
|
232
|
+
state.reports.push({
|
|
233
|
+
reportKey: config.reportKey,
|
|
234
|
+
slug: config.slug,
|
|
235
|
+
retiredAt: null,
|
|
236
|
+
copyOwner: "agent"
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
var copyKind = {
|
|
241
|
+
rows: (state) => state.copies,
|
|
242
|
+
parse: (value) => aeoReportCopySchema.parse(value),
|
|
243
|
+
createRow: (metadata, copy, options) => ({
|
|
244
|
+
...metadata,
|
|
245
|
+
copy,
|
|
246
|
+
basisRunId: options.basisRunId ?? null,
|
|
247
|
+
provenance: options.provenance ?? null,
|
|
248
|
+
validation: options.validation ?? null
|
|
249
|
+
}),
|
|
250
|
+
tracksCopyOwner: true
|
|
251
|
+
};
|
|
252
|
+
var MemoryConfigStore = class extends LocalVersionStore {
|
|
253
|
+
constructor(repo = new LocalVersionRepository()) {
|
|
254
|
+
super(repo, configKind);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
var MemoryCopyStore = class extends LocalVersionStore {
|
|
258
|
+
constructor(repo = new LocalVersionRepository()) {
|
|
259
|
+
super(repo, copyKind);
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
var memoryVersionStores = (repo = new LocalVersionRepository()) => {
|
|
263
|
+
const stores = {
|
|
264
|
+
configStore: new MemoryConfigStore(repo),
|
|
265
|
+
copyStore: new MemoryCopyStore(repo)
|
|
266
|
+
};
|
|
267
|
+
return stores;
|
|
268
|
+
};
|
|
269
|
+
var openFileVersionStores = (directory = path.join(aeoCheckpointDir, "configs")) => {
|
|
270
|
+
return memoryVersionStores(
|
|
271
|
+
new LocalVersionRepository(path.join(directory, "registry.json"))
|
|
272
|
+
);
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export {
|
|
276
|
+
LocalVersionRepository,
|
|
277
|
+
MemoryConfigStore,
|
|
278
|
+
MemoryCopyStore,
|
|
279
|
+
memoryVersionStores,
|
|
280
|
+
openFileVersionStores
|
|
281
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StoreConflictError
|
|
3
|
+
} from "./chunk-FWBVTM7F.js";
|
|
4
|
+
import {
|
|
5
|
+
assertCopyValidation,
|
|
6
|
+
copyCheckerVersion
|
|
7
|
+
} from "./chunk-FBFZBLTY.js";
|
|
8
|
+
import {
|
|
9
|
+
internalModelProfileSchema
|
|
10
|
+
} from "./chunk-CFFPOTP4.js";
|
|
11
|
+
import {
|
|
12
|
+
aeoSnapshotSchema
|
|
13
|
+
} from "./chunk-SDWYZM64.js";
|
|
14
|
+
|
|
15
|
+
// src/stores/publication.ts
|
|
16
|
+
var sameTriple = (actual, expected) => {
|
|
17
|
+
if (typeof actual !== "object" || actual === null) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const isSame = "reportKey" in actual && actual.reportKey === expected.reportKey && "runId" in actual && actual.runId === expected.runId && "configVersion" in actual && actual.configVersion === expected.configVersion && "copyVersion" in actual && actual.copyVersion === expected.copyVersion;
|
|
21
|
+
return isSame;
|
|
22
|
+
};
|
|
23
|
+
var readModelProfile = (request) => {
|
|
24
|
+
if (typeof request !== "object" || request === null || !("modelProfile" in request)) {
|
|
25
|
+
return void 0;
|
|
26
|
+
}
|
|
27
|
+
return request.modelProfile;
|
|
28
|
+
};
|
|
29
|
+
var assertPublishable = (options) => {
|
|
30
|
+
const { triple, receipt, run, artifact, config, copy } = options;
|
|
31
|
+
const restoringPublication = sameTriple(options.priorPublication, triple);
|
|
32
|
+
if (!sameTriple(receipt, triple) || receipt.checkerVersion !== copyCheckerVersion || receipt.valid !== true || typeof receipt.approvedBy !== "string" || !receipt.approvedBy.trim()) {
|
|
33
|
+
throw new StoreConflictError(
|
|
34
|
+
"Publication requires current validation and approval of the exact run/config/copy triple"
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
if (run?.reportKey !== triple.reportKey || run.status !== "completed" || run.configVersion !== triple.configVersion || !artifact?.fullScope || artifact.configVersion !== triple.configVersion) {
|
|
38
|
+
throw new StoreConflictError(
|
|
39
|
+
"Publication requires a completed, full-scope run of the selected config"
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (run.deletedAt) {
|
|
43
|
+
throw new StoreConflictError(
|
|
44
|
+
`Please restore deleted run '${triple.runId}' before publishing it.`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
if (!config || !copy || config.reportKey !== triple.reportKey || copy.reportKey !== triple.reportKey || config.version !== triple.configVersion || copy.version !== triple.copyVersion || config.status !== "approved" && !(restoringPublication && config.status === "superseded") || copy.status !== "approved" && !(restoringPublication && copy.status === "superseded")) {
|
|
48
|
+
throw new StoreConflictError(
|
|
49
|
+
"Publication requires approved config and copy versions belonging to this report"
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
if (copy.source !== "agent" && copy.basisRunId !== triple.runId) {
|
|
53
|
+
throw new StoreConflictError(
|
|
54
|
+
"Human copy must be explicitly reviewed for this run"
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
const pinned = readModelProfile(run.request);
|
|
59
|
+
if (!pinned) {
|
|
60
|
+
throw new Error("Pinned verifier profile is missing.");
|
|
61
|
+
}
|
|
62
|
+
assertCopyValidation({
|
|
63
|
+
copy: copy.copy,
|
|
64
|
+
provenance: copy.provenance,
|
|
65
|
+
receipt: copy.validation,
|
|
66
|
+
config: config.config,
|
|
67
|
+
configVersion: triple.configVersion,
|
|
68
|
+
snapshot: aeoSnapshotSchema.parse(artifact.snapshot),
|
|
69
|
+
runId: triple.runId,
|
|
70
|
+
grounding: artifact.grounding,
|
|
71
|
+
verifierProfile: internalModelProfileSchema.parse(pinned).roles.premiseVerifier
|
|
72
|
+
});
|
|
73
|
+
} catch (error) {
|
|
74
|
+
throw new StoreConflictError(
|
|
75
|
+
"Publication requires current copy validation bound to the stored grounding, source passages, assessments and model profile",
|
|
76
|
+
{ cause: error }
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
const publishable = { run, artifact, config, copy };
|
|
80
|
+
return publishable;
|
|
81
|
+
};
|
|
82
|
+
var isCurrentValidation = (value) => {
|
|
83
|
+
return typeof value === "object" && value !== null && "checkerVersion" in value && value.checkerVersion === copyCheckerVersion && "valid" in value && value.valid === true;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
sameTriple,
|
|
88
|
+
assertPublishable,
|
|
89
|
+
isCurrentValidation
|
|
90
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isRecord
|
|
3
|
+
} from "./chunk-7PLK6VGC.js";
|
|
4
|
+
import {
|
|
5
|
+
surfaceRetrievalExposure
|
|
6
|
+
} from "./chunk-HXHFMFQU.js";
|
|
7
|
+
|
|
8
|
+
// src/probes/chat-retrieval.ts
|
|
9
|
+
var stringOr = (value, fallback) => {
|
|
10
|
+
return typeof value === "string" ? value : fallback;
|
|
11
|
+
};
|
|
12
|
+
var partsOf = (steps) => {
|
|
13
|
+
return steps.flatMap((step) => step.content.filter(isRecord));
|
|
14
|
+
};
|
|
15
|
+
var extractOpenAiRetrieval = (steps) => {
|
|
16
|
+
const calls = [];
|
|
17
|
+
for (const part of partsOf(steps)) {
|
|
18
|
+
if (part.type !== "tool-result" || part.toolName !== "web_search") {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
const output = isRecord(part.output) ? part.output : {};
|
|
22
|
+
const action = isRecord(output.action) ? output.action : {};
|
|
23
|
+
const sources = Array.isArray(output.sources) ? output.sources : [];
|
|
24
|
+
const sourceUrls = sources.flatMap(
|
|
25
|
+
(source) => isRecord(source) && source.type === "url" && typeof source.url === "string" ? [source.url] : []
|
|
26
|
+
);
|
|
27
|
+
if (action.type === "search") {
|
|
28
|
+
const query = stringOr(action.query, "");
|
|
29
|
+
calls.push({
|
|
30
|
+
kind: "search",
|
|
31
|
+
query,
|
|
32
|
+
url: null,
|
|
33
|
+
resultUrls: sourceUrls,
|
|
34
|
+
resultsComplete: false
|
|
35
|
+
});
|
|
36
|
+
const extraQueries = Array.isArray(action.queries) ? action.queries : [];
|
|
37
|
+
for (const extra of extraQueries) {
|
|
38
|
+
if (typeof extra !== "string" || !extra || extra === query) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
calls.push({
|
|
42
|
+
kind: "search",
|
|
43
|
+
query: extra,
|
|
44
|
+
url: null,
|
|
45
|
+
resultUrls: null,
|
|
46
|
+
resultsComplete: false
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
} else if (action.type === "openPage" || action.type === "findInPage") {
|
|
50
|
+
const url = stringOr(action.url, "");
|
|
51
|
+
calls.push({
|
|
52
|
+
kind: action.type === "openPage" ? "open_page" : "find_in_page",
|
|
53
|
+
query: null,
|
|
54
|
+
url,
|
|
55
|
+
// The opened page itself plus whatever the model cited from it.
|
|
56
|
+
resultUrls: [.../* @__PURE__ */ new Set([...url ? [url] : [], ...sourceUrls])],
|
|
57
|
+
resultsComplete: false
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return { exposure: surfaceRetrievalExposure.chatgpt, calls };
|
|
62
|
+
};
|
|
63
|
+
var extractAnthropicRetrieval = (steps) => {
|
|
64
|
+
const calls = [];
|
|
65
|
+
const callIndexById = /* @__PURE__ */ new Map();
|
|
66
|
+
for (const part of partsOf(steps)) {
|
|
67
|
+
if (part.toolName !== "web_search") {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const input = isRecord(part.input) ? part.input : {};
|
|
71
|
+
const callId = stringOr(part.toolCallId, "");
|
|
72
|
+
if (part.type === "tool-call") {
|
|
73
|
+
const index = calls.push({
|
|
74
|
+
kind: "search",
|
|
75
|
+
query: stringOr(input.query, ""),
|
|
76
|
+
url: null,
|
|
77
|
+
resultUrls: null,
|
|
78
|
+
resultsComplete: true
|
|
79
|
+
}) - 1;
|
|
80
|
+
if (callId) {
|
|
81
|
+
callIndexById.set(callId, index);
|
|
82
|
+
}
|
|
83
|
+
} else if (part.type === "tool-result") {
|
|
84
|
+
let index = callId ? callIndexById.get(callId) : void 0;
|
|
85
|
+
index ??= calls.push({
|
|
86
|
+
kind: "search",
|
|
87
|
+
query: stringOr(input.query, ""),
|
|
88
|
+
url: null,
|
|
89
|
+
resultUrls: null,
|
|
90
|
+
resultsComplete: true
|
|
91
|
+
}) - 1;
|
|
92
|
+
const call = calls[index];
|
|
93
|
+
if (!call) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
call.resultUrls = Array.isArray(part.output) ? part.output.flatMap(
|
|
97
|
+
(item) => isRecord(item) && typeof item.url === "string" ? [item.url] : []
|
|
98
|
+
) : null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return { exposure: surfaceRetrievalExposure.claude, calls };
|
|
102
|
+
};
|
|
103
|
+
var getGroundingProvider = (meta) => {
|
|
104
|
+
if (isRecord(meta.google)) {
|
|
105
|
+
return meta.google;
|
|
106
|
+
}
|
|
107
|
+
if (isRecord(meta.vertex)) {
|
|
108
|
+
return meta.vertex;
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
};
|
|
112
|
+
var extractGeminiRetrieval = (providerMetadata) => {
|
|
113
|
+
const meta = isRecord(providerMetadata) ? providerMetadata : {};
|
|
114
|
+
const provider = getGroundingProvider(meta);
|
|
115
|
+
const grounding = provider ? provider.groundingMetadata : null;
|
|
116
|
+
const queries = isRecord(grounding) ? grounding.webSearchQueries : null;
|
|
117
|
+
const calls = (Array.isArray(queries) ? queries : []).filter(
|
|
118
|
+
(query) => typeof query === "string" && query.length > 0
|
|
119
|
+
).map((query) => ({
|
|
120
|
+
kind: "search",
|
|
121
|
+
query,
|
|
122
|
+
url: null,
|
|
123
|
+
resultUrls: null,
|
|
124
|
+
resultsComplete: true
|
|
125
|
+
}));
|
|
126
|
+
return { exposure: surfaceRetrievalExposure.gemini, calls };
|
|
127
|
+
};
|
|
128
|
+
var retrievalResultUrls = (retrieval) => {
|
|
129
|
+
return retrieval.calls.flatMap((call) => call.resultUrls ?? []);
|
|
130
|
+
};
|
|
131
|
+
var rewriteRetrievalUrls = (retrieval, resolved) => {
|
|
132
|
+
if (resolved.size === 0) {
|
|
133
|
+
return retrieval;
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
exposure: retrieval.exposure,
|
|
137
|
+
calls: retrieval.calls.map(
|
|
138
|
+
(call) => call.resultUrls ? {
|
|
139
|
+
...call,
|
|
140
|
+
resultUrls: call.resultUrls.map((url) => resolved.get(url) ?? url)
|
|
141
|
+
} : call
|
|
142
|
+
)
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
export {
|
|
147
|
+
extractOpenAiRetrieval,
|
|
148
|
+
extractAnthropicRetrieval,
|
|
149
|
+
extractGeminiRetrieval,
|
|
150
|
+
retrievalResultUrls,
|
|
151
|
+
rewriteRetrievalUrls
|
|
152
|
+
};
|
|
File without changes
|