opencode-swarm 7.17.1 → 7.17.3

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/cli/index.js CHANGED
@@ -34,7 +34,7 @@ var package_default;
34
34
  var init_package = __esm(() => {
35
35
  package_default = {
36
36
  name: "opencode-swarm",
37
- version: "7.17.1",
37
+ version: "7.17.3",
38
38
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
39
  main: "dist/index.js",
40
40
  types: "dist/index.d.ts",
@@ -51420,7 +51420,7 @@ async function handleTurboCommand(directory, args, sessionID) {
51420
51420
  if (arg0 === "on") {
51421
51421
  let strategy = "standard";
51422
51422
  try {
51423
- const { config: config3 } = loadPluginConfigWithMeta(directory);
51423
+ const { config: config3 } = _internals25.loadPluginConfigWithMeta(directory);
51424
51424
  if (config3.turbo?.strategy === "lean") {
51425
51425
  strategy = "lean";
51426
51426
  }
@@ -51475,7 +51475,7 @@ function enableLeanTurbo(session, directory, sessionID) {
51475
51475
  let maxParallelCoders = 4;
51476
51476
  let conflictPolicy = "serialize";
51477
51477
  try {
51478
- const { config: config3 } = loadPluginConfigWithMeta(directory);
51478
+ const { config: config3 } = _internals25.loadPluginConfigWithMeta(directory);
51479
51479
  const leanConfig = config3.turbo?.lean;
51480
51480
  if (leanConfig) {
51481
51481
  maxParallelCoders = leanConfig.max_parallel_coders ?? 4;
@@ -51545,11 +51545,15 @@ function buildStatusMessage(session, directory, sessionID) {
51545
51545
  ].join(`
51546
51546
  `);
51547
51547
  }
51548
+ var _internals25;
51548
51549
  var init_turbo = __esm(() => {
51549
51550
  init_config();
51550
51551
  init_state();
51551
51552
  init_state3();
51552
51553
  init_logger();
51554
+ _internals25 = {
51555
+ loadPluginConfigWithMeta
51556
+ };
51553
51557
  });
51554
51558
 
51555
51559
  // src/commands/write-retro.ts
@@ -51802,7 +51806,7 @@ function createSwarmCommandHandler(directory, agents) {
51802
51806
  const attemptedCommand = tokens[0] || "";
51803
51807
  const MAX_DISPLAY = 100;
51804
51808
  const displayCommand = attemptedCommand.length > MAX_DISPLAY ? `${attemptedCommand.slice(0, MAX_DISPLAY)}...` : attemptedCommand;
51805
- const similar = _internals25.findSimilarCommands(attemptedCommand);
51809
+ const similar = _internals26.findSimilarCommands(attemptedCommand);
51806
51810
  const header = `Command \`/swarm ${displayCommand}\` not found.`;
51807
51811
  const suggestions = similar.length > 0 ? `Did you mean:
51808
51812
  ${similar.map((cmd) => ` \u2022 /swarm ${cmd}`).join(`
@@ -51909,7 +51913,7 @@ function findSimilarCommands(query) {
51909
51913
  }
51910
51914
  const scored = VALID_COMMANDS.map((cmd) => {
51911
51915
  const cmdLower = cmd.toLowerCase();
51912
- const fullScore = _internals25.levenshteinDistance(q, cmdLower);
51916
+ const fullScore = _internals26.levenshteinDistance(q, cmdLower);
51913
51917
  let tokenScore = Infinity;
51914
51918
  if (cmd.includes(" ") || cmd.includes("-")) {
51915
51919
  const qTokens = q.split(/[\s-]+/);
@@ -51922,7 +51926,7 @@ function findSimilarCommands(query) {
51922
51926
  for (const ct of cmdTokens) {
51923
51927
  if (ct.length === 0)
51924
51928
  continue;
51925
- const dist = _internals25.levenshteinDistance(qt, ct);
51929
+ const dist = _internals26.levenshteinDistance(qt, ct);
51926
51930
  if (dist < minDist)
51927
51931
  minDist = dist;
51928
51932
  }
@@ -51932,7 +51936,7 @@ function findSimilarCommands(query) {
51932
51936
  }
51933
51937
  const dashStrippedQ = q.replace(/-/g, "");
51934
51938
  const dashStrippedCmd = cmdLower.replace(/-/g, "");
51935
- const dashScore = _internals25.levenshteinDistance(dashStrippedQ, dashStrippedCmd);
51939
+ const dashScore = _internals26.levenshteinDistance(dashStrippedQ, dashStrippedCmd);
51936
51940
  const score = Math.min(fullScore, tokenScore, dashScore);
51937
51941
  return { cmd, score };
51938
51942
  });
@@ -51964,11 +51968,11 @@ async function handleHelpCommand(ctx) {
51964
51968
  return buildHelpText2();
51965
51969
  }
51966
51970
  const tokens = targetCommand.split(/\s+/);
51967
- const resolved = _internals25.resolveCommand(tokens);
51971
+ const resolved = _internals26.resolveCommand(tokens);
51968
51972
  if (resolved) {
51969
- return _internals25.buildDetailedHelp(resolved.key, resolved.entry);
51973
+ return _internals26.buildDetailedHelp(resolved.key, resolved.entry);
51970
51974
  }
51971
- const similar = _internals25.findSimilarCommands(targetCommand);
51975
+ const similar = _internals26.findSimilarCommands(targetCommand);
51972
51976
  const { buildHelpText: fullHelp } = await Promise.resolve().then(() => (init_commands(), exports_commands));
51973
51977
  if (similar.length > 0) {
51974
51978
  return `Command '/swarm ${targetCommand}' not found.
@@ -52062,7 +52066,7 @@ function resolveCommand(tokens) {
52062
52066
  }
52063
52067
  return null;
52064
52068
  }
52065
- var COMMAND_REGISTRY, VALID_COMMANDS, _internals25, validation;
52069
+ var COMMAND_REGISTRY, VALID_COMMANDS, _internals26, validation;
52066
52070
  var init_registry = __esm(() => {
52067
52071
  init_acknowledge_spec_drift();
52068
52072
  init_agents();
@@ -52132,7 +52136,7 @@ var init_registry = __esm(() => {
52132
52136
  clashesWithNativeCcCommand: "/agents"
52133
52137
  },
52134
52138
  help: {
52135
- handler: (ctx) => _internals25.handleHelpCommand(ctx),
52139
+ handler: (ctx) => _internals26.handleHelpCommand(ctx),
52136
52140
  description: "Show help for swarm commands",
52137
52141
  category: "core",
52138
52142
  args: "[command]",
@@ -52431,9 +52435,24 @@ var init_registry = __esm(() => {
52431
52435
  },
52432
52436
  turbo: {
52433
52437
  handler: (ctx) => handleTurboCommand(ctx.directory, ctx.args, ctx.sessionID),
52434
- description: "Toggle Turbo Mode for the active session [on|off]",
52435
- args: "on, off",
52436
- details: 'Toggles Turbo Mode which skips non-critical QA gates for faster iteration. When enabled, the architect can proceed without waiting for all automated checks. Session-scoped \u2014 resets on new session. Use "on" or "off" to set explicitly, or toggle with no argument.',
52438
+ description: "Toggle Turbo Mode strategy for the active session [on|off|lean|standard|status]",
52439
+ args: "on, off, lean, standard, status",
52440
+ details: `Toggles Turbo Mode for the current session. Supports two strategies:
52441
+
52442
+ ` + `**Standard turbo** \u2014 skips non-critical QA gates for faster iteration.
52443
+ ` + `**Lean turbo** \u2014 parallel lane execution with per-lane reviewer gates and file-lock conflict detection.
52444
+ ` + `
52445
+ Subcommands:
52446
+ ` + ` turbo on \u2014 enable turbo (uses lean when config turbo.strategy is "lean", otherwise standard)
52447
+ ` + ` turbo off \u2014 disable all turbo modes
52448
+ ` + ` turbo lean on \u2014 enable Lean Turbo explicitly
52449
+ ` + ` turbo lean off \u2014 disable Lean Turbo
52450
+ ` + ` turbo lean \u2014 toggle Lean Turbo on/off
52451
+ ` + ` turbo standard on \u2014 force standard turbo (disables lean even if config says lean)
52452
+ ` + ` turbo standard off \u2014 disable standard turbo (falls back to lean if config strategy is lean)
52453
+ ` + ` turbo status \u2014 show detailed status including active strategy and lanes
52454
+ ` + `
52455
+ ` + "Session-scoped \u2014 resets on new session.",
52437
52456
  category: "utility"
52438
52457
  },
52439
52458
  "full-auto": {
@@ -52489,7 +52508,7 @@ var init_registry = __esm(() => {
52489
52508
  }
52490
52509
  };
52491
52510
  VALID_COMMANDS = Object.keys(COMMAND_REGISTRY);
52492
- _internals25 = {
52511
+ _internals26 = {
52493
52512
  handleHelpCommand,
52494
52513
  validateAliases,
52495
52514
  resolveCommand,
@@ -52497,7 +52516,7 @@ var init_registry = __esm(() => {
52497
52516
  findSimilarCommands,
52498
52517
  buildDetailedHelp
52499
52518
  };
52500
- validation = _internals25.validateAliases();
52519
+ validation = _internals26.validateAliases();
52501
52520
  if (!validation.valid) {
52502
52521
  throw new Error(`COMMAND_REGISTRY alias validation failed:
52503
52522
  ${validation.errors.join(`
@@ -366,9 +366,9 @@ export declare const COMMAND_REGISTRY: {
366
366
  };
367
367
  readonly turbo: {
368
368
  readonly handler: (ctx: CommandContext) => Promise<string>;
369
- readonly description: "Toggle Turbo Mode for the active session [on|off]";
370
- readonly args: "on, off";
371
- readonly details: "Toggles Turbo Mode which skips non-critical QA gates for faster iteration. When enabled, the architect can proceed without waiting for all automated checks. Session-scoped — resets on new session. Use \"on\" or \"off\" to set explicitly, or toggle with no argument.";
369
+ readonly description: "Toggle Turbo Mode strategy for the active session [on|off|lean|standard|status]";
370
+ readonly args: "on, off, lean, standard, status";
371
+ readonly details: string;
372
372
  readonly category: "utility";
373
373
  };
374
374
  readonly 'full-auto': {
@@ -1,3 +1,14 @@
1
+ import { loadPluginConfigWithMeta } from '../config';
2
+ /**
3
+ * Test-only dependency-injection seam. Production code calls
4
+ * `_internals.loadPluginConfigWithMeta(...)` so tests can replace the function
5
+ * on this object without using `mock.module` from `bun:test`, which leaks
6
+ * across files in Bun's shared test-runner process (AGENTS.md §7).
7
+ * Mutating this local object is file-scoped and trivially restorable via afterEach.
8
+ */
9
+ export declare const _internals: {
10
+ loadPluginConfigWithMeta: typeof loadPluginConfigWithMeta;
11
+ };
1
12
  /**
2
13
  * Handles the /swarm turbo command.
3
14
  * Supports standard turbo toggle, lean turbo mode, and status reporting.
@@ -8,7 +8,7 @@
8
8
  * No I/O — fully unit-testable with mock inputs. All file reads/writes happen in
9
9
  * sibling modules (criteria-store, council-evidence-writer).
10
10
  */
11
- import type { CouncilConfig, CouncilCriteria, CouncilMemberVerdict, CouncilSynthesis, PhaseCouncilSynthesis } from './types';
11
+ import type { CouncilConfig, CouncilCriteria, CouncilMemberVerdict, CouncilSynthesis, FinalCouncilSynthesis, PhaseCouncilSynthesis } from './types';
12
12
  export declare function synthesizeCouncilVerdicts(taskId: string, swarmId: string, verdicts: CouncilMemberVerdict[], criteria: CouncilCriteria | null, roundNumber: number, config?: Partial<CouncilConfig>): CouncilSynthesis;
13
13
  /**
14
14
  * Synthesize phase-level council verdicts into a PhaseCouncilSynthesis.
@@ -19,3 +19,9 @@ export declare function synthesizeCouncilVerdicts(taskId: string, swarmId: strin
19
19
  * (see writePhaseCouncilEvidence in submit-phase-council-verdicts.ts).
20
20
  */
21
21
  export declare function synthesizePhaseCouncilAdvisory(phaseNumber: number, phaseSummary: string, verdicts: CouncilMemberVerdict[], roundNumber: number, config?: Partial<CouncilConfig>, _workingDir?: string): PhaseCouncilSynthesis;
22
+ /**
23
+ * Synthesize project-level final council verdicts into a FinalCouncilSynthesis.
24
+ * This uses the same five-member verdict semantics as phase council, but the
25
+ * output is scoped to completed-project review and the final_council gate.
26
+ */
27
+ export declare function synthesizeFinalCouncilAdvisory(projectSummary: string, verdicts: CouncilMemberVerdict[], roundNumber: number, config?: Partial<CouncilConfig>): FinalCouncilSynthesis;
@@ -87,6 +87,38 @@ export interface PhaseCouncilSynthesis {
87
87
  /** Summary of the phase being reviewed */
88
88
  phaseSummary?: string;
89
89
  }
90
+ /**
91
+ * Project-level final council synthesis result.
92
+ * Distinct from task-level and phase-level council results: this is the
93
+ * final project close gate and writes to .swarm/evidence/final-council.json.
94
+ */
95
+ export interface FinalCouncilSynthesis {
96
+ /** Always 'project' - distinguishes final council from task/phase councils */
97
+ scope: 'project';
98
+ /** ISO 8601 */
99
+ timestamp: string;
100
+ overallVerdict: CouncilVerdict;
101
+ vetoedBy: CouncilAgent[] | null;
102
+ memberVerdicts: CouncilMemberVerdict[];
103
+ unresolvedConflicts: string[];
104
+ /** Severity HIGH + MEDIUM from veto members */
105
+ requiredFixes: CouncilFinding[];
106
+ /** Severity LOW or from non-veto members */
107
+ advisoryFindings: CouncilFinding[];
108
+ /** Project-level advisory notes for the architect */
109
+ advisoryNotes: string[];
110
+ /** Single markdown document for final project review */
111
+ unifiedFeedbackMd: string;
112
+ /** 1-indexed */
113
+ roundNumber: number;
114
+ allCriteriaMet: boolean;
115
+ /** Distinct council members that produced verdicts */
116
+ quorumSize: number;
117
+ /** Path where evidence was written */
118
+ evidencePath: '.swarm/evidence/final-council.json';
119
+ /** Summary of the completed project being reviewed */
120
+ projectSummary: string;
121
+ }
90
122
  export interface CouncilCriteriaItem {
91
123
  id: string;
92
124
  description: string;