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
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
hostStepAccounting
|
|
3
|
+
} from "./chunk-FAUFE7MI.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "./chunk-OYKV5NDM.js";
|
|
5
|
+
engineResources
|
|
6
|
+
} from "./chunk-6P7EZJI7.js";
|
|
8
7
|
import {
|
|
9
8
|
createRecommendationVerifier
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
validateAgentCopy
|
|
13
|
-
} from "./chunk-FBFZBLTY.js";
|
|
9
|
+
} from "./chunk-622NMXN6.js";
|
|
14
10
|
import {
|
|
15
11
|
getEnvironment
|
|
16
12
|
} from "./chunk-PO2J5OQ3.js";
|
|
13
|
+
import {
|
|
14
|
+
validateAgentCopy
|
|
15
|
+
} from "./chunk-R6XDZWUL.js";
|
|
17
16
|
import {
|
|
18
17
|
aeoSnapshotSchema
|
|
19
18
|
} from "./chunk-SDWYZM64.js";
|
|
@@ -100,9 +99,8 @@ var materializeCopyInputs = async (args) => {
|
|
|
100
99
|
return written.sort();
|
|
101
100
|
};
|
|
102
101
|
var validateCopyDraft = async (args) => {
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
const accounting = args.accounting ?? models.accounting;
|
|
102
|
+
const verifierProfile = args.verifierRole;
|
|
103
|
+
const accounting = args.accounting ?? hostStepAccounting();
|
|
106
104
|
return validateAgentCopy({
|
|
107
105
|
draft: args.draft,
|
|
108
106
|
config: args.config,
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
internalModelProfileSchema
|
|
3
|
+
} from "./chunk-RYCRL3YA.js";
|
|
4
|
+
|
|
5
|
+
// src/models/local-profile.ts
|
|
6
|
+
var promptVersions = {
|
|
7
|
+
copy: 5,
|
|
8
|
+
premiseVerifier: 5,
|
|
9
|
+
analyzer: 3,
|
|
10
|
+
research: 2,
|
|
11
|
+
adjudication: 2,
|
|
12
|
+
competitorClassifier: 2,
|
|
13
|
+
domainClassifier: 2
|
|
14
|
+
};
|
|
15
|
+
var schemaVersions = {
|
|
16
|
+
copy: 3,
|
|
17
|
+
adjudication: 2,
|
|
18
|
+
premiseVerifier: 2
|
|
19
|
+
};
|
|
20
|
+
var reasoningAllowanceTokens = 32768;
|
|
21
|
+
var roleSizing = {
|
|
22
|
+
analyzer: { maxOutputTokens: 16384, deadlineMs: 18e4 },
|
|
23
|
+
perception: { maxOutputTokens: 16384, deadlineMs: 3e5 },
|
|
24
|
+
research: { maxOutputTokens: 4096, deadlineMs: 6e4 },
|
|
25
|
+
adjudication: { maxOutputTokens: 16384, deadlineMs: 3e5 },
|
|
26
|
+
premiseVerifier: { maxOutputTokens: 8192, deadlineMs: 18e4 },
|
|
27
|
+
author: { maxOutputTokens: 24576, deadlineMs: 3e5 },
|
|
28
|
+
copy: { maxOutputTokens: 24576, deadlineMs: 3e5 },
|
|
29
|
+
domainClassifier: { maxOutputTokens: 16384, deadlineMs: 18e4 },
|
|
30
|
+
competitorClassifier: { maxOutputTokens: 8192, deadlineMs: 3e5 }
|
|
31
|
+
};
|
|
32
|
+
var createRoleConfig = (name, model, sizing) => {
|
|
33
|
+
const allowance = model.thinkingInOutput ? reasoningAllowanceTokens : 0;
|
|
34
|
+
const roleConfig = {
|
|
35
|
+
model: model.id,
|
|
36
|
+
providerOptions: model.providerOptions,
|
|
37
|
+
promptVersion: `${name}-grounding-v${promptVersions[name] ?? 1}`,
|
|
38
|
+
schemaVersion: `${name}-v${schemaVersions[name] ?? 1}`,
|
|
39
|
+
deadlineMs: sizing.deadlineMs,
|
|
40
|
+
maxInputTokens: 8e4,
|
|
41
|
+
maxOutputTokens: Math.min(
|
|
42
|
+
sizing.maxOutputTokens + allowance,
|
|
43
|
+
model.maxOutputTokens
|
|
44
|
+
),
|
|
45
|
+
pricingUsdPerMillion: model.pricingUsdPerMillion
|
|
46
|
+
};
|
|
47
|
+
return roleConfig;
|
|
48
|
+
};
|
|
49
|
+
var localStageModel = (model) => {
|
|
50
|
+
return {
|
|
51
|
+
model: model.id,
|
|
52
|
+
reasoningEffort: model.stageReasoningEffort,
|
|
53
|
+
contextWindow: model.contextWindow,
|
|
54
|
+
pricingUsdPerMillion: model.pricingUsdPerMillion
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
var localModelProfile = (model, { searchProvider }) => {
|
|
58
|
+
const role = (name) => {
|
|
59
|
+
return createRoleConfig(name, model, roleSizing[name]);
|
|
60
|
+
};
|
|
61
|
+
const roles = {
|
|
62
|
+
analyzer: role("analyzer"),
|
|
63
|
+
perception: role("perception"),
|
|
64
|
+
research: role("research"),
|
|
65
|
+
adjudication: role("adjudication"),
|
|
66
|
+
premiseVerifier: role("premiseVerifier"),
|
|
67
|
+
author: role("author"),
|
|
68
|
+
copy: role("copy"),
|
|
69
|
+
domainClassifier: role("domainClassifier"),
|
|
70
|
+
competitorClassifier: role("competitorClassifier")
|
|
71
|
+
};
|
|
72
|
+
const profile = internalModelProfileSchema.parse({
|
|
73
|
+
id: `local:${model.id}`,
|
|
74
|
+
version: 1,
|
|
75
|
+
pricingCheckedAt: model.pricingCheckedAt,
|
|
76
|
+
searchProvider,
|
|
77
|
+
roles: {
|
|
78
|
+
...roles,
|
|
79
|
+
logoDiscovery: {
|
|
80
|
+
...createRoleConfig("logoDiscovery", model, {
|
|
81
|
+
maxOutputTokens: 1024,
|
|
82
|
+
deadlineMs: 6e4
|
|
83
|
+
}),
|
|
84
|
+
promptVersion: "logoDiscovery-grounding-v2",
|
|
85
|
+
schemaVersion: "logoDiscovery-v2",
|
|
86
|
+
maxInputTokens: 24e3
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
stages: localStageModel(model)
|
|
90
|
+
});
|
|
91
|
+
return profile;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
localStageModel,
|
|
96
|
+
localModelProfile
|
|
97
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEnvironment
|
|
3
|
+
} from "./chunk-PO2J5OQ3.js";
|
|
4
|
+
|
|
5
|
+
// src/codex-workflow/codex-binary.ts
|
|
6
|
+
import { execFile } from "node:child_process";
|
|
7
|
+
import { readFileSync } from "node:fs";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import path from "node:path";
|
|
10
|
+
import { promisify } from "node:util";
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
var codexManifestSchema = z.object({
|
|
13
|
+
version: z.string().min(1),
|
|
14
|
+
bin: z.object({ codex: z.string().min(1) })
|
|
15
|
+
});
|
|
16
|
+
var resolveCodexBinary = (env = getEnvironment()) => {
|
|
17
|
+
const override = env.AEO_CODEX_BIN;
|
|
18
|
+
if (override !== void 0 && override !== "") {
|
|
19
|
+
return codexBinaryAt(override);
|
|
20
|
+
}
|
|
21
|
+
const require2 = createRequire(import.meta.url);
|
|
22
|
+
const manifestFile = require2.resolve("@openai/codex/package.json");
|
|
23
|
+
const manifest = codexManifestSchema.parse(
|
|
24
|
+
JSON.parse(readFileSync(manifestFile, "utf8"))
|
|
25
|
+
);
|
|
26
|
+
const script = path.join(path.dirname(manifestFile), manifest.bin.codex);
|
|
27
|
+
const binary = {
|
|
28
|
+
command: process.execPath,
|
|
29
|
+
prefixArgs: [script],
|
|
30
|
+
path: script,
|
|
31
|
+
source: "dependency",
|
|
32
|
+
version: manifest.version
|
|
33
|
+
};
|
|
34
|
+
return binary;
|
|
35
|
+
};
|
|
36
|
+
var codexBinaryAt = (command) => {
|
|
37
|
+
return {
|
|
38
|
+
command,
|
|
39
|
+
prefixArgs: [],
|
|
40
|
+
path: command,
|
|
41
|
+
source: "AEO_CODEX_BIN",
|
|
42
|
+
version: null
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var codexArgs = (binary, args) => {
|
|
46
|
+
return [...binary.prefixArgs, ...args];
|
|
47
|
+
};
|
|
48
|
+
var codexBinaryVersion = async (binary = resolveCodexBinary()) => {
|
|
49
|
+
try {
|
|
50
|
+
const { stdout } = await promisify(execFile)(
|
|
51
|
+
binary.command,
|
|
52
|
+
codexArgs(binary, ["--version"]),
|
|
53
|
+
{ timeout: 15e3 }
|
|
54
|
+
);
|
|
55
|
+
const [firstLine] = stdout.trim().split("\n");
|
|
56
|
+
return firstLine === void 0 || firstLine === "" ? null : firstLine;
|
|
57
|
+
} catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export {
|
|
63
|
+
resolveCodexBinary,
|
|
64
|
+
codexBinaryAt,
|
|
65
|
+
codexArgs,
|
|
66
|
+
codexBinaryVersion
|
|
67
|
+
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
auditFileVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OU73OUX4.js";
|
|
4
|
+
import {
|
|
5
|
+
recommendedModelId
|
|
6
|
+
} from "./chunk-W5X7WJYL.js";
|
|
4
7
|
|
|
5
8
|
// src/engine/templates.ts
|
|
6
9
|
var exampleAuditFile = {
|
|
7
10
|
version: auditFileVersion,
|
|
11
|
+
model: recommendedModelId,
|
|
8
12
|
brand: {
|
|
9
13
|
name: "Northwind Data",
|
|
10
14
|
domain: "northwind.example",
|
|
@@ -37,8 +41,9 @@ var exampleAuditFile = {
|
|
|
37
41
|
grounding: "full",
|
|
38
42
|
runPolicy: {
|
|
39
43
|
maxPlannedUnits: 100,
|
|
40
|
-
//
|
|
41
|
-
|
|
44
|
+
// No dollar cap here: approve one per run with `run --max-usd`, after
|
|
45
|
+
// `literally-aeo plan` shows the estimate. It caps every paid call.
|
|
46
|
+
budget: { maxHours: 12 }
|
|
42
47
|
}
|
|
43
48
|
};
|
|
44
49
|
var exampleEnvFile = `# Settings literally-aeo reads. Keep this file out of source control.
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
canonicalizeQualifiedNames
|
|
3
|
+
} from "./chunk-EJ655TVU.js";
|
|
1
4
|
import {
|
|
2
5
|
assembleSectionResult
|
|
3
6
|
} from "./chunk-DC6PN7QJ.js";
|
|
4
|
-
import {
|
|
5
|
-
canonicalizeQualifiedNames
|
|
6
|
-
} from "./chunk-AUB5THIS.js";
|
|
7
7
|
import {
|
|
8
8
|
answerFilePath,
|
|
9
9
|
answerSectionPrefix
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-LOBXOZ2R.js";
|
|
11
11
|
import {
|
|
12
12
|
analyzeOutputSchema,
|
|
13
13
|
qualifyOutputSchema
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-6GHHNPFJ.js";
|
|
15
15
|
import {
|
|
16
16
|
extractCitedUrls,
|
|
17
17
|
normalizeResponseText
|
|
@@ -13,13 +13,13 @@ import {
|
|
|
13
13
|
perceptionExtractionSchema,
|
|
14
14
|
perceptionModel,
|
|
15
15
|
perceptionVersion
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SHUMCKCS.js";
|
|
17
17
|
import {
|
|
18
18
|
competitorClassifierVersion
|
|
19
19
|
} from "./chunk-YIEAIIND.js";
|
|
20
20
|
import {
|
|
21
21
|
learnDomainLabels
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-NCXSNHXX.js";
|
|
23
23
|
import {
|
|
24
24
|
perceptionKey
|
|
25
25
|
} from "./chunk-5SOTF3XD.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-ZCOI3HE2.js";
|
|
32
32
|
import {
|
|
33
33
|
internalModelRoleDigest
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-RYCRL3YA.js";
|
|
35
35
|
import {
|
|
36
36
|
aeoSnapshotSchema,
|
|
37
37
|
aeoSnapshotVersion
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
describeSupportedModels,
|
|
3
|
+
findSupportedModel,
|
|
4
|
+
recommendedModelId
|
|
5
|
+
} from "./chunk-W5X7WJYL.js";
|
|
1
6
|
import {
|
|
2
7
|
agentAuthEnv,
|
|
3
8
|
cliNameForSurface,
|
|
4
9
|
detectAgentClis,
|
|
5
10
|
versionForSurface
|
|
6
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HTOD4W4E.js";
|
|
12
|
+
import {
|
|
13
|
+
codexBinaryVersion,
|
|
14
|
+
resolveCodexBinary
|
|
15
|
+
} from "./chunk-U772TN32.js";
|
|
7
16
|
import {
|
|
17
|
+
agentSurfaces,
|
|
8
18
|
isAgentSurface
|
|
9
19
|
} from "./chunk-OBXAHX3L.js";
|
|
10
20
|
|
|
@@ -58,6 +68,46 @@ var directoryCheck = async (dir) => {
|
|
|
58
68
|
return { name: "run directory", ok: false, detail: `${dir}: ${message}` };
|
|
59
69
|
}
|
|
60
70
|
};
|
|
71
|
+
var modelCheck = (model) => {
|
|
72
|
+
const id = model ?? recommendedModelId;
|
|
73
|
+
const supported = findSupportedModel(id);
|
|
74
|
+
if (!supported) {
|
|
75
|
+
return {
|
|
76
|
+
name: "model",
|
|
77
|
+
ok: false,
|
|
78
|
+
detail: [
|
|
79
|
+
`${id} is not supported; use one of:`,
|
|
80
|
+
...describeSupportedModels()
|
|
81
|
+
].join("\n ")
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
name: "model",
|
|
86
|
+
ok: true,
|
|
87
|
+
detail: [
|
|
88
|
+
`${supported.id}${model === void 0 ? " (recommended; audit.json names none)" : ""}`,
|
|
89
|
+
supported.stageRuntimeVerifiedAt === null ? "not yet verified on the Codex stage runtime through the gateway" : `verified on the Codex stage runtime ${supported.stageRuntimeVerifiedAt}`
|
|
90
|
+
].join("; ")
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
var codexCheck = async () => {
|
|
94
|
+
try {
|
|
95
|
+
const binary = resolveCodexBinary();
|
|
96
|
+
const version = await codexBinaryVersion(binary);
|
|
97
|
+
const origin = binary.source === "dependency" ? "the package's own pinned dependency" : `AEO_CODEX_BIN=${binary.path}`;
|
|
98
|
+
return {
|
|
99
|
+
name: "codex (stage runtime)",
|
|
100
|
+
ok: version !== null,
|
|
101
|
+
detail: version === null ? `${binary.path} did not start; reinstall literally-aeo` : `${version}, from ${origin}`
|
|
102
|
+
};
|
|
103
|
+
} catch (err) {
|
|
104
|
+
return {
|
|
105
|
+
name: "codex (stage runtime)",
|
|
106
|
+
ok: false,
|
|
107
|
+
detail: `not installed with the package (${err instanceof Error ? err.message : String(err)}); reinstall literally-aeo`
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
};
|
|
61
111
|
var runPreflight = async (args) => {
|
|
62
112
|
const { surfaces, settings } = args;
|
|
63
113
|
const nodeMajor = Number(process.versions.node.split(".")[0]);
|
|
@@ -69,12 +119,9 @@ var runPreflight = async (args) => {
|
|
|
69
119
|
ok: nodeMajor >= minimumNodeMajor,
|
|
70
120
|
detail: `${process.version} (${minimumNodeMajor} or newer required)`
|
|
71
121
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
ok: versions.codex !== null,
|
|
76
|
-
detail: versions.codex ?? "not found on PATH; the workflow stages need it"
|
|
77
|
-
},
|
|
122
|
+
modelCheck(args.model),
|
|
123
|
+
// Every stage session runs on Codex, whatever is measured.
|
|
124
|
+
await codexCheck(),
|
|
78
125
|
settingCheck(gatewaySetting, settings)
|
|
79
126
|
];
|
|
80
127
|
if (surfaces.includes("google_ai_overview") || args.groundingSearch) {
|
|
@@ -91,6 +138,17 @@ var runPreflight = async (args) => {
|
|
|
91
138
|
detail: version === null ? `\`${cliNameForSurface(surface)}\` not found on PATH` : `${cliNameForSurface(surface)} ${version}; ${auth.kind === "variable" ? `authenticates with ${auth.name}` : "uses the CLI login on this machine, checked by a canary before the run"}`
|
|
92
139
|
});
|
|
93
140
|
}
|
|
141
|
+
for (const surface of agentSurfaces) {
|
|
142
|
+
if (agents.includes(surface)) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const version = versionForSurface(surface, versions);
|
|
146
|
+
checks.push({
|
|
147
|
+
name: `${surface} CLI`,
|
|
148
|
+
ok: true,
|
|
149
|
+
detail: version === null ? `\`${cliNameForSurface(surface)}\` not installed; needed only when the config measures coding agents` : `${cliNameForSurface(surface)} ${version} installed; this config does not measure it`
|
|
150
|
+
});
|
|
151
|
+
}
|
|
94
152
|
checks.push(await directoryCheck(args.dir));
|
|
95
153
|
return checks;
|
|
96
154
|
};
|
|
@@ -100,5 +158,6 @@ export {
|
|
|
100
158
|
credentialSettingNames,
|
|
101
159
|
runSettingNames,
|
|
102
160
|
agentAuthMode,
|
|
161
|
+
modelCheck,
|
|
103
162
|
runPreflight
|
|
104
163
|
};
|
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
} from "./chunk-SREGO3PU.js";
|
|
9
9
|
import {
|
|
10
10
|
assessTraceCoverage
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5JPYM4MD.js";
|
|
12
12
|
import {
|
|
13
13
|
readJournal
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YRBIC5QH.js";
|
|
15
15
|
import {
|
|
16
16
|
bundlePaths,
|
|
17
17
|
digestManifest,
|
|
18
18
|
objectPathPrefix
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WVACVWBL.js";
|
|
20
20
|
import {
|
|
21
21
|
sha256Hex
|
|
22
22
|
} from "./chunk-E6NQQU6V.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
proposedAssessmentSchema
|
|
3
|
+
} from "./chunk-IE7NAL6B.js";
|
|
1
4
|
import {
|
|
2
5
|
ResearchLimitError,
|
|
3
6
|
ResearchOwnershipError,
|
|
4
7
|
researchCallCharge
|
|
5
8
|
} from "./chunk-Y4OGZ3Q5.js";
|
|
6
|
-
import {
|
|
7
|
-
proposedAssessmentSchema
|
|
8
|
-
} from "./chunk-WUELMJ22.js";
|
|
9
9
|
import {
|
|
10
10
|
researchActionSchema,
|
|
11
11
|
researchToolResultSchema
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codexStageModelSchema,
|
|
3
|
+
internalModelRoleSchema,
|
|
4
|
+
modelPricingSchema
|
|
5
|
+
} from "./chunk-RYCRL3YA.js";
|
|
6
|
+
|
|
7
|
+
// src/models/supported-models.ts
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
var supportedModelSchema = z.object({
|
|
10
|
+
/** The gateway model ID, as audit.json's `model` names it. */
|
|
11
|
+
id: z.string().min(1),
|
|
12
|
+
label: z.string().min(1),
|
|
13
|
+
pricingUsdPerMillion: modelPricingSchema,
|
|
14
|
+
pricingCheckedAt: z.iso.date(),
|
|
15
|
+
contextWindow: z.number().int().positive(),
|
|
16
|
+
maxOutputTokens: z.number().int().positive(),
|
|
17
|
+
/** The model's hidden reasoning is billed inside the output allowance,
|
|
18
|
+
* so every role is given room to think on top of its answer. */
|
|
19
|
+
thinkingInOutput: z.boolean(),
|
|
20
|
+
providerOptions: internalModelRoleSchema.shape.providerOptions,
|
|
21
|
+
stageReasoningEffort: codexStageModelSchema.shape.reasoningEffort,
|
|
22
|
+
/** The date a real batch ran through the gateway on Codex's Responses
|
|
23
|
+
* wire API with this model (the spike, spec §4.3); null until then. */
|
|
24
|
+
stageRuntimeVerifiedAt: z.iso.date().nullable()
|
|
25
|
+
}).strict();
|
|
26
|
+
var supportedModels = [
|
|
27
|
+
{
|
|
28
|
+
id: "anthropic/claude-opus-5.5",
|
|
29
|
+
label: "Claude Opus 5.5",
|
|
30
|
+
pricingUsdPerMillion: { input: 4, output: 20, cachedInput: 0.2 },
|
|
31
|
+
pricingCheckedAt: "2026-11-04",
|
|
32
|
+
contextWindow: 1e6,
|
|
33
|
+
maxOutputTokens: 128e3,
|
|
34
|
+
thinkingInOutput: true,
|
|
35
|
+
providerOptions: { gateway: { reasoning: { effort: "high" } } },
|
|
36
|
+
stageReasoningEffort: "high",
|
|
37
|
+
stageRuntimeVerifiedAt: "2026-11-04"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "anthropic/claude-sonnet-5.5",
|
|
41
|
+
label: "Claude Sonnet 5.5",
|
|
42
|
+
pricingUsdPerMillion: { input: 2, output: 10, cachedInput: 0.2 },
|
|
43
|
+
pricingCheckedAt: "2026-11-04",
|
|
44
|
+
contextWindow: 1e6,
|
|
45
|
+
maxOutputTokens: 128e3,
|
|
46
|
+
thinkingInOutput: true,
|
|
47
|
+
providerOptions: { gateway: { reasoning: { effort: "high" } } },
|
|
48
|
+
stageReasoningEffort: "high",
|
|
49
|
+
stageRuntimeVerifiedAt: "2026-11-04"
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
var recommendedModelId = "anthropic/claude-opus-5.5";
|
|
53
|
+
var describeSupportedModels = () => {
|
|
54
|
+
const lines = supportedModels.map((model) => {
|
|
55
|
+
const { input, cachedInput, output } = model.pricingUsdPerMillion;
|
|
56
|
+
const recommended = model.id === recommendedModelId ? " (recommended)" : "";
|
|
57
|
+
return `${model.id}${recommended}: ${model.label}, $${input} in / $${cachedInput} cached / $${output} out per million tokens (checked ${model.pricingCheckedAt})`;
|
|
58
|
+
});
|
|
59
|
+
return lines;
|
|
60
|
+
};
|
|
61
|
+
var findSupportedModel = (id) => {
|
|
62
|
+
return supportedModels.find((model) => model.id === id);
|
|
63
|
+
};
|
|
64
|
+
var UnsupportedModelError = class extends Error {
|
|
65
|
+
constructor(id) {
|
|
66
|
+
super(
|
|
67
|
+
[
|
|
68
|
+
`${id} is not a supported model. Set audit.json's "model" to one of:`,
|
|
69
|
+
...describeSupportedModels().map((line) => ` ${line}`)
|
|
70
|
+
].join("\n")
|
|
71
|
+
);
|
|
72
|
+
this.name = "UnsupportedModelError";
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var resolveSupportedModel = (id = recommendedModelId) => {
|
|
76
|
+
const model = findSupportedModel(id);
|
|
77
|
+
if (!model) {
|
|
78
|
+
throw new UnsupportedModelError(id);
|
|
79
|
+
}
|
|
80
|
+
return model;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export {
|
|
84
|
+
supportedModelSchema,
|
|
85
|
+
supportedModels,
|
|
86
|
+
recommendedModelId,
|
|
87
|
+
describeSupportedModels,
|
|
88
|
+
findSupportedModel,
|
|
89
|
+
UnsupportedModelError,
|
|
90
|
+
resolveSupportedModel
|
|
91
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
captureArtifactSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YAAUWCJ4.js";
|
|
4
4
|
import {
|
|
5
5
|
canonicalDigest
|
|
6
6
|
} from "./chunk-E6NQQU6V.js";
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
// src/bundle/contracts.ts
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
var toolId = "literally-aeo";
|
|
14
|
-
var toolVersion = "0.
|
|
14
|
+
var toolVersion = "0.2.0";
|
|
15
15
|
var bundleSchemaVersion = 1;
|
|
16
16
|
var traceSchemaVersion = 1;
|
|
17
17
|
var canonicalization = "literally-aeo-canonical-json-v1";
|
|
@@ -1,28 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codexBinaryVersion,
|
|
3
|
+
resolveCodexBinary
|
|
4
|
+
} from "./chunk-U772TN32.js";
|
|
1
5
|
import {
|
|
2
6
|
getEnvironment
|
|
3
7
|
} from "./chunk-PO2J5OQ3.js";
|
|
4
8
|
|
|
5
9
|
// src/codex-workflow/codex-home.ts
|
|
6
|
-
import { execFile } from "node:child_process";
|
|
7
10
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
8
11
|
import path from "node:path";
|
|
9
|
-
|
|
10
|
-
var codexModel = {
|
|
12
|
+
var codexGateway = {
|
|
11
13
|
provider: "vercel",
|
|
12
14
|
providerName: "Vercel AI Gateway",
|
|
13
15
|
baseUrl: "https://ai-gateway.vercel.sh/v1",
|
|
14
16
|
/** The environment variable the gateway key is read from; the only
|
|
15
17
|
* secret the child process sees. */
|
|
16
18
|
apiKeyEnv: "AI_GATEWAY_API_KEY",
|
|
17
|
-
wireApi: "responses"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
wireApi: "responses"
|
|
20
|
+
};
|
|
21
|
+
var codexStageConfig = (stageModel) => {
|
|
22
|
+
const config = {
|
|
23
|
+
...codexGateway,
|
|
24
|
+
model: stageModel.model,
|
|
25
|
+
reasoningEffort: stageModel.reasoningEffort,
|
|
26
|
+
contextWindow: stageModel.contextWindow
|
|
27
|
+
};
|
|
28
|
+
return config;
|
|
26
29
|
};
|
|
27
30
|
var codexHomeDir = (workdir) => {
|
|
28
31
|
return path.join(workdir, ".codex-home");
|
|
@@ -30,7 +33,8 @@ var codexHomeDir = (workdir) => {
|
|
|
30
33
|
var tomlString = (value) => {
|
|
31
34
|
return JSON.stringify(value);
|
|
32
35
|
};
|
|
33
|
-
var codexConfigToml = (workdir, research) => {
|
|
36
|
+
var codexConfigToml = (workdir, { stageModel, research }) => {
|
|
37
|
+
const codexModel = codexStageConfig(stageModel);
|
|
34
38
|
const underTmp = workdir === "/tmp" || workdir.startsWith("/tmp/");
|
|
35
39
|
return [
|
|
36
40
|
`model = "${codexModel.model}"`,
|
|
@@ -88,11 +92,11 @@ var codexConfigToml = (workdir, research) => {
|
|
|
88
92
|
] : []
|
|
89
93
|
].join("\n");
|
|
90
94
|
};
|
|
91
|
-
var prepareCodexHome = async (workdir, env = getEnvironment()
|
|
92
|
-
const apiKey = env[
|
|
95
|
+
var prepareCodexHome = async (workdir, { stageModel, research, env = getEnvironment() }) => {
|
|
96
|
+
const apiKey = env[codexGateway.apiKeyEnv];
|
|
93
97
|
if (!apiKey) {
|
|
94
98
|
throw new Error(
|
|
95
|
-
`${
|
|
99
|
+
`${codexGateway.apiKeyEnv} is not set; the Codex stages run on ${stageModel.model} through the gateway and need it.`
|
|
96
100
|
);
|
|
97
101
|
}
|
|
98
102
|
const home = codexHomeDir(workdir);
|
|
@@ -102,26 +106,18 @@ var prepareCodexHome = async (workdir, env = getEnvironment(), research) => {
|
|
|
102
106
|
await writeFile(path.join(workdir, ".aeo-report-root"), "");
|
|
103
107
|
await writeFile(
|
|
104
108
|
path.join(home, "config.toml"),
|
|
105
|
-
codexConfigToml(workdir, research)
|
|
109
|
+
codexConfigToml(workdir, { stageModel, research })
|
|
106
110
|
);
|
|
107
111
|
return {
|
|
108
112
|
PATH: env.PATH ?? "",
|
|
109
113
|
HOME: home,
|
|
110
114
|
CODEX_HOME: home,
|
|
111
115
|
TMPDIR: temporaryDirectory,
|
|
112
|
-
[
|
|
116
|
+
[codexGateway.apiKeyEnv]: apiKey
|
|
113
117
|
};
|
|
114
118
|
};
|
|
115
|
-
var codexCliVersion = async (
|
|
116
|
-
|
|
117
|
-
const { stdout } = await promisify(execFile)(command, ["--version"], {
|
|
118
|
-
timeout: 15e3
|
|
119
|
-
});
|
|
120
|
-
const [firstLine] = stdout.trim().split("\n");
|
|
121
|
-
return firstLine === void 0 || firstLine === "" ? null : firstLine;
|
|
122
|
-
} catch {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
119
|
+
var codexCliVersion = async (binary = resolveCodexBinary()) => {
|
|
120
|
+
return codexBinaryVersion(binary);
|
|
125
121
|
};
|
|
126
122
|
var workflowSecrets = (env) => {
|
|
127
123
|
return [env.AEO_DATABASE_URL, env.AI_GATEWAY_API_KEY].filter(
|
|
@@ -130,7 +126,8 @@ var workflowSecrets = (env) => {
|
|
|
130
126
|
};
|
|
131
127
|
|
|
132
128
|
export {
|
|
133
|
-
|
|
129
|
+
codexGateway,
|
|
130
|
+
codexStageConfig,
|
|
134
131
|
codexHomeDir,
|
|
135
132
|
codexConfigToml,
|
|
136
133
|
prepareCodexHome,
|