literally-aeo 0.1.1 → 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-ZBDUE3A5.js → chunk-2GU6CNQI.js} +12 -7
- package/dist/lib/chunks/{chunk-CKUTDJAB.js → chunk-2ROXN2EC.js} +42 -7
- package/dist/lib/chunks/{chunk-XHWRSGX3.js → chunk-3JO5TXBA.js} +1 -1
- package/dist/lib/chunks/{chunk-XL4JIQ5X.js → chunk-4PD65FRJ.js} +7 -3
- package/dist/lib/chunks/{chunk-GMKF2FU4.js → chunk-5JPYM4MD.js} +1 -1
- package/dist/lib/chunks/{chunk-5VNYUCLL.js → chunk-622NMXN6.js} +6 -9
- package/dist/lib/chunks/{chunk-XNRSHATN.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-SWS3K62X.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-E3OEE5XN.js → chunk-CUYVHXHI.js} +2 -2
- package/dist/lib/chunks/{chunk-2GY42RIJ.js → chunk-D3GE3OCB.js} +1 -1
- package/dist/lib/chunks/chunk-DVFFYY5G.js +74 -0
- package/dist/lib/chunks/{chunk-ZXGATMMH.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-FNDJUELJ.js → chunk-FOCJ7HPC.js} +7 -7
- package/dist/lib/chunks/{chunk-FPAN3VRW.js → chunk-FUAUPNRO.js} +26 -18
- package/dist/lib/chunks/{chunk-OQVIRYT5.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-47IZBMP2.js → chunk-GESHTTSA.js} +2 -2
- package/dist/lib/chunks/chunk-GNMFJ2OK.js +321 -0
- package/dist/lib/chunks/{chunk-NVBMIPXR.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-POUSX3T4.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-HFOYASRQ.js → chunk-NGHAP2P5.js} +4 -4
- package/dist/lib/chunks/{chunk-ZLOOC46D.js → chunk-OKL7GN2F.js} +3 -3
- package/dist/lib/chunks/{chunk-3DG7GHFA.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-KHU5DRBE.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-LPND3VNQ.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-MD4AVTK2.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-I3TMFPK4.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-3KQFLOC7.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
|
@@ -312,15 +312,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
312
312
|
}>>;
|
|
313
313
|
configVersion: z.ZodOptional<z.ZodNumber>;
|
|
314
314
|
modelProfile: z.ZodOptional<z.ZodObject<{
|
|
315
|
-
id: z.
|
|
316
|
-
"opus-grounding-v1": "opus-grounding-v1";
|
|
317
|
-
"astra-grounding-v1": "astra-grounding-v1";
|
|
318
|
-
"opus-harness-v1": "opus-harness-v1";
|
|
319
|
-
"astra-harness-v1": "astra-harness-v1";
|
|
320
|
-
"glm-harness-v1": "glm-harness-v1";
|
|
321
|
-
"deepseek-harness-v1": "deepseek-harness-v1";
|
|
322
|
-
"deepseek-harness-v2": "deepseek-harness-v2";
|
|
323
|
-
}>;
|
|
315
|
+
id: z.ZodString;
|
|
324
316
|
version: z.ZodLiteral<1>;
|
|
325
317
|
pricingCheckedAt: z.ZodISODate;
|
|
326
318
|
searchProvider: z.ZodEnum<{
|
|
@@ -329,14 +321,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
329
321
|
}>;
|
|
330
322
|
roles: z.ZodObject<{
|
|
331
323
|
analyzer: z.ZodObject<{
|
|
332
|
-
model: z.
|
|
333
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
334
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
335
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
336
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
337
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
338
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
339
|
-
}>;
|
|
324
|
+
model: z.ZodString;
|
|
340
325
|
providerOptions: z.ZodObject<{
|
|
341
326
|
openai: z.ZodOptional<z.ZodObject<{
|
|
342
327
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -363,14 +348,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
363
348
|
}, z.core.$strict>;
|
|
364
349
|
}, z.core.$strict>;
|
|
365
350
|
perception: z.ZodObject<{
|
|
366
|
-
model: z.
|
|
367
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
368
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
369
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
370
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
371
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
372
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
373
|
-
}>;
|
|
351
|
+
model: z.ZodString;
|
|
374
352
|
providerOptions: z.ZodObject<{
|
|
375
353
|
openai: z.ZodOptional<z.ZodObject<{
|
|
376
354
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -397,14 +375,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
397
375
|
}, z.core.$strict>;
|
|
398
376
|
}, z.core.$strict>;
|
|
399
377
|
research: z.ZodObject<{
|
|
400
|
-
model: z.
|
|
401
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
402
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
403
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
404
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
405
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
406
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
407
|
-
}>;
|
|
378
|
+
model: z.ZodString;
|
|
408
379
|
providerOptions: z.ZodObject<{
|
|
409
380
|
openai: z.ZodOptional<z.ZodObject<{
|
|
410
381
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -431,14 +402,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
431
402
|
}, z.core.$strict>;
|
|
432
403
|
}, z.core.$strict>;
|
|
433
404
|
adjudication: z.ZodObject<{
|
|
434
|
-
model: z.
|
|
435
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
436
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
437
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
438
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
439
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
440
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
441
|
-
}>;
|
|
405
|
+
model: z.ZodString;
|
|
442
406
|
providerOptions: z.ZodObject<{
|
|
443
407
|
openai: z.ZodOptional<z.ZodObject<{
|
|
444
408
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -465,14 +429,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
465
429
|
}, z.core.$strict>;
|
|
466
430
|
}, z.core.$strict>;
|
|
467
431
|
premiseVerifier: z.ZodObject<{
|
|
468
|
-
model: z.
|
|
469
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
470
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
471
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
472
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
473
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
474
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
475
|
-
}>;
|
|
432
|
+
model: z.ZodString;
|
|
476
433
|
providerOptions: z.ZodObject<{
|
|
477
434
|
openai: z.ZodOptional<z.ZodObject<{
|
|
478
435
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -499,14 +456,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
499
456
|
}, z.core.$strict>;
|
|
500
457
|
}, z.core.$strict>;
|
|
501
458
|
author: z.ZodObject<{
|
|
502
|
-
model: z.
|
|
503
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
504
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
505
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
506
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
507
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
508
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
509
|
-
}>;
|
|
459
|
+
model: z.ZodString;
|
|
510
460
|
providerOptions: z.ZodObject<{
|
|
511
461
|
openai: z.ZodOptional<z.ZodObject<{
|
|
512
462
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -533,14 +483,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
533
483
|
}, z.core.$strict>;
|
|
534
484
|
}, z.core.$strict>;
|
|
535
485
|
copy: z.ZodObject<{
|
|
536
|
-
model: z.
|
|
537
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
538
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
539
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
540
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
541
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
542
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
543
|
-
}>;
|
|
486
|
+
model: z.ZodString;
|
|
544
487
|
providerOptions: z.ZodObject<{
|
|
545
488
|
openai: z.ZodOptional<z.ZodObject<{
|
|
546
489
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -567,14 +510,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
567
510
|
}, z.core.$strict>;
|
|
568
511
|
}, z.core.$strict>;
|
|
569
512
|
domainClassifier: z.ZodObject<{
|
|
570
|
-
model: z.
|
|
571
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
572
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
573
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
574
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
575
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
576
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
577
|
-
}>;
|
|
513
|
+
model: z.ZodString;
|
|
578
514
|
providerOptions: z.ZodObject<{
|
|
579
515
|
openai: z.ZodOptional<z.ZodObject<{
|
|
580
516
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -601,14 +537,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
601
537
|
}, z.core.$strict>;
|
|
602
538
|
}, z.core.$strict>;
|
|
603
539
|
logoDiscovery: z.ZodOptional<z.ZodObject<{
|
|
604
|
-
model: z.
|
|
605
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
606
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
607
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
608
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
609
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
610
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
611
|
-
}>;
|
|
540
|
+
model: z.ZodString;
|
|
612
541
|
providerOptions: z.ZodObject<{
|
|
613
542
|
openai: z.ZodOptional<z.ZodObject<{
|
|
614
543
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -635,14 +564,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
635
564
|
}, z.core.$strict>;
|
|
636
565
|
}, z.core.$strict>>;
|
|
637
566
|
competitorClassifier: z.ZodOptional<z.ZodObject<{
|
|
638
|
-
model: z.
|
|
639
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
640
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
641
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
642
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
643
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
644
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
645
|
-
}>;
|
|
567
|
+
model: z.ZodString;
|
|
646
568
|
providerOptions: z.ZodObject<{
|
|
647
569
|
openai: z.ZodOptional<z.ZodObject<{
|
|
648
570
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -669,14 +591,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
669
591
|
}, z.core.$strict>;
|
|
670
592
|
}, z.core.$strict>>;
|
|
671
593
|
scrutiny: z.ZodOptional<z.ZodObject<{
|
|
672
|
-
model: z.
|
|
673
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
674
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
675
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
676
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
677
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
678
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
679
|
-
}>;
|
|
594
|
+
model: z.ZodString;
|
|
680
595
|
providerOptions: z.ZodObject<{
|
|
681
596
|
openai: z.ZodOptional<z.ZodObject<{
|
|
682
597
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -703,14 +618,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
703
618
|
}, z.core.$strict>;
|
|
704
619
|
}, z.core.$strict>>;
|
|
705
620
|
repairPlanner: z.ZodOptional<z.ZodObject<{
|
|
706
|
-
model: z.
|
|
707
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
708
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
709
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
710
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
711
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
712
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
713
|
-
}>;
|
|
621
|
+
model: z.ZodString;
|
|
714
622
|
providerOptions: z.ZodObject<{
|
|
715
623
|
openai: z.ZodOptional<z.ZodObject<{
|
|
716
624
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -737,14 +645,7 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
737
645
|
}, z.core.$strict>;
|
|
738
646
|
}, z.core.$strict>>;
|
|
739
647
|
visualReviewer: z.ZodOptional<z.ZodObject<{
|
|
740
|
-
model: z.
|
|
741
|
-
"anthropic/claude-opus-4.6": "anthropic/claude-opus-4.6";
|
|
742
|
-
"openai/gpt-6-astra": "openai/gpt-6-astra";
|
|
743
|
-
"zai/glm-5.3": "zai/glm-5.3";
|
|
744
|
-
"moonshotai/kimi-k3": "moonshotai/kimi-k3";
|
|
745
|
-
"deepseek/deepseek-v4.1-flash": "deepseek/deepseek-v4.1-flash";
|
|
746
|
-
"anthropic/claude-opus-5": "anthropic/claude-opus-5";
|
|
747
|
-
}>;
|
|
648
|
+
model: z.ZodString;
|
|
748
649
|
providerOptions: z.ZodObject<{
|
|
749
650
|
openai: z.ZodOptional<z.ZodObject<{
|
|
750
651
|
reasoningEffort: z.ZodLiteral<"high">;
|
|
@@ -771,6 +672,20 @@ export declare const runInputsSchema: z.ZodObject<{
|
|
|
771
672
|
}, z.core.$strict>;
|
|
772
673
|
}, z.core.$strict>>;
|
|
773
674
|
}, z.core.$strict>;
|
|
675
|
+
stages: z.ZodOptional<z.ZodObject<{
|
|
676
|
+
model: z.ZodString;
|
|
677
|
+
reasoningEffort: z.ZodEnum<{
|
|
678
|
+
high: "high";
|
|
679
|
+
medium: "medium";
|
|
680
|
+
xhigh: "xhigh";
|
|
681
|
+
}>;
|
|
682
|
+
contextWindow: z.ZodNumber;
|
|
683
|
+
pricingUsdPerMillion: z.ZodObject<{
|
|
684
|
+
input: z.ZodNumber;
|
|
685
|
+
output: z.ZodNumber;
|
|
686
|
+
cachedInput: z.ZodNumber;
|
|
687
|
+
}, z.core.$strict>;
|
|
688
|
+
}, z.core.$strict>>;
|
|
774
689
|
}, z.core.$strict>>;
|
|
775
690
|
modelBudget: z.ZodOptional<z.ZodObject<{
|
|
776
691
|
maxUsd: z.ZodNumber;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { CopyValidationOutcome } from '../agents/copy-validation';
|
|
2
2
|
import type { AeoBrand } from '../schema';
|
|
3
3
|
import type { ExecutionRecorder } from '../bundle/recorder';
|
|
4
|
+
import type { ModelCallAccounting } from '../models/accounting';
|
|
5
|
+
import type { CodexStageModel } from '../models/profiles';
|
|
4
6
|
import { type StageValue } from './checks';
|
|
5
7
|
import { type ResearchServerConfig } from './codex-home';
|
|
6
8
|
import { type Correction, type StageName } from './schemas';
|
|
7
9
|
import type { AnswerFile } from './workdir';
|
|
8
10
|
import type { BatchLayout } from './batch-layout';
|
|
11
|
+
/** Tokens a Codex session reported: cached input is part of input. */
|
|
12
|
+
export type SessionUsage = {
|
|
13
|
+
inputTokens: number;
|
|
14
|
+
cachedInputTokens: number;
|
|
15
|
+
outputTokens: number;
|
|
16
|
+
};
|
|
9
17
|
export type StageRun = {
|
|
10
18
|
stage: StageName;
|
|
11
19
|
model: string;
|
|
@@ -13,10 +21,7 @@ export type StageRun = {
|
|
|
13
21
|
* `degraded` and their answers carry no judgment from this stage. */
|
|
14
22
|
ok: boolean;
|
|
15
23
|
durationMs: number;
|
|
16
|
-
usage:
|
|
17
|
-
inputTokens: number;
|
|
18
|
-
outputTokens: number;
|
|
19
|
-
} | null;
|
|
24
|
+
usage: SessionUsage | null;
|
|
20
25
|
errors: string[];
|
|
21
26
|
/** Answer files whose batch never validated: excluded from this stage
|
|
22
27
|
* and every later one, recorded, never a reason to stop the run. */
|
|
@@ -41,7 +46,13 @@ export type StageContext = {
|
|
|
41
46
|
ownedDomains?: readonly string[];
|
|
42
47
|
/** The host stopping the work: sessions are killed and no batch starts. */
|
|
43
48
|
signal?: AbortSignal;
|
|
44
|
-
/**
|
|
49
|
+
/** The model every session runs on (the run's pinned stage model). */
|
|
50
|
+
stageModel: CodexStageModel;
|
|
51
|
+
/** The run's ledger: every session is reserved before it starts and
|
|
52
|
+
* settled from its reported tokens. Absent, sessions are not charged. */
|
|
53
|
+
accounting?: ModelCallAccounting;
|
|
54
|
+
/** Overrides for tests: the command to run instead of the engine's own
|
|
55
|
+
* Codex. */
|
|
45
56
|
command?: string;
|
|
46
57
|
timeoutMs?: number;
|
|
47
58
|
/** Answers per Codex session; the default fits the pinned model. */
|
|
@@ -27,13 +27,14 @@ export declare const runPolicySchema: z.ZodObject<{
|
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
allowPartial: z.ZodDefault<z.ZodBoolean>;
|
|
29
29
|
budget: z.ZodPrefault<z.ZodObject<{
|
|
30
|
-
maxUsd: z.
|
|
30
|
+
maxUsd: z.ZodOptional<z.ZodNumber>;
|
|
31
31
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
32
32
|
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
33
33
|
}, z.core.$strict>>;
|
|
34
34
|
}, z.core.$strict>;
|
|
35
35
|
export declare const auditFileSchema: z.ZodObject<{
|
|
36
36
|
version: z.ZodLiteral<1>;
|
|
37
|
+
model: z.ZodOptional<z.ZodString>;
|
|
37
38
|
brand: z.ZodObject<{
|
|
38
39
|
name: z.ZodString;
|
|
39
40
|
domain: z.ZodString;
|
|
@@ -102,7 +103,7 @@ export declare const auditFileSchema: z.ZodObject<{
|
|
|
102
103
|
}, z.core.$strip>>;
|
|
103
104
|
allowPartial: z.ZodDefault<z.ZodBoolean>;
|
|
104
105
|
budget: z.ZodPrefault<z.ZodObject<{
|
|
105
|
-
maxUsd: z.
|
|
106
|
+
maxUsd: z.ZodOptional<z.ZodNumber>;
|
|
106
107
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
107
108
|
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
108
109
|
}, z.core.$strict>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { readAuthorResearch, type AuthorBrief } from '../codex-workflow/author';
|
|
3
|
+
import type { SupportedModel } from '../models/supported-models';
|
|
3
4
|
import { type AuditFile, type AuthorReference } from './audit-file';
|
|
4
5
|
declare const authorRecordSchema: z.ZodObject<{
|
|
5
6
|
version: z.ZodLiteral<1>;
|
|
@@ -17,10 +18,15 @@ export type LocalAuthorResult = {
|
|
|
17
18
|
auditFile: string | undefined;
|
|
18
19
|
research: Awaited<ReturnType<typeof readAuthorResearch>>['summary'];
|
|
19
20
|
};
|
|
20
|
-
/** runLocalAuthor runs the author session over a brief into `dir
|
|
21
|
+
/** runLocalAuthor runs the author session over a brief into `dir`, on
|
|
22
|
+
* `model`, under the approved cap: the draft directory's ledger reserves
|
|
23
|
+
* the research tools' whole search allowance before the session, and the
|
|
24
|
+
* session itself, so neither can take the run past the cap. */
|
|
21
25
|
export declare const runLocalAuthor: (args: {
|
|
22
26
|
brief: AuthorBrief;
|
|
23
27
|
dir: string;
|
|
28
|
+
model: SupportedModel;
|
|
29
|
+
maxUsd: number;
|
|
24
30
|
secrets: readonly string[];
|
|
25
31
|
signal?: AbortSignal;
|
|
26
32
|
}) => Promise<LocalAuthorResult>;
|
|
@@ -1,43 +1,53 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { ModelBudgetLimits } from '../models/accounting';
|
|
3
3
|
export declare const budgetFile = "BUDGET.json";
|
|
4
|
+
/** What audit.json says: the dollar cap is optional there, because the
|
|
5
|
+
* operator may approve it on the command line instead. */
|
|
4
6
|
export declare const budgetPolicySchema: z.ZodObject<{
|
|
5
|
-
maxUsd: z.
|
|
7
|
+
maxUsd: z.ZodOptional<z.ZodNumber>;
|
|
6
8
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
7
9
|
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
8
10
|
}, z.core.$strict>;
|
|
9
11
|
export type BudgetPolicy = z.infer<typeof budgetPolicySchema>;
|
|
12
|
+
/** The limits a run froze: the cap is always there. */
|
|
13
|
+
declare const frozenPolicySchema: z.ZodObject<{
|
|
14
|
+
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
15
|
+
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
16
|
+
maxUsd: z.ZodNumber;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
export type FrozenBudgetPolicy = z.infer<typeof frozenPolicySchema>;
|
|
10
19
|
/** A --budget-file: the limits to raise; what it leaves out stays. */
|
|
11
20
|
export declare const budgetAmendmentSchema: z.ZodObject<{
|
|
12
|
-
maxUsd: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
13
21
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
14
22
|
maxHours: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
23
|
+
maxUsd: z.ZodOptional<z.ZodNumber>;
|
|
15
24
|
}, z.core.$strict>;
|
|
16
25
|
export type BudgetAmendment = z.infer<typeof budgetAmendmentSchema>;
|
|
17
26
|
declare const budgetStateSchema: z.ZodObject<{
|
|
18
27
|
version: z.ZodLiteral<1>;
|
|
19
28
|
original: z.ZodObject<{
|
|
20
|
-
maxUsd: z.ZodDefault<z.ZodNumber>;
|
|
21
29
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
22
30
|
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
31
|
+
maxUsd: z.ZodNumber;
|
|
23
32
|
}, z.core.$strict>;
|
|
24
33
|
current: z.ZodObject<{
|
|
25
|
-
maxUsd: z.ZodDefault<z.ZodNumber>;
|
|
26
34
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
27
35
|
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
36
|
+
maxUsd: z.ZodNumber;
|
|
28
37
|
}, z.core.$strict>;
|
|
29
38
|
deadlineAt: z.ZodISODateTime;
|
|
39
|
+
model: z.ZodOptional<z.ZodString>;
|
|
30
40
|
amendments: z.ZodArray<z.ZodObject<{
|
|
31
41
|
at: z.ZodISODateTime;
|
|
32
42
|
from: z.ZodObject<{
|
|
33
|
-
maxUsd: z.ZodDefault<z.ZodNumber>;
|
|
34
43
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
35
44
|
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
45
|
+
maxUsd: z.ZodNumber;
|
|
36
46
|
}, z.core.$strict>;
|
|
37
47
|
to: z.ZodObject<{
|
|
38
|
-
maxUsd: z.ZodDefault<z.ZodNumber>;
|
|
39
48
|
maxTokens: z.ZodDefault<z.ZodNumber>;
|
|
40
49
|
maxHours: z.ZodDefault<z.ZodNumber>;
|
|
50
|
+
maxUsd: z.ZodNumber;
|
|
41
51
|
}, z.core.$strict>;
|
|
42
52
|
deadlineFrom: z.ZodISODateTime;
|
|
43
53
|
deadlineTo: z.ZodISODateTime;
|
|
@@ -46,7 +56,8 @@ declare const budgetStateSchema: z.ZodObject<{
|
|
|
46
56
|
type BudgetState = z.infer<typeof budgetStateSchema>;
|
|
47
57
|
export type RunBudget = {
|
|
48
58
|
limits: ModelBudgetLimits;
|
|
49
|
-
policy:
|
|
59
|
+
policy: FrozenBudgetPolicy;
|
|
60
|
+
model: string;
|
|
50
61
|
/** The amendment this invocation recorded, for the run journal. */
|
|
51
62
|
amended: BudgetState['amendments'][number] | undefined;
|
|
52
63
|
/** audit.json asks for other limits than the run froze: reported, never
|
|
@@ -55,14 +66,34 @@ export type RunBudget = {
|
|
|
55
66
|
};
|
|
56
67
|
/** readBudgetAmendment reads a --budget-file. */
|
|
57
68
|
export declare const readBudgetAmendment: (file: string) => Promise<BudgetAmendment>;
|
|
58
|
-
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*/
|
|
64
|
-
export declare
|
|
69
|
+
/** Thrown before any paid work when a new run has no approved cap. */
|
|
70
|
+
export declare class BudgetCapMissingError extends Error {
|
|
71
|
+
constructor(message: string);
|
|
72
|
+
}
|
|
73
|
+
/** Thrown before any paid work when audit.json names another model than
|
|
74
|
+
* the run directory froze. */
|
|
75
|
+
export declare class RunModelChangedError extends Error {
|
|
76
|
+
constructor(message: string);
|
|
77
|
+
}
|
|
78
|
+
/** readFrozenBudget reads a run directory's BUDGET.json; undefined when
|
|
79
|
+
* the directory has not started. Read-only. */
|
|
80
|
+
export declare const readFrozenBudget: (dir: string) => Promise<BudgetState | undefined>;
|
|
81
|
+
type ResolveRunBudgetOptions = {
|
|
82
|
+
/** The gateway model audit.json resolves to. */
|
|
83
|
+
model: string;
|
|
84
|
+
/** The cap approved on the command line (`--max-usd`). On a new run it
|
|
85
|
+
* sets the cap; on a resume it raises it, recorded like a --budget-file. */
|
|
86
|
+
maxUsd?: number;
|
|
65
87
|
amendment?: BudgetAmendment;
|
|
66
88
|
now?: () => Date;
|
|
67
|
-
}
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* resolveRunBudget returns the limits and the model a run executes under:
|
|
92
|
+
* frozen from audit.json (and --max-usd) on the first run, kept on every
|
|
93
|
+
* resume, raised only by an amendment. A new run without a dollar cap is
|
|
94
|
+
* refused, as is a resume whose audit.json names another model. An
|
|
95
|
+
* amendment that lowers a limit is refused: the ledger may already hold
|
|
96
|
+
* more than the lower limit.
|
|
97
|
+
*/
|
|
98
|
+
export declare const resolveRunBudget: (dir: string, policy: BudgetPolicy, { model, maxUsd, amendment, now }: ResolveRunBudgetOptions) => Promise<RunBudget>;
|
|
68
99
|
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type Range } from '../models/cost-coefficients';
|
|
2
|
+
import type { SupportedModel } from '../models/supported-models';
|
|
3
|
+
import type { RunPlan } from '../runner';
|
|
4
|
+
export type CostRange = Range<number>;
|
|
5
|
+
export type RunCostEstimate = {
|
|
6
|
+
currency: 'USD';
|
|
7
|
+
/** An estimate, labelled as such wherever it is shown. */
|
|
8
|
+
kind: 'estimate';
|
|
9
|
+
model: string;
|
|
10
|
+
coefficientsVersion: number;
|
|
11
|
+
low: number;
|
|
12
|
+
high: number;
|
|
13
|
+
categories: {
|
|
14
|
+
probes: CostRange;
|
|
15
|
+
stages: CostRange;
|
|
16
|
+
hostCalls: CostRange;
|
|
17
|
+
search: CostRange;
|
|
18
|
+
};
|
|
19
|
+
/** The cap to propose to the operator: the high end, rounded up. */
|
|
20
|
+
recommendedCapUsd: number;
|
|
21
|
+
};
|
|
22
|
+
export type AuthorCostEstimate = Omit<RunCostEstimate, 'categories'> & {
|
|
23
|
+
categories: {
|
|
24
|
+
stages: CostRange;
|
|
25
|
+
search: CostRange;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
type EstimateRunOptions = {
|
|
29
|
+
plan: Pick<RunPlan, 'units' | 'probesBySurface'>;
|
|
30
|
+
model: SupportedModel;
|
|
31
|
+
grounding: 'full' | 'extraction_only';
|
|
32
|
+
};
|
|
33
|
+
/** estimateRunCost estimates a whole run as planned; a resume spends less,
|
|
34
|
+
* because banked answers are never probed again. */
|
|
35
|
+
export declare const estimateRunCost: ({ plan, model, grounding, }: EstimateRunOptions) => RunCostEstimate;
|
|
36
|
+
/** estimateAuthorCost estimates one author session and its research. */
|
|
37
|
+
export declare const estimateAuthorCost: (model: SupportedModel) => AuthorCostEstimate;
|
|
38
|
+
/** One line a person reads: "$12.40 to $38.10 (estimate)". */
|
|
39
|
+
export declare const describeCostRange: (range: CostRange) => string;
|
|
40
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { type ExecutionRecorder } from '../bundle/recorder';
|
|
|
2
2
|
import { type WriterLock } from '../bundle/writer-lock';
|
|
3
3
|
import type { GroundRun } from '../codex-workflow/finish';
|
|
4
4
|
import { type RunSource } from '../codex-workflow/run-source';
|
|
5
|
+
import { type ModelCallAccounting } from '../models/accounting';
|
|
5
6
|
import type { InternalModelContext } from '../models/context';
|
|
6
7
|
import { type RunPlan } from '../runner';
|
|
7
8
|
import type { AeoAuditConfig, RunRequest } from '../schema';
|
|
@@ -38,6 +39,9 @@ export type LocalRun = {
|
|
|
38
39
|
/** The run's pinned model context: every host call charges its ledger
|
|
39
40
|
* and is recorded in the run journal. */
|
|
40
41
|
internalModels: InternalModelContext;
|
|
42
|
+
/** The same ledger unwrapped, for the Codex sessions, which the journal
|
|
43
|
+
* records as operations of their own. */
|
|
44
|
+
ledger: ModelCallAccounting;
|
|
41
45
|
ground: GroundRun;
|
|
42
46
|
/** The directory's writer lock and its run journal, held from before the
|
|
43
47
|
* first canary: the workflow continues under both (prepareWorkdir held). */
|
|
@@ -57,6 +61,8 @@ export type LocalRun = {
|
|
|
57
61
|
*/
|
|
58
62
|
export declare const openLocalRun: (file: AuditFile, dir: string, options?: {
|
|
59
63
|
signal?: AbortSignal;
|
|
64
|
+
/** The cap approved on the command line (`run --max-usd`). */
|
|
65
|
+
maxUsd?: number;
|
|
60
66
|
amendment?: BudgetAmendment;
|
|
61
67
|
derivedFromRunId?: string;
|
|
62
68
|
}) => Promise<LocalRun>;
|
|
@@ -17,11 +17,16 @@ export declare const agentAuthMode: (surface: AeoAgentSurface, settings: Setting
|
|
|
17
17
|
} | {
|
|
18
18
|
kind: "cli_session";
|
|
19
19
|
};
|
|
20
|
+
/** The model audit.json names, or the recommended one: refused when it is
|
|
21
|
+
* not on the supported list, which the detail then prints. */
|
|
22
|
+
export declare const modelCheck: (model: string | undefined) => PreflightCheck;
|
|
20
23
|
/** runPreflight checks what a run over these surfaces needs locally. */
|
|
21
24
|
export declare const runPreflight: (args: {
|
|
22
25
|
surfaces: readonly AeoSurface[];
|
|
23
26
|
settings: Settings;
|
|
24
27
|
dir: string;
|
|
28
|
+
/** audit.json's `model`; absent means the recommended model. */
|
|
29
|
+
model?: string;
|
|
25
30
|
/** Full grounding researches through the pinned search provider. */
|
|
26
31
|
groundingSearch?: boolean;
|
|
27
32
|
}) => Promise<PreflightCheck[]>;
|
|
@@ -3,6 +3,8 @@ export type EngineResources = {
|
|
|
3
3
|
root: string;
|
|
4
4
|
author: string;
|
|
5
5
|
editorial: string;
|
|
6
|
+
/** The operator guide `literally-aeo guide` prints. */
|
|
7
|
+
guide: string;
|
|
6
8
|
};
|
|
7
9
|
/** engineResources finds the resources of the running engine. */
|
|
8
10
|
export declare const engineResources: () => Promise<EngineResources>;
|
|
@@ -27,10 +27,11 @@ export type RecordedAuthorEvidence = z.infer<typeof authorEvidenceSchema>;
|
|
|
27
27
|
/** readRecordedAuthorEvidence reads what a run recorded about how its
|
|
28
28
|
* configuration came to be; a run from before the record says manual. */
|
|
29
29
|
export declare const readRecordedAuthorEvidence: (dir: string) => Promise<RecordedAuthorEvidence | undefined>;
|
|
30
|
-
|
|
31
|
-
* into its directory, replacing what an earlier invocation wrote. */
|
|
32
|
-
export declare const recordRunConfiguration: ({ dir, configFile, evidence, }: {
|
|
30
|
+
export declare const recordRunConfiguration: ({ dir, configFile, evidence, model, }: {
|
|
33
31
|
dir: string;
|
|
34
32
|
configFile: string;
|
|
35
33
|
evidence: RecordedAuthorEvidence;
|
|
34
|
+
/** A model named outside the file (`rejudge --model`): the recorded
|
|
35
|
+
* configuration is the one the run ran with, not the file's. */
|
|
36
|
+
model?: string;
|
|
36
37
|
}) => Promise<void>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type WriterLockState } from '../bundle/writer-lock';
|
|
2
|
+
export declare const SpendCategory: {
|
|
3
|
+
readonly PROBES: "probes";
|
|
4
|
+
readonly STAGES: "stages";
|
|
5
|
+
readonly HOST_CALLS: "hostCalls";
|
|
6
|
+
readonly SEARCH: "search";
|
|
7
|
+
};
|
|
8
|
+
export type SpendCategory = (typeof SpendCategory)[keyof typeof SpendCategory];
|
|
9
|
+
/** spendCategoryOf names the kind of paid work a ledger role charges:
|
|
10
|
+
* `stage:` Codex sessions, `probe:` assistant answers, `search:` and
|
|
11
|
+
* grounding's research searches, everything else the host's model calls. */
|
|
12
|
+
export declare const spendCategoryOf: (role: string) => SpendCategory;
|
|
13
|
+
export type CategorySpend = {
|
|
14
|
+
usd: number;
|
|
15
|
+
calls: number;
|
|
16
|
+
};
|
|
17
|
+
export type RunSpend = {
|
|
18
|
+
currency: 'USD';
|
|
19
|
+
/** The run's frozen cap; undefined before the first run froze one. */
|
|
20
|
+
capUsd: number | undefined;
|
|
21
|
+
/** The model the run froze with its cap. */
|
|
22
|
+
model: string | undefined;
|
|
23
|
+
deadlineAt: string | undefined;
|
|
24
|
+
/** What every call charges: settled cost, else its reservation. */
|
|
25
|
+
chargedUsd: number;
|
|
26
|
+
/** Settled calls: at their reported cost, or at their reservation when
|
|
27
|
+
* the provider reported none. */
|
|
28
|
+
settledUsd: number;
|
|
29
|
+
/** Calls reserved and not settled: dispatched, or lost with a process. */
|
|
30
|
+
openUsd: number;
|
|
31
|
+
remainingUsd: number | undefined;
|
|
32
|
+
byCategory: Record<SpendCategory, CategorySpend>;
|
|
33
|
+
};
|
|
34
|
+
export type RunActivity = {
|
|
35
|
+
kind: string;
|
|
36
|
+
/** The Codex stage, for a session. */
|
|
37
|
+
stage: string | undefined;
|
|
38
|
+
/** The model role or surface, for a host call or probe. */
|
|
39
|
+
role: string | undefined;
|
|
40
|
+
at: string;
|
|
41
|
+
/** Started and not yet finished. */
|
|
42
|
+
open: boolean;
|
|
43
|
+
};
|
|
44
|
+
export type RunStatus = {
|
|
45
|
+
dir: string;
|
|
46
|
+
state: 'new' | 'resumable' | 'completed';
|
|
47
|
+
writer: {
|
|
48
|
+
purpose: string;
|
|
49
|
+
pid: number;
|
|
50
|
+
host: string;
|
|
51
|
+
since: string;
|
|
52
|
+
state: WriterLockState;
|
|
53
|
+
} | undefined;
|
|
54
|
+
/** The run's phase as its journal shows it last. */
|
|
55
|
+
phase: string | undefined;
|
|
56
|
+
lastActivity: RunActivity | undefined;
|
|
57
|
+
/** The Codex stage outputs present in OUT/. */
|
|
58
|
+
completedStages: string[];
|
|
59
|
+
answers: {
|
|
60
|
+
planned: number | undefined;
|
|
61
|
+
captured: number;
|
|
62
|
+
failed: number;
|
|
63
|
+
};
|
|
64
|
+
spend: RunSpend;
|
|
65
|
+
lastError: {
|
|
66
|
+
type: string;
|
|
67
|
+
error: string;
|
|
68
|
+
reason: string;
|
|
69
|
+
at: string;
|
|
70
|
+
} | undefined;
|
|
71
|
+
stoppedAtBudget: boolean;
|
|
72
|
+
};
|
|
73
|
+
/** readRunStatus reads a run directory's state; undefined when it holds no
|
|
74
|
+
* run (no journal, no bank, no prepared inputs). */
|
|
75
|
+
export declare const readRunStatus: (dir: string) => Promise<RunStatus | undefined>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const exampleAuditFile: {
|
|
2
2
|
version: 1;
|
|
3
|
+
model: string;
|
|
3
4
|
brand: {
|
|
4
5
|
name: string;
|
|
5
6
|
domain: string;
|
|
@@ -29,8 +30,6 @@ export declare const exampleAuditFile: {
|
|
|
29
30
|
runPolicy: {
|
|
30
31
|
maxPlannedUnits: number;
|
|
31
32
|
budget: {
|
|
32
|
-
maxUsd: number;
|
|
33
|
-
maxTokens: number;
|
|
34
33
|
maxHours: number;
|
|
35
34
|
};
|
|
36
35
|
};
|