@sireai/optimus 0.1.10 → 0.1.13
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/cli/optimus.js +55 -10
- package/dist/cli/optimus.js.map +1 -1
- package/dist/config/load-config.js +1 -1
- package/dist/integrations/jira/jira-client.d.ts +7 -1
- package/dist/integrations/jira/jira-client.js +18 -0
- package/dist/integrations/jira/jira-client.js.map +1 -1
- package/dist/problem-solving-core/codex/codex-auth-resolver.d.ts +3 -0
- package/dist/problem-solving-core/codex/codex-auth-resolver.js +101 -17
- package/dist/problem-solving-core/codex/codex-auth-resolver.js.map +1 -1
- package/dist/problem-solving-core/codex/codex-connectivity-checks.js +24 -14
- package/dist/problem-solving-core/codex/codex-connectivity-checks.js.map +1 -1
- package/dist/problem-solving-core/codex/codex-preflight.d.ts +0 -1
- package/dist/problem-solving-core/codex/codex-preflight.js +5 -21
- package/dist/problem-solving-core/codex/codex-preflight.js.map +1 -1
- package/dist/problem-solving-core/codex/codex-runner.js +10 -2
- package/dist/problem-solving-core/codex/codex-runner.js.map +1 -1
- package/dist/task-environment/delivery/task-publication-service.d.ts +4 -1
- package/dist/task-environment/delivery/task-publication-service.js +112 -5
- package/dist/task-environment/delivery/task-publication-service.js.map +1 -1
- package/dist/task-environment/orchestration/task-orchestrator.js +1 -0
- package/dist/task-environment/orchestration/task-orchestrator.js.map +1 -1
- package/dist/task-environment/orchestration/triage-runner.js +10 -2
- package/dist/task-environment/orchestration/triage-runner.js.map +1 -1
- package/dist/types.d.ts +14 -1
- package/optimus.config.template.json +1 -1
- package/package.json +1 -1
- package/task-harnesses/bugfix/STANDARD.md +20 -14
package/dist/cli/optimus.js
CHANGED
|
@@ -1039,12 +1039,13 @@ async function resolveDefaultSetupAnswers() {
|
|
|
1039
1039
|
enableSentry: false
|
|
1040
1040
|
};
|
|
1041
1041
|
}
|
|
1042
|
+
const rawConfig = await readRawProjectConfig(configPath);
|
|
1042
1043
|
const config = await loadConfig(configPath);
|
|
1043
1044
|
const store = new SQLiteTaskStore(config.storage.rootDir);
|
|
1044
1045
|
await store.init();
|
|
1045
1046
|
const repositories = await store.listRepositoryRoots();
|
|
1046
1047
|
const primaryRepository = repositories[0];
|
|
1047
|
-
const provider = config.codex.provider;
|
|
1048
|
+
const provider = config.codex.provider ?? resolveSetupCachedProvider(rawConfig);
|
|
1048
1049
|
return {
|
|
1049
1050
|
repoPath: primaryRepository?.path ?? "",
|
|
1050
1051
|
repoAlias: primaryRepository?.alias ?? "",
|
|
@@ -1183,8 +1184,45 @@ function resolveSetupCodexApiKeyEnvName(answers) {
|
|
|
1183
1184
|
}
|
|
1184
1185
|
return undefined;
|
|
1185
1186
|
}
|
|
1186
|
-
function
|
|
1187
|
+
function normalizeSetupCachedProvider(input) {
|
|
1188
|
+
if (!input || typeof input !== "object") {
|
|
1189
|
+
return undefined;
|
|
1190
|
+
}
|
|
1191
|
+
const candidate = input;
|
|
1192
|
+
const id = candidate.id?.trim();
|
|
1193
|
+
const displayName = candidate.displayName?.trim();
|
|
1194
|
+
const baseUrl = candidate.baseUrl?.trim();
|
|
1195
|
+
const apiKeyEnvName = candidate.apiKeyEnvName?.trim();
|
|
1196
|
+
const wireApi = candidate.wireApi;
|
|
1197
|
+
if (!id || !displayName || !baseUrl || !apiKeyEnvName || (wireApi !== "responses" && wireApi !== "chat")) {
|
|
1198
|
+
return undefined;
|
|
1199
|
+
}
|
|
1200
|
+
return {
|
|
1201
|
+
id,
|
|
1202
|
+
displayName,
|
|
1203
|
+
baseUrl,
|
|
1204
|
+
apiKeyEnvName,
|
|
1205
|
+
wireApi
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
function resolveSetupCachedProvider(rawConfig) {
|
|
1209
|
+
const activeProvider = normalizeSetupCachedProvider(rawConfig?.codex?.provider);
|
|
1210
|
+
if (activeProvider) {
|
|
1211
|
+
return activeProvider;
|
|
1212
|
+
}
|
|
1213
|
+
return normalizeSetupCachedProvider(rawConfig?.codex?.setupCache?.modelProvider);
|
|
1214
|
+
}
|
|
1215
|
+
function buildSetupConfig(answers, rawConfig) {
|
|
1187
1216
|
const config = buildDefaultConfig();
|
|
1217
|
+
const cachedProvider = answers.codexAuthMode === "model_provider"
|
|
1218
|
+
? {
|
|
1219
|
+
id: answers.codexProviderId.trim(),
|
|
1220
|
+
displayName: answers.codexProviderDisplayName.trim(),
|
|
1221
|
+
baseUrl: answers.codexProviderBaseUrl.trim(),
|
|
1222
|
+
apiKeyEnvName: answers.codexProviderApiKeyEnvName.trim(),
|
|
1223
|
+
wireApi: "responses"
|
|
1224
|
+
}
|
|
1225
|
+
: resolveSetupCachedProvider(rawConfig);
|
|
1188
1226
|
config.codex.auth.mode = answers.codexAuthMode;
|
|
1189
1227
|
if (answers.codexAuthMode === "model_provider") {
|
|
1190
1228
|
config.codex.provider = {
|
|
@@ -1198,6 +1236,14 @@ function buildSetupConfig(answers) {
|
|
|
1198
1236
|
else {
|
|
1199
1237
|
delete config.codex.provider;
|
|
1200
1238
|
}
|
|
1239
|
+
if (cachedProvider) {
|
|
1240
|
+
config.codex.setupCache = {
|
|
1241
|
+
modelProvider: cachedProvider
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
else {
|
|
1245
|
+
delete config.codex.setupCache;
|
|
1246
|
+
}
|
|
1201
1247
|
config.delivery.channels = answers.enableFeishu ? ["console", "feishu"] : ["console"];
|
|
1202
1248
|
config.delivery.feishu = {
|
|
1203
1249
|
...config.delivery.feishu,
|
|
@@ -1329,18 +1375,16 @@ async function runQuickDoctor(configPath = resolveDefaultConfigPath()) {
|
|
|
1329
1375
|
if (!codexAuth.authenticated) {
|
|
1330
1376
|
blocking.push({
|
|
1331
1377
|
code: "codex_auth_missing",
|
|
1332
|
-
message: `Codex authentication is missing. Required credential: ${codexAuth.
|
|
1333
|
-
fix: codexAuth.
|
|
1334
|
-
? `Provide ${codexAuth.apiKeyEnvName} in .env.local, or rerun \`optimus setup\` and enter the Codex API key.`
|
|
1335
|
-
: "Rerun `optimus setup` and select a supported Codex auth mode."
|
|
1378
|
+
message: `Codex authentication is missing for ${codexAuth.validationPath}. Required credential: ${codexAuth.requirement}.`,
|
|
1379
|
+
fix: codexAuth.fixHint
|
|
1336
1380
|
});
|
|
1337
1381
|
next.add("optimus setup");
|
|
1338
1382
|
}
|
|
1339
|
-
if (codexAuth.mode === "codex_cli_login") {
|
|
1383
|
+
if (codexAuth.mode === "codex_cli_login" && codexAuth.authenticated) {
|
|
1340
1384
|
warnings.push({
|
|
1341
|
-
code: "
|
|
1385
|
+
code: "codex_cli_login_resolved",
|
|
1342
1386
|
message: "Codex auth mode is codex_cli_login.",
|
|
1343
|
-
impact:
|
|
1387
|
+
impact: `Local Codex CLI login was resolved from ${codexAuth.authFilePath ?? "~/.codex/auth.json"}.`
|
|
1344
1388
|
});
|
|
1345
1389
|
}
|
|
1346
1390
|
if (!config.codex.model?.trim()) {
|
|
@@ -1502,8 +1546,9 @@ async function runSetup(args) {
|
|
|
1502
1546
|
const resolvedExecutionMode = existingRepository?.executionMode ?? describeRepositoryExecutionPlan({ executionMode: "copy" }, inspection).resolvedDefaultMode;
|
|
1503
1547
|
const previewExecutionPlan = describeRepositoryExecutionPlan({ executionMode: resolvedExecutionMode }, inspection);
|
|
1504
1548
|
const reviewSystem = await detectRepositoryReviewSystem(normalizedRepoPath, inspection);
|
|
1549
|
+
const rawConfig = configExists ? await readRawProjectConfig(configPath) : undefined;
|
|
1505
1550
|
await mkdir(dirname(configPath), { recursive: true });
|
|
1506
|
-
await writeFile(configPath, `${buildSetupConfig({ ...answers, repoPath: normalizedRepoPath })}\n`, "utf8");
|
|
1551
|
+
await writeFile(configPath, `${buildSetupConfig({ ...answers, repoPath: normalizedRepoPath }, rawConfig)}\n`, "utf8");
|
|
1507
1552
|
const codexAuthEnvName = resolveSetupCodexApiKeyEnvName(answers);
|
|
1508
1553
|
if (answers.codexApiKey && codexAuthEnvName) {
|
|
1509
1554
|
await mkdir(dirname(envPath), { recursive: true });
|