project-autopilot 12.0.0 → 12.0.1

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 (40) hide show
  1. package/README.md +10 -10
  2. package/SKILL.md +1 -3
  3. package/adapters/agents.json +11 -1
  4. package/config.example.json +5 -3
  5. package/config.schema.json +28 -9
  6. package/docs/configuration.md +5 -3
  7. package/package.json +1 -1
  8. package/scripts/adapter-drivers.mjs +209 -22
  9. package/scripts/agent-contract.mjs +24 -2
  10. package/scripts/agent-invocation.mjs +32 -5
  11. package/scripts/autopilot.mjs +787 -222
  12. package/scripts/config-layout.mjs +6 -0
  13. package/scripts/config-migration.mjs +3 -3
  14. package/scripts/config-validation.mjs +12 -4
  15. package/scripts/e2e-detect.mjs +30 -0
  16. package/scripts/escalation-naming.mjs +19 -0
  17. package/scripts/failure-contract.mjs +25 -9
  18. package/scripts/gen-config-schema.mjs +7 -0
  19. package/scripts/idle-hang-watchdog.mjs +34 -7
  20. package/scripts/implementation-baseline.mjs +95 -4
  21. package/scripts/model-discovery.mjs +176 -38
  22. package/scripts/opencode-generation.mjs +116 -0
  23. package/scripts/per-task-budget.mjs +11 -7
  24. package/scripts/plan-review-rounds.mjs +164 -9
  25. package/scripts/planning-boundary.mjs +16 -6
  26. package/scripts/planning-continuation.mjs +43 -23
  27. package/scripts/planning-review-decision.mjs +3 -0
  28. package/scripts/planning-review-wiring.mjs +12 -8
  29. package/scripts/relay-guards.mjs +133 -11
  30. package/scripts/review-canary.mjs +5 -2
  31. package/scripts/role-fallback.mjs +23 -8
  32. package/scripts/run-history.mjs +32 -1
  33. package/scripts/run-observability.mjs +46 -2
  34. package/scripts/setup-discovery.mjs +2 -1
  35. package/scripts/setup.mjs +183 -81
  36. package/scripts/skill-copy.mjs +49 -0
  37. package/scripts/task-requirements.mjs +24 -0
  38. package/scripts/watch-report.mjs +146 -21
  39. package/scripts/watch-summary.mjs +26 -3
  40. package/scripts/plan-mode-model-note.mjs +0 -27
@@ -1,5 +1,32 @@
1
+ import {isOpenCodeAdapter, openCodeUsesModelSuffix, detectOpenCodeGeneration} from "./opencode-generation.mjs";
2
+
3
+ // OpenCode 2.x has no --variant flag: its effort level rides the model value
4
+ // as provider/model#level. 1.x (and an unreadable probe) keeps the manifest's
5
+ // declared --variant flag unchanged.
6
+ function effectiveEffortMode(adapter) {
7
+ if (isOpenCodeAdapter(adapter)) {
8
+ return detectOpenCodeGeneration(adapter) === "2" ? "model_suffix" : "flag";
9
+ }
10
+ if (adapter?.effort_mode === "config") return "config";
11
+ if (adapter?.effort_mode === "model_suffix") return "model_suffix";
12
+ return "flag";
13
+ }
14
+
15
+ // 2.x needs a private server for a config-defined agent (autopilot_readonly)
16
+ // to be visible. The manifest stays the 1.x argv; this adds the flag only on
17
+ // the generation that requires it.
18
+ function addOpenCodeStandalone(args, adapter) {
19
+ if (!openCodeUsesModelSuffix(adapter)) return args;
20
+ if (args.includes("--standalone")) return args;
21
+ const runIndex = args.indexOf("run");
22
+ if (runIndex < 0) return args;
23
+ args.splice(runIndex + 1, 0, "--standalone");
24
+ return args;
25
+ }
26
+
1
27
  export function applyAgentSelections(args, role, adapter) {
2
28
  const out = [...args];
29
+ const effortMode = role?.reasoning ? effectiveEffortMode(adapter) : null;
3
30
 
4
31
  if (role?.model) {
5
32
  if (!adapter?.model_flag) {
@@ -9,12 +36,12 @@ export function applyAgentSelections(args, role, adapter) {
9
36
  }
10
37
 
11
38
  if (role?.reasoning) {
12
- if (adapter.effort_mode === "config") {
39
+ if (effortMode === "config") {
13
40
  if (!adapter.effort_config_key) {
14
41
  throw new Error(`${adapter.binary || "agent"} does not declare an effort config key.`);
15
42
  }
16
43
  out.push("--config", `${adapter.effort_config_key}=${JSON.stringify(role.reasoning)}`);
17
- } else if (adapter.effort_mode === "model_suffix") {
44
+ } else if (effortMode === "model_suffix") {
18
45
  if (!adapter.model_flag || !role.model) {
19
46
  throw new Error(`${adapter.binary || "agent"} effort requires a selected model.`);
20
47
  }
@@ -52,7 +79,7 @@ export function applyAgentSelections(args, role, adapter) {
52
79
  }
53
80
  }
54
81
 
55
- return out;
82
+ return addOpenCodeStandalone(out, adapter);
56
83
  }
57
84
 
58
85
  export function verifyAgentInvocation(args, role, adapter) {
@@ -62,7 +89,7 @@ export function verifyAgentInvocation(args, role, adapter) {
62
89
  if (role?.model) {
63
90
  const i = adapter?.model_flag ? list.lastIndexOf(String(adapter.model_flag)) : -1;
64
91
  if (i < 0 || String(list[i + 1] || "") !== String(role.model)) {
65
- if (adapter?.variant_mode === "model_suffix" && i >= 0 && String(list[i + 1] || "").startsWith(`${role.model}#`)) {
92
+ if ((adapter?.variant_mode === "model_suffix" || openCodeUsesModelSuffix(adapter)) && i >= 0 && String(list[i + 1] || "").startsWith(`${role.model}#`)) {
66
93
  // model suffix is an intentional transport for variants/effort.
67
94
  } else {
68
95
  errors.push(`model '${role.model}' was not present in the final CLI invocation.`);
@@ -77,7 +104,7 @@ export function verifyAgentInvocation(args, role, adapter) {
77
104
  if (index < 0 || list[index + 1] !== expected) {
78
105
  errors.push(`reasoning/effort '${role.reasoning}' was not present in the final CLI config invocation.`);
79
106
  }
80
- } else if (adapter?.effort_mode === "model_suffix") {
107
+ } else if (adapter?.effort_mode === "model_suffix" || (isOpenCodeAdapter(adapter) && effectiveEffortMode(adapter) === "model_suffix")) {
81
108
  const i = adapter?.model_flag ? list.lastIndexOf(String(adapter.model_flag)) : -1;
82
109
  const value = i >= 0 ? String(list[i + 1] || "") : "";
83
110
  if (!value.endsWith(`#${role.reasoning}`)) {