ridgeline 0.2.25 → 0.3.6
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/README.md +1 -1
- package/dist/agents/core/builder.md +1 -1
- package/dist/agents/core/reviewer.md +3 -3
- package/dist/agents/planners/simplicity.md +7 -0
- package/dist/agents/planners/synthesizer.md +90 -0
- package/dist/agents/planners/thoroughness.md +7 -0
- package/dist/agents/planners/velocity.md +7 -0
- package/dist/agents/specialists/{depender.md → auditor.md} +2 -2
- package/dist/agents/specialists/{navigator.md → scout.md} +2 -2
- package/dist/agents/specialists/{checker.md → verifier.md} +10 -10
- package/dist/cli.js +17 -37
- package/dist/cli.js.map +1 -1
- package/dist/commands/build.d.ts +1 -0
- package/dist/commands/build.js +46 -48
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/dry-run.d.ts +2 -0
- package/dist/commands/dry-run.js +66 -0
- package/dist/commands/dry-run.js.map +1 -0
- package/dist/commands/index.d.ts +2 -2
- package/dist/commands/index.js +2 -2
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/plan.js +14 -7
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/spec.js +85 -97
- package/dist/commands/spec.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/engine/claude/sandbox.bwrap.d.ts +1 -1
- package/dist/engine/claude/sandbox.d.ts +3 -8
- package/dist/engine/claude/sandbox.greywall.d.ts +1 -1
- package/dist/engine/claude/sandbox.js.map +1 -1
- package/dist/engine/claude/sandbox.types.d.ts +7 -0
- package/dist/engine/claude/sandbox.types.js +3 -0
- package/dist/engine/claude/sandbox.types.js.map +1 -0
- package/dist/engine/claude/stream.decode.d.ts +4 -1
- package/dist/engine/claude/stream.decode.js +8 -2
- package/dist/engine/claude/stream.decode.js.map +1 -1
- package/dist/engine/discovery/agent.scan.d.ts +0 -1
- package/dist/engine/discovery/agent.scan.js +2 -3
- package/dist/engine/discovery/agent.scan.js.map +1 -1
- package/dist/engine/index.d.ts +4 -4
- package/dist/engine/index.js +3 -4
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/pipeline/build.exec.js +6 -37
- package/dist/engine/pipeline/build.exec.js.map +1 -1
- package/dist/engine/pipeline/ensemble.exec.d.ts +12 -0
- package/dist/engine/pipeline/ensemble.exec.js +343 -0
- package/dist/engine/pipeline/ensemble.exec.js.map +1 -0
- package/dist/engine/pipeline/pipeline.shared.d.ts +42 -0
- package/dist/engine/pipeline/pipeline.shared.js +111 -0
- package/dist/engine/pipeline/pipeline.shared.js.map +1 -0
- package/dist/engine/pipeline/plan.exec.d.ts +3 -5
- package/dist/engine/pipeline/plan.exec.js +6 -62
- package/dist/engine/pipeline/plan.exec.js.map +1 -1
- package/dist/engine/pipeline/review.exec.js +6 -29
- package/dist/engine/pipeline/review.exec.js.map +1 -1
- package/dist/engine/worktree.d.ts +0 -5
- package/dist/engine/worktree.js +10 -15
- package/dist/engine/worktree.js.map +1 -1
- package/dist/store/feedback.js +65 -64
- package/dist/store/feedback.js.map +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.js.map +1 -1
- package/dist/store/settings.d.ts +2 -1
- package/dist/types.d.ts +23 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js.map +1 -1
- package/package.json +4 -2
- package/dist/agents/core/hooks/network-guard.md +0 -24
- package/dist/agents/core/plugin.json +0 -4
|
@@ -40,19 +40,11 @@ const claude_exec_1 = require("../claude/claude.exec");
|
|
|
40
40
|
const agent_prompt_1 = require("../claude/agent.prompt");
|
|
41
41
|
const stream_decode_1 = require("../claude/stream.decode");
|
|
42
42
|
const handoff_1 = require("../../store/handoff");
|
|
43
|
-
const agent_scan_1 = require("../discovery/agent.scan");
|
|
44
43
|
const plugin_scan_1 = require("../discovery/plugin.scan");
|
|
45
|
-
const
|
|
44
|
+
const pipeline_shared_1 = require("./pipeline.shared");
|
|
46
45
|
const assembleUserPrompt = (config, phase, feedbackPath) => {
|
|
47
46
|
const sections = [];
|
|
48
|
-
|
|
49
|
-
sections.push(fs.readFileSync(config.constraintsPath, "utf-8"));
|
|
50
|
-
sections.push("");
|
|
51
|
-
if (config.tastePath) {
|
|
52
|
-
sections.push("## taste.md\n");
|
|
53
|
-
sections.push(fs.readFileSync(config.tastePath, "utf-8"));
|
|
54
|
-
sections.push("");
|
|
55
|
-
}
|
|
47
|
+
(0, pipeline_shared_1.appendConstraintsAndTaste)(sections, config);
|
|
56
48
|
const handoff = (0, handoff_1.readHandoff)(config.buildDir);
|
|
57
49
|
if (handoff) {
|
|
58
50
|
sections.push("## handoff.md\n");
|
|
@@ -86,44 +78,21 @@ const assembleUserPrompt = (config, phase, feedbackPath) => {
|
|
|
86
78
|
const invokeBuilder = async (config, phase, feedbackPath) => {
|
|
87
79
|
const systemPrompt = (0, agent_prompt_1.resolveAgentPrompt)("builder.md");
|
|
88
80
|
const userPrompt = assembleUserPrompt(config, phase, feedbackPath);
|
|
89
|
-
const { onStdout, flush } = (0, stream_decode_1.createDisplayCallbacks)();
|
|
90
|
-
const
|
|
91
|
-
const agents = (0, agent_scan_1.buildAgentsFlag)(builtinAgents);
|
|
92
|
-
const pluginDirs = (0, plugin_scan_1.discoverPluginDirs)(config);
|
|
93
|
-
// Include core hooks plugin when running in unsafe mode (no sandbox)
|
|
94
|
-
if (config.unsafe && !config.sandboxProvider) {
|
|
95
|
-
const coreDir = (0, plugin_scan_1.getCorePluginDir)();
|
|
96
|
-
if (coreDir) {
|
|
97
|
-
pluginDirs.push({ dir: coreDir, createdPluginJson: false });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
81
|
+
const { onStdout, flush } = (0, stream_decode_1.createDisplayCallbacks)({ projectRoot: config.worktreePath ?? process.cwd() });
|
|
82
|
+
const prepared = (0, pipeline_shared_1.prepareAgentsAndPlugins)(config);
|
|
100
83
|
try {
|
|
101
84
|
const result = await (0, claude_exec_1.invokeClaude)({
|
|
102
85
|
systemPrompt,
|
|
103
86
|
userPrompt,
|
|
104
87
|
model: config.model,
|
|
105
88
|
allowedTools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep", "Agent"],
|
|
106
|
-
|
|
107
|
-
pluginDirs: pluginDirs.length > 0 ? pluginDirs.map((p) => p.dir) : undefined,
|
|
108
|
-
cwd: config.worktreePath ?? process.cwd(),
|
|
109
|
-
timeoutMs: config.timeoutMinutes * 60 * 1000,
|
|
110
|
-
onStdout,
|
|
111
|
-
onStderr: (text) => {
|
|
112
|
-
// Surface auth errors and other critical stderr messages immediately
|
|
113
|
-
const lower = text.toLowerCase();
|
|
114
|
-
if (lower.includes("error") || lower.includes("auth") || lower.includes("unauthorized") || lower.includes("forbidden")) {
|
|
115
|
-
(0, output_1.printError)(`claude stderr: ${text.trim()}`);
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
sandboxProvider: config.sandboxProvider,
|
|
119
|
-
networkAllowlist: config.networkAllowlist,
|
|
120
|
-
additionalWritePaths: [config.buildDir],
|
|
89
|
+
...(0, pipeline_shared_1.commonInvokeOptions)(config, prepared, onStdout),
|
|
121
90
|
});
|
|
122
91
|
return result;
|
|
123
92
|
}
|
|
124
93
|
finally {
|
|
125
94
|
flush();
|
|
126
|
-
(0, plugin_scan_1.cleanupPluginDirs)(pluginDirs);
|
|
95
|
+
(0, plugin_scan_1.cleanupPluginDirs)(prepared.pluginDirs);
|
|
127
96
|
}
|
|
128
97
|
};
|
|
129
98
|
exports.invokeBuilder = invokeBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.exec.js","sourceRoot":"","sources":["../../../src/engine/pipeline/build.exec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6B;AAC7B,gDAAiC;AAEjC,uDAAoD;AACpD,yDAA2D;AAC3D,2DAAgE;AAChE,iDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"build.exec.js","sourceRoot":"","sources":["../../../src/engine/pipeline/build.exec.ts"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Y,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;YACxE,GAAG,IAAA,qCAAmB,EAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;SACnD,CAAC,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;YAAS,CAAC;QACT,KAAK,EAAE,CAAA;QACP,IAAA,+BAAiB,EAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IACxC,CAAC;AACH,CAAC,CAAA;AAxBY,QAAA,aAAa,iBAwBzB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RidgelineConfig, PhaseInfo, ClaudeResult, EnsemblePlanResult } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* Attempt to extract a JSON object from a string that may be wrapped in
|
|
4
|
+
* markdown fences (```json ... ```) or surrounded by explanatory text.
|
|
5
|
+
* Returns the parsed object on success, or throws on failure.
|
|
6
|
+
*/
|
|
7
|
+
export declare const extractJSON: (raw: string) => unknown;
|
|
8
|
+
export declare const invokePlanner: (config: RidgelineConfig) => Promise<{
|
|
9
|
+
result: ClaudeResult;
|
|
10
|
+
phases: PhaseInfo[];
|
|
11
|
+
ensemble: EnsemblePlanResult;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.invokePlanner = exports.extractJSON = void 0;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const claude_exec_1 = require("../claude/claude.exec");
|
|
40
|
+
const stream_decode_1 = require("../claude/stream.decode");
|
|
41
|
+
const phases_1 = require("../../store/phases");
|
|
42
|
+
const agent_scan_1 = require("../discovery/agent.scan");
|
|
43
|
+
const output_1 = require("../../ui/output");
|
|
44
|
+
const spinner_1 = require("../../ui/spinner");
|
|
45
|
+
const agent_prompt_1 = require("../claude/agent.prompt");
|
|
46
|
+
const plan_exec_1 = require("./plan.exec");
|
|
47
|
+
const pipeline_shared_1 = require("./pipeline.shared");
|
|
48
|
+
const resolvePlannersDir = () => {
|
|
49
|
+
const candidates = [
|
|
50
|
+
path.join(__dirname, "..", "agents", "planners"),
|
|
51
|
+
path.join(__dirname, "..", "..", "agents", "planners"),
|
|
52
|
+
path.join(__dirname, "..", "..", "..", "src", "agents", "planners"),
|
|
53
|
+
];
|
|
54
|
+
for (const dir of candidates) {
|
|
55
|
+
if (fs.existsSync(dir) && fs.statSync(dir).isDirectory())
|
|
56
|
+
return dir;
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
60
|
+
const discoverPlanners = () => {
|
|
61
|
+
const dir = resolvePlannersDir();
|
|
62
|
+
if (!dir)
|
|
63
|
+
return [];
|
|
64
|
+
const planners = [];
|
|
65
|
+
for (const entry of fs.readdirSync(dir)) {
|
|
66
|
+
if (!entry.endsWith(".md"))
|
|
67
|
+
continue;
|
|
68
|
+
if (entry === "synthesizer.md")
|
|
69
|
+
continue; // synthesizer is not a specialist
|
|
70
|
+
const filepath = path.join(dir, entry);
|
|
71
|
+
try {
|
|
72
|
+
const content = fs.readFileSync(filepath, "utf-8");
|
|
73
|
+
const fm = (0, agent_scan_1.parseFrontmatter)(content);
|
|
74
|
+
if (!fm)
|
|
75
|
+
continue;
|
|
76
|
+
// Extract perspective from frontmatter or fall back to filename
|
|
77
|
+
const perspectiveMatch = content.match(/^perspective:\s*(.+)$/m);
|
|
78
|
+
const perspective = perspectiveMatch ? perspectiveMatch[1].trim() : fm.name;
|
|
79
|
+
// The overlay is the body after frontmatter
|
|
80
|
+
const body = content.replace(/^---\n[\s\S]*?\n---\n*/, "").trim();
|
|
81
|
+
if (!body)
|
|
82
|
+
continue;
|
|
83
|
+
planners.push({ perspective, overlay: body });
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// Skip unreadable files
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return planners;
|
|
90
|
+
};
|
|
91
|
+
const resolveSynthesizerPrompt = () => {
|
|
92
|
+
const dir = resolvePlannersDir();
|
|
93
|
+
if (dir) {
|
|
94
|
+
const synthPath = path.join(dir, "synthesizer.md");
|
|
95
|
+
if (fs.existsSync(synthPath))
|
|
96
|
+
return fs.readFileSync(synthPath, "utf-8");
|
|
97
|
+
}
|
|
98
|
+
// Fallback to core agents location
|
|
99
|
+
return (0, agent_prompt_1.resolveAgentPrompt)("synthesizer.md");
|
|
100
|
+
};
|
|
101
|
+
// ---------------------------------------------------------------------------
|
|
102
|
+
// Robust JSON extraction — handles markdown fences and surrounding text
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
/**
|
|
105
|
+
* Attempt to extract a JSON object from a string that may be wrapped in
|
|
106
|
+
* markdown fences (```json ... ```) or surrounded by explanatory text.
|
|
107
|
+
* Returns the parsed object on success, or throws on failure.
|
|
108
|
+
*/
|
|
109
|
+
const extractJSON = (raw) => {
|
|
110
|
+
const trimmed = raw.trim();
|
|
111
|
+
// 1. Try direct parse first (happy path)
|
|
112
|
+
try {
|
|
113
|
+
return JSON.parse(trimmed);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// continue to extraction strategies
|
|
117
|
+
}
|
|
118
|
+
// 2. Strip markdown fences: ```json ... ``` or ``` ... ```
|
|
119
|
+
const fenceMatch = trimmed.match(/```(?:json)?\s*\n?([\s\S]*?)```/);
|
|
120
|
+
if (fenceMatch) {
|
|
121
|
+
try {
|
|
122
|
+
return JSON.parse(fenceMatch[1].trim());
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
// continue
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// 3. Find the outermost { ... } in the string
|
|
129
|
+
const firstBrace = trimmed.indexOf("{");
|
|
130
|
+
const lastBrace = trimmed.lastIndexOf("}");
|
|
131
|
+
if (firstBrace !== -1 && lastBrace > firstBrace) {
|
|
132
|
+
try {
|
|
133
|
+
return JSON.parse(trimmed.slice(firstBrace, lastBrace + 1));
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
// continue
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
throw new Error("No valid JSON object found in output");
|
|
140
|
+
};
|
|
141
|
+
exports.extractJSON = extractJSON;
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
// JSON schema for structured specialist output
|
|
144
|
+
// ---------------------------------------------------------------------------
|
|
145
|
+
const SPECIALIST_PROPOSAL_SCHEMA = JSON.stringify({
|
|
146
|
+
type: "object",
|
|
147
|
+
properties: {
|
|
148
|
+
perspective: { type: "string", description: "The specialist's perspective label" },
|
|
149
|
+
summary: { type: "string", description: "1-2 sentence overview of the approach" },
|
|
150
|
+
phases: {
|
|
151
|
+
type: "array",
|
|
152
|
+
items: {
|
|
153
|
+
type: "object",
|
|
154
|
+
properties: {
|
|
155
|
+
title: { type: "string" },
|
|
156
|
+
slug: { type: "string", description: "Kebab-case slug for file naming" },
|
|
157
|
+
goal: { type: "string", description: "1-3 paragraphs in business/product terms" },
|
|
158
|
+
acceptanceCriteria: {
|
|
159
|
+
type: "array",
|
|
160
|
+
items: { type: "string" },
|
|
161
|
+
description: "Concrete, verifiable outcomes",
|
|
162
|
+
},
|
|
163
|
+
specReference: { type: "string", description: "Relevant spec sections" },
|
|
164
|
+
rationale: { type: "string", description: "Why this phase boundary exists" },
|
|
165
|
+
},
|
|
166
|
+
required: ["title", "slug", "goal", "acceptanceCriteria", "specReference", "rationale"],
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
tradeoffs: { type: "string", description: "What this approach sacrifices" },
|
|
170
|
+
},
|
|
171
|
+
required: ["perspective", "summary", "phases", "tradeoffs"],
|
|
172
|
+
});
|
|
173
|
+
// ---------------------------------------------------------------------------
|
|
174
|
+
// Prompt construction
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
/**
|
|
177
|
+
* Build a specialist system prompt by prepending the personality overlay to the
|
|
178
|
+
* base planner prompt, then replacing the file-writing instructions with a
|
|
179
|
+
* directive to return structured JSON.
|
|
180
|
+
*/
|
|
181
|
+
const buildSpecialistSystemPrompt = (basePrompt, overlay) => {
|
|
182
|
+
// Strip YAML frontmatter from the base prompt
|
|
183
|
+
const withoutFrontmatter = basePrompt.replace(/^---\n[\s\S]*?\n---\n*/, "");
|
|
184
|
+
// Remove the output-related sections that reference the Write tool and file naming
|
|
185
|
+
const withoutOutput = withoutFrontmatter
|
|
186
|
+
.replace(/## File Naming[\s\S]*?(?=## Phase Spec Format)/, "")
|
|
187
|
+
.replace(/## Process[\s\S]*$/, "");
|
|
188
|
+
const jsonDirective = [
|
|
189
|
+
"",
|
|
190
|
+
"## Output Format",
|
|
191
|
+
"",
|
|
192
|
+
"Return your plan as a single JSON object matching the provided schema.",
|
|
193
|
+
"Do not use the Write tool. Do not produce markdown files.",
|
|
194
|
+
"Include your perspective label, a brief summary, your proposed phases, and the tradeoffs of your approach.",
|
|
195
|
+
].join("\n");
|
|
196
|
+
return `${overlay}\n\n${withoutOutput}${jsonDirective}`;
|
|
197
|
+
};
|
|
198
|
+
/** Assemble the user prompt for a specialist (no output directory). */
|
|
199
|
+
const assembleSpecialistUserPrompt = (config) => {
|
|
200
|
+
return (0, plan_exec_1.assembleBaseUserPrompt)(config) + "\n\nReturn your proposed plan as structured JSON.";
|
|
201
|
+
};
|
|
202
|
+
/** Assemble the user prompt for the synthesizer, including all proposals. */
|
|
203
|
+
const assembleSynthesizerUserPrompt = (config, proposals) => {
|
|
204
|
+
const sections = [];
|
|
205
|
+
// Include original inputs
|
|
206
|
+
sections.push((0, plan_exec_1.assembleBaseUserPrompt)(config));
|
|
207
|
+
sections.push("");
|
|
208
|
+
// Include each specialist proposal
|
|
209
|
+
sections.push("## Specialist Proposals\n");
|
|
210
|
+
for (const { perspective, proposal } of proposals) {
|
|
211
|
+
sections.push(`### ${perspective.charAt(0).toUpperCase() + perspective.slice(1)} Specialist\n`);
|
|
212
|
+
sections.push(`**Summary:** ${proposal.summary}\n`);
|
|
213
|
+
sections.push(`**Tradeoffs:** ${proposal.tradeoffs}\n`);
|
|
214
|
+
sections.push(`**Phases (${proposal.phases.length}):**\n`);
|
|
215
|
+
for (let i = 0; i < proposal.phases.length; i++) {
|
|
216
|
+
const phase = proposal.phases[i];
|
|
217
|
+
sections.push(`#### Phase ${i + 1}: ${phase.title} (\`${phase.slug}\`)`);
|
|
218
|
+
sections.push(`**Goal:** ${phase.goal}\n`);
|
|
219
|
+
sections.push("**Acceptance Criteria:**");
|
|
220
|
+
for (const criterion of phase.acceptanceCriteria) {
|
|
221
|
+
sections.push(`- ${criterion}`);
|
|
222
|
+
}
|
|
223
|
+
sections.push(`\n**Spec Reference:** ${phase.specReference}`);
|
|
224
|
+
sections.push(`**Rationale:** ${phase.rationale}\n`);
|
|
225
|
+
}
|
|
226
|
+
sections.push("---\n");
|
|
227
|
+
}
|
|
228
|
+
// Output directory
|
|
229
|
+
sections.push("## Output Directory\n");
|
|
230
|
+
sections.push(`Write phase spec files to: ${config.phasesDir}`);
|
|
231
|
+
sections.push("Use the naming convention: 01-<slug>.md, 02-<slug>.md, etc.");
|
|
232
|
+
return sections.join("\n");
|
|
233
|
+
};
|
|
234
|
+
// ---------------------------------------------------------------------------
|
|
235
|
+
// Ensemble orchestration
|
|
236
|
+
// ---------------------------------------------------------------------------
|
|
237
|
+
const invokePlanner = async (config) => {
|
|
238
|
+
const planners = discoverPlanners();
|
|
239
|
+
if (planners.length === 0) {
|
|
240
|
+
throw new Error("No planner personalities found in agents/planners/");
|
|
241
|
+
}
|
|
242
|
+
const basePrompt = (0, agent_prompt_1.resolveAgentPrompt)("planner.md");
|
|
243
|
+
const specialistUserPrompt = assembleSpecialistUserPrompt(config);
|
|
244
|
+
// --- Phase 1: Spawn specialists in parallel ---
|
|
245
|
+
const spinner = (0, spinner_1.startSpinner)("Planning");
|
|
246
|
+
const specialistPromises = planners.map(({ perspective, overlay }) => {
|
|
247
|
+
const systemPrompt = buildSpecialistSystemPrompt(basePrompt, overlay);
|
|
248
|
+
const startTime = Date.now();
|
|
249
|
+
return (0, claude_exec_1.invokeClaude)({
|
|
250
|
+
systemPrompt,
|
|
251
|
+
userPrompt: specialistUserPrompt,
|
|
252
|
+
model: config.model,
|
|
253
|
+
allowedTools: [],
|
|
254
|
+
cwd: process.cwd(),
|
|
255
|
+
timeoutMs: config.timeoutMinutes * 60 * 1000,
|
|
256
|
+
jsonSchema: SPECIALIST_PROPOSAL_SCHEMA,
|
|
257
|
+
onStderr: (0, pipeline_shared_1.createStderrHandler)(perspective),
|
|
258
|
+
}).then((result) => {
|
|
259
|
+
const elapsed = (0, spinner_1.formatElapsed)(Date.now() - startTime);
|
|
260
|
+
spinner.printAbove(` ${perspective.padEnd(14)} complete (${elapsed}, $${result.costUsd.toFixed(2)})`);
|
|
261
|
+
return { perspective, result };
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
const settled = await Promise.allSettled(specialistPromises);
|
|
265
|
+
// --- Phase 2: Collect successful proposals ---
|
|
266
|
+
const successful = [];
|
|
267
|
+
for (const outcome of settled) {
|
|
268
|
+
if (outcome.status === "fulfilled") {
|
|
269
|
+
const { perspective, result } = outcome.value;
|
|
270
|
+
try {
|
|
271
|
+
const proposal = (0, exports.extractJSON)(result.result);
|
|
272
|
+
successful.push({ perspective, result, proposal });
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
const preview = result.result.length > 300
|
|
276
|
+
? result.result.slice(0, 300) + "…"
|
|
277
|
+
: result.result;
|
|
278
|
+
(0, output_1.printError)(`Failed to parse ${perspective} specialist output as JSON. Preview:\n${preview}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
(0, output_1.printError)(`Specialist failed: ${outcome.reason}`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
const minRequired = Math.ceil(planners.length / 2);
|
|
286
|
+
if (successful.length < minRequired) {
|
|
287
|
+
spinner.stop();
|
|
288
|
+
throw new Error(`Planning requires at least ${minRequired} of ${planners.length} specialist proposals to succeed, got ${successful.length}. ` +
|
|
289
|
+
"Check Claude authentication and try again.");
|
|
290
|
+
}
|
|
291
|
+
if (successful.length < planners.length) {
|
|
292
|
+
(0, output_1.printInfo)(`Continuing with ${successful.length} of ${planners.length} proposals`);
|
|
293
|
+
}
|
|
294
|
+
// --- Budget guard ---
|
|
295
|
+
const specialistCost = successful.reduce((sum, s) => sum + s.result.costUsd, 0);
|
|
296
|
+
if (config.maxBudgetUsd !== null && specialistCost >= config.maxBudgetUsd) {
|
|
297
|
+
spinner.stop();
|
|
298
|
+
throw new Error(`Specialist planning cost ($${specialistCost.toFixed(2)}) already exceeds budget ($${config.maxBudgetUsd.toFixed(2)}). ` +
|
|
299
|
+
"Skipping synthesis to avoid further cost.");
|
|
300
|
+
}
|
|
301
|
+
// --- Phase 3: Synthesize ---
|
|
302
|
+
spinner.stop();
|
|
303
|
+
(0, output_1.printInfo)("Synthesizing best plan from specialist proposals...");
|
|
304
|
+
const synthesizerPrompt = resolveSynthesizerPrompt();
|
|
305
|
+
const synthesizerUserPrompt = assembleSynthesizerUserPrompt(config, successful.map(({ perspective, proposal }) => ({ perspective, proposal })));
|
|
306
|
+
const { onStdout, flush } = (0, stream_decode_1.createDisplayCallbacks)({ projectRoot: process.cwd() });
|
|
307
|
+
let synthResult;
|
|
308
|
+
try {
|
|
309
|
+
synthResult = await (0, claude_exec_1.invokeClaude)({
|
|
310
|
+
systemPrompt: synthesizerPrompt,
|
|
311
|
+
userPrompt: synthesizerUserPrompt,
|
|
312
|
+
model: config.model,
|
|
313
|
+
allowedTools: ["Write"],
|
|
314
|
+
cwd: process.cwd(),
|
|
315
|
+
timeoutMs: config.timeoutMinutes * 60 * 1000,
|
|
316
|
+
onStdout,
|
|
317
|
+
onStderr: (0, pipeline_shared_1.createStderrHandler)("synthesizer"),
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
finally {
|
|
321
|
+
flush();
|
|
322
|
+
}
|
|
323
|
+
// --- Phase 4: Collect results ---
|
|
324
|
+
const phases = (0, phases_1.scanPhases)(config.phasesDir);
|
|
325
|
+
if (phases.length === 0) {
|
|
326
|
+
throw new Error("Synthesizer did not generate any phase files");
|
|
327
|
+
}
|
|
328
|
+
const specialistResults = successful.map((s) => s.result);
|
|
329
|
+
const totalCostUsd = specialistCost + synthResult.costUsd;
|
|
330
|
+
const totalDurationMs = Math.max(...specialistResults.map((r) => r.durationMs)) + synthResult.durationMs;
|
|
331
|
+
return {
|
|
332
|
+
result: synthResult,
|
|
333
|
+
phases,
|
|
334
|
+
ensemble: {
|
|
335
|
+
specialistResults,
|
|
336
|
+
synthesizerResult: synthResult,
|
|
337
|
+
totalCostUsd,
|
|
338
|
+
totalDurationMs,
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
exports.invokePlanner = invokePlanner;
|
|
343
|
+
//# sourceMappingURL=ensemble.exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensemble.exec.js","sourceRoot":"","sources":["../../../src/engine/pipeline/ensemble.exec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6B;AAC7B,gDAAiC;AAEjC,uDAAoD;AACpD,2DAAgE;AAChE,+CAA+C;AAC/C,wDAA0D;AAC1D,4CAAuD;AACvD,8CAA8D;AAC9D,yDAA2D;AAC3D,2CAAoD;AACpD,uDAAuD;AAWvD,MAAM,kBAAkB,GAAG,GAAkB,EAAE;IAC7C,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC;QAChD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC;QACtD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,CAAC;KACpE,CAAA;IACD,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,IA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C;IAED,MAAM,iBAAiB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IACzD,MAAM,YAAY,GAAG,cAAc,GAAG,WAAW,CAAC,OAAO,CAAA;IACzD,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,WAAW,CAAC,UAAU,CAAA;IAExG,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,MAAM;QACN,QAAQ,EAAE;YACR,iBAAiB;YACjB,iBAAiB,EAAE,WAAW;YAC9B,YAAY;YACZ,eAAe;SAChB;KACF,CAAA;AACH,CAAC,CAAA;AA/HY,QAAA,aAAa,iBA+HzB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RidgelineConfig } from "../../types";
|
|
2
|
+
import { PluginDir } from "../discovery/plugin.scan";
|
|
3
|
+
/**
|
|
4
|
+
* Discover agents and plugins, including the core hooks plugin in unsafe mode.
|
|
5
|
+
*/
|
|
6
|
+
export declare const prepareAgentsAndPlugins: (config: RidgelineConfig) => {
|
|
7
|
+
agents: Record<string, {
|
|
8
|
+
description: string;
|
|
9
|
+
prompt: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
}> | undefined;
|
|
12
|
+
pluginDirs: PluginDir[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Create an onStderr callback that surfaces auth errors and critical messages.
|
|
16
|
+
*/
|
|
17
|
+
export declare const createStderrHandler: (label?: string) => ((text: string) => void);
|
|
18
|
+
/**
|
|
19
|
+
* Append constraints.md and optional taste.md sections to a prompt sections array.
|
|
20
|
+
*/
|
|
21
|
+
export declare const appendConstraintsAndTaste: (sections: string[], config: RidgelineConfig) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Build the common invokeClaude options shared across pipeline agents.
|
|
24
|
+
*/
|
|
25
|
+
export declare const commonInvokeOptions: (config: RidgelineConfig, prepared: {
|
|
26
|
+
agents: ReturnType<typeof prepareAgentsAndPlugins>["agents"];
|
|
27
|
+
pluginDirs: PluginDir[];
|
|
28
|
+
}, onStdout: (chunk: string) => void) => {
|
|
29
|
+
agents: Record<string, {
|
|
30
|
+
description: string;
|
|
31
|
+
prompt: string;
|
|
32
|
+
model?: string;
|
|
33
|
+
}> | undefined;
|
|
34
|
+
pluginDirs: string[] | undefined;
|
|
35
|
+
cwd: string;
|
|
36
|
+
timeoutMs: number;
|
|
37
|
+
onStdout: (chunk: string) => void;
|
|
38
|
+
onStderr: (text: string) => void;
|
|
39
|
+
sandboxProvider: import("../claude/sandbox.types").SandboxProvider | null | undefined;
|
|
40
|
+
networkAllowlist: string[];
|
|
41
|
+
additionalWritePaths: string[];
|
|
42
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.commonInvokeOptions = exports.appendConstraintsAndTaste = exports.createStderrHandler = exports.prepareAgentsAndPlugins = void 0;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const agent_scan_1 = require("../discovery/agent.scan");
|
|
39
|
+
const plugin_scan_1 = require("../discovery/plugin.scan");
|
|
40
|
+
const output_1 = require("../../ui/output");
|
|
41
|
+
/**
|
|
42
|
+
* Discover agents and plugins, including the core hooks plugin in unsafe mode.
|
|
43
|
+
*/
|
|
44
|
+
const prepareAgentsAndPlugins = (config) => {
|
|
45
|
+
const builtinAgents = (0, agent_scan_1.discoverBuiltinAgents)();
|
|
46
|
+
const agents = (0, agent_scan_1.buildAgentsFlag)(builtinAgents);
|
|
47
|
+
const pluginDirs = (0, plugin_scan_1.discoverPluginDirs)(config);
|
|
48
|
+
if (config.unsafe && !config.sandboxProvider) {
|
|
49
|
+
const coreDir = (0, plugin_scan_1.getCorePluginDir)();
|
|
50
|
+
if (coreDir) {
|
|
51
|
+
pluginDirs.push({ dir: coreDir, createdPluginJson: false });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
agents: Object.keys(agents).length > 0 ? agents : undefined,
|
|
56
|
+
pluginDirs,
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
exports.prepareAgentsAndPlugins = prepareAgentsAndPlugins;
|
|
60
|
+
/**
|
|
61
|
+
* Create an onStderr callback that surfaces auth errors and critical messages.
|
|
62
|
+
*/
|
|
63
|
+
const createStderrHandler = (label) => {
|
|
64
|
+
const prefix = label ? `[${label}] ` : "";
|
|
65
|
+
return (text) => {
|
|
66
|
+
const lower = text.toLowerCase();
|
|
67
|
+
if (lower.includes("error") || lower.includes("auth") || lower.includes("unauthorized") || lower.includes("forbidden")) {
|
|
68
|
+
(0, output_1.printError)(`${prefix}claude stderr: ${text.trim()}`);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
exports.createStderrHandler = createStderrHandler;
|
|
73
|
+
/**
|
|
74
|
+
* Map PluginDir[] to string[] for invokeClaude, or undefined if empty.
|
|
75
|
+
*/
|
|
76
|
+
const pluginDirPaths = (dirs) => dirs.length > 0 ? dirs.map((p) => p.dir) : undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Append constraints.md and optional taste.md sections to a prompt sections array.
|
|
79
|
+
*/
|
|
80
|
+
const appendConstraintsAndTaste = (sections, config) => {
|
|
81
|
+
sections.push("## constraints.md\n");
|
|
82
|
+
sections.push(fs.readFileSync(config.constraintsPath, "utf-8"));
|
|
83
|
+
sections.push("");
|
|
84
|
+
if (config.tastePath) {
|
|
85
|
+
sections.push("## taste.md\n");
|
|
86
|
+
sections.push(fs.readFileSync(config.tastePath, "utf-8"));
|
|
87
|
+
sections.push("");
|
|
88
|
+
}
|
|
89
|
+
if (config.extraContext) {
|
|
90
|
+
sections.push("## Additional Context\n");
|
|
91
|
+
sections.push(config.extraContext);
|
|
92
|
+
sections.push("");
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
exports.appendConstraintsAndTaste = appendConstraintsAndTaste;
|
|
96
|
+
/**
|
|
97
|
+
* Build the common invokeClaude options shared across pipeline agents.
|
|
98
|
+
*/
|
|
99
|
+
const commonInvokeOptions = (config, prepared, onStdout) => ({
|
|
100
|
+
agents: prepared.agents,
|
|
101
|
+
pluginDirs: pluginDirPaths(prepared.pluginDirs),
|
|
102
|
+
cwd: config.worktreePath ?? process.cwd(),
|
|
103
|
+
timeoutMs: config.timeoutMinutes * 60 * 1000,
|
|
104
|
+
onStdout,
|
|
105
|
+
onStderr: (0, exports.createStderrHandler)(),
|
|
106
|
+
sandboxProvider: config.sandboxProvider,
|
|
107
|
+
networkAllowlist: config.networkAllowlist,
|
|
108
|
+
additionalWritePaths: [config.buildDir],
|
|
109
|
+
});
|
|
110
|
+
exports.commonInvokeOptions = commonInvokeOptions;
|
|
111
|
+
//# sourceMappingURL=pipeline.shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.shared.js","sourceRoot":"","sources":["../../../src/engine/pipeline/pipeline.shared.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6B;AAE7B,wDAAgF;AAChF,0DAA0F;AAC1F,4CAA4C;AAE5C;;GAEG;AACI,MAAM,uBAAuB,GAAG,CAAC,MAAuB,EAG7D,EAAE;IACF,MAAM,aAAa,GAAG,IAAA,kCAAqB,GAAE,CAAA;IAC7C,MAAM,MAAM,GAAG,IAAA,4BAAe,EAAC,aAAa,CAAC,CAAA;IAC7C,MAAM,UAAU,GAAG,IAAA,gCAAkB,EAAC,MAAM,CAAC,CAAA;IAE7C,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAA,8BAAgB,GAAE,CAAA;QAClC,IAAI,OAAO,EAAE,CAAC;YACZ,UAAU,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,CAAA;QAC7D,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,I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
5
|
-
}>;
|
|
1
|
+
import { RidgelineConfig } from "../../types";
|
|
2
|
+
/** Assemble the shared portion of the user prompt: spec, constraints, taste, target model. */
|
|
3
|
+
export declare const assembleBaseUserPrompt: (config: RidgelineConfig) => string;
|