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,11 @@
|
|
|
1
|
+
import type { RunPlan } from '../../runner';
|
|
2
|
+
import type { RunRequest } from '../../schema';
|
|
3
|
+
import type { CaptureArtifact } from './artifacts';
|
|
4
|
+
/**
|
|
5
|
+
* Coverage shortfalls of a capture against the plan's surfaces and the
|
|
6
|
+
* admitted thresholds, plus every section that failed outright. The capture
|
|
7
|
+
* step treats a non-empty list as a transient, resumable provider condition
|
|
8
|
+
* (codex-workflow/capture.ts): the next attempt reuses the banked captures
|
|
9
|
+
* and probes only the missing units.
|
|
10
|
+
*/
|
|
11
|
+
export declare const captureCoverageIssues: (capture: Pick<CaptureArtifact, "sections" | "failedSections">, surfaces: RunPlan["surfaces"], thresholds: RunRequest["coverageThresholds"]) => string[];
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { AdmissionManifest, ApprovedRunManifest, ArtifactRef, DispatchMode, ExecutionState, MeasurementStart } from './contracts';
|
|
2
|
+
import type { HarnessPolicy } from './policy';
|
|
3
|
+
export type HarnessOwner = {
|
|
4
|
+
batchJobId: string;
|
|
5
|
+
attempt: number;
|
|
6
|
+
};
|
|
7
|
+
export type HarnessFence = {
|
|
8
|
+
executionId: string;
|
|
9
|
+
generation: number;
|
|
10
|
+
owner: HarnessOwner;
|
|
11
|
+
};
|
|
12
|
+
export type HarnessExecution = {
|
|
13
|
+
executionId: string;
|
|
14
|
+
pipelineId: string | null;
|
|
15
|
+
reportKey: string;
|
|
16
|
+
operationKey: string;
|
|
17
|
+
mode: DispatchMode;
|
|
18
|
+
manifests: {
|
|
19
|
+
admission: ArtifactRef;
|
|
20
|
+
approvedRun: ArtifactRef | null;
|
|
21
|
+
measurementStart: ArtifactRef | null;
|
|
22
|
+
/** The current checkpoint index; null until the first save advances it. */
|
|
23
|
+
checkpoint: ArtifactRef | null;
|
|
24
|
+
};
|
|
25
|
+
policy: HarnessPolicy;
|
|
26
|
+
state: ExecutionState;
|
|
27
|
+
generation: number;
|
|
28
|
+
owner: HarnessOwner | null;
|
|
29
|
+
leaseExpiresAt: string | null;
|
|
30
|
+
heartbeatAt: string | null;
|
|
31
|
+
cancelRequestedAt: string | null;
|
|
32
|
+
deadlineAt: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
};
|
|
36
|
+
export type ClaimResult = {
|
|
37
|
+
status: 'missing';
|
|
38
|
+
} | {
|
|
39
|
+
status: 'terminal';
|
|
40
|
+
execution: HarnessExecution;
|
|
41
|
+
} | {
|
|
42
|
+
status: 'lease_held';
|
|
43
|
+
execution: HarnessExecution;
|
|
44
|
+
leaseExpiresAt: string;
|
|
45
|
+
}
|
|
46
|
+
/** An older Batch attempt can never take over from a newer one. */
|
|
47
|
+
| {
|
|
48
|
+
status: 'superseded';
|
|
49
|
+
execution: HarnessExecution;
|
|
50
|
+
} | {
|
|
51
|
+
status: 'claimed';
|
|
52
|
+
execution: HarnessExecution;
|
|
53
|
+
fence: HarnessFence;
|
|
54
|
+
};
|
|
55
|
+
export declare class HarnessFencedError extends Error {
|
|
56
|
+
constructor(message?: string);
|
|
57
|
+
}
|
|
58
|
+
export declare class HarnessCancelledError extends Error {
|
|
59
|
+
constructor();
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* HarnessShutdownError means the host process is going away (SIGTERM, a Batch
|
|
63
|
+
* replacement, a lost lease). Not an operator decision: the execution stays
|
|
64
|
+
* `running` for the next attempt to resume from the banked captures.
|
|
65
|
+
*/
|
|
66
|
+
export declare class HarnessShutdownError extends Error {
|
|
67
|
+
constructor(message?: string);
|
|
68
|
+
}
|
|
69
|
+
export declare class HarnessIntegrityError extends Error {
|
|
70
|
+
constructor(message: string);
|
|
71
|
+
}
|
|
72
|
+
export declare class HarnessConflictError extends Error {
|
|
73
|
+
readonly conflict: 'terminal' | 'state';
|
|
74
|
+
constructor(conflict: 'terminal' | 'state', message: string);
|
|
75
|
+
}
|
|
76
|
+
export declare const artifactByteLimit: number;
|
|
77
|
+
export type HarnessStore = {
|
|
78
|
+
create(input: {
|
|
79
|
+
executionId: string;
|
|
80
|
+
pipelineId: string | null;
|
|
81
|
+
reportKey: string;
|
|
82
|
+
operationKey: string;
|
|
83
|
+
mode: DispatchMode;
|
|
84
|
+
policy: HarnessPolicy;
|
|
85
|
+
deadlineAt: string;
|
|
86
|
+
admission: AdmissionManifest;
|
|
87
|
+
}): Promise<HarnessExecution>;
|
|
88
|
+
get(executionId: string): Promise<HarnessExecution | null>;
|
|
89
|
+
findByOperationKey(operationKey: string): Promise<HarnessExecution | null>;
|
|
90
|
+
claim(executionId: string, owner: HarnessOwner): Promise<ClaimResult>;
|
|
91
|
+
heartbeat(fence: HarnessFence): Promise<{
|
|
92
|
+
cancelRequested: boolean;
|
|
93
|
+
}>;
|
|
94
|
+
requestCancel(executionId: string): Promise<void>;
|
|
95
|
+
/** Moves the state; a block or a completion also releases the lease so
|
|
96
|
+
* the next attempt, or the operator, need not wait it out. */
|
|
97
|
+
transition(fence: HarnessFence, state: ExecutionState): Promise<void>;
|
|
98
|
+
/** Admission's re-entry for a copy pass: a completed execution goes back
|
|
99
|
+
* to running at the copy stage, ownerless, so the next report job claims
|
|
100
|
+
* it and rewrites the copy over the committed run. Already reopened is a
|
|
101
|
+
* no-op; anything else refuses. */
|
|
102
|
+
reopenForCopy(executionId: string): Promise<void>;
|
|
103
|
+
pinApprovedRun(fence: HarnessFence, manifest: ApprovedRunManifest): Promise<ArtifactRef>;
|
|
104
|
+
pinMeasurementStart(fence: HarnessFence, manifest: MeasurementStart): Promise<ArtifactRef>;
|
|
105
|
+
readArtifact(executionId: string, ref: ArtifactRef): Promise<unknown>;
|
|
106
|
+
readCheckpoint(executionId: string): Promise<{
|
|
107
|
+
scope: string;
|
|
108
|
+
files: Record<string, string>;
|
|
109
|
+
} | null>;
|
|
110
|
+
/** Saves immutable file chunks first, under no lock, then advances the
|
|
111
|
+
* checkpoint index under the fence in one short transaction, so a large
|
|
112
|
+
* save never holds the execution row past a heartbeat or a claim. A null
|
|
113
|
+
* entry removes an obsolete file; concurrent batches merge their patches. */
|
|
114
|
+
saveCheckpoint(fence: HarnessFence, scope: string, files: Readonly<Record<string, string | null>>): Promise<void>;
|
|
115
|
+
};
|
|
116
|
+
export declare const artifactId: (kind: ArtifactRef["kind"], digest: string) => string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AeoBrand } from '../schema';
|
|
2
|
+
export type AnalyzerIdentity = {
|
|
3
|
+
brand: AeoBrand;
|
|
4
|
+
competitors: AeoBrand[];
|
|
5
|
+
};
|
|
6
|
+
export declare const codepointCompare: (a: string, b: string) => number;
|
|
7
|
+
export declare const brandIdentityHash: (identity: AnalyzerIdentity) => string;
|
|
8
|
+
export declare const perceptionKey: (args: {
|
|
9
|
+
sectionKey: string;
|
|
10
|
+
identity: AnalyzerIdentity;
|
|
11
|
+
productBrief: string;
|
|
12
|
+
answers: ReadonlyArray<{
|
|
13
|
+
surface: string;
|
|
14
|
+
runIndex: number;
|
|
15
|
+
promptIdx: number;
|
|
16
|
+
text: string;
|
|
17
|
+
}>;
|
|
18
|
+
perceptionVersion: number;
|
|
19
|
+
modelProfileDigest?: string;
|
|
20
|
+
}) => string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** JSONB can reorder object keys; persisted receipts must hash values, not order. */
|
|
2
|
+
export declare const canonicalJson: (value: unknown) => string;
|
|
3
|
+
/**
|
|
4
|
+
* strictCanonicalJson is the public canonicalization of audit bundles
|
|
5
|
+
* (specs/aeo-open-source-cli-spec.md §8.1): canonicalJson's bytes on every
|
|
6
|
+
* valid JSON value, with a refusal where canonicalJson silently rewrites
|
|
7
|
+
* (a non-finite number becomes null, an undefined array element an invalid
|
|
8
|
+
* empty slot, a Date or Map an empty object). Keys sort by UTF-16 code
|
|
9
|
+
* units, array order is kept, there is no whitespace.
|
|
10
|
+
*/
|
|
11
|
+
export declare const strictCanonicalJson: (value: unknown, at?: string) => string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AeoPrompt, AeoSurface, AgentProbeConfig } from '../schema';
|
|
2
|
+
import type { CheckpointMatch, ProbeUnit } from '../stores/ports';
|
|
3
|
+
export type { CapturedUnitRecord, CheckpointMatch, CheckpointProbe, FailedUnitRecord, ProbeUnit, UnitRecord, } from '../stores/ports';
|
|
4
|
+
/** Key without the prompt text: section | surface | prompt id | run index. */
|
|
5
|
+
export declare const probeUnitKey: (unit: {
|
|
6
|
+
sectionKey: string;
|
|
7
|
+
surface: AeoSurface;
|
|
8
|
+
promptId: string;
|
|
9
|
+
runIndex: number;
|
|
10
|
+
}) => string;
|
|
11
|
+
export declare const promptTextHash: (promptText: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Storage key of a unit record (§4.2): the unit key plus a hash of the
|
|
14
|
+
* prompt text, so an edited prompt is a miss by construction and a
|
|
15
|
+
* redelivered capture of the same unit collides.
|
|
16
|
+
*/
|
|
17
|
+
export declare const unitRecordKey: (unit: ProbeUnit) => string;
|
|
18
|
+
/**
|
|
19
|
+
* The probe units a run plans for one section: chat surfaces cover every
|
|
20
|
+
* prompt at the canonical run counts; agent surfaces follow the config's
|
|
21
|
+
* agentProbes volume. Mirrors the pipeline's fan-out exactly — the planned
|
|
22
|
+
* set is both the resume scope and the scoring denominator.
|
|
23
|
+
*/
|
|
24
|
+
export declare const plannedProbeUnitsForSection: (args: {
|
|
25
|
+
sectionKey: string;
|
|
26
|
+
prompts: AeoPrompt[];
|
|
27
|
+
surfaces: readonly AeoSurface[];
|
|
28
|
+
agentProbes: AgentProbeConfig;
|
|
29
|
+
}) => ProbeUnit[];
|
|
30
|
+
export declare const entryMatches: (entry: {
|
|
31
|
+
sectionKey: string;
|
|
32
|
+
surface: AeoSurface;
|
|
33
|
+
}, match: CheckpointMatch) => boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* readEnv returns an environment variable as set, or undefined when it is
|
|
3
|
+
* not set. An empty string stays an empty string.
|
|
4
|
+
*/
|
|
5
|
+
export declare const readEnv: (name: string) => string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* getEnvironment returns the whole environment, for code that hands it to a
|
|
8
|
+
* child process or copies selected keys from it.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getEnvironment: () => NodeJS.ProcessEnv;
|
|
11
|
+
/**
|
|
12
|
+
* writeEnv sets an environment variable for this process and its children,
|
|
13
|
+
* or removes it when `value` is undefined.
|
|
14
|
+
*/
|
|
15
|
+
export declare const writeEnv: (name: string, value: string | undefined) => void;
|
|
16
|
+
/**
|
|
17
|
+
* requireEnv returns a non-empty environment variable, or throws when it is
|
|
18
|
+
* missing or empty. `message` replaces the default error text.
|
|
19
|
+
*/
|
|
20
|
+
export declare const requireEnv: (name: string, message?: string) => string;
|
|
21
|
+
export type RequiredEnvVar = {
|
|
22
|
+
name: string;
|
|
23
|
+
purpose: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* assertEnvVars is the fail-fast gate for the runner: it checks every
|
|
27
|
+
* required variable and throws ONE error listing everything that is missing,
|
|
28
|
+
* before any probe is sent or money is spent. Callers decide which variables
|
|
29
|
+
* a given run needs.
|
|
30
|
+
*/
|
|
31
|
+
export declare const assertEnvVars: (required: readonly RequiredEnvVar[]) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
2
|
+
type LogFields = Record<string, unknown>;
|
|
3
|
+
export declare const createLog: (component: string) => {
|
|
4
|
+
/** debug logs verbose detail, shown on the console only with AEO_DEBUG=1. */
|
|
5
|
+
debug(message: string, fields?: LogFields): void;
|
|
6
|
+
info(message: string, fields?: LogFields): void;
|
|
7
|
+
warn(message: string, fields?: LogFields): void;
|
|
8
|
+
error(message: string, error?: unknown, fields?: LogFields): void;
|
|
9
|
+
};
|
|
10
|
+
export type Log = ReturnType<typeof createLog>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../report/core/progress-comparison';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../report/core/report-presentation';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* isObject accepts any non-null object, arrays included. It narrows untyped
|
|
3
|
+
* JSON before its fields are read one by one.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* isRecord accepts a non-null object that is not an array: a JSON object.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { Sql } from 'postgres';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare const modelBudgetLimitsSchema: z.ZodObject<{
|
|
4
|
+
maxUsd: z.ZodNumber;
|
|
5
|
+
maxTokens: z.ZodNumber;
|
|
6
|
+
deadlineAt: z.ZodString;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export type ModelBudgetLimits = z.infer<typeof modelBudgetLimitsSchema>;
|
|
9
|
+
declare const callSchema: z.ZodObject<{
|
|
10
|
+
requestedModel: z.ZodOptional<z.ZodString>;
|
|
11
|
+
reasoningEffort: z.ZodOptional<z.ZodString>;
|
|
12
|
+
profileDigest: z.ZodOptional<z.ZodString>;
|
|
13
|
+
callId: z.ZodString;
|
|
14
|
+
role: z.ZodString;
|
|
15
|
+
reservedUsd: z.ZodNumber;
|
|
16
|
+
inputTokens: z.ZodNumber;
|
|
17
|
+
maxOutputTokens: z.ZodNumber;
|
|
18
|
+
minRemainingUsd: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
minRemainingTokens: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export type ModelCallReservation = z.infer<typeof callSchema>;
|
|
22
|
+
export type ModelCallUsage = {
|
|
23
|
+
requestedModel?: string;
|
|
24
|
+
resolvedModel?: string;
|
|
25
|
+
reasoningEffort?: string;
|
|
26
|
+
durationMs?: number;
|
|
27
|
+
costUsd?: number;
|
|
28
|
+
inputTokens?: number;
|
|
29
|
+
outputTokens?: number;
|
|
30
|
+
cachedInputTokens?: number;
|
|
31
|
+
reasoningTokens?: number;
|
|
32
|
+
requestId?: string;
|
|
33
|
+
finishReason?: string;
|
|
34
|
+
/**
|
|
35
|
+
* False when the provider billed the call but produced no usable answer (a
|
|
36
|
+
* refused gateway credit, an answer nothing parsed). Absent means the call
|
|
37
|
+
* completed; a mandatory obligation is discharged only then.
|
|
38
|
+
*/
|
|
39
|
+
valid?: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type LedgerCall = ModelCallReservation & {
|
|
42
|
+
usage?: ModelCallUsage;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* chargedCall returns what a call charges the ledger: its settled usage once
|
|
46
|
+
* both token counts are known, otherwise its reservation. An indeterminate call
|
|
47
|
+
* keeps its reservation until an attempt settles it.
|
|
48
|
+
*/
|
|
49
|
+
export declare const chargedCall: (call: LedgerCall) => {
|
|
50
|
+
usd: number;
|
|
51
|
+
tokens: number;
|
|
52
|
+
};
|
|
53
|
+
export declare const chargedTotal: (calls: Iterable<LedgerCall>) => {
|
|
54
|
+
usd: number;
|
|
55
|
+
tokens: number;
|
|
56
|
+
};
|
|
57
|
+
/** What a host model call sent and what came back, exactly as the
|
|
58
|
+
* application supplied and received it (specs/aeo-open-source-cli-spec.md
|
|
59
|
+
* §7.1). Never headers or credentials: those are not application input. */
|
|
60
|
+
export type ModelCallEvidence = {
|
|
61
|
+
kind: 'request';
|
|
62
|
+
system: string | null;
|
|
63
|
+
prompt: string;
|
|
64
|
+
/** The output schema as JSON Schema; null when it has none. */
|
|
65
|
+
schema: unknown;
|
|
66
|
+
role: unknown;
|
|
67
|
+
images: readonly {
|
|
68
|
+
id: string;
|
|
69
|
+
bytes: Uint8Array;
|
|
70
|
+
}[];
|
|
71
|
+
} | {
|
|
72
|
+
kind: 'response';
|
|
73
|
+
payload: unknown;
|
|
74
|
+
text: string | null;
|
|
75
|
+
valid: boolean;
|
|
76
|
+
};
|
|
77
|
+
export type ModelCallAccounting = {
|
|
78
|
+
readonly deadlineAt?: string;
|
|
79
|
+
reserve(call: ModelCallReservation): Promise<void>;
|
|
80
|
+
assertOwned(): Promise<void>;
|
|
81
|
+
settle(callId: string, usage: ModelCallUsage): Promise<void>;
|
|
82
|
+
/** Present when the run records its execution: the request before
|
|
83
|
+
* dispatch, the response before settlement. A failure stops the call. */
|
|
84
|
+
observe?(callId: string, evidence: ModelCallEvidence): Promise<void>;
|
|
85
|
+
};
|
|
86
|
+
export type ModelBudgetOwner = {
|
|
87
|
+
kind: 'agent';
|
|
88
|
+
jobId: string;
|
|
89
|
+
batchJobId: string;
|
|
90
|
+
attempt: number;
|
|
91
|
+
} | {
|
|
92
|
+
kind: 'run';
|
|
93
|
+
runId: string;
|
|
94
|
+
batchJobId?: string;
|
|
95
|
+
attempt?: number;
|
|
96
|
+
} | {
|
|
97
|
+
kind: 'workflow';
|
|
98
|
+
pipelineId: string;
|
|
99
|
+
runId: string;
|
|
100
|
+
configVersion: number;
|
|
101
|
+
copyVersion: number;
|
|
102
|
+
} | {
|
|
103
|
+
kind: 'operator';
|
|
104
|
+
runId: string;
|
|
105
|
+
reportKey: string;
|
|
106
|
+
} | {
|
|
107
|
+
kind: 'harness_copy';
|
|
108
|
+
executionId: string;
|
|
109
|
+
generation: number;
|
|
110
|
+
batchJobId: string;
|
|
111
|
+
attempt: number;
|
|
112
|
+
runId: string;
|
|
113
|
+
};
|
|
114
|
+
type BudgetState = {
|
|
115
|
+
limits: ModelBudgetLimits;
|
|
116
|
+
calls: Record<string, LedgerCall>;
|
|
117
|
+
};
|
|
118
|
+
type ModelBudgetErrorKind = 'exhausted' | 'deadline' | 'integrity' | 'ownership';
|
|
119
|
+
export declare class ModelBudgetError extends Error {
|
|
120
|
+
readonly kind: ModelBudgetErrorKind;
|
|
121
|
+
constructor(message: string, kind?: ModelBudgetErrorKind);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* validateModelBudgetState lets retry admission preserve the ledger only after
|
|
125
|
+
* validating its original pins.
|
|
126
|
+
*/
|
|
127
|
+
export declare const validateModelBudgetState: (raw: unknown, limits: ModelBudgetLimits) => void;
|
|
128
|
+
export declare const createMemoryModelAccounting: (limits: ModelBudgetLimits, now?: () => number) => ModelCallAccounting & {
|
|
129
|
+
state: BudgetState;
|
|
130
|
+
};
|
|
131
|
+
export declare const createFileModelAccounting: (args: {
|
|
132
|
+
filename: string;
|
|
133
|
+
limits: ModelBudgetLimits;
|
|
134
|
+
assertOwned: () => Promise<void>;
|
|
135
|
+
}) => ModelCallAccounting;
|
|
136
|
+
/**
|
|
137
|
+
* createPostgresModelAccounting charges the pipeline budget for every job; a
|
|
138
|
+
* standalone run owns its own budget.
|
|
139
|
+
*/
|
|
140
|
+
export declare const createPostgresModelAccounting: (args: {
|
|
141
|
+
sql: Sql;
|
|
142
|
+
owner: ModelBudgetOwner;
|
|
143
|
+
pipelineId?: string;
|
|
144
|
+
runId?: string;
|
|
145
|
+
limits: ModelBudgetLimits;
|
|
146
|
+
}) => ModelCallAccounting;
|
|
147
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { InternalModelRoleConfig } from './profiles';
|
|
3
|
+
/**
|
|
4
|
+
* batchModelInputs bounds complete requests, including escaped data and
|
|
5
|
+
* schema, before dispatch.
|
|
6
|
+
*/
|
|
7
|
+
export declare const batchModelInputs: <T>(args: {
|
|
8
|
+
items: readonly T[];
|
|
9
|
+
role: InternalModelRoleConfig;
|
|
10
|
+
schema: z.ZodType;
|
|
11
|
+
system: string;
|
|
12
|
+
prompt: (items: T[], start: number) => string;
|
|
13
|
+
maxItems?: number;
|
|
14
|
+
}) => Array<{
|
|
15
|
+
items: T[];
|
|
16
|
+
start: number;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModelCallAccounting } from './accounting';
|
|
2
|
+
import type { InternalModelProfile } from './profiles';
|
|
3
|
+
/**
|
|
4
|
+
* withModelBudgetProtection checks every reservation atomically against the
|
|
5
|
+
* shared budget, including calls already pending in other workers. Optional
|
|
6
|
+
* work cannot spend the money needed for one final copy, its verifier, and its
|
|
7
|
+
* pending claim adjudication. Repairs consume the same allocation and must
|
|
8
|
+
* leave the next verifier funded.
|
|
9
|
+
*/
|
|
10
|
+
export declare const withModelBudgetProtection: (accounting: ModelCallAccounting, profile: InternalModelProfile) => ModelCallAccounting;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModelCallAccounting } from './accounting';
|
|
2
|
+
import type { InternalModelProfile } from './profiles';
|
|
3
|
+
import type { StructuredTransport } from './structured';
|
|
4
|
+
export type InternalModelContext = {
|
|
5
|
+
profile: InternalModelProfile;
|
|
6
|
+
accounting: ModelCallAccounting;
|
|
7
|
+
transport?: StructuredTransport;
|
|
8
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** What one round produced for the items it was asked about. */
|
|
2
|
+
export type CoverageRoundAnswers<Answer> = {
|
|
3
|
+
/** Sound answers, keyed by the item's position in `items`. */
|
|
4
|
+
answered: Iterable<readonly [index: number, answer: Answer]>;
|
|
5
|
+
/** Items the model reported on but the host refused. They stay pending,
|
|
6
|
+
* and the round counts as progress because a refusal is evidence the
|
|
7
|
+
* model can address the item at all. */
|
|
8
|
+
refused?: Iterable<number>;
|
|
9
|
+
};
|
|
10
|
+
export type CoverageRoundReport = {
|
|
11
|
+
round: number;
|
|
12
|
+
/** Items this round asked about. */
|
|
13
|
+
asked: number;
|
|
14
|
+
/** Items this round answered soundly. */
|
|
15
|
+
added: number;
|
|
16
|
+
/** Items this round reported on and the host refused. */
|
|
17
|
+
refused: number;
|
|
18
|
+
/** Items still without an answer after this round. */
|
|
19
|
+
pending: number;
|
|
20
|
+
};
|
|
21
|
+
export type AskUntilCoveredArgs<Item, Answer> = {
|
|
22
|
+
/** The whole batch, in prompt order; answers are keyed by position here. */
|
|
23
|
+
items: readonly Item[];
|
|
24
|
+
/** Answers settled before the first round, from an earlier attempt or a
|
|
25
|
+
* cache; never asked about again. Answers are merged into this same map
|
|
26
|
+
* as they arrive, which is what keeps them when `ask` throws. */
|
|
27
|
+
answered?: Map<number, Answer>;
|
|
28
|
+
/** The most rounds to ask, the first included. */
|
|
29
|
+
maxRounds: number;
|
|
30
|
+
/** One call over the items still pending, each with its position in
|
|
31
|
+
* `items` so the prompt can keep whatever numbering its contract names. */
|
|
32
|
+
ask: (pending: ReadonlyArray<{
|
|
33
|
+
index: number;
|
|
34
|
+
item: Item;
|
|
35
|
+
}>, round: number) => Promise<CoverageRoundAnswers<Answer>>;
|
|
36
|
+
/** Observability, called after every round. */
|
|
37
|
+
onRound?: (report: CoverageRoundReport) => void;
|
|
38
|
+
};
|
|
39
|
+
export type AskUntilCoveredResult<Answer> = {
|
|
40
|
+
/** The caller's map, or a fresh one, with every sound answer. */
|
|
41
|
+
answered: Map<number, Answer>;
|
|
42
|
+
/** Positions in `items` still without an answer. */
|
|
43
|
+
pending: number[];
|
|
44
|
+
/** Rounds actually asked. */
|
|
45
|
+
rounds: number;
|
|
46
|
+
};
|
|
47
|
+
export declare const askUntilCovered: <Item, Answer>(args: AskUntilCoveredArgs<Item, Answer>) => Promise<AskUntilCoveredResult<Answer>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type ModelCallAbortReason = 'deadline' | 'cancelled';
|
|
2
|
+
/**
|
|
3
|
+
* ModelCallAbortError keeps the host's abort decision separate from provider
|
|
4
|
+
* failures. A provider may wrap a host abort as HTTP 500, and callers must not
|
|
5
|
+
* mistake it for a transient provider failure.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ModelCallAbortError extends Error {
|
|
8
|
+
readonly reason: ModelCallAbortReason;
|
|
9
|
+
constructor(reason: ModelCallAbortReason, cause: unknown);
|
|
10
|
+
}
|
|
11
|
+
export declare const assertModelCallActive: (signal: AbortSignal, cause?: unknown) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type FailureClassification = 'timeout' | 'abort' | 'schema' | 'outputlimit' | 'provider' | 'unclassified';
|
|
2
|
+
/** Only allowlisted labels and a numeric HTTP status can leave an error object. */
|
|
3
|
+
export declare const structuredFailureDiagnostic: (error: unknown, signal?: AbortSignal) => {
|
|
4
|
+
classification: FailureClassification;
|
|
5
|
+
errorClass: string;
|
|
6
|
+
httpStatus?: number;
|
|
7
|
+
};
|
|
8
|
+
export {};
|