opencode-swarm 7.81.3 → 7.82.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.
@@ -8,9 +8,9 @@
8
8
  * - Escalation tracking via escalation
9
9
  *
10
10
  * This module provides the createPrmHook factory that returns the toolAfter
11
- * handler used by the swarm hook system. PRM replaces loop-detector.ts for
12
- * repetition_loop detection, but loop-detector.ts is kept as a fast circuit
13
- * breaker for backward compatibility.
11
+ * handler used by the swarm hook system. PRM complements loop-detector.ts:
12
+ * loop-detector.ts remains the fast circuit breaker in guardrails/tool-before,
13
+ * while PRM provides deeper multi-pattern detection and escalation.
14
14
  */
15
15
  export { formatCourseCorrectionForInjection, generateCourseCorrection, } from './course-correction';
16
16
  export { createDefaultEscalationState, EscalationTracker } from './escalation';
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { createParallelDispatcher } from '../parallel/dispatcher/parallel-dispatcher.js';
3
3
  import { createSwarmTool } from './create-tool.js';
4
+ export declare const MAX_PROMPT_CHARS = 80000;
4
5
  declare const LaneSchema: z.ZodObject<{
5
6
  id: z.ZodString;
6
7
  agent: z.ZodString;
@@ -12,6 +13,7 @@ declare const DispatchLanesArgsSchema: z.ZodObject<{
12
13
  agent: z.ZodString;
13
14
  prompt: z.ZodString;
14
15
  }, z.core.$strip>>;
16
+ common_prompt: z.ZodOptional<z.ZodString>;
15
17
  max_concurrent: z.ZodOptional<z.ZodNumber>;
16
18
  timeout_ms: z.ZodOptional<z.ZodNumber>;
17
19
  }, z.core.$strip>;
@@ -21,6 +23,7 @@ declare const DispatchLanesAsyncArgsSchema: z.ZodObject<{
21
23
  agent: z.ZodString;
22
24
  prompt: z.ZodString;
23
25
  }, z.core.$strip>>;
26
+ common_prompt: z.ZodOptional<z.ZodString>;
24
27
  max_concurrent: z.ZodOptional<z.ZodNumber>;
25
28
  timeout_ms: z.ZodOptional<z.ZodNumber>;
26
29
  batch_id: z.ZodOptional<z.ZodString>;
@@ -190,10 +193,35 @@ export declare const _internals: {
190
193
  sleep: (ms: number) => Promise<void>;
191
194
  };
192
195
  export declare const _test_exports: {
196
+ applyCommonPrompt: typeof applyCommonPrompt;
193
197
  extractLastAssistantText: typeof extractLastAssistantText;
194
198
  formatError: typeof formatError;
195
199
  nextCollectPollInterval: typeof nextCollectPollInterval;
196
200
  promptHash: typeof promptHash;
201
+ DispatchLanesArgsSchema: z.ZodObject<{
202
+ lanes: z.ZodArray<z.ZodObject<{
203
+ id: z.ZodString;
204
+ agent: z.ZodString;
205
+ prompt: z.ZodString;
206
+ }, z.core.$strip>>;
207
+ common_prompt: z.ZodOptional<z.ZodString>;
208
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
209
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
210
+ }, z.core.$strip>;
211
+ DispatchLanesAsyncArgsSchema: z.ZodObject<{
212
+ lanes: z.ZodArray<z.ZodObject<{
213
+ id: z.ZodString;
214
+ agent: z.ZodString;
215
+ prompt: z.ZodString;
216
+ }, z.core.$strip>>;
217
+ common_prompt: z.ZodOptional<z.ZodString>;
218
+ max_concurrent: z.ZodOptional<z.ZodNumber>;
219
+ timeout_ms: z.ZodOptional<z.ZodNumber>;
220
+ batch_id: z.ZodOptional<z.ZodString>;
221
+ mode: z.ZodOptional<z.ZodString>;
222
+ pr_head_sha: z.ZodOptional<z.ZodString>;
223
+ scope: z.ZodOptional<z.ZodString>;
224
+ }, z.core.$strip>;
197
225
  };
198
226
  type ReadOnlyToolPermissions = Record<string, false> & {
199
227
  write: false;
@@ -217,6 +245,24 @@ declare function extractLastAssistantText(messages: Array<{
217
245
  }>;
218
246
  }>): string;
219
247
  declare function nextCollectPollInterval(currentMs: number): number;
248
+ type ApplyCommonPromptResult = {
249
+ ok: true;
250
+ lanes: DispatchLaneSpec[];
251
+ } | {
252
+ ok: false;
253
+ errors: string[];
254
+ };
255
+ /**
256
+ * Prepend an optional shared `common_prompt` to every lane prompt so callers can
257
+ * send large shared context once instead of inlining it into each lane (which
258
+ * bloats the tool-call payload and triggers truncated/malformed tool-call JSON).
259
+ * Returns an error when any assembled prompt exceeds the per-lane character limit.
260
+ *
261
+ * Always returns a fresh array the caller owns: a shallow copy of the originals
262
+ * when no `commonPrompt` is provided, or shallow-copied lanes with rewritten
263
+ * prompts when it is. Callers may treat the returned array as their own.
264
+ */
265
+ declare function applyCommonPrompt(lanes: DispatchLaneSpec[], commonPrompt: string | undefined): ApplyCommonPromptResult;
220
266
  declare function formatError(error: unknown): string;
221
267
  declare function promptHash(lane: DispatchLaneSpec, directory: string, batchId: string): string;
222
268
  export declare const dispatch_lanes: ReturnType<typeof createSwarmTool>;
@@ -45,7 +45,7 @@ export declare const TOOL_METADATA: {
45
45
  };
46
46
  imports: {
47
47
  description: string;
48
- agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "explorer" | "sme" | "critic" | "critic_oversight" | "architect" | "researcher" | "docs_design" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier")[];
48
+ agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "explorer" | "sme" | "critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_oversight" | "architect" | "researcher" | "docs_design")[];
49
49
  };
50
50
  lint: {
51
51
  description: string;
@@ -73,11 +73,11 @@ export declare const TOOL_METADATA: {
73
73
  };
74
74
  symbols: {
75
75
  description: string;
76
- agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic" | "critic_oversight" | "architect" | "researcher" | "docs_design" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "spec_writer")[];
76
+ agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_oversight" | "architect" | "researcher" | "docs_design" | "spec_writer")[];
77
77
  };
78
78
  complexity_hotspots: {
79
79
  description: string;
80
- agents: ("reviewer" | "test_engineer" | "explorer" | "sme" | "critic" | "critic_oversight" | "architect" | "researcher" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier")[];
80
+ agents: ("reviewer" | "test_engineer" | "explorer" | "sme" | "critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_oversight" | "architect" | "researcher")[];
81
81
  };
82
82
  schema_drift: {
83
83
  description: string;
@@ -121,7 +121,7 @@ export declare const TOOL_METADATA: {
121
121
  };
122
122
  pkg_audit: {
123
123
  description: string;
124
- agents: ("reviewer" | "test_engineer" | "critic_oversight" | "architect" | "critic_hallucination_verifier")[];
124
+ agents: ("reviewer" | "test_engineer" | "critic_hallucination_verifier" | "critic_oversight" | "architect")[];
125
125
  };
126
126
  test_runner: {
127
127
  description: string;
@@ -141,7 +141,7 @@ export declare const TOOL_METADATA: {
141
141
  };
142
142
  detect_domains: {
143
143
  description: string;
144
- agents: ("docs" | "explorer" | "sme" | "critic" | "critic_oversight" | "architect" | "docs_design" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier")[];
144
+ agents: ("docs" | "explorer" | "sme" | "critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_oversight" | "architect" | "docs_design")[];
145
145
  };
146
146
  git_blame: {
147
147
  description: string;
@@ -153,7 +153,7 @@ export declare const TOOL_METADATA: {
153
153
  };
154
154
  retrieve_summary: {
155
155
  description: string;
156
- agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic" | "critic_oversight" | "architect" | "docs_design" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_architecture_supervisor" | "spec_writer")[];
156
+ agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_architecture_supervisor" | "critic_oversight" | "architect" | "docs_design" | "spec_writer")[];
157
157
  };
158
158
  extract_code_blocks: {
159
159
  description: string;
@@ -217,7 +217,7 @@ export declare const TOOL_METADATA: {
217
217
  };
218
218
  knowledge_recall: {
219
219
  description: string;
220
- agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic" | "critic_oversight" | "architect" | "docs_design" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_architecture_supervisor" | "curator_init" | "curator_phase" | "skill_improver" | "spec_writer")[];
220
+ agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_architecture_supervisor" | "critic_oversight" | "architect" | "docs_design" | "curator_init" | "curator_phase" | "skill_improver" | "spec_writer")[];
221
221
  };
222
222
  knowledge_remove: {
223
223
  description: string;
@@ -229,11 +229,11 @@ export declare const TOOL_METADATA: {
229
229
  };
230
230
  search: {
231
231
  description: string;
232
- agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic_oversight" | "architect" | "researcher" | "docs_design" | "critic_hallucination_verifier" | "skill_improver" | "spec_writer")[];
232
+ agents: ("reviewer" | "test_engineer" | "coder" | "docs" | "designer" | "explorer" | "sme" | "critic_hallucination_verifier" | "critic_oversight" | "architect" | "researcher" | "docs_design" | "skill_improver" | "spec_writer")[];
233
233
  };
234
234
  batch_symbols: {
235
235
  description: string;
236
- agents: ("reviewer" | "explorer" | "critic_oversight" | "architect" | "critic_hallucination_verifier")[];
236
+ agents: ("reviewer" | "explorer" | "critic_hallucination_verifier" | "critic_oversight" | "architect")[];
237
237
  };
238
238
  suggest_patch: {
239
239
  description: string;
@@ -241,15 +241,15 @@ export declare const TOOL_METADATA: {
241
241
  };
242
242
  req_coverage: {
243
243
  description: string;
244
- agents: ("critic" | "critic_oversight" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "spec_writer")[];
244
+ agents: ("critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_oversight" | "spec_writer")[];
245
245
  };
246
246
  get_approved_plan: {
247
247
  description: string;
248
- agents: ("critic" | "critic_oversight" | "critic_drift_verifier")[];
248
+ agents: ("critic" | "critic_drift_verifier" | "critic_oversight")[];
249
249
  };
250
250
  repo_map: {
251
251
  description: string;
252
- agents: ("reviewer" | "coder" | "explorer" | "critic" | "critic_oversight" | "architect" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_architecture_supervisor")[];
252
+ agents: ("reviewer" | "coder" | "explorer" | "critic" | "critic_sounding_board" | "critic_drift_verifier" | "critic_hallucination_verifier" | "critic_architecture_supervisor" | "critic_oversight" | "architect")[];
253
253
  };
254
254
  get_qa_gate_profile: {
255
255
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.81.3",
3
+ "version": "7.82.0",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",