literally-aeo 0.1.0 → 0.2.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/README.md +42 -6
- package/dist/author-tools.js +33 -64
- package/dist/cli.mjs +2723 -1616
- package/dist/lib/agents/author-schema.js +4 -5
- package/dist/lib/agents/author-validation.js +5 -6
- package/dist/lib/agents/copy-validation.js +4 -5
- package/dist/lib/agents/verifier.js +8 -8
- package/dist/lib/analysis/domain-classifier.js +8 -8
- package/dist/lib/analysis/domain-labels.js +3 -4
- package/dist/lib/analysis/progress.js +3 -4
- package/dist/lib/analysis/sentiment.js +8 -8
- package/dist/lib/author/examples.js +5 -6
- package/dist/lib/bundle/contracts.js +5 -6
- package/dist/lib/bundle/export.js +22 -19
- package/dist/lib/bundle/isolation.js +17 -0
- package/dist/lib/bundle/journal.js +6 -7
- package/dist/lib/bundle/project-journal.js +11 -10
- package/dist/lib/bundle/project.js +19 -16
- package/dist/lib/bundle/read.js +23 -20
- package/dist/lib/bundle/recorder.js +9 -8
- package/dist/lib/bundle/redact.js +6 -7
- package/dist/lib/bundle/trace-coverage.js +6 -7
- package/dist/lib/bundle/verify-integrity.js +8 -9
- package/dist/lib/bundle/verify-measurement.js +10 -11
- package/dist/lib/bundle/verify-report.js +11 -12
- package/dist/lib/bundle/verify.js +17 -18
- package/dist/lib/bundle/writer-lock.js +3 -1
- package/dist/lib/capture-manifest.js +3 -4
- package/dist/lib/checks/run-checks.js +10 -9
- package/dist/lib/chunks/chunk-2B5QF6UQ.js +159 -0
- package/dist/lib/chunks/{chunk-4US3OBKJ.js → chunk-2GU6CNQI.js} +12 -7
- package/dist/lib/chunks/{chunk-AWOJWMPN.js → chunk-2ROXN2EC.js} +42 -7
- package/dist/lib/chunks/{chunk-XHWRSGX3.js → chunk-3JO5TXBA.js} +1 -1
- package/dist/lib/chunks/{chunk-5GZVDGTX.js → chunk-4PD65FRJ.js} +7 -3
- package/dist/lib/chunks/{chunk-P4K6BP3L.js → chunk-5JPYM4MD.js} +1 -1
- package/dist/lib/chunks/{chunk-5VNYUCLL.js → chunk-622NMXN6.js} +6 -9
- package/dist/lib/chunks/{chunk-4ZY6P5SO.js → chunk-663HABKP.js} +5 -5
- package/dist/lib/chunks/{chunk-RMFT4KKK.js → chunk-6G25V4CF.js} +1 -1
- package/dist/lib/chunks/{chunk-GVC4LH2N.js → chunk-6GHHNPFJ.js} +1 -1
- package/dist/lib/chunks/{chunk-KMRQSIZW.js → chunk-6GOBBNDU.js} +16 -1
- package/dist/lib/chunks/{chunk-SBAZBOPI.js → chunk-6P7EZJI7.js} +4 -2
- package/dist/lib/chunks/chunk-7XO3SQAX.js +117 -0
- package/dist/lib/chunks/{chunk-M2OD74GP.js → chunk-7Z27HQWL.js} +3 -3
- package/dist/lib/chunks/{chunk-IPNK7FYT.js → chunk-AYY4MYTW.js} +1 -1
- package/dist/lib/chunks/{chunk-WDSCJEDG.js → chunk-BE4ENGUY.js} +10 -10
- package/dist/lib/chunks/{chunk-FKLNEB2P.js → chunk-BGOIPHJZ.js} +39 -11
- package/dist/lib/chunks/{chunk-7GXRDAUY.js → chunk-BLKLPUYR.js} +2 -2
- package/dist/lib/chunks/chunk-BSRKN6FU.js +93 -0
- package/dist/lib/chunks/{chunk-PCYNBDZ7.js → chunk-CO5T6WU5.js} +14 -9
- package/dist/lib/chunks/{chunk-BEQLSAVX.js → chunk-CUYVHXHI.js} +2 -2
- package/dist/lib/chunks/{chunk-RBOO4NDG.js → chunk-D3GE3OCB.js} +1 -1
- package/dist/lib/chunks/chunk-DVFFYY5G.js +74 -0
- package/dist/lib/chunks/{chunk-5H3SNUQT.js → chunk-EBUQPCKB.js} +1 -1
- package/dist/lib/chunks/{chunk-4E4NDGOZ.js → chunk-EE26FNSY.js} +1 -1
- package/dist/lib/chunks/{chunk-AUB5THIS.js → chunk-EJ655TVU.js} +1 -1
- package/dist/lib/chunks/{chunk-S2AM76LT.js → chunk-F4W5YHDZ.js} +2 -2
- package/dist/lib/chunks/chunk-FAUFE7MI.js +31 -0
- package/dist/lib/chunks/{chunk-2KJZ326K.js → chunk-FOCJ7HPC.js} +7 -7
- package/dist/lib/chunks/{chunk-OL746E4T.js → chunk-FUAUPNRO.js} +26 -18
- package/dist/lib/chunks/{chunk-J6IJGYP5.js → chunk-G62E525I.js} +2 -2
- package/dist/lib/chunks/{chunk-2NJEWPCV.js → chunk-GDKGZQ3T.js} +2 -2
- package/dist/lib/chunks/{chunk-HSZ3DM74.js → chunk-GEFKDW7X.js} +15 -2
- package/dist/lib/chunks/{chunk-CS24IL3K.js → chunk-GESHTTSA.js} +2 -2
- package/dist/lib/chunks/chunk-GNMFJ2OK.js +321 -0
- package/dist/lib/chunks/{chunk-H3G3VTT7.js → chunk-HFRAHG5C.js} +44 -26
- package/dist/lib/chunks/{chunk-MHAKYFDF.js → chunk-HQG63ZKO.js} +11 -11
- package/dist/lib/chunks/{chunk-OORO55OM.js → chunk-HTOD4W4E.js} +21 -6
- package/dist/lib/chunks/{chunk-Q2PWES4B.js → chunk-I3XGRGXE.js} +1 -1
- package/dist/lib/chunks/{chunk-WUELMJ22.js → chunk-IE7NAL6B.js} +1 -1
- package/dist/lib/chunks/{chunk-KRFHQQS7.js → chunk-JXMDOAKA.js} +17 -17
- package/dist/lib/chunks/{chunk-S7KJZIUR.js → chunk-KJMU5KH4.js} +2 -2
- package/dist/lib/chunks/{chunk-2ROSV4HD.js → chunk-L7MEIRJB.js} +1 -1
- package/dist/lib/chunks/{chunk-CPT2GKKW.js → chunk-LOBXOZ2R.js} +1 -1
- package/dist/lib/chunks/{chunk-IAR6XGEW.js → chunk-ML4W6KC6.js} +1 -1
- package/dist/lib/chunks/{chunk-WKH6BJAZ.js → chunk-MNWO7EHC.js} +4 -4
- package/dist/lib/chunks/{chunk-D2LPQO6Y.js → chunk-MRL5RUP7.js} +1 -1
- package/dist/lib/chunks/{chunk-IEVAFDW7.js → chunk-NCXSNHXX.js} +3 -3
- package/dist/lib/chunks/{chunk-AKKFERA4.js → chunk-NGHAP2P5.js} +4 -4
- package/dist/lib/chunks/{chunk-ZLOOC46D.js → chunk-OKL7GN2F.js} +3 -3
- package/dist/lib/chunks/{chunk-YOZNLFSB.js → chunk-OQU5IXAJ.js} +5 -5
- package/dist/lib/chunks/{chunk-I7VNIW6Q.js → chunk-OU73OUX4.js} +16 -10
- package/dist/lib/chunks/{chunk-56VOFZ7T.js → chunk-QHUDJVPJ.js} +90 -24
- package/dist/lib/chunks/{chunk-WTQWU522.js → chunk-QSJ4IKUF.js} +9 -9
- package/dist/lib/chunks/{chunk-FBFZBLTY.js → chunk-R6XDZWUL.js} +7 -8
- package/dist/lib/chunks/{chunk-CJ5YD3CU.js → chunk-RJ5R6YYA.js} +5 -5
- package/dist/lib/chunks/{chunk-5EX5DKMA.js → chunk-RR46EDDR.js} +33 -25
- package/dist/lib/chunks/chunk-RYCRL3YA.js +106 -0
- package/dist/lib/chunks/{chunk-Z4LMDKBU.js → chunk-SHUMCKCS.js} +2 -2
- package/dist/lib/chunks/{chunk-3EBWDHPK.js → chunk-TJQ5OPLQ.js} +10 -12
- package/dist/lib/chunks/chunk-U64NCRRR.js +97 -0
- package/dist/lib/chunks/chunk-U772TN32.js +67 -0
- package/dist/lib/chunks/{chunk-YR67JG2V.js → chunk-UEMZYHYJ.js} +8 -3
- package/dist/lib/chunks/{chunk-J46W3EMQ.js → chunk-UZJSTJFP.js} +5 -5
- package/dist/lib/chunks/{chunk-XJVXASDD.js → chunk-V7OAPKNF.js} +3 -3
- package/dist/lib/chunks/{chunk-WE2WPNG2.js → chunk-VKM6MMA4.js} +66 -7
- package/dist/lib/chunks/{chunk-YWJPJI3W.js → chunk-VL253W5C.js} +3 -1
- package/dist/lib/chunks/{chunk-XU6WQ5UL.js → chunk-VPZQGND4.js} +3 -3
- package/dist/lib/chunks/{chunk-X2Y2ZNG3.js → chunk-W2VGLWTS.js} +3 -3
- package/dist/lib/chunks/{chunk-6AUEDSTU.js → chunk-W5DC23OP.js} +1 -1
- package/dist/lib/chunks/chunk-W5X7WJYL.js +91 -0
- package/dist/lib/chunks/{chunk-QFVRCSJ2.js → chunk-WDOA5JEH.js} +2 -0
- package/dist/lib/chunks/{chunk-6KO7HGCQ.js → chunk-WVACVWBL.js} +2 -2
- package/dist/lib/chunks/{chunk-MIF5IYNR.js → chunk-XDG6NPJB.js} +26 -29
- package/dist/lib/chunks/{chunk-X6E44EGV.js → chunk-XR44YSHT.js} +2 -2
- package/dist/lib/chunks/chunk-Y2CZ6FZY.js +61 -0
- package/dist/lib/chunks/{chunk-5KKLUM7M.js → chunk-YAAUWCJ4.js} +1 -1
- package/dist/lib/chunks/{chunk-N2ZZ6JRF.js → chunk-YRBIC5QH.js} +1 -1
- package/dist/lib/chunks/chunk-ZIGNJAPC.js +11 -0
- package/dist/lib/cli/bundle-commands.js +71 -65
- package/dist/lib/cli/guide-command.js +25 -0
- package/dist/lib/cli/io.js +1 -1
- package/dist/lib/cli/run-commands.js +270 -104
- package/dist/lib/cli/status-command.js +234 -0
- package/dist/lib/codex-workflow/aggregate.js +8 -9
- package/dist/lib/codex-workflow/author-tools.js +6 -7
- package/dist/lib/codex-workflow/author.js +17 -17
- package/dist/lib/codex-workflow/capture.js +10 -9
- package/dist/lib/codex-workflow/checkpoint.js +6 -7
- package/dist/lib/codex-workflow/checks.js +6 -7
- package/dist/lib/codex-workflow/codex-binary.js +13 -0
- package/dist/lib/codex-workflow/codex-home.js +6 -3
- package/dist/lib/codex-workflow/copy-editor.js +14 -14
- package/dist/lib/codex-workflow/copy-recovery.js +3 -4
- package/dist/lib/codex-workflow/copy.js +11 -11
- package/dist/lib/codex-workflow/finish.js +17 -18
- package/dist/lib/codex-workflow/host-models.js +7 -7
- package/dist/lib/codex-workflow/loop.js +42 -38
- package/dist/lib/codex-workflow/quality.js +3 -4
- package/dist/lib/codex-workflow/run-inputs.js +5 -6
- package/dist/lib/codex-workflow/run-source.js +14 -13
- package/dist/lib/codex-workflow/schemas.js +5 -6
- package/dist/lib/codex-workflow/session.js +7 -8
- package/dist/lib/codex-workflow/stage.js +26 -23
- package/dist/lib/codex-workflow/workdir.js +6 -7
- package/dist/lib/engine/audit-file.js +7 -6
- package/dist/lib/engine/author.js +37 -31
- package/dist/lib/engine/budget.js +7 -1
- package/dist/lib/engine/cost-estimate.js +41 -0
- package/dist/lib/engine/local-run.js +48 -42
- package/dist/lib/engine/preflight.js +10 -6
- package/dist/lib/engine/rejudge.js +56 -50
- package/dist/lib/engine/resources.js +1 -1
- package/dist/lib/engine/run-configuration.js +2 -1
- package/dist/lib/engine/run-status.js +151 -0
- package/dist/lib/engine/templates.js +8 -7
- package/dist/lib/grounding/controller.js +7 -7
- package/dist/lib/grounding/extract.js +6 -6
- package/dist/lib/grounding/grounding-runtime.js +18 -17
- package/dist/lib/grounding/model.js +5 -5
- package/dist/lib/grounding/recorded-tools.js +10 -9
- package/dist/lib/harness/report/artifacts.js +4 -5
- package/dist/lib/lib/checkpoint.js +3 -4
- package/dist/lib/models/batching.js +5 -5
- package/dist/lib/models/cost-coefficients.js +20 -0
- package/dist/lib/models/local-profile.js +10 -0
- package/dist/lib/models/pricing.js +6 -0
- package/dist/lib/models/profiles.js +7 -14
- package/dist/lib/models/structured-images.js +1 -1
- package/dist/lib/models/structured.js +4 -4
- package/dist/lib/models/supported-models.js +20 -0
- package/dist/lib/pipeline.js +9 -8
- package/dist/lib/probes/agent-cli-parsers.js +1 -1
- package/dist/lib/probes/agent-clis.js +6 -5
- package/dist/lib/probes/charged-trace.js +10 -0
- package/dist/lib/probes/probes.js +6 -6
- package/dist/lib/runner.js +10 -10
- package/dist/lib/schema.js +3 -4
- package/dist/lib/section-result.js +3 -4
- package/dist/lib/stores/artifacts.js +3 -4
- package/dist/lib/stores/files.js +9 -9
- package/dist/lib/stores/local-versions.js +4 -5
- package/dist/lib/stores/memory.js +6 -7
- package/dist/lib/stores/publication.js +5 -6
- package/dist/lib/viewer/server.js +18 -19
- package/dist/lib/workflow/schema.js +2 -3
- package/dist/types/agents/copy-validation.d.ts +4 -4
- package/dist/types/agents/verifier.d.ts +6 -6
- package/dist/types/bundle/contracts.d.ts +1 -1
- package/dist/types/bundle/isolation.d.ts +37 -0
- package/dist/types/bundle/project-journal.d.ts +2 -0
- package/dist/types/bundle/recorder.d.ts +4 -0
- package/dist/types/bundle/writer-lock.d.ts +9 -0
- package/dist/types/cli/guide-command.d.ts +4 -0
- package/dist/types/cli/status-command.d.ts +2 -0
- package/dist/types/codex-workflow/codex-binary.d.ts +26 -0
- package/dist/types/codex-workflow/codex-home.d.ts +24 -20
- package/dist/types/codex-workflow/copy-editor.d.ts +1 -1
- package/dist/types/codex-workflow/copy.d.ts +3 -4
- package/dist/types/codex-workflow/finish.d.ts +5 -3
- package/dist/types/codex-workflow/host-models.d.ts +7 -3
- package/dist/types/codex-workflow/loop.d.ts +10 -1
- package/dist/types/codex-workflow/run-inputs.d.ts +28 -113
- package/dist/types/codex-workflow/stage.d.ts +16 -5
- package/dist/types/engine/audit-file.d.ts +3 -2
- package/dist/types/engine/author.d.ts +7 -1
- package/dist/types/engine/budget.d.ts +46 -15
- package/dist/types/engine/cost-estimate.d.ts +40 -0
- package/dist/types/engine/local-run.d.ts +6 -0
- package/dist/types/engine/preflight.d.ts +5 -0
- package/dist/types/engine/resources.d.ts +2 -0
- package/dist/types/engine/run-configuration.d.ts +4 -3
- package/dist/types/engine/run-status.d.ts +75 -0
- package/dist/types/engine/templates.d.ts +1 -2
- package/dist/types/models/cost-coefficients.d.ts +106 -0
- package/dist/types/models/local-profile.d.ts +12 -0
- package/dist/types/models/pricing.d.ts +8 -0
- package/dist/types/models/profiles.d.ts +55 -160
- package/dist/types/models/served-model.d.ts +2 -3
- package/dist/types/models/structured.d.ts +3 -3
- package/dist/types/models/supported-models.d.ts +48 -0
- package/dist/types/probes/charged-trace.d.ts +8 -0
- package/dist/types/probes/probe-trace.d.ts +2 -0
- package/dist/types/schema.d.ts +28 -113
- package/dist/types/workflow/schema.d.ts +79 -152
- package/package.json +2 -1
- package/resources/guide/OPERATOR.md +180 -0
- package/src/agents/copy-validation.ts +8 -12
- package/src/agents/verifier.ts +10 -14
- package/src/bundle/contracts.ts +3 -3
- package/src/bundle/isolation.ts +157 -0
- package/src/bundle/project-journal.ts +4 -0
- package/src/bundle/project.ts +20 -7
- package/src/bundle/recorder.ts +5 -0
- package/src/bundle/writer-lock.ts +27 -0
- package/src/cli/guide-command.ts +28 -0
- package/src/cli/io.ts +2 -0
- package/src/cli/literally-aeo.ts +39 -19
- package/src/cli/run-commands.ts +236 -18
- package/src/cli/status-command.ts +113 -0
- package/src/codex-workflow/codex-binary.ts +105 -0
- package/src/codex-workflow/codex-home.ts +50 -40
- package/src/codex-workflow/copy.ts +7 -10
- package/src/codex-workflow/finish.ts +13 -8
- package/src/codex-workflow/host-models.ts +33 -24
- package/src/codex-workflow/loop.ts +36 -9
- package/src/codex-workflow/stage.ts +126 -17
- package/src/engine/audit-file.ts +10 -8
- package/src/engine/author.ts +47 -2
- package/src/engine/budget.ts +138 -43
- package/src/engine/cost-estimate.ts +178 -0
- package/src/engine/guide/OPERATOR.md +180 -0
- package/src/engine/local-run.ts +38 -8
- package/src/engine/preflight.ts +90 -7
- package/src/engine/resources.ts +9 -4
- package/src/engine/run-configuration.ts +19 -1
- package/src/engine/run-status.ts +452 -0
- package/src/engine/templates.ts +5 -2
- package/src/models/cost-coefficients.ts +140 -0
- package/src/models/local-profile.ts +150 -0
- package/src/models/pricing.ts +31 -0
- package/src/models/profiles.ts +58 -419
- package/src/models/served-model.ts +2 -3
- package/src/models/structured-images.ts +5 -4
- package/src/models/structured.ts +20 -7
- package/src/models/supported-models.ts +112 -0
- package/src/probes/agent-clis.ts +24 -2
- package/src/probes/charged-trace.ts +87 -0
- package/src/probes/probe-trace.ts +2 -0
- package/src/probes/probes.ts +48 -2
- package/dist/lib/chunks/chunk-CFFPOTP4.js +0 -356
- package/dist/lib/chunks/chunk-LIZX4N3H.js +0 -110
- package/dist/lib/chunks/chunk-OYKV5NDM.js +0 -28
package/README.md
CHANGED
|
@@ -5,12 +5,29 @@ mention you, cite you, and who they recommend instead. `literally-aeo` runs
|
|
|
5
5
|
the audit on your own machine with your own provider keys, and writes a
|
|
6
6
|
portable evidence bundle that anyone can verify offline.
|
|
7
7
|
|
|
8
|
+
## Ask Claude to run this for you
|
|
9
|
+
|
|
10
|
+
You don't need to be a developer. Open Claude Code (the terminal app, or
|
|
11
|
+
the Code tab of the Claude desktop app) and paste:
|
|
12
|
+
|
|
13
|
+
> Run an AEO audit for acme.example with github.com/literallydotdev/aeo.
|
|
14
|
+
> Install it and follow `literally-aeo guide`.
|
|
15
|
+
|
|
16
|
+
Claude installs what is missing, asks a few questions about your company,
|
|
17
|
+
and asks you to approve an amount before anything is spent; the run cannot
|
|
18
|
+
spend more than that. You paste your provider keys into a file in your own
|
|
19
|
+
editor, never into the chat. `literally-aeo guide` prints the protocol
|
|
20
|
+
Claude follows, checkpoint by checkpoint.
|
|
21
|
+
|
|
22
|
+
## Run it yourself
|
|
23
|
+
|
|
8
24
|
```sh
|
|
9
25
|
npm install -g literally-aeo
|
|
10
26
|
literally-aeo init # audit.json and .env.example
|
|
11
27
|
literally-aeo doctor --env-file .env # what a run needs, checked offline
|
|
12
|
-
literally-aeo plan # what a run would measure and cost
|
|
13
|
-
literally-aeo run --env-file .env
|
|
28
|
+
literally-aeo plan # what a run would measure, and its estimated cost
|
|
29
|
+
literally-aeo run --env-file .env --max-usd 50 # measure under a cap; run again to resume
|
|
30
|
+
literally-aeo status audit-run # phase, answers and spend, read-only
|
|
14
31
|
literally-aeo view audit-run # local, loopback-only viewer
|
|
15
32
|
literally-aeo export audit-run # a deterministic .aeo.zip bundle
|
|
16
33
|
literally-aeo verify audit-run.aeo.zip # offline verification
|
|
@@ -18,16 +35,35 @@ literally-aeo verify audit-run.aeo.zip # offline verification
|
|
|
18
35
|
|
|
19
36
|
## Requirements
|
|
20
37
|
|
|
21
|
-
- Node.js 24 or newer
|
|
22
|
-
Windows users run it under
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
- Node.js 24 or newer on Linux, where it is tested. macOS (Apple silicon)
|
|
39
|
+
is expected to work but is not tested in CI. Windows users run it under
|
|
40
|
+
WSL 2.
|
|
41
|
+
- Nothing else for the analysis and writing stages: the
|
|
42
|
+
[Codex CLI](https://github.com/openai/codex) that runs them is a pinned
|
|
43
|
+
dependency of the package.
|
|
25
44
|
- An `AI_GATEWAY_API_KEY` (Vercel AI Gateway) for the assistant answers and
|
|
26
45
|
the host model calls, and a DataForSEO login for Google AI Overviews and
|
|
27
46
|
factual grounding searches.
|
|
28
47
|
- For coding-agent surfaces, the CLI of each one you measure (Claude Code,
|
|
29
48
|
Codex, Cursor) and its own login.
|
|
30
49
|
|
|
50
|
+
## Model and cost
|
|
51
|
+
|
|
52
|
+
One model judges the answers, researches the claims and writes the report:
|
|
53
|
+
`"model"` in `audit.json`, a gateway model ID. Leave it out to use the
|
|
54
|
+
recommended model, the strongest the engine supports, because judgment and
|
|
55
|
+
writing quality are the report. `literally-aeo doctor` lists the supported
|
|
56
|
+
models with their list prices and refuses any other. The assistants being
|
|
57
|
+
measured keep their own pinned models; they are what the audit observes.
|
|
58
|
+
|
|
59
|
+
`literally-aeo plan` estimates what a run costs, as a range per kind of
|
|
60
|
+
work: the assistant answers, the analysis stages, the other model calls and
|
|
61
|
+
the searches. A run does not start without a cap you approve
|
|
62
|
+
(`--max-usd`), and the cap covers all of that work: the run stops,
|
|
63
|
+
resumable, before a call would cross it. A run keeps its model and its cap;
|
|
64
|
+
`rejudge --model` judges the same answers with another model in a new run
|
|
65
|
+
directory.
|
|
66
|
+
|
|
31
67
|
Nothing is sent to Literally.dev: no telemetry, no account, no upload.
|
|
32
68
|
A run contacts only the providers you configure and the sites it checks.
|
|
33
69
|
|
package/dist/author-tools.js
CHANGED
|
@@ -1584,60 +1584,34 @@ var coverageThresholdsSchema = z7.object({
|
|
|
1584
1584
|
|
|
1585
1585
|
// src/models/profiles.ts
|
|
1586
1586
|
import { z as z8 } from "zod";
|
|
1587
|
-
var internalModelProfileIdSchema = z8.
|
|
1588
|
-
"opus-grounding-v1",
|
|
1589
|
-
"astra-grounding-v1",
|
|
1590
|
-
"opus-harness-v1",
|
|
1591
|
-
"astra-harness-v1",
|
|
1592
|
-
// GLM 5.3 through the gateway for every text role, domain classification
|
|
1593
|
-
// included, and Kimi K3 for logo discovery. An evaluation profile, not
|
|
1594
|
-
// the default.
|
|
1595
|
-
"glm-harness-v1",
|
|
1596
|
-
// DeepSeek V4.1 Flash through the gateway for every text role, Kimi K3
|
|
1597
|
-
// for logo discovery. The profile every admission pins (codexRunnerProfile).
|
|
1598
|
-
"deepseek-harness-v1",
|
|
1599
|
-
// The same bulk roles on DeepSeek, with the premise verifier on Opus:
|
|
1600
|
-
// schema compliance and reasoning quality where a refused verdict costs a
|
|
1601
|
-
// copy generation (2026-09-12).
|
|
1602
|
-
"deepseek-harness-v2"
|
|
1603
|
-
]);
|
|
1587
|
+
var internalModelProfileIdSchema = z8.string().min(1);
|
|
1604
1588
|
var generationBackendSchema = z8.enum([
|
|
1605
1589
|
"claude_code",
|
|
1606
1590
|
"codex",
|
|
1607
1591
|
"gateway"
|
|
1608
1592
|
]);
|
|
1593
|
+
var modelPricingSchema = z8.object({
|
|
1594
|
+
input: z8.number().positive(),
|
|
1595
|
+
output: z8.number().positive(),
|
|
1596
|
+
cachedInput: z8.number().nonnegative()
|
|
1597
|
+
}).strict();
|
|
1609
1598
|
var internalModelRoleSchema = z8.object({
|
|
1610
|
-
model
|
|
1611
|
-
|
|
1612
|
-
"openai/gpt-6-astra",
|
|
1613
|
-
"zai/glm-5.3",
|
|
1614
|
-
"moonshotai/kimi-k3",
|
|
1615
|
-
"deepseek/deepseek-v4.1-flash",
|
|
1616
|
-
"anthropic/claude-opus-5"
|
|
1617
|
-
]),
|
|
1599
|
+
/** The gateway model ID, such as `anthropic/claude-opus-5.5`. */
|
|
1600
|
+
model: z8.string().min(1),
|
|
1618
1601
|
providerOptions: z8.object({
|
|
1619
1602
|
openai: z8.object({ reasoningEffort: z8.literal("high") }).strict().optional(),
|
|
1620
|
-
/** Ask
|
|
1621
|
-
*
|
|
1622
|
-
* keeps a long generation inside the gateway's limits. A token
|
|
1623
|
-
* budget is deliberately NOT sent: GLM ignores it (measured). */
|
|
1603
|
+
/** Ask a reasoning model to think hard. A token budget is not
|
|
1604
|
+
* sent: not every provider honours one. */
|
|
1624
1605
|
gateway: z8.object({
|
|
1625
1606
|
reasoning: z8.union([
|
|
1626
1607
|
z8.object({ effort: z8.literal("high") }).strict(),
|
|
1627
|
-
/**
|
|
1628
|
-
*
|
|
1629
|
-
* a stored profile must keep parsing and dispatching exactly as
|
|
1630
|
-
* admitted. */
|
|
1608
|
+
/** Accepted so that a stored profile keeps parsing and
|
|
1609
|
+
* dispatching exactly as admitted; never built any more. */
|
|
1631
1610
|
z8.object({ max_tokens: z8.number().int().positive() }).strict()
|
|
1632
1611
|
]),
|
|
1633
|
-
/** The gateway
|
|
1634
|
-
*
|
|
1635
|
-
*
|
|
1636
|
-
* for GLM 5.3 dropped the schema and every structured call
|
|
1637
|
-
* failed as `StructuredOutputMissingError`, while `baseten`
|
|
1638
|
-
* and `fireworks` answered in a second. The pinned routes are
|
|
1639
|
-
* the ones probed to return objects; the gateway still balances
|
|
1640
|
-
* among them. Absent on profiles pinned before the routing pin. */
|
|
1612
|
+
/** The gateway upstream routes a role is restricted to, when
|
|
1613
|
+
* not every route of an open-weight model returns structured
|
|
1614
|
+
* output. Absent leaves routing to the gateway. */
|
|
1641
1615
|
only: z8.array(z8.string().min(1)).min(1).max(12).optional()
|
|
1642
1616
|
}).strict().optional()
|
|
1643
1617
|
}).strict(),
|
|
@@ -1646,15 +1620,19 @@ var internalModelRoleSchema = z8.object({
|
|
|
1646
1620
|
deadlineMs: z8.number().int().positive(),
|
|
1647
1621
|
maxInputTokens: z8.number().int().positive().max(1e5),
|
|
1648
1622
|
maxOutputTokens: z8.number().int().positive(),
|
|
1649
|
-
/** How many items one batched call may carry, when the
|
|
1650
|
-
*
|
|
1651
|
-
*
|
|
1623
|
+
/** How many items one batched call may carry, when the model wants a
|
|
1624
|
+
* narrower batch than the call site's own default. Absent leaves that
|
|
1625
|
+
* default. */
|
|
1652
1626
|
maxItemsPerCall: z8.number().int().positive().optional(),
|
|
1653
|
-
pricingUsdPerMillion:
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1627
|
+
pricingUsdPerMillion: modelPricingSchema
|
|
1628
|
+
}).strict();
|
|
1629
|
+
var codexStageModelSchema = z8.object({
|
|
1630
|
+
model: z8.string().min(1),
|
|
1631
|
+
reasoningEffort: z8.enum(["medium", "high", "xhigh"]),
|
|
1632
|
+
/** The context window Codex must be told: it has no metadata for
|
|
1633
|
+
* gateway models and otherwise compacts a session at its own default. */
|
|
1634
|
+
contextWindow: z8.number().int().positive(),
|
|
1635
|
+
pricingUsdPerMillion: modelPricingSchema
|
|
1658
1636
|
}).strict();
|
|
1659
1637
|
var researchSearchProviderSchema = z8.enum([
|
|
1660
1638
|
"disabled",
|
|
@@ -1677,25 +1655,16 @@ var internalModelProfileSchema = z8.object({
|
|
|
1677
1655
|
// Missing on stored profiles: optional enrichment never rewrites pins.
|
|
1678
1656
|
logoDiscovery: internalModelRoleSchema.optional(),
|
|
1679
1657
|
competitorClassifier: internalModelRoleSchema.optional(),
|
|
1680
|
-
/** Retired roles, still accepted so profiles
|
|
1681
|
-
*
|
|
1682
|
-
* the model-backed visual review (11 September 2026), the scrutiny
|
|
1683
|
-
* and repair-planner roles with the journaled harness loop
|
|
1684
|
-
* (13 September 2026). No new profile resolves them. */
|
|
1658
|
+
/** Retired roles, still accepted so stored profiles parse unchanged
|
|
1659
|
+
* on resume. No new profile resolves them. */
|
|
1685
1660
|
scrutiny: internalModelRoleSchema.optional(),
|
|
1686
1661
|
repairPlanner: internalModelRoleSchema.optional(),
|
|
1687
1662
|
visualReviewer: internalModelRoleSchema.optional()
|
|
1688
|
-
}).strict()
|
|
1663
|
+
}).strict(),
|
|
1664
|
+
/** The Codex stages' model. Absent on profiles pinned before the stage
|
|
1665
|
+
* model became part of the profile; their host supplies it. */
|
|
1666
|
+
stages: codexStageModelSchema.optional()
|
|
1689
1667
|
}).strict();
|
|
1690
|
-
var reasoningOutputFamilies = [
|
|
1691
|
-
"glm",
|
|
1692
|
-
"kimi",
|
|
1693
|
-
"deepseek"
|
|
1694
|
-
];
|
|
1695
|
-
var thinkingInOutputFamilies = [
|
|
1696
|
-
...reasoningOutputFamilies,
|
|
1697
|
-
"opus5"
|
|
1698
|
-
];
|
|
1699
1668
|
|
|
1700
1669
|
// src/models/accounting.ts
|
|
1701
1670
|
import { z as z9 } from "zod";
|