@vexdo/cli 0.2.2 → 0.2.3
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/dist/index.js +23 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -38,9 +38,12 @@ function parseServices(value) {
|
|
|
38
38
|
}
|
|
39
39
|
const name = requireString(readObjectField(service, "name"), `services[${String(index)}].name`);
|
|
40
40
|
const servicePath = requireString(readObjectField(service, "path"), `services[${String(index)}].path`);
|
|
41
|
+
const envIdRaw = readObjectField(service, "env_id");
|
|
42
|
+
const env_id = envIdRaw === void 0 ? void 0 : requireString(envIdRaw, `services[${String(index)}].env_id`);
|
|
41
43
|
return {
|
|
42
44
|
name,
|
|
43
|
-
path: servicePath
|
|
45
|
+
path: servicePath,
|
|
46
|
+
env_id
|
|
44
47
|
};
|
|
45
48
|
});
|
|
46
49
|
}
|
|
@@ -1221,7 +1224,7 @@ async function checkCodexAvailable() {
|
|
|
1221
1224
|
}
|
|
1222
1225
|
}
|
|
1223
1226
|
async function submitTask(prompt, options) {
|
|
1224
|
-
const args = ["cloud", "exec", prompt];
|
|
1227
|
+
const args = ["cloud", "exec", "--env", options?.envId ?? "", prompt];
|
|
1225
1228
|
const result = await runCodexCommand(args, { cwd: options?.cwd });
|
|
1226
1229
|
const sessionId = parseSessionId(result.stdout);
|
|
1227
1230
|
if (result.exitCode !== 0 || !sessionId) {
|
|
@@ -1229,8 +1232,9 @@ async function submitTask(prompt, options) {
|
|
|
1229
1232
|
}
|
|
1230
1233
|
return sessionId;
|
|
1231
1234
|
}
|
|
1232
|
-
async function resumeTask(sessionId, feedback) {
|
|
1233
|
-
const
|
|
1235
|
+
async function resumeTask(sessionId, feedback, options) {
|
|
1236
|
+
const args = ["cloud", "exec", "--env", options?.envId ?? "", "resume", sessionId, feedback];
|
|
1237
|
+
const result = await runCodexCommand(args);
|
|
1234
1238
|
const nextSessionId = parseSessionId(result.stdout);
|
|
1235
1239
|
if (result.exitCode !== 0 || !nextSessionId) {
|
|
1236
1240
|
throw new CodexError("resume_failed", `Failed to resume codex cloud session ${sessionId}.`, result);
|
|
@@ -1374,6 +1378,16 @@ function requireAnthropicApiKey() {
|
|
|
1374
1378
|
async function requireGhAvailable() {
|
|
1375
1379
|
await checkGhAvailable();
|
|
1376
1380
|
}
|
|
1381
|
+
function resolveCodexEnvId(serviceName, configEnvId) {
|
|
1382
|
+
const envVarName = `CODEX_ENV_ID_${serviceName.toUpperCase().replace(/[^A-Z0-9]/g, "_")}`;
|
|
1383
|
+
const envId = configEnvId ?? process.env[envVarName];
|
|
1384
|
+
if (!envId) {
|
|
1385
|
+
throw new Error(
|
|
1386
|
+
`Codex environment ID is required for service "${serviceName}". Set env_id under services.${serviceName} in .vexdo.yml or export ${envVarName}=<id>.`
|
|
1387
|
+
);
|
|
1388
|
+
}
|
|
1389
|
+
return envId;
|
|
1390
|
+
}
|
|
1377
1391
|
|
|
1378
1392
|
// src/lib/review-loop.ts
|
|
1379
1393
|
import path6 from "path";
|
|
@@ -2266,8 +2280,9 @@ async function runStart(taskFile, options) {
|
|
|
2266
2280
|
scopedLogger.info(`[dry-run] Would run codex cloud implementation for service ${step.service}`);
|
|
2267
2281
|
return { service: step.service, status: "done" };
|
|
2268
2282
|
}
|
|
2283
|
+
const envId = options.dryRun ? void 0 : resolveCodexEnvId(step.service, serviceCfg.env_id);
|
|
2269
2284
|
scopedLogger.info("Submitting to Codex Cloud...");
|
|
2270
|
-
const submissionSession = stepState.session_id ?? await submitTask(step.spec, { cwd: serviceRoot });
|
|
2285
|
+
const submissionSession = stepState.session_id ?? await submitTask(step.spec, { cwd: serviceRoot, envId });
|
|
2271
2286
|
await updateStep(projectRoot, task.id, step.service, { session_id: submissionSession });
|
|
2272
2287
|
const execution = await runCloudReviewLoop({
|
|
2273
2288
|
taskId: task.id,
|
|
@@ -2283,7 +2298,8 @@ async function runStart(taskFile, options) {
|
|
|
2283
2298
|
claude,
|
|
2284
2299
|
verbose: options.verbose,
|
|
2285
2300
|
log: scopedLogger,
|
|
2286
|
-
serviceRoot
|
|
2301
|
+
serviceRoot,
|
|
2302
|
+
envId
|
|
2287
2303
|
});
|
|
2288
2304
|
await updateStep(projectRoot, task.id, step.service, {
|
|
2289
2305
|
lastReviewComments: execution.lastReviewComments,
|
|
@@ -2437,7 +2453,7 @@ async function runCloudReviewLoop(opts) {
|
|
|
2437
2453
|
};
|
|
2438
2454
|
}
|
|
2439
2455
|
opts.log.warn(`Review requested fixes (iteration ${String(iteration2 + 1)}/${String(opts.config.review.max_iterations)})`);
|
|
2440
|
-
sessionId = await resumeTask(sessionId, arbiter.feedback_for_codex);
|
|
2456
|
+
sessionId = await resumeTask(sessionId, arbiter.feedback_for_codex, { envId: opts.envId });
|
|
2441
2457
|
opts.stepState.session_id = sessionId;
|
|
2442
2458
|
iteration2 += 1;
|
|
2443
2459
|
opts.stepState.iteration = iteration2;
|