@sireai/optimus 0.1.34 → 0.1.37

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.
Files changed (45) hide show
  1. package/dist/cli/optimus.js +41 -22
  2. package/dist/cli/optimus.js.map +1 -1
  3. package/dist/integrations/jira/jira-access-manager.d.ts +1 -0
  4. package/dist/integrations/jira/jira-access-manager.js +24 -0
  5. package/dist/integrations/jira/jira-access-manager.js.map +1 -1
  6. package/dist/problem-solving-core/codex/codex-runner.d.ts +2 -0
  7. package/dist/problem-solving-core/codex/codex-runner.js +43 -28
  8. package/dist/problem-solving-core/codex/codex-runner.js.map +1 -1
  9. package/dist/task-environment/delivery/task-delivery-service.js +3 -1
  10. package/dist/task-environment/delivery/task-delivery-service.js.map +1 -1
  11. package/dist/task-environment/evidence/evidence-preparation-service.js +2 -1
  12. package/dist/task-environment/evidence/evidence-preparation-service.js.map +1 -1
  13. package/dist/task-environment/intake/manual-problem-intake.js +30 -0
  14. package/dist/task-environment/intake/manual-problem-intake.js.map +1 -1
  15. package/dist/task-environment/orchestration/execution-context-assembler.d.ts +1 -0
  16. package/dist/task-environment/orchestration/execution-context-assembler.js +50 -0
  17. package/dist/task-environment/orchestration/execution-context-assembler.js.map +1 -1
  18. package/dist/task-environment/orchestration/task-orchestrator.d.ts +1 -0
  19. package/dist/task-environment/orchestration/task-orchestrator.js +27 -5
  20. package/dist/task-environment/orchestration/task-orchestrator.js.map +1 -1
  21. package/dist/task-environment/orchestration/task-package-inputs.d.ts +2 -0
  22. package/dist/task-environment/orchestration/task-package-inputs.js +38 -0
  23. package/dist/task-environment/orchestration/task-package-inputs.js.map +1 -0
  24. package/dist/task-environment/orchestration/task-runtime-policy.d.ts +4 -0
  25. package/dist/task-environment/orchestration/task-runtime-policy.js +38 -0
  26. package/dist/task-environment/orchestration/task-runtime-policy.js.map +1 -0
  27. package/dist/types.d.ts +32 -0
  28. package/embedded-skills/task/bugfix/android-hprof-analyzer/SKILL.md +37 -0
  29. package/embedded-skills/task/bugfix/android-hprof-analyzer/runtime/README.md +11 -0
  30. package/embedded-skills/task/bugfix/android-hprof-analyzer/scripts/analyze-hprof.mjs +286 -0
  31. package/embedded-skills/task/bugfix/android-hprof-analyzer/scripts/ensure-shark-runtime.mjs +213 -0
  32. package/embedded-skills/task/bugfix/android-hprof-analyzer/scripts/run-shark.sh +27 -0
  33. package/embedded-skills/task/bugfix/android-hprof-analyzer/skill.json +6 -0
  34. package/package.json +1 -1
  35. package/task-harnesses/bugfix/CONSTRAINTS.md +2 -0
  36. package/task-harnesses/bugfix/ROLE.md +4 -0
  37. package/task-harnesses/bugfix/STANDARD.md +1 -0
  38. package/task-harnesses/pm/ACCEPT.md +94 -0
  39. package/task-harnesses/pm/CONSTRAINTS.md +27 -0
  40. package/task-harnesses/pm/CONTEXT.md +26 -0
  41. package/task-harnesses/pm/EVOLUTION.md +35 -0
  42. package/task-harnesses/pm/ROLE.md +59 -0
  43. package/task-harnesses/pm/STANDARD.md +125 -0
  44. package/task-harnesses/pm/manifest.json +13 -0
  45. package/task-harnesses/registry.json +4 -0
@@ -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";
@@ -316,23 +317,22 @@ function renderCommandHelp(command) {
316
317
  "",
317
318
  "Usage:",
318
319
  " optimus submit --title <title> --description <text> [options]",
319
- " optimus submit --title <title> --description-file <path> [options]",
320
- " printf '%s' '<text>' | optimus submit --title <title> --description-stdin [options]",
320
+ " optimus submit --title <title> --file <path> [options]",
321
321
  "",
322
322
  "Required:",
323
323
  " --title <title> Task title",
324
- " --description <text> Task description",
324
+ " --description <text> Task text",
325
325
  "",
326
326
  "Common options:",
327
- " --description-file <path> Read task description from a file",
328
- " --description-stdin Read task description from stdin",
327
+ " --file <path> Read task text from a file",
329
328
  " --repo <alias> Target registered repository alias",
330
329
  " --task-type <type> Task type, default bugfix",
331
330
  " --source-ref <id> External issue key or source reference",
332
331
  " --allow-duplicate Allow duplicate submission",
333
332
  "",
334
333
  "Example:",
335
- " optimus submit --title \"Login crash\" --description \"Crash on startup\" --repo ohos-pre"
334
+ " optimus submit --title \"Login crash\" --description \"Crash on startup\" --repo ohos-pre",
335
+ " optimus submit --title \"Onboarding prototype\" --file ./docs/onboarding-prd.md --task-type pm"
336
336
  ].join("\n"),
337
337
  feedback: [
338
338
  "optimus feedback",
@@ -2110,6 +2110,7 @@ async function buildReplayExecutionContext(input) {
2110
2110
  : undefined;
2111
2111
  return {
2112
2112
  taskRootDir,
2113
+ runtimePolicy: getTaskRuntimePolicy(input.taskType),
2113
2114
  addresses: {
2114
2115
  mode,
2115
2116
  workspaceDir,
@@ -2260,28 +2261,41 @@ async function resolveLongTextArg(args, keys) {
2260
2261
  return value;
2261
2262
  }
2262
2263
  }
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;
2264
+ const fileKeys = typeof keys.file === "string" ? [keys.file] : (keys.file ?? []);
2265
+ for (const key of fileKeys) {
2266
+ const filePath = args[key]?.trim();
2267
+ if (filePath) {
2268
+ const content = (await readFile(filePath, "utf8")).trim();
2269
+ if (content) {
2270
+ return content;
2271
+ }
2268
2272
  }
2269
2273
  }
2270
- if (keys.stdin && args[keys.stdin] === "true") {
2271
- const content = (await readTextFromStdin()).trim();
2272
- if (content) {
2273
- return content;
2274
+ const stdinKeys = typeof keys.stdin === "string" ? [keys.stdin] : (keys.stdin ?? []);
2275
+ for (const key of stdinKeys) {
2276
+ if (args[key] === "true") {
2277
+ const content = (await readTextFromStdin()).trim();
2278
+ if (content) {
2279
+ return content;
2280
+ }
2274
2281
  }
2275
2282
  }
2276
2283
  return undefined;
2277
2284
  }
2278
2285
  function renderShellQuotingHint(command) {
2286
+ const requirementHint = command === "submit"
2287
+ ? "Use single quotes, or pass the text with --file."
2288
+ : "Use single quotes, or pass the text with --description-file / --description-stdin.";
2279
2289
  return [
2280
- `${command} requires both --title and --description.`,
2290
+ command === "submit"
2291
+ ? "submit requires both --title and task text."
2292
+ : "feedback requires both --title and --description.",
2281
2293
  "Tip: shell metacharacters like `...`, $(...), and $VAR may be expanded before Optimus starts.",
2282
- "Use single quotes, or pass the text with --description-file / --description-stdin.",
2294
+ requirementHint,
2283
2295
  `Example: optimus ${command} --title "..." --description 'literal text with \`optimus setup\` inside'`,
2284
- `Example: printf '%s' 'literal text with \`optimus setup\` inside' | optimus ${command} --title "..." --description-stdin`
2296
+ ...(command === "submit"
2297
+ ? [`Example: optimus submit --title "..." --file ./task.md`]
2298
+ : [`Example: printf '%s' 'literal text with \`optimus setup\` inside' | optimus feedback --title "..." --description-stdin`])
2285
2299
  ].join("\n");
2286
2300
  }
2287
2301
  async function main() {
@@ -2475,10 +2489,10 @@ async function main() {
2475
2489
  if (command === "submit") {
2476
2490
  const args = parseArgs(commandArgs);
2477
2491
  const title = args.title?.trim();
2492
+ const taskType = args["task-type"]?.trim() || "bugfix";
2478
2493
  const description = await resolveLongTextArg(args, {
2479
2494
  inline: ["desc", "description"],
2480
- file: "description-file",
2481
- stdin: "description-stdin"
2495
+ file: "file"
2482
2496
  });
2483
2497
  if (!title || !description) {
2484
2498
  console.error(renderShellQuotingHint("submit"));
@@ -2486,7 +2500,7 @@ async function main() {
2486
2500
  return;
2487
2501
  }
2488
2502
  await store.init();
2489
- const repositorySelection = await resolveSubmissionRepositorySelector(args, store, config);
2503
+ const repositorySelection = await resolveSubmissionRepositorySelector(taskType, args, store, config);
2490
2504
  if (!repositorySelection.ok) {
2491
2505
  console.error(repositorySelection.reason);
2492
2506
  process.exitCode = 1;
@@ -2494,6 +2508,7 @@ async function main() {
2494
2508
  }
2495
2509
  const event = createManualProblemEvent({
2496
2510
  ...args,
2511
+ description,
2497
2512
  ...(repositorySelection.repoSelector ? { repo: repositorySelection.repoSelector } : {}),
2498
2513
  ...(args["allow-duplicate"] === "true" ? { "allow-duplicate": "true" } : {})
2499
2514
  });
@@ -3405,7 +3420,11 @@ async function inspectBuiltinSkills(config, skillSyncService) {
3405
3420
  evolutionTaskLevelSkills
3406
3421
  };
3407
3422
  }
3408
- async function resolveSubmissionRepositorySelector(args, store, config) {
3423
+ async function resolveSubmissionRepositorySelector(taskType, args, store, config) {
3424
+ const runtimePolicy = getTaskRuntimePolicy(taskType);
3425
+ if (!runtimePolicy.requiresRepository) {
3426
+ return { ok: true };
3427
+ }
3409
3428
  const candidates = await listCliRepositoryCandidates(store, config);
3410
3429
  const requestedRepo = args.repo?.trim();
3411
3430
  if (requestedRepo) {