@vexdo/cli 0.2.3 → 0.2.5
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 +18 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var DEFAULT_REVIEW_MODEL = "claude-haiku-4-5-20251001";
|
|
|
16
16
|
var DEFAULT_MAX_ITERATIONS = 3;
|
|
17
17
|
var DEFAULT_AUTO_SUBMIT = false;
|
|
18
18
|
var DEFAULT_CODEX_MODEL = "gpt-4o";
|
|
19
|
+
var DEFAULT_CODEX_BASE_BRANCH = "main";
|
|
19
20
|
function isRecord(value) {
|
|
20
21
|
return typeof value === "object" && value !== null;
|
|
21
22
|
}
|
|
@@ -93,14 +94,16 @@ function parseMaxConcurrent(value) {
|
|
|
93
94
|
}
|
|
94
95
|
function parseCodex(value) {
|
|
95
96
|
if (value === void 0) {
|
|
96
|
-
return { model: DEFAULT_CODEX_MODEL };
|
|
97
|
+
return { model: DEFAULT_CODEX_MODEL, base_branch: DEFAULT_CODEX_BASE_BRANCH };
|
|
97
98
|
}
|
|
98
99
|
if (!isRecord(value)) {
|
|
99
100
|
throw new Error("codex must be an object");
|
|
100
101
|
}
|
|
101
102
|
const modelRaw = readObjectField(value, "model");
|
|
102
103
|
const model = modelRaw === void 0 ? DEFAULT_CODEX_MODEL : requireString(modelRaw, "codex.model");
|
|
103
|
-
|
|
104
|
+
const baseBranchRaw = readObjectField(value, "base_branch");
|
|
105
|
+
const base_branch = baseBranchRaw === void 0 ? DEFAULT_CODEX_BASE_BRANCH : requireString(baseBranchRaw, "codex.base_branch");
|
|
106
|
+
return { model, base_branch };
|
|
104
107
|
}
|
|
105
108
|
function findProjectRoot(startDir = process.cwd()) {
|
|
106
109
|
let current = path.resolve(startDir);
|
|
@@ -1187,9 +1190,13 @@ function runCodexCommand(args, opts) {
|
|
|
1187
1190
|
});
|
|
1188
1191
|
}
|
|
1189
1192
|
function parseSessionId(output2) {
|
|
1190
|
-
const
|
|
1191
|
-
if (
|
|
1192
|
-
return
|
|
1193
|
+
const kvMatch = /session[_-]?id\s*[:=]\s*([A-Za-z0-9._-]+)/i.exec(output2);
|
|
1194
|
+
if (kvMatch?.[1]) {
|
|
1195
|
+
return kvMatch[1];
|
|
1196
|
+
}
|
|
1197
|
+
const urlMatch = /\/codex\/tasks\/([A-Za-z0-9._-]+)/i.exec(output2);
|
|
1198
|
+
if (urlMatch?.[1]) {
|
|
1199
|
+
return urlMatch[1];
|
|
1193
1200
|
}
|
|
1194
1201
|
for (const line of output2.split(/\r?\n/)) {
|
|
1195
1202
|
const trimmed = line.trim();
|
|
@@ -1224,7 +1231,11 @@ async function checkCodexAvailable() {
|
|
|
1224
1231
|
}
|
|
1225
1232
|
}
|
|
1226
1233
|
async function submitTask(prompt, options) {
|
|
1227
|
-
const args = ["cloud", "exec", "--env", options?.envId ?? ""
|
|
1234
|
+
const args = ["cloud", "exec", "--env", options?.envId ?? ""];
|
|
1235
|
+
if (options?.branch) {
|
|
1236
|
+
args.push("--branch", options.branch);
|
|
1237
|
+
}
|
|
1238
|
+
args.push(prompt);
|
|
1228
1239
|
const result = await runCodexCommand(args, { cwd: options?.cwd });
|
|
1229
1240
|
const sessionId = parseSessionId(result.stdout);
|
|
1230
1241
|
if (result.exitCode !== 0 || !sessionId) {
|
|
@@ -2282,7 +2293,7 @@ async function runStart(taskFile, options) {
|
|
|
2282
2293
|
}
|
|
2283
2294
|
const envId = options.dryRun ? void 0 : resolveCodexEnvId(step.service, serviceCfg.env_id);
|
|
2284
2295
|
scopedLogger.info("Submitting to Codex Cloud...");
|
|
2285
|
-
const submissionSession = stepState.session_id ?? await submitTask(step.spec, { cwd: serviceRoot, envId });
|
|
2296
|
+
const submissionSession = stepState.session_id ?? await submitTask(step.spec, { cwd: serviceRoot, envId, branch: config.codex.base_branch });
|
|
2286
2297
|
await updateStep(projectRoot, task.id, step.service, { session_id: submissionSession });
|
|
2287
2298
|
const execution = await runCloudReviewLoop({
|
|
2288
2299
|
taskId: task.id,
|