@sireai/optimus 0.1.33 → 0.1.34
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 +43 -41
- package/dist/cli/optimus.js.map +1 -1
- package/dist/integrations/jira/jira-access-manager.d.ts +0 -1
- package/dist/integrations/jira/jira-access-manager.js +0 -24
- package/dist/integrations/jira/jira-access-manager.js.map +1 -1
- package/dist/problem-solving-core/codex/codex-runner.d.ts +0 -2
- package/dist/problem-solving-core/codex/codex-runner.js +28 -43
- package/dist/problem-solving-core/codex/codex-runner.js.map +1 -1
- package/dist/task-environment/delivery/task-delivery-service.js +1 -3
- package/dist/task-environment/delivery/task-delivery-service.js.map +1 -1
- package/dist/task-environment/intake/manual-problem-intake.js +0 -30
- package/dist/task-environment/intake/manual-problem-intake.js.map +1 -1
- package/dist/task-environment/orchestration/execution-context-assembler.d.ts +0 -1
- package/dist/task-environment/orchestration/execution-context-assembler.js +0 -50
- package/dist/task-environment/orchestration/execution-context-assembler.js.map +1 -1
- package/dist/task-environment/orchestration/task-orchestrator.d.ts +0 -1
- package/dist/task-environment/orchestration/task-orchestrator.js +5 -27
- package/dist/task-environment/orchestration/task-orchestrator.js.map +1 -1
- package/dist/types.d.ts +0 -32
- package/package.json +1 -1
- package/task-harnesses/registry.json +0 -4
- package/dist/task-environment/orchestration/task-package-inputs.d.ts +0 -2
- package/dist/task-environment/orchestration/task-package-inputs.js +0 -38
- package/dist/task-environment/orchestration/task-package-inputs.js.map +0 -1
- package/dist/task-environment/orchestration/task-runtime-policy.d.ts +0 -4
- package/dist/task-environment/orchestration/task-runtime-policy.js +0 -38
- package/dist/task-environment/orchestration/task-runtime-policy.js.map +0 -1
- package/task-harnesses/pm/ACCEPT.md +0 -94
- package/task-harnesses/pm/CONSTRAINTS.md +0 -27
- package/task-harnesses/pm/CONTEXT.md +0 -26
- package/task-harnesses/pm/EVOLUTION.md +0 -35
- package/task-harnesses/pm/ROLE.md +0 -59
- package/task-harnesses/pm/STANDARD.md +0 -125
- package/task-harnesses/pm/manifest.json +0 -13
package/dist/cli/optimus.js
CHANGED
|
@@ -17,7 +17,6 @@ import { classifyCodexFailureCategory } from "../problem-solving-core/codex/code
|
|
|
17
17
|
import { createManualEventContent, createManualProblemEvent } from "../task-environment/intake/manual-problem-intake.js";
|
|
18
18
|
import { OptimusLogger } from "../task-environment/observability/logger.js";
|
|
19
19
|
import { TaskOrchestrator } from "../task-environment/orchestration/task-orchestrator.js";
|
|
20
|
-
import { getTaskRuntimePolicy } from "../task-environment/orchestration/task-runtime-policy.js";
|
|
21
20
|
import { TriageRunner } from "../task-environment/orchestration/triage-runner.js";
|
|
22
21
|
import { OptimusRuntime } from "../task-environment/runtime/optimus-runtime.js";
|
|
23
22
|
import { SQLiteTaskStore } from "../task-environment/storage/sqlite-task-store.js";
|
|
@@ -74,6 +73,7 @@ function renderSetupResult(result) {
|
|
|
74
73
|
const envLabel = result.codexAuth.envName ?? "unknown";
|
|
75
74
|
lines.push(`Codex Auth: ${result.codexAuth.mode} | ${result.codexAuth.configured ? `${envLabel} configured` : `${envLabel} missing`}${providerLabel}`);
|
|
76
75
|
}
|
|
76
|
+
lines.push(`Codex Model: ${result.codexAuth.model ?? "missing"}`);
|
|
77
77
|
lines.push("");
|
|
78
78
|
lines.push("Next");
|
|
79
79
|
lines.push("- optimus start");
|
|
@@ -316,22 +316,23 @@ function renderCommandHelp(command) {
|
|
|
316
316
|
"",
|
|
317
317
|
"Usage:",
|
|
318
318
|
" optimus submit --title <title> --description <text> [options]",
|
|
319
|
-
" optimus submit --title <title> --file <path> [options]",
|
|
319
|
+
" optimus submit --title <title> --description-file <path> [options]",
|
|
320
|
+
" printf '%s' '<text>' | optimus submit --title <title> --description-stdin [options]",
|
|
320
321
|
"",
|
|
321
322
|
"Required:",
|
|
322
323
|
" --title <title> Task title",
|
|
323
|
-
" --description <text> Task
|
|
324
|
+
" --description <text> Task description",
|
|
324
325
|
"",
|
|
325
326
|
"Common options:",
|
|
326
|
-
" --file <path>
|
|
327
|
+
" --description-file <path> Read task description from a file",
|
|
328
|
+
" --description-stdin Read task description from stdin",
|
|
327
329
|
" --repo <alias> Target registered repository alias",
|
|
328
330
|
" --task-type <type> Task type, default bugfix",
|
|
329
331
|
" --source-ref <id> External issue key or source reference",
|
|
330
332
|
" --allow-duplicate Allow duplicate submission",
|
|
331
333
|
"",
|
|
332
334
|
"Example:",
|
|
333
|
-
" optimus submit --title \"Login crash\" --description \"Crash on startup\" --repo ohos-pre"
|
|
334
|
-
" optimus submit --title \"Onboarding prototype\" --file ./docs/onboarding-prd.md --task-type pm"
|
|
335
|
+
" optimus submit --title \"Login crash\" --description \"Crash on startup\" --repo ohos-pre"
|
|
335
336
|
].join("\n"),
|
|
336
337
|
feedback: [
|
|
337
338
|
"optimus feedback",
|
|
@@ -1167,7 +1168,10 @@ async function promptSetupAnswers(defaults) {
|
|
|
1167
1168
|
let codexProviderDisplayName;
|
|
1168
1169
|
let codexProviderBaseUrl;
|
|
1169
1170
|
let codexProviderApiKeyEnvName;
|
|
1171
|
+
let codexModel;
|
|
1170
1172
|
if (codexAuthMode === "openai_api_key") {
|
|
1173
|
+
printSetupHint("Provider model: use a model name supported by the current provider. Examples: gpt-5.2-codex, gpt-5.2, gpt-5-mini.");
|
|
1174
|
+
codexModel = (await ask(renderSetupPrompt("Required", "Provider model (examples: gpt-5.2-codex, gpt-5.2, gpt-5-mini)", defaults.codexModel ?? ""))).trim() || defaults.codexModel;
|
|
1171
1175
|
printSetupHint("OpenAI API key: used only when you choose direct OpenAI API authentication.");
|
|
1172
1176
|
codexApiKey = (await ask(renderSetupPrompt("Optional", "OpenAI API key for OPENAI_API_KEY", "leave blank to keep existing"))).trim() || undefined;
|
|
1173
1177
|
}
|
|
@@ -1178,12 +1182,18 @@ async function promptSetupAnswers(defaults) {
|
|
|
1178
1182
|
codexProviderDisplayName = (await ask(renderSetupPrompt("Required", "Provider display name", defaults.codexProviderDisplayName ?? ""))).trim() || defaults.codexProviderDisplayName;
|
|
1179
1183
|
printSetupHint("Provider base URL: the model API endpoint root Optimus should call.");
|
|
1180
1184
|
codexProviderBaseUrl = (await ask(renderSetupPrompt("Required", "Provider base URL", defaults.codexProviderBaseUrl ?? ""))).trim() || defaults.codexProviderBaseUrl;
|
|
1185
|
+
printSetupHint("Provider model: use a model name supported by the current provider. Examples: gpt-5.2-codex, gpt-5.2, gpt-5-mini.");
|
|
1186
|
+
codexModel = (await ask(renderSetupPrompt("Required", "Provider model (examples: gpt-5.2-codex, gpt-5.2, gpt-5-mini)", defaults.codexModel ?? ""))).trim() || defaults.codexModel;
|
|
1181
1187
|
printSetupHint("Provider API key env name: the environment variable name Optimus will read at runtime.");
|
|
1182
1188
|
codexProviderApiKeyEnvName = (await ask(renderSetupPrompt("Required", "Provider API key env name", defaults.codexProviderApiKeyEnvName ?? ""))).trim() || defaults.codexProviderApiKeyEnvName;
|
|
1183
1189
|
const providerKeyLabel = codexProviderApiKeyEnvName || defaults.codexProviderApiKeyEnvName || "the configured provider env";
|
|
1184
1190
|
printSetupHint(`Provider API key value: optional here; leave blank to keep the current ${providerKeyLabel} value.`);
|
|
1185
1191
|
codexApiKey = (await ask(renderSetupPrompt("Optional", `Provider API key value for ${providerKeyLabel}`, "leave blank to keep existing"))).trim() || undefined;
|
|
1186
1192
|
}
|
|
1193
|
+
else {
|
|
1194
|
+
printSetupHint("Provider model: use a model name supported by the current provider. Examples: gpt-5.2-codex, gpt-5.2, gpt-5-mini.");
|
|
1195
|
+
codexModel = (await ask(renderSetupPrompt("Required", "Provider model (examples: gpt-5.2-codex, gpt-5.2, gpt-5-mini)", defaults.codexModel ?? ""))).trim() || defaults.codexModel;
|
|
1196
|
+
}
|
|
1187
1197
|
printSetupSection("Feishu", "Built-in Feishu app delivery is already available. Add a webhook only if group notifications should go to a chat first. Type \"\" to clear an existing optional value.");
|
|
1188
1198
|
printSetupHint("Feishu webhook: optional; leave empty to use direct Feishu app delivery only.");
|
|
1189
1199
|
const feishuWebhook = resolveOptionalTextAnswer(await ask(renderSetupPrompt("Optional", "Feishu webhook", defaults.feishuWebhook ? "configured" : "")), defaults.feishuWebhook ?? undefined);
|
|
@@ -1218,6 +1228,7 @@ async function promptSetupAnswers(defaults) {
|
|
|
1218
1228
|
repoPath,
|
|
1219
1229
|
repoAlias,
|
|
1220
1230
|
codexAuthMode,
|
|
1231
|
+
...(codexModel ? { codexModel } : {}),
|
|
1221
1232
|
...(codexApiKey ? { codexApiKey } : {}),
|
|
1222
1233
|
...(codexProviderId ? { codexProviderId } : {}),
|
|
1223
1234
|
...(codexProviderDisplayName ? { codexProviderDisplayName } : {}),
|
|
@@ -1253,6 +1264,7 @@ async function resolveDefaultSetupAnswers() {
|
|
|
1253
1264
|
repoPath: "",
|
|
1254
1265
|
repoAlias: "",
|
|
1255
1266
|
codexAuthMode: defaults.codex.auth.mode,
|
|
1267
|
+
...(defaults.codex.model?.trim() ? { codexModel: defaults.codex.model.trim() } : {}),
|
|
1256
1268
|
enableJira: false,
|
|
1257
1269
|
enableSentry: false
|
|
1258
1270
|
};
|
|
@@ -1268,6 +1280,7 @@ async function resolveDefaultSetupAnswers() {
|
|
|
1268
1280
|
repoPath: primaryRepository?.path ?? "",
|
|
1269
1281
|
repoAlias: primaryRepository?.alias ?? "",
|
|
1270
1282
|
codexAuthMode: config.codex.auth.mode,
|
|
1283
|
+
...(config.codex.model?.trim() ? { codexModel: config.codex.model.trim() } : {}),
|
|
1271
1284
|
...(provider?.id ? { codexProviderId: provider.id } : {}),
|
|
1272
1285
|
...(provider?.displayName ? { codexProviderDisplayName: provider.displayName } : {}),
|
|
1273
1286
|
...(provider?.baseUrl ? { codexProviderBaseUrl: provider.baseUrl } : {}),
|
|
@@ -1340,6 +1353,9 @@ function validateSetupAnswers(answers) {
|
|
|
1340
1353
|
if (answers.codexAuthMode === "model_provider" && !answers.codexProviderApiKeyEnvName?.trim()) {
|
|
1341
1354
|
return "setup requires provider API key env name when Codex auth mode is model_provider.";
|
|
1342
1355
|
}
|
|
1356
|
+
if (!answers.codexModel?.trim()) {
|
|
1357
|
+
return "setup requires a Codex model.";
|
|
1358
|
+
}
|
|
1343
1359
|
if (answers.enableJira && !answers.jiraBaseUrl?.trim()) {
|
|
1344
1360
|
return "setup requires a Jira base URL when Jira integration is enabled.";
|
|
1345
1361
|
}
|
|
@@ -1425,6 +1441,7 @@ function resolveSetupCachedProvider(rawConfig) {
|
|
|
1425
1441
|
}
|
|
1426
1442
|
function buildSetupConfig(answers, rawConfig) {
|
|
1427
1443
|
const config = buildDefaultConfig();
|
|
1444
|
+
const configuredCodexModel = answers.codexModel?.trim();
|
|
1428
1445
|
const cachedProvider = answers.codexAuthMode === "model_provider"
|
|
1429
1446
|
? {
|
|
1430
1447
|
id: answers.codexProviderId.trim(),
|
|
@@ -1435,6 +1452,9 @@ function buildSetupConfig(answers, rawConfig) {
|
|
|
1435
1452
|
}
|
|
1436
1453
|
: resolveSetupCachedProvider(rawConfig);
|
|
1437
1454
|
config.codex.auth.mode = answers.codexAuthMode;
|
|
1455
|
+
if (configuredCodexModel) {
|
|
1456
|
+
config.codex.model = configuredCodexModel;
|
|
1457
|
+
}
|
|
1438
1458
|
if (answers.codexAuthMode === "model_provider") {
|
|
1439
1459
|
config.codex.provider = {
|
|
1440
1460
|
id: answers.codexProviderId.trim(),
|
|
@@ -2028,6 +2048,7 @@ async function runSetup(args) {
|
|
|
2028
2048
|
sentryEnabled: config.sentry.enabled,
|
|
2029
2049
|
codexAuth: {
|
|
2030
2050
|
mode: codexAuth.mode,
|
|
2051
|
+
...(config.codex.model?.trim() ? { model: config.codex.model.trim() } : {}),
|
|
2031
2052
|
...(codexAuth.apiKeyEnvName ? { envName: codexAuth.apiKeyEnvName } : {}),
|
|
2032
2053
|
configured: codexAuth.authenticated,
|
|
2033
2054
|
...(codexAuth.providerId ? {
|
|
@@ -2089,7 +2110,6 @@ async function buildReplayExecutionContext(input) {
|
|
|
2089
2110
|
: undefined;
|
|
2090
2111
|
return {
|
|
2091
2112
|
taskRootDir,
|
|
2092
|
-
runtimePolicy: getTaskRuntimePolicy(input.taskType),
|
|
2093
2113
|
addresses: {
|
|
2094
2114
|
mode,
|
|
2095
2115
|
workspaceDir,
|
|
@@ -2240,41 +2260,28 @@ async function resolveLongTextArg(args, keys) {
|
|
|
2240
2260
|
return value;
|
|
2241
2261
|
}
|
|
2242
2262
|
}
|
|
2243
|
-
const
|
|
2244
|
-
|
|
2245
|
-
const
|
|
2246
|
-
if (
|
|
2247
|
-
|
|
2248
|
-
if (content) {
|
|
2249
|
-
return content;
|
|
2250
|
-
}
|
|
2263
|
+
const filePath = keys.file ? args[keys.file]?.trim() : undefined;
|
|
2264
|
+
if (filePath) {
|
|
2265
|
+
const content = (await readFile(filePath, "utf8")).trim();
|
|
2266
|
+
if (content) {
|
|
2267
|
+
return content;
|
|
2251
2268
|
}
|
|
2252
2269
|
}
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
if (
|
|
2256
|
-
|
|
2257
|
-
if (content) {
|
|
2258
|
-
return content;
|
|
2259
|
-
}
|
|
2270
|
+
if (keys.stdin && args[keys.stdin] === "true") {
|
|
2271
|
+
const content = (await readTextFromStdin()).trim();
|
|
2272
|
+
if (content) {
|
|
2273
|
+
return content;
|
|
2260
2274
|
}
|
|
2261
2275
|
}
|
|
2262
2276
|
return undefined;
|
|
2263
2277
|
}
|
|
2264
2278
|
function renderShellQuotingHint(command) {
|
|
2265
|
-
const requirementHint = command === "submit"
|
|
2266
|
-
? "Use single quotes, or pass the text with --file."
|
|
2267
|
-
: "Use single quotes, or pass the text with --description-file / --description-stdin.";
|
|
2268
2279
|
return [
|
|
2269
|
-
command
|
|
2270
|
-
? "submit requires both --title and task text."
|
|
2271
|
-
: "feedback requires both --title and --description.",
|
|
2280
|
+
`${command} requires both --title and --description.`,
|
|
2272
2281
|
"Tip: shell metacharacters like `...`, $(...), and $VAR may be expanded before Optimus starts.",
|
|
2273
|
-
|
|
2282
|
+
"Use single quotes, or pass the text with --description-file / --description-stdin.",
|
|
2274
2283
|
`Example: optimus ${command} --title "..." --description 'literal text with \`optimus setup\` inside'`,
|
|
2275
|
-
|
|
2276
|
-
? [`Example: optimus submit --title "..." --file ./task.md`]
|
|
2277
|
-
: [`Example: printf '%s' 'literal text with \`optimus setup\` inside' | optimus feedback --title "..." --description-stdin`])
|
|
2284
|
+
`Example: printf '%s' 'literal text with \`optimus setup\` inside' | optimus ${command} --title "..." --description-stdin`
|
|
2278
2285
|
].join("\n");
|
|
2279
2286
|
}
|
|
2280
2287
|
async function main() {
|
|
@@ -2468,10 +2475,10 @@ async function main() {
|
|
|
2468
2475
|
if (command === "submit") {
|
|
2469
2476
|
const args = parseArgs(commandArgs);
|
|
2470
2477
|
const title = args.title?.trim();
|
|
2471
|
-
const taskType = args["task-type"]?.trim() || "bugfix";
|
|
2472
2478
|
const description = await resolveLongTextArg(args, {
|
|
2473
2479
|
inline: ["desc", "description"],
|
|
2474
|
-
file: "file"
|
|
2480
|
+
file: "description-file",
|
|
2481
|
+
stdin: "description-stdin"
|
|
2475
2482
|
});
|
|
2476
2483
|
if (!title || !description) {
|
|
2477
2484
|
console.error(renderShellQuotingHint("submit"));
|
|
@@ -2479,7 +2486,7 @@ async function main() {
|
|
|
2479
2486
|
return;
|
|
2480
2487
|
}
|
|
2481
2488
|
await store.init();
|
|
2482
|
-
const repositorySelection = await resolveSubmissionRepositorySelector(
|
|
2489
|
+
const repositorySelection = await resolveSubmissionRepositorySelector(args, store, config);
|
|
2483
2490
|
if (!repositorySelection.ok) {
|
|
2484
2491
|
console.error(repositorySelection.reason);
|
|
2485
2492
|
process.exitCode = 1;
|
|
@@ -2487,7 +2494,6 @@ async function main() {
|
|
|
2487
2494
|
}
|
|
2488
2495
|
const event = createManualProblemEvent({
|
|
2489
2496
|
...args,
|
|
2490
|
-
description,
|
|
2491
2497
|
...(repositorySelection.repoSelector ? { repo: repositorySelection.repoSelector } : {}),
|
|
2492
2498
|
...(args["allow-duplicate"] === "true" ? { "allow-duplicate": "true" } : {})
|
|
2493
2499
|
});
|
|
@@ -3399,11 +3405,7 @@ async function inspectBuiltinSkills(config, skillSyncService) {
|
|
|
3399
3405
|
evolutionTaskLevelSkills
|
|
3400
3406
|
};
|
|
3401
3407
|
}
|
|
3402
|
-
async function resolveSubmissionRepositorySelector(
|
|
3403
|
-
const runtimePolicy = getTaskRuntimePolicy(taskType);
|
|
3404
|
-
if (!runtimePolicy.requiresRepository) {
|
|
3405
|
-
return { ok: true };
|
|
3406
|
-
}
|
|
3408
|
+
async function resolveSubmissionRepositorySelector(args, store, config) {
|
|
3407
3409
|
const candidates = await listCliRepositoryCandidates(store, config);
|
|
3408
3410
|
const requestedRepo = args.repo?.trim();
|
|
3409
3411
|
if (requestedRepo) {
|