muonroi-cli 1.8.5 → 1.9.0
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/packages/agent-harness-core/src/event-filter.js +11 -0
- package/dist/packages/agent-harness-core/src/event-redact.js +7 -0
- package/dist/packages/agent-harness-core/src/event-tee.d.ts +20 -4
- package/dist/packages/agent-harness-core/src/event-tee.js +32 -5
- package/dist/packages/agent-harness-core/src/mcp-server.d.ts +14 -0
- package/dist/packages/agent-harness-core/src/mcp-server.js +86 -10
- package/dist/packages/agent-harness-core/src/predicate.d.ts +1 -1
- package/dist/packages/agent-harness-core/src/protocol.d.ts +24 -2
- package/dist/src/agent-harness/mock-model.d.ts +10 -0
- package/dist/src/agent-harness/mock-model.js +6 -2
- package/dist/src/chat/chat-keychain.d.ts +7 -12
- package/dist/src/chat/chat-keychain.js +19 -86
- package/dist/src/cli/keys.d.ts +8 -45
- package/dist/src/cli/keys.js +18 -324
- package/dist/src/council/clarifier.d.ts +4 -2
- package/dist/src/council/clarifier.js +158 -36
- package/dist/src/council/debate-planner.js +3 -2
- package/dist/src/council/debate.js +59 -5
- package/dist/src/council/index.d.ts +23 -0
- package/dist/src/council/index.js +37 -2
- package/dist/src/council/llm.d.ts +62 -0
- package/dist/src/council/llm.js +123 -23
- package/dist/src/council/panel-select.js +13 -3
- package/dist/src/council/planner.js +17 -0
- package/dist/src/council/preflight.d.ts +10 -0
- package/dist/src/council/preflight.js +36 -0
- package/dist/src/council/prompts.d.ts +9 -1
- package/dist/src/council/prompts.js +23 -6
- package/dist/src/council/types.d.ts +10 -0
- package/dist/src/ee/auth.d.ts +19 -0
- package/dist/src/ee/auth.js +39 -0
- package/dist/src/ee/client.js +28 -3
- package/dist/src/ee/ee-onboarding.js +6 -26
- package/dist/src/flow/compaction/compress.d.ts +2 -2
- package/dist/src/flow/compaction/compress.js +21 -8
- package/dist/src/flow/compaction/extract.d.ts +3 -3
- package/dist/src/flow/compaction/extract.js +6 -6
- package/dist/src/flow/compaction/index.d.ts +2 -1
- package/dist/src/flow/compaction/index.js +29 -3
- package/dist/src/flow/compaction/progress.d.ts +35 -0
- package/dist/src/flow/compaction/progress.js +35 -0
- package/dist/src/generated/version.d.ts +1 -1
- package/dist/src/generated/version.js +1 -1
- package/dist/src/gsd/flags.d.ts +11 -0
- package/dist/src/gsd/flags.js +19 -0
- package/dist/src/gsd/plan-council.js +104 -72
- package/dist/src/gsd/verdict-schema.d.ts +1 -1
- package/dist/src/headless/council-answers.js +4 -0
- package/dist/src/index.js +129 -260
- package/dist/src/lsp/builtins.js +3 -1
- package/dist/src/lsp/manager.d.ts +5 -1
- package/dist/src/lsp/manager.js +249 -3
- package/dist/src/lsp/npm-cache.d.ts +11 -1
- package/dist/src/lsp/npm-cache.js +17 -1
- package/dist/src/lsp/runtime.d.ts +6 -1
- package/dist/src/lsp/runtime.js +17 -1
- package/dist/src/lsp/types.d.ts +83 -1
- package/dist/src/lsp/types.js +10 -0
- package/dist/src/mcp/client-pool.js +43 -15
- package/dist/src/mcp/lsp-tools.d.ts +5 -1
- package/dist/src/mcp/lsp-tools.js +93 -2
- package/dist/src/mcp/mcp-keychain.d.ts +3 -5
- package/dist/src/mcp/mcp-keychain.js +9 -49
- package/dist/src/mcp/setup-guide-text.d.ts +1 -1
- package/dist/src/mcp/setup-guide-text.js +22 -2
- package/dist/src/mcp/tools-server.d.ts +10 -0
- package/dist/src/mcp/tools-server.js +10 -2
- package/dist/src/models/catalog.json +19 -19
- package/dist/src/orchestrator/ask-user.d.ts +61 -0
- package/dist/src/orchestrator/ask-user.js +65 -0
- package/dist/src/orchestrator/compaction.d.ts +2 -3
- package/dist/src/orchestrator/compaction.js +8 -8
- package/dist/src/orchestrator/council-manager.js +9 -8
- package/dist/src/orchestrator/council-request.d.ts +49 -0
- package/dist/src/orchestrator/council-request.js +62 -0
- package/dist/src/orchestrator/interactive-pause.d.ts +26 -0
- package/dist/src/orchestrator/interactive-pause.js +36 -0
- package/dist/src/orchestrator/message-processor.d.ts +4 -0
- package/dist/src/orchestrator/message-processor.js +26 -8
- package/dist/src/orchestrator/orchestrator.d.ts +25 -0
- package/dist/src/orchestrator/orchestrator.js +204 -50
- package/dist/src/orchestrator/preprocessor.js +2 -2
- package/dist/src/orchestrator/safety-askcard.d.ts +1 -1
- package/dist/src/orchestrator/safety-askcard.js +5 -2
- package/dist/src/orchestrator/safety-intercept.d.ts +5 -0
- package/dist/src/orchestrator/safety-intercept.js +7 -0
- package/dist/src/orchestrator/stall-watchdog.d.ts +8 -1
- package/dist/src/orchestrator/stall-watchdog.js +24 -3
- package/dist/src/orchestrator/stream-runner.d.ts +13 -3
- package/dist/src/orchestrator/stream-runner.js +54 -21
- package/dist/src/orchestrator/tool-engine.d.ts +19 -0
- package/dist/src/orchestrator/tool-engine.js +241 -25
- package/dist/src/orchestrator/turn-watchdog.d.ts +7 -0
- package/dist/src/orchestrator/turn-watchdog.js +38 -9
- package/dist/src/pil/agent-operating-contract.d.ts +1 -1
- package/dist/src/pil/agent-operating-contract.js +6 -4
- package/dist/src/pil/discovery.d.ts +1 -1
- package/dist/src/pil/discovery.js +2 -2
- package/dist/src/pil/layer1_5-complexity-size.d.ts +7 -0
- package/dist/src/pil/layer1_5-complexity-size.js +31 -5
- package/dist/src/pil/llm-classify.d.ts +78 -3
- package/dist/src/pil/llm-classify.js +351 -111
- package/dist/src/pil/native-capabilities-workbook.d.ts +1 -1
- package/dist/src/pil/native-capabilities-workbook.js +7 -0
- package/dist/src/pil/pipeline.js +2 -0
- package/dist/src/pil/repo-grounding-probe.d.ts +15 -0
- package/dist/src/pil/repo-grounding-probe.js +136 -0
- package/dist/src/pil/repo-structure-hints.d.ts +7 -0
- package/dist/src/pil/repo-structure-hints.js +45 -0
- package/dist/src/product-loop/artifact-io.js +4 -0
- package/dist/src/product-loop/criteria-seed.d.ts +51 -0
- package/dist/src/product-loop/criteria-seed.js +200 -0
- package/dist/src/product-loop/discovery-interview.d.ts +9 -0
- package/dist/src/product-loop/discovery-interview.js +37 -18
- package/dist/src/product-loop/discovery-recommender.js +2 -1
- package/dist/src/product-loop/discovery-schema.js +14 -1
- package/dist/src/product-loop/discovery-triage.d.ts +23 -0
- package/dist/src/product-loop/discovery-triage.js +109 -0
- package/dist/src/product-loop/gather.js +150 -2
- package/dist/src/product-loop/index.js +7 -0
- package/dist/src/product-loop/loop-driver.js +21 -8
- package/dist/src/product-loop/phase-plan.d.ts +16 -0
- package/dist/src/product-loop/phase-plan.js +42 -4
- package/dist/src/product-loop/phase-rituals.d.ts +3 -0
- package/dist/src/product-loop/phase-rituals.js +8 -3
- package/dist/src/product-loop/phase-runner.js +30 -11
- package/dist/src/product-loop/plan-adherence-review.d.ts +26 -0
- package/dist/src/product-loop/plan-adherence-review.js +144 -0
- package/dist/src/product-loop/sprint-runner.d.ts +62 -0
- package/dist/src/product-loop/sprint-runner.js +309 -8
- package/dist/src/product-loop/types.d.ts +25 -0
- package/dist/src/providers/anthropic.d.ts +9 -8
- package/dist/src/providers/anthropic.js +13 -47
- package/dist/src/providers/auth/grok-oauth.d.ts +1 -0
- package/dist/src/providers/auth/grok-oauth.js +30 -5
- package/dist/src/providers/auth/openai-oauth.d.ts +1 -0
- package/dist/src/providers/auth/openai-oauth.js +14 -0
- package/dist/src/providers/auth/token-store.d.ts +9 -9
- package/dist/src/providers/auth/token-store.js +8 -70
- package/dist/src/providers/auth/types.d.ts +8 -0
- package/dist/src/providers/env-store.d.ts +17 -0
- package/dist/src/providers/env-store.js +228 -0
- package/dist/src/providers/keychain.d.ts +21 -17
- package/dist/src/providers/keychain.js +124 -135
- package/dist/src/providers/runtime.d.ts +24 -9
- package/dist/src/providers/runtime.js +48 -37
- package/dist/src/providers/strategies/thinking-mode.js +9 -1
- package/dist/src/providers/strategies/xai.strategy.js +27 -0
- package/dist/src/providers/warm.d.ts +65 -0
- package/dist/src/providers/warm.js +145 -0
- package/dist/src/self-qa/agentic-loop.js +3 -2
- package/dist/src/storage/transcript.js +56 -2
- package/dist/src/tools/git-safety.d.ts +19 -0
- package/dist/src/tools/git-safety.js +168 -0
- package/dist/src/tools/native-tools.d.ts +1 -1
- package/dist/src/tools/native-tools.js +76 -1
- package/dist/src/tools/registry.d.ts +17 -0
- package/dist/src/tools/registry.js +116 -1
- package/dist/src/types/index.d.ts +29 -1
- package/dist/src/ui/app.js +67 -4
- package/dist/src/ui/components/agent-rail-activities.d.ts +26 -0
- package/dist/src/ui/components/agent-rail-activities.js +47 -0
- package/dist/src/ui/components/compact-progress-card.d.ts +24 -0
- package/dist/src/ui/components/compact-progress-card.js +42 -0
- package/dist/src/ui/components/council-phase-timeline.js +17 -2
- package/dist/src/ui/components/council-question-card.js +1 -0
- package/dist/src/ui/components/message-view.d.ts +15 -0
- package/dist/src/ui/components/message-view.js +50 -1
- package/dist/src/ui/components/tool-group.d.ts +15 -3
- package/dist/src/ui/components/tool-group.js +69 -11
- package/dist/src/ui/containers/modals-layer.d.ts +2 -1
- package/dist/src/ui/containers/modals-layer.js +2 -2
- package/dist/src/ui/council-harness-event.d.ts +57 -0
- package/dist/src/ui/council-harness-event.js +46 -0
- package/dist/src/ui/heartbeat-debug.d.ts +29 -0
- package/dist/src/ui/heartbeat-debug.js +45 -0
- package/dist/src/ui/modals/api-key-modal.js +1 -1
- package/dist/src/ui/modals/model-picker-modal.d.ts +8 -18
- package/dist/src/ui/modals/model-picker-modal.js +8 -10
- package/dist/src/ui/slash/ee.js +81 -0
- package/dist/src/ui/slash/menu-items.js +11 -2
- package/dist/src/ui/use-app-logic.js +354 -224
- package/dist/src/ui/utils/agent-activities.d.ts +39 -0
- package/dist/src/ui/utils/agent-activities.js +96 -0
- package/dist/src/ui/utils/group-tool-entries.d.ts +26 -0
- package/dist/src/ui/utils/group-tool-entries.js +111 -0
- package/dist/src/ui/utils/tool-summary.d.ts +21 -0
- package/dist/src/ui/utils/tool-summary.js +91 -0
- package/dist/src/utils/event-loop-monitor.d.ts +85 -0
- package/dist/src/utils/event-loop-monitor.js +107 -0
- package/dist/src/utils/llm-deadline.d.ts +14 -0
- package/dist/src/utils/llm-deadline.js +19 -0
- package/dist/src/utils/loop-profiler.d.ts +102 -0
- package/dist/src/utils/loop-profiler.js +202 -0
- package/dist/src/utils/settings.d.ts +27 -0
- package/dist/src/utils/settings.js +38 -2
- package/dist/src/utils/side-question.d.ts +1 -2
- package/dist/src/utils/side-question.js +2 -2
- package/dist/src/verify/entrypoint.js +51 -16
- package/dist/src/verify/orchestrator.d.ts +1 -1
- package/dist/src/verify/orchestrator.js +20 -3
- package/package.json +1 -2
- package/dist/src/cli/bw-vault.d.ts +0 -55
- package/dist/src/cli/bw-vault.js +0 -133
- package/dist/src/mcp/ee-tools.d.ts +0 -46
- package/dist/src/mcp/ee-tools.js +0 -194
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { resolvePlanCouncilLeader } from "../council/leader.js";
|
|
3
3
|
import { buildCouncilContextBundle } from "./council-context.js";
|
|
4
|
+
import { getPlanReviewDebateRetries } from "./flags.js";
|
|
4
5
|
import { buildGsdPerspectiveTaskRequest } from "./model-tier.js";
|
|
5
6
|
import { planningArtifact } from "./paths.js";
|
|
6
7
|
import { buildDebateTopic, buildPerspectivePrompt, perspectivesForDepth, } from "./plan-council-prompts.js";
|
|
@@ -137,81 +138,112 @@ export async function runPlanCouncil(opts) {
|
|
|
137
138
|
const leader = await resolvePlanCouncilLeader(sessionModelId);
|
|
138
139
|
const bundle = buildCouncilContextBundle(cwd, { depth, revisionCycle });
|
|
139
140
|
const topic = buildDebateTopic(planBody, bundle);
|
|
141
|
+
// The council debate returns an EMPTY synthesis on any of its fail-open
|
|
142
|
+
// paths (provider unreachable, sub-phase catch, user/watchdog abort) — a
|
|
143
|
+
// silent null we must NOT collapse into a permanent forced-`revise`. Retry
|
|
144
|
+
// the debate on empty (covers transient aborts), then fall back to the
|
|
145
|
+
// perspective path so an autonomous /ideal run never bricks with 0 code.
|
|
146
|
+
const maxRetries = getPlanReviewDebateRetries();
|
|
140
147
|
let synthesis = "";
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
let lastDebateError;
|
|
149
|
+
for (let attempt = 0; attempt <= maxRetries; attempt += 1) {
|
|
150
|
+
try {
|
|
151
|
+
synthesis = (await opts.runDebate(topic)) ?? "";
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
lastDebateError = err.message;
|
|
155
|
+
console.error(`[gsd] plan-review debate threw (attempt ${attempt + 1}/${maxRetries + 1}): ${lastDebateError}`);
|
|
156
|
+
synthesis = "";
|
|
157
|
+
}
|
|
158
|
+
if (synthesis.trim())
|
|
159
|
+
break;
|
|
160
|
+
if (attempt < maxRetries) {
|
|
161
|
+
console.error(`[gsd] plan-review debate returned empty synthesis ` +
|
|
162
|
+
`(attempt ${attempt + 1}/${maxRetries + 1}) — provider unreachable / aborted / ` +
|
|
163
|
+
`sub-phase fail-open; retrying`);
|
|
164
|
+
}
|
|
143
165
|
}
|
|
144
|
-
|
|
145
|
-
|
|
166
|
+
// Persistent empty synthesis after retries — this is a DEBATE FAILURE, not
|
|
167
|
+
// a plan defect. Do NOT write a misleading "leader did not emit a verdict"
|
|
168
|
+
// forced-revise (which would brick the run). Log the real reason
|
|
169
|
+
// (No-Silent-Catch) and fall through to the perspective path below, which
|
|
170
|
+
// produces a genuine verdict from parallel sub-agent reviewers (heuristic
|
|
171
|
+
// last resort) so the loop can proceed.
|
|
172
|
+
if (!synthesis.trim()) {
|
|
173
|
+
console.error(`[gsd] plan-review debate produced no synthesis after ${maxRetries + 1} attempt(s)` +
|
|
174
|
+
`${lastDebateError ? ` (last error: ${lastDebateError})` : ""} — ` +
|
|
175
|
+
`falling back to perspective review`);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
const parsed = extractStructuredVerdict(synthesis);
|
|
179
|
+
const parseFailed = parsed === null;
|
|
180
|
+
// Model-first: if we could not extract structured verdict, DO NOT regex
|
|
181
|
+
// the prose. Force a conservative revise so the loop iterates and the
|
|
182
|
+
// leader gets another chance to emit valid JSON (the prior-concerns
|
|
183
|
+
// directive re-states the contract).
|
|
184
|
+
// Map "approve" → "pass" so the merged verdict matches the union the rest
|
|
185
|
+
// of the pipeline expects (applyVerdict keys the gate on `=== "pass"`).
|
|
186
|
+
const rawVerdict = parseFailed ? "revise" : parsed.verdict;
|
|
187
|
+
const verdict = rawVerdict === "approve" ? "pass" : rawVerdict;
|
|
188
|
+
const source = parseFailed ? "parse-failed" : "structured";
|
|
189
|
+
const concerns = parsed?.concerns.map(String) ?? [
|
|
190
|
+
"Council leader did not emit a structured verdict block — forcing revision.",
|
|
191
|
+
];
|
|
192
|
+
const evidence = parsed?.evidence.map(String) ?? [];
|
|
193
|
+
const rationale = parsed?.rationale ?? "";
|
|
194
|
+
const planReviewPath = planningArtifact(cwd, "PLAN-REVIEW.md");
|
|
195
|
+
const planVerifyPath = planningArtifact(cwd, "PLAN-VERIFY.md");
|
|
196
|
+
const reviewContent = [
|
|
197
|
+
"# PLAN-REVIEW",
|
|
198
|
+
"",
|
|
199
|
+
`Leader: \`${leader.modelId}\``,
|
|
200
|
+
`Revision cycle: ${revisionCycle}`,
|
|
201
|
+
`Verdict source: ${source}${parseFailed ? " (parse failed — forced revise)" : ""}`,
|
|
202
|
+
"",
|
|
203
|
+
"## Council Debate Synthesis",
|
|
204
|
+
"",
|
|
205
|
+
synthesis.trim() || "No synthesis generated.",
|
|
206
|
+
rationale ? `\n**Rationale:** ${rationale}` : "",
|
|
207
|
+
"",
|
|
208
|
+
"## Merged Concerns",
|
|
209
|
+
"",
|
|
210
|
+
concerns.length ? concerns.map((c) => `- ${c}`).join("\n") : "- (none)",
|
|
211
|
+
].join("\n");
|
|
212
|
+
const verifyContent = [
|
|
213
|
+
"# PLAN-VERIFY",
|
|
214
|
+
"",
|
|
215
|
+
`verdict: ${verdict}`,
|
|
216
|
+
`revisionRequired: ${verdict === "revise" || verdict === "block" ? "yes" : "no"}`,
|
|
217
|
+
`verdictSource: ${source}`,
|
|
218
|
+
`verdictParseFailed: ${parseFailed ? "yes" : "no"}`,
|
|
219
|
+
"",
|
|
220
|
+
"## Summary",
|
|
221
|
+
verdict === "pass"
|
|
222
|
+
? "Council leader approved via structured verdict."
|
|
223
|
+
: parseFailed
|
|
224
|
+
? "Structured verdict missing — forced revision so the leader re-emits valid JSON."
|
|
225
|
+
: `Council requested ${verdict}.`,
|
|
226
|
+
"",
|
|
227
|
+
"## Concerns",
|
|
228
|
+
concerns.length ? concerns.map((c) => `- ${c}`).join("\n") : "- (none)",
|
|
229
|
+
].join("\n");
|
|
230
|
+
writeFileSync(planReviewPath, reviewContent, "utf8");
|
|
231
|
+
writeFileSync(planVerifyPath, verifyContent, "utf8");
|
|
232
|
+
applyVerdict(cwd, verdict);
|
|
233
|
+
return {
|
|
234
|
+
skipped: false,
|
|
235
|
+
perspectives: [],
|
|
236
|
+
planReviewPath,
|
|
237
|
+
planVerifyPath,
|
|
238
|
+
verdict,
|
|
239
|
+
leaderModelId: leader.modelId,
|
|
240
|
+
revisionRequired: verdict === "revise" || verdict === "block",
|
|
241
|
+
contextBundleChars: bundle.totalChars,
|
|
242
|
+
hadPriorConcerns: bundle.hadPriorConcerns,
|
|
243
|
+
verdictSource: source,
|
|
244
|
+
verdictParseFailed: parseFailed,
|
|
245
|
+
};
|
|
146
246
|
}
|
|
147
|
-
const parsed = extractStructuredVerdict(synthesis);
|
|
148
|
-
const parseFailed = parsed === null;
|
|
149
|
-
// Model-first: if we could not extract structured verdict, DO NOT regex
|
|
150
|
-
// the prose. Force a conservative revise so the loop iterates and the
|
|
151
|
-
// leader gets another chance to emit valid JSON (the prior-concerns
|
|
152
|
-
// directive re-states the contract).
|
|
153
|
-
// Map "approve" → "pass" so the merged verdict matches the union the rest
|
|
154
|
-
// of the pipeline expects (applyVerdict keys the gate on `=== "pass"`).
|
|
155
|
-
const rawVerdict = parseFailed ? "revise" : parsed.verdict;
|
|
156
|
-
const verdict = rawVerdict === "approve" ? "pass" : rawVerdict;
|
|
157
|
-
const source = parseFailed ? "parse-failed" : "structured";
|
|
158
|
-
const concerns = parsed?.concerns.map(String) ?? [
|
|
159
|
-
"Council leader did not emit a structured verdict block — forcing revision.",
|
|
160
|
-
];
|
|
161
|
-
const evidence = parsed?.evidence.map(String) ?? [];
|
|
162
|
-
const rationale = parsed?.rationale ?? "";
|
|
163
|
-
const planReviewPath = planningArtifact(cwd, "PLAN-REVIEW.md");
|
|
164
|
-
const planVerifyPath = planningArtifact(cwd, "PLAN-VERIFY.md");
|
|
165
|
-
const reviewContent = [
|
|
166
|
-
"# PLAN-REVIEW",
|
|
167
|
-
"",
|
|
168
|
-
`Leader: \`${leader.modelId}\``,
|
|
169
|
-
`Revision cycle: ${revisionCycle}`,
|
|
170
|
-
`Verdict source: ${source}${parseFailed ? " (parse failed — forced revise)" : ""}`,
|
|
171
|
-
"",
|
|
172
|
-
"## Council Debate Synthesis",
|
|
173
|
-
"",
|
|
174
|
-
synthesis.trim() || "No synthesis generated.",
|
|
175
|
-
rationale ? `\n**Rationale:** ${rationale}` : "",
|
|
176
|
-
"",
|
|
177
|
-
"## Merged Concerns",
|
|
178
|
-
"",
|
|
179
|
-
concerns.length ? concerns.map((c) => `- ${c}`).join("\n") : "- (none)",
|
|
180
|
-
].join("\n");
|
|
181
|
-
const verifyContent = [
|
|
182
|
-
"# PLAN-VERIFY",
|
|
183
|
-
"",
|
|
184
|
-
`verdict: ${verdict}`,
|
|
185
|
-
`revisionRequired: ${verdict === "revise" || verdict === "block" ? "yes" : "no"}`,
|
|
186
|
-
`verdictSource: ${source}`,
|
|
187
|
-
`verdictParseFailed: ${parseFailed ? "yes" : "no"}`,
|
|
188
|
-
"",
|
|
189
|
-
"## Summary",
|
|
190
|
-
verdict === "pass"
|
|
191
|
-
? "Council leader approved via structured verdict."
|
|
192
|
-
: parseFailed
|
|
193
|
-
? "Structured verdict missing — forced revision so the leader re-emits valid JSON."
|
|
194
|
-
: `Council requested ${verdict}.`,
|
|
195
|
-
"",
|
|
196
|
-
"## Concerns",
|
|
197
|
-
concerns.length ? concerns.map((c) => `- ${c}`).join("\n") : "- (none)",
|
|
198
|
-
].join("\n");
|
|
199
|
-
writeFileSync(planReviewPath, reviewContent, "utf8");
|
|
200
|
-
writeFileSync(planVerifyPath, verifyContent, "utf8");
|
|
201
|
-
applyVerdict(cwd, verdict);
|
|
202
|
-
return {
|
|
203
|
-
skipped: false,
|
|
204
|
-
perspectives: [],
|
|
205
|
-
planReviewPath,
|
|
206
|
-
planVerifyPath,
|
|
207
|
-
verdict,
|
|
208
|
-
leaderModelId: leader.modelId,
|
|
209
|
-
revisionRequired: verdict === "revise" || verdict === "block",
|
|
210
|
-
contextBundleChars: bundle.totalChars,
|
|
211
|
-
hadPriorConcerns: bundle.hadPriorConcerns,
|
|
212
|
-
verdictSource: source,
|
|
213
|
-
verdictParseFailed: parseFailed,
|
|
214
|
-
};
|
|
215
247
|
}
|
|
216
248
|
// ---------- Perspective path (parallel sub-agents) ----------
|
|
217
249
|
const leader = await resolvePlanCouncilLeader(sessionModelId);
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
import { z } from "zod";
|
|
21
21
|
export declare const PlanCouncilVerdictSchema: z.ZodObject<{
|
|
22
22
|
verdict: z.ZodEnum<{
|
|
23
|
-
approve: "approve";
|
|
24
23
|
block: "block";
|
|
24
|
+
approve: "approve";
|
|
25
25
|
revise: "revise";
|
|
26
26
|
}>;
|
|
27
27
|
concerns: z.ZodCatch<z.ZodArray<z.ZodString>>;
|
|
@@ -10,6 +10,10 @@ export function createCouncilAutoAnswerer(opts) {
|
|
|
10
10
|
"pil-acceptance": [],
|
|
11
11
|
"tool-loop-cap": [],
|
|
12
12
|
"safety-override": [],
|
|
13
|
+
// ask_user: no file queue — fall through to defaultAnswerFor, which returns
|
|
14
|
+
// the agent's FIRST option (index 0) or "" for a free-text ask. Index 0 is
|
|
15
|
+
// NOT a CLI recommendation, just first-listed; headless has no human.
|
|
16
|
+
"ask-user": [],
|
|
13
17
|
};
|
|
14
18
|
const preflightApprove = opts.file?.preflightApprove ?? true;
|
|
15
19
|
return {
|