opencode-orchestra 0.0.0-stage → 1.1.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.
@@ -0,0 +1,175 @@
1
+ function renderAdditionalContextBlock(additionalContext) {
2
+ const trimmed = additionalContext?.trim();
3
+ if (!trimmed)
4
+ return "";
5
+ return `\n\n<additional_context>\n${trimmed}\n</additional_context>`;
6
+ }
7
+ function renderOrchestratorFeedbackBlock(feedback) {
8
+ const trimmed = feedback?.trim();
9
+ if (!trimmed)
10
+ return "";
11
+ return `\n\n<orchestrator_feedback>\n${trimmed}\n</orchestrator_feedback>`;
12
+ }
13
+ export function buildClassifyPrompt(task, additionalContext) {
14
+ return [
15
+ "Classify the following software engineering task into exactly one mode:",
16
+ "- `investigate`: pure root-cause analysis, tracing, explaining behavior, or auditing WITHOUT modifying files.",
17
+ "- `coder`: implementing features, fixing bugs, refactoring, optimizing code, or writing tests.",
18
+ "",
19
+ "Reply with ONLY one word: `investigate` or `coder`.",
20
+ "",
21
+ `<task>\n${task}\n</task>${renderAdditionalContextBlock(additionalContext)}`,
22
+ ].join("\n");
23
+ }
24
+ export function buildCoderWorkerL0Prompt(task, additionalContext) {
25
+ return `You are a Layer 0 coding worker in a multi-agent deep-reasoning pipeline.
26
+ Implement a complete, working solution for the task below.
27
+
28
+ <original_task>
29
+ ${task}
30
+ </original_task>${renderAdditionalContextBlock(additionalContext)}
31
+
32
+ ## Rules
33
+ 1. Explore the relevant files first; follow the project's existing conventions.
34
+ 2. Implement the fix/feature cleanly and write or update tests where appropriate.
35
+ 3. Actually run the build and test commands (do not claim verification you did not run).
36
+ 4. Be ruthlessly honest in your final report — never hide gaps or unverified edge cases.
37
+
38
+ ## Required Final Report Format
39
+ End your response with this exact structure:
40
+
41
+ > [!WARNING] **Skepticism Disclaimer**
42
+ > [One honest sentence on how confident you are and why. Do not be reassuring.]
43
+
44
+ ## 1. What I changed
45
+ [Files touched and the substance of each change.]
46
+
47
+ ## 2. Why
48
+ [Brief rationale tied to the task requirements.]
49
+
50
+ ## 3. Verification Record
51
+ - **Deep Verification (ran actual tests):** [exact commands run and observed results]
52
+ - **Shallow Verification (manual run / typecheck only):** [what was only checked statically or manually]
53
+ - **Unverified aspects:** [what you did NOT check — be exhaustive and honest]
54
+
55
+ ## 4. Known Issues
56
+ Prefix each with one of:
57
+ - \`Fatal Functional Bug\` — it does not work
58
+ - \`Shallow Verification\` — plausibly works, not properly tested
59
+ - \`Minor Robustness Risk\` — edge case, unlikely in practice
60
+ (Use "None" only if you genuinely ran tests that prove it.)
61
+
62
+ ## 5. Untested Edge Cases & Next Step
63
+ [What a skeptical reviewer should attack first.]`;
64
+ }
65
+ export function buildCoderImprovementPrompt(task, priorAttempt, round, additionalContext, spotCheckFeedback) {
66
+ return `You are Improvement Worker #${round} in a multi-agent deep-reasoning coding pipeline.
67
+ A previous worker has already attempted this task. Its code changes are already present in your workspace, and its report is provided inside <prior_attempt>.
68
+
69
+ Your job is to find what is wrong with the prior attempt and fix it.
70
+ You are NOT a rubber stamp. A review that finds nothing and changes nothing is almost always a failed review.
71
+
72
+ <original_task>
73
+ ${task}
74
+ </original_task>${renderAdditionalContextBlock(additionalContext)}${renderOrchestratorFeedbackBlock(spotCheckFeedback)}
75
+
76
+ <prior_attempt>
77
+ ${priorAttempt}
78
+ </prior_attempt>
79
+
80
+ ## Workflow
81
+
82
+ ### Step 1 — Understand the task independently FIRST
83
+ Read <original_task> and form your own understanding of all requirements BEFORE relying on <prior_attempt>.
84
+ Treat <prior_attempt> as an unverified hypothesis to test, not a statement of fact.
85
+
86
+ ### Step 2 — Break it
87
+ Approach the prior attempt as a skeptical reviewer trying to reject a pull request. Actually run the code; do not review by reading alone:
88
+ - Build the project and run the real test suite.
89
+ - Re-run anything the prior report claims it verified.
90
+ - Attack everything listed under "Unverified aspects", "Known Issues", and "Untested Edge Cases".
91
+ - Probe edge cases: empty/null inputs, boundaries, error paths, concurrency, unusual legal inputs.
92
+ - Verify every requirement in <original_task> is actually satisfied (watch for partial implementations or weakened/skipped tests).
93
+ For every problem you find, record: **input -> expected -> actual -> root cause**.
94
+
95
+ ### Step 3 — Fix
96
+ Fix everything you found. Prefer a correct, clean, minimal diff; rewrite the prior approach if it is fundamentally flawed.
97
+
98
+ ### Step 4 — Re-verify & Report
99
+ Re-run every failing scenario you found plus the full test suite, and report using the same structured format (What I changed, Why, Verification Record, Known Issues, Untested Edge Cases & Next Step) plus a **Flaws Found & Fixed** section.`;
100
+ }
101
+ export function buildInvestigatorWorkerL0Prompt(task, additionalContext) {
102
+ return `You are a Layer 0 investigator in a multi-agent deep-reasoning pipeline.
103
+ Your job is to perform a thorough, evidence-backed technical investigation of the task below WITHOUT modifying source files.
104
+
105
+ <original_task>
106
+ ${task}
107
+ </original_task>${renderAdditionalContextBlock(additionalContext)}
108
+
109
+ ## Rules
110
+ 1. Do not modify repository source files.
111
+ 2. Cite exact file paths, symbol names, line numbers, code snippets, and command outputs for every claim.
112
+ 3. Organize findings by subtopic if the question has multiple facets.
113
+ 4. Clearly separate observed facts from inferences.
114
+
115
+ ## Required Final Report Format
116
+ Include your detailed technical analysis, and end with a **"Remaining Questions & Gaps"** section listing:
117
+ - Questions or sub-topics you could not fully answer and why
118
+ - Areas where your evidence is weak or inconclusive
119
+ - Leads you identified but did not have time to follow
120
+ - What the next investigator should prioritize`;
121
+ }
122
+ export function buildInvestigatorImprovementPrompt(task, priorAttempt, round, additionalContext, spotCheckFeedback) {
123
+ return `You are Investigation Improvement Worker #${round} in a multi-agent deep-reasoning pipeline.
124
+ A previous worker has already investigated this topic. Its findings are provided inside <prior_attempt>.
125
+
126
+ Your job is to find what is wrong or incomplete in the prior investigation and produce a more comprehensive, accurate analysis.
127
+ You are NOT a rubber stamp. A review that finds nothing and changes nothing is almost always a failed review.
128
+
129
+ <original_task>
130
+ ${task}
131
+ </original_task>${renderAdditionalContextBlock(additionalContext)}${renderOrchestratorFeedbackBlock(spotCheckFeedback)}
132
+
133
+ <prior_attempt>
134
+ ${priorAttempt}
135
+ </prior_attempt>
136
+
137
+ ## Workflow
138
+
139
+ ### Step 1 — Understand the question independently FIRST
140
+ Read <original_task> and form your own understanding of what needs to be answered BEFORE trusting <prior_attempt>.
141
+ Treat <prior_attempt> as a hypothesis to test, not a statement of fact.
142
+
143
+ ### Step 2 — Challenge the prior findings
144
+ Approach the prior investigation as a skeptical reviewer:
145
+ - Re-read the code paths the prior investigator cited. Confirm their interpretation is correct.
146
+ - Check if file paths, line numbers, and code snippets actually exist and say what the report claims.
147
+ - Attack everything listed under "Remaining Questions & Gaps".
148
+ - Look for alternative explanations, missing call sites, or unfollowed code paths.
149
+ - Check for logical leaps where evidence does not support the conclusion.
150
+ For every problem you find, record: **claim -> evidence cited -> what the code actually shows -> corrected finding**.
151
+
152
+ ### Step 3 — Fill gaps and correct
153
+ Investigate what the prior worker missed and resolve open questions with concrete evidence.
154
+
155
+ ### Step 4 — Synthesize
156
+ Produce a unified, comprehensive answer combining verified findings with your own research. Every claim must cite specific files, line numbers, and code snippets. Clearly highlight any remaining uncertainty.`;
157
+ }
158
+ export function buildOrchestratorVerifyPrompt(task, mode, finalReport, additionalContext) {
159
+ return `You are the Boost Orchestrator performing an independent final spot-check (${mode} pipeline).
160
+
161
+ <original_task>
162
+ ${task}
163
+ </original_task>${renderAdditionalContextBlock(additionalContext)}
164
+
165
+ <candidate_report>
166
+ ${finalReport}
167
+ </candidate_report>
168
+
169
+ ## Instructions
170
+ 1. Spot-check the workspace (for coder tasks, check modified files / git diff / test output; for investigate tasks, verify key cited files/symbols exist).
171
+ 2. Check whether every requirement in <original_task> is addressed and whether any fatal bug or unverified critical claim remains.
172
+ 3. Respond with:
173
+ - First line: \`VERDICT: PASS\` if the solution/investigation is solid and complete, OR \`VERDICT: FAIL\` if another improvement round is needed.
174
+ - Followed by a concise explanation of what you verified and any remaining gaps.`;
175
+ }
@@ -0,0 +1,77 @@
1
+ import { type PluginStorage } from "./board.js";
2
+ export declare const READ_ONLY_STRIPPED_TOOLS: readonly ["write", "edit", "patch", "multiedit", "apply_patch", "notebook_edit", "bash", "shell", "sh", "exec", "terminal", "run_command"];
3
+ export interface SwarmWorkerMeta {
4
+ boardId: string;
5
+ workerId: string;
6
+ lastSeenSeq: number;
7
+ parkGuardCount: number;
8
+ }
9
+ export type CoordinatorRole = "boost" | "teamwork" | "swarm";
10
+ export interface CoordinatorSessionMeta {
11
+ role: CoordinatorRole;
12
+ directive?: string;
13
+ registeredAt: number;
14
+ injections: number;
15
+ maxInjections: number;
16
+ ttlMs: number;
17
+ }
18
+ export interface RegisterCoordinatorOptions {
19
+ directive?: string;
20
+ maxInjections?: number;
21
+ ttlMs?: number;
22
+ now?: number;
23
+ }
24
+ export declare function registerCoordinatorSession(sessionID: string, role: CoordinatorRole, options?: RegisterCoordinatorOptions): void;
25
+ export declare function unregisterCoordinatorSession(sessionID: string): void;
26
+ export declare function isCoordinatorSession(sessionID: string, now?: number): boolean;
27
+ /**
28
+ * Clears coordinator session state on `experimental.idle`:
29
+ * - Immediately clears `boost` and `swarm` (single-turn dispatch; if idle without
30
+ * calling the tool, the slash command was abandoned).
31
+ * - Preserves `teamwork` across idle turns (scoping Q&A) until TTL/maxInjections.
32
+ */
33
+ export declare function clearCoordinatorOnIdle(sessionID: string, now?: number): boolean;
34
+ export declare function registerReadOnlySession(sessionID: string): void;
35
+ export declare function unregisterReadOnlySession(sessionID: string): void;
36
+ export declare function isReadOnlySession(sessionID: string): boolean;
37
+ export declare function resetSessionRegistry(): void;
38
+ export declare function registerSwarmWorkerSession(sessionID: string, boardId: string, workerId: string, initialSeenSeq?: number): void;
39
+ export declare function unregisterSwarmWorkerSession(sessionID: string): void;
40
+ export declare function getSwarmWorkerSession(sessionID: string): SwarmWorkerMeta | undefined;
41
+ export declare function markSwarmWorkerRead(boardId: string, workerId: string, seq: number): void;
42
+ /**
43
+ * Advances a worker's `lastSeenSeq` to `postSeq` after posting its own message,
44
+ * only when the worker was already caught up (`lastSeenSeq === postSeq - 1`),
45
+ * preventing self-notification noise without skipping unread peer posts.
46
+ */
47
+ export declare function advanceSwarmWorkerOnOwnPost(boardId: string, workerId: string, postSeq: number): void;
48
+ export interface ContextHookEventLike {
49
+ readonly sessionID: string;
50
+ system: Array<{
51
+ type: string;
52
+ text?: string;
53
+ }>;
54
+ tools: Record<string, unknown>;
55
+ }
56
+ /**
57
+ * Runtime enforcement hook for `ctx.session.hook("context", ...)`:
58
+ * 1. Strips mutating file-edit tools from read-only worker sessions.
59
+ * 2. Injects live Swarm board-head status into active Swarm worker sessions.
60
+ */
61
+ export declare function applyContextHook(event: ContextHookEventLike, storage?: PluginStorage, now?: number): Promise<void>;
62
+ export interface IdleHookEventLike {
63
+ readonly sessionID: string;
64
+ }
65
+ export interface SyntheticDispatcher {
66
+ synthetic(input: {
67
+ sessionID: string;
68
+ text: string;
69
+ resume?: boolean;
70
+ }): Promise<unknown>;
71
+ }
72
+ /**
73
+ * Runtime park-guard for `ctx.session.hook("experimental.idle", ...)`:
74
+ * Prevents a Swarm worker from going idle prematurely when unread peer
75
+ * messages addressed to it (or "all") exist on the shared board.
76
+ */
77
+ export declare function applyIdleParkGuardHook(event: IdleHookEventLike, storage: PluginStorage | undefined, dispatcher: SyntheticDispatcher | undefined): Promise<boolean>;
@@ -0,0 +1,200 @@
1
+ import { checkPeerWait, getBoardHead } from "./board.js";
2
+ export const READ_ONLY_STRIPPED_TOOLS = [
3
+ "write",
4
+ "edit",
5
+ "patch",
6
+ "multiedit",
7
+ "apply_patch",
8
+ "notebook_edit",
9
+ "bash",
10
+ "shell",
11
+ "sh",
12
+ "exec",
13
+ "terminal",
14
+ "run_command",
15
+ ];
16
+ const MAX_PARK_GUARD_WAKES = 2;
17
+ const DEFAULT_COORDINATOR_TTL_MS = 10 * 60 * 1000;
18
+ const DEFAULT_COORDINATOR_MAX_INJECTIONS = {
19
+ boost: 4,
20
+ swarm: 4,
21
+ teamwork: 8,
22
+ };
23
+ const readOnlySessions = new Set();
24
+ const swarmWorkerSessions = new Map();
25
+ const coordinatorSessions = new Map();
26
+ function isCoordinatorExpired(meta, now) {
27
+ return (now - meta.registeredAt >= meta.ttlMs ||
28
+ meta.injections >= meta.maxInjections);
29
+ }
30
+ export function registerCoordinatorSession(sessionID, role, options) {
31
+ coordinatorSessions.set(sessionID, {
32
+ role,
33
+ directive: options?.directive,
34
+ registeredAt: options?.now ?? Date.now(),
35
+ injections: 0,
36
+ maxInjections: options?.maxInjections ?? DEFAULT_COORDINATOR_MAX_INJECTIONS[role],
37
+ ttlMs: options?.ttlMs ?? DEFAULT_COORDINATOR_TTL_MS,
38
+ });
39
+ }
40
+ export function unregisterCoordinatorSession(sessionID) {
41
+ coordinatorSessions.delete(sessionID);
42
+ }
43
+ export function isCoordinatorSession(sessionID, now = Date.now()) {
44
+ const meta = coordinatorSessions.get(sessionID);
45
+ if (!meta)
46
+ return false;
47
+ if (isCoordinatorExpired(meta, now)) {
48
+ coordinatorSessions.delete(sessionID);
49
+ return false;
50
+ }
51
+ return true;
52
+ }
53
+ /**
54
+ * Clears coordinator session state on `experimental.idle`:
55
+ * - Immediately clears `boost` and `swarm` (single-turn dispatch; if idle without
56
+ * calling the tool, the slash command was abandoned).
57
+ * - Preserves `teamwork` across idle turns (scoping Q&A) until TTL/maxInjections.
58
+ */
59
+ export function clearCoordinatorOnIdle(sessionID, now = Date.now()) {
60
+ const meta = coordinatorSessions.get(sessionID);
61
+ if (!meta)
62
+ return false;
63
+ if (meta.role === "boost" ||
64
+ meta.role === "swarm" ||
65
+ isCoordinatorExpired(meta, now)) {
66
+ coordinatorSessions.delete(sessionID);
67
+ return true;
68
+ }
69
+ return false;
70
+ }
71
+ export function registerReadOnlySession(sessionID) {
72
+ readOnlySessions.add(sessionID);
73
+ }
74
+ export function unregisterReadOnlySession(sessionID) {
75
+ readOnlySessions.delete(sessionID);
76
+ }
77
+ export function isReadOnlySession(sessionID) {
78
+ return readOnlySessions.has(sessionID);
79
+ }
80
+ export function resetSessionRegistry() {
81
+ readOnlySessions.clear();
82
+ swarmWorkerSessions.clear();
83
+ coordinatorSessions.clear();
84
+ }
85
+ export function registerSwarmWorkerSession(sessionID, boardId, workerId, initialSeenSeq = 0) {
86
+ swarmWorkerSessions.set(sessionID, {
87
+ boardId,
88
+ workerId,
89
+ lastSeenSeq: initialSeenSeq,
90
+ parkGuardCount: 0,
91
+ });
92
+ }
93
+ export function unregisterSwarmWorkerSession(sessionID) {
94
+ swarmWorkerSessions.delete(sessionID);
95
+ }
96
+ export function getSwarmWorkerSession(sessionID) {
97
+ return swarmWorkerSessions.get(sessionID);
98
+ }
99
+ export function markSwarmWorkerRead(boardId, workerId, seq) {
100
+ for (const meta of swarmWorkerSessions.values()) {
101
+ if (meta.boardId === boardId && meta.workerId === workerId) {
102
+ if (seq > meta.lastSeenSeq) {
103
+ meta.lastSeenSeq = seq;
104
+ }
105
+ }
106
+ }
107
+ }
108
+ /**
109
+ * Advances a worker's `lastSeenSeq` to `postSeq` after posting its own message,
110
+ * only when the worker was already caught up (`lastSeenSeq === postSeq - 1`),
111
+ * preventing self-notification noise without skipping unread peer posts.
112
+ */
113
+ export function advanceSwarmWorkerOnOwnPost(boardId, workerId, postSeq) {
114
+ for (const meta of swarmWorkerSessions.values()) {
115
+ if (meta.boardId === boardId &&
116
+ meta.workerId === workerId &&
117
+ meta.lastSeenSeq === postSeq - 1) {
118
+ meta.lastSeenSeq = postSeq;
119
+ }
120
+ }
121
+ }
122
+ /**
123
+ * Runtime enforcement hook for `ctx.session.hook("context", ...)`:
124
+ * 1. Strips mutating file-edit tools from read-only worker sessions.
125
+ * 2. Injects live Swarm board-head status into active Swarm worker sessions.
126
+ */
127
+ export async function applyContextHook(event, storage, now = Date.now()) {
128
+ if (readOnlySessions.has(event.sessionID)) {
129
+ for (const toolName of READ_ONLY_STRIPPED_TOOLS) {
130
+ if (toolName in event.tools) {
131
+ delete event.tools[toolName];
132
+ }
133
+ }
134
+ }
135
+ const coordinatorMeta = coordinatorSessions.get(event.sessionID);
136
+ if (coordinatorMeta) {
137
+ if (isCoordinatorExpired(coordinatorMeta, now)) {
138
+ coordinatorSessions.delete(event.sessionID);
139
+ }
140
+ else {
141
+ coordinatorMeta.injections += 1;
142
+ event.system.push({
143
+ type: "text",
144
+ text: coordinatorMeta.directive ?? `[Orchestrator Role Reminder (${coordinatorMeta.role})] Delegate to the \`${coordinatorMeta.role}\` tool. Once dispatched, tell the user what is running and end this turn without waiting. When a completion arrives, distrust its claims and verify against primary evidence before reporting.`,
145
+ });
146
+ if (coordinatorMeta.injections >= coordinatorMeta.maxInjections) {
147
+ coordinatorSessions.delete(event.sessionID);
148
+ }
149
+ }
150
+ }
151
+ const swarmMeta = swarmWorkerSessions.get(event.sessionID);
152
+ if (swarmMeta && storage) {
153
+ try {
154
+ const head = await getBoardHead(storage, swarmMeta.boardId);
155
+ if (head.latestSeq > swarmMeta.lastSeenSeq) {
156
+ event.system.push({
157
+ type: "text",
158
+ text: `[Swarm Board Update] boardId="${swarmMeta.boardId}" now has latestSeq=${head.latestSeq} (totalPosts=${head.totalPosts}, authors=${head.authors.join(", ")}). Call swarm_board_read(boardId="${swarmMeta.boardId}", afterSeq=${swarmMeta.lastSeenSeq}) if you need peer updates.`,
159
+ });
160
+ }
161
+ }
162
+ catch {
163
+ // Non-fatal board head check
164
+ }
165
+ }
166
+ }
167
+ /**
168
+ * Runtime park-guard for `ctx.session.hook("experimental.idle", ...)`:
169
+ * Prevents a Swarm worker from going idle prematurely when unread peer
170
+ * messages addressed to it (or "all") exist on the shared board.
171
+ */
172
+ export async function applyIdleParkGuardHook(event, storage, dispatcher) {
173
+ const swarmMeta = swarmWorkerSessions.get(event.sessionID);
174
+ if (!swarmMeta || !storage || !dispatcher) {
175
+ return false;
176
+ }
177
+ if (swarmMeta.parkGuardCount >= MAX_PARK_GUARD_WAKES) {
178
+ return false;
179
+ }
180
+ try {
181
+ const status = await checkPeerWait(storage, swarmMeta.boardId, swarmMeta.workerId, swarmMeta.lastSeenSeq);
182
+ if (!status.hasUnreadPeerActivity) {
183
+ return false;
184
+ }
185
+ swarmMeta.lastSeenSeq = status.latestSeq;
186
+ swarmMeta.parkGuardCount += 1;
187
+ const formatted = status.unreadForWorker
188
+ .map((p) => `#${p.seq} [@${p.author}${p.to ? ` -> @${p.to}` : ""}]: ${p.message}`)
189
+ .join("\n");
190
+ await dispatcher.synthetic({
191
+ sessionID: event.sessionID,
192
+ text: `[Swarm Park-Guard] Before finalizing, review these unread peer board messages for ${swarmMeta.workerId} (boardId="${swarmMeta.boardId}"):\n${formatted}\n\nIncorporate any relevant findings or handoffs into your final report.`,
193
+ resume: true,
194
+ });
195
+ return true;
196
+ }
197
+ catch {
198
+ return false;
199
+ }
200
+ }
@@ -0,0 +1,61 @@
1
+ import { type PluginStorage } from "./board.js";
2
+ import { type ModelRef, type ResolvedSwarmMode, type SwarmMode } from "./parser.js";
3
+ import { type BoostSessionClient } from "./pipeline.js";
4
+ export interface SwarmWorktreeClient {
5
+ create(input: {
6
+ projectID: string;
7
+ name?: string;
8
+ }): Promise<{
9
+ directory: string;
10
+ branch?: string;
11
+ }>;
12
+ remove(input: {
13
+ projectID: string;
14
+ directory: string;
15
+ force: boolean;
16
+ }): Promise<void>;
17
+ }
18
+ export interface SwarmPipelineOptions {
19
+ sessionID: string;
20
+ task: string;
21
+ additionalContext?: string;
22
+ mode?: SwarmMode;
23
+ workers?: number;
24
+ useWorktree?: boolean;
25
+ projectID?: string;
26
+ storage?: PluginStorage;
27
+ worktree?: SwarmWorktreeClient;
28
+ modelOverride?: ModelRef;
29
+ onProgress?: (status: string) => void | Promise<void>;
30
+ signal?: AbortSignal;
31
+ }
32
+ export interface SwarmWorkerRecord {
33
+ id: string;
34
+ slice: string;
35
+ status: "completed" | "failed";
36
+ sessionID?: string;
37
+ worktreeDirectory?: string;
38
+ worktreeFallback?: boolean;
39
+ output?: string;
40
+ error?: string;
41
+ }
42
+ export interface SwarmPipelineResult {
43
+ boardId: string;
44
+ boardPostsCount: number;
45
+ worktreesUsed: number;
46
+ mode: ResolvedSwarmMode;
47
+ workerCount: number;
48
+ succeededWorkers: number;
49
+ failedWorkers: number;
50
+ childSessionIDs: string[];
51
+ blackboard: string;
52
+ report: string;
53
+ }
54
+ export declare function buildSwarmClassifyPrompt(task: string): string;
55
+ export declare function buildSwarmSlicePlannerPrompt(task: string, workerCount: number, additionalContext?: string): string;
56
+ export declare function buildSwarmWorkerPrompt(task: string, workerId: string, slice: string, stageLabel: string, boardId?: string, additionalContext?: string): string;
57
+ export declare function buildSwarmCritiqueWorkerPrompt(task: string, blackboard: string, stage1Outputs: string, additionalContext?: string): string;
58
+ export declare function buildSwarmSentinelPrompt(task: string, blackboard: string, stage1Outputs: string, additionalContext?: string): string;
59
+ export declare function buildSwarmSynthesizerPrompt(task: string, mode: ResolvedSwarmMode, blackboard: string, workerOutputs: string, critiqueReport?: string, additionalContext?: string): string;
60
+ export declare function renderSwarmBlackboard(task: string, mode: ResolvedSwarmMode, records: readonly SwarmWorkerRecord[], stage2Status?: string): string;
61
+ export declare function runSwarmPipeline(sessionClient: BoostSessionClient, options: SwarmPipelineOptions): Promise<SwarmPipelineResult>;