@sireai/optimus 0.1.30 → 0.1.33
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 +41 -22
- package/dist/cli/optimus.js.map +1 -1
- package/dist/integrations/jira/jira-access-manager.d.ts +1 -0
- package/dist/integrations/jira/jira-access-manager.js +24 -0
- package/dist/integrations/jira/jira-access-manager.js.map +1 -1
- package/dist/integrations/jira/jira-client.js +50 -8
- package/dist/integrations/jira/jira-client.js.map +1 -1
- package/dist/problem-solving-core/codex/codex-runner.d.ts +2 -0
- package/dist/problem-solving-core/codex/codex-runner.js +43 -28
- package/dist/problem-solving-core/codex/codex-runner.js.map +1 -1
- package/dist/task-environment/delivery/task-delivery-service.js +3 -1
- package/dist/task-environment/delivery/task-delivery-service.js.map +1 -1
- package/dist/task-environment/evidence/evidence-preparation-service.js +19 -3
- package/dist/task-environment/evidence/evidence-preparation-service.js.map +1 -1
- package/dist/task-environment/intake/manual-problem-intake.js +30 -0
- package/dist/task-environment/intake/manual-problem-intake.js.map +1 -1
- package/dist/task-environment/orchestration/execution-context-assembler.d.ts +1 -0
- package/dist/task-environment/orchestration/execution-context-assembler.js +50 -0
- package/dist/task-environment/orchestration/execution-context-assembler.js.map +1 -1
- package/dist/task-environment/orchestration/task-orchestrator.d.ts +1 -0
- package/dist/task-environment/orchestration/task-orchestrator.js +27 -5
- package/dist/task-environment/orchestration/task-orchestrator.js.map +1 -1
- package/dist/task-environment/orchestration/task-package-inputs.d.ts +2 -0
- package/dist/task-environment/orchestration/task-package-inputs.js +38 -0
- package/dist/task-environment/orchestration/task-package-inputs.js.map +1 -0
- package/dist/task-environment/orchestration/task-runtime-policy.d.ts +4 -0
- package/dist/task-environment/orchestration/task-runtime-policy.js +38 -0
- package/dist/task-environment/orchestration/task-runtime-policy.js.map +1 -0
- package/dist/task-environment/runtime/optimus-runtime.d.ts +2 -0
- package/dist/task-environment/runtime/optimus-runtime.js +49 -20
- package/dist/task-environment/runtime/optimus-runtime.js.map +1 -1
- package/dist/task-environment/storage/sqlite-event-store.d.ts +1 -1
- package/dist/task-environment/storage/sqlite-event-store.js +2 -1
- package/dist/task-environment/storage/sqlite-event-store.js.map +1 -1
- package/dist/types.d.ts +32 -0
- package/package.json +1 -1
- package/task-harnesses/bugfix/CONSTRAINTS.md +3 -0
- package/task-harnesses/pm/ACCEPT.md +94 -0
- package/task-harnesses/pm/CONSTRAINTS.md +27 -0
- package/task-harnesses/pm/CONTEXT.md +26 -0
- package/task-harnesses/pm/EVOLUTION.md +35 -0
- package/task-harnesses/pm/ROLE.md +59 -0
- package/task-harnesses/pm/STANDARD.md +125 -0
- package/task-harnesses/pm/manifest.json +13 -0
- package/task-harnesses/registry.json +4 -0
package/dist/cli/optimus.js
CHANGED
|
@@ -17,6 +17,7 @@ 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";
|
|
20
21
|
import { TriageRunner } from "../task-environment/orchestration/triage-runner.js";
|
|
21
22
|
import { OptimusRuntime } from "../task-environment/runtime/optimus-runtime.js";
|
|
22
23
|
import { SQLiteTaskStore } from "../task-environment/storage/sqlite-task-store.js";
|
|
@@ -315,23 +316,22 @@ function renderCommandHelp(command) {
|
|
|
315
316
|
"",
|
|
316
317
|
"Usage:",
|
|
317
318
|
" optimus submit --title <title> --description <text> [options]",
|
|
318
|
-
" optimus submit --title <title> --
|
|
319
|
-
" printf '%s' '<text>' | optimus submit --title <title> --description-stdin [options]",
|
|
319
|
+
" optimus submit --title <title> --file <path> [options]",
|
|
320
320
|
"",
|
|
321
321
|
"Required:",
|
|
322
322
|
" --title <title> Task title",
|
|
323
|
-
" --description <text> Task
|
|
323
|
+
" --description <text> Task text",
|
|
324
324
|
"",
|
|
325
325
|
"Common options:",
|
|
326
|
-
" --
|
|
327
|
-
" --description-stdin Read task description from stdin",
|
|
326
|
+
" --file <path> Read task text from a file",
|
|
328
327
|
" --repo <alias> Target registered repository alias",
|
|
329
328
|
" --task-type <type> Task type, default bugfix",
|
|
330
329
|
" --source-ref <id> External issue key or source reference",
|
|
331
330
|
" --allow-duplicate Allow duplicate submission",
|
|
332
331
|
"",
|
|
333
332
|
"Example:",
|
|
334
|
-
" optimus submit --title \"Login crash\" --description \"Crash on startup\" --repo ohos-pre"
|
|
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
335
|
].join("\n"),
|
|
336
336
|
feedback: [
|
|
337
337
|
"optimus feedback",
|
|
@@ -2089,6 +2089,7 @@ async function buildReplayExecutionContext(input) {
|
|
|
2089
2089
|
: undefined;
|
|
2090
2090
|
return {
|
|
2091
2091
|
taskRootDir,
|
|
2092
|
+
runtimePolicy: getTaskRuntimePolicy(input.taskType),
|
|
2092
2093
|
addresses: {
|
|
2093
2094
|
mode,
|
|
2094
2095
|
workspaceDir,
|
|
@@ -2239,28 +2240,41 @@ async function resolveLongTextArg(args, keys) {
|
|
|
2239
2240
|
return value;
|
|
2240
2241
|
}
|
|
2241
2242
|
}
|
|
2242
|
-
const
|
|
2243
|
-
|
|
2244
|
-
const
|
|
2245
|
-
if (
|
|
2246
|
-
|
|
2243
|
+
const fileKeys = typeof keys.file === "string" ? [keys.file] : (keys.file ?? []);
|
|
2244
|
+
for (const key of fileKeys) {
|
|
2245
|
+
const filePath = args[key]?.trim();
|
|
2246
|
+
if (filePath) {
|
|
2247
|
+
const content = (await readFile(filePath, "utf8")).trim();
|
|
2248
|
+
if (content) {
|
|
2249
|
+
return content;
|
|
2250
|
+
}
|
|
2247
2251
|
}
|
|
2248
2252
|
}
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
if (
|
|
2252
|
-
|
|
2253
|
+
const stdinKeys = typeof keys.stdin === "string" ? [keys.stdin] : (keys.stdin ?? []);
|
|
2254
|
+
for (const key of stdinKeys) {
|
|
2255
|
+
if (args[key] === "true") {
|
|
2256
|
+
const content = (await readTextFromStdin()).trim();
|
|
2257
|
+
if (content) {
|
|
2258
|
+
return content;
|
|
2259
|
+
}
|
|
2253
2260
|
}
|
|
2254
2261
|
}
|
|
2255
2262
|
return undefined;
|
|
2256
2263
|
}
|
|
2257
2264
|
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.";
|
|
2258
2268
|
return [
|
|
2259
|
-
|
|
2269
|
+
command === "submit"
|
|
2270
|
+
? "submit requires both --title and task text."
|
|
2271
|
+
: "feedback requires both --title and --description.",
|
|
2260
2272
|
"Tip: shell metacharacters like `...`, $(...), and $VAR may be expanded before Optimus starts.",
|
|
2261
|
-
|
|
2273
|
+
requirementHint,
|
|
2262
2274
|
`Example: optimus ${command} --title "..." --description 'literal text with \`optimus setup\` inside'`,
|
|
2263
|
-
|
|
2275
|
+
...(command === "submit"
|
|
2276
|
+
? [`Example: optimus submit --title "..." --file ./task.md`]
|
|
2277
|
+
: [`Example: printf '%s' 'literal text with \`optimus setup\` inside' | optimus feedback --title "..." --description-stdin`])
|
|
2264
2278
|
].join("\n");
|
|
2265
2279
|
}
|
|
2266
2280
|
async function main() {
|
|
@@ -2454,10 +2468,10 @@ async function main() {
|
|
|
2454
2468
|
if (command === "submit") {
|
|
2455
2469
|
const args = parseArgs(commandArgs);
|
|
2456
2470
|
const title = args.title?.trim();
|
|
2471
|
+
const taskType = args["task-type"]?.trim() || "bugfix";
|
|
2457
2472
|
const description = await resolveLongTextArg(args, {
|
|
2458
2473
|
inline: ["desc", "description"],
|
|
2459
|
-
file: "
|
|
2460
|
-
stdin: "description-stdin"
|
|
2474
|
+
file: "file"
|
|
2461
2475
|
});
|
|
2462
2476
|
if (!title || !description) {
|
|
2463
2477
|
console.error(renderShellQuotingHint("submit"));
|
|
@@ -2465,7 +2479,7 @@ async function main() {
|
|
|
2465
2479
|
return;
|
|
2466
2480
|
}
|
|
2467
2481
|
await store.init();
|
|
2468
|
-
const repositorySelection = await resolveSubmissionRepositorySelector(args, store, config);
|
|
2482
|
+
const repositorySelection = await resolveSubmissionRepositorySelector(taskType, args, store, config);
|
|
2469
2483
|
if (!repositorySelection.ok) {
|
|
2470
2484
|
console.error(repositorySelection.reason);
|
|
2471
2485
|
process.exitCode = 1;
|
|
@@ -2473,6 +2487,7 @@ async function main() {
|
|
|
2473
2487
|
}
|
|
2474
2488
|
const event = createManualProblemEvent({
|
|
2475
2489
|
...args,
|
|
2490
|
+
description,
|
|
2476
2491
|
...(repositorySelection.repoSelector ? { repo: repositorySelection.repoSelector } : {}),
|
|
2477
2492
|
...(args["allow-duplicate"] === "true" ? { "allow-duplicate": "true" } : {})
|
|
2478
2493
|
});
|
|
@@ -3384,7 +3399,11 @@ async function inspectBuiltinSkills(config, skillSyncService) {
|
|
|
3384
3399
|
evolutionTaskLevelSkills
|
|
3385
3400
|
};
|
|
3386
3401
|
}
|
|
3387
|
-
async function resolveSubmissionRepositorySelector(args, store, config) {
|
|
3402
|
+
async function resolveSubmissionRepositorySelector(taskType, args, store, config) {
|
|
3403
|
+
const runtimePolicy = getTaskRuntimePolicy(taskType);
|
|
3404
|
+
if (!runtimePolicy.requiresRepository) {
|
|
3405
|
+
return { ok: true };
|
|
3406
|
+
}
|
|
3388
3407
|
const candidates = await listCliRepositoryCandidates(store, config);
|
|
3389
3408
|
const requestedRepo = args.repo?.trim();
|
|
3390
3409
|
if (requestedRepo) {
|