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
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
tokenCostUsd
|
|
3
|
+
} from "./chunk-ZIGNJAPC.js";
|
|
1
4
|
import {
|
|
2
5
|
forgetSession,
|
|
3
6
|
readSession,
|
|
4
7
|
saveSession
|
|
5
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EE26FNSY.js";
|
|
6
9
|
import {
|
|
7
10
|
CopyVerificationUnavailableError,
|
|
8
11
|
recoverEditorialRounds
|
|
@@ -11,13 +14,16 @@ import {
|
|
|
11
14
|
authorFiles,
|
|
12
15
|
authorPacket,
|
|
13
16
|
authorSessionInputs
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BE4ENGUY.js";
|
|
15
18
|
import {
|
|
16
19
|
copyDir
|
|
17
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TJQ5OPLQ.js";
|
|
18
21
|
import {
|
|
19
22
|
batchInput
|
|
20
23
|
} from "./chunk-VHDVKEWO.js";
|
|
24
|
+
import {
|
|
25
|
+
sessionReservation
|
|
26
|
+
} from "./chunk-DVFFYY5G.js";
|
|
21
27
|
import {
|
|
22
28
|
killChildProcessGroup
|
|
23
29
|
} from "./chunk-7QYZSP7Q.js";
|
|
@@ -25,15 +31,21 @@ import {
|
|
|
25
31
|
mergeBatches,
|
|
26
32
|
restoreQualificationQuotes,
|
|
27
33
|
validateStage
|
|
28
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EJ655TVU.js";
|
|
29
35
|
import {
|
|
30
36
|
sessionPrompt,
|
|
31
37
|
stagePrompts
|
|
32
38
|
} from "./chunk-4QQJXCD2.js";
|
|
33
39
|
import {
|
|
34
|
-
|
|
40
|
+
codexGateway,
|
|
41
|
+
codexStageConfig,
|
|
35
42
|
prepareCodexHome
|
|
36
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-XDG6NPJB.js";
|
|
44
|
+
import {
|
|
45
|
+
codexArgs,
|
|
46
|
+
codexBinaryAt,
|
|
47
|
+
resolveCodexBinary
|
|
48
|
+
} from "./chunk-U772TN32.js";
|
|
37
49
|
import {
|
|
38
50
|
writePendingJson
|
|
39
51
|
} from "./chunk-MX6Y4RD2.js";
|
|
@@ -42,17 +54,17 @@ import {
|
|
|
42
54
|
qualifyRowSchema,
|
|
43
55
|
stageJsonSchema,
|
|
44
56
|
stageVersions
|
|
45
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-6GHHNPFJ.js";
|
|
46
58
|
import {
|
|
47
59
|
isAuthError
|
|
48
60
|
} from "./chunk-7O3M6I2X.js";
|
|
49
|
-
import {
|
|
50
|
-
isObject
|
|
51
|
-
} from "./chunk-7PLK6VGC.js";
|
|
52
61
|
import {
|
|
53
62
|
getEnvironment,
|
|
54
63
|
readEnv
|
|
55
64
|
} from "./chunk-PO2J5OQ3.js";
|
|
65
|
+
import {
|
|
66
|
+
isObject
|
|
67
|
+
} from "./chunk-7PLK6VGC.js";
|
|
56
68
|
import {
|
|
57
69
|
maxReviewRounds
|
|
58
70
|
} from "./chunk-SDWYZM64.js";
|
|
@@ -60,7 +72,7 @@ import {
|
|
|
60
72
|
// src/codex-workflow/stage.ts
|
|
61
73
|
import { spawn } from "node:child_process";
|
|
62
74
|
import { createWriteStream } from "node:fs";
|
|
63
|
-
import { createHash } from "node:crypto";
|
|
75
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
64
76
|
import {
|
|
65
77
|
appendFile,
|
|
66
78
|
mkdir,
|
|
@@ -112,6 +124,7 @@ var stageSpecs = {
|
|
|
112
124
|
analyze: {
|
|
113
125
|
...reportStage,
|
|
114
126
|
batched: true,
|
|
127
|
+
sessionCost: "answers",
|
|
115
128
|
judgedOn: "batch",
|
|
116
129
|
persistent: false,
|
|
117
130
|
sharedInputs: fixedInputs([
|
|
@@ -132,6 +145,7 @@ var stageSpecs = {
|
|
|
132
145
|
qualify: {
|
|
133
146
|
...reportStage,
|
|
134
147
|
batched: true,
|
|
148
|
+
sessionCost: "answers",
|
|
135
149
|
judgedOn: "batch",
|
|
136
150
|
persistent: false,
|
|
137
151
|
sharedInputs: fixedInputs([
|
|
@@ -157,6 +171,7 @@ var stageSpecs = {
|
|
|
157
171
|
review: {
|
|
158
172
|
...reportStage,
|
|
159
173
|
batched: true,
|
|
174
|
+
sessionCost: "answers",
|
|
160
175
|
judgedOn: "batch",
|
|
161
176
|
persistent: true,
|
|
162
177
|
sharedInputs: fixedInputs([
|
|
@@ -186,6 +201,7 @@ var stageSpecs = {
|
|
|
186
201
|
write: {
|
|
187
202
|
...reportStage,
|
|
188
203
|
batched: false,
|
|
204
|
+
sessionCost: "report",
|
|
189
205
|
judgedOn: "all",
|
|
190
206
|
persistent: true,
|
|
191
207
|
// Everything under COPY/, listed at digest time.
|
|
@@ -217,6 +233,7 @@ var stageSpecs = {
|
|
|
217
233
|
// read-only sandbox, judged by the host's verdict after it submits.
|
|
218
234
|
author: {
|
|
219
235
|
batched: false,
|
|
236
|
+
sessionCost: "brief",
|
|
220
237
|
judgedOn: "all",
|
|
221
238
|
persistent: true,
|
|
222
239
|
sharedInputs: authorFiles,
|
|
@@ -242,6 +259,10 @@ var sumUsage = (usages) => {
|
|
|
242
259
|
(total, usage) => total + usage.inputTokens,
|
|
243
260
|
0
|
|
244
261
|
),
|
|
262
|
+
cachedInputTokens: reported.reduce(
|
|
263
|
+
(total, usage) => total + usage.cachedInputTokens,
|
|
264
|
+
0
|
|
265
|
+
),
|
|
245
266
|
outputTokens: reported.reduce(
|
|
246
267
|
(total, usage) => total + usage.outputTokens,
|
|
247
268
|
0
|
|
@@ -292,7 +313,7 @@ var scopeFor = (ctx, stage, batch) => {
|
|
|
292
313
|
var batchInputsDigest = async (ctx, stage, batch) => {
|
|
293
314
|
const spec = stageSpecs[stage];
|
|
294
315
|
const parts = {
|
|
295
|
-
model: JSON.stringify(
|
|
316
|
+
model: JSON.stringify(codexStageConfig(ctx.stageModel)),
|
|
296
317
|
prompt: stagePrompts[stage],
|
|
297
318
|
version: String(stageVersions[stage]),
|
|
298
319
|
schema: JSON.stringify(stageJsonSchema(stage)),
|
|
@@ -340,7 +361,11 @@ var sessionSandbox = (spec) => {
|
|
|
340
361
|
};
|
|
341
362
|
var eventText = z.string().optional().catch(void 0);
|
|
342
363
|
var eventTokens = z.number().optional().catch(void 0);
|
|
343
|
-
var eventUsage = z.looseObject({
|
|
364
|
+
var eventUsage = z.looseObject({
|
|
365
|
+
input_tokens: eventTokens,
|
|
366
|
+
cached_input_tokens: eventTokens,
|
|
367
|
+
output_tokens: eventTokens
|
|
368
|
+
}).optional().catch(void 0);
|
|
344
369
|
var codexEventSchema = z.looseObject({
|
|
345
370
|
type: eventText,
|
|
346
371
|
thread_id: eventText,
|
|
@@ -377,6 +402,42 @@ var describeItem = (item) => {
|
|
|
377
402
|
}
|
|
378
403
|
return item.type ?? "item";
|
|
379
404
|
};
|
|
405
|
+
var reserveSession = async (ctx, { stage, batch, attempt }) => {
|
|
406
|
+
const { accounting, stageModel } = ctx;
|
|
407
|
+
if (!accounting) {
|
|
408
|
+
return void 0;
|
|
409
|
+
}
|
|
410
|
+
const pricing = stageModel.pricingUsdPerMillion;
|
|
411
|
+
const reserved = sessionReservation({
|
|
412
|
+
cost: stageSpecs[stage].sessionCost,
|
|
413
|
+
answers: batch.files.length
|
|
414
|
+
});
|
|
415
|
+
const callId = `codex:${stage}-${batch.index}:${attempt ?? 1}:${randomUUID()}`;
|
|
416
|
+
await accounting.reserve({
|
|
417
|
+
callId,
|
|
418
|
+
role: `stage:${stage}`,
|
|
419
|
+
requestedModel: stageModel.model,
|
|
420
|
+
reasoningEffort: stageModel.reasoningEffort,
|
|
421
|
+
reservedUsd: tokenCostUsd(pricing, reserved),
|
|
422
|
+
inputTokens: reserved.inputTokens,
|
|
423
|
+
maxOutputTokens: reserved.outputTokens
|
|
424
|
+
});
|
|
425
|
+
const charge = {
|
|
426
|
+
settle: async (usage) => {
|
|
427
|
+
await accounting.settle(
|
|
428
|
+
callId,
|
|
429
|
+
usage ? {
|
|
430
|
+
requestedModel: stageModel.model,
|
|
431
|
+
costUsd: tokenCostUsd(pricing, usage),
|
|
432
|
+
inputTokens: usage.inputTokens,
|
|
433
|
+
cachedInputTokens: usage.cachedInputTokens,
|
|
434
|
+
outputTokens: usage.outputTokens
|
|
435
|
+
} : { requestedModel: stageModel.model, valid: false }
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
};
|
|
439
|
+
return charge;
|
|
440
|
+
};
|
|
380
441
|
var execCodex = async (ctx, { stage, batch, feedback, attempt }) => {
|
|
381
442
|
const env = ctx.codexEnv;
|
|
382
443
|
const spec = stageSpecs[stage];
|
|
@@ -386,7 +447,7 @@ var execCodex = async (ctx, { stage, batch, feedback, attempt }) => {
|
|
|
386
447
|
const contract = sha({
|
|
387
448
|
stage,
|
|
388
449
|
version: stageVersions[stage],
|
|
389
|
-
model:
|
|
450
|
+
model: codexStageConfig(ctx.stageModel),
|
|
390
451
|
prompt: stagePrompts[stage],
|
|
391
452
|
continuation: sessionPrompt(stage, batch.index, { continuation: true }),
|
|
392
453
|
schema: stageJsonSchema(stage),
|
|
@@ -427,7 +488,9 @@ ${input}` : input;
|
|
|
427
488
|
resumeInput ? "-" : instruction
|
|
428
489
|
];
|
|
429
490
|
let threadId = session?.threadId ?? null;
|
|
491
|
+
const codexBinary = ctx.command ? codexBinaryAt(ctx.command) : resolveCodexBinary();
|
|
430
492
|
ctx.signal?.throwIfAborted();
|
|
493
|
+
const charge = await reserveSession(ctx, { stage, batch, attempt });
|
|
431
494
|
const operation = await ctx.recorder?.start({
|
|
432
495
|
kind: "codex_session",
|
|
433
496
|
stage,
|
|
@@ -439,16 +502,17 @@ ${input}` : input;
|
|
|
439
502
|
arguments: JSON.stringify(args)
|
|
440
503
|
},
|
|
441
504
|
details: {
|
|
442
|
-
requestedModel:
|
|
443
|
-
provider:
|
|
444
|
-
reasoningEffort:
|
|
505
|
+
requestedModel: ctx.stageModel.model,
|
|
506
|
+
provider: codexGateway.providerName,
|
|
507
|
+
reasoningEffort: ctx.stageModel.reasoningEffort,
|
|
508
|
+
codex: { source: codexBinary.source, version: codexBinary.version },
|
|
445
509
|
sandbox: sessionSandbox(spec),
|
|
446
510
|
resumedThreadId: session?.threadId ?? null
|
|
447
511
|
}
|
|
448
512
|
});
|
|
449
513
|
const transcript = [];
|
|
450
514
|
const result = await new Promise((resolve) => {
|
|
451
|
-
const child = spawn(
|
|
515
|
+
const child = spawn(codexBinary.command, codexArgs(codexBinary, args), {
|
|
452
516
|
cwd: ctx.dir,
|
|
453
517
|
env,
|
|
454
518
|
detached: true,
|
|
@@ -489,6 +553,7 @@ ${input}` : input;
|
|
|
489
553
|
if (found) {
|
|
490
554
|
usage = {
|
|
491
555
|
inputTokens: found.input_tokens ?? 0,
|
|
556
|
+
cachedInputTokens: found.cached_input_tokens ?? 0,
|
|
492
557
|
outputTokens: found.output_tokens ?? 0
|
|
493
558
|
};
|
|
494
559
|
}
|
|
@@ -533,6 +598,7 @@ ${input}` : input;
|
|
|
533
598
|
sessionUsage: result.usage
|
|
534
599
|
}
|
|
535
600
|
});
|
|
601
|
+
await charge?.settle(result.usage);
|
|
536
602
|
if (spec.persistent && threadId) {
|
|
537
603
|
const files = await saveSession(ctx.dir, label, { contract, threadId });
|
|
538
604
|
await ctx.checkpoint?.(files);
|
|
@@ -1360,11 +1426,11 @@ var runStage = async (initial, stage, options = {}) => {
|
|
|
1360
1426
|
}
|
|
1361
1427
|
const ctx = {
|
|
1362
1428
|
...initial,
|
|
1363
|
-
codexEnv: await prepareCodexHome(
|
|
1364
|
-
initial.
|
|
1365
|
-
getEnvironment(),
|
|
1366
|
-
spec.research ? initial.research :
|
|
1367
|
-
)
|
|
1429
|
+
codexEnv: await prepareCodexHome(initial.dir, {
|
|
1430
|
+
stageModel: initial.stageModel,
|
|
1431
|
+
env: getEnvironment(),
|
|
1432
|
+
...spec.research && initial.research ? { research: initial.research } : {}
|
|
1433
|
+
})
|
|
1368
1434
|
};
|
|
1369
1435
|
const batches = stageBatches(ctx, stage);
|
|
1370
1436
|
const qualificationWasFresh = stage === "review" && await isStageFresh(ctx, "qualify");
|
|
@@ -1449,7 +1515,7 @@ var runStage = async (initial, stage, options = {}) => {
|
|
|
1449
1515
|
}
|
|
1450
1516
|
const result = {
|
|
1451
1517
|
stage,
|
|
1452
|
-
model:
|
|
1518
|
+
model: ctx.stageModel.model,
|
|
1453
1519
|
ok: output !== void 0,
|
|
1454
1520
|
durationMs: Date.now() - started,
|
|
1455
1521
|
usage,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
writeArchive
|
|
3
|
+
} from "./chunk-PYLJISDZ.js";
|
|
1
4
|
import {
|
|
2
5
|
redactBundle
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EBUQPCKB.js";
|
|
4
7
|
import {
|
|
5
8
|
acquireWriterLock
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
writeArchive
|
|
9
|
-
} from "./chunk-PYLJISDZ.js";
|
|
9
|
+
} from "./chunk-6GOBBNDU.js";
|
|
10
10
|
import {
|
|
11
11
|
projectWorkdir
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FUAUPNRO.js";
|
|
13
13
|
import {
|
|
14
14
|
runJournalDir
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4PD65FRJ.js";
|
|
16
16
|
import {
|
|
17
17
|
openJournal,
|
|
18
18
|
readJournal
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YRBIC5QH.js";
|
|
20
20
|
import {
|
|
21
21
|
mintRunId
|
|
22
22
|
} from "./chunk-W46Y7KBR.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
toolId,
|
|
34
34
|
toolVersion,
|
|
35
35
|
traceSchemaVersion
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-WVACVWBL.js";
|
|
37
37
|
import {
|
|
38
38
|
encodeBundleJson,
|
|
39
39
|
parseBundleJson,
|
|
@@ -12,11 +12,10 @@ import {
|
|
|
12
12
|
} from "./chunk-2PAO43CH.js";
|
|
13
13
|
import {
|
|
14
14
|
aeoAuditConfigSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-OKL7GN2F.js";
|
|
16
16
|
import {
|
|
17
|
-
internalModelRoleDigest
|
|
18
|
-
|
|
19
|
-
} from "./chunk-CFFPOTP4.js";
|
|
17
|
+
internalModelRoleDigest
|
|
18
|
+
} from "./chunk-RYCRL3YA.js";
|
|
20
19
|
import {
|
|
21
20
|
ModelBudgetError
|
|
22
21
|
} from "./chunk-TNL2GWYR.js";
|
|
@@ -186,7 +185,7 @@ var validateAgentCopy = async (args) => {
|
|
|
186
185
|
]
|
|
187
186
|
};
|
|
188
187
|
}
|
|
189
|
-
const profile = args.verifierProfile
|
|
188
|
+
const profile = args.verifierProfile;
|
|
190
189
|
let catalog;
|
|
191
190
|
try {
|
|
192
191
|
if (args.grounding) {
|
|
@@ -490,7 +489,7 @@ var copyFactsUnchanged = (provenance, {
|
|
|
490
489
|
config,
|
|
491
490
|
runId,
|
|
492
491
|
grounding,
|
|
493
|
-
verifierProfile
|
|
492
|
+
verifierProfile
|
|
494
493
|
}) => {
|
|
495
494
|
const facts = new Map(
|
|
496
495
|
buildFactCatalog({ snapshot, config, runId, grounding }).facts.map(
|
|
@@ -570,7 +569,7 @@ var validateHumanCopy = async (args) => {
|
|
|
570
569
|
"Human copy must cover exactly the configured sections"
|
|
571
570
|
);
|
|
572
571
|
}
|
|
573
|
-
const profile = args.verifierProfile
|
|
572
|
+
const profile = args.verifierProfile;
|
|
574
573
|
let facts;
|
|
575
574
|
try {
|
|
576
575
|
validateGroundingBundle(args.grounding, {
|
|
@@ -710,7 +709,7 @@ var assertCopyValidation = (args) => {
|
|
|
710
709
|
});
|
|
711
710
|
const receipt = isStoredReceipt(args.receipt) ? args.receipt : null;
|
|
712
711
|
const provenance = isStoredProvenance(args.provenance) ? args.provenance : null;
|
|
713
|
-
const profile = args.verifierProfile
|
|
712
|
+
const profile = args.verifierProfile;
|
|
714
713
|
const verifierPromptVersions = {
|
|
715
714
|
3: 1,
|
|
716
715
|
4: 2,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
copywriterFiles
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TJQ5OPLQ.js";
|
|
4
4
|
import {
|
|
5
5
|
writePendingJson
|
|
6
6
|
} from "./chunk-MX6Y4RD2.js";
|
|
7
7
|
import {
|
|
8
8
|
writeOutputSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6GHHNPFJ.js";
|
|
10
10
|
import {
|
|
11
11
|
premiseVerifierInstructions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-622NMXN6.js";
|
|
13
13
|
import {
|
|
14
14
|
generateStructured,
|
|
15
15
|
structuredCallReservation
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CO5T6WU5.js";
|
|
17
17
|
import {
|
|
18
18
|
narrativeContextFactIds
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-R6XDZWUL.js";
|
|
20
20
|
import {
|
|
21
21
|
buildFactCatalog,
|
|
22
22
|
projectWriterFactCatalog
|
|
@@ -4,12 +4,16 @@ import {
|
|
|
4
4
|
partition,
|
|
5
5
|
runStage,
|
|
6
6
|
stageInputsDigest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QHUDJVPJ.js";
|
|
8
|
+
import {
|
|
9
|
+
finishRun,
|
|
10
|
+
writeFinished
|
|
11
|
+
} from "./chunk-JXMDOAKA.js";
|
|
8
12
|
import {
|
|
9
13
|
copyEditHistory,
|
|
10
14
|
editCopyDraft,
|
|
11
15
|
readCopyEdits
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-RJ5R6YYA.js";
|
|
13
17
|
import {
|
|
14
18
|
CopyVerificationUnavailableError
|
|
15
19
|
} from "./chunk-KZR25REO.js";
|
|
@@ -17,60 +21,54 @@ import {
|
|
|
17
21
|
readStoredReview,
|
|
18
22
|
reportQuality
|
|
19
23
|
} from "./chunk-NCLFZOZU.js";
|
|
20
|
-
import {
|
|
21
|
-
finishRun,
|
|
22
|
-
writeFinished
|
|
23
|
-
} from "./chunk-KRFHQQS7.js";
|
|
24
24
|
import {
|
|
25
25
|
copywriterFiles,
|
|
26
26
|
materializeCopyInputs,
|
|
27
27
|
readSnapshot,
|
|
28
28
|
validateCopyDraft
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TJQ5OPLQ.js";
|
|
30
30
|
import {
|
|
31
|
-
hostModels
|
|
32
|
-
|
|
31
|
+
hostModels,
|
|
32
|
+
pinnedProfileOf
|
|
33
|
+
} from "./chunk-FAUFE7MI.js";
|
|
33
34
|
import {
|
|
34
35
|
stableBatchLayout
|
|
35
36
|
} from "./chunk-SBQ4TWGJ.js";
|
|
36
37
|
import {
|
|
37
38
|
aggregateWorkdir
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-UZJSTJFP.js";
|
|
39
40
|
import {
|
|
40
41
|
validateStage
|
|
41
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-EJ655TVU.js";
|
|
42
43
|
import {
|
|
43
44
|
materializeWorkdir
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-LOBXOZ2R.js";
|
|
45
46
|
import {
|
|
46
47
|
acquireWriterLock
|
|
47
|
-
} from "./chunk-
|
|
48
|
-
import {
|
|
49
|
-
codexModel
|
|
50
|
-
} from "./chunk-MIF5IYNR.js";
|
|
48
|
+
} from "./chunk-6GOBBNDU.js";
|
|
51
49
|
import {
|
|
52
50
|
writePendingJson
|
|
53
51
|
} from "./chunk-MX6Y4RD2.js";
|
|
54
52
|
import {
|
|
55
53
|
writeRunInputs
|
|
56
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-GDKGZQ3T.js";
|
|
57
55
|
import {
|
|
58
56
|
openRecorder,
|
|
59
57
|
recordingAccounting
|
|
60
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-4PD65FRJ.js";
|
|
61
59
|
import {
|
|
62
60
|
RunOrigin,
|
|
63
61
|
measurementDigest
|
|
64
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-WVACVWBL.js";
|
|
65
63
|
import {
|
|
66
64
|
capturePlan
|
|
67
65
|
} from "./chunk-YHS5IEVZ.js";
|
|
68
66
|
import {
|
|
69
67
|
verdictSchemaFor
|
|
70
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-622NMXN6.js";
|
|
71
69
|
import {
|
|
72
70
|
classifyVerifierFailure
|
|
73
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-R6XDZWUL.js";
|
|
74
72
|
import {
|
|
75
73
|
isObject
|
|
76
74
|
} from "./chunk-7PLK6VGC.js";
|
|
@@ -103,7 +101,7 @@ var hostModelsOf = (ctx) => {
|
|
|
103
101
|
if (ctx.internalModels) {
|
|
104
102
|
return ctx.internalModels;
|
|
105
103
|
}
|
|
106
|
-
const models = hostModels();
|
|
104
|
+
const models = hostModels(pinnedProfileOf(ctx.source?.request.modelProfile));
|
|
107
105
|
return ctx.recorder ? {
|
|
108
106
|
...models,
|
|
109
107
|
accounting: recordingAccounting(models.accounting, ctx.recorder)
|
|
@@ -178,6 +176,12 @@ var prepareLockedWorkdir = async (source, dir, options) => {
|
|
|
178
176
|
recorder
|
|
179
177
|
)
|
|
180
178
|
};
|
|
179
|
+
const stageModel = source.request.modelProfile?.stages ?? options.stageModel;
|
|
180
|
+
if (!stageModel) {
|
|
181
|
+
throw new Error(
|
|
182
|
+
"The run pins no Codex stage model: its profile has no `stages` and the caller supplied none."
|
|
183
|
+
);
|
|
184
|
+
}
|
|
181
185
|
const log = options.log ?? ((line) => {
|
|
182
186
|
console.log(line);
|
|
183
187
|
});
|
|
@@ -201,6 +205,8 @@ var prepareLockedWorkdir = async (source, dir, options) => {
|
|
|
201
205
|
source,
|
|
202
206
|
secrets: options.secrets ?? [],
|
|
203
207
|
internalModels,
|
|
208
|
+
stageModel,
|
|
209
|
+
...options.ledger && { accounting: options.ledger },
|
|
204
210
|
recorder,
|
|
205
211
|
releaseWriter: writer.release,
|
|
206
212
|
signal: options.signal,
|
|
@@ -366,6 +372,7 @@ var finish = async (ctx, { degraded, write, ground, quality }) => {
|
|
|
366
372
|
degraded,
|
|
367
373
|
write,
|
|
368
374
|
ground,
|
|
375
|
+
stageModelId: ctx.stageModel.model,
|
|
369
376
|
internalModels: hostModelsOf(ctx),
|
|
370
377
|
signal: ctx.signal,
|
|
371
378
|
quality
|
|
@@ -429,7 +436,7 @@ var runOne = async (ctx, stage, { force, pass }) => {
|
|
|
429
436
|
const previous = recordedRunSchema.parse(JSON.parse(raw));
|
|
430
437
|
const run2 = {
|
|
431
438
|
stage,
|
|
432
|
-
model:
|
|
439
|
+
model: ctx.stageModel.model,
|
|
433
440
|
ok: true,
|
|
434
441
|
durationMs: 0,
|
|
435
442
|
usage: null,
|
|
@@ -462,6 +469,7 @@ var deliverableCopy = async (ctx, inputs, written) => {
|
|
|
462
469
|
draft,
|
|
463
470
|
snapshot: await readSnapshot(ctx.dir),
|
|
464
471
|
secrets: ctx.secrets,
|
|
472
|
+
verifierRole: inputs.verifierRole ?? hostModelsOf(ctx).profile.roles.premiseVerifier,
|
|
465
473
|
accounting: ctx.internalModels?.accounting
|
|
466
474
|
});
|
|
467
475
|
if (!validated.valid || !validated.copy || !validated.provenance || !validated.receipt) {
|
|
@@ -528,7 +536,7 @@ var writeReportCopy = async (ctx, inputs, { force }) => {
|
|
|
528
536
|
);
|
|
529
537
|
run = {
|
|
530
538
|
stage: "write",
|
|
531
|
-
model:
|
|
539
|
+
model: ctx.stageModel.model,
|
|
532
540
|
ok: false,
|
|
533
541
|
durationMs: 0,
|
|
534
542
|
usage: null,
|
|
@@ -600,7 +608,7 @@ var Scorecard = class {
|
|
|
600
608
|
version: 1,
|
|
601
609
|
startedAt: this.#startedAt,
|
|
602
610
|
finishedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
603
|
-
model:
|
|
611
|
+
model: this.#ctx.stageModel.model,
|
|
604
612
|
answers: this.#ctx.answers.length,
|
|
605
613
|
verdict,
|
|
606
614
|
stages: this.#stages,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import {
|
|
2
|
+
canonicalJson
|
|
3
|
+
} from "./chunk-D5B4ZOW6.js";
|
|
4
|
+
|
|
5
|
+
// src/models/profiles.ts
|
|
6
|
+
import { createHash } from "node:crypto";
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
var internalModelProfileIdSchema = z.string().min(1);
|
|
9
|
+
var generationBackendSchema = z.enum([
|
|
10
|
+
"claude_code",
|
|
11
|
+
"codex",
|
|
12
|
+
"gateway"
|
|
13
|
+
]);
|
|
14
|
+
var modelPricingSchema = z.object({
|
|
15
|
+
input: z.number().positive(),
|
|
16
|
+
output: z.number().positive(),
|
|
17
|
+
cachedInput: z.number().nonnegative()
|
|
18
|
+
}).strict();
|
|
19
|
+
var internalModelRoleSchema = z.object({
|
|
20
|
+
/** The gateway model ID, such as `anthropic/claude-opus-5.5`. */
|
|
21
|
+
model: z.string().min(1),
|
|
22
|
+
providerOptions: z.object({
|
|
23
|
+
openai: z.object({ reasoningEffort: z.literal("high") }).strict().optional(),
|
|
24
|
+
/** Ask a reasoning model to think hard. A token budget is not
|
|
25
|
+
* sent: not every provider honours one. */
|
|
26
|
+
gateway: z.object({
|
|
27
|
+
reasoning: z.union([
|
|
28
|
+
z.object({ effort: z.literal("high") }).strict(),
|
|
29
|
+
/** Accepted so that a stored profile keeps parsing and
|
|
30
|
+
* dispatching exactly as admitted; never built any more. */
|
|
31
|
+
z.object({ max_tokens: z.number().int().positive() }).strict()
|
|
32
|
+
]),
|
|
33
|
+
/** The gateway upstream routes a role is restricted to, when
|
|
34
|
+
* not every route of an open-weight model returns structured
|
|
35
|
+
* output. Absent leaves routing to the gateway. */
|
|
36
|
+
only: z.array(z.string().min(1)).min(1).max(12).optional()
|
|
37
|
+
}).strict().optional()
|
|
38
|
+
}).strict(),
|
|
39
|
+
promptVersion: z.string().min(1),
|
|
40
|
+
schemaVersion: z.string().min(1),
|
|
41
|
+
deadlineMs: z.number().int().positive(),
|
|
42
|
+
maxInputTokens: z.number().int().positive().max(1e5),
|
|
43
|
+
maxOutputTokens: z.number().int().positive(),
|
|
44
|
+
/** How many items one batched call may carry, when the model wants a
|
|
45
|
+
* narrower batch than the call site's own default. Absent leaves that
|
|
46
|
+
* default. */
|
|
47
|
+
maxItemsPerCall: z.number().int().positive().optional(),
|
|
48
|
+
pricingUsdPerMillion: modelPricingSchema
|
|
49
|
+
}).strict();
|
|
50
|
+
var codexStageModelSchema = z.object({
|
|
51
|
+
model: z.string().min(1),
|
|
52
|
+
reasoningEffort: z.enum(["medium", "high", "xhigh"]),
|
|
53
|
+
/** The context window Codex must be told: it has no metadata for
|
|
54
|
+
* gateway models and otherwise compacts a session at its own default. */
|
|
55
|
+
contextWindow: z.number().int().positive(),
|
|
56
|
+
pricingUsdPerMillion: modelPricingSchema
|
|
57
|
+
}).strict();
|
|
58
|
+
var researchSearchProviderSchema = z.enum([
|
|
59
|
+
"disabled",
|
|
60
|
+
"dataforseo-google-organic-v1"
|
|
61
|
+
]);
|
|
62
|
+
var internalModelProfileSchema = z.object({
|
|
63
|
+
id: internalModelProfileIdSchema,
|
|
64
|
+
version: z.literal(1),
|
|
65
|
+
pricingCheckedAt: z.iso.date(),
|
|
66
|
+
searchProvider: researchSearchProviderSchema,
|
|
67
|
+
roles: z.object({
|
|
68
|
+
analyzer: internalModelRoleSchema,
|
|
69
|
+
perception: internalModelRoleSchema,
|
|
70
|
+
research: internalModelRoleSchema,
|
|
71
|
+
adjudication: internalModelRoleSchema,
|
|
72
|
+
premiseVerifier: internalModelRoleSchema,
|
|
73
|
+
author: internalModelRoleSchema,
|
|
74
|
+
copy: internalModelRoleSchema,
|
|
75
|
+
domainClassifier: internalModelRoleSchema,
|
|
76
|
+
// Missing on stored profiles: optional enrichment never rewrites pins.
|
|
77
|
+
logoDiscovery: internalModelRoleSchema.optional(),
|
|
78
|
+
competitorClassifier: internalModelRoleSchema.optional(),
|
|
79
|
+
/** Retired roles, still accepted so stored profiles parse unchanged
|
|
80
|
+
* on resume. No new profile resolves them. */
|
|
81
|
+
scrutiny: internalModelRoleSchema.optional(),
|
|
82
|
+
repairPlanner: internalModelRoleSchema.optional(),
|
|
83
|
+
visualReviewer: internalModelRoleSchema.optional()
|
|
84
|
+
}).strict(),
|
|
85
|
+
/** The Codex stages' model. Absent on profiles pinned before the stage
|
|
86
|
+
* model became part of the profile; their host supplies it. */
|
|
87
|
+
stages: codexStageModelSchema.optional()
|
|
88
|
+
}).strict();
|
|
89
|
+
var internalModelProfileDigest = (profile) => {
|
|
90
|
+
return createHash("sha256").update(canonicalJson(internalModelProfileSchema.parse(profile))).digest("hex");
|
|
91
|
+
};
|
|
92
|
+
var internalModelRoleDigest = (roleConfig) => {
|
|
93
|
+
return createHash("sha256").update(canonicalJson(internalModelRoleSchema.parse(roleConfig))).digest("hex");
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export {
|
|
97
|
+
internalModelProfileIdSchema,
|
|
98
|
+
generationBackendSchema,
|
|
99
|
+
modelPricingSchema,
|
|
100
|
+
internalModelRoleSchema,
|
|
101
|
+
codexStageModelSchema,
|
|
102
|
+
researchSearchProviderSchema,
|
|
103
|
+
internalModelProfileSchema,
|
|
104
|
+
internalModelProfileDigest,
|
|
105
|
+
internalModelRoleDigest
|
|
106
|
+
};
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
} from "./chunk-JS3GBU3R.js";
|
|
13
13
|
import {
|
|
14
14
|
batchModelInputs
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-W5DC23OP.js";
|
|
16
16
|
import {
|
|
17
17
|
generateStructured
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CO5T6WU5.js";
|
|
19
19
|
import {
|
|
20
20
|
createLog
|
|
21
21
|
} from "./chunk-ZSEY7AHQ.js";
|